API Docs
Subscriptions
API ReferenceSubscriptionsConfirm

Confirm Subscription

Confirms a previously created subscription and processes the payment.

POST /subscriptions/{subscription_id}/confirm

Path Parameters

ParameterTypeRequiredDescription
subscription_idstringYesThe unique identifier for the subscription.

Headers

HeaderTypeRequiredDescription
api-keystringYesYour secret API key.
X-Profile-IdstringYesProfile ID for authentication.

Body Parameters

ParameterTypeRequiredDescription
payment_detailsobjectYesPayment method and billing details for confirmation. See Payment Details.
client_secretstringNoShort-lived token (15 min) used from the client to authenticate SDK sessions.

Payment Details

ParameterTypeRequiredDescription
payment_methodstringYesThe 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_dataobjectNoThe payment method data object. Structure depends on payment_method. See Payment Method Data.
payment_method_typestringNoSub-type of the payment method (e.g. credit, debit, google_pay, apple_pay).
payment_typestringNonormal, new_mandate, setup_mandate, or recurring_mandate. Use setup_mandate for zero-auth flows.
payment_tokenstringNoPre-existing payment token (e.g. token_sxJdmpUnpNsJk5VWzcjl).
customer_acceptanceobjectNoMandate acceptance details. See Customer Acceptance.
billingobjectNoBilling address. See Address.
shippingobjectNoShipping address. See Address.

Payment Method Data

Pass the appropriate object key matching your payment_method value.

Card

ParameterTypeRequiredDescription
card.card_numberstringYesThe full card number (e.g. 4242424242424242).
card.card_exp_monthstringYesCard expiry month (e.g. 03).
card.card_exp_yearstringYesCard expiry year (e.g. 2030).
card.card_holder_namestringYesName on the card.
card.card_cvcstringYesCard verification code.
card.card_networkstringNoCard network: Visa, Mastercard, AmericanExpress, JCB, etc.
card.nick_namestringNoFriendly name for the card.

Customer Acceptance

ParameterTypeRequiredDescription
acceptance_typestringYesHow the mandate was accepted: online or offline.
accepted_atstringNoISO 8601 timestamp of when acceptance was given (e.g. 2022-09-10T10:11:12Z).
online.ip_addressstringYes (if online)Customer's IP address at time of acceptance.
online.user_agentstringYes (if online)Customer's browser user agent string.

Address

ParameterTypeRequiredDescription
address.line1stringNoFirst line of the street address.
address.line2stringNoSecond line (apartment, suite, unit, etc.).
address.line3stringNoThird line, if applicable.
address.citystringNoCity, district, suburb, town, or village.
address.statestringNoState or region.
address.zipstringNoPostal or ZIP code.
address.countrystringNoTwo-letter ISO 3166-1 country code (e.g. US, GB).
address.first_namestringNoFirst name on the address.
address.last_namestringNoLast name on the address.
phone.numberstringNoContact phone number.
phone.country_codestringNoPhone country code (e.g. +1).
emailstringNoEmail 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

StatusDescription
activeSubscription confirmed and billing normally.
pendingAwaiting final activation.
failedConfirmation or payment failed.
unpaidPayment was not collected successfully.
cancelledSubscription was cancelled during confirmation.

Error Responses

Status CodeDescription
400Invalid confirmation data — check payment_method and required fields.
404Subscription not found — verify the subscription_id.
409Subscription already confirmed — cannot confirm twice.