API Create products and offer
Step 1: Generate an OAuth token
See Create an OAuth token for details.
Step 2: Create Products (V16+)
PR_OSS_SUBSCRIPTION_FEE
which is an optional one shot fee paid due at subscriptionPR_REC_MONTHLY_1ST
which is a recurrent product, mandatory
POST {{opencell.url}}/v2/catalog/productManagement/createProductSimpleOneshot
{
"productCode": "PR_OSS_SUBSCRIPTION_FEE",
"label": "Price for subscription fee",
"price": 500,
"oneShotChargeTemplateType": "SUBSCRIPTION",
}
POST {{opencell.url}}/v2/catalog/productManagement/createProductSimpleRecurring
{
"productCode": "PR_REC_MONTHLY_1ST",
"description": "Recurring charge",
"price": 100,
"calendar": "MONTHLY",
"subscriptionProrata": true,
"terminationProrata": true,
"applyInAdvance": true,
"anticipateEndOfSubscription": true
}
Step 3: Create Offer
We will create an offer OF_REC
that includes:
PR_REC_MONTHLY_1ST
which is a recurrent product, mandatoryPR_OSS_SUBSCRIPTION_FEE
which is an optional one shot fee paid due at subscription
POST {{opencell.url}}/catalog/offerTemplate/createOrUpdate
{
"code": "OF_REC",
"name": "c",
"description": "Simple monthly recurring with optional subscription fee",
"disabled": false,
"lifeCycleStatus": "ACTIVE",
"offerTemplateCategoryCode": null,
"validFrom": "2022-01-01",
"offerProducts": [
{
"product": {
"code": "PR_REC_MONTHLY_1ST"
},
"mandatory": true,
"quantityDefault": 1,
"quantityMin": 1,
"quantityMax": 1
},
{
"product": {
"code": "PR_OSS_SUBSCRIPTION_FEE"
},
"mandatory": false,
"quantityDefault": 0,
"quantityMin": 0
}
]
}
and ind cURL:
curl --location 'https://sandbox.opencell.com/opencell/api/rest/catalog/offerTemplate/createOrUpdate' \
--header 'Content-Type: application/json' \
--data '{
"code": "OF_REC",
"name": "Demo recurring offer",
"description": "Simple monthly recurring with optional subscription fee",
"disabled": false,
"lifeCycleStatus": "ACTIVE",
"offerTemplateCategoryCode": null,
"validFrom": "2022-01-01",
"offerProducts": [
{
"product": {
"code": "PR_REC_MONTHLY_1ST"
},
"mandatory": true,
"quantityDefault": 1,
"quantityMin": 1,
"quantityMax": 1
},
{
"product": {
"code": "PR_OSS_SUBSCRIPTION_FEE"
},
"mandatory": false,
"quantityDefault": 0,
"quantityMin": 0
}
]
}'