Checkout (public)

Compare payment costs

Prices the invoice in up to five coins without creating deposit addresses. The checkout uses it to rank the coins a connected wallet holds, and, without refund_address, to check a chosen coin before the customer gives an address. Each entry has either the amount to send or the reason the coin cannot be used; a refused route also carries minimum_usd when NEAR Intents names a minimum. When NEAR Intents does not answer, or this server's 1Click request budget is taken by payments, an entry comes back with ok: false, temporary: true and "The payment network did not answer. Try again." When the business has private payments on and they cannot be quoted, the whole request fails with a quote_unavailable error, because no coin can be used. Rate limits: 10 per minute per invoice, and 25 coins per minute per IP address and 100 coins per minute per network (each request counts the number of different coins it compares).

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

Path Parameters

id*string

Invoice id, starting with inv_.

Request Body

application/json
  1. body
origin_assets*array<>
Items1 <= items <= 5
refund_address?string

The payer's address on each coin's chain. Leave it out to check whether the coins can pay and what they cost before the payer gives an address.

Length1 <= length <= 200

Response Body

One estimate per distinct coin.

application/json
  1. response
object*string
data*array<|>
Example Request
curl -X POST 'https://example.com/api/v1/invoices/string/estimate' \  -H 'Content-Type: application/json' \  -d '{  "origin_assets": [    "string"  ]}'
Example Response
{  "object": "list",  "data": [    {      "asset_id": "string",      "ok": true,      "amount_in": "string",      "amount_in_base": "string",      "amount_in_usd": "string"    }  ]}