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

:arrow_left: [Guide](https://hackmd.io/QA2NYRliRLGviJl5P4-ZCw)
# [20802] Get Debt Data
## Usage
Request [20802] is used to get the debt data for a single account.
## 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>
~~~
{
"accountid": ""
"Transaction": {
"TransactionID": "",
"TerminalID": "",
"DateTime": ""
}
}
~~~
</details>
:::
|Parameter|Required|Type|Description|Example|
|:----:|:----:|:----:|----|:----:|
| `accountid` | Yes | String | Unique account ID received in response to [[20801]](https://hackmd.io/8x6rVjR-SnOj1HHwAfa8tg). |`17`|
|`Transaction`|Yes|Structure|Structure transmits the transaction data. See section "[Transaction Structure](https://hackmd.io/ijxPm0xtTpycgTjuU_NHQQ?view#2-Data)".|See example below.|
:::success
<details>
<summary>Example of the request [20802]</summary>
<br>
~~~md
{
"Partner": {
"PartnerToken": "72a8ddb8-9145-4a41-af1a-8c48ecaa4be1",
"OperationType": 20802
},
"Data": "{\"accountid\": \"17\", \"Transaction\": {\"TransactionID\": \"187725ff2f251\", \"TerminalID\": \"1\", \"DateTime\": \"20230221 120111\"}}",
"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)"*.
### Data Structure
Data structure of the response is formed from the following parameters:
|Parameter|Required|Type|Description|Example|
|:----:|:----:|:----:|----|:----:|
| `ID_PLAT_KLIENT` | Yes |Integer | Unique ID of the service payer. |`383064108`|
| `KOMIS` | Yes |Array | Array of structures transmits commission sum data. | See example below.|
| `PLATS` | Yes |Array | Array of structures transmits debt data. Parameters of each structure are optional and individually configured depending on the payment type and Partner's needs. | See example below.|
### Response Examples
:::success
<details>
<summary>Operation Successfully Completed</summary>
<br>
~~~md
{
"Code": 200,
"Message": "Done",
"Data": {
"ID_PLAT_KLIENT": 383064108,
"KOMIS": [
{
"SUM": 0
}
],
"PLATS": [
{
"ID_PLAT_PLAT": 339506757008,
"FIRME": "EURO-RECONSTRUCTION LIMITED LIABILITY COMPANY",
"SERVICE_LABEL": "AP (subscription fee)",
"ABCOUNT": "1*34",
"SUMM": 303.08,
"DTIME": "2022-06-23T12:39:45Z",
"MONEY_ID": 0,
"COUNTERS": null
},
{
"ID_PLAT_PLAT": 339506756908,
"FIRME": "EURO-RECONSTRUCTION LIMITED LIABILITY COMPANY",
"SERVICE_LABEL": "CENTRALIZED HOT WATER SUPPLY",
"ABCOUNT": "1*34",
"SUMM": 16511.68,
"DTIME": "2022-06-23T12:39:45Z",
"MONEY_ID": 0,
"COUNTERS": [
{
"ID_PLAT_COUNTERS": 14788381901,
"NCOUNTERS": 1,
"OLD_VAL": 0,
"NEW_VAL": 0
}
]
}
]
}
}
~~~
</details>
:::
:::success
<details>
<summary>Operation Failed</summary>
<br>
~~~md
{
"Code": 200,
"Message": "done",
"Data": {
"OperationID": 111,
"OperationStatus": 21,
"Reason": 3
},
"KeyAES": "",
"Sign": ""
}
~~~
</details>
:::
## Related Requests
[[20801] Get Directory Data](https://hackmd.io/8x6rVjR-SnOj1HHwAfa8tg)
[[208011] Get Directory City Data](https://hackmd.io/LZsuqpBMR-iPJcnBKS7DmA)
[[10108] Debt Repayment](https://hackmd.io/9MdA15b8Ra-SS1pGfia0oQ)
## 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>