Checkout (public)

Get a deposit address

Returns a one-time deposit address and the exact amount to send for the chosen coin. The quote is valid for 20 minutes, or until the invoice expires if that is sooner. Asking again for the same coin and refund address returns the open quote instead of a new one. A quote for a different coin or refund address retires the previous unused one; the old address is watched for 24 hours in case a payment still arrives. The invoice needs at least 2 minutes of lifetime left. When the business has private payments on, the quote is a NEAR Intents confidential quote and the payment has confidential: true. If NEAR Intents refuses it, or this server is not set up for confidential quotes, the answer is a quote_unavailable error without param; Solverr never falls back to a public payment. Rate limits: 120 per minute per IP address and per network, 10 per minute per invoice, 120 new addresses per minute per business, and 10 new addresses per invoice per hour.

POST
/api/v1/invoices/{id}/quote

Path Parameters

id*string

Invoice id, starting with inv_.

Request Body

application/json
  1. body
origin_asset*string

Asset id of the coin the payer sends, from the tokens list.

Length1 <= length <= 200
refund_address*string

The payer's own address on the coin's chain. Refunds go here. It is checked against the chain's address format.

Length1 <= length <= 200

Response Body

The deposit details for this payment attempt.

application/json
  1. response

One payment attempt on an invoice, with its deposit address and latest status.

id*string
object*string
status*PaymentStatus

The NEAR Intents status of this attempt, in lowercase.

Value in"pending_deposit""known_deposit_tx""incomplete_deposit""processing""success""refunded""failed"
coin*
amount_in*string

The exact amount to send, as a decimal string.

amount_in_base*string

The same amount in the coin's smallest unit.

min_amount_in_base*string

Below this amount the payment is refunded.

amount_in_usd*string|null
deposit_address*string

One-time address for this attempt only. Demo store invoices get addresses that start with TEST-, which cannot receive funds.

deposit_memo*|

A memo that must be included with the transfer, when present.

refund_address*string
confidential*boolean

True when NEAR Intents quoted this attempt as a confidential intent (private payments). The public checkout state then leaves out destination_transactions, so the payment cannot be linked to the payout.

deadline*string

Send before this time.

Formatdate-time
time_estimate_seconds*integer
deposited_amount*string|null
refunded_amount*string|null
refund_fee*|

Fee NEAR Intents kept when it returned the payment, in the payment's coin. Set only for refunded payments.

refund_reason*string|null
origin_transactions*array<>
destination_transactions*array<>
correlation_id*string

NEAR Intents reference for support.

quote_signature*string

NEAR Intents signature of the quote, kept as proof of the terms.

created_at*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/api/v1/invoices/string/quote' \  -H 'Content-Type: application/json' \  -d '{  "origin_asset": "nep141:arb-0xaf88d065e77c8cc2239327c5edb3a432268e5831.omft.near",  "refund_address": "0x1111111111111111111111111111111111111111"}'
Example Response
{  "id": "quo_4kT9mW2xQpL7vN3rB8sZ",  "object": "payment",  "status": "pending_deposit",  "coin": {    "asset_id": "string",    "symbol": "string",    "blockchain": "string",    "chain_name": "string",    "decimals": 0  },  "amount_in": "string",  "amount_in_base": "string",  "min_amount_in_base": "string",  "amount_in_usd": "string",  "deposit_address": "string",  "deposit_memo": "string",  "refund_address": "string",  "confidential": true,  "deadline": "2019-08-24T14:15:22Z",  "time_estimate_seconds": 0,  "deposited_amount": "string",  "refunded_amount": "string",  "refund_fee": "string",  "refund_reason": "string",  "origin_transactions": [    {      "hash": "string",      "url": "string"    }  ],  "destination_transactions": [    {      "hash": "string",      "url": "string"    }  ],  "correlation_id": "string",  "quote_signature": "string",  "created_at": "2019-08-24T14:15:22Z"}