Skip to main content
POST
Create receipt

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.

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

Unknown top-level keys are rejected (400 validation_failed / unexpected_key); metadata is the one object that accepts arbitrary keys. team, livemode and owner are reserved and injected by the auth middleware.

client
object
required
currency
string
required

Currency code (ISO 4217)

Example:

"MXN"

items
object[]
required

Receipt items

exchange_rate
number | null

Exchange rate to use for currency conversion

Example:

1

metadata
object | null

Additional metadata - accepts any custom properties for tracking business data, references, or integration identifiers. All properties are preserved and returned as-is.

periodicity
enum<string> | null

Receipt validity period. two_month and two_months are both accepted and mean the same period (end of the following month).

Available options:
day,
week,
two_weeks,
month,
two_month,
two_months,
null
Example:

"month"

invoice_config
object

Invoice configuration for future stamping. Accepted and validated on this endpoint, but note the create-receipt handler does not currently persist it onto the receipt — it is validated and discarded.

payment_form
string | null

SAT payment form code

Example:

"01"

idempotency_key
string | null

Stable key for one business event. A duplicate returns HTTP 400 with error.code resource_conflict, not the existing receipt as a successful response. Reconcile the existing record and retain this key across retries.

Example:

"receipt-key-12345"

send_email
boolean | null

Whether to send email and WhatsApp notifications for this receipt. Defaults to true.

Example:

true

ignore_emails
boolean | null

Suppress email and WhatsApp notifications for this receipt. Takes precedence over send_email — the handler stores ignore_emails ?? (send_email === false).

Example:

false

Response

Receipt created successfully. The receipt is stored with status: pending — no PAC call happens here, so no PAC-related error can be returned by this operation. Stamping happens later, via POST /v2/receipts/{id}/stamp or the self-invoicing portal.

Standardized success envelope emitted by sendSuccessResponse.

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

true

data
object
required

The operation payload.

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:

"Receipt created successfully"