Skip to content

POST /v1/payment

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

POST /v1/payment
FieldTypeRequiredDescription
price_amountnumberYesAmount in price_currency (max 1,000,000,000)
price_currencystringYesFiat or crypto currency code (e.g., usd)
pay_currencystringYesCryptocurrency the buyer pays with (e.g., btc)
order_idstringNoYour internal order identifier
order_descriptionstringNoDescription of the purchase
ipn_callback_urlstringNoURL for payment status webhooks (must be valid HTTP/HTTPS)
pay_amountnumberNoOverride the calculated pay amount
purchase_idstringNoCustom purchase ID (auto-generated if omitted)
payout_addressstringNoCustom payout address
payout_currencystringNoCustom payout currency
payout_extra_idstringNoExtra ID for payout (e.g., memo)
is_fixed_ratebooleanNoUse exact output mode for settlement amount
is_fee_paid_by_userbooleanNoWhether the buyer pays the fee
Terminal window
curl -X POST https://api.nearpayments.io/v1/payment \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"price_amount": 25.50,
"price_currency": "usd",
"pay_currency": "btc",
"order_id": "order-42",
"ipn_callback_url": "https://example.com/webhook"
}'
{
"payment_id": 1,
"payment_status": "waiting",
"pay_address": "bc1q...",
"price_amount": 25.50,
"price_currency": "usd",
"pay_amount": 0.00029,
"actually_paid": 0,
"pay_currency": "btc",
"order_id": "order-42",
"order_description": null,
"purchase_id": 5234123456,
"outcome_amount": null,
"outcome_currency": null,
"invoice_id": null,
"payin_extra_id": null,
"payin_hash": null,
"payout_hash": null,
"burning_percent": "null",
"type": "crypto2crypto",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}