Start a purchase
Purchase
Start a purchase
Initiates a purchase and returns a session ID to poll for fulfillment.
POST
Start a purchase
Initiates a purchase from a pack. Returns a
See the item shape reference for the full canonical schema.
session_id that you pass to /api/v1/vm/buy/status to poll for the pulled items.
Prerequisites: The pack must have
in_stock: true and enable: true. amount must be between 1 and the pack’s max_per_mint.Request body
Pack ID from
/api/v1/vm/available.Number of pulls. Must be
≥ 1 and ≤ max_per_mint.Partner-defined identifier for the end user making the purchase. Pulled items are associated with this
user_id for inventory lookup, sellback, and shipping.Example request
Response
Unique session identifier. Pass to
/api/v1/vm/buy/status to poll for fulfillment.Array of pulled items.
Item identifier. Used as
item_id in /api/v1/vm/buyback.Item metadata:
name, image, back_image, and attributes.CDN URL for the card back image, or
null when not available.The sellback value in USD.
Item source. One of:
enft, ebay, fanatics, alt, external.On-chain mint address.
null for items that haven’t been minted (in sandbox, always null for ebay-sourced items).On-chain collection address.
Token standard for on-chain items.
Errors
| Status | Body | Cause |
|---|---|---|
400 | { "error": "Claw machine is out of stock" } | Pack is not currently purchasable. See note below. |
400 | { "error": "Amount must be greater than 0" } | Invalid amount |
400 | { "error": "Amount must be less than or equal to N" } | Exceeds max_per_mint |
400 | { "error": "VM not found" } | Unknown pack ID |
400 | { "error": "user_id is required" } | Missing user_id |
500 | { "error": "Error during transaction" } | Internal server error |
Claw machine is out of stock is returned when the pack is not currently purchasable. In sandbox, this single error covers three distinct underlying conditions: enable: false, in_stock: false, or no candidate listings available in any rarity tier at request time. Production may differentiate these with distinct messages in the future. Partners should treat any “out of stock” 400 as terminal for this pack and re-fetch /api/v1/vm/available before retrying.Sandbox notes
In sandbox, item selection isMath.random()-weighted across the pack’s rarity_distribution.weight field, then a uniform random pick within the chosen tier’s FMV range. Items are not reserved or removed from inventory. The same listing can be returned to other user_ids on subsequent calls. Sandbox buy/init also fulfills synchronously, so the items are already pulled by the time the response arrives. Calling buy/init twice with the same body produces two distinct session_ids and stacks the items.