Skip to content

POST /v1/invoice

Creates an invoice with a hosted payment page where buyers can select their preferred cryptocurrency and complete payment. Requires authentication.

POST /v1/invoice
FieldTypeRequiredDescription
price_amountnumberYesInvoice amount
price_currencystringYesCurrency code
pay_currencystringNoPre-select a payment currency
order_idstringNoYour internal order ID
order_descriptionstringNoWhat’s being invoiced
ipn_callback_urlstringNoWebhook URL
success_urlstringNoRedirect after successful payment
cancel_urlstringNoRedirect if cancelled
partially_paid_urlstringNoRedirect if partially paid
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"
}'
{
"id": "a1b2c3d4-e5f6-...",
"token_id": "1",
"order_id": "inv-100",
"order_description": null,
"price_amount": "50",
"price_currency": "usd",
"pay_currency": null,
"ipn_callback_url": null,
"customer_email": null,
"partially_paid_url": null,
"payout_currency": null,
"is_fixed_rate": false,
"is_fee_paid_by_user": false,
"source": null,
"collect_user_data": false,
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z",
"invoice_url": "https://api.nearpayments.io/invoice/a1b2c3d4-e5f6-...",
"success_url": "https://example.com/success",
"cancel_url": "https://example.com/cancel"
}