/api/v1/mystery/purchase/prepare packs:purchaseNon-custodial purchase, step 1: returns unsigned USDC-approve + purchase calldata. The END USER signs and broadcasts these from their own wallet — rip.fun never touches their funds. Creates no rows.
POST /api/v1/mystery/purchase/prepare write These inputs are shared across all docs pages — an id entered here carries over.
{
"wallet_address": "0x0000000000000000000000000000000000000000",
"tier_id": 1
}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/purchase/prepare' \
-H 'X-API-Key: rip_v1_…' \
-H 'Content-Type: application/json' \
-d '{"wallet_address":"0x0000000000000000000000000000000000000000","tier_id":1}' | Field | Type | Required | Description |
|---|---|---|---|
wallet_address | string | yes | End-user wallet that will sign + pay |
tier_id | number | yes | Tier to purchase |
max_price_usdc | string | — | Price cap; defaults to the last-seen tier price |
data)| Field | Description |
|---|---|
chain_id / contract / payment_token | Chain + MysteryComboPool + USDC addresses |
max_price / max_price_usdc | Approval amount (micros + decimal) |
calls[] | {to, data, description} — approve USDC, then purchase the tier |
| Status | Code | When |
|---|---|---|
| 400 | invalid_tier | unknown tier_id |
See Errors for the response envelope and the full code list.