Checkout Sessions
A checkout session represents a hosted payment page. Create a session, redirect your customer to the session URL, and NodeRails handles the rest: chain selection, wallet connection, and payment capture.
💡
Hosted payment page
Checkout sessions power the NodeRails hosted payment UI. Your customer never leaves a NodeRails-hosted page, reducing PCI-equivalent complexity for crypto payments.
Create a checkout session
POST
/checkout-sessionsCreates a new checkout session. Returns a session object with line items.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
appId | string | Yes | Your app UUID |
successUrl | string | Yes | URL to redirect on successful payment |
cancelUrl | string | Yes | URL to redirect on cancellation |
items | CheckoutItem[] | Yes | Line items (min 1) |
customerAccountId | string | No | Existing customer UUID |
mode | "PAYMENT" | "SUBSCRIPTION" | No | Checkout mode (default: PAYMENT) |
expiresInMinutes | number | No | Auto-expire in 1–1440 minutes |
metadata | object | No | Arbitrary key-value metadata |
CheckoutItem
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Item name (1–255 chars) |
amount | string | No | Price in fiat (decimal string) |
currency | string | No | Currency code (max 10 chars) |
quantity | number | No | Item quantity (positive integer) |
description | string | No | Item description (max 500) |
productPlanId | string | No | Link to a product plan |
productPlanPriceId | string | No | Specific price option |
isPriceOption | boolean | No | Whether to use price option |
List checkout sessions
GET
/checkout-sessionsQuery parameters
| Parameter | Type | Description |
|---|---|---|
appId | string | Filter by app UUID |
status | "OPEN" | "COMPLETE" | "EXPIRED" | Filter by status |
page | number | Page number (default: 1) |
pageSize | number | Items per page (1–100) |
Retrieve a checkout session
GET
/checkout-sessions/:idExpire a checkout session
POST
/checkout-sessions/:id/expireManually expires an open checkout session, preventing any further payments.
Create from payment link
POST
/checkout-sessions/from-linkCreates a checkout session from a payment link slug. This is a public endpoint, no authentication required.
| Parameter | Type | Required | Description |
|---|---|---|---|
slug | string | Yes | Payment link slug (1–100 chars) |
Create from invoice
POST
/checkout-sessions/from-invoiceCreates a checkout session from an invoice ID. This is a public endpoint, no authentication required.
| Parameter | Type | Required | Description |
|---|---|---|---|
invoiceId | string | Yes | Invoice UUID |
Response object
All responses are wrapped in { "success": true, "data": ... }. List endpoints add pagination with total, page, pageSize, and totalPages.
CheckoutSession fields
idstringUnique checkout session UUIDappIdstringApp this session belongs tocustomerAccountIdstring | nullLinked customer UUID, if anypaymentIntentIdstring | nullAssociated payment intent UUID once payment beginsmodestringPAYMENT or SUBSCRIPTIONstatusstringOPEN, COMPLETE, or EXPIREDsourceTypestringOrigin type: CHECKOUT, PAYMENT_LINK, INVOICE, or SUBSCRIPTIONsourceIdstring | nullID of the originating resource (payment link, invoice, etc.)amountstringTotal payment amount as a decimal stringcurrencystringFiat currency code (e.g. USD)subtotalstringAmount before taxtaxAmountstringCalculated tax amounttaxDescriptionstring | nullTax label shown to customer (e.g. 'VAT 20%')allowedChains'ALL' | number[]Permitted blockchain chain IDsallowedTokens'ALL' | string[]Permitted token identifierssuccessUrlstringRedirect URL after successful paymentcancelUrlstringRedirect URL on cancellationselectedPriceIdstring | nullSelected product plan price UUIDrequireBillingDetailsbooleanWhether billing details are required at checkoutmetadataobjectArbitrary key-value pairsexpiresAtstringISO 8601 expiration timestampcompletedAtstring | nullISO 8601 timestamp when session completedcreatedAtstringISO 8601 creation timestampupdatedAtstringISO 8601 last-update timestampitemsCheckoutSessionItem[]Line items in this sessionCheckoutSessionItem fields
idstringItem UUIDcheckoutSessionIdstringParent checkout session UUIDproductPlanIdstring | nullLinked product plan UUIDproductPlanPriceIdstring | nullLinked price UUIDnamestringItem display namedescriptionstring | nullItem descriptionamountstringPrice per unit as decimal stringcurrencystringCurrency codequantitynumberItem quantityisPriceOptionbooleanWhether this item uses a price optioncreatedAtstringISO 8601 creation timestamp💡
Retrieve response
The retrieve endpoint returns additional nested objects:
app (full app record), paymentIntent (full payment intent), and each item includes productPlan and productPlanPrice when linked.