curl --request POST \
--url https://sandbox-platform.jupico.com/v1/subscriptions \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"subMerchantId": "<string>",
"planId": "c23b205a-244b-4962-9337-a5b68f1c874f",
"customerId": "<string>"
}
'import requests
url = "https://sandbox-platform.jupico.com/v1/subscriptions"
payload = {
"subMerchantId": "<string>",
"planId": "c23b205a-244b-4962-9337-a5b68f1c874f",
"customerId": "<string>"
}
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: '<string>',
planId: 'c23b205a-244b-4962-9337-a5b68f1c874f',
customerId: '<string>'
})
};
fetch('https://sandbox-platform.jupico.com/v1/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://sandbox-platform.jupico.com/v1/subscriptions';
const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subMerchantId: '<string>',
planId: 'c23b205a-244b-4962-9337-a5b68f1c874f',
customerId: '<string>'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Create a subscription
Subscribes a customer to one or more plan schedules, billed against a stored payment token. Billing runs automatically at each schedule’s frequency.
curl --request POST \
--url https://sandbox-platform.jupico.com/v1/subscriptions \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"subMerchantId": "<string>",
"planId": "c23b205a-244b-4962-9337-a5b68f1c874f",
"customerId": "<string>"
}
'import requests
url = "https://sandbox-platform.jupico.com/v1/subscriptions"
payload = {
"subMerchantId": "<string>",
"planId": "c23b205a-244b-4962-9337-a5b68f1c874f",
"customerId": "<string>"
}
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: '<string>',
planId: 'c23b205a-244b-4962-9337-a5b68f1c874f',
customerId: '<string>'
})
};
fetch('https://sandbox-platform.jupico.com/v1/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://sandbox-platform.jupico.com/v1/subscriptions';
const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subMerchantId: '<string>',
planId: 'c23b205a-244b-4962-9337-a5b68f1c874f',
customerId: '<string>'
})
};
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 subscription.
The planId of the existing plan you subscribe to.
"c23b205a-244b-4962-9337-a5b68f1c874f"
The customer id of the subscription.
The customer's token associated with the subscription.
Array containing schedules pricing models params when needed.
Hide child attributes
Hide child attributes
Identifier of the plan schedule the subscription uses.
"c23b205a-244b-4962-9337-a5b68f1c874f"
Pricing models params. Depending of schedule pricing model you must provide corresponding params.
Hide child attributes
Hide child attributes
Quantity purchased, for quantity-based pricing models.
100
ID of the tier selected for this subscription.
"c23b205a-244b-4962-9337-a5b68f1c874f"
IDs of the modules selected for this subscription.
[
"c23b205a-244b-4962-9337-a5b68f1c874f",
"c23b205a-244b-4962-9337-a5b68f1c874e"
]
Response
Subscription successfully created.
Was this page helpful?

