On this page:
https://api.premepay.com/v1/stores/:id/plans
Primefy provides its users with the functionality to create personalized subscription plans. To customize your plans, you first need to create your subscription plan. Once you have your subscription plan created, you will only need to link the subscribing consumers, following the steps described in the Subscription plan section.
The Subscription Plan can be associated with national and international consumers.
You can create a subscription plan using the route above.
Parameter | Type | Description | Required |
---|---|---|---|
name |
string | Plan name | Yes |
description |
string | Description | Yes |
frequency |
integer | Frequency | Yes |
paymentTypes |
array<integer> | Payment type | Yes, at least one |
0 |
Credit card | ||
1 |
Bank Slip (Boleto Bancário) | ||
3 |
Pix | ||
products |
array<object> | Products associated with the Plan | No |
productId |
integer | Product Id | No |
quantity |
decimal | Number of Products associated with the Plan | No |
amount |
decimal | Amount | Yes |
currency |
string | Alpha code of the currency to be processed. Example: "GBP", "USD", "CAD” | Yes (for International Plans) |
gracePeriod |
integer | Grace period | Yes |
maxCharges |
integer | Number of charges according to frequency. Use the value 0 for recurring charges with no maximum period | No |
chargeDaysBefore |
integer | Defines how many days before the charge should be generated | No |
tax |
object | No | |
mode |
See table above with descriptions | No | |
amount |
Value of the Fee to be applied | No |
ID | Status |
---|---|
0 | Daily |
1 | Weekly |
2 | Monthly |
3 | Quarterly |
4 | Six-monthly |
5 | Annual |
This is an example of what your request to create a subscription plan might look like. This is the necessary first step to add your customers to a recurring subscription plan.
If your request has invalid creation parameters - for example, specifying an invalid field or value - you may receive an error response. Below is the complete list of possible error responses:
Related Content
<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a22a31f7-bd92-40af-8042-7685c0c0859a/GET.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a22a31f7-bd92-40af-8042-7685c0c0859a/GET.png" width="40px" /> GET - Get subscription plan details
</aside>
<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/52c5ff42-e8bf-45d3-81d1-b6e05786a688/POST.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/52c5ff42-e8bf-45d3-81d1-b6e05786a688/POST.png" width="40px" /> POST - Add customer to plan
</aside>