Mx Build Pago
mx__build_pagoGenerate a well-formed, unsealed CFDI 4.0 payment complement (Pagos 2.0) by combining fixed concept fields with pagos data, ready for sealing.
Instructions
Build a well-formed, unsealed Complemento de Pagos 2.0 CFDI.
Composes the fixed single-Concepto wrapper SAT's Guía de llenado de
pagos mandates for a Pago-type Comprobante (ClaveProdServ,
ClaveUnidad, Descripcion, ValorUnitario, Importe, ObjetoImp are
all fixed conventional values — see this module's docstring constants)
with the Pagos20 complement built from pagos_data, and attaches the
complement under cfdi:Complemento.
buyer.uso_cfdi is forced to "CP01" (the schema requires it for every
Pagos CFDI per the same guide, regardless of what the caller passes) —
mirrors how this tool already forces SubTotal/Moneda/etc.
The output XML omits Sello/NoCertificado/Certificado, same as
mx__build_cfdi — seal afterward with mx__seal_cfdi.
Returns a dict with:
xml: the generated, unsealed CFDI XML string (with the Pagos complement attached)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pagos_data | Yes | Fields matching the Pagos20 schema | |
| comprobante_data | Yes | Fields matching CFDIComprobante, minus SubTotal/Moneda/FormaPago/MetodoPago/CondicionesDePago/lines/TipoDeComprobante — all fixed or derived for a Pagos CFDI, do not supply them |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||