Create Payment
Payments
Create Payment
Create a new payment and generate a checkout URL
POST
Create Payment
Endpoint
Request
Headers
Body Parameters
Example Request
Response
Success Response (200 OK)
Response Fields
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
Testing
Use real API keys to create test payments with small amounts ($0.50 minimum). See Testing Guide for details.Related Resources
Retrieve Payment
Check payment status after creation
Webhook Overview
Get real-time payment notifications
Node.js Guide
Complete integration tutorial
Error Reference
Complete list of error codes