Skip to content

Invoices

Invoices provide a hosted payment page where buyers can select their preferred cryptocurrency and complete payment.

POST /v1/invoice
FieldTypeRequiredDescription
price_amountnumberYesInvoice amount
price_currencystringYesCurrency code
order_idstringNoYour internal order ID
order_descriptionstringNoWhat’s being invoiced
ipn_callback_urlstringNoWebhook URL
success_urlstringNoRedirect after successful payment
cancel_urlstringNoRedirect if cancelled
Terminal window
curl -X POST https://api.nearpayments.io/v1/invoice \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"price_amount": 50,
"price_currency": "usd",
"order_id": "inv-100",
"success_url": "https://example.com/success",
"cancel_url": "https://example.com/cancel"
}'

The response includes an invoice_url — share this with your customer.


GET /v1/invoice-payment?invoiceId={id}

Returns the payment linked to an invoice, or a message if no payment has been created yet.