curl --location --request POST 'https://openapi1.uat.useepay.com/api/v1/checkout_sessions' \
--header 'x-merchant-no: 500000000007245' \
--header 'x-api-key: FUYTIUvjhgfytfuytwiue' \
--header 'x-app-id: www.pay.com' \
--header 'x-api-version: {{x-api-version}}' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"mode": "payment",
"ui_mode": "custom",
"amount": 99.99,
"currency": "USD",
"merchant_order_id": "order_abc123xyz456",
"customer": {
"email": "customer@example.com",
"name": "John Doe",
"phone": "+1234567890",
"merchant_customer_id": "cust_merchant_123456"
},
"line_items": [
{
"quantity": 1,
"price_data": {
"product_data": {
"name": "Premium Product",
"desc": "High quality product with premium features"
},
"unit_amount": 99.99,
"currency": "USD"
}
}
],
"payment_method_types": [
"card",
"apple_pay",
"google_pay"
],
"metadata": {
"order_type": "online",
"source": "web",
"campaign": "summer_sale"
}
}'{
"id": "cs_1A2B3C4D5E6F7G8H",
"object": "checkout.session",
"mode": "subscription",
"ui_mode": "custom",
"amount": 99.99,
"currency": "USD",
"merchant_order_id": "sub_order_jkl345mno678",
"status": "open",
"customer": {
"id": "cus_9Z8Y7X6W5V4U3T",
"email": "trial@example.com",
"name": "Trial User",
"phone": "+1234567890",
"merchant_customer_id": "cust_trial_merchant_345678"
},
"line_items": [
{
"quantity": 1,
"price_data": {
"product_data": {
"name": "Premium Monthly Plan",
"desc": "Unlimited access with first month discount"
},
"unit_amount": 99.99,
"currency": "USD",
"recurring": {
"interval": "month",
"interval_count": 1,
"total_billing_cycles": 12
}
}
}
],
"subscription_data": {
"discount_period_config": {
"discount_period_count": 1,
"discount_period_amount": 0.01
}
},
"collection_method": "auto_charge",
"payment_method_types": [
"card",
"apple_pay",
"google_pay"
],
"metadata": {
"subscription_type": "premium",
"billing_cycle": "monthly",
"trial_offer": "first_month_99_percent_off"
},
"created": 1705228800,
"expires_at": 1705315200
}