Record the payer's acceptance of the terms
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");curl_easy_setopt(hnd, CURLOPT_URL, "https://example.com/elements/session/accept-terms");
struct curl_slist *headers = NULL;headers = curl_slist_append(headers, "Authorization: Bearer <token>");curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://example.com/elements/session/accept-terms"), Headers = { { "Authorization", "Bearer <token>" }, },};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://example.com/elements/session/accept-terms"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://example.com/elements/session/accept-terms")) .header("Authorization", "Bearer <token>") .method("POST", HttpRequest.BodyPublishers.noBody()) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://example.com/elements/session/accept-terms") .post(null) .addHeader("Authorization", "Bearer <token>") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'POST', url: 'https://example.com/elements/session/accept-terms', headers: {Authorization: 'Bearer <token>'}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://example.com/elements/session/accept-terms';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}val client = OkHttpClient()
val request = Request.Builder() .url("https://example.com/elements/session/accept-terms") .post(null) .addHeader("Authorization", "Bearer <token>") .build()
val response = client.newCall(request).execute()use reqwest;
#[tokio::main]pub async fn main() { let url = "https://example.com/elements/session/accept-terms";
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request POST \ --url https://example.com/elements/session/accept-terms \ --header 'Authorization: Bearer <token>'wget --quiet \ --method POST \ --header 'Authorization: Bearer <token>' \ --output-document \ - https://example.com/elements/session/accept-termsThe payer accepted the terms this session declared — recorded WHEN THEY DID IT, not as a rider on the first tranche. <payplug-terms> calls this the moment its switch goes on; the view then carries termsAcceptedAt, which is what lets the page render itself settled after a reload, on any device, without remembering anything itself.
Idempotent, and quiet when there is nothing to accept: a session that declared no terms records nothing and answers 200 all the same — a page has no error to handle for a question nobody asked.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The operation went through — the view that resulted from it.
object
The session view — everything the payment page renders from, and nothing else.
object
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.
ISO 4217 code of the session — every amount below is in it.
What the whole order costs — fixed at creation, never moves.
object
Amount in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.
ISO 4217 code, uppercase. One currency per session.
What is still to be covered: the total minus every settled attempt. Pre-computed — render it, do not recompute it.
object
Amount in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.
ISO 4217 code, uppercase. One currency per session.
When the session dies, epoch milliseconds. Past it, holds are released and nothing was taken.
Every method of the session, in the order configured — ineligible ones included (see eligible).
object
Archetype of this entry: what to render and how it behaves. (id is what you pass to start an attempt.)
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).
Tranche window: outside it the method is not eligible — the amount picker clamps to it.
object
Smallest amount this method accepts, in minor units (inclusive).
Largest amount this method accepts, in minor units (inclusive).
ISO 4217 code — always the session’s own.
Render the cardholder-name field on this entry’s form — the merchant asked for it.
Card networks this entry accepts, in the order to display them — resolved, defaults applied.
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.
Everything the hosted-fields front needs to boot, resolved at session creation.
object
Public client-level key id of the PSP’s hosted-fields SDK.
Its PUBLIC key — safe in the page by construction; no secret ever reaches the browser.
Where to load that SDK from.
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.
Merchant-chosen name to display instead of the method’s own (a promoted card instance).
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.
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.
object
Archetype of this entry: what to render and how it behaves. (id is what you pass to start an attempt.)
Which Apple Pay front to mount: the REAL OS sheet (ApplePaySession — Safari only, domain registered with Apple), or the simulated provider’s plain form. The routing provider id itself never leaves the server.
Tranche window: outside it the method is not eligible — the amount picker clamps to it.
object
Smallest amount this method accepts, in minor units (inclusive).
Largest amount this method accepts, in minor units (inclusive).
ISO 4217 code — always the session’s own.
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.
Merchant-chosen name to display instead of the method’s own (a promoted card instance).
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.
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.
object
Archetype of this entry: what to render and how it behaves. (id is what you pass to start an attempt.)
Tranche window: outside it the method is not eligible — the amount picker clamps to it.
object
Smallest amount this method accepts, in minor units (inclusive).
Largest amount this method accepts, in minor units (inclusive).
ISO 4217 code — always the session’s own.
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.
Merchant-chosen name to display instead of the method’s own (a promoted card instance).
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.
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.
object
Archetype of this entry: what to render and how it behaves. (id is what you pass to start an attempt.)
Tranche window: outside it the method is not eligible — the amount picker clamps to it.
object
Smallest amount this method accepts, in minor units (inclusive).
Largest amount this method accepts, in minor units (inclusive).
ISO 4217 code — always the session’s own.
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.
Merchant-chosen name to display instead of the method’s own (a promoted card instance).
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.
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.
object
Archetype of this entry: what to render and how it behaves. (id is what you pass to start an attempt.)
Tranche window: outside it the method is not eligible — the amount picker clamps to it.
object
Smallest amount this method accepts, in minor units (inclusive).
Largest amount this method accepts, in minor units (inclusive).
ISO 4217 code — always the session’s own.
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.
Merchant-chosen name to display instead of the method’s own (a promoted card instance).
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.
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.
object
Archetype of this entry: what to render and how it behaves. (id is what you pass to start an attempt.)
The instalment plans this order offers, each with what it COSTS — schedule, fees, total, credit and APR, all computed by the platform. Render these figures; the contractual rates behind them never leave the server.
object
How many instalments this plan spreads the order over.
Whether the payer pays fees for it.
One amount per instalment, in order: the first is due today, each next one 30 days later.
object
Amount in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.
ISO 4217 code, uppercase. One currency per session.
What the plan costs the payer on top of the order.
object
Amount in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.
ISO 4217 code, uppercase. One currency per session.
Principal + fees — what the payer ultimately pays.
object
Amount in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.
ISO 4217 code, uppercase. One currency per session.
What the lender actually advances — the regulated base the APR is priced against.
object
Amount in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.
ISO 4217 code, uppercase. One currency per session.
Annual percentage rate as a FRACTION — 0.2031 means 20.31 %. Derived from the schedule above.
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.
Merchant-chosen name to display instead of the method’s own (a promoted card instance).
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.
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.
The merchant’s own order reference, echoed as given.
Order lines, when the merchant declared any.
object
What the buyer reads for this line.
How many units.
Price of the LINE — unit price × quantity, not the unit price.
object
Amount in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.
ISO 4217 code, uppercase. One currency per session.
The label that will appear on the payer’s bank statement, when the merchant set one.
The terms the page must show, in the merchant’s own order — absent when none were declared.
object
Your wording, shown as-is — never translated, like statementDescriptor.
Where the full document lives — required: your customer must be able to read what they accept.
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.
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.
Every attempt of this session, oldest first — in flight, settled, refused and released alike.
object
Handle of this attempt — what the cancel and accept/refuse actions address.
BNPL attempts only: the plan the payer chose.
object
How many instalments the payer picked — 3 for a 3× plan.
Whether that plan carries fees. The pair (installments, withFees) names a plan uniquely.
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.
Archetype of the method that carries this attempt — drives wording and behaviour.
The methods[].id this attempt was started on — one session may offer two card configs.
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.
What this attempt asked for.
object
Amount in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.
ISO 4217 code, uppercase. One currency per session.
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 in the MINOR unit of the currency — 1000_00 is one thousand euros, never 1000.
ISO 4217 code, uppercase. One currency per session.
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.
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.
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.
object
Change the browser location to url.
Send the payer here.
object
Build a hidden form with params and POST it to url.
Where the form must be submitted.
Hidden fields to submit verbatim — do not reorder, rename or drop any.
object
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.
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" } ] }}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).
object
Stable machine-readable code — the one thing to branch on. Never parse the message.
English sentence for logs and operators. Wording may change; the code will not.
Example
{ "code": "InvalidElementsToken", "message": "unknown or expired session token"}SessionReadOnly — the session reached a final state; its token still reads, but no longer acts.
object
Stable machine-readable code — the one thing to branch on. Never parse the message.
English sentence for logs and operators. Wording may change; the code will not.
Example
{ "code": "SessionReadOnly", "message": "the session reached a final state; the token is read-only"}SessionNotPending — the session is no longer taking decisions.
object
Stable machine-readable code — the one thing to branch on. Never parse the message.
English sentence for logs and operators. Wording may change; the code will not.
Example
{ "code": "SessionNotPending", "message": "session is PAID"}