/api/v1/mystery/buyback/:purchase_id packs:buybackCreates a system-signed MARKETPLACE offer on a card (so rip.fun collects the marketplace fee) at 85% of its value by default. Only cards valued $10–$100 are eligible. The current holder accepts the offer from their own wallet and receives proceeds net of fee. The path segment accepts EITHER a purchase id OR an on-chain token id: a value matching one of your purchases runs the purchase-linked path, otherwise it is treated as a token id and behaves exactly like POST /buyback (token-first — works for cards distributed through your own system, raw + graded, with value_usdc/value_source in the response). Fill in EITHER input below. Purchase ids take precedence.
POST /api/v1/mystery/buyback/ money These inputs are shared across all docs pages — an id entered here carries over.
{}Not run yet — press Run to make a live call against https://staging-service.rip.fun (through this demo's server-side proxy; the API key never reaches the browser).
curl -X POST 'https://staging-service.rip.fun/api/v1/mystery/buyback/' \
-H 'X-API-Key: rip_v1_…' \
-H 'Content-Type: application/json' \
-d '{}' | Field | Type | Required | Description |
|---|---|---|---|
token_id | string | — | Purchase path: required when the purchase revealed multiple items (ignored on the token-id path — the path segment IS the token) |
item_type | string | — | Token-id path only: "CARD" or "GRADED_CARD" — disambiguates a numeric id shared by a raw and a graded card |
offer_price_usdc | string | — | Overrides the default 85%-of-value price (can never exceed the value) |
data)| Field | Description |
|---|---|
offer_signature / offer_id | The signed marketplace offer |
price / price_usdc | Gross offer price |
seller_receives_usdc / marketplace_fee_usdc | Net to the holder vs rip.fun fee |
requester / target / deadline | rip.fun signer, current holder, offer expiry |
value_usdc / value_source | Token-id path only: what was priced and from which source (card_raw_price / buyback_oracle / graded_market_price) |
| Status | Code | When |
|---|---|---|
| 409 | not_eligible | card value outside the $10–$100 buyback range |
| 409 | value_unknown | no market price available for the card |
| 409 | not_fulfilled | purchase path: purchase has not revealed yet |
| 404 | token_not_found | token-id path: neither a purchase of yours nor a known token |
| 409 | offer_exists | another active offer already targets that token (double-payout guard) |
| 409 | ambiguous_token | token-id path: id is both a raw and a graded card — pass item_type |
See Errors for the response envelope and the full code list.