Skip to main content
POST

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) — body validation runs in strict allowlist mode, so a field the schema does not declare produces that error. In particular there is no client_id field: reference an existing client with client: { "id": "client_…" }, or look one up with client: { "search": { "on_key": "tax_id", "on_value": "…" } }. Supplying both id and search on the same object is a 400.

team, livemode and owner are reserved and injected by the auth middleware.

client
object
required
currency
string
required
Example:

"MXN"

use
string
required
Example:

"G03"

items
object[]
required
payment_form
enum<string>
required

SAT forma de pago. 99 (Por definir) needs payment_method PPD; with PUE it is refused with 400, except on a factura global.

Available options:
01,
02,
03,
04,
05,
06,
08,
12,
13,
14,
15,
17,
23,
24,
25,
26,
27,
28,
29,
30,
31,
99
Example:

"03"

payment_method
enum<string>
required
Available options:
PPD,
PUE
Example:

"PUE"

date
number
return_files
boolean

Return base64 encoded PDF and XML files in response

Example:

true

exchange_rate
number

Exchange rate for currency conversion. If not provided, the latest rate from our rates collection will be used automatically. A rate of 1 on a currency other than the team's local currency is refused with 400.

Example:

1

folio_number
number
Example:

123

series
string

Optional. Defaults to the team's invoice serie. For a Colombian debit note it defaults to the team's debit-note serie, then ND, so a debit note never takes a number from the sales-invoice serie. In Colombia the series and folio stored on the issued document are the ones DIAN assigned (for example ND3 is series ND, folio 3).

Example:

"A"

idempotency_key
string | null

Your identifier for this invoice, for example your order id. With it, sending the same request again cannot issue a second CFDI or charge a second credit:

  • Once the invoice exists, the same key answers 400 with duplicate: true and the existing uuid.
  • While another request with the key is being processed, it answers 409 idempotency_in_progress.
  • After a 503 PAC_OUTCOME_UNKNOWN, a retry with the key resends the exact same XML and folio, so the PAC either stamps it once or reports the stamp it already made.
  • A definitive rejection (for example the SAT refusing the data) frees the key, so you can fix the body and send it again under the same key.

Scoped to your team and the credential's mode. Required on every item of POST /invoices/income/batch.

Example:

"unique_key_123"

exports
enum<string> | null
Available options:
01,
02,
03,
04,
null
Example:

"01"

complements
object[] | null
carta_porte
object

Mexico, carriers and freight forwarders only: bills the freight as a CFDI de ingreso with the Carta Porte 3.1 complement (road transport). Same object and SAT attribute names as POST /invoices/transfer. At least one item must be a transport service (product_key 78101500-78102205, 78121603, 78141500/01, 84121806, 92121800-02); the goods go in carta_porte.Mercancias. Not available on global invoices or debit notes, in currency XXX, or next to a donatarias complement.

Earlier documents this invoice relates to. In Mexico, relationship is a SAT CFDI relationship code and documents lists fiscal UUIDs.

Colombia, debit note (document_kind: debit_note): exactly one entry, with relationship: "02" and one document: the invoice being debited, given as its uuid (CUFE) or its DIAN number (for example FV69), or the credit note the debit note reverses, given the same way (for example NCP27).

invoice_pdf_notes
string
Example:

"Additional notes for PDF"

pdf_fields
object[] | null

Colombia (DIAN) only. Label/value pairs printed beside the dates on the PDF gigstack draws for teams that use their own Colombian PDF, for example a purchase order number. They are printed only: they are not part of the DIAN XML. Up to 10. A field with the same label as one the team prints from metadata replaces it; with an empty value it hides it on this invoice. Ignored in Mexico.

Maximum array length: 10
addenda
string | null
Example:

"<addenda>...</addenda>"

send_email
boolean

Whether to send the document via email to the client. Defaults to true.

Example:

true

ignore_emails
boolean | null

Suppress all notification emails for this document. Takes precedence over send_email — when true, no mail is sent even if send_email is true.

Example:

false

emails
string<email>[]
Example:
metadata
object

Custom key-value metadata. Colombia: the team setting order_reference (e.g. {metadata.orderId?}) can send a metadata value to DIAN as the sales invoice's purchase order.

Example:
automation_type
enum<string>

Optional. Invoice automation type:

  • payment: Create invoice with payment automation
  • none: No automation, create invoice only
Available options:
payment,
none
Example:

"payment"

global
object | null

Factura global period. Required when the client is PUBLICO EN GENERAL (XAXX010101000); without it the invoice is refused instead of being stamped for the current month.

payment_due_date
string

Colombia (DIAN) only. Due date of a credit invoice (payment_method: PPD), as YYYY-MM-DD. Required for a Colombian PPD invoice, on or after the stamping day in Bogotá; printed on the DIAN document as "Fecha de vencimiento", with the term ("Plazo: N días") at the start of the observations. Refused for other countries and for PUE.

Pattern: ^\d{4}-\d{2}-\d{2}$
Example:

"2026-11-19"

document_kind
enum<string> | null

Colombia (DIAN) only. Which document to issue. Omitted, null or invoice issues a regular sales invoice (factura de venta). debit_note issues a DIAN debit note (nota débito) that charges an additional amount on an invoice you already issued. A debit note:

  • requires motive;
  • must reference exactly one invoice: related_documents: [{ "relationship": "02", "documents": ["<invoice uuid or DIAN number>"] }]. The referenced document must be a sales invoice of the same team and mode, or a credit note it reverses (see billing_period), never another debit note;
  • cannot be combined with global;
  • carries in items only the additional amounts being charged (interest, collection costs, the price increase), not the original invoice's items.

Teams that don't invoice in Colombia get 400 for debit_note. These checks run before a credit is consumed or a folio reserved.

Available options:
invoice,
debit_note,
null
Example:

"debit_note"

motive
enum<string> | null

Colombia (DIAN) only. Required when document_kind is debit_note, refused (400) on any other invoice. The DIAN concept of the debit note, by code or by name:

These codes are not the credit-note or cancellation motives: 2 means "Gastos por cobrar" here.

Available options:
1,
2,
3,
4,
interest,
collection_expenses,
value_change,
other,
null
Example:

"1"

billing_period
object | null

Colombia (DIAN) only, debit notes that reverse a credit note. The period the debit note covers. Required when the debit note reverses a credit note (related_documents names a credit note): DIAN then issues it as a debit note without an invoice reference (operation type 32), which must carry a billing period. Refused (400) on a debit note that debits a sales invoice and on any other invoice. Both checks run before a credit is consumed or a folio reserved.

start_time defaults to 00:00:00 and end_time to 23:59:59; the dates must be days that exist and the period must end no earlier than it starts.

Response

Invoice created successfully

message
string
Example:

"Invoice created successfully"

data
object