Errors

Every Swichi Payments error code, what it means and the fix.

Every error has the same shape. code is stable and has a section on this page (its doc_url points here); message says what happened in plain words; retryable says whether the same request may succeed if you send it again later (with the same Idempotency-Key); param names the field at fault; request_id finds the request in your logs.

{ "error": {
    "type": "payment_error",
    "code": "insufficient_funds",
    "message": "Your Swichi balance is too low for this payout and its fee.",
    "retryable": false,
    "doc_url": "https://docs.swichi.cc/errors#insufficient_funds",
    "request_id": "req_01J…"
} }

Why a collection or payout failed later is on the object itself (failure.code and failure.message, which you may show the payer) and in its collection.failed or payout.failed webhook. Swichi never shows a network's or a provider's own error text.

authentication_required

Send your payments key as Authorization: Bearer <your payments key>.

invalid_api_key

The key is not valid: it may be revoked, rolled more than 24 hours ago, or mistyped. Make a new one under Swichi Gateway → Developers → API keys.

invalid_request

The request is malformed; message says what to fix and param which field. Do not retry unchanged.

amount_too_small

The amount is under Swichi's smallest collection or payout for that method; message says the minimum (for example "The smallest withdrawal is TZS 5,000.") and param is amount. Nothing was held or sent. Retry with at least the minimum.

amount_too_large

The amount is over Swichi's largest collection or payout for that method; message says the maximum (for example "The largest payment is TZS 5,000,000.") and param is amount. Nothing was held or sent. Split it into smaller payments.

not_found

There is no such object for your business in this mode. Sandbox and live never share an id: a sandbox id is never found with a live key, or the reverse.

idempotency_conflict

This Idempotency-Key was used with a different request. Use a new key for a new request.

idempotency_in_progress

A request with this Idempotency-Key is still running. Retry in a moment with the same key.

rate_limited

You are sending requests faster than your limit. Wait Retry-After seconds and retry.

key_product_mismatch

This key cannot move money. Use a payments key from Swichi Gateway → Developers → API keys.

missing_scope

The key lacks the scope this request needs (collections, payouts, transfers or read). Add it to the key on the API keys page, or use another key.

ip_not_allowed

The request came from an address that is not on the key's own IP allow list. Add the address or range to the key.

currency_not_supported

Swichi Gateway moves Tanzanian shillings only: send "currency": "TZS" and amounts in whole shillings.

network_not_supported

This number's network is not one Swichi collects from or pays out to, or it does not match the network you sent. Collections work from M-Pesa, Airtel Money, Mixx by Yas and HaloPesa numbers.

method_not_available

This way of paying is not available now: payouts to M-Pesa are not open yet, or the network is not answering. Try another network or bank, or retry later when retryable is true.

collection_not_paid

Only a paid (succeeded) collection can be refunded. A pending, failed or expired collection took no money from the payer.

refund_exceeds_payment

The refund is more than is left on the collection: what it paid, less refunds already made or on their way. Read the collection's refunds, then refund what is left, or nothing.

insufficient_funds

Your Swichi balance is too low for this payout or transfer and its fee. Collect first, or wait for money on its way in (incoming in GET /balance).

limit_exceeded

This is over one of your business's Swichi limits (per payment, per day, per month, the balance cap, or how many payout destinations a new business may have). Limits grow with your history; new businesses start low. Try a smaller amount or wait for the day or month to turn.

key_limit_exceeded

This is over a limit you set on this key (per payment, or payouts per day). Change it on the API keys page, or use another key.

payee_blocked

Swichi cannot send money to this number or account, or take money from it.

account_under_review

Swichi is reviewing your business. While it reviews, collections keep working and payouts wait; if your account is on hold, nothing moves. We contact you; you do not need to do anything.

payouts_paused

Swichi paused payouts for a check. Your money is safe; retry later.

account_not_ready

Your business is not ready for live payments: finish the go-live checklist under Swichi Gateway → Developers → Verification. Your test key keeps working in the sandbox.

Every live request checks the whole checklist again (an active business account, an approved review, a merchant profile with the current terms, screening with no open case, and a settlement account). When one lapses, live requests answer this code and the message says what to fix; the Developers page shows the same item.

live_not_open

Swichi Gateway live payments are not open yet. Keep building in the sandbox; your integration works the same when live opens.

payout_not_cancellable

Only a payout that has not been sent (pending_approval or in_cooldown) can be cancelled.

sandbox_only

This request works with a test key only (the sandbox's simulate endpoints).

destination_not_found

There is no Swichi business with this account id in this mode, or it cannot receive money now.

internal_error

Something went wrong on our side. Retry with the same Idempotency-Key; if it persists, send us the request_id.

On this page