Skip to main content

3. Notifying the retailer of a change in payment status. Payment Callback

Attention!

Keep in mind that if the site in which You are testing payments is not publicly accessible for requests from the Internet, then notifications of changes in the status of payments from Our processing service will not be able to reach Your online store, as a result of which the status of orders in your store will not change.

When the user has made a payment, the Processing Service sends a request in the following format to the store's API url, which was specified at the time of creating the payment:

POST https://shop-website.com/api/change-order-status
{
"id": "23d93cac-000f-5000-8000-126628f15141",
"shop_order_id": "208843-42-23-842",
"status": "paid",
"amount": "100.00",
"amount_of_shipping": "15.00",
"currency": "EUR",
"description": "Order #208843-42-23-842",
"created_at": "2019-01-22T14:30:45-03:00",
"expires": "2020-02-22T00:00:00-00:00"
}

Fields description

FieldTypeRequiredDescription
idstringyespayment identifier
statusstringyespayment status.
Value options:
"pending"- pending payment;
"awaiting_payment_confirmation" - the transaction was found in the mempool, its confirmation in the blockchain network is pending;
"paid" - payment made;
"cancelled" - the payment is cancelled by the seller;
"expired" - payment time has expired;
amountstringyestotal amount of payment
currencystringyespayment currency
descriptionstringyespayment description, maximum 128 characters
created_atstringyespayment creation date, RFC3339 format
expiresstringyesdate when payment expires, RFC3339 format
client_currencystringnocurrency displayed for the client
client_amountstringnototal payment amount in the client's currency
client_amount_of_shippingstringnoelivery amount in the client's currency

Example of a notification with the client's currency

{
"email": "[email protected]",
"shop_order_id": "208843-42-23-842",
"amount": "6.29",
"amount_of_shipping": "1.26",
"сurrency": "EUR",
"client_amount": "100.00",
"client_amount_of_shipping": "20.00",
"client_сurrency": "TRY",
"callback_url": "https://website.com/api/change-status",
"description": "Order #208843-42-23-842",
"expires": "2020-02-22T00:00:00-00:00"
}