curl --request POST \
--url https://sandbox-platform.jupico.com/v1/subscriptions/plan \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"subMerchantId": "jpt-sim-md-1",
"name": "Test plan",
"description": "Plan description",
"schedules": [
{
"order": 1,
"label": "Free week",
"invoiceDescription": "Invoice desc for free week.",
"frequency": "one-time",
"cyclesQty": 1,
"executionDays": [
1
],
"pricingModel": {
"type": "free",
"free": {
"daysQty": 7
}
},
"featuresEnabled": false
},
{
"order": 2,
"label": "Monthly plan",
"invoiceDescription": "Invoice description for monthly plan.",
"frequency": "monthly",
"cyclesQty": 60,
"executionDays": [
0
],
"pricingModel": {
"type": "perUsageQuantity",
"perUsageQuantity": {
"unit": "device",
"unitPrice": 10
}
},
"featuresEnabled": false
}
]
}
'import requests
url = "https://sandbox-platform.jupico.com/v1/subscriptions/plan"
payload = {
"subMerchantId": "jpt-sim-md-1",
"name": "Test plan",
"description": "Plan description",
"schedules": [
{
"order": 1,
"label": "Free week",
"invoiceDescription": "Invoice desc for free week.",
"frequency": "one-time",
"cyclesQty": 1,
"executionDays": [1],
"pricingModel": {
"type": "free",
"free": { "daysQty": 7 }
},
"featuresEnabled": False
},
{
"order": 2,
"label": "Monthly plan",
"invoiceDescription": "Invoice description for monthly plan.",
"frequency": "monthly",
"cyclesQty": 60,
"executionDays": [0],
"pricingModel": {
"type": "perUsageQuantity",
"perUsageQuantity": {
"unit": "device",
"unitPrice": 10
}
},
"featuresEnabled": False
}
]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subMerchantId: 'jpt-sim-md-1',
name: 'Test plan',
description: 'Plan description',
schedules: [
{
order: 1,
label: 'Free week',
invoiceDescription: 'Invoice desc for free week.',
frequency: 'one-time',
cyclesQty: 1,
executionDays: [1],
pricingModel: {type: 'free', free: {daysQty: 7}},
featuresEnabled: false
},
{
order: 2,
label: 'Monthly plan',
invoiceDescription: 'Invoice description for monthly plan.',
frequency: 'monthly',
cyclesQty: 60,
executionDays: [0],
pricingModel: {type: 'perUsageQuantity', perUsageQuantity: {unit: 'device', unitPrice: 10}},
featuresEnabled: false
}
]
})
};
fetch('https://sandbox-platform.jupico.com/v1/subscriptions/plan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://sandbox-platform.jupico.com/v1/subscriptions/plan';
const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subMerchantId: 'jpt-sim-md-1',
name: 'Test plan',
description: 'Plan description',
schedules: [
{
order: 1,
label: 'Free week',
invoiceDescription: 'Invoice desc for free week.',
frequency: 'one-time',
cyclesQty: 1,
executionDays: [1],
pricingModel: {type: 'free', free: {daysQty: 7}},
featuresEnabled: false
},
{
order: 2,
label: 'Monthly plan',
invoiceDescription: 'Invoice description for monthly plan.',
frequency: 'monthly',
cyclesQty: 60,
executionDays: [0],
pricingModel: {type: 'perUsageQuantity', perUsageQuantity: {unit: 'device', unitPrice: 10}},
featuresEnabled: false
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Create a plan
Creates a subscription plan — the reusable template customers subscribe to. A plan contains one or more billing schedules, each with its own frequency and pricing model (flat, tiered, per-module, or usage-based), plus optional hosted session settings for customer-facing signup.
curl --request POST \
--url https://sandbox-platform.jupico.com/v1/subscriptions/plan \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"subMerchantId": "jpt-sim-md-1",
"name": "Test plan",
"description": "Plan description",
"schedules": [
{
"order": 1,
"label": "Free week",
"invoiceDescription": "Invoice desc for free week.",
"frequency": "one-time",
"cyclesQty": 1,
"executionDays": [
1
],
"pricingModel": {
"type": "free",
"free": {
"daysQty": 7
}
},
"featuresEnabled": false
},
{
"order": 2,
"label": "Monthly plan",
"invoiceDescription": "Invoice description for monthly plan.",
"frequency": "monthly",
"cyclesQty": 60,
"executionDays": [
0
],
"pricingModel": {
"type": "perUsageQuantity",
"perUsageQuantity": {
"unit": "device",
"unitPrice": 10
}
},
"featuresEnabled": false
}
]
}
'import requests
url = "https://sandbox-platform.jupico.com/v1/subscriptions/plan"
payload = {
"subMerchantId": "jpt-sim-md-1",
"name": "Test plan",
"description": "Plan description",
"schedules": [
{
"order": 1,
"label": "Free week",
"invoiceDescription": "Invoice desc for free week.",
"frequency": "one-time",
"cyclesQty": 1,
"executionDays": [1],
"pricingModel": {
"type": "free",
"free": { "daysQty": 7 }
},
"featuresEnabled": False
},
{
"order": 2,
"label": "Monthly plan",
"invoiceDescription": "Invoice description for monthly plan.",
"frequency": "monthly",
"cyclesQty": 60,
"executionDays": [0],
"pricingModel": {
"type": "perUsageQuantity",
"perUsageQuantity": {
"unit": "device",
"unitPrice": 10
}
},
"featuresEnabled": False
}
]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subMerchantId: 'jpt-sim-md-1',
name: 'Test plan',
description: 'Plan description',
schedules: [
{
order: 1,
label: 'Free week',
invoiceDescription: 'Invoice desc for free week.',
frequency: 'one-time',
cyclesQty: 1,
executionDays: [1],
pricingModel: {type: 'free', free: {daysQty: 7}},
featuresEnabled: false
},
{
order: 2,
label: 'Monthly plan',
invoiceDescription: 'Invoice description for monthly plan.',
frequency: 'monthly',
cyclesQty: 60,
executionDays: [0],
pricingModel: {type: 'perUsageQuantity', perUsageQuantity: {unit: 'device', unitPrice: 10}},
featuresEnabled: false
}
]
})
};
fetch('https://sandbox-platform.jupico.com/v1/subscriptions/plan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://sandbox-platform.jupico.com/v1/subscriptions/plan';
const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subMerchantId: 'jpt-sim-md-1',
name: 'Test plan',
description: 'Plan description',
schedules: [
{
order: 1,
label: 'Free week',
invoiceDescription: 'Invoice desc for free week.',
frequency: 'one-time',
cyclesQty: 1,
executionDays: [1],
pricingModel: {type: 'free', free: {daysQty: 7}},
featuresEnabled: false
},
{
order: 2,
label: 'Monthly plan',
invoiceDescription: 'Invoice description for monthly plan.',
frequency: 'monthly',
cyclesQty: 60,
executionDays: [0],
pricingModel: {type: 'perUsageQuantity', perUsageQuantity: {unit: 'device', unitPrice: 10}},
featuresEnabled: false
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
The subMerchantId associated with the plan.
"jpt-sim-md-1"
Plan's name.
"Black friday test plan"
Plan's description.
"Black friday test plan description"
Array containing plan's schedules.
Hide child attributes
Hide child attributes
Schedule order.
1
Schedule's label
"Silver"
Schedule's description to make invoice.
"Invoice for \"Silver\" schedule."
Number of cycles of schedule
3
Billing frequency
one-time, daily, weekly, every-28-days, biweekly, monthly, yearly "monthly"
Days on which scheduled charges execute.
Array of billing numbers day[0-32] for monthly, 0 at period start(month's 1st), 32 at period end(month's last day)
Pricing models params.
Hide child attributes
Hide child attributes
Pricing model type, one of ["free", "flat", "flatTiered", "perModule", "perUsageQuantity", "perUsageVolume", "perUsageTiered"]. Depending of this value you must provide corresponding next atribute.
"flat"
Flat pricing with selectable tiers.
Hide child attributes
Hide child attributes
Available tiers for this schedule.
Hide child attributes
Hide child attributes
Display name of the tier.
"Basic"
Description of the tier shown to the customer.
Price of the tier per billing cycle.
100
Display settings for the tier's feature list.
Hide child attributes
Hide child attributes
Heading displayed above the feature list.
Feature list displayed for this tier.
Hide child attributes
Hide child attributes
Icon displayed next to the feature.
Display name.
Free-text description.
URL the feature links to.
Per-module pricing: the customer subscribes to individual modules.
Hide child attributes
Hide child attributes
Modules available for subscription.
Hide child attributes
Hide child attributes
Display name.
"Basic"
Free-text description.
Price per billing cycle.
100
Display settings for the feature list.
Hide child attributes
Hide child attributes
Heading displayed above the feature list.
Feature list displayed for this tier.
Hide child attributes
Hide child attributes
Icon displayed next to the feature.
Display name.
Free-text description.
URL the feature links to.
Usage-based pricing where the unit price depends on total volume.
Hide child attributes
Hide child attributes
Volume pricing steps.
Hide child attributes
Hide child attributes
First unit quantity this step applies to.
1
Last unit quantity this step applies to.
9
Price per unit within this volume step.
15
Usage-based pricing with tiered rates per volume step.
Hide child attributes
Hide child attributes
Available tiers for this schedule.
Hide child attributes
Hide child attributes
Display name of the tier.
"Basic"
Description of the tier shown to the customer.
Price of the tier per billing cycle.
100
Display settings for the tier's feature list.
Hide child attributes
Hide child attributes
Heading displayed above the feature list.
Feature list displayed for this tier.
Hide child attributes
Hide child attributes
Icon displayed next to the feature.
Display name.
Free-text description.
URL the feature links to.
Whether this setting is enabled.
true
Whether tier features are enabled for this schedule.
false
Plan's title.
""
Plan's sub title.
""
Object to edit configuration of created hosted session.
Hide child attributes
Hide child attributes
Only required field, setting enabled = true, we create a session with default values. In case you want customization, append below data.
true
Payment methods offered on the hosted page.
Hide child attributes
Hide child attributes
Default payment method one of ["creditCard","eCheck", "applePay","googlePay"]
"creditCard"
Navigation behavior of the hosted page.
Hide child attributes
Hide child attributes
Default payment method one of ["standalone","redirect"]
"redirect"
URLs the customer is redirected to during the flow.
Hide child attributes
Hide child attributes
URL the customer is redirected to after successful payment.
"https://yoursite.com/successUrl"
URL the customer is redirected to if they cancel.
"https://yoursite.com/cancelUrl"
URL the customer is redirected to when they navigate back.
"https://yoursite.com/backUrl"
Hosted session functions
Hide child attributes
Hide child attributes
How many times the hosted session link can be used.
Response
Plan successfully created.
Was this page helpful?

