Skip to main content
Skip table of contents

API Subscribe

Pre-requisite: have an existing offer in the catalogue

On this page, you will learn to subscribe a customer to an offer.

Step 1: Generate an OAuth token

See Create an OAuth token for details.

Step 2: Create the order

  • create a subscription to be named CLASSIC-C00-SU from offer OF_REContaining PR_REC_MONTHLY_1ST and PR_OSS_SUBSCRIPTION_FEE

POST {{opencell.url}}/billing/subscription/subscribeAndInstantiateProducts

CODE
{
    "code": "{{subscription.code}}",
    "description": "Subscription {{subscription.code}} to {{offer.code}}",
    "userAccount": "{{account.code}}",
    "offerTemplate": "OF_REC",
    "seller": "{{seller}}",
    "subscriptionDate": "{{subscription.date}}",
    "terminationDate": null,
    "endAgreementDate": null,
    "status": null,
    "terminationReason": null,
    "customFields": null,
    "productToInstantiateDto": [
        {
            "productCode": "PR_REC_MONTHLY_1ST",
            "quantity": 1
        },
        {
            "productCode": "PR_OSS_SUBSCRIPTION_FEE",
            "quantity": 1
        }
    ]
}

CODE
curl --location 'https://sandbox.opencell.net/opencell/api/rest/billing/subscription/subscribeAndInstantiateProducts' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--data '{
    "code": "CLASSIC-C00-SU",
    "description": "Subscription CLASSIC-C00-SU to {{offer.code}}",
    "userAccount": "CLASSIC-C00",
    "offerTemplate": "OF_REC",
    "seller": "MAIN_SELLER",
    "subscriptionDate": "2022-01-01T01:23:45.678Z",
    "terminationDate": null,
    "endAgreementDate": null,
    "status": null,
    "terminationReason": null,
    "customFields": null,
    "productToInstantiateDto": [
        {
            "productCode": "PR_REC_MONTHLY_1ST",
            "quantity": 1
        },
        {
            "productCode": "PR_OSS_SUBSCRIPTION_FEE",
            "quantity": 1
        }
    ]
}'
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.