Batch Payments

Batch payments allow your customers to pay multiple invoices in a single transaction.

Batch payments are only available for bankAccount and check payments. custom payments are not officially supported, but you can implement them yourself.

Enabling Batch Payments

To enable batch payments, you set batchPayment on the invoice to true. This field will be true if the invoice is a batch payment, and false otherwise.

The Mercoa <PayableDetails /> React component also supports batch payments using the <PaymentOptions /> sub-component.

POST
/invoice/:invoiceId
1curl -X POST https://api.mercoa.com/invoice/in_26e7b5d3-a739-4b23-9ad9-6aaa085f47a9 \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "batchPayment": true
6}'

How Batch Payments Work

Mercoa automatically batches payments for invoices that have the batchPayment field set to true. This means that you don’t need to manually batch payments.

Mercoa uses the following logic to determine if an invoice is part of a batch:

  1. If the invoice has the batchPayment field set to true
  2. The invoice has the same payerId and vendorId
  3. The invoice has the same paymentSourceId and paymentDestinationId
  4. The invoice has the same paymentDestinationOptions
  5. The invoice has the same deductionDate
  6. The invoice has status of SCHEDULED

If any of these conditions aren’t met, the invoice is considered a separate payment.

Bank Payments

Mercoa sends a single ACH payment for all invoices in a batch. The paymentDestinationOptions memo assumes that all the invoices in the batch contain the same memo, as one is chosen at random.

Check Payments

Mercoa sends a single check payment for all invoices in a batch. The check will also contain a table of the invoices in the batch.

When Batch Payments Are Created

On the deductionDate, Mercoa will create a batch payment for the invoices in the batch. This batch will be created at the last payment window of the day, so invoices can be added to the batch until the last payment window.

Printed Check Batches

Because printed checks are not processed by Mercoa’s payment job, when any invoice in a batch is marked as PAID, Mercoa will process all invoices in the batch.