Automatic POSTBACK

After successful payment execution, a POST request with information about the payment is sent to the notification URL specified in the project settings.

Request parameters

Parameter name
Data type
Value
Example
Description

status

string

success

success

Request execution status

invoice_id

string

id

DZLF4212

Unique payment identifier

amount_crypto

decimal

sum

0.4567

Payment amount in cryptocurrency

currency

string

BTC

LTC

ETH

USDT_TRC20 USDT_ERC20 USDC_TRC20 USDC_ERC20 TUSD_TRC20 TUSD_ERC20

BTC

Currency code

order_id

string

id

ORD99999

Store order identifier

token

string

token

eyJ0eXAiOiJKV1QiLCJhbGciOiJIAcI1NiJ9.eyJpZCI6MTMsImV4cCI6MTYzMTc4NjQyNn0.HQavV3z8dFnk56bX3MSY5X9lR6qVa9YhAoeTEHkaAzs

JWT token

JWT token — response signature from the server. It is signed with a secret key generated in the project settings. Additionally, UUID of the invoice is added to the token. The token is valid for 5 minutes after the notification is created. It is generated each time a payment notification is sent.

The encryption algorithm is HS256.

Response example

{
   "status": "success",
   "invoice_id": “DZLF4212,
   "amount_crypto": 0.4567,
   "currency": “BTC“,
}

Example of POSTBACK processor

from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route('/postback', methods=['POST'])
def handle_postback():
    data = request.json
    status = data.get('status')
    invoice_id = data.get('invoice_id')
    amount_crypto = data.get('amount_crypto')
    currency = data.get('currency')
    order_id = data.get('order_id')
    token = data.get('token')
    
    # ... your code for processing postback ...
    
    return jsonify({'message': 'Postback received'}), 200

if __name__ == '__main__':
    app.run(port=5000)

Last updated