Mystery Pack API

A B2B API for selling mystery card packs to your end-users. List tiers and odds, sell packs (from a credit balance you hold or from the user's own wallet), reveal the cards, offer instant buybacks, and redeem cards for physical shipment. Every action is attributed to your partner key.

Base URLs

EnvironmentOriginNotes
Sandbox (staging)https://staging-service.rip.funBase Sepolia — what the "Try it" runners in these docs call
Productionhttps://service.rip.funBase mainnet

All endpoints live under the /api/v1 base path and require an X-API-Key. All money is USDC with 6 decimals: balances are integer micros returned as strings ("12500000" = 12.5 USDC), plus a *_usdc decimal string for display.

Two custody models

  • Custodial (default) — the end-user funds a credit balance rip.fun holds. One POST debits it and rip.fun makes the purchase. The user never signs anything.
  • Non-custodial — the API returns the transactions to send (prepare), the end-user sends them from their own wallet, and you record the transaction (submit). rip.fun never touches their funds.

Living documentation

Every endpoint page in the API Reference embeds a live runner: tweak the request inputs, press Run, and see the real staging response (status + latency), plus a ready-to-copy curl snippet that tracks your inputs. The partner API key stays on this demo's server — the browser only ever talks to a whitelisted proxy.

For the full product experience — connect a wallet, buy a pack, reveal the card, sell it back or redeem it physically — open the Storefront demo.

Quick start

  1. Get a partner API key from rip.fun (see Authentication).
  2. List tiers and odds to render your shop.
  3. Purchase: custodial or non-custodial prepare → user signs → submit.
  4. Poll purchase status (or use webhooks) until FULFILLED, then show the revealed items.
  5. Offer a buyback or a physical redemption.

The three multi-party sequences (who signs what, which webhooks fire) are spelled out in End-to-end flows.

Get testnet funds (Base Sepolia)

To actually run the sandbox flows — buy a pack, sell it back, redeem it — your test wallet needs a little Base Sepolia ETH for gas plus USDC to pay for packs. Staging's payment token is Circle's native Base Sepolia USDC at 0x036CbD53842c5426634e7929541eC2318f3dCF7e — the same token Circle's faucet dispenses.

Tier 1 on staging costs $1 USDC, so a single Circle claim covers ~20 test purchases.