Collect due invoices now (sandbox)
Sandbox only — returns permission_denied anywhere else, where scheduled invoices collect on their own. Collects your invoices that are due right now, up to a batch limit, and answers {claimed, collected, released}; call it again if claimed came back at the limit.
Use it to see a schedule through to a charge without waiting for its date: schedule with a collectAt in the past, then call this. The charge is real, with the same statuses and Attempts rows a dated collection produces — nothing here is simulated. Calling it twice is safe; a second pass reuses the transaction rather than charging again.
Response contract
The successful wire shape and errors an integration should branch on.
Collection run
application/jsonclaimedintegerrequired- Invoices of yours that were due and taken for collection in this pass, up to the batch limit. Call again if it comes back at the limit.
collectedintegerrequired- How many of those were charged successfully. A shortfall is not an error — a declined card is recorded against the invoice and retried on its own schedule; read Attempts for the reason.
releasedintegerrequired- Invoices freed from a pass that stopped part-way and left them held. Normally 0.
Example response
{
"claimed": 2,
"collected": 1,
"released": 0
}Error responses
authentication_failedThe key is missing, malformed, revoked, or invalid for this environment.
permission_deniedThe key does not have invoices.schedule.
conflictThe resource is not in a state where this operation is valid.