Api reference
Create a checkout session
Create a checkout session for an invoice or product.
Related endpoints
GET /checkout-sessions/{id}— Retrieve a checkout sessionPOST /checkout-sessions/{id}/expire— Expire a checkout session
Common errors
400 invalid_request— malformed payload or failed validation.401 unauthenticated— missing, malformed, or revoked API key.404 resource_missing— the referenced resource does not exist or is not visible to your key.
Idempotency
Pass an Idempotency-Key header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see the idempotency guide.
x-api-key<token>
Your RevKeen API key (powered by Unkey). Get it from Dashboard > Settings > API Keys. Use rk_sandbox_* for test mode and rk_live_* for production.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.revkeen.com/v2/checkout-sessions" \ -H "x-api-key: $REVKEEN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "invoiceId": "inv_123", "productId": "prod_123", "amountMinor": 1000, "currency": "USD", "successUrl": "https://example.com/success", "cancelUrl": "https://example.com/cancel", "allowedMethods": [ "card", "in_store" ], "companionDeviceId": "00000000-0000-0000-0000-000000000000" }'{
"data": {
"id": "string",
"url": "string",
"publicToken": "string",
"amountMinor": 0,
"currency": "string",
"customerId": "string",
"expiresAt": "string",
"allowedMethods": [
"card",
"in_store"
],
"selectedMethod": null
},
"requestId": "string"
}{
"error": "string"
}{
"error": "string"
}{
"error": "string"
}