Subscriptions
API ReferenceSubscriptionsConfirm
Confirm Subscription
Confirms a previously created subscription and processes the payment.
POST /subscriptions/{subscription_id}/confirm
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
subscription_id | string | Yes | The unique identifier for the subscription. |
Headers
| Header | Type | Required | Description |
|---|---|---|---|
api-key | string | Yes | Your secret API key. |
X-Profile-Id | string | Yes | Profile ID for authentication. |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
payment_details | object | Yes | Payment method and billing details for confirmation. See Payment Details. |
client_secret | string | No | Short-lived token (15 min) used from the client to authenticate SDK sessions. |
Payment Details
| Parameter | Type | Required | Description |
|---|---|---|---|
payment_method | string | Yes | The payment method type: card, wallet, bank_redirect, bank_transfer, bank_debit, pay_later, crypto, upi, voucher, gift_card, open_banking, mobile_payment, network_token. |
payment_method_data | object | No | The payment method data object. Structure depends on payment_method. See Payment Method Data. |
payment_method_type | string | No | Sub-type of the payment method (e.g. credit, debit, google_pay, apple_pay). |
payment_type | string | No | normal, new_mandate, setup_mandate, or recurring_mandate. Use setup_mandate for zero-auth flows. |
payment_token | string | No | Pre-existing payment token (e.g. token_sxJdmpUnpNsJk5VWzcjl). |
customer_acceptance | object | No | Mandate acceptance details. See Customer Acceptance. |
billing | object | No | Billing address. See Address. |
shipping | object | No | Shipping address. See Address. |
Payment Method Data
Pass the appropriate object key matching your payment_method value.
Card
| Parameter | Type | Required | Description |
|---|---|---|---|
card.card_number | string | Yes | The full card number (e.g. 4242424242424242). |
card.card_exp_month | string | Yes | Card expiry month (e.g. 03). |
card.card_exp_year | string | Yes | Card expiry year (e.g. 2030). |
card.card_holder_name | string | Yes | Name on the card. |
card.card_cvc | string | Yes | Card verification code. |
card.card_network | string | No | Card network: Visa, Mastercard, AmericanExpress, JCB, etc. |
card.nick_name | string | No | Friendly name for the card. |
Customer Acceptance
| Parameter | Type | Required | Description |
|---|---|---|---|
acceptance_type | string | Yes | How the mandate was accepted: online or offline. |
accepted_at | string | No | ISO 8601 timestamp of when acceptance was given (e.g. 2022-09-10T10:11:12Z). |
online.ip_address | string | Yes (if online) | Customer's IP address at time of acceptance. |
online.user_agent | string | Yes (if online) | Customer's browser user agent string. |
Address
| Parameter | Type | Required | Description |
|---|---|---|---|
address.line1 | string | No | First line of the street address. |
address.line2 | string | No | Second line (apartment, suite, unit, etc.). |
address.line3 | string | No | Third line, if applicable. |
address.city | string | No | City, district, suburb, town, or village. |
address.state | string | No | State or region. |
address.zip | string | No | Postal or ZIP code. |
address.country | string | No | Two-letter ISO 3166-1 country code (e.g. US, GB). |
address.first_name | string | No | First name on the address. |
address.last_name | string | No | Last name on the address. |
phone.number | string | No | Contact phone number. |
phone.country_code | string | No | Phone country code (e.g. +1). |
email | string | No | Email address. |
Request Example
curl -X POST 'https://api.sandbox.paychtec.com/subscriptions/sub_123/confirm' \ -H "Content-Type: application/json" \ -H "api-key: snd_YOUR_API_KEY" \ -H "X-Profile-Id: prof_12345" \ -d '{"payment_details": { "payment_method": "card", "payment_method_type": "credit", "payment_method_data": { "card": { "card_number": "4111111111111111", "card_exp_month": "03", "card_exp_year": "2030", "card_holder_name": "John Doe", "card_cvc": "737" } }, "customer_acceptance": { "acceptance_type": "online", "accepted_at": "2024-01-01T10:00:00Z", "online": { "ip_address": "127.0.0.1", "user_agent": "Mozilla/5.0" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "city": "San Francisco", "state": "California", "zip": "94122", "country": "US", "first_name": "John", "last_name": "Doe" }, "phone": { "number": "123456789", "country_code": "+1" } }}}'Response
{
"id": "sub_abc123",
"status": "active",
"profile_id": "prof_12345",
"merchant_id": "mer_abc123",
"customer_id": "cust_123456789",
"item_price_id": "standard-plan-USD-Monthly",
"payment": {
"payment_id": "pay_xyz789",
"status": "succeeded",
"amount": 2900,
"currency": "USD",
"payment_method_type": "credit"
},
"invoice": {
"id": "inv_abc123",
"subscription_id": "sub_abc123",
"amount": 2900,
"currency": "USD",
"status": "invoice_paid"
}
}Subscription Statuses
| Status | Description |
|---|---|
active | Subscription confirmed and billing normally. |
pending | Awaiting final activation. |
failed | Confirmation or payment failed. |
unpaid | Payment was not collected successfully. |
cancelled | Subscription was cancelled during confirmation. |
Error Responses
| Status Code | Description |
|---|---|
400 | Invalid confirmation data — check payment_method and required fields. |
404 | Subscription not found — verify the subscription_id. |
409 | Subscription already confirmed — cannot confirm twice. |