Create buyback offer

POST /api/v1/mystery/buyback/:purchase_id packs:buyback

Makes a buyback offer on a card at 85% of its value (override with offer_price_usdc). The current holder accepts it and receives the payout minus the marketplace fee — either from their own wallet, or gaslessly via the accept endpoints below. The path accepts a purchase id OR an on-chain token id (works for cards you distributed yourself, raw or graded; those return value_usdc / value_source). Fill in either input below; purchase ids take precedence.

Try it POST /api/v1/mystery/buyback/ money

These inputs are shared across all docs pages — an id entered here carries over.

request body
object · 0 keys
{}
response

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 (tracks the inputs above)
curl -X POST 'https://service.rip.fun/api/v1/mystery/buyback/' \
  -H 'X-API-Key: rip_…' \
  -H 'Content-Type: application/json' \
  -d '{}'

Request fields

FieldTypeRequiredDescription
token_idstringPurchase path: required when the purchase revealed multiple items (ignored on the token-id path — the path segment IS the token)
item_typestringToken-id path only: "CARD" or "GRADED_CARD" — disambiguates a numeric id shared by a raw and a graded card
offer_price_usdcstringOverrides the default 85%-of-value price (can never exceed the value)

Response fields (data)

FieldDescription
offer_signature / offer_idThe signed marketplace offer
price / price_usdcGross offer price
seller_receives_usdc / marketplace_fee_usdcNet to the holder vs rip.fun fee
requester / target / deadlinerip.fun signer, current holder, offer expiry
value_usdc / value_sourceToken-id path only: what was priced and from which source (card_raw_price / buyback_oracle / graded_market_price)

Errors

StatusCodeWhen
409value_unknownno market price available for the card
409not_fulfilledpurchase path: purchase has not revealed yet
404token_not_foundtoken-id path: neither a purchase of yours nor a known token
409offer_existsthis token already has an active offer
409ambiguous_tokentoken-id path: id is both a raw and a graded card — pass item_type
409nft_not_whitelistedthe marketplace doesn’t trade that NFT contract in this environment yet — the offer is refused up front rather than signed un-acceptably

See Errors for the response envelope and the full code list.

Flow

  1. Partner: POST /buyback/:id with a purchase id or a token id → a buyback offer at 85% of value
  2. End user (holder): accepts it — from their own wallet, or gaslessly via the accept endpoints — and receives USDC minus the fee
  3. rip.fun: the card is sent to your pool wallet; the fronted USDC is settled daily (GET /billing)
  4. Webhooks: buyback.confirmed → buyback.card_transferred (or buyback.transfer_held if no pool wallet is set)