GuidesRecipesAPI ReferenceChangelog
Guides

Generate Quote

How do I generate a quote?

Use the POST /api/quotes endpoint

To generate a quote, you need:

  • A customer_guid -- retrieve it from GET /api/customers if needed.
  • A symbol in pair format (e.g., BTC-USD) -- see GET /api/symbols for supported symbols.

Quote validity

Quotes in sandbox are valid for 30 seconds. Production quotes are valid for 8 seconds.

Request parameters

Set the following fields in the request body:

  • customer_guid -- the customer's identifier
  • symbol -- the trading pair (e.g., BTC-USD)
  • side -- buy or sell
  • Either receive_amount or deliver_amount (not both):
    • receive_amount specifies how much crypto to receive
    • deliver_amount specifies how much fiat to spend

All amounts are in base units. For example, Bitcoin's base unit is 1 satoshi (100,000,000 satoshis = 1 BTC). To purchase 0.1 BTC, set receive_amount to 10000000.

ℹ️

Bank-level trading

To trade at the bank level instead of the customer level, provide bank_guid instead of customer_guid when creating the quote.

Response

An example POST /api/quotes response:

{
  "guid": "<quote_guid>",
  "customer_guid": "<customer_guid>",
  "symbol": "BTC-USD",
  "side": "buy",
  "receive_amount": 10000000,
  "deliver_amount": 293407,
  "fee": 0,
  "issued_at": "2022-05-11T19:47:52.048Z",
  "expires_at": "2022-05-11T19:48:22.048Z"
}
⚠️

Quote expiration

If you execute a trade after the quote has expired, the trade will fail.


What’s Next