Create Subscription on Subscriber
The CreateSubscriptionOnSubscriber
API in OCS.io is designed to streamline the process of adding new subscriptions directly to subscriber.
API Overview
Fields Required for Creating a Subscription on a Subscriber
The following table lists and describes the fields required to create a subscription on a subscriber through the CreateSubscriptionOnSubscriber
API:
Field | Description |
---|---|
subscriber |
ID (Ref ID / External ID) of the Subscriber. |
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 subscriber:
-
Subscriber must be provided in the request, it must be already created in the system and must not be in Deactivated State.
-
If External ID is provided in the request, it must be unique and must not be already assigned to another Offer Subscription even in Deactivated State.
-
State Reason must be configured in the system for given State.
-
If Pending State is provided in the request, it will be ignored and Subscription on Subscriber will be created without Pending.
-
Offer must be configured in the system.
-
If Parent Offer Subscription is provided in the request, it must be already created in the system and must not be in Deactivated State.
Create Subscription on Subscriber Example
Use the following request’s body to create a subscription on a subscriber:
{
"requestId": "{{$guid}}",
"subscriber": {
"externalId": "subscriber_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 subscriber with external ID
subscriber_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
andattribute2
with valuesvalue1
andvalue2
respectively.