Create Account
The CRM / Ordering system creates an Account in the OCS.io via the RESTful API. The request body contains the Account details. The OCS.io creates the instance of the Account, then returns Business Transaction containing created Account 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 createAccount API |
CRM / Ordering system calls Create Account 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 createAccount 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 an account:
-
If Account Profile is provided in the request, it must be configured in the system.
-
If Account Segment is provided in the request, it must be configured in the system.
-
Currency 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 Account will be created without Pending.
-
If Account Profile is not provided in the request, attributes Account Type, Currency, State and State Reason must be provided in the request.
-
If Customer is not provided in the request, Account 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 Account even in Deactivated State.
-
If Customer is provided in the request, it must be already created in the system and must not be in Deactivated State.
-
If Parent Account is provided in the request, it must be already created in the system and must not be in Deactivated State.
-
If Parent Account is not provided in the request, Account Type must be Payment Responsible.
Perform Business Logic
-
If Account Profile is provided in the request, system sets Account attributes like Account Type, Account Segment, Currency, State and State Reason from Account Profile configuration.
-
If additional attributes like Account Type, Account Segment, Currency, State and State Reason are provided in the request, those override attributes from Account Profile.
-
If External ID is provided, this is set to the newly created Account.
-
If Account Profile is provided in the request, system creates Customer based on Account Profile configuration.
-
System creates Account.
Publish Business Transaction
Following entities will be published to Streaming Platform as part of Business Transaction:
If Account is of type Payment Responsible, Payer’s details such Payment Method, Delivery Method, Bank Account, etc. needs to be updated in the OCS.io. Update of the Payer is described in Update Payer Use-Case. |