Skip to content

Payments

POST /v1/payment

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

FieldTypeRequiredDescription
price_amountnumberYesAmount in price_currency
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
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,
"purchase_id": 5234123456,
"payment_status": "waiting",
"pay_address": "bc1q...",
"pay_amount": 0.00029,
"price_amount": 25.50,
"price_currency": "usd",
"pay_currency": "btc",
"order_id": "order-42",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}

GET /v1/payment/{payment_id}
Terminal window
curl https://api.nearpayments.io/v1/payment/1 \
-H "x-api-key: YOUR_API_KEY"
StatusDescription
waitingAwaiting payment
confirmingTransaction detected, waiting for confirmations
confirmedConfirmed on-chain
sendingConverting and sending to merchant
finishedPayment complete
partially_paidBuyer sent less than required
failedPayment failed
refundedPayment was refunded
expiredPayment expired (24h default)

GET /v1/payment/
ParameterTypeDescription
limitnumberResults per page (max 500)
pagenumberPage number
sortBystringField to sort by
orderBystringasc or desc
dateFromstringFilter from date
dateTostringFilter to date