[УКР](https://hackmd.io/Fo0-oeZ4Sz-Gju6Qg01hiA) | ENG

:arrow_left: [Guide](https://hackmd.io/QA2NYRliRLGviJl5P4-ZCw)
# [20404] Get Card Data by Token
*What is "Token Payment" and how the cards are tokenized, see in the section ["Token Payment"](https://hackmd.io/hELnx1lqQwS9RiactYbLEA).*
## Usage
Request [20404] is used to get card data for re-interacting with the client. For this purpose, the the client's card token is transmitted. In response, the Operator sends the client's card data stored on the server.
## Request
*See the description of the "Partner", "KeyAES" and "Sign" attributes in the section "[General API Integration Information](https://hackmd.io/ijxPm0xtTpycgTjuU_NHQQ)".*
### Data Structure
The Data structure for this operation is formed from two parameters `UserID` and `ClientToken`:
|Parameter|Required|Type|Description|Example|
|:----:|:----:|:----:|----|:----:|
| `UserID` | Yes| String | Unique client identifier in the Partner system: phone or email. |`380932799111`|
|`ClientToken`|Yes|String|Client card token.|`d1d2a97aac30eefd26959842-55d2bf3b236a2f84b4e8e2a1-d12c291f4e669`|
:::success
<details>
<summary>Example of request [20404]</summary>
<br>
~~~md
{
"Partner": {
"PartnerToken": "72a8ddb8-9145-4a41-af1a-8c48ecaa4be1",
"OperationType": 20404
},
"Data": "{\"UserID\": \"380932799111\", \"ClientToken\": \"20a9c01be1c24feb2a8f77385a2a469b90a9258bdd6b916cb6f03ea294257b31\"}",
"KeyAES": "",
"Sign": ""
}
~~~
</details>
:::
## Response
*See the general information on the response structure formation in the section "[General API Integration Information](https://hackmd.io/ijxPm0xtTpycgTjuU_NHQQ?view#Response-Structure)"*.
### Data Structure
Successful response to the request [20404] contains the data structure `CardData`, that transmits the card data:
| Parameter | Obligation | Type | Description | Example
|:----:|:----:|:----:|----|:----:|
| `PAN` | Yes | String | Card PAN (bank card number). | `8888888888888888` |
|`ExpMon`|Yes|String|Month of card validity.|`02`|
|`ExpYear`|Yes|String|Last 2 digits of the card's expiration year.|`22`|
|`CardName`|Yes|String|Client's card name. |`Privatbank Card`|
|`Token`|Yes|String|Client card token.|`72a8ddb8-9145-4a41-af1a-8c48ecaa4be1`|
:::success
<details>
<summary>Example of successful response to request [20404]</summary>
<br>
~~~md
{
"Code": 200,
"Message": "done",
"Data": {
"CardData": "{\"Token\":\"7a8250a2327737abe5f2febd3f645afcaf46742b296344ec29c70b2a3abe744\",\"Pan\":\"8888888888888888\",\"ExpMon\":\"11\",\"ExpYear\":\" 12\",\"CardName\":\"Privatbank Card\"}",
"OperationID": 45717,
"OperationStatus": 10
},
"KeyAES": "",
"Sign": ""
}
~~~
</details>
:::
## Related Requests
[[10101] Card-Card](https://hackmd.io/VYlXRMiWRkimK0sxlTZ2BA)
[[10102/101023/101025] Card-Wallet](https://hackmd.io/MUZzd3mTRQeQfBsE-emVVQ)
[[10103] Card-IBAN of Individual](https://hackmd.io/9c9kaHeMTH-LiGf_mVWwpg)
[[101031] Card-IBAN of Legal Entity](https://hackmd.io/XQDv9qmoRiqFzfzcD0H1uA)
[[10150/10051] Card-Phone-Card](https://hackmd.io/ES9hW5BlS6CozQAmULgnRw)
**Token Payment**
[[104021] Card Payment by Token](https://hackmd.io/I4FJ0d0eStuvfqG2YmS8IQ)
[[1040217] Bulk Card Payment by Token](https://hackmd.io/6h9zyYaBTwOLzzP8XJDrfg)
[[104121] Auto Debit by Token. MO/TO Operations](https://hackmd.io/X4ImobdtSJ-Hy1qM-p7PWA)
**Get Card Data**
[[20400/20410] Get Card Data by Phone Number](https://hackmd.io/Xd9OZWXARcSZRTCsu-1jrw)
**Get Transaction Data**
[[20003] Get Operation Status](https://hackmd.io/_eAjmoG-QPWoWWmsLOGf1g)
## Reference Materials
General parameters of the XPAY system are given in the section ["Reference Materials"](https://hackmd.io/16yLv895Qo-FWTvrWWQwbg): operation types, payment types, response codes, operation status, reasons of operation rejection, etc.

:arrow_left: [Guide](https://hackmd.io/QA2NYRliRLGviJl5P4-ZCw)
:arrow_left: [General API Integration Information](https://hackmd.io/ijxPm0xtTpycgTjuU_NHQQ)
<details>
<summary>XPAY Support</summary>
</br>
Phone: +38 093 891 92 00
Email: info@xpay.com.ua
Telegram: @xpaysupportbot
</details>