Send Authorization: Bearer sk_test_... (test) or sk_live_... (live) on every /v1 request;
anything else is 401 auth.unauthorized. A revoked key is 401 auth.key_revoked. Manage keys via
API keys.
The key’s prefix decides the mode, and the mode scopes all data: a sk_test_ key never sees
live resources and vice-versa. Every resource carries livemode. Test mode uses the simulated
stamping service and tolerates the sample CSD; see Testing.
Money is always a decimal string ("116.00") — never a float — so cents never drift. Amounts
are computed and rounded half-up at the currency’s decimal places. Times are ISO-8601 UTC
(2026-07-10T18:25:43Z). Ids are prefixed, time-ordered, base32 ULID-style: org_, key_,
fp_, inv_, dl_, we_, evt_, whd_, req_.
Send Idempotency-Key: <unique> on any POST. The first response is stored for 24h and replayed
byte-for-byte for identical retries (replays add idempotent-replayed: true). A different body
under the same key is 409 idempotency.key_reuse; an in-flight duplicate is
409 idempotency.key_processing. This makes retrying a 502 safe — no duplicate stamp.
Fiscal profiles, invoices, webhook endpoints, and connected accounts accept a metadata object of
string→string (≤50 keys, key ≤40 chars, value ≤500). It round-trips untouched and always appears
(default {}). On PATCH, metadata is merged: send a key to set it, or a key with an
empty-string value to delete it.
Where documented, ?expand=<field> inlines a related resource. Invoices support
?expand=fiscal_profile. An unsupported value is 422 request.invalid_expand.
Pin a dated release with the Invoice-Version: 2026-07-15 header (Stripe-style). Omit it to use
the current version. An unknown value is 400 request.invalid_version. A key may also carry a
pinned version. Precedence: request header → key pin → current. The resolved version is echoed
on every response’s Invoice-Version header.Versioning is real, not cosmetic — each dated version pins a response shape, so an old
integration keeps exactly the contract it was built against. Discover every version at
GET /v1/versions (public, no auth) and read the diff in the
Changelog. A version scheduled for removal is served with RFC 8594
Deprecation: true and a Sunset HTTP-date on every response.
A token-bucket limiter admits a steady rate with a burst. Authed responses carry RateLimit-Limit,
RateLimit-Remaining, and RateLimit-Reset. A throttled request is 429 rate_limit.exceeded with
a Retry-After header — back off and retry.
Every metered action is recorded on a read-only stream. GET /v1/usage returns
cursor-paginated usage_record objects for the acting org + mode — the Stripe usage-record analog.
Today a fresh CFDI stamp emits one record (kind: "stamp", quantity: 1, resource_id the
inv_…); idempotent replays and duplicate re-stamps never double-count. Filter with ?kind=,
?date_from=, and ?date_to= (inclusive bounds on created_at).
Errors are application/problem+json (RFC 9457) with a stable code, a human- and agent-readable
remediation, an optional pac object, request_id, and a doc_url deep-link. Switch on code,
show remediation. The full catalog lives in the Error reference.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Invoice API","description":"Mexican CFDI 4.0 invoicing API — stamp, cancel, validate, and bulk-download.","colors":{"primary":"#16a34a","light":"#4ade80","dark":"#15803d"},"favicon":"https://mintcdn.com/invoiceapi/zn1ZuSpkXG_1Rv6s/favicon.svg?fit=max\u0026auto=format\u0026n=zn1ZuSpkXG_1Rv6s\u0026q=85\u0026s=77fb818571243295fe27cfc2fc5a1479","navbar":{"primary":{"type":"button","label":"Quickstart","href":"/quickstart"}},"footer":{"socials":{}},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"invoiceapi","hasAudioNarration":false,"actualSubdomain":"invoiceapi","customDomains":["docs.newinvoice.dev"],"gitSource":{"type":"github","owner":"disruptive-learning","repo":"invoice_api","deployBranch":"main","contentDirectory":"mintlify","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6af358e37449a8e2dc9bd3ba","clientVersion":"0.0.4102","searchFilterCounts":[{"language":"default","tag":"API Reference","count":77},{"language":"default","tag":"Documentation","count":17},{"language":"default","tag":"Guides","count":12},{"language":"default","tag":"fiscal_profiles","count":11},{"language":"default","tag":"invoices","count":7},{"language":"default","tag":"downloads","count":6},{"language":"default","tag":"webhook_endpoints","count":6},{"language":"default","tag":"accounts","count":5},{"language":"default","tag":"ticket_invoices","count":5},{"language":"default","tag":"api_keys","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"concepts/conventions","slug":"/concepts/conventions","pageMetadata":{"title":"Conventions","description":"Auth, test vs live, money, pagination, idempotency, metadata, versioning, rate limits, and Request-Id — the rules every endpoint follows.","icon":"book","href":"/concepts/conventions"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Auth, test vs live, money, pagination, idempotency, metadata, versioning, rate limits, and Request-Id — the rules every endpoint follows.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Every endpoint follows the same rules. Learn them once and the whole API is predictable.`}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsxs(_components.p,{children:[`Send `,_jsx(_components.code,{children:`Authorization: Bearer sk_test_...`}),` (test) or `,_jsx(_components.code,{children:`sk_live_...`}),` (live) on every `,_jsx(_components.code,{children:`/v1`}),` request;\nanything else is `,_jsx(_components.code,{children:`401 auth.unauthorized`}),`. A revoked key is `,_jsx(_components.code,{children:`401 auth.key_revoked`}),`. Manage keys via\n`,_jsx(_components.a,{href:`/guides/api-keys`,children:`API keys`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`test-vs-live`,children:`Test vs live`}),`\n`,_jsxs(_components.p,{children:[`The key’s prefix decides the mode, and the mode scopes `,_jsx(_components.strong,{children:`all`}),` data: a `,_jsx(_components.code,{children:`sk_test_`}),` key never sees\nlive resources and vice-versa. Every resource carries `,_jsx(_components.code,{children:`livemode`}),`. Test mode uses the simulated\nstamping service and tolerates the sample CSD; see `,_jsx(_components.a,{href:`/guides/testing`,children:`Testing`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`money-and-time`,children:`Money and time`}),`\n`,_jsxs(_components.p,{children:[`Money is always a `,_jsx(_components.strong,{children:`decimal string`}),` (`,_jsx(_components.code,{children:`\"116.00\"`}),`) — never a float — so cents never drift. Amounts\nare computed and rounded half-up at the currency’s decimal places. Times are ISO-8601 UTC\n(`,_jsx(_components.code,{children:`2026-07-10T18:25:43Z`}),`). Ids are prefixed, time-ordered, base32 ULID-style: `,_jsx(_components.code,{children:`org_`}),`, `,_jsx(_components.code,{children:`key_`}),`,\n`,_jsx(_components.code,{children:`fp_`}),`, `,_jsx(_components.code,{children:`inv_`}),`, `,_jsx(_components.code,{children:`dl_`}),`, `,_jsx(_components.code,{children:`we_`}),`, `,_jsx(_components.code,{children:`evt_`}),`, `,_jsx(_components.code,{children:`whd_`}),`, `,_jsx(_components.code,{children:`req_`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`pagination`,children:`Pagination`}),`\n`,_jsxs(_components.p,{children:[`List endpoints take `,_jsx(_components.code,{children:`?limit=`}),` (1–100, default 20) plus `,_jsx(_components.strong,{children:`one`}),` cursor:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`?starting_after=\u003cid>`}),` — the next (older) page`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`?ending_before=\u003cid>`}),` — the previous (newer) page`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Sending both is `,_jsx(_components.code,{children:`422 request.invalid_pagination`}),`. Responses are newest-first:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"list\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/v1/invoices\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [ `}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ], `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"has_more\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`idempotency`,children:`Idempotency`}),`\n`,_jsxs(_components.p,{children:[`Send `,_jsx(_components.code,{children:`Idempotency-Key: \u003cunique>`}),` on any POST. The first response is stored for 24h and replayed\nbyte-for-byte for identical retries (replays add `,_jsx(_components.code,{children:`idempotent-replayed: true`}),`). A different body\nunder the same key is `,_jsx(_components.code,{children:`409 idempotency.key_reuse`}),`; an in-flight duplicate is\n`,_jsx(_components.code,{children:`409 idempotency.key_processing`}),`. This makes retrying a `,_jsx(_components.code,{children:`502`}),` safe — no duplicate stamp.`]}),`\n`,_jsx(Heading,{level:`2`,id:`metadata`,children:`Metadata`}),`\n`,_jsxs(_components.p,{children:[`Fiscal profiles, invoices, webhook endpoints, and connected accounts accept a `,_jsx(_components.code,{children:`metadata`}),` object of\nstring→string (≤50 keys, key ≤40 chars, value ≤500). It round-trips untouched and always appears\n(default `,_jsx(_components.code,{children:`{}`}),`). On PATCH, metadata is `,_jsx(_components.strong,{children:`merged`}),`: send a key to set it, or a key with an\nempty-string value to delete it.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"metadata\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"order_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ord_1789\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"obsolete_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } }`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`expand`,children:`Expand`}),`\n`,_jsxs(_components.p,{children:[`Where documented, `,_jsx(_components.code,{children:`?expand=\u003cfield>`}),` inlines a related resource. Invoices support\n`,_jsx(_components.code,{children:`?expand=fiscal_profile`}),`. An unsupported value is `,_jsx(_components.code,{children:`422 request.invalid_expand`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`versioning`,children:`Versioning`}),`\n`,_jsxs(_components.p,{children:[`Pin a dated release with the `,_jsx(_components.code,{children:`Invoice-Version: 2026-07-15`}),` header (Stripe-style). Omit it to use\nthe current version. An unknown value is `,_jsx(_components.code,{children:`400 request.invalid_version`}),`. A key may also carry a\npinned version. Precedence: `,_jsx(_components.strong,{children:`request header → key pin → current`}),`. The resolved version is echoed\non every response’s `,_jsx(_components.code,{children:`Invoice-Version`}),` header.`]}),`\n`,_jsxs(_components.p,{children:[`Versioning is `,_jsx(_components.strong,{children:`real, not cosmetic`}),` — each dated version pins a response `,_jsx(_components.em,{children:`shape`}),`, so an old\nintegration keeps exactly the contract it was built against. Discover every version at\n`,_jsx(_components.a,{href:`/api-reference`,children:_jsx(_components.code,{children:`GET /v1/versions`})}),` (public, no auth) and read the diff in the\n`,_jsx(_components.a,{href:`/concepts/versioning`,children:`Changelog`}),`. A version scheduled for removal is served with RFC 8594\n`,_jsx(_components.code,{children:`Deprecation: true`}),` and a `,_jsx(_components.code,{children:`Sunset`}),` HTTP-date on every response.`]}),`\n`,_jsx(Heading,{level:`2`,id:`rate-limits`,children:`Rate limits`}),`\n`,_jsxs(_components.p,{children:[`A token-bucket limiter admits a steady rate with a burst. Authed responses carry `,_jsx(_components.code,{children:`RateLimit-Limit`}),`,\n`,_jsx(_components.code,{children:`RateLimit-Remaining`}),`, and `,_jsx(_components.code,{children:`RateLimit-Reset`}),`. A throttled request is `,_jsx(_components.code,{children:`429 rate_limit.exceeded`}),` with\na `,_jsx(_components.code,{children:`Retry-After`}),` header — back off and retry.`]}),`\n`,_jsx(Heading,{level:`2`,id:`request-id`,children:`Request-Id`}),`\n`,_jsxs(_components.p,{children:[`Every response carries a `,_jsx(_components.code,{children:`Request-Id`}),` header; it is also the `,_jsx(_components.code,{children:`request_id`}),` in every error body.`]}),`\n`,_jsxs(Tip,{children:[`Log the `,_jsx(_components.code,{children:`Request-Id`}),`. Support and idempotency both key off it.`]}),`\n`,_jsx(Heading,{level:`2`,id:`usage`,children:`Usage`}),`\n`,_jsxs(_components.p,{children:[`Every metered action is recorded on a read-only stream. `,_jsx(_components.a,{href:`/api-reference`,children:_jsx(_components.code,{children:`GET /v1/usage`})}),` returns\ncursor-paginated `,_jsx(_components.code,{children:`usage_record`}),` objects for the acting org + mode — the Stripe usage-record analog.\nToday a fresh CFDI stamp emits one record (`,_jsx(_components.code,{children:`kind: \"stamp\"`}),`, `,_jsx(_components.code,{children:`quantity: 1`}),`, `,_jsx(_components.code,{children:`resource_id`}),` the\n`,_jsx(_components.code,{children:`inv_…`}),`); idempotent replays and duplicate re-stamps never double-count. Filter with `,_jsx(_components.code,{children:`?kind=`}),`,\n`,_jsx(_components.code,{children:`?date_from=`}),`, and `,_jsx(_components.code,{children:`?date_to=`}),` (inclusive bounds on `,_jsx(_components.code,{children:`created_at`}),`).`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"usage_record\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ur_…\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"kind\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stamp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"quantity\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"resource_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"inv_…\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"livemode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-07-10T18:25:43Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(_components.p,{children:[`Errors are `,_jsx(_components.code,{children:`application/problem+json`}),` (RFC 9457) with a stable `,_jsx(_components.code,{children:`code`}),`, a human- and agent-readable\n`,_jsx(_components.code,{children:`remediation`}),`, an optional `,_jsx(_components.code,{children:`pac`}),` object, `,_jsx(_components.code,{children:`request_id`}),`, and a `,_jsx(_components.code,{children:`doc_url`}),` deep-link. Switch on `,_jsx(_components.code,{children:`code`}),`,\nshow `,_jsx(_components.code,{children:`remediation`}),`. The full catalog lives in the `,_jsx(_components.a,{href:`/concepts/errors`,children:`Error reference`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Conventions","description":"Auth, test vs live, money, pagination, idempotency, metadata, versioning, rate limits, and Request-Id — the rules every endpoint follows.","icon":"book","href":"/concepts/conventions"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Test vs live","slug":"test-vs-live","depth":2,"children":[]},{"title":"Money and time","slug":"money-and-time","depth":2,"children":[]},{"title":"Pagination","slug":"pagination","depth":2,"children":[]},{"title":"Idempotency","slug":"idempotency","depth":2,"children":[]},{"title":"Metadata","slug":"metadata","depth":2,"children":[]},{"title":"Expand","slug":"expand","depth":2,"children":[]},{"title":"Versioning","slug":"versioning","depth":2,"children":[]},{"title":"Rate limits","slug":"rate-limits","depth":2,"children":[]},{"title":"Request-Id","slug":"request-id","depth":2,"children":[]},{"title":"Usage","slug":"usage","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"invoiceapi","siteName":"Invoice API","title":"Conventions - Invoice API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-11T02:50:47.022Z","originalFileLocation":"concepts/conventions.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Auth, test vs live, money, pagination, idempotency, metadata, versioning, rate limits, and Request-Id — the rules every endpoint follows.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Invoice API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/invoiceapi/BFU6Hg8PMnpYZfzc/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/invoiceapi/BFU6Hg8PMnpYZfzc/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/invoiceapi/BFU6Hg8PMnpYZfzc/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/invoiceapi/BFU6Hg8PMnpYZfzc/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/invoiceapi/BFU6Hg8PMnpYZfzc/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/invoiceapi/BFU6Hg8PMnpYZfzc/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/invoiceapi/BFU6Hg8PMnpYZfzc/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/invoiceapi/BFU6Hg8PMnpYZfzc/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/invoiceapi/BFU6Hg8PMnpYZfzc/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Conventions - Invoice API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Auth, test vs live, money, pagination, idempotency, metadata, versioning, rate limits, and Request-Id — the rules every endpoint follows.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Invoice API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.newinvoice.dev/concepts/conventions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://invoiceapi.mintlify.site/_mintlify/api/og/v2?division=Concepts\u0026amp;title=Conventions\u0026amp;description=Auth%2C+test+vs+live%2C+money%2C+pagination%2C+idempotency%2C+metadata%2C+versioning%2C+rate+limits%2C+and+Request-Id+%E2%80%94+the+rules+every+endpoint+follows.\u0026amp;theme=55d6e0c1f80b6a9d3c7b0ddc\u0026amp;signature=bc903126e1b1bd374b0a1c01be2382ae018677c0bbdf764a53f0140971f83bd3\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Conventions - Invoice API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Auth, test vs live, money, pagination, idempotency, metadata, versioning, rate limits, and Request-Id — the rules every endpoint follows.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://invoiceapi.mintlify.site/_mintlify/api/og/v2?division=Concepts\u0026amp;title=Conventions\u0026amp;description=Auth%2C+test+vs+live%2C+money%2C+pagination%2C+idempotency%2C+metadata%2C+versioning%2C+rate+limits%2C+and+Request-Id+%E2%80%94+the+rules+every+endpoint+follows.\u0026amp;theme=55d6e0c1f80b6a9d3c7b0ddc\u0026amp;signature=bc903126e1b1bd374b0a1c01be2382ae018677c0bbdf764a53f0140971f83bd3\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/invoiceapi/BFU6Hg8PMnpYZfzc/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Invoice API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#16a34a\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.newinvoice.dev/concepts/conventions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/concepts/conventions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.newinvoice.dev/#organization\",\"name\":\"Invoice API\",\"url\":\"https://docs.newinvoice.dev\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.newinvoice.dev#website\",\"name\":\"Invoice API\",\"url\":\"https://docs.newinvoice.dev\",\"publisher\":{\"@id\":\"https://docs.newinvoice.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.newinvoice.dev/concepts/conventions#webpage\",\"url\":\"https://docs.newinvoice.dev/concepts/conventions\",\"name\":\"Conventions\",\"description\":\"Auth, test vs live, money, pagination, idempotency, metadata, versioning, rate limits, and Request-Id — the rules every endpoint follows.\",\"dateModified\":\"2026-07-11T02:50:47.022Z\",\"isPartOf\":{\"@id\":\"https://docs.newinvoice.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.newinvoice.dev/concepts/conventions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.newinvoice.dev/concepts/conventions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Invoice API\",\"item\":\"https://docs.newinvoice.dev\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Conventions\",\"item\":\"https://docs.newinvoice.dev/concepts/conventions\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.newinvoice.dev/concepts/conventions#article\",\"headline\":\"Conventions\",\"name\":\"Conventions\",\"description\":\"Auth, test vs live, money, pagination, idempotency, metadata, versioning, rate limits, and Request-Id — the rules every endpoint follows.\",\"url\":\"https://docs.newinvoice.dev/concepts/conventions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.newinvoice.dev/concepts/conventions#webpage\"},\"dateModified\":\"2026-07-11T02:50:47.022Z\",\"publisher\":{\"@id\":\"https://docs.newinvoice.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.newinvoice.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Invoice API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Invoice API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/concepts/conventions.md","siteName":"Invoice API","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Get started","pages":[{"title":"Invoice API","icon":"house","href":""},{"title":"Quickstart","icon":"bolt","href":"/quickstart"}]},{"group":"Guides","pages":[{"title":"Stamping your first invoice","icon":"file-invoice","href":"/guides/stamping-your-first-invoice"},{"title":"Cancellation","icon":"ban","href":"/guides/cancellation"},{"title":"SAT sync — every CFDI the SAT has on file","icon":"arrows-rotate","href":"/guides/sat-sync"},{"title":"SAT credentials — access with the taxpayer's RFC and CIEC","icon":"key","href":"/guides/sat-credentials"},{"title":"Constancia de situación fiscal","icon":"file-certificate","href":"/guides/constancia"},{"title":"Massive download","icon":"cloud-arrow-down","href":"/guides/massive-download"},{"title":"Webhooks","icon":"webhook","href":"/guides/webhooks"},{"title":"Connect — one platform, many tenants","icon":"diagram-project","href":"/guides/connect"},{"title":"API keys","icon":"key","href":"/guides/api-keys"},{"title":"Testing","icon":"flask","href":"/guides/testing"},{"title":"Going live","icon":"rocket","href":"/guides/going-live"},{"title":"SAT catalogs","description":"Look up the exact coded values the SAT requires — payment forms, payment methods, uso CFDI, tax regimes, and more — instead of guessing four-digit enums.","icon":"list","href":"/guides/catalogs"}]},{"group":"Concepts","pages":[{"title":"Conventions","icon":"book","href":"/concepts/conventions"},{"title":"Versioning \u0026 changelog","description":"Dated API versions, what changed in each, how to pin one, and the deprecation policy.","icon":"code-branch","href":"/concepts/versioning"},{"title":"Error reference","icon":"triangle-exclamation","href":"/concepts/errors"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/get-"}]}]},"basePath":"","title":"Conventions - Invoice API","buildId":"dpl_596ePT575z4qnAFksq1biRW97aLY","deploymentId":"dpl_596ePT575z4qnAFksq1biRW97aLY","dynamics":[],"chunks":[]}