[УКР](https://hackmd.io/qVpHKagbQwWbHF-znvdGcQ) | ENG

:arrow_left: [Guide](https://hackmd.io/pa6TRNZTTa67jO_qYDuRBQ)
# [40401] Payment Instrument-Card
## 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
Data structure for this operation is formed from the following parameters:
:::info
<details>
<summary>Data structure formation (examples are below)</summary>
<br>
~~~
{
"UserID": "",
"Phone": "",
"Email": "",
"DeviceID": "",
"Sum": ,
"Sender": "",
"Recipient": "",
"CallbackURL": "",
"Transaction": {
"TransactionID": "",
"TerminalID": "",
"DateTime": ""
}
}
~~~
</details>
:::
|Parameter|Required|Type|Description|Example|
|:----:|:----:|:----:|----|:----:|
|`UserID`|No |String|Unique client identifier in the Partner system.|`Uwuh0B5GQVuokYSL`|
| `Phone` | Yes | String | Client phone number in the format "380xxxxxxxxxxxx". |`380679335544`|
| `Email` | No | String | Client email. |`index@gmail.com`|
|`DeviceID`|Yes |String|Unique identifier of the client device.|`0Ht9z0yh5aDNr5-js1zGFz5QTmIE=`|
| `Sum` | Yes |Integer| Operation sum in kopecks. |1UAH=>`100`|
| `Sender` | Yes | String | UUID (unique identifier) of the client's payment instrument. |`ead5ea7a-f19f-44ec-8742-3621b4bfdc18`|
| `Recipient` | Yes |String | Recipient card PAN (bank card number). | `8888888888888888` |
| `CallbackURL` | No | String | URL to which the client will be redirected after completing the payment.| `https://partner.com/result_page`|
|`Transaction`|Yes|Structure|Structure transmits transaction data. See section "[Transaction Structure](https://hackmd.io/ijxPm0xtTpycgTjuU_NHQQ?view#2-Data)".|See example below.|
:::success
<details>
<summary>Example of the request [40401]</summary>
<br>
~~~md
{
"Partner": {
"PartnerToken": "0ef55760-01d2-4a45-ba82-591ac7fe47f6",
"OperationType": 40401,
"Locale": "en"
},
"Data": "{\"UserID\":\"551151\", \"DeviceID\": \"1c1cb30e74f2b49a\", \"Phone\": \"380952777795\", \"Email\": \"y0952777795@gmail.com\", \"Sum\": 333961, \"Sender\": \"e4a02ac1-c8b3-4237-add1-92b9f43f5bed\", \"Recipient\": \"8888888888888888\", \"CallbackURL\": \"https://partner.com/callback/xpass1\", \"Transaction\": {\"TransactionID\": \"2d4d7a505752727677476d306d494766484f6d45\", \"TerminalID\": \"32\", \"DateTime\": \"20220330 14:11:16\"}}",
"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)"*.
### Response Examples
:::success
<details>
<summary>Operation Successfully Completed</summary>
<br>
~~~md
{
"Code": 200,
"Message": "done",
"Data": {
"OperationID": 11,
"OperationStatus": 10
},
"KeyAES": "",
"Sign": ""
}
~~~
</details>
:::
:::success
<details>
<summary>Operation Failed</summary>
<br>
~~~md
{
"Code": 200,
"Message": "fail",
"Data": {
"OperationID": 111,
"OperationStatus": 21,
"Reason": 3
},
"KeyAES": "",
"Sign": ""
}
~~~
</details>
:::
## 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/pa6TRNZTTa67jO_qYDuRBQ)
: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>