Skip to main content

1. Creating a crypto payment.

The merchant's website or app sends a request to the Processing Service to create a payment, which has the following form:

POST https://<HOSTNAME>/api/v1/payments/create
Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l
Idempotence-Key: ps_1614589640890_3134
Content-Type: application/json
{
"email": "[email protected]",
"shop_order_id": "208843-42-23-842",
"client_amount": "10",
"client_cryptocurrency": "USDT",
"client_amount_of_shipping": "1",
"callback_url": "https://website.com/api/change-status",
"description": "Order #208843-42-23-864",
"expires": "2023-02-22T00:00:00-00:00"
}

Fields description>

FieldTypeRequiredDescription
emailstringyesbuyer's email; used when refunds are necessary;
shop_order_idstringnoshop order id
client_amountstringyestotal payment amount (currency is specified in the merchant's profile);
client_cryptocurrencystringyescurrency displayed for the client
client_amount_of_shippingstringnoamount of shipping.
This field has an informational function.
callback_urlstringnoURL address of callback API of the store to which the Processing Service will send a request when payment status is changed (when payment is executed)
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.
descriptionstringnoif you need to add a description of the payment which the merchant wants to see in the personal account, you must pass the description parameter.
Description must not exceed 128 characters.
expiresstringnothe date when the payment expires in RFC3339 format. Default: 1 hour from the moment of sending;

The processing service returns the created payment object:

{
"id": "3021c31c-fffb-40d0-995c-d301b33aab06",
"status": "pending",
"client_amount": "10",
"client_cryptocurrency": "USDT",
"client_amount_of_shipping": "1",
"description": "Order #208843-42-23-864",
"confirmation_token": "04a20cec-45b6-4402-b7c9-cad3d3efeb5e",
"confirmation_url": "https://website.com/api/change-status",
"created_at": "2022-11-24T19:21:22.611733+00:00",
"expires": "2023-02-22T00:00:00+00:00",
"receipt_code": "90496d33-b9f7-40bd-a7b1-846dfe719786",
"test": false
}

You'll need to get <confirmation_token> variable for widget activation.

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;
client_amountstringyestotal amount of payment
client_currencystringyespayment currency
client_amount_of_shippingstringyesamount of shipping
descriptionstringyespayment description, maximum 128 characters
confirmation_tokenstringyespayment token, that is necessary to initialize the widget
confirmation_urlstringyesURL address of callback API of the store to which the Processing Service will send a request when payment status is changed (when payment is executed)
created_atstringyespayment creation date, RFC3339 format
expiresstringyesdate when payment expires, RFC3339 format
receipt_codestringyescheck t
testbooleanyeslag for test order for API debugging