{"openapi":"3.1.0","info":{"title":"Mexico CFDI 4.0 Pre-check API","version":"0.1.0","description":"Checks a draft CFDI 4.0 (JSON or XML) before it goes to a PAC for stamping, using only rules that appear in SAT's published cfdv40.xsd, tdCFDI.xsd and catCFDI.xsd: required attributes and children, value shapes (RFC, amounts, dates, postal codes), the verified code lists, the conditional rules written in the schema's own documentation (TipoCambio, Descuento, tax amounts) and the arithmetic...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://mx-cfdi-precheck.connectorbay.com/mcp.\n\nDisclaimer: General information only, not legal, tax, accounting or payment advice. Mexico CFDI 4.0 Pre-check is an independent tool: it is not affiliated with, endorsed by or operated by any government body, central bank, standards body or scheme operator. Rates, thresholds and rules change; check the cited official source and confirm with a qualified professional before you rely on a result.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/mx-cfdi-precheck/docs"},"termsOfService":"https://connectorbay.com/mx-cfdi-precheck/terms"},"servers":[{"url":"https://mx-cfdi-precheck.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/mx-cfdi-precheck/docs"},"security":[{},{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/validate_cfdi_draft":{"post":{"operationId":"validate_cfdi_draft","summary":"Check a draft CFDI 4.0 (JSON object or XML text) against the SAT schema rules and return a fix list with the rule behind","description":"Check a draft CFDI 4.0 (JSON object or XML text) against the SAT schema rules and return a fix list with the rule behind each finding. Use for \"Before I send this invoice to my PAC, does it have every field CFDI 4.0 requires?\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"draft":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"default":null,"description":"Draft as a JSON object: Comprobante attributes at the top level plus Emisor, Receptor, Conceptos (list; each may hold Impuestos with Traslados/Retenciones lists) and optional Impuestos, InformacionGlobal. Amounts as quoted decimal strings. Give this or xml. Each text at most 2,000 characters.","title":"Draft"},"xml":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Draft as CFDI 4.0 XML text (root Comprobante). DOCTYPE and entity declarations are refused. Give this or draft. At most 2,000,000 characters.","title":"Xml"},"stage":{"default":"unsigned_draft","description":"unsigned_draft (Sello, NoCertificado, Certificado may still be missing: info) or signed_for_stamping (they are required: errors). At most 30 characters.","title":"Stage","type":"string"},"currency_decimals":{"default":2,"description":"Decimals of the invoice currency for the rounding tolerance of the arithmetic checks (2 for MXN and USD)","maximum":6,"minimum":0,"title":"Currency Decimals","type":"integer"}},"title":"validate_cfdi_draftArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/check_cfdi_totals":{"post":{"operationId":"check_cfdi_totals","summary":"Recompute line amounts, tax amounts, SubTotal, Descuento and Total from concept lines with exact decimals and compare th","description":"Recompute line amounts, tax amounts, SubTotal, Descuento and Total from concept lines with exact decimals and compare them with the declared figures. Use for \"My lines are 2 x 100.00 with 16% VAT: are SubTotal, IVA and Total right?\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"concepts":{"description":"Concept lines as objects with CFDI attribute names: Cantidad, ValorUnitario, optional Importe and Descuento, optional Impuestos {Traslados: [...], Retenciones: [...]} with Base, Impuesto, TipoFactor, TasaOCuota and optional Importe. Amounts as quoted decimal strings. At most 5,000 items.","items":{"additionalProperties":true,"type":"object"},"title":"Concepts","type":"array"},"declared":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"default":null,"description":"Figures printed on the invoice to compare: SubTotal, Descuento, Total, TotalImpuestosTrasladados, TotalImpuestosRetenidos (quoted decimal strings)","title":"Declared"},"currency_decimals":{"default":2,"description":"Decimals of the invoice currency (2 for MXN and USD); tax amounts are rounded half up to this many decimals","maximum":6,"minimum":0,"title":"Currency Decimals","type":"integer"}},"required":["concepts"],"title":"check_cfdi_totalsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/validate_rfc_structure":{"post":{"operationId":"validate_rfc_structure","summary":"Check that an RFC has the shape SAT's schema (t_RFC) allows: 12 or 13 characters, letters, a YYMMDD date part and a fina","description":"Check that an RFC has the shape SAT's schema (t_RFC) allows: 12 or 13 characters, letters, a YYMMDD date part and a final digit or A; structure only, no registry lookup. Use for \"Is this RFC written in a valid shape for a company or for an individual?\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"rfc":{"description":"RFC to check, as printed on the invoice or constancia (uppercase letters, 12 or 13 characters). At most 50 characters.","title":"Rfc","type":"string"}},"required":["rfc"],"title":"validate_rfc_structureArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_required_fields":{"post":{"operationId":"list_required_fields","summary":"List the attributes of a CFDI 4.0 element with required, optional or conditional status and the value constraints writte","description":"List the attributes of a CFDI 4.0 element with required, optional or conditional status and the value constraints written in SAT's schema. Use for \"Which attributes does the Receptor node need in CFDI 4.0?\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"element":{"default":"all","description":"comprobante, emisor, receptor, concepto, concepto_traslado, concepto_retencion, impuestos, traslado, retencion, informacion_global, cfdi_relacionados, cfdi_relacionado or all. At most 50 characters.","title":"Element","type":"string"}},"title":"list_required_fieldsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/explain_cfdi_field":{"post":{"operationId":"explain_cfdi_field","summary":"Explain one CFDI 4.0 field in plain language, quoting SAT's own schema documentation where the tool could read it and sa","description":"Explain one CFDI 4.0 field in plain language, quoting SAT's own schema documentation where the tool could read it and saying where the allowed values come from. Use for \"Why is TipoCambio required on my dollar invoice?\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"field":{"description":"Field as Element.Attribute or just the attribute name, for example Comprobante.TipoCambio, Receptor.UsoCFDI or SubTotal. At most 100 characters.","title":"Field","type":"string"}},"required":["field"],"title":"explain_cfdi_fieldArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_catalog_codes":{"post":{"operationId":"list_catalog_codes","summary":"List the code values SAT's catalogue schema enumerates for Exportacion, TipoDeComprobante, MetodoPago and FormaPago, and","description":"List the code values SAT's catalogue schema enumerates for Exportacion, TipoDeComprobante, MetodoPago and FormaPago, and say which catalogues are not covered. Use for \"Which payment-form codes does the CFDI 4.0 schema accept?\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"catalog":{"description":"exportacion, tipo_de_comprobante, metodo_pago or forma_pago. At most 50 characters.","title":"Catalog","type":"string"}},"required":["catalog"],"title":"list_catalog_codesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}