Create Batch
POST/api/v1/batches
Create a new batch of invoices for bulk processing.
Batch Types:
send: Validate and send all invoicesvalidate: Only validate (dry run)schedule: Validate now, send at scheduled time
Scheduling: a schedule batch needs scheduled_at (ISO 8601; UTC when it
carries no offset), not in the past, and is sent once, within a minute or so of
that time. One first picked up more than 24 hours after its scheduled_at is
not sent: it ends failed with an error_message starting SCHEDULE_EXPIRED.
scheduled_at on a send or validate batch, an unknown batch_type, or a
schedule batch without a future scheduled_at is refused with 422.
A schedule batch is sent by the platform at its time, so creating one needs
the invoices:send permission as well (as /process does); send and
validate batches need only invoices:create.
Limits: at most 5,000 invoices per batch, and a request body of at most
20 MB (413 BATCH_BODY_TOO_LARGE past it). Sending a batch of more than 100
invoices is queued: see POST /batches/{id}/process.
Requestโ
Responsesโ
- 201
- 413
- 422
Successful Response
BATCH_BODY_TOO_LARGE: the request body is larger than 20 MB
The body is not a valid batch (for example more than 5,000 invoices)