Batches
Create batches to group payments, set their defaults, and submit every payment in a batch at once.
A batch is a container for payments. It has no status of its own. It gives its payments their defaults, lets you restrict how they are paid, and lets you submit them all with one call. A typical batch is one payroll run, one tournament, or one month of invoices.
Before you start
- Creating and editing batches needs the Write permission. Submitting a batch needs the Payment Approval permission. See Permissions.
- Know which payment category your payments fall under. The category drives tax treatment; see the Tax Guide.
Step 1: Create a batch
curl -X POST https://api-sandbox.paymentlabs.io/batches \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "October creator payouts",
"referenceId": "payrun-2026-10",
"defaultPaymentCategory": "royalties",
"taxJurisdiction": "us"
}'Create Batch returns 201 with the batch and a Location header. Keep the id (B-...).
| Field | Required | Description |
|---|---|---|
name | Yes | Shown to you, and used as the payee memo of payments that do not set one. |
defaultPaymentCategory | Yes | The category a payment gets when it does not set its own, for example remote-contractors or royalties. The Tax Guide lists all 12 values and what each is for. |
taxJurisdiction | Depends | The tax jurisdiction for the batch's payments: one enabled on your account, or none. Required when your account has more than one jurisdiction. With one jurisdiction it defaults to that one; with none it defaults to none. It cannot be changed after the batch is created. |
referenceId | No | Your own label for the batch. It is not checked for uniqueness. |
allowedPaymentMethods | No | The payout methods payees may be paid with on this batch, for example ["bank-transfer-1", "paypal"]. Leave it out to allow every method enabled on your account. |
deniedCountries | No | Two-letter country codes (ISO 3166-1 alpha-2). Payments to payees who live in these countries are not sent: they move to RESTRICTED. |
archived | No | true to create the batch already archived. |
Creating a batch fires the batch-created webhook.
Step 2: Add payments
Add payments one by one with Create Payment (see Creating and Submitting Payments), or many at once from a spreadsheet with a payment import.
The batch's totals (totalAmount, numberOfPayments, paymentsSummary and the rest) are recalculated in the background. They can lag a few seconds behind the payments you just added.
Step 3: Submit the batch
Submit Batch queues every payment in the batch that can be sent, and returns 202 Accepted.
curl -X POST https://api-sandbox.paymentlabs.io/batches/B-01JDA1B2C3D4E5F6G7H8J9K0M1/submit \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "autoSubmit": true, "feeCap": "5.00", "fxDifferenceCoverage": "payor" }'| Field | Description |
|---|---|
autoSubmit | true sends payments to payees who are payable now, and parks the others in WAITING_PAYABILITY until their payee becomes payable, then sends them. false (default) sends only payments whose payee is payable now and leaves the rest untouched. |
feeCap | The most you pay in transfer fees per payment, as a decimal string in each payment's currency, for example "5.00". The payee covers any fee above it. Leave it out to use the cap configured on your account. See Payment Methods and Costs. |
fxDifferenceCoverage | payor or payee: who covers the exchange-rate and fee difference when a returned payment is sent again. Leave it out to use your account default. |
Which payments a batch submit sends:
- Only payments in
DRAFT,FAILEDorRETURNED. - Only when the payee is payable, or when
autoSubmitistrue. - Never a payment that is being cancelled.
Repeating Submit Batch does not send a payment twice: a payment picked up by two requests is sent only once.
Every other payment is skipped without an error, so a 202 does not tell you how many payments were sent. Follow each payment through the payment-status-changed webhook, or search the batch's payments after a few seconds. A batch submit does not check your ledger balance first: payments that the balance cannot cover wait for funds (see Funding and Ledger Accounts).
To submit selected payments instead of the whole batch, submit each payment on its own (see Creating and Submitting Payments).
Update, archive and find batches
- Read one batch: Get Batch.
- List batches: List Batches returns your active batches, oldest first. Send
archived=trueto list only archived batches instead. When the response hasnextPage, pass it asexclusiveStartIdto get the next page. To filter or sort, use Search Batches. - Search batches: Search Batches. You can filter and sort on
id,referenceId,name,taxJurisdiction,defaultPaymentCategory,archived,auditInfo.createdAt,auditInfo.updatedAt,auditInfo.createdByandauditInfo.updatedBy. See Search, Exports and Pagination. - Update a batch: Patch Batch with any of
name,referenceId,defaultPaymentCategory,allowedPaymentMethods,deniedCountriesandarchived. It returns204and firesbatch-changed.- A new
defaultPaymentCategoryapplies to payments you create afterwards. Add"updateExistingPayments": trueto also re-categorize the batch'sDRAFTpayments. - Changes to
name,allowedPaymentMethods,deniedCountriesandarchivedare copied to the batch's payments in the background. A newdeniedCountrieslist moves unsent payments of affected payees into or out ofRESTRICTED.
- A new
- Archive a batch:
PATCHwith"archived": true. An archived batch is read-only: you cannot add payments to it, edit it, or submit it. To use it again,PATCHwith"archived": false. If a payment in an archived batch is returned, Payment Labs unarchives the batch so you can send the payment again.
To stop every unsent payment in a batch, cancel them with Cancel Batch Payments. It returns 204 and cancels, in the background, each payment that is DRAFT, FAILED, RETURNED, WAITING_PAYABILITY or RESTRICTED and is not already queued for sending.
Errors and edge cases
| Error | Meaning | What to do |
|---|---|---|
400 VALIDATION_ERROR | A field is missing or invalid, for example an unknown category, a jurisdiction not enabled on your account, a missing taxJurisdiction when you have several, a bad country code, or a field the API does not accept. details names each field. | Fix the field. taxJurisdiction is not accepted on Patch Batch. |
404 NOT_FOUND | The batch does not exist or is not yours. | Check the batchId. |
423 NOT_EDITABLE | The batch is archived. | Unarchive it first. |
403 FORBIDDEN_INSUFFICIENT_TAGS on Submit Batch | Your credential lacks the Payment Approval permission. | Ask Payment Labs to change the credential's role. |
403 on Submit Batch, other codes | Your account is blocked from sending payments, or your role has an approval amount limit. Users with an approval limit cannot submit a whole batch. | Contact Payment Labs, or submit payments one by one. |
409 CUSTOMER_FROZEN on Submit Batch | Payouts from your account are frozen. | Contact Payment Labs. |
| Retried Create Batch | A retry after a timeout creates a second batch. | Search for your referenceId before you retry. |
Next steps
Updated 1 day ago
