Buy an offer
Prices the offer and pays for it.
payment_source: wallet. If the wallet (including any overdraft) covers
the price, it is debited at once, the quote is fulfilled, and an order is
created and fulfilled in the background: poll the order or wait for its
webhook. If not, nothing is charged and the response is 402. While the
account is overdue its overdraft is frozen, and the response is
403 account_overdue until the debits past their terms are paid down.
usdt, usdc or bank_transfer. The quote is awaiting_funds and
payment says where to send price. A stablecoin quote names the network
it will be paid on, and payment gives the account's address on that network.
It waits even when the wallet already holds enough: money already there is
spent only with payment_source: wallet. Every payment credits the wallet, and
waiting quotes are then paid from the balance (never from an overdraft): the
one priced exactly at what arrived first, then the oldest that fit.
Unpaid by expires_at, it becomes expired; money that arrives later stays
in the wallet.
If the offer cannot be priced right now, nothing is created or charged and the
response is 502 fulfillment_unavailable: retry shortly. If the rail fails
while the quote is being readied (giving the account a deposit address, or
minting a Lightning invoice), the response is 502 rail_unavailable: retry
shortly, or pick another payment_source.
Authorization
ApiKey An account API key, sent as Authorization: Bearer tz_live_…. The prefix
selects the mode: tz_test_ for sandbox, tz_live_ for real money.
In: header
Header Parameters
A client-generated key, unique per intended operation, that makes this request
safe to retry. The same key returns the original response; the same key with a
different request is rejected. Missing: 400 idempotency_key_required.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/quotes" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "offer_id": "off_jp_5gb_30d", "payment_source": "wallet" }'{ "id": "string", "object": "quote", "status": "awaiting_funds", "offer_id": "string", "payment_source": "wallet", "price": { "amount": 1450, "currency": "USD" }, "wallet": { "debited": 0, "balance_after": 0 }, "payment": { "rail": "usdt", "amount": { "amount": 1450, "currency": "USD" }, "asset": "USDT", "network": "bep20", "asset_amount": "14.40", "destinations": [ { "id": "string", "object": "funding_destination", "type": "bank_account", "bank_name": "string", "account_number": "string", "account_name": "string" } ], "lightning": { "id": "string", "bolt11": "lnbc144u1p...", "payment_hash": "string", "amount_sats": 22656, "expires_at": "2019-08-24T14:15:22Z" } }, "expires_at": "2019-08-24T14:15:22Z", "order_id": "string", "metadata": { "property1": "string", "property2": "string" }, "created_at": "2019-08-24T14:15:22Z"}