Skip to content
myela

Each row is a POST /invoices body plus the schedule fields collectAt and paymentMethodId; a row is created and then scheduled, through the same rules as the single routes. Amounts are integer minor units. A row's idempotencyKey covers both steps, so sending the same row again, in this job or a later one, returns its invoice instead of a second one; without it the job derives a key from job id and row number. A row that fails after its invoice was created still names that invoice in result. A row stopped by a temporary problem is unresolved: resume the job to retry it.

Bulk create and schedule invoices

POST/v1/bulk_jobs/invoicesLink

Each row is a POST /invoices body plus the schedule fields collectAt and paymentMethodId; a row is created and then scheduled, through the same rules as the single routes. Amounts are integer minor units. A row's idempotencyKey covers both steps, so sending the same row again, in this job or a later one, returns its invoice instead of a second one; without it the job derives a key from job id and row number. A row that fails after its invoice was created still names that invoice in result. A row stopped by a temporary problem is unresolved: resume the job to retry it.

SandboxSecret keybulkJobs.scheduleInvoices

Request fields

Edit a field and the generated request updates immediately.

Request body
Optional fields1
arrayoptional

The lines being billed. Each carries a description, a quantity, and a unitAmount in minor units; the invoice totals itself from them, so amount becomes optional.

Response contract

The successful wire shape and errors an integration should branch on.

200

Bulk job

application/json
idstringrequired
Unique bulk job identifier.
object"bulk_job"required
Stable resource discriminator.
typestringrequired
Which single-item operation every row runs: customers.create, payments.capture or invoices.schedule (create, then schedule).
statusstringrequired
pending, processing, completed, completed_with_errors or failed.
totalItemsintegerrequired
Rows submitted.
processedItemsintegerrequired
Rows that reached a final state.
succeededItemsintegerrequired
Rows whose operation succeeded.
failedItemsintegerrequired
Rows refused definitively.
unresolvedItemsintegerrequired
Rows to resume: a capture whose money outcome must be reconciled first, or an invoice row stopped by a temporary problem.
expiresAtstringrequired
When the job can no longer be resumed.
createdAtstringrequired
When the job was created.
itemsarrayrequired
One entry per row: its number, status, the created or captured resource on success, or a code and message on failure. A refused invoice row adds error.detailCode, the code single create returns in details.code, and still names its invoice in result if one was created.
warningobject
Only when an invoices job is created on an environment with no automatic collection: code INVOICE_SCHEDULER_DISABLED and a message. The invoices are scheduled, but nothing will charge them on its own.
Example response
{
  "id": "bj_01JEXAMPLE",
  "object": "bulk_job",
  "type": "payments.capture",
  "status": "completed_with_errors",
  "totalItems": 3,
  "processedItems": 3,
  "succeededItems": 2,
  "failedItems": 0,
  "unresolvedItems": 1,
  "expiresAt": "2026-09-05T00:00:00.000Z",
  "createdAt": "2026-09-04T00:00:00.000Z",
  "items": [
    {
      "row": 1,
      "status": "succeeded",
      "result": {
        "id": "pay_01JEXAMPLE",
        "status": "pending_settlement"
      }
    }
  ],
  "warning": {
    "code": "INVOICE_SCHEDULER_DISABLED",
    "message": "Automatic collection is not running on this environment."
  }
}
Error responses
401authentication_failed

The key is missing, malformed, revoked, or invalid for this environment.

403permission_denied

The key does not have bulkJobs.scheduleInvoices.

422invalid_request

One or more request fields are invalid.

409conflict

The resource is not in a state where this operation is valid.