ResellersReferenceReseller API
Create Purchase
POST
/storefront-public/api/v1/purchasesPrices the lines, holds the total against balance plus credit limit, and mints the keys. With expectedTotalMinor, a total that differs from it refuses the purchase with QuoteChangedError, carrying the new total. A purchase over the approval threshold waits for the seller with its funds held. A provider that cannot be reached leaves it processing; reading it retries.
Authorization
bearer AuthorizationBearer <token>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
idempotencyKey*string
Length
4 <= length <= 100lines*array<>
Items
1 <= items <= 20note*|null
tags?array<string>
Items
items <= 20expectedTotalMinor?integer
Range
0 <= value <= 9007199254740991Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/storefront-public/api/v1/purchases" \ -H "Content-Type: application/json" \ -d '{ "idempotencyKey": "string", "lines": [ { "skuId": "string", "quantity": 1 } ], "note": "string" }'{ "purchase": { "id": "string", "status": "pending_approval", "totalMinor": 0, "chargedMinor": 0, "currency": "AED", "lines": [ { "id": "string", "skuId": "string", "skuName": "string", "quantity": 1, "unitPriceMinor": 0, "lineTotalMinor": 0, "status": "pending", "mintedCount": -9007199254740991, "failureReason": "string" } ], "note": "string", "tags": [ "string" ], "idempotencyKey": "string", "createdAt": "string", "completedAt": "string", "resale": { "buyer": { "membershipId": "string", "displayName": "string" }, "soldFor": { "totalMinor": 0, "chargedMinor": 0 } }, "awaitingApproval": { "_tag": "Store" } }, "licenses": [ { "id": "string", "code": "string", "skuId": "string", "skuName": "string", "purpose": "sale", "purchaseId": "string", "status": "unused", "durationMinutes": 1, "activatedAt": "string", "expiresAt": "string", "holderDisplay": "string", "lastSeenAt": "string", "note": "string", "tags": [ "string" ], "refreshedAt": "string", "createdAt": "string" } ]}