Endpoint
Request
Headers
Header | Required | Description |
---|---|---|
Authorization | Yes | Bearer token with your API key |
Content-Type | Yes | Must be application/json |
Idempotency-Key | No | Unique key to prevent duplicate payments |
Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
amount | integer | Yes | Payment amount in cents (e.g., 10000 = 0.50) |
currency | string | Yes | Currency code. Currently only "usd" is supported |
return_url | string | Yes | URL to redirect customer after payment completion |
customer_email | string | No | Customer’s email address for receipts |
customer_name | string | No | Customer’s name for receipts |
metadata | object | No | Custom data to attach to this payment (max 50 keys) |
Example Request
Response
Success Response (200 OK)
Response Fields
Field | Type | Description |
---|---|---|
id | string | Unique payment identifier |
amount | integer | Payment amount in cents |
currency | string | Currency code |
status | string | Payment status: pending , completed , failed , or refunded |
checkout_url | string | URL to redirect customer for payment |
customer_email | string | Customer’s email (if provided) |
customer_name | string | Customer’s name (if provided) |
metadata | object | Custom data attached to payment |
created_at | string | ISO 8601 timestamp when payment was created |
Error Responses
400 Bad Request
Invalid parameters:- Amount less than 50 cents
- Invalid currency (only USD supported)
- Missing required fields
- Invalid return_url format
- Metadata exceeds 50 keys
401 Unauthorized
Invalid or missing API key:- API key not provided in Authorization header
- API key format is incorrect
- API key doesn’t exist or was deleted
- Shop is inactive
429 Too Many Requests
Rate limit exceeded:500 Internal Server Error
Server error:Next Steps
After creating a payment:-
Redirect customer to checkout_url
- Customer completes payment on the white-labeled checkout page
-
Customer redirected back to your return_url with payment ID:
- Webhook sent to your server with payment details (if configured)
-
Verify payment status by retrieving the payment:
Implementation Examples
Node.js / Express
PHP
Python / Flask
Metadata Usage
Use metadata to attach custom data to payments. This data is returned in webhooks and when retrieving payments.Best Practices
Metadata Limits
- Maximum 50 keys per payment
- Keys must be strings
- Values must be strings, numbers, or booleans
- Total metadata size limit: 5KB
Idempotency
Prevent duplicate payments by including an idempotency key:- Safe to retry failed requests
- Prevents duplicate charges if request times out
- Guarantees exactly-once payment creation