Sending receipts and notifications to customer
Sending receipt
To form and send an electronic sales receipt to customers after performing a payment, pass all the positions indicated in the receipt in the payment request.
The data for the receipt is passed as a JSON object which is encoded in Base64 and sent in the payment request in the receipt_data parameter. The JSON object structure is given in the receiptdata
model in the Gate
API.
Example of the receipt data to be sent
Initial JSON object:
{
"receipt_data":{
"positions":[
{
"quantity":3,
"amount":10000,
"tax":18,
"tax_amount":1800,
"description":"Design frame"
}
],
"total_tax_amount":1800,
"common_tax":18
}
}
The same data, encoded in Base64, to be sent to Payment Page in the payment request:
receipt_data: "eyAgCiAgICAgICJwb3NpdGlvbnMiOlsgIAogICAgICAgICB7ICAKICAgICAgICAgICAgInF1YW50aXR5IjozLAogICAgICAgICAgICAiYW1vdW50IjoxMDAwMCwKICAgICAgICAgICAgInRheCI6MTgsCiAgICAgICAgICAgICJ0YXhfYW1vdW50IjoxODAwLAogICAgICAgICAgICAiZGVzY3JpcHRpb24iOiJEZXNpZ24gZnJhbWUiCiAgICAgICAgIH0KICAgICAgXSwKICAgICAgInRvdGFsX3RheF9hbW91bnQiOjE4MDAsCiAgICAgICJjb21tb25fdGF4IjoxOCAgICAgICAKfQ"
For more information about sending receipts to customers, see the section Sending notifications to customers.