Submit purchase

POST /api/v1/instant/purchase/submit packs:purchase

Purchase step 2. After the user sends the buy-and-open transaction, record its hash so CardOS can correlate the on-chain events and track the delivery. The transaction is verified on-chain before anything is written — the packet type, price, request id and recipient are read from the receipt, never from the request — and re-submitting the same hash is idempotent. The cards land in the user’s own wallet; poll GET /instant/purchase/:purchase_id or consume the instant_purchase.* webhooks.

Try it POST /api/v1/instant/purchase/submit write

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

request body
object · 3 keys
{
  "wallet_address": "0x0000000000000000000000000000000000000000",
  "packet_type_id": 14,
  "transaction_hash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
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).

tracks the inputs above
curl -X POST 'https://service.rip.fun/api/v1/instant/purchase/submit' \
  -H 'X-API-Key: rip_…' \
  -H 'Content-Type: application/json' \
  -d '{"wallet_address":"0x0000000000000000000000000000000000000000","packet_type_id":14,"transaction_hash":"0x0000000000000000000000000000000000000000000000000000000000000000"}'

Request fields

FieldTypeRequiredDescription
packet_type_idnumberyesPacket type purchased
transaction_hashstringyes0x… hash of the broadcast buy-and-open tx (must be mined)
external_user_id / wallet_addressstringEnd-user identity to attribute the purchase to

Response fields (data)

FieldDescription
id / statusPurchase id; status SUBMITTED
packet_type_id / set_id / product_idWhat was bought
price / price_usdcPack price (micros + decimal)
transaction_hashThe recorded on-chain purchase

Errors

StatusCodeWhen
400missing_tx_hashtransaction_hash omitted
400invalid_packet_typepacket_type_id is not a known instant pack
400tx_unverifiedthe tx isn’t mined yet or isn’t a RipFunStore instant-pack purchase
400tx_revertedthe purchase transaction reverted on-chain
400packet_type_mismatchthe tx bought a different packet type than submitted
400purchaser_mismatchthe declared wallet isn’t the on-chain recipient
409tx_already_recordedthe tx already belongs to another purchase

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