Create Subscription
Subscriptions
Create Subscription
This endpoint creates a new subscription for a customer, enrolls the customer’s card, and initiates the first payment where applicable.
Important Notes
cardDetailsis mandatory when creating a subscription.- If no trial period is configured, the first charge is attempted immediately after the card is enrolled.
- If a trial period is configured, the subscription is created with a status of TRIALING. The card is enrolled immediately, but the first charge is deferred until the trial period ends.
- When additional customer authentication is required, the subscription is created with a status of REQUIRES_ACTION, and the response includes the 3D Secure challenge details.
- Creating another active subscription using the same
customerIdandplanCodereturns a 409 Conflict response. - Before the first successful payment, the subscription remains in the INCOMPLETE state.
- The card service determines the charge mode (DIRECT_CHARGE, TOKENIZATION, or AGREEMENT_BASED) during card enrollment and returns it in the response. The subscription service stores this value for future recurring billing.
POST
Create Subscription
Authorizations
Payaza {{Public API Key in Base 64}}
Body
application/json
The unique reference identifier assigned to the customer.
Example:
"test-trial"
The email address of the customer used for transactional notifications.
Example:
"johndoe@gmail.com"
The unique plan code generated when the subscription plan was created. If omitted, a plan is automatically created from the request.
Example:
"PLN_906FE4B"
The card information used to enroll the customer for recurring billing.
Response
Subscription Created