Skip to main content

Overview

A subscription checkout creates a recurring deposit flow for a customer. Subscription checkouts are deposit-only and require line_items plus subscription_data. Dynamic inline pricing with price_cents is currently supported for subscription checkouts only. Regular purchase checkouts should continue to reference existing products by product_id.

How It Works

  1. Create a checkout session with type: "deposit".
  2. Include line_items for the subscription product.
  3. Include subscription_data with the billing interval and interval count.
  4. The customer is redirected to the Soap-hosted checkout page.
  5. Upon completion, Soap creates the checkout and associated subscription metadata.

API Request

curl -X POST 'https://api-sandbox.paywithsoap.com/api/v1/checkouts' \
--header 'Content-Type: application/json' \
--header 'Authorization: YOUR_API_KEY' \
--data '{
    "customer_id": "cus_aaN5GMMF8CFpsYMuEnN9DPFMtGQaVDQZ",
    "type": "deposit",
    "line_items": [
        {
            "name": "Premium Monthly Plan",
            "price_cents": 2999,
            "quantity": 1,
            "sku": "PREMIUM-MONTHLY",
            "url": "https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=800&q=80",
            "dedup": true
        }
    ],
    "subscription_data": {
        "interval": "month",
        "interval_count": 1
    }
}'

Key Parameters

ParameterRequiredDescription
customer_idYesThe customer’s unique identifier
typeYesMust be "deposit"
line_itemsYesArray of existing product references or inline subscription products
subscription_data.intervalYesBilling interval: day, week, month, or year
subscription_data.interval_countYesNumber of intervals between charges
experienceNo"web" or "webview"
return_urlNoWhere to redirect the customer after completion

Line Items

Subscription line items can be either:
  • An existing product reference with product_id and quantity.
  • An inline dynamic product with name, price_cents, and quantity, plus optional sku, url, and dedup.
When dedup is true, include a stable sku. Soap reuses a matching product for the business by sku and price_cents instead of creating a duplicate.

When to Use

  • Monthly or annual memberships
  • Recurring subscription products
  • Quarterly billing using interval: "month" and interval_count: 3

Back to Create Checkout

View the full API reference for creating checkouts.