Whish Money Whish MoneyDevelopers
Guides

Errors & response format

Every Whish Money API speaks the same envelope. Learn it once and error handling is the same everywhere.

The rule of thumb
  • HTTP is always 200
  • Branch on status then code
  • 500 means pending, not failed
  • Match code strings exactly

The response envelope

Every endpoint returns HTTP 200 with Content-Type: application/json and the same envelope. Branch on the status and code fields in the body, never on the HTTP status code.

FieldTypeDescription
statusBooleantrue when the call was accepted and processed. false when it was not.
codeStringnull whenever status is true. An operation-specific error code when status is false; the value 500 is special (see below). This field only ever reports errors, never a transaction's progress.
dialogObjectOptional title / message for display to the end user.
dataObjectOperation payload on success; shape varies per endpoint (and may be a scalar or null).
actions / extraObjectReserved; typically null.
retrievedBooleanPresent on idempotent operations. true means the response replays an already-processed request (it was not run again).

How to interpret the outcome

The two fields move together, so read them as a pair. There are only these combinations:

statuscodeTreat as
truenullSucceeded. Process data.
false500Pending. Outcome unknown; escalate to Whish and do not mark it failed.
falseany other codeFailed, unless that code is a documented challenge for the endpoint you called.

A status: true is never accompanied by a code, and a code never reports how far a transaction has progressed. Where an operation has a lifecycle of its own, the endpoint reports it on a separate field inside data (for example Whish Pay's collectStatus), which is unrelated to the envelope status.

Some endpoints return status: false for an expected challenge rather than a failure. The clearest example is Bills: a bill.requires_provider_otp code means the biller needs a one-time password, so you continue the flow rather than treating it as an error. Always check the endpoint reference for the codes it can return.

Working with error codes

The pending case (code: 500)

A code: 500 means an internal error left the outcome unknown, not that the operation failed. It is common for Mobile Wallet money transfers and rare elsewhere. Map it to Pending, keep your record open, and recover the real result by reconciling: