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

:arrow_left: [Guide](https://hackmd.io/pa6TRNZTTa67jO_qYDuRBQ)
# [40023] Get Transaction History for Payment Instrument
## 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": "",
"UUID": "",
"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=`|
|`UUID`|Yes|String|UUID (unique identifier) of the payment instrument for which the transaction history is formed. |`ead5ea7a-f19f-44ec-8742-3621b4bfdc18`|
|`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 [40023]</summary>
<br>
~~~md
{
"Partner": {
"PartnerToken": "3b4e5666-b585-491a-af31-516e47b25041",
"OperationType": 40023
},
"Data": "{\"Email\": \"cirko2008@gmail.com\", \"UserID\": \"Uwuh0B5GQVuokYSL\", \"DeviceID\": \"0Ht9z0yh5aDNr5js1zGFz5QTmIE=\", \"UUID\": \"ead5ea7a-f19f-44ec-8742-3621b4bfdc18=\", \"Transaction\": {\"DateTime\": \"2022-04-21 02:46:33\", \"TerminalID\": \"1\", \"TransactionID\": \"JXECMxR4IUCqtsqr5KBkABrKC0M=\"}}",
"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 [40023] contains the structure `DecodedData`/`EncodedData`, in which unencrypted or encrypted data of the payment instrument is transmitted.
### Response Examples
:::success
<details>
<summary>Transaction history for the payment instrument in unencrypted form</summary>
<br>
~~~md
{
"Code": 200,
"Message": "done!",
"Data": {
"DecodedData": "[{\"id\":29476864,\"type\":\"inner_transfer\",\"title\":\"Transfer from 0678897193\",\"phone\":\"\ ",\"card\":\"\",\"subtitle\":\"Transfer\",\"currency\":\"UAH\",\"sum\":100,\"state\" :\"0001\",\"status\":\"Done\",\"state_comment\":\"\",\"credit_wallet\":\"0678897193\",\"balance\":2555, \"fee\":0,\"debit_wallet\":\"0632822311\",\"date\":\"2019-12-18T16:10:50+02:00\",\"operation_type\": \"40402\"},{\"id\":28225140,\"type\":\"inner_transfer\",\"title\":\"Transfer to 0637922253\",\"phone\":\" \",\"card\":\"\",\"subtitle\":\"Transfer\",\"currency\":\"UAH\",\"sum\":-300,\"state \":\"0001\",\"status\":\"Done\",\"state_comment\":\"\",\"credit_wallet\":\"560c5911-cd5e-442e-88d8-04cd5d9fe115\ ",\"balance\":2455,\"fee\":0,\"debit_wallet\":\"0637922253\",\"date\":\"2019-12-11T07:54:55+02: 00\",\"operation_type\":\"40402\"},{\"id\":28225069,\"type\":\"inner_transfer\",\"title\":\"Transfer from 0637922253\ ",\"phone\":\"\",\"card\":\"\",\"subtitle\":\"Transfer\",\"currency\":\"UAH\",\"sum\":2 00,\"state\":\"0001\",\"status\":\"Done\",\"state_comment\":\"\",\"credit_wallet\":\"0637922253\",\ "balance\":2755,\"fee\":0,\"debit_wallet\":\"0632822311\",\"date\":\"2019-12-11T07:53:48+02:00\" ,\"operation_type\":\"40402\"},{\"id\":28224451,\"type\":\"inner_transfer\",\"title\":\"Transfer to 0637922253\",\ "phone\":\"\",\"card\":\"\",\"subtitle\":\"Transfer\",\"currency\":\"UAH\",\"sum\":-58,\"state\":\"0001\",\"status\":\"Done\",\"state_comment\":\"\",\"credit_wallet\":\"560c5911-cd5e -442e-88d8-04cd5d9fe115\",\"balance\":2555,\"fee\":0,\"debit_wallet\":\"0637922253\",\"date\":\"2019-12-11T07 :24:35+02:00\",\"operation_type\":\"40402\"}]",
"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>