Skip to navigation

Prepare token approval

Prepare token approval.

Credential: Customer session

Before you call

  • A customer session for the same partner, integration, customer, wallet and chain.
  • Use the original preparationId and the customer’s registered wallet.
  • Keep the signed bytes and any known hashes if you need to recover an uncertain submission.
  • Set an Idempotency-Key and reuse it for an identical retry.

Prepares the token approval transactions that a SELL needs before escrow creation. Use the owning customer session. Sinbad may reuse an allowance snapshot for up to 30 seconds and invalidates it after a confirmed approval or reset. A snapshot is advisory, because Sinbad always simulates the current chain state before it broadcasts.

The response holds no transactions when the customer needs no approval: on a BUY, or when the allowance is already enough. On a SELL, it returns the exact approval, preceded by an allowance reset when a non-zero allowance is too small.

Run the transactions in order and wait for each to be CONFIRMED before the next. You can execute them with the wallet, submit the signed bytes of an ordinary wallet transaction to POST /v1/transactions, or broadcast externally and report the hash there. An approval does not create a trade and does not extend the breakdown’s deadline.

Confirm with Sinbad that this endpoint is enabled in your environment.

Errors

StatusCodeWhat to do
400VALIDATION_ERRORCorrect the fields reported in details before retrying.
401UNAUTHENTICATEDCreate a new customer session or use a valid server credential.
403FORBIDDENCheck credential ownership, integration and the supplied Origin.
404NOT_FOUNDCheck the resource ID. A resource that belongs to someone else also returns 404.
409CONFLICTRead the current state again before you prepare or retry.
503UPSTREAM_ERRORRetry with backoff; preserve the same idempotency key for a repeated mutation.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

breakdownIdstringRequired

Headers

Idempotency-KeystringRequiredformat: "^[A-Za-z0-9_-]{8,128}$"

Request

This endpoint expects an object.

Response

Separate approval calls in execution order.
approvalRequiredboolean
approvalobject
transactionslist of objects

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
503
Service Unavailable Error