Skip to content
PitishaAPI

Errors

The error object, status codes and what to do about each.

Pitisha uses standard HTTP status codes. Anything outside the 200s means the request did not do what you asked.

The error object

{
  "error": {
    "code": "invalid_request",
    "message": "amount must be a positive integer.",
    "param": "amount",
    "request_id": "req_4k2m9x"
  }
}
FieldMeaning
codeA stable machine-readable string. Branch on this, not on message.
messageA human explanation. It can change, so do not parse it.
paramThe field at fault, when there is one.
request_idQuote this when you contact support.

Codes

CodeStatusWhat it meansWhat to do
invalid_request400A parameter is missing or the wrong shape.Read error.param and fix that field.
authentication_failed401The API key is missing, wrong or revoked.Check you send Authorization: Bearer and use the key for the right mode.
permission_denied403Your key or role cannot do this.Use a key with the access you need, or ask an owner.
not_found404The object does not exist in this mode.Check the id, and that you are not mixing sandbox and live ids.
idempotency_conflict409The Idempotency-Key was used with different parameters.Use a new key for a different request.
insufficient_funds422The wallet cannot cover the amount plus the fee.Top up the wallet or lower the amount.
wallet_frozen422The wallet is frozen.Unfreeze it in the portal or with PATCH /v1/wallets/{id}.
shortcode_inactive422The shortcode is pending or suspended.Wait for it to become active, or use another shortcode.
rate_limited429Too many requests.Wait for the seconds in the Retry-After header.
api_error500Something went wrong on our side.Retry with the same Idempotency-Key. If it persists, contact support with the request id.

Failed payments are not errors

A customer declining a payment is a normal result. The request succeeds with 201, and the collection later ends as failed with a failure object. Handle it from the collection.failed webhook.