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., USDC-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., USDC-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, USDC's base unit is 1/1,000,000 of a USDC (1,000,000 base units = 1 USDC). To purchase 100 USDC, set receive_amount to 100000000.

ℹ️

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": "USDC-USD",
  "side": "buy",
  "receive_amount": 100000000,
  "deliver_amount": 10005,
  "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