Skip to content

Errors ​

Being released

The money rails described here are built and tested, and are being rolled out. Until a rail is switched on for the exchange, invoices are paid by bank transfer or mobile money and recorded by Finance, as today.

Every refusal has the same shape: a machine-readable error code and a message a person can read.

json
{ "error": "invoice_not_owed", "message": "INV-0002 is paid; nothing is owed on it" }

A request that does not fit the endpoint's schema is a 400 with the list of problems:

json
{ "error": "bad_request", "issues": [{ "path": ["amountMinor"], "message": "Expected number, received string" }] }

Status codes ​

StatusMeaning
200 / 201Done; 201 when something was created
202Accepted: a payment out was opened and waits for approvals or for the provider
400The request is malformed (bad_request, bad_phone, bad_document, …)
401No valid session (unauthorized), or a webhook with a bad signature (bad_signature)
403Signed in, without the role this write needs (forbidden, with roles)
404No such record (not_found)
409The request is understood, but the record's state does not allow it
422Driver KYC details the card processor would refuse (kyc_incomplete, with problems)
429Too many wrong passwords (too_many_attempts, with retryAfterSeconds)
503A ledger, rail or provider did not answer (ledger_unavailable, rail_unavailable, …)

Money codes ​

CodeMeaning
currency_not_on_railThe record's currency is not one this rail carries (no conversion)
rail_not_configuredThat rail is not switched on for this exchange
rail_unavailableThe rail did not answer; try again
transfer_openA payment for this record is already open: approve or cancel it first
not_awaiting_approvalThe transfer is not waiting for approvals
already_approvedYou already approved this transfer; a different user must give the second approval
not_cancellableOnly a payment out that has not been sent can be cancelled
invoice_not_owedThe invoice is not Issued or Part-paid
overpaymentMore than is outstanding on the invoice
not_a_bill_to_collectA freight invoice is paid by the exchange, not collected
not_ours_to_payOnly a freight invoice is paid out by the exchange
no_stellar_addressThe party has no Stellar address on record
no_trustlineThe recipient's Stellar account cannot hold that coin yet
no_walletThe party has no Celo wallet on record
no_phoneNo phone on record to pay or to collect from
no_funding_sourceNothing records where the escrow's money came from
card_refund_by_handA card-funded escrow is refunded through Mamlaka
invalid_amountMobile money is whole shillings; B2C is at least KES 10
test_numbers_onlyIn the gateway sandbox only its test numbers are allowed
gateway_refusedMamlaka refused the request; the message says why
cards_not_configuredVirtual cards are not switched on for this exchange
kyc_not_approvedA card is issued only once the driver's KYC is approved
kyc_in_handKYC is waiting or approved; only a rejected one is resubmitted
card_not_activeThe card is pending, frozen or closed
not_issued_hereThe card was not issued through the exchange
trip_not_in_transitA card is loaded only for a trip on the road
float_too_lowMamlaka's float cannot cover the issue or load

Ledger codes ​

CodeMeaning
ledger_refusedThe receipt contract refused the change; the contract's own reason is in the message, and nothing was written
ledger_unavailableThe chain did not answer
lot_not_on_ledgerThe lot has no token on the ledger yet
insufficient_stockMore than is available on the lot or listing
over_capacity / warehouse_suspendedThe warehouse cannot take it

AgriTrade Exchange