Create Subscriber

The CRM / Ordering system creates a Subscriber in the OCS.io via the RESTful API. The request body contains the Subscriber details. The OCS.io creates the instance of the Customer, then returns Business Transaction containing created Subscriber as a payload of the response. Other systems may be notified about the Business Transaction via the Streaming Platform.

Primary Actor

CRM / Ordering system.

Basic Flow

Create Subscriber Basic Flow
Step Actor Action Description

1.

CRM / Ordering

Call createSubscriber API

CRM / Ordering system calls Create Subscriber 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 createSubscriber 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.

Request Validations

The following validations are performed when creating a subscriber:

  • If Subscriber Profile is provided in the request, it must be configured in the system.

  • If Subscriber Segment is provided in the request, it must be configured in the system.

  • State Reason must be configured in the system for given State.

  • If Pending State is provided in the request, it will be ignored and Subscriber will be created without Pending.

  • If Subscriber Profile is not provided in the request, attributes State and State Reason must be provided in the request.

  • If Account is provided in the request, it must be already created in the system and must not be in Deactivated State.

  • If Account is not provided in the request, Subscriber Profile must be provided in the request.

  • If External ID is provided in the request, it must be unique and must not be already assigned to another Subscriber even in Deactivated State.

  • If Primary Resource is provided in the request, it must be unique and must not be already assigned to another Subscriber in other state then Deactivated.

  • If Primary Resource is provided in the request, Primary Resource Type must be also provided in the request and it must be configured in the system.

Perform Business Logic

  1. If Subscriber Profile is provided in the request, system sets Account attributes like Subscriber Segment, State and State Reason from Subscriber Profile configuration.

  2. If additional attributes like Subscriber Segment, State and State Reason are provided in the request, those override attributes from Subscriber Profile.

  3. If External ID is provided, this is set to the newly created Subscriber.

  4. If Subscriber Profile is provided in the request, system creates Customer and Account based on Subscriber Profile configuration.

    • System creates Subscriber.

Publish Business Transaction

Following entities will be published to Streaming Platform as part of Business Transaction: