| API | URL |
|---|---|
| create session | https://docs-v2.useepay.com/405702890e0 |
| element | https://docs-v2.useepay.com/8034530m0 |
| Object | Created By | Purpose | Lifecycle |
|---|---|---|---|
| Checkout Session | Merchant API call | Payment session container | 24 hours (default) |
| Subscription | Checkout Session (subscription mode) | Recurring billing configuration | Until canceled |
| Invoice | Subscription | Individual billing period | Per period |
| Payment Intent | Checkout Session or Invoice | Actual payment execution | Single use |
| Session Status | Payment Status | Description | Next Action |
|---|---|---|---|
open | unpaid | 🟡 Awaiting payment | Customer needs to confirm payment |
complete | paid | ✅ Payment succeeded | No action needed |
expired | unpaid | ⏰ Session expired | Create new session |
{
"mode": "payment",
"amount": 99.99,
"currency": "USD",
"line_items": [...]
}complete{
"mode": "subscription",
"amount": 99.99,
"currency": "USD",
"subscription_data": {},
"collection_method": "auto_charge",
"line_items": [{
"price_data": {
"recurring": {
"interval": "month",
"interval_count": 1
}
}
}]
}completecollection_method is empty / not provided, it means the merchant maintains the subscription lifecycle by themselves.subscription_id){
"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"
}completeclient_secret for secure access:{
"id": "cs_1A2B3C4D5E6F7G8H",
"client_secret": "cs_1A2B3C4D5E6F7G8H_secret_abc123"
}client_secret when confirming payment to ensure only authorized clients can complete the transaction.| Issue | Cause | Solution |
|---|---|---|
| ❌ "mode required" | Missing required field | Include mode in request |
| ❌ "amount not equals to item lines" | Line items total ≠ amount | Recalculate line items total |
| ❌ "subscription_data required" | Subscription mode missing config | Add subscription_data object |
| ❌ "Session expired" | Session > 24 hours old | Create new session |
| ❌ "current period start time required" | Missing subscription start time | System auto-sets (no action needed) |
| Object | API Endpoint | Purpose |
|---|---|---|
| Checkout Session | /v1/checkout/sessions | Payment session management |
| Payment Intent | /v1/payment_intents | Execute individual payments |
| Subscription | /v1/subscriptions | Manage recurring billing |
| Invoice | /v1/invoices | Individual billing periods |
| Customer | /v1/customers | Customer management |
{
"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"]
}{
"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"]
}