Skip to main content

Plans

A plan is a template that defines the terms of a subscription, such as price, billing frequency, and duration. Before you can create a subscription for a customer, you must first set up at least one plan.


Features​

Authentication and Security

To access the API, it is necessary to authenticate each request with a token, see Authentication.

πŸ“Œ Create a plan​

  • Base URL: https://api-sandbox.n1co.shop
  • Method: POST
  • Endpoint: /api/v3/Plans
  • Description: Creates a new subscription plan.
  • Required Headers:
  • Content-Type: application/json
  • Authorization: Bearer {your_token}
  • Example:
{
"name": "Expert Family Plan",
"description": "Plan for 2 students with full access",
"amount": 499,
"customFields": [
{
"label": "SAVE 10 MONTHS",
"name": "savings_label",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": ""
},
{
"label": "Professional and updated content with digital certificates",
"name": "feature_content_digital",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "included"
},
{
"label": "Physical certificates for professional learning paths",
"name": "feature_physical_certificates",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "included"
},
{
"label": "Access to Startups, English, and leadership schools",
"name": "feature_special_schools",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "included"
},
{
"label": "Exclusive events like Platzi Conf",
"name": "feature_exclusive_events",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "included"
},
{
"label": "Download content on the mobile app",
"name": "feature_mobile_download",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "included"
}
],
"billingCycleType": "Year",
"billingCyclesNumber": 1,
"cyclesToBillBeforeAllowCancelation": null,
"termsAndConditions": "Annual family plan for 2 students. Save $589 vs 2 monthly plans for 12 months.",
"subscriberLimit": null,
"enrollmentEndDate": null,
"subscriptionEndDate": null,
"billingDay": null,
"locationId": 578
}

Request Parameters​

ParameterTypeRequiredDescription
namestringβœ…Name of the subscription plan
descriptionstringβœ…Description of the subscription plan
amountdecimalβœ…Price set for the subscription plan
customFieldsarray of objects❌Allows configuring custom fields for the plan, it is optional
customFields[].labelstringβœ…A value is required for each custom field
customFields[].namestringβœ…A name is required and must be unique for each custom field
customFields[].placeholderstring❌Can be used for an input field
customFields[].isRequiredboolean❌Can be used for an input field
customFields[].isVisibleboolean❌Can be used for an input field
customFields[].isEditableboolean❌Can be used for an input field
customFields[].defaultValuestring❌Allows assigning a default value
billingCycleTypestringβœ…Type of billing cycle: Day, Week, Month, Year
billingCyclesNumberintegerβœ…Billing frequency according to billingCycleType (e.g., 2 days, 3 months, 1 year)
cyclesToBillBeforeAllowCancelationinteger❌Number of mandatory periods before allowing cancellation. Send null if not applicable
termsAndConditionsstring❌Allows indicating the terms and conditions for the plan
subscriberLimitinteger❌Subscriber limit for the plan. Send null for unlimited
enrollmentEndDatedatetime❌Deadline to accept new subscribers (ISO 8601 format). After this date, no more subscribers will be accepted. Can be null
subscriptionEndDatedatetime❌Subscription end date (ISO 8601 format). Upon reaching this date, the subscription becomes inactive and no further charges will be made. Can be null
billingDayinteger❌Specific day of the month to make the charge (only for monthly subscriptions). Values: 1-27 or 31. Can be null
locationIdintegerβœ…ID of the branch to which the plan will be associated. Obtained from Portal β†’ Settings β†’ Branches
billingCycleType Values

Accepted values are:

  • Day - Daily cycle
  • Week - Weekly cycle
  • Month - Monthly cycle
  • Year - Annual cycle
Billing Day

The billingDay parameter only applies when billingCycleType is Month. For other cycle types, it must be sent as null.


πŸ“Œ Query the details of a plan​

  • Base URL: https://api-sandbox.n1co.shop
  • Method: GET
  • Endpoint: /api/v3/Plans/{planId}
  • Description: Gets the information of a subscription plan.
  • Required Headers:
  • Authorization: Bearer {your_token}
  • Response Example:
{
"planId": 1807,
"name": "Plan Basic 01",
"description": "Monthly plan for 1 student",
"endDate": null,
"cyclesToBillBeforeAllowCancelation": null,
"subscriberLimit": null,
"enrollmentEndDate": null,
"billingCyclesNumber": 1,
"billingCycleType": "Month",
"termsAndConditions": "Recurring monthly charge. You can cancel at any time.",
"activeSubscriptionsCount": 0,
"inactiveSubscriptionsCount": 0,
"paymentLink": {
"created": "2025-11-10T20:12:18.2824468Z",
"code": "OjYjhP8",
"linkUrl": "https://pay.h4b.dev/pl/OjYjhP8",
"expirationDateTime": null,
"amount": 39.0000,
"isActive": true,
"maxSales": null,
"customFields": [
{
"label": "Professional and updated content with digital certificates",
"name": "feature_content_digital",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "included"
},
{
"label": "Physical certificates for professional learning paths",
"name": "feature_physical_certificates",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "not_included"
},
{
"label": "Access to Startups, English, and leadership schools",
"name": "feature_special_schools",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "not_included"
},
{
"label": "Exclusive events like Platzi Conf",
"name": "feature_exclusive_events",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "not_included"
},
{
"label": "Download content on the mobile app",
"name": "feature_mobile_download",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "not_included"
}
]
},
"billingDay": 1,
"locationId": 578,
"createdBy": "c8573b9a-88ea-45b6-aef4-4817440f2cc9",
"currencyCode": "USD",
"locale": "es-SV",
"isActive": true
}

