Reference
Errors
YesPaisaPay uses conventional HTTP status codes. 2xx means success; 4xx means a problem with the request; 5xx means something went wrong on our side.
Error shape
{
"error": {
"type": "card_error",
"code": "card_declined",
"message": "Your card was declined.",
"decline_code": "insufficient_funds",
"request_id": "req_1H..."
}
}Status codes
| Code | Meaning |
|---|---|
| 200 | OK |
| 400 | Bad request — missing or invalid parameter |
| 401 | Unauthorized — missing or invalid API key |
| 402 | Payment required — the charge was declined |
| 404 | Not found |
| 409 | Conflict — idempotency key reused with a different body |
| 429 | Rate limited — back off and retry |
| 5xx | Something went wrong on our end |
Retrying safely
Retries are safe if you pass an Idempotency-Key header. We'll return the original response for any retry within 24 hours, so you can confidently retry network errors without double-charging customers.
