Skip to main content
POST
Create an invoice

Authorizations

Authorization
string
header
required

API key: Authorization: Bearer sk_test_... or sk_live_....

Headers

Invoice-Version
string

Pin a dated API release (Stripe-style). Omit to use the current version. An unknown value returns 400 request.invalid_version. Echoed back on every response.

Example:

"2026-07-10"

Invoice-Account
string

Connect: act on behalf of one of your connected accounts (its acct_…/org_… id). Omit to act as your own organization. Not honored on /v1/api_keys.

Example:

"org_2P9connectedacct"

Idempotency-Key
string

Safely retry any POST. The first response is stored for 24h and replayed byte-for-byte for identical retries (the replay adds an idempotent-replayed: true header). Reusing the key with a different body is 409 idempotency.key_reuse; an in-flight duplicate is 409 idempotency.key_processing. This makes retrying a 502/429 safe — no duplicate stamp.

Example:

"a1b2c3d4-e5f6-4789-8abc-1234567890ab"

Query Parameters

expand

Comma-separated related objects to inline, e.g. "fiscal_profile".

expand[]

Bracket-array form of expand, e.g. ?expand[]=fiscal_profile.

Body

application/json
fiscal_profile_id
string
required

Id of the fiscal profile (issuer) to stamp with, e.g. "fp_2P9K3sample".

Minimum string length: 1
type
enum<string>
default:I

CFDI TipoDeComprobante: "I" ingreso (default), "E" egreso (nota de crédito), "P" pago.

Available options:
I,
E,
P
serie
string

CFDI Serie (optional invoice series prefix).

Required string length: 1 - 25
folio
string

CFDI Folio; auto-assigned when omitted.

Required string length: 1 - 40
date
string

CFDI Fecha, ISO-8601; defaults to now at build time. Must be within the past 72 hours.

payment_form
enum<string>

c_FormaPago code (FormaPago), e.g. "01" efectivo, "03" transferencia, "99" por definir. Required for type I/E; forced to "99" when payment_method is PPD. See GET /v1/catalogs/payment_forms (or the SAT catalogs guide) for each code's meaning.

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

c_MetodoPago: "PUE" pago en una sola exhibición or "PPD" pago en parcialidades o diferido. Required for type I/E.

Available options:
PUE,
PPD
currency
enum<string>
default:MXN

c_Moneda currency code (Moneda), e.g. "MXN" (default) or "USD". See GET /v1/catalogs/currencies (or the SAT catalogs guide) for each code's meaning.

Available options:
MXN,
USD,
EUR,
CAD,
GBP,
JPY,
CHF,
CNY,
AUD,
BRL,
ARS,
COP,
CLP,
PEN,
DKK,
SEK,
NOK,
HKD,
SGD,
NZD,
KRW,
XXX
exchange_rate

TipoCambio: MXN per 1 unit of currency; required when currency is neither MXN nor XXX.

Pattern: ^-?\d+(\.\d+)?$
use
enum<string>

c_UsoCFDI code (UsoCFDI), e.g. "G03"; falls back to customer.use. Required for type I/E. See GET /v1/catalogs/uso_cfdi (or the SAT catalogs guide) for each code's meaning.

Available options:
G01,
G02,
G03,
I01,
I02,
I03,
I04,
I05,
I06,
I07,
I08,
D01,
D02,
D03,
D04,
D05,
D06,
D07,
D08,
D09,
D10,
S01,
CP01,
CN01
export
enum<string>
default:01

c_Exportacion code (Exportacion). Default "01" (no aplica); other codes need the Comercio Exterior complement (not supported in v1). See GET /v1/catalogs/export_types (or the SAT catalogs guide) for each code's meaning.

Available options:
01,
02,
03,
04
relation
object

CFDI relation (CfdiRelacionados). Required for type E (nota de crédito).

customer
object

Customer (Receptor) — who the invoice is for.

items
object[]

Line items (Conceptos). Required for type I/E; must be empty for type P.

payments
object[]

Complemento de pagos 2.0 entries. Required for and only valid on type P.

global_information
object

InformacionGlobal for a factura global (público en general XAXX010101000).

draft
boolean

Hold the invoice as a signed draft instead of stamping it immediately (default false).

metadata
object

Integrator-owned key-value map (≤50 keys), stored and echoed back verbatim.

{key}
any

Response

Default Response

object
enum<string>
required

Always "invoice".

Available options:
invoice
id
string
required

Invoice id, e.g. "inv_2P9K3sample".

livemode
boolean
required

True if stamped with a live-mode key against the real SAT.

status
enum<string>
required

Lifecycle status: draft, stamping (in flight), stamped, or stamp_failed.

Available options:
draft,
stamping,
stamped,
stamp_failed
type
enum<string>
required

CFDI TipoDeComprobante: "I" ingreso, "E" egreso (nota de crédito), "P" pago.

Available options:
I,
E,
P
fiscal_profile_id
string
required

Id of the fiscal profile (issuer) that stamped this invoice.

serie
string | null
required

CFDI Serie, or null if unset.

folio
string | null
required

CFDI Folio, or null if unset.

customer
object
required

The receptor (customer) as stamped onto the CFDI.

currency
string
required

c_Moneda currency code, e.g. "MXN".

subtotal
string | null
required

Sum of line amounts before taxes, decimal string, e.g. "100.00".

total
string | null
required

Grand total including taxes, decimal string, e.g. "116.00".

uuid
string | null
required

SAT folio fiscal (UUID) once stamped, else null.

stamped_at
string | null
required

When the CFDI was stamped (ISO-8601 UTC), or null.

sello_cfd
string | null
required

Issuer digital seal (Sello del CFDI), or null.

sello_sat
string | null
required

SAT digital seal from the TimbreFiscalDigital, or null.

no_certificado_sat
string | null
required

SAT certificate serial that timbró the CFDI, or null.

cancellation
object
required

Cancellation status for this CFDI.

error
any | null
required

The last stamping error (problem+json shape) when status is stamp_failed, else null.

xml_url
string
required

Path to download the CFDI XML, e.g. "/v1/invoices/:id/xml".

pdf_url
string
required

Path to download the CFDI PDF, e.g. "/v1/invoices/:id/pdf".

metadata
object
required

Integrator-owned key-value map echoed back.

created_at
string
required

Creation timestamp, ISO-8601 UTC.

updated_at
string
required

Last-update timestamp, ISO-8601 UTC.

fiscal_profile
object

The full issuer profile — present only when ?expand=fiscal_profile is requested.