UseePay Open API
UseePay PortalMechant Dashboard
Product Docs
Product Docs
  • V2.0
  • V1.0
UseePay PortalMechant Dashboard
Product Docs
Product Docs
  • V2.0
  • V1.0
  1. Checkout session
  • Integration
    • Welcome to the UseePay Demo Page
    • Payment Product Overview
      • Hosted Checkout Integration Guide
      • Embedded Checkout Integration Guide
      • Express Checkout Integration Guide
      • Server to Server Integration Guide
    • About Payment Methods
      • Card
      • Klarna
      • Naver pay
      • Kakao Pay
      • Toss Pay
      • Payco
      • Affirm
      • Blik
      • Trustly
      • Cashapp
      • Pay with Link
      • After Pay
      • ApplePay
        • Apple Pay
        • Apple Pay Web Integration (API Integration)
      • GooglePay
        • Google Pay
        • Google Pay Web Integration (API Integration)
    • Subscription
      • Get started with Subscription
    • Online payment
      • Get started with online payments
    • Payment Capabilities
      • Adaptive Price
      • Supported Payment Methods for Checkout
    • Checkout session
      • Checkout Session Guide
  • Developer
    • Introduction
    • Authentication
    • Errors
    • Error code
      • last_payment_error documentation
    • Best Integration
      • Quickly create a paymentIntent for a subscription
      • Auto-Charge Subscription Guide
    • Payment Intents
      • Payment Intent Overview
      • Quickly create a paymentIntent
      • Create a PaymentIntent
      • Retrieve a PaymentIntent
      • Update a PaymentIntent
      • Confirm a PaymentIntent
      • Cancel a PaymentIntent
      • Capture a PaymentIntent
      • List all payment intents
    • Customers
      • Create a customer
      • Retrieves a customer
      • Update a customer
      • List all customers
    • Subscriptions
      • Create a subscription
      • Retrieves a subscription
      • Update a subscription
      • List all subscriptions
      • Cancel a subscription
    • Invoices
      • Create a invoice
      • Retrieves a invoice
      • List all invoices
      • Pay a invoice
    • Payment Methods
      • Retieve Payment Method Session
    • Mandates
      • Create a mandate
      • Retrieves a mandate
      • List all mandates
    • Refunds
      • Create a refund
      • Retrieves a refund
      • List all refunds
    • Webhooks
      • Webhook Activation/Signature Verification Steps
      • Supported Webhook Events
      • Dispute Webhook Integration Document
      • 2026-04 coming soon
        • Webhook Request Format Update
        • Webhook events for example
      • Before 2026-04 supported
        • Webhook Events Documentation
        • Webhook events for example
      • Create a webhook
      • Retrieves a webhook
      • Update a webhook
      • List all webhooks
    • Embedded Checkout
      • Payment Element
      • Payment Element (Deferred Intent)
      • Express Checkout Element
      • Checkout Session Element
    • About Testing
      • Test Cards
      • ApplePay&GooglePay
    • Payment Method Configuration
      • Retieve Payment Method Configuration
    • Checkout Session
      • Create Checkout Session
      • Retrieve Checkout Session
    • Trackers
      • upload trackers
      • Retrieve a tracker
    • Capture
      • Capture Overview
      • List captures by intent id
    • Schemas
      • CheckoutSessionCreateRequest
      • PaymentMethod
      • CreatePaymentIntentRequest
      • LineItem
      • Customer
      • Address
      • ProductData
      • Shipping
      • SubscriptionData
      • Error
      • DiscountPeriodConfig
      • DeviceData
      • CheckoutSessionResponse
      • ErrorResponse
      • Order
      • Product
      • PaymentMethodOptions
      • RiskControlOptions
      • Mandate
      • PaymentIntent
      • Billing
      • Card
      • AliPay
      • Wallet
      • Klarna
      • WechatPay
      • Refund
      • Subscription
      • Recurring
      • PriceData
      • SubscriptionItem
      • Invoice
      • NextAction
      • Webhook
      • CollectableOptions
      • PaymentLink
      • last_payment_error
      • discount_period_config
      • Capture
  • Reconciliation
    • SFTP Access for Reconciliation
  • Message
    • Messaging Element
  • FAQ
    • Unable to receive Webhook notifications
  1. Checkout session

