POST /payment
Creates a new payment. The buyer sends crypto to the returned address. Requires authentication.
Request
Section titled “Request”POST /paymentHeaders
Section titled “Headers”| Header | Description |
|---|---|
merchant | Your merchant UUID |
sign | MD5 of base64(JSON.stringify(body)) + API_KEY |
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
amount | string|number | Yes | Payment amount |
currency | string | Yes | Currency code (e.g., USDT) |
order_id | string | Yes | Your internal order identifier |
network | string | No | Blockchain network (e.g., tron) |
url_callback | string | No | URL for payment status webhooks |
url_return | string | No | URL the buyer returns to |
url_success | string | No | URL the buyer is redirected to on success |
is_payment_multiple | string | No | "true" or "false" — allow multiple partial payments |
lifetime | number | No | Payment lifetime in seconds |
to_currency | string | No | Currency to convert the payment into |
subtract | number | No | Subtract fee from the payment amount |
accuracy_payment_percent | number | No | Acceptable underpayment percent |
additional_data | string | No | Arbitrary metadata string |
discount_percent | number | No | Discount applied to the payment |
is_refresh | string | No | "true" or "false" — refresh an existing payment |
Example
Section titled “Example”# 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" }'Response
Section titled “Response”{ "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" }}