Creates a new payment. Requires an idempotency key to prevent duplicate payments on retry.
curl -X POST \
https://api.example.com/rest-api/v0/test-payment \
-H 'Content-Type: application/json' \
-H 'Client-Key: your-api-key' \
-H 'Client-Secret: your-api-secret' \
-H 'Idempotency-Key: payment_123456_unique_key' \
-d '{
"amount": 100.00,
"currency": "USD",
"description": "Test payment for order #12345",
"customerId": "cus_12345"
}'
{
"id": "pay_abc123xyz456",
"amount": 100.00,
"currency": "USD",
"status": "succeeded",
"timestamp": "2023-07-01T12:00:00.000Z"
}
The exact same response will be returned for any duplicate request with the same idempotency key, without creating a new payment.
Network failure during payment submission:
If you retry with same key but different parameters (e.g., different amount), youβll receive a 409 Conflict error.
Your secret API key. Keep this secure and never expose it in client-side code.
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"
Payment processed successfully
The response is of type object
.