/api/v1/mystery/sellback/prepare packs:buyback Returns unsigned calldata for the holder to sign from their own wallet — CardOS never holds the NFT and never broadcasts for them. Up to two calls: a one-time Card.setApprovalForAll (included only when approval_needed; the pool does safeTransferFrom inside the sale, so without it the whole tx reverts, and it never needs repeating for that wallet), then MysteryComboPool.acceptCardBuyback. min_total_usdc is on-chain slippage protection: the pool re-reads the oracle at execution time, so a minimum equal to the quote reverts on any downward drift — the default allows 1%. Every token must be eligible or this fails 409, because the on-chain call is all-or-nothing.
POST /api/v1/mystery/sellback/prepare write These inputs are shared across all docs pages, so an id entered here carries over.
{
"wallet_address": "0x0000000000000000000000000000000000000000",
"token_ids": []
}Not run yet. Press Run to make a live call against https://service.rip.fun (through this demo's server-side proxy; the API key never reaches the browser).
curl -X POST 'https://service.rip.fun/api/v1/mystery/sellback/prepare' \
-H 'X-API-Key: rip_…' \
-H 'Content-Type: application/json' \
-d '{"wallet_address":"0x0000000000000000000000000000000000000000","token_ids":[]}' | Field | Type | Required | Description |
|---|---|---|---|
wallet_address | string | yes | The holder signing the sale |
token_ids | string[] | yes | Cards to sell (max 50, all must be eligible) |
min_total_usdc | string | — | Minimum acceptable total; defaults to the quote less 1% |
slippage_bps | int | — | Alternative to min_total_usdc — tolerance in bps (default 100) |
data)| Field | Description |
|---|---|
calls[] | to / data / kind / description, in order — send them from the holder’s wallet. kind is machine-readable: set-approval-for-all (present only when the one-time approval is missing), then sellback |
min_total / min_total_usdc | The slippage floor encoded into the call |
quoted_payout_usdc | What the quote said at prepare time |
| Status | Code | When |
|---|---|---|
| 409 | window_expired | a card’s buyback window has closed — it can never be sold back |
| 409 | wrong_holder | the wallet is not the card’s original recipient |
| 409 | value_unknown | the oracle has no price for the card’s group (the contract would revert) |
| 409 | insufficient_liquidity | the buyback pool cannot cover the payout right now |
See Errors for the response envelope and the full code list.