Create Outgoing Payment from Incoming Payment

The Customer Sales Representative or Finance Department User wants to via CRM / Finance system GUI create Outgoing payment from remaining balance on Incoming payment. This operation is available in the CRM / Finance system GUI for users with correct privileges.

The CRM / Finance system via the RESTful API requests for creation of the Outgoing payment. The request body contains the Account details, identification of the incoming payment with remaining balance and amount for which outgoing payment will be created.

The OCS.io creates the outgoing payment, then returns result of the operation as a payload of the response.

The CRM / Finance system presents the result of the operation to the User in the GUI.

Primary Actor

Customer Sales Representative or Finance Department User.

Basic Flow

Create Outgoing Payment from Incoming Payment Basic Flow
Step Actor Action Description

1.

CSR / FIN User

Search Incomming Payment

Customer Sales Representative or Finance Department User via CRM / Finance GUI searches for an Incomming Payment from which Outgoing Payment should be created.

2.

CRM / Finance

Display Search Incomming Payment

CRM / Finance System displays result of Search Incomming Payment to the User.

3.

CSR / FIN User

Request for Operation

Customer Sales Representative or Finance Department User via CRM / Finance GUI requests for Operation.

4.

CRM / Finance

Call createPaymentOut API

CRM / Finance System calls Create Outgoing Payment from Incoming Payment API exposed by OCS.io.

5.

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.

6.

OCS.io

Perform Business Logic

OCS.io performs Business Logic implemented for the Use-Case.

7.

OCS.io

Publish Business Transaction

OCS.io publishes zero to many messages to Streaming Platform that impacted entities have been changed.

8.

OCS.io

Return createPaymentOut Response

OCS.io returns Response to the CRM / Finance System.

Response codes are as follows:

  • 200 = OK

  • 400 = Request Validation failed

  • 500 = Internal error

9.

CRM / Finance

Result of Operation

CRM / Finance system displays result of the operation to the User.

10.

Finance System

Subscribe for Business Transactions

Finance System subscribes for Business Transactions to be delivered by Streaming Platform.

11.

Finance System

Process Business Transactions

Finance System process Business Transactions internally. This typically includes storing of changed entities, update indexes, update metrics, etc.

12.

DWH

Subscribe for Business Transactions

DWH subscribes for Business Transactions to be delivered by Streaming Platform.

13.

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 outgoing payment from an incoming payment:

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

  • Payer must be already created in the system.

  • Currency must be configured in the system.

  • Payment Method must be configured in the system.

  • If Payment Method is Bank Transfer, then either combination of Bank Account Number & Bank Number Code or IBAN & BIC must be provided in the request.

  • If Payment Method is Money Order, then Payer’s Address must be provided in the request.

  • If more than one item in Payment Amounts array is provided in the request, then Currency must be identical for each item.

  • Each referenced Incoming Payment provided in the request, must exist in the system.

  • Each referenced Incoming Payment provided in the request, must not be Cancelled.

  • Amount of each item in Payment Amounts must not exceed Remaining Amount of each referenced Incoming Payment.

  • Cancellation Reason Incoming Payment to Outgoing Payment must be configured in the system.

Perform Business Logic

  1. System calculates Total Amount from all Payment Amounts provided in the request.

  2. System creates Outgoing Payment Request with following attributes:

    • Payment No: generated Outgoing Payment Number

    • Payment Amount: calculated Total Amount

    • Bank Account: provided Bank Account Details in case Payment Method is Bank Transfer

    • Money Order: provided Address for Money Order in case Payment Method is Money Order

    • Payment Scheduled Date: effective date of the request (usually actual date)

    • Payment Refs: provided Payment References

  3. System creates Incoming Payment to Outgoing Payment Monetary Transaction for each referenced Incoming Payment.

  4. System decreases Remaining Amount on referenced Incoming Payment by Amount provided in the request.

  5. In case Remaining Amount on referenced Incoming Payment is 0, system marks referenced Incoming Payment as Cancelled with reason Incoming Payment to Outgoing Payment.

  6. System creates entries in Payment History for each affected Incoming and Outgoing Payment.

Publish Notification

Following Notifications will be published to Streaming Platform:

  • None.

Publish Business Transaction

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