Checkout Session Guide

πŸ’³ Checkout Session Guide#

πŸ“– Overview#

Checkout Session is a unified payment session object that simplifies the payment integration process. It supports both one-time payments and subscription payments, providing a seamless payment experience for merchants and customers.

✨ Key Features#

🎯 Unified Payment Interface - Single API for both one-time and subscription payments
πŸ”„ Automatic Object Creation - Automatically creates PaymentIntent, Subscription, and Invoice
πŸ’° Flexible Pricing - Support for discount periods, trial periods, and promotional pricing
πŸ” Secure Payment Flow - Built-in security with client secrets and session expiration
πŸ“Š Real-time Status Tracking - Monitor payment progress through session status
🌍 Multi-currency Support - Accept payments in multiple currencies

APIURL
create sessionhttps://docs-v2.useepay.com/405702890e0
elementhttps://docs-v2.useepay.com/8034530m0

πŸ—οΈ Object Relationships#

Payment Mode (One-time Payment)#

Subscription Mode (Recurring Payment)#

Complete Object Relationship Diagram#

πŸ“‹ Object Relationship Table#

ObjectCreated ByPurposeLifecycle
Checkout SessionMerchant API callPayment session container24 hours (default)
SubscriptionCheckout Session (subscription mode)Recurring billing configurationUntil canceled
InvoiceSubscriptionIndividual billing periodPer period
Payment IntentCheckout Session or InvoiceActual payment executionSingle use

πŸ”„ Status Flow#

Checkout Session Status Flow#

Payment Status Flow#

Combined Status Flow (Session + Payment)#

πŸ“Š Status Combinations#

Session StatusPayment StatusDescriptionNext Action
openunpaid🟑 Awaiting paymentCustomer needs to confirm payment
completepaidβœ… Payment succeededNo action needed
expiredunpaid⏰ Session expiredCreate new session

🎯 Use Cases#

1️⃣ One-time Payment#

Scenario: Customer purchases a product for $99.99
{
  "mode": "payment",
  "amount": 99.99,
  "currency": "USD",
  "line_items": [...]
}
Flow:
1.
Create Checkout Session
2.
Customer enters payment details
3.
Confirm payment β†’ Creates PaymentIntent
4.
Payment succeeds β†’ Session status: complete

2️⃣ Subscription (No Discount)#

Scenario: Customer subscribes to a monthly plan at $99.99/month
{
  "mode": "subscription",
  "amount": 99.99,
  "currency": "USD",
  "subscription_data": {},
  "collection_method": "auto_charge",
  "line_items": [{
    "price_data": {
      "recurring": {
        "interval": "month",
        "interval_count": 1
      }
    }
  }]
}
Flow:
1.
Create Checkout Session
2.
Confirm payment β†’ Creates:
Subscription (recurring: $99.99/month)
Invoice #1 (amount: $99.99)
PaymentIntent (amount: $99.99)
3.
Payment succeeds β†’ Session status: complete
4.
Future billing: System auto-creates Invoice #2, #3... at $99.99 each month

collection_method is empty (Merchant-managed subscription)#

If collection_method is empty / not provided, it means the merchant maintains the subscription lifecycle by themselves.
In this mode:
1.
Checkout Session is still used as a unified checkout container.
2.
For the initial confirmation, the system still creates objects in order:
Subscription β†’ Invoice β†’ PaymentIntent
3.
The difference is future billing is not automatically triggered by the system.
4.
The merchant triggers renewals when needed:
The merchant creates a new billing period by calling our Invoice API (with subscription_id)
Then calls invoice.pay to charge the customer for that invoice
5.
The merchant is responsible for subscription lifecycle management (schedule, cancel/pause/resume, retries, etc.).

3️⃣ Subscription with Discount Period#

Scenario: First month 0.01,then99.99/month
{
  "mode": "subscription",
  "amount": 99.99,
  "currency": "USD",
  "subscription_data": {
    "discount_period_config": {
      "discount_period_count": 1,
      "discount_period_amount": 0.01
    }
  },
  "collection_method": "auto_charge"
}
Flow:
1.
Create Checkout Session
2.
Confirm payment β†’ Creates:
Subscription (recurring: 99.99/month,discount:1period@0.01)
Invoice #1 (amount: $0.01 - discount period)
PaymentIntent (amount: $0.01)
3.
Payment succeeds β†’ Session status: complete
4.
Month 2+: System auto-creates Invoice #2, #3... at $99.99 each month
Pricing Timeline:

