---
# System prepended metadata

title: '[20004] Get Transaction Receipt'

---

[УКР](https://hackmd.io/mOA9rZ_xSxWrNZxKzvZ5HQ) | ENG
![](https://i.imgur.com/ULmPUgP.jpg)
:arrow_left: [Guide](https://hackmd.io/QA2NYRliRLGviJl5P4-ZCw)

# [20004] Get Transaction Receipt

## Usage

Request [20004] is used to get the operation receipt in PDF format.


## 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 the following parameters:

:::info
<details>
<summary>Data structure formation (examples are below)</summary>
<br>

~~~
{
    "OperationID": ,
    "Transaction": {
        "TransactionID": "",
        "TerminalID": "",
        "DateTime": ""
    }
}
~~~
</details>
:::


|Parameter|Required|Type|Description|Example|
|:----:|:----:|:----:|----|:----:|
|`OperationID`|Yes|Integer|Unique operation identifier in the Operator system, for which the receipt is generated.|`71730132`|
|`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 [20004]</summary>
<br>

~~~md
{
   "Partner": {
     "PartnerToken": "72a8ddb8-9145-4a41-af1a-8c48ecaa4be1",
     "OperationType": 20004
   },
   "Data": "{\"OperationID\": 71730132, \"Transaction\": {\"TransactionID\": \"448b46a3-603d-43cd-be79-f129bbd1f626\", \"TerminalID\": \"1 \"}}",
   "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

Successful response to the request [20004] contains the structure array `DataPDF`, that transmits the receipt data. Structure parameters are optional and individually configured depending on the operation type and Partner's needs. Main parameters are:

|Parameter|Required|Type|Description|Example|
|:----:|:----:|:----:|----|:----:|
|`TmplCode`|Yes|String| Template name in the Operator system by which the receipt is generated.|`WP_EMAIL`|
|`Base64Data`|Yes|String|Receipt data in base64 encoding.|See below.|


### Response Example

:::success
<details>
<summary>Formation of operation receipt</summary>
<br>

~~~md
{
   "Code": 200,
   "Message": "OK",
   "Data": {
     "DataPDF": [
       {
         "TmplCode": "BUNDLE_C2A_PDF",
         "Base64Data": "JVBERi0xLjQKMSAwIG9iago8PAovVGl0bGUgKP7/KQovQ3JlYXRvciAo/",
         "N": 0,
         "ID": "Payment ID from AccountPayments request 10005",
         "Ticket_Type": "PAY_ACC"
       },
       {
         "TmplCode": "BUNDLE_C2A_PDF",
         "Base64Data": "JVBERi0xLjQKMSAwIG9iago8PAovVGl0bGUgKP7/KQovQ3JlYXRvciAo/",
         "N": 1,
         "ID": "Payment ID from AccountPayments request 10005",
         "Ticket_Type": "COMMISSION"
       }
     ],
     "OperationID": 35718,
     "OperationStatus": 10
   }
}
~~~
</details>
:::


## Related Requests

[[20001] Get Wallet Balance](https://hackmd.io/SVZQwSioRiGRiy0JwUQFWw)
[[20002] Get Wallet Statement](https://hackmd.io/ChiiYaRgQVeZcjvM5Wt7VA)
[[20003] Get Operation Status](https://hackmd.io/_eAjmoG-QPWoWWmsLOGf1g)
[[20008] Get Exchange Rate](https://hackmd.io/k_ZnVoMwQ-i4WelDZ0wtZA)
[[20009] Get Limit for Operation [10101]](https://hackmd.io/rQ7epWnbQmG9kM0rFjUfhA)
[[20110] Get Card Data](https://hackmd.io/WruG7PGDRsuF0gL0Wl21bA)


## 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.


![](https://i.imgur.com/17gAyWb.png)
: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>