[УКР](https://hackmd.io/EjF35e_sSfKad2ojsEoYWQ) | ENG

:arrow_left: [Guide](https://hackmd.io/QA2NYRliRLGviJl5P4-ZCw)
# [20400/20410] Get Card Data by Phone Number
*What is "Token Payment" and how the cards are tokenized, see in the section ["Token Payment"](https://hackmd.io/hELnx1lqQwS9RiactYbLEA).*
## Usage
Requests [20400/20410] are used to get card data for re-interacting with the client. Only the client's phone number is transmitted for this purpose. In response, the Operator sends the card data and the client's card token stored on the server.
|OperationType |Usage |
|:----:|----|
|`20400`|Get the data of the last linked card.|
|`20410`|Get the data of all linked cards.|
## 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 only one parameter `Phone`:
|Parameter|Required|Type|Description|Example|
|:----:|:----:|:----:|----|:----:|
| `Phone` | Yes | String | Client phone number in format: "380xxxxxxxxxxxx". |`380679335544`|
:::success
<details>
<summary>Example of request [20400]</summary>
<br>
~~~md
{
"Partner": {
"PartnerToken": "72a8ddb8-9145-4a41-af1a-8c48ecaa4be1",
"OperationType": 20400
},
"Data": "{\"Phone\": \"0986081202\"}",
"KeyAES": "",
"Sign": ""
}
~~~
</details>
:::
:::success
<details>
<summary>Example of request [20410]</summary>
<br>
~~~md
{
"Partner": {
"PartnerToken": "72a8ddb8-9145-4a41-af1a-8c48ecaa4be1",
"OperationType": 20410
},
"Data": "{\"Phone\": \"0986081202\"}",
"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 requests [20400/20410] contains the `token` or `tokens` data structure, that transmits the data of the last linked card [20400] or of all linked cards [20410]:
| Parameter | Obligation | Type | Description | Example
|:----:|:----:|:----:|----|:----:|
| `Token` | Yes |String | Card token. Card identifier in the Operator system. |`d1d2a97aac30eefd26959842-55d2bf3b236a2f84b4e8e2a1-d12c291f4e669`|
| `MaskPan` |Yes| String | Masked card number. |`123456******1234` |
|`Bank`|Yes|String|Bank name issuing the card. |`BankName`|
|`PaySys`|Yes|String|International payment system. |`Visa`|
### Response Examples
:::success
<details>
<summary>Example of successful response to request [20400]</summary>
<br>
~~~md
{
"Code": 200,
"Message": "done",
"Data": {
"token": "{\"Token\":\"7a8250a232773abe5f2febd3f645afcaf456742b296344ec29c70b2a3abe744\",\"MaskPan\":\"419811******2503\",\"Bank\":\"Bank\",\"PaySys\":\"VISA\"}",
"OperationID": 35718,
"OperationStatus": 10
},
"KeyAES": "",
"Sign": ""
}
~~~
</details>
:::
:::success
<details>
<summary>Example of successful response to request [20410]</summary>
<br>
~~~md
{
"Code": 200,
"Message": "done",
"Data": {
"OperationID": 35500,
"OperationStatus": 10,
"tokens": "[{\"Token\":\"20a9c01be1c4feb2a8f77385a2a469b90a9258bdd6b916cb6f03ea294257b31\",\"MaskPan\":\"516936******0708\",\"Bank\":\"PRIVATBANK\", \"PaySys\":\"MasterCard (IPM)\"},{\"Token\":\"e85785597108eb2484175906994df57157a351676bfd552dfc2f3b8efbf279f\",\"MaskPan\":\"516875******6358\",\" Bank\":\"PRIVATBANK\",\"PaySys\":\"MasterCard (IPM)\"},{\"Token\":\"73921e408434035296cfb9e810e9e353476bbe117d91591205e24ad639b1a2e\",\"MaskPan\":\"516936** ****0925\",\"Bank\":\"PRIVATBANK\",\"PaySys\":\"MasterCard (IPM)\"},{\"Token\":\"48c71533af0397c583d7d4dd9a4865f559b15e007ccafe396eb67c5e2649d3e\",\" "MaskPan\":\"444111******8660\",\"Bank\":\"Bank\",\"PaySys\":\"Card\"}]"
},
"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**
[[20404] Get Card Data by Token](https://hackmd.io/PSdh1ldNSmmJMR4OIhM_-Q)
**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>