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 Plan

payments/create-plan@1.0.0
2 providers

Create Subscription Plan

Creates a subscription plan in a payment system.

Input
Product ID
Name
Interval
Price
Currency code
Result
Plan ID
State

1.Choose a provider

2.Use CreatePlan 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)

productId
The ID of the product to create a subscription plan for. (To be created with `payments/create-product`)
name
Name of the subscription plan
interval
Frequency of the interval at which the customer is charged. Possible values: - `day` - `week` - `month` - `year`
price
Amount charged each `interval` cycle.
currency
Three-letter currency code in which `price` is specified, in ISO 4217 format.

Example

Result (object)

planId
ID of the plan.
state
State of the plan. Possible values: - `created` - The plan was just created. It may not be possible to accept new subscriptions yet. - `active` - The plan is active and accepting new subscriptions. - `inactive` - The plan has been deactivated, and cannot accept new subscriptions.

Example

Implementation details

Provider
mock
Use case
CreatePlan
Author
@superface
Source
Verified