Skip to main content
When a request fails, Modem Pay returns an HTTP status of 400 or higher and a JSON body with a message you can show or log. Many errors also have a code your code can check.
Check code in your logic, not message. Messages are written for people and may change. Codes don’t.

Status codes

Error codes you may see

Rate limits

Requests to /v1 are limited per business over a rolling 15-minute window. Payouts have their own, stricter limits to protect your balance. When you hit a limit you get a 429:
Wait retryAfter seconds before trying again. Responses also carry the standard RateLimit headers, so you can slow down before you reach the limit. Need a higher limit? Email info@modempay.com with your expected volume.

Retries in the SDKs

The SDKs retry failed requests that are likely to be temporary, such as network errors and 5xx responses. They try up to 3 times by default, waiting a little longer each time.
To hide the retry log lines but keep retrying, set RETRY_LOGGING=false in your environment.
Before retrying a payout yourself, send the same Idempotency-Key header as the first attempt. Then a retry can never pay someone twice. See Mobile money payouts.

Timeouts

SDK requests time out after 60 seconds by default. You can change this (in seconds):
If a payment or payout request times out, don’t assume it failed. Look it up by ID or reference first, or wait for the webhook.