Skip to content

Abandon the payment

POST
/elements/session/abort
curl --request POST \
--url https://example.com/elements/session/abort \
--header 'Authorization: Bearer <token>'

Voids every active authorization — nothing is ever charged on an abandon.

The operation went through — the view that resulted from it.

Media typeapplication/json
object
view
required

The session view — everything the payment page renders from, and nothing else.

object
status
required

The payment journey, and nothing else. PENDING: open, the payer may still pay. CAPTURING: covered, the money is being taken. PAID: done. ABORTING/ABORTED: the payer gave up, holds released. EXPIRING/EXPIRED: the session timed out, holds released. AWAITING: a lender is studying the file (BNPL), nothing taken. AWAITED_REFUSED: that lender said no. The three terminal states — PAID, ABORTED, EXPIRED (and AWAITED_REFUSED) — are where you route away.

string
Allowed values: PENDING CAPTURING PAID ABORTING ABORTED EXPIRING EXPIRED AWAITING AWAITED_REFUSED
currency
required

ISO 4217 code of the session — every amount below is in it.

string
total
required

What the whole order costs — fixed at creation, never moves.

object
amount
required

Amount in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.

integer
currency
required

ISO 4217 code, uppercase. One currency per session.

string
/^[A-Z]{3}$/
remaining
required

What is still to be covered: the total minus every settled attempt. Pre-computed — render it, do not recompute it.

object
amount
required

Amount in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.

integer
currency
required

ISO 4217 code, uppercase. One currency per session.

string
/^[A-Z]{3}$/
expiresAt
required

When the session dies, epoch milliseconds. Past it, holds are released and nothing was taken.

number
methods
required

Every method of the session, in the order configured — ineligible ones included (see eligible).

Array
Any of:
CardMethod
object
method
required

Archetype of this entry: what to render and how it behaves. (id is what you pass to start an attempt.)

string
Allowed value: card
partialAuth

The ISSUER may grant less than asked, and the payer never chose that amount: on a lower grant, offer accept or refuse (see attempts[].awaitingPartialDecision).

string
Allowed value: mandated
range

Tranche window: outside it the method is not eligible — the amount picker clamps to it.

object
min
required

Smallest amount this method accepts, in minor units (inclusive).

integer
max
required

Largest amount this method accepts, in minor units (inclusive).

integer
currency
required

ISO 4217 code — always the session’s own.

string
/^[A-Z]{3}$/
cardHolder

Render the cardholder-name field on this entry’s form — the merchant asked for it.

boolean
schemes
required

Card networks this entry accepts, in the order to display them — resolved, defaults applied.

Array<string>
Allowed values: cb visa mastercard amex maestro diners discover jcb china_union_pay
integration
required

Which card front to mount: the PSP’s hosted fields, or plain inputs for the simulated provider. The routing provider id itself never leaves the server.

string
Allowed values: payplug payplug-retail fake
hostedFields

Everything the hosted-fields front needs to boot, resolved at session creation.

object
keyId
required

Public client-level key id of the PSP’s hosted-fields SDK.

string
key
required

Its PUBLIC key — safe in the page by construction; no secret ever reaches the browser.

string
sdkUrl
required

Where to load that SDK from.

string
id
required

Instance key of this entry — what startAttempt takes as methodId, and what an attempt’s methodId points back to. One session may offer two card entries (a plain one and Amex); the id is what tells them apart.

string
label

Merchant-chosen name to display instead of the method’s own (a promoted card instance).

string
eligible
required

Can an attempt be STARTED on it right now? False when the remaining balance falls outside its window, when no BNPL plan covers the order any more, or when the order must register the payer’s means and this one cannot. An ineligible entry STAYS in the list — an attempt already paid is named from it: render the eligible ones, keep the rest to name what was paid.

boolean
mustSettleRemaining

This method can only pay the WHOLE remaining balance: its PSP has no authorization, so it takes the money on the spot and cannot hand it back. Offer no partial amount on it — it stays proposable, it simply pays the balance in full.

boolean
orderId
required

The merchant’s own order reference, echoed as given.

string
cartItems
required

Order lines, when the merchant declared any.

Array<object>
object
label
required

What the buyer reads for this line.

string
quantity
required

How many units.

integer
>= 1
amount
required

Price of the LINE — unit price × quantity, not the unit price.

object
amount
required

Amount in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.

integer
currency
required

ISO 4217 code, uppercase. One currency per session.

string
/^[A-Z]{3}$/
statementDescriptor

The label that will appear on the payer’s bank statement, when the merchant set one.

string
terms

The terms the page must show, in the merchant’s own order — absent when none were declared.

Array<object>
object
label
required

Your wording, shown as-is — never translated, like statementDescriptor.

string
>= 1 characters
url
required

Where the full document lives — required: your customer must be able to read what they accept.

string format: uri
termsAcceptedAt

When the consent was recorded, in epoch milliseconds — the first tranche that reported one. Its presence is what tells the page the terms are settled, and when.

integer
mustCreateAlias

Present when the order asked for the payer’s card to be registered for payments you initiate later (mustCreateAlias on the session). The card form then tells the payer so, under the pay button.

boolean
attempts
required

Every attempt of this session, oldest first — in flight, settled, refused and released alike.

Array<object>
object
attemptId
required