πŸ“Œ Query all created plans​

  • Base URL: https://api-sandbox.n1co.shop
  • Method: GET
  • Endpoint: /api/v3/Plans/all
  • Description: Gets the details of all created plans.
  • Required Headers:
  • Authorization: Bearer {your_token}
  • Response Example:
[
{
"planId": 1809,
"name": "Expert Plan",
"description": "Plan for 1 student with full access",
"endDate": null,
"cyclesToBillBeforeAllowCancelation": null,
"subscriberLimit": null,
"enrollmentEndDate": null,
"billingCyclesNumber": 1,
"billingCycleType": "Year",
"termsAndConditions": "Annual plan. Save $343 compared to 12 months of the monthly plan.",
"activeSubscriptionsCount": 0,
"inactiveSubscriptionsCount": 0,
"paymentLink": {
"created": "2025-11-10T20:12:30.7746804Z",
"code": "Awp8s5B",
"linkUrl": "https://pay.h4b.dev/pl/Awp8s5B",
"expirationDateTime": null,
"amount": 249.0000,
"isActive": true,
"maxSales": null,
"customFields": [
{
"label": "SAVE 7 MONTHS",
"name": "savings_label",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": ""
},
{
"label": "Professional and updated content with digital certificates",
"name": "feature_content_digital",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "included"
},
{
"label": "Physical certificates for professional learning paths",
"name": "feature_physical_certificates",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "included"
},
{
"label": "Access to Startups, English, and leadership schools",
"name": "feature_special_schools",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "included"
},
{
"label": "Exclusive events like Platzi Conf",
"name": "feature_exclusive_events",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "included"
},
{
"label": "Download content on the mobile app",
"name": "feature_mobile_download",
"placeholder": "",
"isRequired": false,
"isVisible": false,
"isEditable": false,
"defaultValue": "included"
}
]
},
"billingDay": null,
"locationId": 578,
"createdBy": "c8573b9a-88ea-45b6-aef4-4817440f2cc9",
"currencyCode": "USD",
"locale": "es-SV",
"isActive": true
}
]

πŸ“Œ Query the subscriptions of a plan​

  • Base URL: https://api-sandbox.n1co.shop
  • Method: GET
  • Endpoint: /api/v3/Plans/{planId}/Subscriptions
  • Description: Gets the information of all subscriptions for a plan.
  • Required Headers:
  • Authorization: Bearer {your_token}
  • Response Example:
[
{
"subscriptionId": 480,
"planId": 1544,
"name": "ePay Plan",
"description": "ePay subscription description",
"created": "2025-10-15T21:36:26.9682946Z",
"amount": 45.9900,
"amountFormatted": "$45.99",
"billingCycle": 1,
"billingCycleType": "Month",
"currencyCode": "USD",
"locale": "es-SV",
"currentPeriodStart": "2025-10-16T21:36:26.7660968Z",
"currentPeriodEnd": "2025-11-16T21:36:26.7660968Z",
"timezone": "America/El_Salvador",
"subscriptionStatus": "Active",
"customer": {
"name": "Carlos DΓΊran",
"email": "[email protected]",
"phone": "+50364331900",
"paymentMethodName": "TEST 001",
"paymentMethodCardBrand": "visa",
"paymentMethodBin": "400000",
"paymentMethodLastDigits": "2701",
"backupPaymentMethodName": "TEST 002",
"backupPaymentMethodCardBrand": "visa",
"backupPaymentMethodBin": "424242",
"backupPaymentMethodLastDigits": "4242"
}
}
]

πŸ“Œ Query all customers associated with a plan​

  • Base URL: https://api-sandbox.n1co.shop
  • Method: GET
  • Endpoint: /api/v3/Plans/{planId}/customers
  • Description: Gets all customers of a subscription plan.
  • Required Headers:
  • Authorization: Bearer {your_token}
  • Response Example:
[
{
"subscriptionId": 467,
"planId": 576,
"subscriptionStatus": "Inactive",
"enrollmentDate": "2025-09-04T23:08:49.9261083Z",
"currentPeriodStart": "2025-09-05T23:08:49.6377287Z",
"currentPeriodEnd": "2025-10-05T23:08:49.6377287Z",
"subscriptionOrdersCount": 2,
"customer": {
"name": "Carlos DΓΊran",
"email": "[email protected]",
"phone": "+50364331900",
"paymentMethodName": "TEST 001",
"paymentMethodCardBrand": "visa",
"paymentMethodBin": "400000",
"paymentMethodLastDigits": "2701",
"backupPaymentMethodName": "TEST 002",
"backupPaymentMethodCardBrand": "visa",
"backupPaymentMethodBin": "424242",
"backupPaymentMethodLastDigits": "4242"
}
},
{
"subscriptionId": 474,
"planId": 576,
"subscriptionStatus": "Active",
"enrollmentDate": "2025-09-25T21:41:03.4362415Z",
"currentPeriodStart": "2025-09-26T21:41:03.1469338Z",
"currentPeriodEnd": "2025-10-26T21:41:03.1469338Z",
"subscriptionOrdersCount": 2,
"customer": {
"name": "Sandra Elizabeth MartΓ­nez",
"email": "[email protected]",
"phone": "+50774331002",
"paymentMethodName": "TEST 003",
"paymentMethodCardBrand": "visa",
"paymentMethodBin": "500000",
"paymentMethodLastDigits": "3001",
"backupPaymentMethodName": "TEST 004",
"backupPaymentMethodCardBrand": "visa",
"backupPaymentMethodBin": "222201",
"backupPaymentMethodLastDigits": "5589"
}
}
]