Buy an item
/v1/marketplace-items/{marketplaceItemKey}/purchasesBuys one unit of an item for a player: spends its price in points and grants everything the item contains. Idempotent per player when an idempotency key is supplied, a retry returns the original purchase instead of charging again.
Authorization
ApiKey Paste a project API key (no 'Bearer ' prefix). Create one in the dashboard under API keys.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Request body for a purchase. The project environment is not part of the body , it is resolved from the API key, and the item is addressed by the key in the path.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/marketplace-items/string/purchases" \ -H "Content-Type: application/json" \ -d '{ "playerId": "string" }'{ "purchaseId": "e9b59bb6-ba5b-48ce-918b-5f842e450f10", "marketplaceItemKey": "string", "contents": [ { "catalogItemKey": "string", "value": { "type": "number", "value": 0.1 } } ], "occurrenceNumber": 0, "pricePaidInPoints": 0, "remainingBalance": 0}