πŸ” Security Features#

Client Secret#

Each Checkout Session has a unique client_secret for secure access:
{
  "id": "cs_1A2B3C4D5E6F7G8H",
  "client_secret": "cs_1A2B3C4D5E6F7G8H_secret_abc123"
}
Usage: Pass client_secret when confirming payment to ensure only authorized clients can complete the transaction.

Session Expiration#

Default: 24 hours from creation
Purpose: Prevent stale sessions and reduce security risks
Behavior: Expired sessions cannot be confirmed

πŸ“ API Workflow#

Complete Payment Flow (Sequence Diagram)#

Payment Mode Flow (Flowchart)#


🎨 Best Practices#

βœ… DO#

βœ… Set appropriate expiration time - Default 24 hours is suitable for most cases
βœ… Store session_id - Save it in your database for status tracking
βœ… Use metadata - Pass custom data that will be propagated to Subscription/Invoice
βœ… Validate amounts - Ensure line_items total matches the session amount
βœ… Handle webhooks - Listen for payment status changes asynchronously

❌ DON'T#

❌ Don't reuse expired sessions - Create a new session instead
❌ Don't expose client_secret - Keep it secure on the client side
❌ Don't skip validation - Always validate input before creating sessions
❌ Don't hardcode prices - Use dynamic pricing from your product catalog

πŸ” Troubleshooting#

Common Issues#

IssueCauseSolution
❌ "mode required"Missing required fieldInclude mode in request
❌ "amount not equals to item lines"Line items total β‰  amountRecalculate line items total
❌ "subscription_data required"Subscription mode missing configAdd subscription_data object
❌ "Session expired"Session > 24 hours oldCreate new session
❌ "current period start time required"Missing subscription start timeSystem auto-sets (no action needed)

πŸ“š Related Objects#

Quick Reference#

ObjectAPI EndpointPurpose
Checkout Session/v1/checkout/sessionsPayment session management
Payment Intent/v1/payment_intentsExecute individual payments
Subscription/v1/subscriptionsManage recurring billing
Invoice/v1/invoicesIndividual billing periods
Customer/v1/customersCustomer management

πŸ’‘ Examples#

Minimal One-time Payment#

{
  "mode": "payment",
  "amount": 99.99,
  "currency": "USD",
  "merchant_order_id": "order_123",
  "customer": {
    "email": "customer@example.com",
    "name": "John Doe",
    "merchant_customer_id": "cust_123"
  },
  "line_items": [{
    "quantity": 1,
    "price_data": {
      "product_data": {
        "name": "Premium Product"
      },
      "unit_amount": 99.99
    }
  }],
  "payment_method_types": ["card"]
}

Minimal Subscription#

{
  "mode": "subscription",
  "amount": 99.99,
  "currency": "USD",
  "merchant_order_id": "sub_123",
  "customer": {
    "email": "subscriber@example.com",
    "name": "Jane Smith",
    "merchant_customer_id": "cust_456"
  },
  "line_items": [{
    "quantity": 1,
    "price_data": {
      "product_data": {
        "name": "Monthly Plan"
      },
      "unit_amount": 99.99,
      "recurring": {
        "interval": "month",
        "interval_count": 1
      }
    }
  }],
  "subscription_data": {},
  "collection_method": "auto_charge",
  "payment_method_types": ["card"]
}

πŸŽ“ Summary#

Checkout Session is your all-in-one payment solution:
πŸš€ Simple Integration - One API for all payment types
πŸ”„ Automatic Management - Handles object creation and lifecycle
πŸ’° Flexible Billing - Support for discounts, trials, and promotions
πŸ“Š Real-time Tracking - Monitor payment status in real-time
πŸ” Enterprise Security - Built-in security features
Start accepting payments in minutes with Checkout Session! πŸŽ‰

Modified atΒ 2026-01-27 05:16:28
Previous
Supported Payment Methods for Checkout
Next
Introduction
Built with