Create a payment order
POST/api/v1/order/payment
Create a new payment order. The payment order specifies the amount and currency you want to receive from the payer. On the payment page, the payer can choose to pay in a different currency, and the amount will be converted, so you will receive the amount you specified here.
The payer can pay the order in multiple transactions. The order status will be updated to completed
once 19 transaction confirmations are received from the network.
If the full amount is not paid within the order's lifetime, the order status will be marked as failed
.
The order is valid for 20 minutes. During this time, the payer must complete the payment.
Difference between Create a payment order and Create a deposit order:
Create a payment order is used to charge a customer for a specific service or product. The order defines the amount to receive, and the payer can complete the payment in multiple transactions. Use this when you want to collect a specific payment from a customer.
Create a deposit order allows clients to deposit funds into their balance for a specific integration. The client chooses the amount to deposit, and the order is completed after the first transaction. Use this for topping up an account or balance, not for one-time payments.
Request
- application/json
Body
Details of the payment order to create.
Possible values: Value must match regular expression [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
The ID of the integration for which the payment order is created. Retrieve it from the Retrieve a list of integrations endpoint.
The amount to be paid by the client. Use a decimal point as a separator, up to 6 decimal places. If more than 6 decimal places are provided, the value will be rounded.
Possible values: [TRX
, USDT_TRC20
]
The ID of the asset for payment.
Responses
- 200
Payment order created successfully.
- application/json
- Schema
- Example (from schema)
Schema
The unique identifier of the created order.
The URL to the payment page where the client needs to be redirected to complete the payment.
The HTML code for embedding the payment widget on your site.
{
"orderId": "123e4567-e89b-12d3-a456-426614174000",
"paymentLink": "https://example.com/payment/123e4567-e89b-12d3-a456-426614174000",
"widgetCode": "<iframe src=https://example.com/iframe?integrationId=1ef9694f-68a3-630c-843d-5920a49afe21&orderId=1ef9b4d3-aa4f-6146-b1e1-5920a49afe21 width=\"100%\" height=\"800px\" allow=\"clipboard-write *\" ></iframe>"
}