Create Outgoing Payment from Incoming Payment
The CreatePaymentOutFromPaymentIn
API is used to create outgoing payments from incoming payments in OCS.io. This API is particularly useful when there’s a need to record the creation of outgoing payments based on incoming payments.
API Overview
Fields Required for Creating Outgoing Payment from Incoming Payment
The following table lists and describes the fields required to create an outgoing payment from an incoming payment through the CreatePaymentOutFromPaymentIn
API:
Field | Description |
---|---|
account |
ID (Ref ID/ External ID ) of the Account. |
paymentMethod |
Payment Method associated with the Outgoing Payment. |
paymentRef1 |
Payment Reference No.1 associated with the Payment. |
paymentRef2 |
Payment Reference No.2 associated with the Payment. |
paymentRef3 |
Payment Reference No.3 associated with the Payment. |
bankAccountNumber |
Payer’s (Billing Account) bank account number, including prefix, without bank number code. |
bankNumberCode |
Payer’s (Billing Account) bank number code. |
iban |
Payer’s (Billing Account) bank account number in international format. |
bic |
BIC code of bank. |
bankAccountName |
Payer’s (Billing Account) bank account name. |
moneyOrder |
Payer’s (Billing Account) Person and Address details in case Outgoing Payment is of type Money Order. |
description |
Provider’s Description of the Payment. Will be copied to Payer’s NOTE of the payment transaction. |
paymentAmounts |
Array of Payment ID and Amount, identification of incoming payments and amounts to use. |
Detailed API documentation and endpoint specifics are available here. |
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.
Create Outgoing Payment Example
Use the following request’s body to create an outgoing payment from an incoming payment:
{
"requestId": "{{$guid}}",
"user": "crm",
"account": {
"externalId": "account_external_id"
},
"paymentMethod": "payment_method",
"paymentRef1": "payment_ref_1",
"paymentRef2": "payment_ref_2",
"paymentRef3": "payment_ref_3",
"bankAccountNumber": "bank_account_number",
"bankNumberCode": "bank_number_code",
"iban": "iban",
"bic": "bic",
"bankAccountName": "bank_account_name",
"moneyOrder": {
"person": "person_details",
"address": "address_details"
},
"description": "provider_description",
"paymentAmounts": [
{
"entityRefId": "payment_id_1",
"amount": 100000000,
"currency": "EUR"
},
{
"entityRefId": "payment_id_2",
"amount": 200000000,
"currency": "EUR"
}
]
}
The outcome of the API call is as follows:
-
An outgoing payment is created from the incoming payment with the specified details.
-
The description of the payment is
provider_description
. -
The specified payment amounts are used for the payment.