Errors and states

Every reason a payment request is refused, what to tell the user, and what each state of a hold means.

1 min readEdit this page
On this page

A refusal is an ordinary Flowion error, with the same body as every other (errors, pagination and versioning): switch on error, never on message. The set of reasons is closed, so you can write a sentence for each.

Why a request is refused

errorStatusWhat it meansWhat to do
missingIdempotencyKey400The request for a hold has no Idempotency-Key headerSend one
invalidRequest400The key is too long, or payerReference is empty, longer than 200 characters or looks like an email addressSend an opaque reference of your own
forbidden403The caller is not an API key (a member's sign-in is refused here), or the key lacks the settlement.payment.hold permissionCall from your backend with a project key that holds it
notFound404No such charger or hold in your project and the key's mode. A hold of another project, and one a person placed in Flowion Home, read the sameCheck the id and the key's mode
accountNotReady409The organization cannot take card payments right now: no connected account, one Stripe has restricted, or a sandbox project asking for real moneyTell the user the charger cannot take payment. The organization fixes its Stripe account
chargerUnsafeForHold409The hold amount is too small for this charger's speedThe organization raises the hold amount
notAPaidCharger409The charger does not take card paymentsStart it as an ordinary charge
holdNotAuthorized409The hold is not authorized, so nothing can start under itWait for authorized, or ask for a new hold
windowEnded409The five minutes to start are overAsk for a new hold
alreadyStarted409This hold has already started its sessionRead the hold. Never start twice
noOpenSession409A stop for a hold with no running sessionRead the hold: only started has a session to stop
notCaptured409Nothing has been taken on this hold yetAsk for the receipt once the hold says captured
sellerUnavailable503Your organization's details cannot be read from Stripe right nowRetry shortly. The receipt can also come back with its amounts and sellerUnavailable set to true
paymentsUnavailable503Payments cannot be reached right nowRetry shortly, with the same Idempotency-Key for a hold
commandsUnavailable503The charger cannot be reached for a start or a stopRetry shortly

A card that is declined, and a bank that wants the user's approval, are not errors of these routes: they happen in the Payment Element in your page, which tells you, and Flowion then moves the hold to declined, or keeps it at requires_action until the user has approved. Read the hold for what became of it.

Which of these a given route can answer is on its page in the API reference. A 503 carries Retry-After, and a new reason can be added within /v1, so keep a fallback for an unknown code.

What a hold's state means

stateMeans
requestedRecorded, and Stripe has not answered yet
requires_actionThe user has not confirmed the hold yet: this is how a new hold starts. It also means the bank wants approval in the Payment Element
authorizedThe card is held. A session can start, once
startedThe session is running. This is the only state that means so
endedThe session has ended, and its price is being taken
capturedThe price was taken and the rest released. The receipt is ready
capture_failedTaking the price failed. Flowion retries a bounded number of times
declinedThe bank declined. Nothing was started
releasedThe hold was released with nothing taken
expiredThe five minutes passed with no session, and the hold was released
unpaidThe session cost something that could not be taken

The set is open: show an unknown state as "in progress" rather than failing.