/api/v1/mystery/sellback/quote packs:read Per-card eligibility and payout for the NATIVE sell-back — the same loop a first-party rip.fun user runs, and the only sell-back path if you sell CardOS tiers. The pack price already funded the on-chain buyback float, so the payout comes from that float, the card restocks the pool it came from, and nothing is fronted or owed: a sell-back reduces your net revenue rather than creating a debt. Two rules the contract enforces and this endpoint pre-flights: only the ORIGINAL recipient may sell (a card that changed hands never can), and only before its buyback window expires. A batch is capped at 50 cards and is all-or-nothing on-chain, so check every token here before preparing.
POST /api/v1/mystery/sellback/quote These inputs are shared across all docs pages, so an id entered here carries over.
{
"wallet_address": "0x0000000000000000000000000000000000000000",
"token_ids": []
}{
"success": false,
"message": "Mystery partner API key required",
"error": "This endpoint requires an API key linked to a mystery partner account"
}curl -X POST 'https://service.rip.fun/api/v1/mystery/sellback/quote' \
-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 — must be the wallet that received the cards |
token_ids | string[] | yes | Card token ids to quote (max 50) |
data)| Field | Description |
|---|---|
items[].eligible / reason | Per card. reason: no_window (never pool-distributed, or already sold), wrong_holder, window_expired, value_unknown |
items[].expires_at | When this card’s buyback window closes — after it, sell-back is impossible |
items[].payout_usdc | What the pool pays: oracle group price × the pool’s discount permille |
items[].from_raw_card_pack | Whether the card came from a pack whose contents included a raw card (the revenue-share qualifying subset) |
approval_needed | Whether the holder still owes the one-time setApprovalForAll (prepare includes it as a call) |
sufficient_liquidity | Whether the pool currently holds enough USDC — the contract checks this too, so a false here is a revert you can avoid |
| Status | Code | When |
|---|---|---|
| 403 | not_tier_partner | your account sells your own inventory, so the pool sell-back does not apply |
| 400 | invalid_token_ids | token_ids is empty or not numeric token ids |
| 400 | too_many_tokens | more than 50 cards in one batch |
See Errors for the response envelope and the full code list.