Manual Batch Close
A Batch groups captured card transactions that will be submitted together for settlement. By default, Paydude closes batches automatically on the merchant’s settlement schedule. Manual Batch Close lets an enrolled merchant trigger that close on demand — for example, at the end of a shift or a business day — instead of waiting for the automatic close.
Manual Batch Close is only available for enrolled merchants. Contact your Paydude representative to enable it on a Merchant Account.
Card-not-present and card-present batches
Manual Batch Close supports both card-not-present and card-present transactions. The two are batched differently:
| PAYMENT METHOD TYPE | BATCH SCOPE | TERMINAL READER ID | AUTOMATIC CLOSE |
|---|---|---|---|
card (card-not-present) | One open batch per Merchant Account. | null | Closed automatically at cutoff_at if it is still open. |
card_present | One open batch per terminal reader. | The terminal reader the batch belongs to. | None — cutoff_at is null, and the batch stays open until it is closed explicitly. A batch settled on the device (for example, by the terminal's daily auto-settle) is closed automatically once its funds are paid out. |
Card-present Manual Batch Close is supported on Valor terminal readers only. Merchants using other terminal readers continue to have their batches closed automatically on the standard schedule.
Batch Lifecycle
| STATUS | DESCRIPTION |
|---|---|
open | The batch is accepting new captures. |
closing | A close has been accepted; submission to the processor is in flight. |
closed | Every underlying settlement was submitted successfully. This is the merchant-visible "done" signal. |
failed | At least one settlement exhausted retries. The merchant may retry by re-issuing the close call on the failed batch. |
After a batch closes, the next batch opens with the next capture:
- Card-not-present: a new batch opens for the Merchant Account when the merchant captures its next payment.
- Card-present: a new batch opens for a terminal reader when that terminal captures its next payment.
Between a close and the next capture, there is no open batch.
The Batch object
| FIELD | TYPE | DESCRIPTION |
|---|---|---|
id | String | Unique identifier for the batch, prefixed with bch_. |
account_id | String | The Merchant Account the batch belongs to. |
terminal_reader_id | String or null | The terminal reader a card-present batch belongs to. null for card-not-present batches. |
status | Enum | One of open, closing, closed, or failed. |
opened_at | ISO 8601 timestamp | When the batch opened. |
close_requested_at | ISO 8601 timestamp or null | When the close was requested. Set on the first transition out of open. |
closed_at | ISO 8601 timestamp or null | When every underlying settlement was submitted. |
failed_at | ISO 8601 timestamp or null | When the batch failed. |
cutoff_at | ISO 8601 timestamp or null | If the batch is still open at this time, it is closed automatically. The cutoff is set when the batch opens with its first transaction. null means the batch is never closed automatically and must be closed explicitly. |
amount | Integer or null | Net total of the batch (sales minus refunds) in the smallest currency unit, such as cents for USD. Reported by the processor when the batch closes; null until then, or if the processor does not report it. This is not the amount deposited: the Payout that funds the batch is net of processing fees and any held funds, and can include other batches. |
transaction_count | Integer or null | Number of transactions (sales and refunds) in the batch. Reported by the processor when the batch closes; null until then, or if the processor does not report it. Valor does not report a count, so this is always null for Valor card-present batches. |
payout_id | String or null | The Payout that funded this batch. null until the batch has settled and been paid out. |
How captures reach a Batch
Whenever a Charge API is captured on an enrolled Merchant Account — regardless of how the underlying Payment Intent API was created or confirmed — it is added to the matching open Batch API: the merchant’s card-not-present batch, or the card-present batch for the terminal reader that took the payment. No changes are required to how you collect payments.
For a full walkthrough of collecting an online payment, see Online Payments.
Retrieve a Batch
To look up a single batch by its id, call Get a Batch API.
curl -L 'https://api.sandbox-paymentsonline.io/v1/batches/{{BATCH_ID}}' \
-H 'payments-account: {{MERCHANT_ACCOUNT_ID}}' \
-H 'payments-api-key: {{SECRET_KEY}}'Sample response:
{
"id": "bch_01HXYZGHI...",
"account_id": "acct_...",
"terminal_reader_id": null,
"status": "closed",
"opened_at": "2026-07-15T13:00:00.000Z",
"close_requested_at": "2026-07-15T18:30:00.000Z",
"closed_at": "2026-07-15T18:30:03.000Z",
"failed_at": null,
"cutoff_at": "2026-07-17T13:00:00.000Z",
"amount": 125075,
"transaction_count": 42
}A 404 response indicates the batch either does not exist or does not belong to the Merchant Account identified by the request headers.
List Batches
Retrieve batches for a merchant with List Batches API. Results are sorted by opened_at, newest first.
curl -L 'https://api.sandbox-paymentsonline.io/v1/batches?status=open&payment_method_type=card_present' \
-H 'payments-account: {{MERCHANT_ACCOUNT_ID}}' \
-H 'payments-api-key: {{SECRET_KEY}}'Sample response:
{
"items": [
{
"id": "bch_01HXYZJKL...",
"account_id": "acct_...",
"terminal_reader_id": "trm_...",
"status": "open",
"opened_at": "2026-07-15T13:00:00.000Z",
"close_requested_at": null,
"closed_at": null,
"failed_at": null,
"cutoff_at": null,
"amount": null,
"transaction_count": null
}
],
"total": 1,
"offset": 0,
"limit": 30
}Filter parameters
| PARAMETER | TYPE | DESCRIPTION |
|---|---|---|
status | Enum | One of open, closing, closed, or failed. |
payment_method_type | Enum | card returns only card-not-present batches; card_present returns card-present batches for every terminal reader. Other payment method types are rejected. |
terminal_reader_id | String | Return only the batches for this terminal reader (trm_...). Cannot be combined with payment_method_type=card. |
payout_id | String | Return only the batches funded by this Payout (po_...). |
opened_at_gte | ISO 8601 timestamp | Include only batches opened on or after this timestamp. |
opened_at_lte | ISO 8601 timestamp | Include only batches opened on or before this timestamp. |
offset | Integer | Zero-based offset of the first item to return. Defaults to 0. |
limit | Integer | Maximum number of items to return. Defaults to 30; capped at 100. |
Close open Batches
To close open batches for a merchant, call Close open Batches API. The endpoint accepts no body. It first retries any failed batches, then closes open ones, and returns the batches it acted on. Batches with no transactions to submit are skipped and left open, and are not included in the response. If there is nothing to close, the call returns an empty list without side effects.
Without query parameters, the call closes every open batch on the Account — card-not-present and card-present. To narrow it, pass either of these query parameters:
| PARAMETER | TYPE | DESCRIPTION |
|---|---|---|
payment_method_type | Enum | card closes only the card-not-present batch; card_present closes the card-present batches for every terminal reader. |
terminal_reader_id | String | Close only the batch for this terminal reader (trm_...). Combining it with payment_method_type=card returns a 400, because terminal reader batches are always card-present. |
curl -X POST -L 'https://api.sandbox-paymentsonline.io/v1/batches/close?payment_method_type=card' \
-H 'payments-account: {{MERCHANT_ACCOUNT_ID}}' \
-H 'payments-api-key: {{SECRET_KEY}}'Sample response:
[
{
"id": "bch_01HXYZGHI...",
"account_id": "acct_...",
"terminal_reader_id": null,
"status": "closing",
"opened_at": "2026-07-15T13:00:00.000Z",
"close_requested_at": "2026-07-15T18:30:00.000Z",
"closed_at": null,
"failed_at": null,
"cutoff_at": "2026-07-17T13:00:00.000Z",
"amount": null,
"transaction_count": null
}
]Close a Batch by ID
To close a single batch — for example, to retry a batch that previously ended in failed — call Close a Batch API with the batch id in the URL. The endpoint accepts no body and returns the updated batch.
curl -X POST -L 'https://api.sandbox-paymentsonline.io/v1/batches/{{BATCH_ID}}/close' \
-H 'payments-account: {{MERCHANT_ACCOUNT_ID}}' \
-H 'payments-api-key: {{SECRET_KEY}}'Sample response:
{
"id": "bch_01HXYZGHI...",
"account_id": "acct_...",
"terminal_reader_id": null,
"status": "closing",
"opened_at": "2026-07-15T13:00:00.000Z",
"close_requested_at": "2026-07-15T18:30:00.000Z",
"closed_at": null,
"failed_at": null,
"cutoff_at": "2026-07-17T13:00:00.000Z",
"amount": null,
"transaction_count": null
}The endpoint is idempotent on the batch id: repeat calls against a batch already in closing or closed return the current state without side effects. A call against a failed batch resets the failure and retries the close.
Closing a batch that has no transactions to submit returns a 409 and leaves the batch open. Close open Batches skips empty batches instead of returning an error.
Trace a Batch to its Payout
Once a closed batch has settled and been paid out, the batch’s payout_id field holds the Payout API that funded it.
A Payout is a bank deposit, and one deposit can fund several batches — for example, when a merchant closes more than once before funds are deposited. To list every batch in a payout, filter List Batches API by payout_id:
curl -L 'https://api.sandbox-paymentsonline.io/v1/batches?payout_id={{PAYOUT_ID}}' \
-H 'payments-account: {{MERCHANT_ACCOUNT_ID}}' \
-H 'payments-api-key: {{SECRET_KEY}}'payout_id is null until the batch is paid out. If part of a batch’s funds were held, the held amount is released later as a separate balance adjustment, not a second payout.
payout_id tells you which deposit a batch went into; it doesn’t reconcile amounts. A payout’s amount won’t generally equal the sum of its batches’ amount, because fees and holds are netted out of the deposit. To reconcile a payout to the cent, use its Balance Transactions API.
Webhook Events
Subscribe to these Webhook API events to be notified as a batch progresses through its lifecycle:
| EVENT | WHEN IT FIRES |
|---|---|
batch.opened | A new batch is opened for the merchant, or for one of its terminal readers. |
batch.closing | A close has been accepted and submission is in flight. |
batch.closed | Every underlying settlement in the batch was submitted successfully. amount and transaction_count are populated where the processor reports them. |
batch.close_failed | At least one settlement exhausted retries. The merchant may retry the close. Sent once per failed close attempt. |
Each event’s data field contains the Batch API object as it was at the time of the transition.
