Test helpers
Make a test purchase
Buys a published checkout in test mode with a test card, end to end: the order, its tax and its invoice, and the buyer’s receipt. Takes a test-mode key with `test-helpers:write`, a scope only a test-mode key can hold.
Authorization
bearer test-helpers:writeAuthorizationBearer <token>
A v1 API key; the scope named is the one the route needs.
In: header
Scope: test-helpers:write
Header Parameters
Idempotency-Key*string
Names the act so a retry under it lands on the stored answer (idempotency-key).
Length
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://example.com/v1/test-helpers/purchases" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "workspaceSlug": "string", "checkoutId": "a21b4d66-7585-4979-80ec-60ea35b35821", "snapshot": { "version": 1, "key": "string", "contentHash": "string" }, "lines": [ { "offerId": "42da58f8-9040-4cf5-98ce-bce9965cca0d", "pricePointId": "4dc5fd7f-0f4d-455c-ac31-f1e048ceeadf", "quantity": 1 } ], "customer": { "email": "user@example.com", "name": "string", "companyName": "string", "taxId": "string", "taxIdType": "string", "address": { "line1": "string", "line2": "string", "city": "string", "state": "string", "postalCode": "string", "country": "string" } }, "paymentMethod": "test_card_succeeds", "returnUrl": "http://example.com" }'{ "sessionId": "string", "orderId": "string", "invoiceId": "4f163819-178d-470c-a246-d6768476a6ec", "state": "string", "liveMode": false}