Handle of this attempt — what the cancel and accept/refuse actions address.

string format: uuid
plan

BNPL attempts only: the plan the payer chose.

object
installments
required

How many instalments the payer picked — 3 for a 3× plan.

integer
>= 2
withFees
required

Whether that plan carries fees. The pair (installments, withFees) names a plan uniquely.

boolean
awaitingPartialDecision

The issuer granted LESS than asked and the payer has not decided yet: keep offering accept (pay the rest another way) or refuse (release it and retry). Derived from the recorded state, so it survives a page reload.

boolean
method
required

Archetype of the method that carries this attempt — drives wording and behaviour.

string
Allowed values: card applepay wero paypal oney ancv
methodId
required

The methods[].id this attempt was started on — one session may offer two card configs.

string
cardScheme

Card attempts only: the network the PSP says this ran on. The page names a settled tranche by it rather than by the method’s own label — a payer who entered a Visa under a config labelled “American Express” paid with a Visa, and the recap must say so. Absent when the verdict named no network we could place.

string
Allowed values: cb visa mastercard amex maestro diners discover jcb china_union_pay
requested
required

What this attempt asked for.

object
amount
required

Amount in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.

integer
currency
required

ISO 4217 code, uppercase. One currency per session.

string
/^[A-Z]{3}$/
granted
required

What was actually authorized — equal to requested unless the issuer or the payer’s app granted less. This is the amount that counts against the balance.

object
amount
required

Amount in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.

integer
currency
required

ISO 4217 code, uppercase. One currency per session.

string
/^[A-Z]{3}$/
status
required

Where this attempt stands. AUTHORIZING: dispatched, verdict still due (always out-of-band). AUTHORIZED: the money is held. DECLINED: refused, nothing taken. CANCELLED: the payer backed out at the PSP. CAPTURED: taken. VOIDED: the hold was released.

string
Allowed values: AUTHORIZING AUTHORIZED DECLINED CANCELLED CAPTURED VOIDED
operation
required

How this attempt settles: authorization holds the money and a capture follows, payment takes it in one operation. Say the right thing while waiting — a payer waiting on a payment is not waiting on a hold.

string
Allowed values: authorization payment
abandonable
required

Can the payer end this attempt and be sure of owing nothing? Always true for a hold; for a settlement, only where the PSP can undo it. False: offer no abandon button — one that may cost money is worse than none.

boolean
redirect
Any of:
NavigateRedirect
object
kind
required

Change the browser location to url.

string
Allowed value: navigate
url
required

Send the payer here.

string
declineCategory

Why a DECLINED attempt was refused, in the only vocabulary a page may render — the PSP’s own code and message never leave the server (some name things a payer must not be told). Absent means unclassified: say no more than that.

string
Allowed values: bank-refusal insufficient-funds invalid-card-data authentication-failed expired method-unavailable
Example
{
"view": {
"status": "PENDING",
"methods": [
{
"method": "card",
"partialAuth": "mandated",
"schemes": [
"cb"
],
"integration": "payplug",
"mustSettleRemaining": true
}
],
"mustCreateAlias": true,
"attempts": [
{
"awaitingPartialDecision": true,
"method": "card",
"cardScheme": "cb",
"status": "AUTHORIZING",
"operation": "authorization",
"redirect": {
"kind": "navigate"
},
"declineCategory": "bank-refusal"
}
]
}
}

InvalidRequest — the request could not be read: a missing or malformed field, a bad pattern, or a property this door does not declare (the message names it). Every door with a schema can answer this, before any business rule is consulted.

Media typeapplication/json
object
code
required

Stable machine-readable code — the one thing to branch on. Never parse the message.

string
message
required

English sentence for logs and operators. Wording may change; the code will not.

string
Example
{
"code": "InvalidRequest",
"message": "body/<field> failed validation"
}

InvalidElementsToken — the only code this response carries: no usable session token (absent, unknown, or past the read-only grace that follows the end of the session). A dead token and an unknown one answer the same thing, so nothing reveals whether a session ever existed.

Media typeapplication/json
object
code
required

Stable machine-readable code — the one thing to branch on. Never parse the message.

string
message
required

English sentence for logs and operators. Wording may change; the code will not.

string
Example
{
"code": "InvalidElementsToken",
"message": "unknown or expired session token"
}

SessionReadOnly — the session reached a final state; its token still reads, but no longer acts.

Media typeapplication/json
object
code
required

Stable machine-readable code — the one thing to branch on. Never parse the message.

string
message
required

English sentence for logs and operators. Wording may change; the code will not.

string
Example
{
"code": "SessionReadOnly",
"message": "the session reached a final state; the token is read-only"
}

The abort was refused, and the code says by which rule — both of them:

  • SessionNotPending: the session already reached a final state, or is capturing.
  • SettlementInFlight: a settlement that cannot be undone is awaiting its verdict — abort waits for it, because abandoning a session whose money may have just been taken would leave the payer owed.
Media typeapplication/json
object
code
required

Stable machine-readable code — the one thing to branch on. Never parse the message.

string
message
required

English sentence for logs and operators. Wording may change; the code will not.

string
Example
{
"code": "SettlementInFlight",
"message": "a settlement that cannot be undone is in flight: abort waits for its verdict"
}