Checkout sessions
Carts a person pays on the hosted page.
GET /v1/checkouts
List checkout sessions
Cursor-paginated.
- Authentication
- Merchant API key
- Effect
- Read-only.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Page size (1–100). · ≥ 1, ≤ 100, default 20 |
starting_after | string | no | Object ID; return objects after it. · 26 chars |
order | "asc" | "desc" | no | desc lists newest first. · default "asc" |
Responses
| Status | Meaning | Body / error codes |
|---|---|---|
| 200 | Success. | object |
| 401 | Missing or invalid API key. | authentication_error |
| 429 | Rate limited; honor retry-after. | rate_limit_exceeded too_many_auth_failures |
| 500 | Server error. | api_error |
Example response
{
"object": "list",
"url": "string",
"has_more": false,
"data": [
{
"object": "checkout_session",
"id": "01JB9XK3M2R7TQ8N4V6Y0ZPA1C",
"status": "ready_for_payment",
"line_items": [
{
"name": "string",
"unit_amount": 1,
"quantity": 1
}
],
"amount": 1,
"currency": "RON",
"continue_url": "string",
"payment_link_id": "01JB9XK3M2R7TQ8N4V6Y0ZPA1C",
"payment_id": "string",
"return_url": "string",
"metadata": {},
"initiated_by": "api",
"api_key_id": "string",
"expires_at": "2026-10-25T18:00:00.000Z",
"completed_at": "2026-10-25T18:00:00.000Z",
"created_at": "2026-10-25T18:00:00.000Z"
}
]
}POST /v1/checkouts
Create a checkout session
Builds a cart and returns continue_url, where the person pays (card, Apple Pay or Google Pay) on NETOPIA Payments' secure page. Payware never receives the card number. The session wraps a payment link, so the same payment.succeeded and payment.failed events apply. The total is the sum of the items and must fit the maximum amount. Needs a configured NETOPIA Payments account.
- Authentication
- Merchant API key
- Effect
- Creates a session and its payment link; moves no money until a person pays.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
Idempotency-Key | string | no | Makes retries safe: same key + body replays the stored response (idempotency-replayed: true); a different body, or an agent key or dashboard session reusing another credential's key, returns 409 idempotency_key_in_use. · ≤ 96 chars |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
line_items | object[] | yes | ≥ 1 items, ≤ 20 items |
line_items[].name | string | yes | ≤ 200 chars |
line_items[].unit_amount | integer | yes | ≥ 1 |
line_items[].quantity | integer | no | ≥ 1, ≤ 10000, default 1 |
currency | "RON" | "EUR" | "USD" | yes | |
return_url | string (uri) | no | |
expires_in_hours | integer | no | ≥ 1, ≤ 720, default 24 |
metadata | object | no | |
payer | object | no | What you already know about the payer. Anything given here is not asked on the payment page and is always sent to NETOPIA Payments. Whatever is missing is asked from the payer: by the Apple Pay or Google Pay sheet when they pay with a wallet, or on the page before they are sent to the card page. Email and phone are both required by NETOPIA Payments. |
payer.email | string (email) | no | ≤ 255 chars |
payer.phone | string | no | With country code, e.g. +40712345678. · ≤ 50 chars |
payer.first_name | string | no | ≤ 100 chars |
payer.last_name | string | no | ≤ 100 chars |
Example request
{
"line_items": [
{
"name": "string",
"unit_amount": 1,
"quantity": 1
}
],
"currency": "RON",
"return_url": "https://example.com/hooks/payware",
"expires_in_hours": 24,
"metadata": {},
"payer": {
"email": "ana@example.com",
"phone": "string",
"first_name": "string",
"last_name": "string"
}
}Responses
| Status | Meaning | Body / error codes |
|---|---|---|
| 201 | Created. | CheckoutSession |
| 400 | Invalid cart. | validation_failed invalid_json amount_too_large invalid_return_url |
| 401 | Missing or invalid API key. | authentication_error |
| 403 | The key lacks the scope. | scope_missing |
| 429 | Rate limited; honor retry-after. | rate_limit_exceeded too_many_auth_failures |
| 500 | Server error. | api_error |
Example response
{
"object": "checkout_session",
"id": "01JB9XK3M2R7TQ8N4V6Y0ZPA1C",
"status": "ready_for_payment",
"line_items": [
{
"name": "string",
"unit_amount": 1,
"quantity": 1
}
],
"amount": 1,
"currency": "RON",
"continue_url": "string",
"payment_link_id": "01JB9XK3M2R7TQ8N4V6Y0ZPA1C",
"payment_id": "string",
"return_url": "string",
"metadata": {},
"initiated_by": "api",
"api_key_id": "string",
"expires_at": "2026-10-25T18:00:00.000Z",
"completed_at": "2026-10-25T18:00:00.000Z",
"created_at": "2026-10-25T18:00:00.000Z"
}GET /v1/checkouts/:id
Retrieve a checkout session
Its status follows the payment.
- Authentication
- Merchant API key
- Effect
- Read-only.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | Object ID (ULID). · 26 chars |
Responses
| Status | Meaning | Body / error codes |
|---|---|---|
| 200 | Success. | CheckoutSession |
| 401 | Missing or invalid API key. | authentication_error |
| 404 | Not found, or not yours. | resource_missing |
| 429 | Rate limited; honor retry-after. | rate_limit_exceeded too_many_auth_failures |
| 500 | Server error. | api_error |
Example response
{
"object": "checkout_session",
"id": "01JB9XK3M2R7TQ8N4V6Y0ZPA1C",
"status": "ready_for_payment",
"line_items": [
{
"name": "string",
"unit_amount": 1,
"quantity": 1
}
],
"amount": 1,
"currency": "RON",
"continue_url": "string",
"payment_link_id": "01JB9XK3M2R7TQ8N4V6Y0ZPA1C",
"payment_id": "string",
"return_url": "string",
"metadata": {},
"initiated_by": "api",
"api_key_id": "string",
"expires_at": "2026-10-25T18:00:00.000Z",
"completed_at": "2026-10-25T18:00:00.000Z",
"created_at": "2026-10-25T18:00:00.000Z"
}POST /v1/checkouts/:id/cancel
Cancel a checkout session
Only an unpaid session can be canceled.
- Authentication
- Merchant API key
- Effect
- Cancels the wrapped payment link.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | Object ID (ULID). · 26 chars |
Headers
| Name | Type | Required | Description |
|---|---|---|---|
Idempotency-Key | string | no | Makes retries safe: same key + body replays the stored response (idempotency-replayed: true); a different body, or an agent key or dashboard session reusing another credential's key, returns 409 idempotency_key_in_use. · ≤ 96 chars |
Responses
| Status | Meaning | Body / error codes |
|---|---|---|
| 200 | Success. | CheckoutSession |
| 401 | Missing or invalid API key. | authentication_error |
| 404 | Not found, or not yours. | resource_missing |
| 409 | A paid or processing session cannot be canceled. | payment_link_not_open |
| 429 | Rate limited; honor retry-after. | rate_limit_exceeded too_many_auth_failures |
| 500 | Server error. | api_error |
Example response
{
"object": "checkout_session",
"id": "01JB9XK3M2R7TQ8N4V6Y0ZPA1C",
"status": "ready_for_payment",
"line_items": [
{
"name": "string",
"unit_amount": 1,
"quantity": 1
}
],
"amount": 1,
"currency": "RON",
"continue_url": "string",
"payment_link_id": "01JB9XK3M2R7TQ8N4V6Y0ZPA1C",
"payment_id": "string",
"return_url": "string",
"metadata": {},
"initiated_by": "api",
"api_key_id": "string",
"expires_at": "2026-10-25T18:00:00.000Z",
"completed_at": "2026-10-25T18:00:00.000Z",
"created_at": "2026-10-25T18:00:00.000Z"
}POST /v1/checkouts/:id/complete
Pay a checkout session with a stored card
Charges a customer's saved card for the session total instead of sending the person to the hosted page. Needs an Idempotency-Key. The card is the customer's default card unless instrument_id is given; with mandate_id the mandate's card is used and the charge is held to the mandate's limits (see Mandates). The session becomes processing and then completed; a declined charge reopens it (ready_for_payment). An agent key needs payments:write and spending limits.
- Authentication
- Merchant API key
- Effect
- Charges the customer's stored card.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | Object ID (ULID). · 26 chars |
Headers
| Name | Type | Required | Description |
|---|---|---|---|
Idempotency-Key | string | no | Makes retries safe: same key + body replays the stored response (idempotency-replayed: true); a different body, or an agent key or dashboard session reusing another credential's key, returns 409 idempotency_key_in_use. · ≤ 96 chars |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | ULID · 26 chars |
instrument_id | string | no | ULID · 26 chars |
mandate_id | string | no | ULID · 26 chars |
Example request
{
"customer_id": "01JB9XK3M2R7TQ8N4V6Y0ZPA1C",
"instrument_id": "01JB9XK3M2R7TQ8N4V6Y0ZPA1C",
"mandate_id": "01JB9XK3M2R7TQ8N4V6Y0ZPA1C"
}Responses
| Status | Meaning | Body / error codes |
|---|---|---|
| 200 | Success. | CheckoutSession |
| 400 | Invalid request. | validation_failed idempotency_key_required instrument_required instrument_enrollment_required |
| 401 | Missing or invalid API key. | authentication_error |
| 403 | Not allowed. | scope_missing limit_exceeded mandate_not_active mandate_constraint_violated mandate_budget_exceeded mandate_period_exceeded mandate_agent_mismatch |
| 404 | Session, customer or card not found. | resource_missing |
| 409 | The session is not open. | checkout_session_not_open resource_locked |
| 429 | Rate limited; honor retry-after. | rate_limit_exceeded too_many_auth_failures |
| 500 | Server error. | api_error |
Example response
{
"object": "checkout_session",
"id": "01JB9XK3M2R7TQ8N4V6Y0ZPA1C",
"status": "ready_for_payment",
"line_items": [
{
"name": "string",
"unit_amount": 1,
"quantity": 1
}
],
"amount": 1,
"currency": "RON",
"continue_url": "string",
"payment_link_id": "01JB9XK3M2R7TQ8N4V6Y0ZPA1C",
"payment_id": "string",
"return_url": "string",
"metadata": {},
"initiated_by": "api",
"api_key_id": "string",
"expires_at": "2026-10-25T18:00:00.000Z",
"completed_at": "2026-10-25T18:00:00.000Z",
"created_at": "2026-10-25T18:00:00.000Z"
}