RapidCents
Subscription checkout
POST …/checkout/create with mode: subscription plus subscription fields. Embedded and hosted use the same JSON; only ui_mode changes. RapidPay does not support subscriptions.
When to use
- Recurring plans billed through RapidCents checkout.
- Choose
ui_mode: embedded(iframe) orhosted(redirect) the same way as one-time checkout.
Staging/production hosts: Overview → APIs.
Required API
All checkout API requests require:
-
Authorization: Bearer <access_token>— from OAuth (see Overview → OAuth). -
Origin— HTTPS origin of your app (for examplehttps://shop.example.com). It must match the origin registered for your API client in RapidCents. -
Content-Type: application/jsonandAccept: application/jsonunless the API specifies otherwise.
Never expose tokens in the browser
Create checkout sessions on your server only. Do not send the access token to client-side JavaScript.
HTTP headers
Required on every checkout/create call from your backend.
Authorization
string
Origin
string
Content-Type
string
Accept
string
Parameters
Path parameters
In the URL path (not the JSON body). Pattern: POST {API origin}/api/{business_id}/checkout/create
business_id
string (UUID)
Line item objects (line_items[])
Multiple lines for carts or itemized receipts; one object is enough for a single SKU. Omit or send one row when you do not need a breakdown.
name
string
quantity
number
unit_amount
number
total
number
Subscription session (mode: subscription)
Plan object, amounts, return URLs, line_items, optional customer fields. Only ui_mode differs between embedded and hosted. RapidPay does not support subscriptions.
ui_mode
string
mode
string
amount_total
number
amount_subtotal
number
currency
string
success_url
string (URL)
cancel_url
string (URL)
customer_email
string
customer_name
string
subscription
object
subscription.interval
string
subscription.start_date
string (date)
subscription.is_installment
boolean
subscription.name
string
line_items
array
API contract
Confirm subscription field requirements with your RapidCents integration or account manager; APIs may vary by product tier.
Example request
Only ui_mode differs between embedded and hosted.
curl -sS -X POST "https://uatstage00-api.rapidcents.com/api/YOUR_BUSINESS_ID/checkout/create" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Origin: https://your-https-app.example.com" \
-d '{
"ui_mode": "embedded",
"mode": "subscription",
"amount_total": 29.99,
"amount_subtotal": 29.99,
"currency": "CAD",
"success_url": "https://your-https-app.example.com/subscription/success?session=1",
"cancel_url": "https://your-https-app.example.com/plans",
"customer_email": "subscriber@example.com",
"subscription": {
"interval": "Monthly",
"start_date": "2026-04-17",
"is_installment": false,
"name": "Pro plan"
},
"line_items": [
{ "name": "Pro plan", "quantity": 1, "unit_amount": 29.99, "total": 29.99 }
]
}'
Example response
{
"ok": true,
"message": "Checkout session created successfully",
"status": "PENDING",
"checkout_session": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"token": "a1b2c3d4e5f6789012345678901234567890abcdef0123456789abcdef012345",
"checkout_url": "https://checkout.rapidcents.com/session/a1b2c3d4\u2026/embedded",
"allowed_origins": [
"https://shop.example.com"
],
"expires_at": "2026-04-21T18:00:00.000000Z",
"session_status": "PENDING",
"payment_status": "UNPAID",
"amount_total": 49.99,
"amount_subtotal": 49.99,
"amount_tax": 0,
"amount_discount": 0,
"surcharge": false,
"amount_surcharge": 0,
"surcharge_rate": null,
"currency": "CAD",
"mode": "payment",
"description": null,
"customer_id": null,
"customer_email": "buyer@example.com",
"customer_name": "Alex Rivera",
"client_reference_id": null,
"success_url": "https://shop.example.com/thank-you?order=1",
"cancel_url": "https://shop.example.com/cart",
"return_url": null,
"metadata": [],
"ui_mode": "embedded",
"created_at": "2026-04-21T12:00:00.000000Z",
"billing_address_collection": null,
"shipping_address_collection": null,
"billing_address": null,
"shipping_address": null,
"consent": null,
"consent_collection": null,
"phone_number_collection": null,
"line_items": [
{
"name": "Premium plan (monthly)",
"quantity": 1,
"unit_amount": 49.99,
"total": 49.99
}
],
"discounts": null,
"apply_discount": null,
"total_details": null,
"invoice_creation": null,
"tax_id_collection": null
},
"transaction": null
}
checkout_session.token— store as your external session or order correlation id.checkout_session.checkout_url— load in an iframe, new tab, or follow as a redirect depending on the mode.
Browser usage, success_url / cancel_url, security, and common errors are documented once in
Checkout overview → Browser / frontend,
Success & cancel URLs,
Security, and
Common errors.