Skip to content

POST /payment

Creates a new payment. The buyer sends crypto to the returned address. Requires authentication.

POST /payment
HeaderDescription
merchantYour merchant UUID
signMD5 of base64(JSON.stringify(body)) + API_KEY
FieldTypeRequiredDescription
amountstring|numberYesPayment amount
currencystringYesCurrency code (e.g., USDT)
order_idstringYesYour internal order identifier
networkstringNoBlockchain network (e.g., tron)
url_callbackstringNoURL for payment status webhooks
url_returnstringNoURL the buyer returns to
url_successstringNoURL the buyer is redirected to on success
is_payment_multiplestringNo"true" or "false" — allow multiple partial payments
lifetimenumberNoPayment lifetime in seconds
to_currencystringNoCurrency to convert the payment into
subtractnumberNoSubtract fee from the payment amount
accuracy_payment_percentnumberNoAcceptable underpayment percent
additional_datastringNoArbitrary metadata string
discount_percentnumberNoDiscount applied to the payment
is_refreshstringNo"true" or "false" — refresh an existing payment
Terminal window
# Compute sign: MD5(base64(JSON.stringify(body)) + API_KEY)
curl -X POST https://api.nearpayments.io/cryptomus/v1/payment \
-H "Content-Type: application/json" \
-H "merchant: YOUR_MERCHANT_UUID" \
-H "sign: COMPUTED_SIGN" \
-d '{
"amount": "50",
"currency": "USDT",
"order_id": "order-42",
"network": "tron",
"url_callback": "https://example.com/webhook"
}'
{
"state": 0,
"result": {
"uuid": "a1b2c3d4-...",
"order_id": "order-42",
"amount": "50.00",
"payment_amount": "50.00",
"payer_amount": "50.00",
"discount_percent": 0,
"discount": "0.00",
"payer_currency": "USDT",
"currency": "USDT",
"merchant_amount": "49.50",
"network": "tron",
"address": "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb",
"from": null,
"txid": null,
"payment_status": "waiting",
"url": "https://api.nearpayments.io/pay/a1b2c3d4-...",
"expired_at": 1710600000,
"status": "process",
"is_final": false,
"additional_data": null,
"created_at": "2025-01-15T10:30:00+00:00",
"updated_at": "2025-01-15T10:30:00+00:00"
}
}