Create Subscription on Customer

The CreateSubscriptionOnCustomer API in OCS.io is designed to streamline the process of adding new subscriptions directly to customers.

API Overview

Fields Required for Creating a Subscription on a Customer

The following table lists and describes the fields required to create a subscription on a customer through the CreateSubscriptionOnCustomer API:

Field Description

customer

ID (Ref ID / External ID) of the Customer.

offer

Code of the Offer. The offer must be configured before it can be associated with a subscription.

priority

Priority of the Subscription, used to determine priority of application in Rating, Charging, Billing.

externalId

External ID of the Subscription, typically used for integration with external systems.

customName

Custom name assigned to the Subscription, allowing for easier identification or special handling.

customAttributes

Custom attributes as a Key - Value (String) Map, providing additional metadata or configuration settings specific to the subscription.

state

Initial State of the Subscription, defining its operational status at creation.

parentOfferSubscription

ID (Ref ID / External ID) of the Parent Offer Subscription, linking this subscription to another in a hierarchical relationship.

Detailed API documentation and endpoint specifics are available here.

Request Validations

The following validations are performed when creating a subscription on a customer:

Create Subscription on Customer Example

Use the following request’s body to create a subscription on a customer:

{
  "requestId": "{{$guid}}",
  "customer": {
    "externalId": "customer_external_id"
  },
  "offer": "offer_code",
  "externalId": "subscription_external_id",
  "customName": "Demo Subscription",
  "customAttributes": {
    "attribute1": "value1",
    "attribute2": "value2"
  },
  "state": {
    "state": "ACTIVE",
    "stateReason": "dfltActive",
    "stateValidFrom": "2024-05-01T00:00:00+02:00"
  }
}

The outcome of the API call is as follows:

  • A subscription is created on the customer with external ID customer_external_id.

  • The offer code is offer_code, must be configured in Product Catalogue.

  • The external ID of the subscription is subscription_external_id.

  • The custom name of the subscription is Demo Subscription.

  • The custom attributes are attribute1 and attribute2 with values value1 and value2 respectively.