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.

From the account contract

Enforced by reinkey-account in __check_auth.

#CodeMeaning
1BAD_SIGNATUREThe signature doesn't match the agent or owner key.
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.
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.
9SLIPPAGE_UNBOUNDEDThe swap has no minimum output.

From the channel contract

#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.

Off-chain

Returned by the facilitator or the seller's middleware, always with HTTP 402 unless noted.

CodeMeaningWhat the buyer should do
PAYMENT_REQUIREDNo payment header.Read accepts, pay, retry.
PAYMENT_MALFORMED (400)The header isn't base64 JSON, or fields are missing.Fix the payload.
CHANNEL_NOT_FOUNDThe facilitator can't find the channel on-chain.Open a channel.
CHANNEL_CLOSEDThe channel is closed.Open a new one.
CHANNEL_EXPIRINGToo close to expiry to be claimed safely.Open a new channel.
WRONG_PAYEEThe channel pays someone other than this seller.Open a channel to this seller.
WRONG_ASSETThe channel holds a different asset.Use the asset in accepts.
VOUCHER_BAD_SIGNATURESignature check failed.Sign with the channel's voucher key.
VOUCHER_NOT_INCREASINGCumulative is not above the last accepted voucher.Sign a higher cumulative.
VOUCHER_UNDERPAIDThe increase is smaller than the price.Pay at least amount.
CHANNEL_EXHAUSTEDThe deposit can't cover the price.Top up, or open a new channel.
RATE_LIMITED (429)Too many requests.Back off.
TIMEOUTOn a stream: the next voucher didn't arrive in time.Reconnect.

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