@jazadev/node throws JazaError with statusCode, code, and raw when the API rejects a call. Switch on code / statusCode in your BFF; do not parse human messages as the primary control flow.
Typical envelope
Common situations
Exact HTTP statuses and codes can vary by endpoint — log
JazaError.raw when debugging.
Consume input rules
Retry guidance
- Safe to retry with the same
idempotencyKey: network timeouts and transient 5xx onconsume. - Do not retry unchanged when the wallet is empty or the feature code is wrong — fix the input or send the user to top up.
Always pass
idempotencyKey on consume so retries cannot double-charge.