logo
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

CodeMeaning
200OK
400Bad request — missing or invalid parameter
401Unauthorized — missing or invalid API key
402Payment required — the charge was declined
404Not found
409Conflict — idempotency key reused with a different body
429Rate limited — back off and retry
5xxSomething 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.