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.
Show child attributes
Show child attributes
Plan's title.
""
Plan's sub title.
""
Object to edit configuration of created hosted session.
Show child attributes
Show child attributes
Response
Plan successfully created.
Was this page helpful?

