Quick start
By the end of this page you will have created a customer session, found an offer, created a breakdown and submitted the signed escrow transaction for a BUY trade. The examples use the staging environment, and the full flow is in the Buy walkthrough.
Before you start
You need the following from Sinbad onboarding and from your own systems.
1. Create a customer session
Your server creates a session for the customer who is signed in to your product. The first request for a customer must include their full name, a verified email address, a wallet address and a chain ID. Later requests need only integrationId and partnerUserId.
Sinbad returns the session token and its lifetime.
Pass the sessionToken to your customer app. Every call in the remaining steps uses it as the bearer credential. See Create a session for returning customers and quotas.
Never send the partner secret to a browser or mobile app. Only your server calls POST /v1/sessions.
2. Save a payment account
The customer needs a saved fiat account for the payment method they will use.
- Read the catalog with
GET /v1/payment-methods/catalog. Each method lists itsrequiredFieldsand the field that identifies an account. - Collect those fields from the customer and submit them with
POST /v1/me/payment-methods.
Sinbad matches offers only to a saved account that is active and uses the same catalog payment method. See Saved payment accounts.
3. Find an offer
Ask for an offer with POST /v1/offers/best. This example looks for a BUY of 100 USDT, paid by bank transfer.
The response lists matching instant offers and, if none matches exactly, alternatives. Each offer includes its pricing and a breakdownInput that you send unchanged in the next step.
4. Create a breakdown
Create the breakdown with POST /v1/trade-breakdowns. Send the offer’s breakdownInput exactly as received, with an Idempotency-Key header that you reuse only for an identical retry.
Sinbad responds with 201. The response contains the breakdownId, status: "AWAITING_FUNDING", an expiresAt 300 seconds (5 minutes) after creation, the final numbers in tradeDetails, and the escrowTransaction for the customer’s wallet to sign. Show tradeDetails to the customer before they sign.
A breakdown holds the customer’s open trade for that side until the trade ends, the customer opens a dispute or the breakdown expires. See Offers and breakdowns.
5. Sign, submit and track
-
Have the customer’s registered wallet sign
escrowTransaction. Keep itsto,dataandvalueunchanged. -
Send the signed transaction with
POST /v1/transactions. Include thepreparationIdand anIdempotency-Key. -
Poll
GET /v1/transactions/{preparationId}untiltransaction.statusisCONFIRMED, or poll the breakdown untilstatusisCONFIRMEDandtradeIdis set.
A 202 response means Sinbad accepted the transaction and started tracking it. The trade exists, with status CREATED, only after the escrow is confirmed on chain. Sinbad also detects funding directly from the chain, so a submission you miss is still picked up.
Next steps
- Follow the whole trade in the Buy walkthrough or Sell walkthrough.
- Learn how signing, network fees and retries work in Wallets and gas.
- Receive updates without polling with Webhooks.