Create Percentage Billing Discount Subscription
The CRM / Ordering system creates an instance of the Percentage Billing Discount Offer Subscription in the OCS.io via the RESTful API. The request body contains the Subscription details, and the Individual Percentage Discount to apply. The OCS.io creates the Subscription, then returns Business Transaction containing created Offer Subscription as a payload of the response. Other systems may be notified about the Business Transaction via the Streaming Platform.
Basic Flow
Step | Actor | Action | Description |
---|---|---|---|
1. |
CRM / Ordering |
Call createSubscription API |
CRM / Ordering system calls Create Percentage Billing Discount Subscription API exposed by OCS.io. |
2. |
OCS.io |
Request Validations |
OCS.io validates Request whether all mandatory attributes are populated, all data types are valid, ENUMs match with definition, etc. Additionally, OCS.io validates Request against Business Logic. This typically includes, that referenced entity exists in the system, entity has proper state, etc. |
3. |
OCS.io |
Perform Business Logic |
OCS.io performs Business Logic implemented for the Use-Case. |
4. |
OCS.io |
Publish Business Transaction |
OCS.io publishes zero to many messages to Streaming Platform that impacted entities have been changed. |
5. |
OCS.io |
Return createSubscription Response |
OCS.io returns Response to the CRM / Ordering System. |
6. |
DWH |
Subscribe for Business Transactions |
DWH subscribes for Business Transactions to be delivered by Streaming Platform. |
7. |
DWH |
Process Business Transactions |
DWH process Business Transactions internally. This typically includes storing of changed entities, update indexes, update metrics, etc. |
Perform Business Logic
-
If External ID is provided, this is set to the newly created Offer Subscription.
-
System creates Individual Offer Subscription either on Customer, Account or Subscriber level.
Request Validations
-
Individual Offer Subscription of Percentage Billing Discount service could be subscribed either on Customer, Account or Subscriber level. Depends on level, system performs one of the following validation:
-
Customer must be provided in the request, it must be already created in the system and must not be in Deactivated State.
-
Account must be provided in the request, it must be already created in the system and must not be in Deactivated State.
-
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 Individual Offer Subscription will be created without Pending.
-
Offer must be configured in the system.
-
all mandatory Offer Attributes must be provided in the request.