Skip to content

POST /payment/invoice

Creates an invoice with a hosted payment page where buyers can complete payment. Requires authentication.

POST /payment/invoice
FieldTypeRequiredDescription
amountnumberYesInvoice amount
currencystringYesFiat or crypto currency code
lifetimenumberNoInvoice lifetime in minutes
fee_paid_by_payer0 | 1NoWhether the payer covers network fees
under_paid_coveragenumberNoPercentage tolerance for underpayment
to_currencystringNoAuto-convert received funds to this currency
callback_urlstringNoWebhook URL for payment updates
return_urlstringNoRedirect URL after payment
emailstringNoCustomer email
order_idstringNoYour internal order ID
thanks_messagestringNoMessage shown after payment
descriptionstringNoInvoice description
Terminal window
curl -X POST https://api.nearpayments.io/oxapay/v1/payment/invoice \
-H "merchant_api_key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 50,
"currency": "USD",
"order_id": "inv-100",
"return_url": "https://example.com/thanks"
}'
{
"data": {
"track_id": "abc123",
"payment_url": "https://api.nearpayments.io/pay/abc123",
"expired_at": 1700000000,
"date": 1699996400
},
"message": "Operation completed successfully!",
"error": {},
"status": 200,
"version": "1.0.0"
}