Skip to main content
POST
Create a batch of income invoices

Authorizations

Authorization
string
header
required

Authentication Method: HTTP Bearer token.

The runtime requires the literal Bearer prefix — a bare token in the Authorization header is rejected with 401 unauthorized.

Header Format: Authorization: Bearer YOUR_API_KEY

Your API key is a JWT. Live keys operate on live data (livemode: true); test keys operate on isolated test data (livemode: false).

Get your key at: app.gigstack.pro/settings?tab=api

Errors: credential failures are answered by the authentication layer with a raw { "message": … } body, not the standardized envelope — 401 for a missing, malformed or expired token, 403 for a revoked key or a plan without API access. See the Unauthorized and AuthForbidden responses.

Headers

Idempotency-Key
string
required

Your identifier for this batch, 8-128 characters of A-Z a-z 0-9 . _ : -. Reusing it with the same body returns the batch it first created; reusing it with a different body is 409 idempotency_key_reused.

Required string length: 8 - 128
Pattern: ^[A-Za-z0-9._:-]{8,128}$

Query Parameters

team
string

gigstack Connect: Target team ID for multi-team access.

Requires gigstack Connect enabled on your team and shared billing account.

Also requires the multipleIssuerAccounts feature on your plan. Requests targeting a team other than the one your API key belongs to return 403 without it.

Only API keys can use it: an OAuth access token sent with another team's id is rejected with 403 Team mismatch with OAuth token.

Optional — omit it entirely unless you are acting on another team. It deliberately carries no example value so generated snippets do not emit ?team=undefined; when the parameter is absent, the team is derived from your API key.

Example: ?team=team_xyz789

Body

application/json

Up to 1,000 income invoices. Each item is exactly the body of POST /invoices/income, and must carry its own idempotency_key, unique within the batch.

Items are validated one by one: an invalid item is listed in the batch's rejected and the others go ahead. Only a body without a non-empty invoices array (invalid_body) or with more than 1,000 items (too_many_items) refuses the whole request.

livemode, team and owner in an item are ignored (they come from the credential), and so is return_files: a batch does not return files. Keep the whole JSON body under 10 MB.

invoices
object[]
required

The invoices, in the order you want them reported. An item's index is its position here (from 0).

Required array length: 1 - 1000 elements

Response

Retry of an earlier request with the same Idempotency-Key and the same body: the batch it created, as it is now. Nothing is created again. If the first request died while writing the batch, this request finishes creating it.

Standardized success envelope emitted by sendSuccessResponse.

success
enum<boolean>
required
Available options:
true
Example:

true

data
object
required

An income invoice batch: how many invoices it received, which were rejected up front, and the progress of the rest. Timestamps are epoch milliseconds.

timestamp
integer<int64>
required

Server time in epoch milliseconds (Luxon.now().toMillis()).

Example:

1767225600000

message
string

Human-readable summary. Present only when the handler supplies one.

Example:

"Operation completed successfully"