API Docs
Subscriptions
API ReferenceSubscriptionsCreate

Create Subscription

Creates a subscription that requires separate confirmation. Use this endpoint when you need to collect payment details from the customer after creating the subscription (e.g. via the SDK). To create and confirm in one step, use Create and Confirm Subscription.

POST /subscriptions/create

Headers

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

Body Parameters

ParameterTypeRequiredDescription
customer_idstringYesThe unique identifier for the customer.
item_price_idstringYesIdentifier for the item price to subscribe to (e.g. standard-plan-USD-Monthly).
payment_detailsobjectYesPayment configuration for the subscription. See Payment Details.
merchant_reference_idstringNoYour own unique identifier for this subscription.
plan_idstringNoIdentifier for the subscription plan.
coupon_codestringNoCoupon code to apply to the subscription.
billingobjectNoBilling address. See Address.
shippingobjectNoShipping address. See Address.

Payment Details

ParameterTypeRequiredDescription
return_urlstringYesURL to redirect the user to after payment completion.
authentication_typestringNothree_ds or no_three_ds. Defaults to connector behaviour if omitted.
capture_methodstringNoautomatic, manual, manual_multiple, scheduled, or sequential_automatic. Defaults to automatic.
setup_future_usagestringNooff_session (charge later without customer present) or on_session. Defaults to on_session.
payment_typestringNonormal, new_mandate, setup_mandate, or recurring_mandate. Use setup_mandate for zero-auth flows.

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/create' \  -H "Content-Type: application/json" \  -H "api-key: snd_YOUR_API_KEY" \  -H "X-Profile-Id: prof_12345" \  -d '{  "customer_id": "cust_123456789",  "item_price_id": "standard-plan-USD-Monthly",  "payment_details": {    "authentication_type": "no_three_ds",    "capture_method": "automatic",    "return_url": "https://yourapp.com/return",    "setup_future_usage": "off_session"  }}'

Response

{
  "id": "sub_abc123",
  "status": "created",
  "profile_id": "prof_12345",
  "merchant_id": "mer_abc123",
  "customer_id": "cust_123456789",
  "item_price_id": "standard-plan-USD-Monthly",
  "client_secret": "cs_live_...",
  "payment": {
    "payment_id": "pay_xyz789",
    "status": "requires_confirmation",
    "amount": 2900,
    "currency": "USD"
  },
  "invoice": {
    "id": "inv_abc123",
    "subscription_id": "sub_abc123",
    "amount": 2900,
    "currency": "USD",
    "status": "payment_pending"
  }
}

The response includes a client_secret which expires after 15 minutes. Pass this to the SDK or use it to authenticate the subsequent Confirm Subscription call.

Subscription Statuses

StatusDescription
createdSubscription created but not yet confirmed.
activeSubscription is live and billing normally.
pendingAwaiting activation.
trialIn a free trial period.
pausedTemporarily paused.
unpaidPayment failed and subscription is unpaid.
cancelledSubscription has been cancelled.
failedSubscription setup failed.
in_activeSubscription is inactive.
onetimeOne-time payment subscription.

Error Responses

Status CodeDescription
400Invalid subscription data — check required fields and payment details.
404Customer or plan not found — verify customer_id and item_price_id.