BatchPaymentPayload
Payitoff API: BatchPaymentPayload
Schema
When you want to create a BatchPayment
to transmit funds from a SourceAccount
to many PortfolioLoans
and/or Servicers
on behalf of Borrowers
, you will send a BatchPaymentPayload
describing the payments you wish to make to our Create BatchPayment endpoint.
Take care when building
BatchPaymentPayloads
Successfully creating
BatchPayments
requires careful attention to the details of yourBatchPaymentPayload
.
Common Pitfalls
- Your
BatchPaymentPayload
will be rejected if thetotal_amount
does not equal the sum of all items in thepayments
array- Your
BatchPaymentPayload
will be rejected if thenumber_of_payments
does not equal the total number of items in thepayments
array- Your
BatchPaymentPayload
will be rejected if you've re-used areference_id
Review the Examples section to see a valid and invalid
BatchPaymentPayload
.
Schema Description
Properties in bold are required.
Property | Type | Format | Description |
---|---|---|---|
number_of_payments | number | integer | The number of payments in this BatchPayment .Must be equal to the number of BatchPaymentItemPayload objects in the payments array. |
payments | array | BatchPaymentItemPayload | An array of BatchPaymentItemPayload objects that describe the allocation of funds within this BatchPayment . |
reference_id | string | An arbitrary string that must be unique for each batch. Not required, but highly recommended. | |
source_account_id | string | uuid | The UUID that identifies the SourceAccount from which funds will be transferred to pay all BatchPaymentItem objects in this BatchPayment . |
total_amount | string | decimal | The total amount of this BatchPayment .Must be equal to the sum of all of the amounts in the payments array. |
A few words about
reference_id
valuesYou will notice that you can supply a
reference_id
forBatchPayment
andBatchPaymentItem
objects when you create them via their relevantPayload
objects. While these fields are not required, we highly recommend always providing a unique value for eachreference_id
property in your API request payloads. Providing a UUID is an easy way to ensure you always have uniquereference_id
values for yourBatchPayment
andBatchPaymentItem
objects.
Get the most out ofreference_id
Your
reference_id
values should be a unique identifier created and stored in your application to identify thisBatchPayment
for your system.We will use the
reference_id
, when available, to ensure idempotency across CreateBatchPayment
requests (ensuring you always get the sameBatchPayment
outcome even if you resubmit the same request).We will associate the
reference_id
of an item in yourBatchPaymentPayload
(and itsBatchPaymentItemPayload
objects in thepayments
array) if the CreateBatchPayments
request fails—allowing you to identify the offending item in your payload that did not pass validation.The
reference_id
can be used to ensure you are able to match your platform's internal representation of aBatchPayment
with its PayitoffBatchPayment
record.The
reference_id
can help facilitate auditing yourBatchPayment
requests between your internal systems and the Payitoff API fulfillingBatchPayment
requests.The
reference_id
is a string field that allows any value, to provide maximum flexibility to provide your own identification scheme.
Examples
A valid BatchPaymentPayload
should appear as the JSON value of a batch
key in your request.
In the example below, you can see a valid BatchPaymentPayload
:
total_amount
matches the sum of eachamount
property in thepayments
arraynumber_of_payments
matches the number of items in thepayments
array
{
"batch": {
"total_amount": "325.46",
"number_of_payments": 2,
"source_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"reference_id": "b123",
"payments": [
{
"amount": "150.12",
"allocation": {
"type": "servicer",
"id": "9a57055f-ae0d-4ff1-b4b8-db4e564c27d6"
},
"reference_id": "b123-1"
},
{
"amount": "175.34",
"allocation": {
"type": "loan",
"id": "9a57055f-ae0d-4ff1-b4b8-db4e564c27d6"
},
"reference_id": "b123-2"
}
]
}
}
In the example below, you can see an invalid BatchPaymentPayload
:
total_amount
does not match the sum of eachamount
property in thepayments
arraynumber_of_payments
does not match the number of items in thepayments
array
{
"batch": {
"total_amount": "550.34",
"number_of_payments": 5,
"source_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"reference_id": "8b02e87d-06b1-4551-86eb-07f2e9f7b007",
"payments": [
{
"amount": "150.12",
"allocation": {
"type": "servicer",
"id": "9a57055f-ae0d-4ff1-b4b8-db4e564c27d6"
},
"reference_id": "e6275310-3f5b-43db-ab40-0c30258a10cc"
}
]
}
}
Updated almost 3 years ago