ReinkeyDocsConsole

Reason codes

Every rejection carries a stable, upper-case code. Error bodies have one shape:

JSON
{ "error": "CHANNEL_EXHAUSTED", "source": "facilitator", "message": "…", "tx": "…" }

source tells you who said no: chain (a contract on Stellar), facilitator (voucher verification) or gateway (the seller's middleware). tx is present when there is a transaction to look at.

error is the contract; message is not. Codes are stable identifiers you may branch on. The message next to them is informational, may be reworded at any time, and is currently written in Turkish by the hosted facilitator. Never parse it.

The authoritative list is backend/src/common/reason-codes.ts; the contract numbers come from each contract's Error enum. A chain error the facilitator doesn't recognise is passed through as CONTRACT_ERROR_<n>.

From the account contract

Numbers 1–11, enforced by reinkey-account in __check_auth.

#CodeMeaning
1BAD_SIGNATUREThe signature doesn't match the agent or owner key. Reserved: the host usually stops an invalid ed25519 signature before the contract runs.
2POLICY_EXPIREDThe ledger is past expires_ledger.
3ACCOUNT_FROZENThe owner froze the account.
4CONTEXT_NOT_ALLOWEDThe agent tried to call something the policy doesn't cover — including a swap when no dex_router / dex_factory is set.
5PAYEE_NOT_ALLOWEDThe recipient is not in payees.
6PER_TX_CAP_EXCEEDEDThe amount is above per_tx_cap.
7DAILY_CAP_EXCEEDEDThe amount would take today's total above daily_cap.
8PAIR_NOT_ALLOWEDThe swap's asset pair is not in pairs, or the route has more than one hop.
9SLIPPAGE_UNBOUNDEDThe swap has no minimum output (amount_out_min == 0).
10CONTROLLER_LOCKEDThe account was handed to a controller (Float), so the owner signature no longer authorizes anything.
11CONTROLLER_MISMATCHA controller is already set, or the caller is not the controller.

From the channel contract

Numbers 20–27.

#CodeMeaning
20CHANNEL_NOT_FOUNDNo channel with that id.
21CHANNEL_CLOSEDThe channel was closed.
22VOUCHER_BAD_SIGNATUREThe voucher isn't signed by the channel's voucher key.
23VOUCHER_NOT_INCREASINGThe cumulative amount is not above what was already claimed.
24EXCEEDS_DEPOSITThe cumulative amount is above the deposit.
25NOT_EXPIREDThe buyer tried to close before expiry.
26NOT_AUTHORIZEDThe caller may not perform this action.
27INVALID_ARGUMENTA parameter is out of range.

From the credit pool contract (Float)

Numbers 40–49. You only meet these if you call credit-pool directly — depositing, withdrawing, opening or closing a line, or liquidating.

#CodeMeaning
40INVALID_AMOUNTAmount is zero or negative.
41INSUFFICIENT_SHARESThe holder does not have that many shares.
42INSUFFICIENT_LIQUIDITYA withdrawal is larger than the pool's idle USDC; lent-out capital can't be pulled back.
43LINE_EXISTSThat account already has an open credit line.
44LINE_NOT_FOUNDNo line for that account.
45NOT_CONTROLLERThe account's controller is not this pool, so the pool can't lend to it.
46NOT_LIQUIDATABLEliquidate was called while the line is still healthy.
47PRICE_UNAVAILABLENo usable price: the oracle is stale and the pool price is missing.
48INSUFFICIENT_USDCClosing a line needs the debt in USDC in the account; sell XLM first.
49POOL_NOT_AUTHORIZEDThe caller is neither the admin nor the line's beneficiary.

Off-chain

Returned by the facilitator or the seller's middleware. The HTTP status is fixed per code.

CodeHTTPMeaningWhat the caller should do
PAYMENT_REQUIRED402No payment header.Read accepts, pay, retry.
PAYMENT_MALFORMED400The header isn't base64 JSON, or the scheme, network or fields are wrong.Fix the payload.
CHANNEL_NOT_FOUND402The facilitator can't find the channel on-chain.Open a session.
CHANNEL_CLOSED402The channel is closed.Open a new one.
CHANNEL_EXPIRING402Too close to expiry to be claimed safely.Open a new session.
WRONG_PAYEE402The channel pays someone other than this seller.Open a channel to this seller.
WRONG_ASSET402The channel holds a different asset.Use the asset in accepts.
VOUCHER_BAD_SIGNATURE402Signature check failed.Sign with the channel's voucher key.
VOUCHER_NOT_INCREASING402Cumulative is not above the last accepted voucher.Sign a higher cumulative.
VOUCHER_UNDERPAID402The increase is smaller than the price.Pay at least amount.
CHANNEL_EXHAUSTED402The deposit can't cover the price.Top up, or open a new session.
ACCOUNT_FROZEN402The paying account is frozen, so no further voucher will be accepted.Ask the owner to unfreeze.
RATE_LIMITED429Too many requests from this channel or IP, or the open-stream limit is full.Back off; Retry-After is set.
STREAM_NOT_FOUND404The stream session is unknown, already ended, or timed out while idle.Open a new session.
NOT_FOUND404No such account, channel, receipt or resource.Check the identifier.
BAD_REQUEST400A parameter failed validation.Fix the request.
CHAIN_UNAVAILABLE503The facilitator could not read Stellar.Retry; nothing was charged.
PRICE_SOURCE_UNAVAILABLE503No usable price source for a quote or a Float valuation.Retry later.
REPORT_NOT_VERIFIED422POST /v1/report named a transaction that does not exist, did not fail, or does not involve that account.Only report real failures.
AGENT_BUSY409A demo agent run is already in progress.Wait for it to finish.
NOT_SUPPORTED400The feature is not configured on this facilitator: Float with no credit pool, the exchange layer with no XLM contract, the demo controls when they are off.Read GET /supported and GET /demo/info first.
INTERNAL500Unexpected server error.Retry, then report it.
TIMEOUT—On a stream: the next voucher didn't arrive in time. Delivered as a stream event, not an HTTP status.Reconnect.

Only from @reinkey/meter

CodeHTTPMeaning
FACILITATOR_UNAVAILABLE503The middleware could not reach the facilitator over HTTP. Your endpoint is unavailable — never free.

Reinkey runs on Stellar testnet. The contracts are unaudited. Don't send mainnet funds.