Skip to main content
POST
/
v1
/
cashout-requests
/
{id}
/
commit
curl -X POST https://api.totalis.trade/v1/cashout-requests/c3d4e5f6-7890-abcd-ef12-34567890abcd/commit \
  -H "X-API-Key: $TOTALIS_API_KEY"
{
  "data": {
    "cashout_request_id": "c3d4e5f6-7890-abcd-ef12-34567890abcd",
    "status": "committed",
    "chain_sig": "5Nx7...buybackSig",
    "new_locked_micro": 0
  }
}
{
  "error": {
    "code": "SERVICE_UNAVAILABLE",
    "message": "Cashout is being processed; please check back",
    "details": { "reason": "lane_unreachable", "indeterminate": true }
  }
}
Accept the market maker’s live buyback quote and drive the early cashout on chain through the vault buyback lane. The quote is the price — there’s no MM confirm round trip. Signatures are obtained server side via Privy at execution. On success, the position is bought back, your stake is released, and the RFQ flips to bought_back. This endpoint is idempotent per (request, user): a committed result is cached for 5 minutes and replayed with 200 OK.
Indeterminate commits never double spend. If the on chain buyback’s outcome is unknown (timeout or transient RPC failure), the request stays committing and returns 503 with details.indeterminate: true. A reconciler resolves it against on chain state — do not treat a 503 as a failure or assume nothing happened. Reopen the stream and wait for the terminal status. A determinate failure (409) means nothing landed; you may retry.

Authentication

API key required. Pass your API key in the X-API-Key header.
X-API-Key: <your-api-key>
A Privy JWT (Authorization: Bearer <jwt>) is also accepted — see Authentication.

Path parameters

id
string
required
The cashout request ID (UUID).

Request body

No body. The committed quote is the live best_quote on the request.

Response

Returns 201 Created on a fresh commit, or 200 OK when replaying a cached idempotent result.
data
object

Errors

StatusCodeDescription
401UNAUTHORIZEDMissing or invalid API key.
403FORBIDDENYou do not own this cashout request (details.reason: not_owner).
404NOT_FOUNDCashout request not found.
409CONFLICTNo live quote (quote_expired), request not active, missing wallet info (missing_wallet), already locked, or a determinate on chain failure. See details.reason.
410GONEThe cashout request expired before commit.
503SERVICE_UNAVAILABLEIndeterminate — the buyback may have landed. details.indeterminate is true and details.reason is e.g. lane_unreachable / buyback_in_flight; the request stays committing for the reconciler. Don’t retry blindly.
curl -X POST https://api.totalis.trade/v1/cashout-requests/c3d4e5f6-7890-abcd-ef12-34567890abcd/commit \
  -H "X-API-Key: $TOTALIS_API_KEY"
{
  "data": {
    "cashout_request_id": "c3d4e5f6-7890-abcd-ef12-34567890abcd",
    "status": "committed",
    "chain_sig": "5Nx7...buybackSig",
    "new_locked_micro": 0
  }
}
{
  "error": {
    "code": "SERVICE_UNAVAILABLE",
    "message": "Cashout is being processed; please check back",
    "details": { "reason": "lane_unreachable", "indeterminate": true }
  }
}