Process a test payment
Creates a new payment. Requires an idempotency key to prevent duplicate payments on retry.
Idempotency Key Best Practices
- Generate unique keys: Use UUIDs or similar unique identifiers, prefixed with a descriptive operation name
- Store keys client-side: Save the key with the original request so you can retry with the same key
- Key format: Between 6-64 alphanumeric characters
- Expiration: Keys expire after 24 hours by default
- Use case: Perfect for ensuring payment operations are never processed twice, even during network failures
Example Request (curl)
Example Response (First Request)
Example Response (Duplicate Request)
The exact same response will be returned for any duplicate request with the same idempotency key, without creating a new payment.
Retry Scenario Example
Network failure during payment submission:
- Client creates payment request with idempotency key: “payment_123456_unique_key”
- Request begins processing, but network connection fails before response received
- Client retries the exact same request with the same idempotency key
- Server detects duplicate idempotency key and returns the result of the first request
- No duplicate payment is created
If you retry with same key but different parameters (e.g., different amount), you’ll receive a 409 Conflict error.
Authorizations
Your secret API key. Keep this secure and never expose it in client-side code.
Headers
Unique key to ensure the request is idempotent. If a request with the same key is sent multiple times, only the first will be processed, and subsequent requests will return the same response.
"payment_123456_unique_key"
Body
Response
Payment processed successfully
