You are viewing a section of Superface that will be deprecated in Q4 2023. Until then, you can continue to use it as you have before but we recommend that you migrate to our latest version soon. For more details visit superface.ai/docs/migrate.

Create Subscription

payments/create-subscription@1.0.0
2 providers

Create Subscription

Creates a subscription for a subscription plan in a payment system.

Input
Plan ID
Customer Identificator
Result
ID
Status

1.Choose a provider

2.Use CreateSubscription with mock in your code

Below instructions are for our Node.js SDK. Use OneService for other languages.
npm i @superfaceai/one-sdk

Structure details

Input (object)

planId
ID of the plan to create a subscription for.
customer
Unique customer identficator specific to payment system (e.g. e-mail)

Example

Result (object)

subscriptionId
Unique identifier of the subscription.
status
Status of the subscription. Possible values: - `pending` - The subscription has been created, but not yet approved. - `approved` - The subscription has been approved by the buyer. - `active` - The subscription is active. - `trialing` - The subscription is currently in its trial period. - `past_due` - The subscription failed to be paid. - `suspended` - The subscription has been suspended. - `unpaid` - The subscription failed to be paid, and all retry attempts have been exhausted. - `cancelled` - The subscription has been cancelled. - `expired` - The subscription has expired.

Example

Implementation details

Provider
mock
Use case
CreateSubscription
Author
@superface
Source
Verified