---
title: "Crear borrador de factura"
description: "Crea un borrador de CFDI y deriva los impuestos canónicos de sus partidas. En cada pago parcial, incrementa installment, usa el saldo insoluto anterior como previousBalance y usa taxes: \"auto\" cuando Exac conoce el CFDI relacionado; de lo contrario proporciona su taxObject y los impuestos del pago."
language: es-MX
canonical_url: "https://exac.mx/docs/api/documents/invoices/create-invoice-draft"
md_url: "https://exac.mx/docs/api/documents/invoices/create-invoice-draft.md"
---

# Crear borrador de factura

Crea un borrador de CFDI y deriva los impuestos canónicos de sus partidas. En cada pago parcial, incrementa installment, usa el saldo insoluto anterior como previousBalance y usa taxes: "auto" cuando Exac conoce el CFDI relacionado; de lo contrario proporciona su taxObject y los impuestos del pago.

## Solicitud

`POST /v1/invoices`

- **Autorización:** Permiso requerido: `invoices:manage`.

- **Entornos:** Producción y prueba

- **Idempotencia:** Requerida

## Contrato canónico para máquinas

Este fragmento se genera desde la operación canónica y los contratos Zod que utiliza la ruta.

```json
{
  "method": "POST",
  "path": "/v1/invoices",
  "operation": {
    "operationId": "createInvoiceDraft",
    "tags": [
      "Invoices"
    ],
    "summary": "Crear borrador de factura",
    "description": "Crea un borrador de CFDI y deriva los impuestos canónicos de sus partidas. En cada pago parcial, incrementa installment, usa el saldo insoluto anterior como previousBalance y usa taxes: \"auto\" cuando Exac conoce el CFDI relacionado; de lo contrario proporciona su taxObject y los impuestos del pago.",
    "security": [
      {
        "bearerAuth": []
      }
    ],
    "parameters": [
      {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "description": "Clave estable para reintentar exactamente la misma solicitud sin duplicar efectos."
      }
    ],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/InvoiceDraftInput"
          },
          "example": {
            "customerId": "customer-example",
            "items": [
              {
                "kind": "custom",
                "description": "Consultoría administrativa · julio 2026",
                "quantity": 1,
                "unitPrice": 10000,
                "satProductCode": "84111506",
                "satUnitCode": "E48",
                "taxRate": 0.16,
                "taxability": "standard"
              }
            ],
            "kind": "income",
            "cfdiUse": "G03",
            "payment": {
              "timing": "deferred_or_installments",
              "formCode": "99",
              "conditions": "Crédito a 30 días"
            }
          },
          "examples": {
            "incomeProduct": {
              "summary": "Income CFDI with a stored product",
              "value": {
                "customerId": "customer-example",
                "items": [
                  {
                    "kind": "product",
                    "productId": "product-example",
                    "quantity": 1,
                    "unitPrice": 100
                  }
                ],
                "kind": "income",
                "cfdiUse": "S01",
                "payment": {
                  "timing": "single_payment",
                  "formCode": "03"
                }
              }
            },
            "incomeCustom": {
              "summary": "Income CFDI with a custom line",
              "value": {
                "customerId": "customer-example",
                "items": [
                  {
                    "kind": "custom",
                    "description": "Consultoría administrativa · julio 2026",
                    "quantity": 1,
                    "unitPrice": 10000,
                    "satProductCode": "84111506",
                    "satUnitCode": "E48",
                    "taxRate": 0.16,
                    "taxability": "standard"
                  }
                ],
                "kind": "income",
                "cfdiUse": "G03",
                "payment": {
                  "timing": "deferred_or_installments",
                  "formCode": "99",
                  "conditions": "Crédito a 30 días"
                }
              }
            },
            "creditNote": {
              "summary": "Credit-note CFDI",
              "value": {
                "customerId": "customer-example",
                "items": [
                  {
                    "kind": "product",
                    "productId": "product-example",
                    "quantity": 1,
                    "unitPrice": 100
                  }
                ],
                "kind": "credit_note",
                "formCode": "03",
                "relatedDocuments": [
                  {
                    "relationship": "01",
                    "documents": [
                      "00000000-0000-4000-8000-000000000001"
                    ]
                  }
                ]
              }
            },
            "transfer": {
              "summary": "Transfer CFDI",
              "value": {
                "customerId": "customer-example",
                "items": [
                  {
                    "kind": "product",
                    "productId": "product-example",
                    "quantity": 1,
                    "unitPrice": 0
                  }
                ],
                "kind": "transfer"
              }
            },
            "payroll": {
              "summary": "Payroll CFDI",
              "value": {
                "kind": "payroll",
                "employeeId": "employee-example",
                "payroll": {
                  "type": "O",
                  "paidOn": "2026-07-15",
                  "periodStartedOn": "2026-07-01",
                  "periodEndedOn": "2026-07-15",
                  "paidDays": 15,
                  "employee": {
                    "curp": "GODE561231HDFRRN09",
                    "employeeNumber": "E-100",
                    "socialSecurityNumber": "12345678901",
                    "employmentStartedOn": "2025-01-01",
                    "contractType": "01",
                    "regimeType": "02",
                    "paymentFrequency": "04",
                    "stateCode": "CMX",
                    "positionRisk": "1",
                    "integratedDailySalary": 250
                  },
                  "earnings": [
                    {
                      "code": "SAL-001",
                      "type": "001",
                      "taxableAmount": 1000,
                      "exemptAmount": 0
                    }
                  ],
                  "otherPayments": [
                    {
                      "code": "SUB-001",
                      "type": "002",
                      "amount": 0,
                      "employmentSubsidy": 0
                    }
                  ]
                }
              }
            },
            "paymentComplement": {
              "summary": "Payment complement · automatic taxes",
              "value": {
                "kind": "payment_complement",
                "customerId": "customer-example",
                "payments": [
                  {
                    "formCode": "03",
                    "paidLocalDateTime": "2026-07-15T12:00:00",
                    "documents": [
                      {
                        "uuid": "00000000-0000-4000-8000-000000000001",
                        "amount": 11600,
                        "installment": 1,
                        "previousBalance": 11600,
                        "taxes": "auto"
                      }
                    ]
                  }
                ]
              }
            },
            "paymentComplementExternal": {
              "summary": "Payment complement · external CFDI taxes",
              "value": {
                "kind": "payment_complement",
                "customerId": "customer-example",
                "payments": [
                  {
                    "formCode": "03",
                    "paidLocalDateTime": "2026-07-15T12:00:00",
                    "documents": [
                      {
                        "uuid": "00000000-0000-4000-8000-000000000002",
                        "amount": 104.08,
                        "installment": 1,
                        "previousBalance": 104.08,
                        "taxes": {
                          "taxObject": "02",
                          "entries": [
                            {
                              "base": 100,
                              "type": "IVA",
                              "rate": 0.16,
                              "factor": "Tasa"
                            },
                            {
                              "base": 100,
                              "type": "ISR",
                              "rate": 0.0125,
                              "factor": "Tasa",
                              "withholding": true
                            },
                            {
                              "base": 100,
                              "type": "IVA",
                              "rate": 0.106667,
                              "factor": "Tasa",
                              "withholding": true
                            }
                          ]
                        }
                      }
                    ]
                  }
                ]
              }
            }
          }
        }
      }
    },
    "responses": {
      "201": {
        "description": "Operación completada.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "data": {
                  "$ref": "#/components/schemas/InvoiceDetail"
                }
              },
              "required": [
                "data"
              ],
              "additionalProperties": false
            },
            "example": {
              "data": {
                "direction": "issued",
                "status": "draft",
                "archived": false,
                "counterpartyName": "Estudio Jacaranda",
                "total": {
                  "amount": 11600,
                  "currency": "MXN"
                },
                "documentRef": "invoice:invoice-example",
                "category": "invoice",
                "issuedLocalDateTime": "2026-07-15T12:00:00",
                "fiscal": {
                  "subtotal": 10000,
                  "ivaTransferred": 1600,
                  "totalMxn": 11600,
                  "placeOfIssue": "82110",
                  "exportation": "01",
                  "cfdiUse": "G03"
                },
                "kind": "income",
                "cfdiType": "I",
                "issuer": {
                  "rfc": "EKU9003173C9",
                  "legalName": "Consultoría Bruma SA de CV",
                  "taxSystem": "601"
                },
                "receiver": {
                  "rfc": "AAA010101AAA",
                  "legalName": "Estudio Jacaranda",
                  "taxSystem": "601",
                  "postalCode": "82110",
                  "cfdiUse": "G03"
                },
                "items": [
                  {
                    "description": "Consultoría administrativa · julio 2026",
                    "quantity": 1,
                    "unitPrice": 10000,
                    "satProductCode": "84111506",
                    "satUnitCode": "E48"
                  }
                ],
                "payment": {
                  "timing": "deferred_or_installments",
                  "formCode": "99",
                  "methodCode": "PPD",
                  "remainingBalance": 11600,
                  "conditions": "Crédito a 30 días"
                },
                "detail": {
                  "availability": "complete"
                }
              }
            }
          }
        }
      },
      "400": {
        "description": "Solicitud inválida.\n\n`validation_error`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "401": {
        "description": "Credencial inválida o ausente.\n\n`unauthenticated`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "WWW-Authenticate": {
            "$ref": "#/components/headers/WWWAuthenticate"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "403": {
        "description": "La credencial no incluye el permiso `invoices:manage`.\n\n`forbidden`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "WWW-Authenticate": {
            "$ref": "#/components/headers/WWWAuthenticate"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "404": {
        "description": "Recurso no encontrado.\n\n`not_found`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "405": {
        "description": "Método no permitido.\n\n`method_not_allowed`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "Allow": {
            "$ref": "#/components/headers/Allow"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "409": {
        "description": "La operación entra en conflicto con su estado actual o con la clave de idempotencia.\n\nCódigos posibles: `conflict`, `idempotency_conflict`, `operation_in_progress`, `recovery_required`, `migration_required`.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "429": {
        "description": "Demasiadas solicitudes.\n\n`rate_limited`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "500": {
        "description": "Error interno del servidor.\n\n`internal`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      },
      "503": {
        "description": "Servicio temporalmente no disponible.\n\n`provider_unavailable`",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      }
    },
    "x-exac-environments": [
      "production",
      "sandbox"
    ]
  },
  "components": {
    "schemas": {
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ProgrammaticError"
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "ProgrammaticError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "validation_error",
              "unauthenticated",
              "forbidden",
              "payment_required",
              "not_found",
              "method_not_allowed",
              "conflict",
              "idempotency_conflict",
              "operation_in_progress",
              "recovery_required",
              "migration_required",
              "rate_limited",
              "provider_unavailable",
              "internal"
            ],
            "description": "Acción recomendada por código:\n\n- `validation_error` — Corrige cada elemento de details.issues usando su path y código estable.\n- `unauthenticated` — Proporciona una API key o un token de acceso OAuth válido.\n- `forbidden` — Usa una credencial con el permiso requerido.\n- `payment_required` — Revisa el plan del RFC, el método de pago y el límite de gasto en facturación. Reintenta solo después de resolver el requisito de pago.\n- `not_found` — Verifica el identificador del recurso dentro de la organización.\n- `method_not_allowed` — Usa el método HTTP documentado.\n- `conflict` — Actualiza el recurso y resuelve su estado actual.\n- `idempotency_conflict` — Usa otra clave de idempotencia para una solicitud modificada.\n- `operation_in_progress` — Espera el tiempo de Retry-After y repite la misma solicitud.\n- `recovery_required` — No reintentes automáticamente; reconcilia el resultado del proveedor.\n- `migration_required` — Contacta a soporte para completar la migración histórica; no vuelvas a emitir el documento.\n- `rate_limited` — Espera el tiempo de Retry-After antes de reintentar.\n- `provider_unavailable` — Reintenta solo cuando la respuesta marque la falla como reintentable.\n- `internal` — Reintenta después y contacta a soporte si el error persiste."
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "properties": {
              "document": {
                "type": "object",
                "properties": {
                  "documentRef": {
                    "$ref": "#/components/schemas/DocumentRef"
                  },
                  "editable": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "documentRef",
                  "editable"
                ],
                "additionalProperties": false
              },
              "issues": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      }
                    },
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "path",
                    "message"
                  ],
                  "additionalProperties": false
                }
              },
              "retryable": {
                "type": "boolean"
              },
              "retryAfterSeconds": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "reason": {
                "type": "string"
              },
              "balanceMinor": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "topUpUrl": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "status": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "code",
          "message",
          "status"
        ],
        "additionalProperties": false
      },
      "DocumentRef": {
        "type": "string",
        "pattern": "^(invoice|withholding|sales_receipt|declaration|tax_compliance_opinion|sales_receipt_refund):.+$"
      },
      "InvoiceDetail": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/InvoiceIncomeComplete"
          },
          {
            "$ref": "#/components/schemas/InvoiceIncomePartial"
          },
          {
            "$ref": "#/components/schemas/InvoiceCreditNoteComplete"
          },
          {
            "$ref": "#/components/schemas/InvoiceCreditNotePartial"
          },
          {
            "$ref": "#/components/schemas/InvoiceTransferComplete"
          },
          {
            "$ref": "#/components/schemas/InvoiceTransferPartial"
          },
          {
            "$ref": "#/components/schemas/InvoicePayrollComplete"
          },
          {
            "$ref": "#/components/schemas/InvoicePayrollPartial"
          },
          {
            "$ref": "#/components/schemas/InvoicePaymentComplementComplete"
          },
          {
            "$ref": "#/components/schemas/InvoicePaymentComplementPartial"
          }
        ]
      },
      "InvoicePaymentComplementPartial": {
        "type": "object",
        "properties": {
          "cancellationReceiptFormats": {
            "description": "Supported cancellation receipt download formats. Empty for documents without this capability; availability at the provider may still be pending.",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "xml",
                "pdf"
              ]
            }
          },
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "simulated": {
            "description": "Non-fiscal sandbox simulation; the UUID is a local test identifier, not a SAT certification.",
            "type": "boolean",
            "const": true
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "payableArchived": {
            "type": "boolean"
          },
          "receivableArchived": {
            "type": "boolean"
          },
          "settlementTerms": {
            "type": "object",
            "properties": {
              "installmentCount": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60
              },
              "firstDue": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "transaction_date"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "months_after_transaction"
                      },
                      "months": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      }
                    },
                    "required": [
                      "kind",
                      "months"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "fixed_date"
                      },
                      "date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "date"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "recurrence": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "anchor_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "day_of_month"
                      },
                      "day": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      }
                    },
                    "required": [
                      "kind",
                      "day"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "last_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "installmentCount",
              "firstDue",
              "recurrence"
            ],
            "additionalProperties": false
          },
          "documentRef": {
            "type": "string",
            "pattern": "^invoice:.+$"
          },
          "category": {
            "type": "string",
            "const": "invoice"
          },
          "issuedLocalDateTime": {
            "type": "string",
            "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
          },
          "inventoryImpact": {
            "type": "object",
            "properties": {
              "locationId": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "deducted",
                  "reversed"
                ]
              },
              "appliedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "reversedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "stockShortage": {
                "type": "boolean"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          },
          "customerId": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "folio": {
            "type": "string"
          },
          "fiscal": {
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "number"
              },
              "ivaTransferred": {
                "type": "number"
              },
              "ivaWithheld": {
                "type": "number"
              },
              "isrWithheld": {
                "type": "number"
              },
              "exchangeRate": {
                "type": "number"
              },
              "totalMxn": {
                "type": "number"
              },
              "placeOfIssue": {
                "type": "string"
              },
              "exportation": {
                "type": "string"
              },
              "draftIssueDate": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "description": "Configured draft issue instant, separate from stamped local issue time."
              },
              "taxes": {
                "type": "object",
                "properties": {
                  "transfers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "withholdings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "transfers",
                  "withholdings"
                ],
                "additionalProperties": false
              },
              "globalInformation": {
                "type": "object",
                "properties": {
                  "frequency": {
                    "type": "string"
                  },
                  "months": {
                    "type": "string"
                  },
                  "year": {
                    "type": "number"
                  }
                },
                "required": [
                  "frequency",
                  "months",
                  "year"
                ],
                "additionalProperties": false
              },
              "cfdiUse": {
                "type": "string"
              },
              "stampedLocalDateTime": {
                "type": "string",
                "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
              }
            },
            "additionalProperties": false
          },
          "relatedDocuments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "relationshipType": {
                  "type": "string"
                },
                "uuids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "relationshipType",
                "uuids"
              ],
              "additionalProperties": false
            }
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number"
                },
                "unitPrice": {
                  "type": "number"
                },
                "discount": {
                  "type": "number"
                },
                "unitName": {
                  "type": "string"
                },
                "taxObject": {
                  "type": "string"
                },
                "taxes": {
                  "type": "object",
                  "properties": {
                    "transfers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "withholdings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "transfers",
                    "withholdings"
                  ],
                  "additionalProperties": false
                },
                "satProductCode": {
                  "type": "string"
                },
                "satUnitCode": {
                  "type": "string"
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPrice"
              ],
              "additionalProperties": false
            }
          },
          "kind": {
            "type": "string",
            "const": "payment_complement"
          },
          "cfdiType": {
            "type": "string",
            "const": "P"
          },
          "issuer": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "receiver": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "paymentComplement": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string"
              },
              "totalPayments": {
                "type": "number"
              },
              "payments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    },
                    "exchangeRate": {
                      "description": "MXN per payment currency unit.",
                      "type": "number"
                    },
                    "relatedCfdis": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "uuid": {
                            "type": "string"
                          },
                          "series": {
                            "type": "string"
                          },
                          "folio": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "exchangeRate": {
                            "description": "Document currency units per payment currency unit.",
                            "type": "number"
                          },
                          "taxObject": {
                            "type": "string"
                          },
                          "installment": {
                            "type": "string"
                          },
                          "balances": {
                            "type": "object",
                            "properties": {
                              "previous": {
                                "type": "number"
                              },
                              "paid": {
                                "type": "number"
                              },
                              "remaining": {
                                "type": "number"
                              }
                            },
                            "additionalProperties": false
                          },
                          "taxes": {
                            "type": "object",
                            "properties": {
                              "transfers": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "tax": {
                                      "type": "string"
                                    },
                                    "factorType": {
                                      "type": "string"
                                    },
                                    "rateOrFee": {
                                      "type": "string"
                                    },
                                    "amount": {
                                      "type": "string"
                                    },
                                    "base": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "tax",
                                    "factorType"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "withholdings": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "tax": {
                                      "type": "string"
                                    },
                                    "factorType": {
                                      "type": "string"
                                    },
                                    "rateOrFee": {
                                      "type": "string"
                                    },
                                    "amount": {
                                      "type": "string"
                                    },
                                    "base": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "tax",
                                    "factorType"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "transfers",
                              "withholdings"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "uuid",
                          "currency"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "formCode": {
                      "type": "string"
                    },
                    "paidLocalDateTime": {
                      "type": "string",
                      "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
                    }
                  },
                  "required": [
                    "currency",
                    "amount",
                    "relatedCfdis",
                    "formCode",
                    "paidLocalDateTime"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "version",
              "totalPayments",
              "payments"
            ],
            "additionalProperties": false
          },
          "detail": {
            "type": "object",
            "properties": {
              "availability": {
                "type": "string",
                "const": "partial"
              },
              "missing": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "required": [
              "availability",
              "missing"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "direction",
          "status",
          "archived",
          "total",
          "documentRef",
          "category",
          "kind",
          "cfdiType",
          "detail"
        ],
        "additionalProperties": false
      },
      "Money": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "currency"
        ],
        "additionalProperties": false
      },
      "InvoicePaymentComplementComplete": {
        "type": "object",
        "properties": {
          "cancellationReceiptFormats": {
            "description": "Supported cancellation receipt download formats. Empty for documents without this capability; availability at the provider may still be pending.",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "xml",
                "pdf"
              ]
            }
          },
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "simulated": {
            "description": "Non-fiscal sandbox simulation; the UUID is a local test identifier, not a SAT certification.",
            "type": "boolean",
            "const": true
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "payableArchived": {
            "type": "boolean"
          },
          "receivableArchived": {
            "type": "boolean"
          },
          "settlementTerms": {
            "type": "object",
            "properties": {
              "installmentCount": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60
              },
              "firstDue": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "transaction_date"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "months_after_transaction"
                      },
                      "months": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      }
                    },
                    "required": [
                      "kind",
                      "months"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "fixed_date"
                      },
                      "date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "date"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "recurrence": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "anchor_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "day_of_month"
                      },
                      "day": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      }
                    },
                    "required": [
                      "kind",
                      "day"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "last_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "installmentCount",
              "firstDue",
              "recurrence"
            ],
            "additionalProperties": false
          },
          "documentRef": {
            "type": "string",
            "pattern": "^invoice:.+$"
          },
          "category": {
            "type": "string",
            "const": "invoice"
          },
          "issuedLocalDateTime": {
            "type": "string",
            "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
          },
          "inventoryImpact": {
            "type": "object",
            "properties": {
              "locationId": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "deducted",
                  "reversed"
                ]
              },
              "appliedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "reversedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "stockShortage": {
                "type": "boolean"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          },
          "customerId": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "folio": {
            "type": "string"
          },
          "fiscal": {
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "number"
              },
              "ivaTransferred": {
                "type": "number"
              },
              "ivaWithheld": {
                "type": "number"
              },
              "isrWithheld": {
                "type": "number"
              },
              "exchangeRate": {
                "type": "number"
              },
              "totalMxn": {
                "type": "number"
              },
              "placeOfIssue": {
                "type": "string"
              },
              "exportation": {
                "type": "string"
              },
              "draftIssueDate": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "description": "Configured draft issue instant, separate from stamped local issue time."
              },
              "taxes": {
                "type": "object",
                "properties": {
                  "transfers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "withholdings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "transfers",
                  "withholdings"
                ],
                "additionalProperties": false
              },
              "globalInformation": {
                "type": "object",
                "properties": {
                  "frequency": {
                    "type": "string"
                  },
                  "months": {
                    "type": "string"
                  },
                  "year": {
                    "type": "number"
                  }
                },
                "required": [
                  "frequency",
                  "months",
                  "year"
                ],
                "additionalProperties": false
              },
              "cfdiUse": {
                "type": "string"
              },
              "stampedLocalDateTime": {
                "type": "string",
                "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
              }
            },
            "additionalProperties": false
          },
          "relatedDocuments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "relationshipType": {
                  "type": "string"
                },
                "uuids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "relationshipType",
                "uuids"
              ],
              "additionalProperties": false
            }
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number"
                },
                "unitPrice": {
                  "type": "number"
                },
                "discount": {
                  "type": "number"
                },
                "unitName": {
                  "type": "string"
                },
                "taxObject": {
                  "type": "string"
                },
                "taxes": {
                  "type": "object",
                  "properties": {
                    "transfers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "withholdings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "transfers",
                    "withholdings"
                  ],
                  "additionalProperties": false
                },
                "satProductCode": {
                  "type": "string"
                },
                "satUnitCode": {
                  "type": "string"
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPrice"
              ],
              "additionalProperties": false
            }
          },
          "kind": {
            "type": "string",
            "const": "payment_complement"
          },
          "cfdiType": {
            "type": "string",
            "const": "P"
          },
          "issuer": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "receiver": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "paymentComplement": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string"
              },
              "totalPayments": {
                "type": "number"
              },
              "payments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    },
                    "exchangeRate": {
                      "description": "MXN per payment currency unit.",
                      "type": "number"
                    },
                    "relatedCfdis": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "uuid": {
                            "type": "string"
                          },
                          "series": {
                            "type": "string"
                          },
                          "folio": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "exchangeRate": {
                            "description": "Document currency units per payment currency unit.",
                            "type": "number"
                          },
                          "taxObject": {
                            "type": "string"
                          },
                          "installment": {
                            "type": "string"
                          },
                          "balances": {
                            "type": "object",
                            "properties": {
                              "previous": {
                                "type": "number"
                              },
                              "paid": {
                                "type": "number"
                              },
                              "remaining": {
                                "type": "number"
                              }
                            },
                            "additionalProperties": false
                          },
                          "taxes": {
                            "type": "object",
                            "properties": {
                              "transfers": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "tax": {
                                      "type": "string"
                                    },
                                    "factorType": {
                                      "type": "string"
                                    },
                                    "rateOrFee": {
                                      "type": "string"
                                    },
                                    "amount": {
                                      "type": "string"
                                    },
                                    "base": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "tax",
                                    "factorType"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "withholdings": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "tax": {
                                      "type": "string"
                                    },
                                    "factorType": {
                                      "type": "string"
                                    },
                                    "rateOrFee": {
                                      "type": "string"
                                    },
                                    "amount": {
                                      "type": "string"
                                    },
                                    "base": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "tax",
                                    "factorType"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "transfers",
                              "withholdings"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "uuid",
                          "currency"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "formCode": {
                      "type": "string"
                    },
                    "paidLocalDateTime": {
                      "type": "string",
                      "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
                    }
                  },
                  "required": [
                    "currency",
                    "amount",
                    "relatedCfdis",
                    "formCode",
                    "paidLocalDateTime"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "version",
              "totalPayments",
              "payments"
            ],
            "additionalProperties": false
          },
          "detail": {
            "type": "object",
            "properties": {
              "availability": {
                "type": "string",
                "const": "complete"
              }
            },
            "required": [
              "availability"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "direction",
          "status",
          "archived",
          "total",
          "documentRef",
          "category",
          "kind",
          "cfdiType",
          "issuer",
          "receiver",
          "paymentComplement",
          "detail"
        ],
        "additionalProperties": false
      },
      "InvoicePayrollPartial": {
        "type": "object",
        "properties": {
          "cancellationReceiptFormats": {
            "description": "Supported cancellation receipt download formats. Empty for documents without this capability; availability at the provider may still be pending.",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "xml",
                "pdf"
              ]
            }
          },
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "simulated": {
            "description": "Non-fiscal sandbox simulation; the UUID is a local test identifier, not a SAT certification.",
            "type": "boolean",
            "const": true
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "payableArchived": {
            "type": "boolean"
          },
          "receivableArchived": {
            "type": "boolean"
          },
          "settlementTerms": {
            "type": "object",
            "properties": {
              "installmentCount": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60
              },
              "firstDue": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "transaction_date"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "months_after_transaction"
                      },
                      "months": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      }
                    },
                    "required": [
                      "kind",
                      "months"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "fixed_date"
                      },
                      "date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "date"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "recurrence": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "anchor_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "day_of_month"
                      },
                      "day": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      }
                    },
                    "required": [
                      "kind",
                      "day"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "last_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "installmentCount",
              "firstDue",
              "recurrence"
            ],
            "additionalProperties": false
          },
          "documentRef": {
            "type": "string",
            "pattern": "^invoice:.+$"
          },
          "category": {
            "type": "string",
            "const": "invoice"
          },
          "issuedLocalDateTime": {
            "type": "string",
            "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
          },
          "inventoryImpact": {
            "type": "object",
            "properties": {
              "locationId": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "deducted",
                  "reversed"
                ]
              },
              "appliedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "reversedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "stockShortage": {
                "type": "boolean"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          },
          "customerId": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "folio": {
            "type": "string"
          },
          "fiscal": {
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "number"
              },
              "ivaTransferred": {
                "type": "number"
              },
              "ivaWithheld": {
                "type": "number"
              },
              "isrWithheld": {
                "type": "number"
              },
              "exchangeRate": {
                "type": "number"
              },
              "totalMxn": {
                "type": "number"
              },
              "placeOfIssue": {
                "type": "string"
              },
              "exportation": {
                "type": "string"
              },
              "draftIssueDate": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "description": "Configured draft issue instant, separate from stamped local issue time."
              },
              "taxes": {
                "type": "object",
                "properties": {
                  "transfers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "withholdings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "transfers",
                  "withholdings"
                ],
                "additionalProperties": false
              },
              "globalInformation": {
                "type": "object",
                "properties": {
                  "frequency": {
                    "type": "string"
                  },
                  "months": {
                    "type": "string"
                  },
                  "year": {
                    "type": "number"
                  }
                },
                "required": [
                  "frequency",
                  "months",
                  "year"
                ],
                "additionalProperties": false
              },
              "cfdiUse": {
                "type": "string"
              },
              "stampedLocalDateTime": {
                "type": "string",
                "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
              }
            },
            "additionalProperties": false
          },
          "relatedDocuments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "relationshipType": {
                  "type": "string"
                },
                "uuids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "relationshipType",
                "uuids"
              ],
              "additionalProperties": false
            }
          },
          "kind": {
            "type": "string",
            "const": "payroll"
          },
          "cfdiType": {
            "type": "string",
            "const": "N"
          },
          "employeeId": {
            "type": "string"
          },
          "issuer": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "receiver": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "payroll": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "paidDays": {
                "type": "number"
              },
              "earnings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "taxableAmount": {
                      "type": "number"
                    },
                    "exemptAmount": {
                      "type": "number"
                    },
                    "stock": {
                      "type": "object",
                      "properties": {
                        "marketValue": {
                          "type": "number"
                        },
                        "grantPrice": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "overtime": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "days": {
                            "type": "number"
                          },
                          "type": {
                            "type": "string"
                          },
                          "hours": {
                            "type": "number"
                          },
                          "amount": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "days",
                          "type",
                          "hours"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              },
              "incapacities": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "days": {
                      "type": "number"
                    },
                    "type": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "days",
                    "type"
                  ],
                  "additionalProperties": false
                }
              },
              "pension": {
                "type": "object",
                "properties": {
                  "singlePayment": {
                    "type": "number"
                  },
                  "installment": {
                    "type": "number"
                  },
                  "dailyAmount": {
                    "type": "number"
                  },
                  "accumulableIncome": {
                    "type": "number"
                  },
                  "nonAccumulableIncome": {
                    "type": "number"
                  }
                },
                "additionalProperties": false
              },
              "separation": {
                "type": "object",
                "properties": {
                  "totalPaid": {
                    "type": "number"
                  },
                  "serviceYears": {
                    "type": "number"
                  },
                  "lastMonthlySalary": {
                    "type": "number"
                  },
                  "accumulableIncome": {
                    "type": "number"
                  },
                  "nonAccumulableIncome": {
                    "type": "number"
                  }
                },
                "required": [
                  "serviceYears"
                ],
                "additionalProperties": false
              },
              "deductions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "otherPayments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    },
                    "employmentSubsidy": {
                      "type": "number"
                    },
                    "compensation": {
                      "type": "object",
                      "properties": {
                        "balance": {
                          "type": "number"
                        },
                        "year": {
                          "type": "number"
                        },
                        "remainingBalance": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "year"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              },
              "totals": {
                "type": "object",
                "properties": {
                  "earnings": {
                    "type": "number"
                  },
                  "deductions": {
                    "type": "number"
                  },
                  "otherPayments": {
                    "type": "number"
                  },
                  "net": {
                    "type": "number"
                  }
                },
                "additionalProperties": false
              },
              "employee": {
                "type": "object",
                "properties": {
                  "curp": {
                    "type": "string"
                  },
                  "employeeNumber": {
                    "type": "string"
                  },
                  "socialSecurityNumber": {
                    "type": "string"
                  },
                  "contractType": {
                    "type": "string"
                  },
                  "regimeType": {
                    "type": "string"
                  },
                  "paymentFrequency": {
                    "type": "string"
                  },
                  "stateCode": {
                    "type": "string"
                  },
                  "positionRisk": {
                    "type": "string"
                  },
                  "integratedDailySalary": {
                    "type": "number"
                  },
                  "contributionBaseSalary": {
                    "type": "number"
                  },
                  "department": {
                    "type": "string"
                  },
                  "position": {
                    "type": "string"
                  },
                  "workScheduleType": {
                    "type": "string"
                  },
                  "unionMember": {
                    "type": "string"
                  },
                  "bankCode": {
                    "type": "string"
                  },
                  "bankAccount": {
                    "type": "string"
                  },
                  "employmentStartedOn": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  }
                },
                "additionalProperties": false
              },
              "period": {
                "type": "object",
                "properties": {
                  "paidOn": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  },
                  "startedOn": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  },
                  "endedOn": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  }
                },
                "required": [
                  "paidOn"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "earnings",
              "deductions",
              "otherPayments",
              "totals",
              "employee",
              "period"
            ],
            "additionalProperties": false
          },
          "detail": {
            "type": "object",
            "properties": {
              "availability": {
                "type": "string",
                "const": "partial"
              },
              "missing": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "required": [
              "availability",
              "missing"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "direction",
          "status",
          "archived",
          "total",
          "documentRef",
          "category",
          "kind",
          "cfdiType",
          "detail"
        ],
        "additionalProperties": false
      },
      "InvoicePayrollComplete": {
        "type": "object",
        "properties": {
          "cancellationReceiptFormats": {
            "description": "Supported cancellation receipt download formats. Empty for documents without this capability; availability at the provider may still be pending.",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "xml",
                "pdf"
              ]
            }
          },
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "simulated": {
            "description": "Non-fiscal sandbox simulation; the UUID is a local test identifier, not a SAT certification.",
            "type": "boolean",
            "const": true
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "payableArchived": {
            "type": "boolean"
          },
          "receivableArchived": {
            "type": "boolean"
          },
          "settlementTerms": {
            "type": "object",
            "properties": {
              "installmentCount": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60
              },
              "firstDue": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "transaction_date"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "months_after_transaction"
                      },
                      "months": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      }
                    },
                    "required": [
                      "kind",
                      "months"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "fixed_date"
                      },
                      "date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "date"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "recurrence": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "anchor_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "day_of_month"
                      },
                      "day": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      }
                    },
                    "required": [
                      "kind",
                      "day"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "last_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "installmentCount",
              "firstDue",
              "recurrence"
            ],
            "additionalProperties": false
          },
          "documentRef": {
            "type": "string",
            "pattern": "^invoice:.+$"
          },
          "category": {
            "type": "string",
            "const": "invoice"
          },
          "issuedLocalDateTime": {
            "type": "string",
            "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
          },
          "inventoryImpact": {
            "type": "object",
            "properties": {
              "locationId": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "deducted",
                  "reversed"
                ]
              },
              "appliedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "reversedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "stockShortage": {
                "type": "boolean"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          },
          "customerId": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "folio": {
            "type": "string"
          },
          "fiscal": {
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "number"
              },
              "ivaTransferred": {
                "type": "number"
              },
              "ivaWithheld": {
                "type": "number"
              },
              "isrWithheld": {
                "type": "number"
              },
              "exchangeRate": {
                "type": "number"
              },
              "totalMxn": {
                "type": "number"
              },
              "placeOfIssue": {
                "type": "string"
              },
              "exportation": {
                "type": "string"
              },
              "draftIssueDate": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "description": "Configured draft issue instant, separate from stamped local issue time."
              },
              "taxes": {
                "type": "object",
                "properties": {
                  "transfers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "withholdings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "transfers",
                  "withholdings"
                ],
                "additionalProperties": false
              },
              "globalInformation": {
                "type": "object",
                "properties": {
                  "frequency": {
                    "type": "string"
                  },
                  "months": {
                    "type": "string"
                  },
                  "year": {
                    "type": "number"
                  }
                },
                "required": [
                  "frequency",
                  "months",
                  "year"
                ],
                "additionalProperties": false
              },
              "cfdiUse": {
                "type": "string"
              },
              "stampedLocalDateTime": {
                "type": "string",
                "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
              }
            },
            "additionalProperties": false
          },
          "relatedDocuments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "relationshipType": {
                  "type": "string"
                },
                "uuids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "relationshipType",
                "uuids"
              ],
              "additionalProperties": false
            }
          },
          "kind": {
            "type": "string",
            "const": "payroll"
          },
          "cfdiType": {
            "type": "string",
            "const": "N"
          },
          "employeeId": {
            "type": "string"
          },
          "issuer": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "receiver": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "payroll": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "paidDays": {
                "type": "number"
              },
              "earnings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "taxableAmount": {
                      "type": "number"
                    },
                    "exemptAmount": {
                      "type": "number"
                    },
                    "stock": {
                      "type": "object",
                      "properties": {
                        "marketValue": {
                          "type": "number"
                        },
                        "grantPrice": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "overtime": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "days": {
                            "type": "number"
                          },
                          "type": {
                            "type": "string"
                          },
                          "hours": {
                            "type": "number"
                          },
                          "amount": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "days",
                          "type",
                          "hours"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              },
              "incapacities": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "days": {
                      "type": "number"
                    },
                    "type": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "days",
                    "type"
                  ],
                  "additionalProperties": false
                }
              },
              "pension": {
                "type": "object",
                "properties": {
                  "singlePayment": {
                    "type": "number"
                  },
                  "installment": {
                    "type": "number"
                  },
                  "dailyAmount": {
                    "type": "number"
                  },
                  "accumulableIncome": {
                    "type": "number"
                  },
                  "nonAccumulableIncome": {
                    "type": "number"
                  }
                },
                "additionalProperties": false
              },
              "separation": {
                "type": "object",
                "properties": {
                  "totalPaid": {
                    "type": "number"
                  },
                  "serviceYears": {
                    "type": "number"
                  },
                  "lastMonthlySalary": {
                    "type": "number"
                  },
                  "accumulableIncome": {
                    "type": "number"
                  },
                  "nonAccumulableIncome": {
                    "type": "number"
                  }
                },
                "required": [
                  "serviceYears"
                ],
                "additionalProperties": false
              },
              "deductions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "otherPayments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    },
                    "employmentSubsidy": {
                      "type": "number"
                    },
                    "compensation": {
                      "type": "object",
                      "properties": {
                        "balance": {
                          "type": "number"
                        },
                        "year": {
                          "type": "number"
                        },
                        "remainingBalance": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "year"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              },
              "totals": {
                "type": "object",
                "properties": {
                  "earnings": {
                    "type": "number"
                  },
                  "deductions": {
                    "type": "number"
                  },
                  "otherPayments": {
                    "type": "number"
                  },
                  "net": {
                    "type": "number"
                  }
                },
                "additionalProperties": false
              },
              "employee": {
                "type": "object",
                "properties": {
                  "curp": {
                    "type": "string"
                  },
                  "employeeNumber": {
                    "type": "string"
                  },
                  "socialSecurityNumber": {
                    "type": "string"
                  },
                  "contractType": {
                    "type": "string"
                  },
                  "regimeType": {
                    "type": "string"
                  },
                  "paymentFrequency": {
                    "type": "string"
                  },
                  "stateCode": {
                    "type": "string"
                  },
                  "positionRisk": {
                    "type": "string"
                  },
                  "integratedDailySalary": {
                    "type": "number"
                  },
                  "contributionBaseSalary": {
                    "type": "number"
                  },
                  "department": {
                    "type": "string"
                  },
                  "position": {
                    "type": "string"
                  },
                  "workScheduleType": {
                    "type": "string"
                  },
                  "unionMember": {
                    "type": "string"
                  },
                  "bankCode": {
                    "type": "string"
                  },
                  "bankAccount": {
                    "type": "string"
                  },
                  "employmentStartedOn": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  }
                },
                "additionalProperties": false
              },
              "period": {
                "type": "object",
                "properties": {
                  "paidOn": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  },
                  "startedOn": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  },
                  "endedOn": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  }
                },
                "required": [
                  "paidOn"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "earnings",
              "deductions",
              "otherPayments",
              "totals",
              "employee",
              "period"
            ],
            "additionalProperties": false
          },
          "detail": {
            "type": "object",
            "properties": {
              "availability": {
                "type": "string",
                "const": "complete"
              }
            },
            "required": [
              "availability"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "direction",
          "status",
          "archived",
          "total",
          "documentRef",
          "category",
          "kind",
          "cfdiType",
          "payroll",
          "detail"
        ],
        "additionalProperties": false
      },
      "InvoiceTransferPartial": {
        "type": "object",
        "properties": {
          "cancellationReceiptFormats": {
            "description": "Supported cancellation receipt download formats. Empty for documents without this capability; availability at the provider may still be pending.",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "xml",
                "pdf"
              ]
            }
          },
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "simulated": {
            "description": "Non-fiscal sandbox simulation; the UUID is a local test identifier, not a SAT certification.",
            "type": "boolean",
            "const": true
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "payableArchived": {
            "type": "boolean"
          },
          "receivableArchived": {
            "type": "boolean"
          },
          "settlementTerms": {
            "type": "object",
            "properties": {
              "installmentCount": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60
              },
              "firstDue": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "transaction_date"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "months_after_transaction"
                      },
                      "months": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      }
                    },
                    "required": [
                      "kind",
                      "months"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "fixed_date"
                      },
                      "date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "date"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "recurrence": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "anchor_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "day_of_month"
                      },
                      "day": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      }
                    },
                    "required": [
                      "kind",
                      "day"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "last_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "installmentCount",
              "firstDue",
              "recurrence"
            ],
            "additionalProperties": false
          },
          "documentRef": {
            "type": "string",
            "pattern": "^invoice:.+$"
          },
          "category": {
            "type": "string",
            "const": "invoice"
          },
          "issuedLocalDateTime": {
            "type": "string",
            "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
          },
          "inventoryImpact": {
            "type": "object",
            "properties": {
              "locationId": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "deducted",
                  "reversed"
                ]
              },
              "appliedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "reversedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "stockShortage": {
                "type": "boolean"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          },
          "customerId": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "folio": {
            "type": "string"
          },
          "fiscal": {
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "number"
              },
              "ivaTransferred": {
                "type": "number"
              },
              "ivaWithheld": {
                "type": "number"
              },
              "isrWithheld": {
                "type": "number"
              },
              "exchangeRate": {
                "type": "number"
              },
              "totalMxn": {
                "type": "number"
              },
              "placeOfIssue": {
                "type": "string"
              },
              "exportation": {
                "type": "string"
              },
              "draftIssueDate": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "description": "Configured draft issue instant, separate from stamped local issue time."
              },
              "taxes": {
                "type": "object",
                "properties": {
                  "transfers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "withholdings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "transfers",
                  "withholdings"
                ],
                "additionalProperties": false
              },
              "globalInformation": {
                "type": "object",
                "properties": {
                  "frequency": {
                    "type": "string"
                  },
                  "months": {
                    "type": "string"
                  },
                  "year": {
                    "type": "number"
                  }
                },
                "required": [
                  "frequency",
                  "months",
                  "year"
                ],
                "additionalProperties": false
              },
              "cfdiUse": {
                "type": "string"
              },
              "stampedLocalDateTime": {
                "type": "string",
                "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
              }
            },
            "additionalProperties": false
          },
          "relatedDocuments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "relationshipType": {
                  "type": "string"
                },
                "uuids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "relationshipType",
                "uuids"
              ],
              "additionalProperties": false
            }
          },
          "kind": {
            "type": "string",
            "const": "transfer"
          },
          "cfdiType": {
            "type": "string",
            "const": "T"
          },
          "issuer": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "receiver": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number"
                },
                "unitPrice": {
                  "type": "number"
                },
                "discount": {
                  "type": "number"
                },
                "unitName": {
                  "type": "string"
                },
                "taxObject": {
                  "type": "string"
                },
                "taxes": {
                  "type": "object",
                  "properties": {
                    "transfers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "withholdings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "transfers",
                    "withholdings"
                  ],
                  "additionalProperties": false
                },
                "satProductCode": {
                  "type": "string"
                },
                "satUnitCode": {
                  "type": "string"
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPrice"
              ],
              "additionalProperties": false
            }
          },
          "detail": {
            "type": "object",
            "properties": {
              "availability": {
                "type": "string",
                "const": "partial"
              },
              "missing": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "required": [
              "availability",
              "missing"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "direction",
          "status",
          "archived",
          "total",
          "documentRef",
          "category",
          "kind",
          "cfdiType",
          "detail"
        ],
        "additionalProperties": false
      },
      "InvoiceTransferComplete": {
        "type": "object",
        "properties": {
          "cancellationReceiptFormats": {
            "description": "Supported cancellation receipt download formats. Empty for documents without this capability; availability at the provider may still be pending.",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "xml",
                "pdf"
              ]
            }
          },
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "simulated": {
            "description": "Non-fiscal sandbox simulation; the UUID is a local test identifier, not a SAT certification.",
            "type": "boolean",
            "const": true
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "payableArchived": {
            "type": "boolean"
          },
          "receivableArchived": {
            "type": "boolean"
          },
          "settlementTerms": {
            "type": "object",
            "properties": {
              "installmentCount": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60
              },
              "firstDue": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "transaction_date"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "months_after_transaction"
                      },
                      "months": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      }
                    },
                    "required": [
                      "kind",
                      "months"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "fixed_date"
                      },
                      "date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "date"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "recurrence": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "anchor_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "day_of_month"
                      },
                      "day": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      }
                    },
                    "required": [
                      "kind",
                      "day"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "last_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "installmentCount",
              "firstDue",
              "recurrence"
            ],
            "additionalProperties": false
          },
          "documentRef": {
            "type": "string",
            "pattern": "^invoice:.+$"
          },
          "category": {
            "type": "string",
            "const": "invoice"
          },
          "issuedLocalDateTime": {
            "type": "string",
            "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
          },
          "inventoryImpact": {
            "type": "object",
            "properties": {
              "locationId": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "deducted",
                  "reversed"
                ]
              },
              "appliedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "reversedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "stockShortage": {
                "type": "boolean"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          },
          "customerId": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "folio": {
            "type": "string"
          },
          "fiscal": {
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "number"
              },
              "ivaTransferred": {
                "type": "number"
              },
              "ivaWithheld": {
                "type": "number"
              },
              "isrWithheld": {
                "type": "number"
              },
              "exchangeRate": {
                "type": "number"
              },
              "totalMxn": {
                "type": "number"
              },
              "placeOfIssue": {
                "type": "string"
              },
              "exportation": {
                "type": "string"
              },
              "draftIssueDate": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "description": "Configured draft issue instant, separate from stamped local issue time."
              },
              "taxes": {
                "type": "object",
                "properties": {
                  "transfers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "withholdings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "transfers",
                  "withholdings"
                ],
                "additionalProperties": false
              },
              "globalInformation": {
                "type": "object",
                "properties": {
                  "frequency": {
                    "type": "string"
                  },
                  "months": {
                    "type": "string"
                  },
                  "year": {
                    "type": "number"
                  }
                },
                "required": [
                  "frequency",
                  "months",
                  "year"
                ],
                "additionalProperties": false
              },
              "cfdiUse": {
                "type": "string"
              },
              "stampedLocalDateTime": {
                "type": "string",
                "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
              }
            },
            "additionalProperties": false
          },
          "relatedDocuments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "relationshipType": {
                  "type": "string"
                },
                "uuids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "relationshipType",
                "uuids"
              ],
              "additionalProperties": false
            }
          },
          "kind": {
            "type": "string",
            "const": "transfer"
          },
          "cfdiType": {
            "type": "string",
            "const": "T"
          },
          "issuer": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "receiver": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number"
                },
                "unitPrice": {
                  "type": "number"
                },
                "discount": {
                  "type": "number"
                },
                "unitName": {
                  "type": "string"
                },
                "taxObject": {
                  "type": "string"
                },
                "taxes": {
                  "type": "object",
                  "properties": {
                    "transfers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "withholdings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "transfers",
                    "withholdings"
                  ],
                  "additionalProperties": false
                },
                "satProductCode": {
                  "type": "string"
                },
                "satUnitCode": {
                  "type": "string"
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPrice"
              ],
              "additionalProperties": false
            }
          },
          "detail": {
            "type": "object",
            "properties": {
              "availability": {
                "type": "string",
                "const": "complete"
              }
            },
            "required": [
              "availability"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "direction",
          "status",
          "archived",
          "total",
          "documentRef",
          "category",
          "kind",
          "cfdiType",
          "issuer",
          "receiver",
          "items",
          "detail"
        ],
        "additionalProperties": false
      },
      "InvoiceCreditNotePartial": {
        "type": "object",
        "properties": {
          "cancellationReceiptFormats": {
            "description": "Supported cancellation receipt download formats. Empty for documents without this capability; availability at the provider may still be pending.",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "xml",
                "pdf"
              ]
            }
          },
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "simulated": {
            "description": "Non-fiscal sandbox simulation; the UUID is a local test identifier, not a SAT certification.",
            "type": "boolean",
            "const": true
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "payableArchived": {
            "type": "boolean"
          },
          "receivableArchived": {
            "type": "boolean"
          },
          "settlementTerms": {
            "type": "object",
            "properties": {
              "installmentCount": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60
              },
              "firstDue": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "transaction_date"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "months_after_transaction"
                      },
                      "months": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      }
                    },
                    "required": [
                      "kind",
                      "months"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "fixed_date"
                      },
                      "date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "date"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "recurrence": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "anchor_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "day_of_month"
                      },
                      "day": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      }
                    },
                    "required": [
                      "kind",
                      "day"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "last_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "installmentCount",
              "firstDue",
              "recurrence"
            ],
            "additionalProperties": false
          },
          "documentRef": {
            "type": "string",
            "pattern": "^invoice:.+$"
          },
          "category": {
            "type": "string",
            "const": "invoice"
          },
          "issuedLocalDateTime": {
            "type": "string",
            "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
          },
          "inventoryImpact": {
            "type": "object",
            "properties": {
              "locationId": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "deducted",
                  "reversed"
                ]
              },
              "appliedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "reversedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "stockShortage": {
                "type": "boolean"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          },
          "customerId": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "folio": {
            "type": "string"
          },
          "fiscal": {
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "number"
              },
              "ivaTransferred": {
                "type": "number"
              },
              "ivaWithheld": {
                "type": "number"
              },
              "isrWithheld": {
                "type": "number"
              },
              "exchangeRate": {
                "type": "number"
              },
              "totalMxn": {
                "type": "number"
              },
              "placeOfIssue": {
                "type": "string"
              },
              "exportation": {
                "type": "string"
              },
              "draftIssueDate": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "description": "Configured draft issue instant, separate from stamped local issue time."
              },
              "taxes": {
                "type": "object",
                "properties": {
                  "transfers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "withholdings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "transfers",
                  "withholdings"
                ],
                "additionalProperties": false
              },
              "globalInformation": {
                "type": "object",
                "properties": {
                  "frequency": {
                    "type": "string"
                  },
                  "months": {
                    "type": "string"
                  },
                  "year": {
                    "type": "number"
                  }
                },
                "required": [
                  "frequency",
                  "months",
                  "year"
                ],
                "additionalProperties": false
              },
              "cfdiUse": {
                "type": "string"
              },
              "stampedLocalDateTime": {
                "type": "string",
                "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
              }
            },
            "additionalProperties": false
          },
          "relatedDocuments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "relationshipType": {
                  "type": "string"
                },
                "uuids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "relationshipType",
                "uuids"
              ],
              "additionalProperties": false
            }
          },
          "kind": {
            "type": "string",
            "const": "credit_note"
          },
          "cfdiType": {
            "type": "string",
            "const": "E"
          },
          "issuer": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "receiver": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number"
                },
                "unitPrice": {
                  "type": "number"
                },
                "discount": {
                  "type": "number"
                },
                "unitName": {
                  "type": "string"
                },
                "taxObject": {
                  "type": "string"
                },
                "taxes": {
                  "type": "object",
                  "properties": {
                    "transfers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "withholdings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "transfers",
                    "withholdings"
                  ],
                  "additionalProperties": false
                },
                "satProductCode": {
                  "type": "string"
                },
                "satUnitCode": {
                  "type": "string"
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPrice"
              ],
              "additionalProperties": false
            }
          },
          "payment": {
            "type": "object",
            "properties": {
              "timing": {
                "type": "string",
                "enum": [
                  "single_payment",
                  "deferred_or_installments"
                ]
              },
              "formCode": {
                "type": "string"
              },
              "methodCode": {
                "type": "string"
              },
              "dueDate": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "remainingBalance": {
                "type": "number"
              },
              "conditions": {
                "type": "string"
              }
            },
            "required": [
              "timing"
            ],
            "additionalProperties": false
          },
          "detail": {
            "type": "object",
            "properties": {
              "availability": {
                "type": "string",
                "const": "partial"
              },
              "missing": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "required": [
              "availability",
              "missing"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "direction",
          "status",
          "archived",
          "total",
          "documentRef",
          "category",
          "kind",
          "cfdiType",
          "detail"
        ],
        "additionalProperties": false
      },
      "InvoiceCreditNoteComplete": {
        "type": "object",
        "properties": {
          "cancellationReceiptFormats": {
            "description": "Supported cancellation receipt download formats. Empty for documents without this capability; availability at the provider may still be pending.",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "xml",
                "pdf"
              ]
            }
          },
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "simulated": {
            "description": "Non-fiscal sandbox simulation; the UUID is a local test identifier, not a SAT certification.",
            "type": "boolean",
            "const": true
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "payableArchived": {
            "type": "boolean"
          },
          "receivableArchived": {
            "type": "boolean"
          },
          "settlementTerms": {
            "type": "object",
            "properties": {
              "installmentCount": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60
              },
              "firstDue": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "transaction_date"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "months_after_transaction"
                      },
                      "months": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      }
                    },
                    "required": [
                      "kind",
                      "months"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "fixed_date"
                      },
                      "date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "date"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "recurrence": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "anchor_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "day_of_month"
                      },
                      "day": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      }
                    },
                    "required": [
                      "kind",
                      "day"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "last_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "installmentCount",
              "firstDue",
              "recurrence"
            ],
            "additionalProperties": false
          },
          "documentRef": {
            "type": "string",
            "pattern": "^invoice:.+$"
          },
          "category": {
            "type": "string",
            "const": "invoice"
          },
          "issuedLocalDateTime": {
            "type": "string",
            "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
          },
          "inventoryImpact": {
            "type": "object",
            "properties": {
              "locationId": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "deducted",
                  "reversed"
                ]
              },
              "appliedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "reversedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "stockShortage": {
                "type": "boolean"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          },
          "customerId": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "folio": {
            "type": "string"
          },
          "fiscal": {
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "number"
              },
              "ivaTransferred": {
                "type": "number"
              },
              "ivaWithheld": {
                "type": "number"
              },
              "isrWithheld": {
                "type": "number"
              },
              "exchangeRate": {
                "type": "number"
              },
              "totalMxn": {
                "type": "number"
              },
              "placeOfIssue": {
                "type": "string"
              },
              "exportation": {
                "type": "string"
              },
              "draftIssueDate": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "description": "Configured draft issue instant, separate from stamped local issue time."
              },
              "taxes": {
                "type": "object",
                "properties": {
                  "transfers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "withholdings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "transfers",
                  "withholdings"
                ],
                "additionalProperties": false
              },
              "globalInformation": {
                "type": "object",
                "properties": {
                  "frequency": {
                    "type": "string"
                  },
                  "months": {
                    "type": "string"
                  },
                  "year": {
                    "type": "number"
                  }
                },
                "required": [
                  "frequency",
                  "months",
                  "year"
                ],
                "additionalProperties": false
              },
              "cfdiUse": {
                "type": "string"
              },
              "stampedLocalDateTime": {
                "type": "string",
                "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
              }
            },
            "additionalProperties": false
          },
          "relatedDocuments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "relationshipType": {
                  "type": "string"
                },
                "uuids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "relationshipType",
                "uuids"
              ],
              "additionalProperties": false
            }
          },
          "kind": {
            "type": "string",
            "const": "credit_note"
          },
          "cfdiType": {
            "type": "string",
            "const": "E"
          },
          "issuer": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "receiver": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number"
                },
                "unitPrice": {
                  "type": "number"
                },
                "discount": {
                  "type": "number"
                },
                "unitName": {
                  "type": "string"
                },
                "taxObject": {
                  "type": "string"
                },
                "taxes": {
                  "type": "object",
                  "properties": {
                    "transfers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "withholdings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "transfers",
                    "withholdings"
                  ],
                  "additionalProperties": false
                },
                "satProductCode": {
                  "type": "string"
                },
                "satUnitCode": {
                  "type": "string"
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPrice"
              ],
              "additionalProperties": false
            }
          },
          "payment": {
            "type": "object",
            "properties": {
              "timing": {
                "type": "string",
                "enum": [
                  "single_payment",
                  "deferred_or_installments"
                ]
              },
              "formCode": {
                "type": "string"
              },
              "methodCode": {
                "type": "string"
              },
              "dueDate": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "remainingBalance": {
                "type": "number"
              },
              "conditions": {
                "type": "string"
              }
            },
            "required": [
              "timing"
            ],
            "additionalProperties": false
          },
          "detail": {
            "type": "object",
            "properties": {
              "availability": {
                "type": "string",
                "const": "complete"
              }
            },
            "required": [
              "availability"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "direction",
          "status",
          "archived",
          "total",
          "documentRef",
          "category",
          "relatedDocuments",
          "kind",
          "cfdiType",
          "issuer",
          "receiver",
          "items",
          "detail"
        ],
        "additionalProperties": false
      },
      "InvoiceIncomePartial": {
        "type": "object",
        "properties": {
          "cancellationReceiptFormats": {
            "description": "Supported cancellation receipt download formats. Empty for documents without this capability; availability at the provider may still be pending.",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "xml",
                "pdf"
              ]
            }
          },
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "simulated": {
            "description": "Non-fiscal sandbox simulation; the UUID is a local test identifier, not a SAT certification.",
            "type": "boolean",
            "const": true
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "payableArchived": {
            "type": "boolean"
          },
          "receivableArchived": {
            "type": "boolean"
          },
          "settlementTerms": {
            "type": "object",
            "properties": {
              "installmentCount": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60
              },
              "firstDue": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "transaction_date"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "months_after_transaction"
                      },
                      "months": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      }
                    },
                    "required": [
                      "kind",
                      "months"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "fixed_date"
                      },
                      "date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "date"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "recurrence": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "anchor_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "day_of_month"
                      },
                      "day": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      }
                    },
                    "required": [
                      "kind",
                      "day"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "last_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "installmentCount",
              "firstDue",
              "recurrence"
            ],
            "additionalProperties": false
          },
          "documentRef": {
            "type": "string",
            "pattern": "^invoice:.+$"
          },
          "category": {
            "type": "string",
            "const": "invoice"
          },
          "issuedLocalDateTime": {
            "type": "string",
            "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
          },
          "inventoryImpact": {
            "type": "object",
            "properties": {
              "locationId": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "deducted",
                  "reversed"
                ]
              },
              "appliedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "reversedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "stockShortage": {
                "type": "boolean"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          },
          "customerId": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "folio": {
            "type": "string"
          },
          "fiscal": {
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "number"
              },
              "ivaTransferred": {
                "type": "number"
              },
              "ivaWithheld": {
                "type": "number"
              },
              "isrWithheld": {
                "type": "number"
              },
              "exchangeRate": {
                "type": "number"
              },
              "totalMxn": {
                "type": "number"
              },
              "placeOfIssue": {
                "type": "string"
              },
              "exportation": {
                "type": "string"
              },
              "draftIssueDate": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "description": "Configured draft issue instant, separate from stamped local issue time."
              },
              "taxes": {
                "type": "object",
                "properties": {
                  "transfers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "withholdings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "transfers",
                  "withholdings"
                ],
                "additionalProperties": false
              },
              "globalInformation": {
                "type": "object",
                "properties": {
                  "frequency": {
                    "type": "string"
                  },
                  "months": {
                    "type": "string"
                  },
                  "year": {
                    "type": "number"
                  }
                },
                "required": [
                  "frequency",
                  "months",
                  "year"
                ],
                "additionalProperties": false
              },
              "cfdiUse": {
                "type": "string"
              },
              "stampedLocalDateTime": {
                "type": "string",
                "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
              }
            },
            "additionalProperties": false
          },
          "relatedDocuments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "relationshipType": {
                  "type": "string"
                },
                "uuids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "relationshipType",
                "uuids"
              ],
              "additionalProperties": false
            }
          },
          "kind": {
            "type": "string",
            "const": "income"
          },
          "cfdiType": {
            "type": "string",
            "const": "I"
          },
          "issuer": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "receiver": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number"
                },
                "unitPrice": {
                  "type": "number"
                },
                "discount": {
                  "type": "number"
                },
                "unitName": {
                  "type": "string"
                },
                "taxObject": {
                  "type": "string"
                },
                "taxes": {
                  "type": "object",
                  "properties": {
                    "transfers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "withholdings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "transfers",
                    "withholdings"
                  ],
                  "additionalProperties": false
                },
                "satProductCode": {
                  "type": "string"
                },
                "satUnitCode": {
                  "type": "string"
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPrice"
              ],
              "additionalProperties": false
            }
          },
          "payment": {
            "type": "object",
            "properties": {
              "timing": {
                "type": "string",
                "enum": [
                  "single_payment",
                  "deferred_or_installments"
                ]
              },
              "formCode": {
                "type": "string"
              },
              "methodCode": {
                "type": "string"
              },
              "dueDate": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "remainingBalance": {
                "type": "number"
              },
              "conditions": {
                "type": "string"
              }
            },
            "required": [
              "timing"
            ],
            "additionalProperties": false
          },
          "detail": {
            "type": "object",
            "properties": {
              "availability": {
                "type": "string",
                "const": "partial"
              },
              "missing": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "required": [
              "availability",
              "missing"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "direction",
          "status",
          "archived",
          "total",
          "documentRef",
          "category",
          "kind",
          "cfdiType",
          "detail"
        ],
        "additionalProperties": false
      },
      "InvoiceIncomeComplete": {
        "type": "object",
        "properties": {
          "cancellationReceiptFormats": {
            "description": "Supported cancellation receipt download formats. Empty for documents without this capability; availability at the provider may still be pending.",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "xml",
                "pdf"
              ]
            }
          },
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "simulated": {
            "description": "Non-fiscal sandbox simulation; the UUID is a local test identifier, not a SAT certification.",
            "type": "boolean",
            "const": true
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "payableArchived": {
            "type": "boolean"
          },
          "receivableArchived": {
            "type": "boolean"
          },
          "settlementTerms": {
            "type": "object",
            "properties": {
              "installmentCount": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60
              },
              "firstDue": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "transaction_date"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "months_after_transaction"
                      },
                      "months": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      }
                    },
                    "required": [
                      "kind",
                      "months"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "fixed_date"
                      },
                      "date": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "date"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "recurrence": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "anchor_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "day_of_month"
                      },
                      "day": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 31
                      }
                    },
                    "required": [
                      "kind",
                      "day"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "last_day"
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "installmentCount",
              "firstDue",
              "recurrence"
            ],
            "additionalProperties": false
          },
          "documentRef": {
            "type": "string",
            "pattern": "^invoice:.+$"
          },
          "category": {
            "type": "string",
            "const": "invoice"
          },
          "issuedLocalDateTime": {
            "type": "string",
            "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
          },
          "inventoryImpact": {
            "type": "object",
            "properties": {
              "locationId": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "deducted",
                  "reversed"
                ]
              },
              "appliedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "reversedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "stockShortage": {
                "type": "boolean"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          },
          "customerId": {
            "type": "string"
          },
          "series": {
            "type": "string"
          },
          "folio": {
            "type": "string"
          },
          "fiscal": {
            "type": "object",
            "properties": {
              "subtotal": {
                "type": "number"
              },
              "ivaTransferred": {
                "type": "number"
              },
              "ivaWithheld": {
                "type": "number"
              },
              "isrWithheld": {
                "type": "number"
              },
              "exchangeRate": {
                "type": "number"
              },
              "totalMxn": {
                "type": "number"
              },
              "placeOfIssue": {
                "type": "string"
              },
              "exportation": {
                "type": "string"
              },
              "draftIssueDate": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "description": "Configured draft issue instant, separate from stamped local issue time."
              },
              "taxes": {
                "type": "object",
                "properties": {
                  "transfers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "withholdings": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "tax": {
                          "type": "string"
                        },
                        "factorType": {
                          "type": "string"
                        },
                        "rateOrFee": {
                          "type": "string"
                        },
                        "amount": {
                          "type": "string"
                        },
                        "base": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "tax",
                        "factorType"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "transfers",
                  "withholdings"
                ],
                "additionalProperties": false
              },
              "globalInformation": {
                "type": "object",
                "properties": {
                  "frequency": {
                    "type": "string"
                  },
                  "months": {
                    "type": "string"
                  },
                  "year": {
                    "type": "number"
                  }
                },
                "required": [
                  "frequency",
                  "months",
                  "year"
                ],
                "additionalProperties": false
              },
              "cfdiUse": {
                "type": "string"
              },
              "stampedLocalDateTime": {
                "type": "string",
                "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
              }
            },
            "additionalProperties": false
          },
          "relatedDocuments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "relationshipType": {
                  "type": "string"
                },
                "uuids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "relationshipType",
                "uuids"
              ],
              "additionalProperties": false
            }
          },
          "kind": {
            "type": "string",
            "const": "income"
          },
          "cfdiType": {
            "type": "string",
            "const": "I"
          },
          "issuer": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "receiver": {
            "type": "object",
            "properties": {
              "rfc": {
                "type": "string"
              },
              "legalName": {
                "type": "string"
              },
              "taxSystem": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "cfdiUse": {
                "type": "string"
              }
            },
            "required": [
              "rfc",
              "legalName",
              "taxSystem"
            ],
            "additionalProperties": false
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number"
                },
                "unitPrice": {
                  "type": "number"
                },
                "discount": {
                  "type": "number"
                },
                "unitName": {
                  "type": "string"
                },
                "taxObject": {
                  "type": "string"
                },
                "taxes": {
                  "type": "object",
                  "properties": {
                    "transfers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "withholdings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tax": {
                            "type": "string"
                          },
                          "factorType": {
                            "type": "string"
                          },
                          "rateOrFee": {
                            "type": "string"
                          },
                          "amount": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "tax",
                          "factorType"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "transfers",
                    "withholdings"
                  ],
                  "additionalProperties": false
                },
                "satProductCode": {
                  "type": "string"
                },
                "satUnitCode": {
                  "type": "string"
                }
              },
              "required": [
                "description",
                "quantity",
                "unitPrice"
              ],
              "additionalProperties": false
            }
          },
          "payment": {
            "type": "object",
            "properties": {
              "timing": {
                "type": "string",
                "enum": [
                  "single_payment",
                  "deferred_or_installments"
                ]
              },
              "formCode": {
                "type": "string"
              },
              "methodCode": {
                "type": "string"
              },
              "dueDate": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "remainingBalance": {
                "type": "number"
              },
              "conditions": {
                "type": "string"
              }
            },
            "required": [
              "timing"
            ],
            "additionalProperties": false
          },
          "detail": {
            "type": "object",
            "properties": {
              "availability": {
                "type": "string",
                "const": "complete"
              }
            },
            "required": [
              "availability"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "direction",
          "status",
          "archived",
          "total",
          "documentRef",
          "category",
          "kind",
          "cfdiType",
          "issuer",
          "receiver",
          "items",
          "payment",
          "detail"
        ],
        "additionalProperties": false
      },
      "InvoiceDraftInput": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/InvoiceIncomeInput"
          },
          {
            "$ref": "#/components/schemas/InvoiceCreditNoteInput"
          },
          {
            "$ref": "#/components/schemas/InvoiceTransferInput"
          },
          {
            "$ref": "#/components/schemas/InvoicePayrollInput"
          },
          {
            "$ref": "#/components/schemas/InvoicePaymentComplementInput"
          }
        ]
      },
      "InvoicePaymentComplementInput": {
        "type": "object",
        "properties": {
          "pdfCustomSection": {
            "type": "string"
          },
          "emissionDate": {
            "description": "Emission instant with UTC offset; validated against the certification window at stamping.",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "kind": {
            "type": "string",
            "const": "payment_complement"
          },
          "customerId": {
            "type": "string",
            "minLength": 1
          },
          "payments": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "formCode": {
                  "description": "Known SAT payment-form code.",
                  "x-exac-sat-catalog": "payment-forms",
                  "oneOf": [
                    {
                      "type": "string",
                      "title": "SAT c_FormaPago",
                      "description": "Consulta códigos y nombres vigentes [aquí](/docs/sat-catalogs/invoicing#payment-forms).",
                      "enum": [
                        "12",
                        "13",
                        "14",
                        "15",
                        "17",
                        "23",
                        "24",
                        "25",
                        "26",
                        "27",
                        "28",
                        "29",
                        "30",
                        "31",
                        "99",
                        "01",
                        "02",
                        "03",
                        "04",
                        "05",
                        "06",
                        "08"
                      ]
                    }
                  ]
                },
                "paidLocalDateTime": {
                  "type": "string",
                  "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
                },
                "documents": {
                  "minItems": 1,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "minLength": 1
                      },
                      "amount": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "installment": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991,
                        "description": "1-based payment sequence"
                      },
                      "previousBalance": {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "description": "Balance before payment; then use prior remaining balance"
                      },
                      "series": {
                        "type": "string"
                      },
                      "folio": {
                        "type": "string"
                      },
                      "currency": {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 3
                      },
                      "exchangeRate": {
                        "description": "Document currency units per MXN.",
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "taxes": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "auto",
                            "description": "Calculate taxes from this organization's CFDI."
                          },
                          {
                            "type": "object",
                            "properties": {
                              "taxObject": {
                                "type": "string",
                                "enum": [
                                  "01",
                                  "02",
                                  "03",
                                  "04",
                                  "05",
                                  "06",
                                  "07",
                                  "08"
                                ],
                                "description": "SAT ObjetoImpDR from the related CFDI"
                              },
                              "entries": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "base": {
                                      "type": "number",
                                      "minimum": 0
                                    },
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "IVA",
                                        "ISR",
                                        "IEPS"
                                      ]
                                    },
                                    "rate": {
                                      "type": "number",
                                      "minimum": 0
                                    },
                                    "factor": {
                                      "type": "string",
                                      "enum": [
                                        "Tasa",
                                        "Cuota",
                                        "Exento"
                                      ]
                                    },
                                    "withholding": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "base",
                                    "type",
                                    "rate"
                                  ],
                                  "additionalProperties": false
                                },
                                "description": "Payment-level tax rows from the related CFDI"
                              }
                            },
                            "required": [
                              "taxObject",
                              "entries"
                            ],
                            "additionalProperties": false,
                            "description": "Taxes for an external CFDI Exac cannot inspect"
                          }
                        ]
                      }
                    },
                    "required": [
                      "uuid",
                      "amount",
                      "installment",
                      "previousBalance",
                      "taxes"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "formCode",
                "documents"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "kind",
          "customerId",
          "payments"
        ],
        "additionalProperties": false,
        "title": "CFDI P · payment_complement"
      },
      "InvoicePayrollInput": {
        "type": "object",
        "properties": {
          "pdfCustomSection": {
            "type": "string"
          },
          "emissionDate": {
            "description": "Emission instant with UTC offset; validated against the certification window at stamping.",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "kind": {
            "type": "string",
            "const": "payroll"
          },
          "employeeId": {
            "type": "string",
            "minLength": 1
          },
          "payroll": {
            "type": "object",
            "properties": {
              "type": {
                "default": "O",
                "description": "O: ordinary payroll; E: extraordinary, requiring paymentFrequency 99.",
                "type": "string",
                "enum": [
                  "O",
                  "E"
                ]
              },
              "paidOn": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  },
                  {
                    "pattern": "^(19|20)"
                  }
                ]
              },
              "periodStartedOn": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  },
                  {
                    "pattern": "^(19|20)"
                  }
                ]
              },
              "periodEndedOn": {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  },
                  {
                    "pattern": "^(19|20)"
                  }
                ]
              },
              "paidDays": {
                "type": "number",
                "minimum": 0.001,
                "maximum": 36160,
                "multipleOf": 0.001
              },
              "employee": {
                "type": "object",
                "properties": {
                  "curp": {
                    "type": "string",
                    "pattern": "^[A-Z][AEIOUX][A-Z]{2}[0-9]{2}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])[MHX]([ABCMTZ]S|[BCJMOT]C|[CNPST]L|[GNQ]T|[GQS]R|C[MH]|[MY]N|[DH]G|NE|VZ|DF|SP)[BCDFGHJ-NP-TV-Z]{3}[0-9A-Z][0-9]$"
                  },
                  "employeeNumber": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 15,
                    "pattern": "^[^|]+$"
                  },
                  "socialSecurityNumber": {
                    "type": "string",
                    "pattern": "^\\d{1,15}$"
                  },
                  "employmentStartedOn": {
                    "type": "string",
                    "allOf": [
                      {
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                      },
                      {
                        "pattern": "^(19|20)"
                      }
                    ]
                  },
                  "contractType": {
                    "description": "Known SAT payroll contract-type code.",
                    "x-exac-sat-catalog": "payroll-contract-types",
                    "oneOf": [
                      {
                        "type": "string",
                        "title": "SAT c_TipoContrato",
                        "description": "Consulta códigos y nombres vigentes [aquí](/docs/sat-catalogs/payroll#payroll-contract-types).",
                        "enum": [
                          "10",
                          "99",
                          "01",
                          "02",
                          "03",
                          "04",
                          "05",
                          "06",
                          "07",
                          "08",
                          "09"
                        ]
                      }
                    ]
                  },
                  "regimeType": {
                    "description": "Known SAT payroll regime-type code.",
                    "x-exac-sat-catalog": "payroll-regime-types",
                    "oneOf": [
                      {
                        "type": "string",
                        "title": "SAT c_TipoRegimen",
                        "description": "Consulta códigos y nombres vigentes [aquí](/docs/sat-catalogs/payroll#payroll-regime-types).",
                        "enum": [
                          "10",
                          "11",
                          "12",
                          "13",
                          "99",
                          "02",
                          "03",
                          "04",
                          "05",
                          "06",
                          "07",
                          "08",
                          "09"
                        ]
                      }
                    ]
                  },
                  "paymentFrequency": {
                    "description": "Known SAT payroll payment-frequency code.",
                    "x-exac-sat-catalog": "payroll-payment-frequencies",
                    "oneOf": [
                      {
                        "type": "string",
                        "title": "SAT c_PeriodicidadPago",
                        "description": "Consulta códigos y nombres vigentes [aquí](/docs/sat-catalogs/payroll#payroll-payment-frequencies).",
                        "enum": [
                          "10",
                          "99",
                          "01",
                          "02",
                          "03",
                          "04",
                          "05",
                          "06",
                          "07",
                          "08",
                          "09"
                        ]
                      }
                    ]
                  },
                  "stateCode": {
                    "description": "Known SAT federal-entity code.",
                    "x-exac-sat-catalog": "federal-entities",
                    "oneOf": [
                      {
                        "type": "string",
                        "title": "SAT c_Estado",
                        "description": "Consulta códigos y nombres vigentes [aquí](/docs/sat-catalogs/payroll#federal-entities).",
                        "enum": [
                          "AGU",
                          "BCN",
                          "BCS",
                          "CAM",
                          "CHH",
                          "CHP",
                          "CMX",
                          "COA",
                          "COL",
                          "DIF",
                          "DUR",
                          "GRO",
                          "GUA",
                          "HID",
                          "JAL",
                          "MEX",
                          "MIC",
                          "MOR",
                          "NAY",
                          "NLE",
                          "OAX",
                          "PUE",
                          "QUE",
                          "ROO",
                          "SIN",
                          "SLP",
                          "SON",
                          "TAB",
                          "TAM",
                          "TLA",
                          "VER",
                          "YUC",
                          "ZAC"
                        ]
                      }
                    ]
                  },
                  "positionRisk": {
                    "type": "string",
                    "enum": [
                      "1",
                      "2",
                      "3",
                      "4",
                      "5",
                      "99"
                    ],
                    "description": "Known SAT payroll position-risk code.",
                    "x-exac-sat-catalog": "payroll-position-risks"
                  },
                  "integratedDailySalary": {
                    "type": "number",
                    "minimum": 0,
                    "exclusiveMaximum": 1000000000000000000,
                    "multipleOf": 0.01
                  },
                  "contributionBaseSalary": {
                    "type": "number",
                    "minimum": 0,
                    "exclusiveMaximum": 1000000000000000000,
                    "multipleOf": 0.01
                  },
                  "department": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "pattern": "^[^|]+$"
                  },
                  "position": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "pattern": "^[^|]+$"
                  },
                  "workScheduleType": {
                    "description": "Known SAT payroll work-schedule code.",
                    "x-exac-sat-catalog": "payroll-work-schedule-types",
                    "oneOf": [
                      {
                        "type": "string",
                        "title": "SAT c_TipoJornada",
                        "description": "Consulta códigos y nombres vigentes [aquí](/docs/sat-catalogs/payroll#payroll-work-schedule-types).",
                        "enum": [
                          "99",
                          "01",
                          "02",
                          "03",
                          "04",
                          "05",
                          "06",
                          "07",
                          "08"
                        ]
                      }
                    ]
                  },
                  "unionMember": {
                    "type": "string",
                    "enum": [
                      "Sí",
                      "No"
                    ]
                  },
                  "bankCode": {
                    "description": "Known SAT payroll bank code.",
                    "x-exac-sat-catalog": "payroll-banks",
                    "oneOf": [
                      {
                        "type": "string",
                        "title": "SAT c_Banco",
                        "description": "Consulta códigos y nombres vigentes [aquí](/docs/sat-catalogs/payroll#payroll-banks).",
                        "enum": [
                          "102",
                          "103",
                          "106",
                          "108",
                          "110",
                          "112",
                          "113",
                          "116",
                          "124",
                          "126",
                          "127",
                          "128",
                          "129",
                          "130",
                          "131",
                          "132",
                          "133",
                          "134",
                          "135",
                          "136",
                          "137",
                          "138",
                          "139",
                          "140",
                          "141",
                          "143",
                          "145",
                          "147",
                          "148",
                          "149",
                          "150",
                          "151",
                          "152",
                          "153",
                          "154",
                          "155",
                          "156",
                          "157",
                          "158",
                          "159",
                          "160",
                          "166",
                          "168",
                          "600",
                          "601",
                          "602",
                          "605",
                          "606",
                          "607",
                          "608",
                          "610",
                          "614",
                          "615",
                          "616",
                          "617",
                          "618",
                          "619",
                          "620",
                          "621",
                          "622",
                          "623",
                          "626",
                          "627",
                          "628",
                          "629",
                          "630",
                          "631",
                          "632",
                          "633",
                          "634",
                          "636",
                          "637",
                          "638",
                          "640",
                          "642",
                          "646",
                          "647",
                          "648",
                          "649",
                          "651",
                          "652",
                          "653",
                          "655",
                          "656",
                          "659",
                          "670",
                          "901",
                          "902",
                          "002",
                          "006",
                          "009",
                          "012",
                          "014",
                          "019",
                          "021",
                          "030",
                          "032",
                          "036",
                          "037",
                          "042",
                          "044",
                          "058",
                          "059",
                          "060",
                          "062",
                          "072"
                        ]
                      }
                    ]
                  },
                  "bankAccount": {
                    "type": "string",
                    "pattern": "^(?:\\d{10}|\\d{11}|\\d{16}|\\d{18})$"
                  }
                },
                "required": [
                  "curp",
                  "employeeNumber",
                  "contractType",
                  "regimeType",
                  "paymentFrequency",
                  "stateCode"
                ],
                "additionalProperties": false,
                "description": "Contracts 01–08 require regime 02/03/04, socialSecurityNumber, employmentStartedOn, positionRisk and integratedDailySalary. Other contracts use a different regime; those four fields are optional when applicable."
              },
              "earnings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "minLength": 3,
                      "maxLength": 15,
                      "pattern": "^[^|]+$",
                      "description": "Employer-assigned internal payroll accounting code, not the SAT type code"
                    },
                    "description": {
                      "description": "Optional payroll concept description",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100,
                      "pattern": "^[^|]+$"
                    },
                    "type": {
                      "description": "Known SAT payroll earning-type code.",
                      "x-exac-sat-catalog": "payroll-earning-types",
                      "oneOf": [
                        {
                          "type": "string",
                          "title": "SAT c_TipoPercepcion",
                          "description": "Consulta códigos y nombres vigentes [aquí](/docs/sat-catalogs/payroll#payroll-earning-types).",
                          "enum": [
                            "001",
                            "002",
                            "003",
                            "004",
                            "005",
                            "006",
                            "009",
                            "010",
                            "011",
                            "012",
                            "013",
                            "014",
                            "015",
                            "019",
                            "020",
                            "021",
                            "022",
                            "023",
                            "024",
                            "025",
                            "026",
                            "027",
                            "028",
                            "029",
                            "030",
                            "031",
                            "032",
                            "033",
                            "034",
                            "035",
                            "036",
                            "037",
                            "038",
                            "039",
                            "044",
                            "045",
                            "046",
                            "047",
                            "048",
                            "049",
                            "050",
                            "051",
                            "052",
                            "053",
                            "054",
                            "055",
                            "056",
                            "057"
                          ]
                        }
                      ]
                    },
                    "taxableAmount": {
                      "type": "number",
                      "minimum": 0,
                      "exclusiveMaximum": 1000000000000000000,
                      "multipleOf": 0.01
                    },
                    "exemptAmount": {
                      "type": "number",
                      "minimum": 0,
                      "exclusiveMaximum": 1000000000000000000,
                      "multipleOf": 0.01
                    },
                    "stock": {
                      "type": "object",
                      "properties": {
                        "marketValue": {
                          "type": "number",
                          "minimum": 0.000001,
                          "multipleOf": 0.000001
                        },
                        "grantPrice": {
                          "type": "number",
                          "minimum": 0.000001,
                          "multipleOf": 0.000001
                        }
                      },
                      "required": [
                        "marketValue",
                        "grantPrice"
                      ],
                      "additionalProperties": false
                    },
                    "overtime": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "days": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 2147483647
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "01",
                              "02",
                              "03"
                            ]
                          },
                          "hours": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 2147483647
                          },
                          "amount": {
                            "type": "number",
                            "minimum": 0,
                            "exclusiveMaximum": 1000000000000000000,
                            "multipleOf": 0.01
                          }
                        },
                        "required": [
                          "days",
                          "type",
                          "hours",
                          "amount"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "code",
                    "type",
                    "taxableAmount",
                    "exemptAmount"
                  ],
                  "additionalProperties": false
                }
              },
              "pension": {
                "type": "object",
                "properties": {
                  "accumulableIncome": {
                    "type": "number",
                    "minimum": 0,
                    "exclusiveMaximum": 1000000000000000000,
                    "multipleOf": 0.01
                  },
                  "nonAccumulableIncome": {
                    "type": "number",
                    "minimum": 0,
                    "exclusiveMaximum": 1000000000000000000,
                    "multipleOf": 0.01
                  },
                  "singlePayment": {
                    "type": "number",
                    "minimum": 0,
                    "exclusiveMaximum": 1000000000000000000,
                    "multipleOf": 0.01
                  },
                  "installment": {
                    "type": "number",
                    "minimum": 0,
                    "exclusiveMaximum": 1000000000000000000,
                    "multipleOf": 0.01
                  },
                  "dailyAmount": {
                    "type": "number",
                    "minimum": 0,
                    "exclusiveMaximum": 1000000000000000000,
                    "multipleOf": 0.01
                  }
                },
                "required": [
                  "accumulableIncome",
                  "nonAccumulableIncome"
                ],
                "additionalProperties": false
              },
              "separation": {
                "type": "object",
                "properties": {
                  "accumulableIncome": {
                    "type": "number",
                    "minimum": 0,
                    "exclusiveMaximum": 1000000000000000000,
                    "multipleOf": 0.01
                  },
                  "nonAccumulableIncome": {
                    "type": "number",
                    "minimum": 0,
                    "exclusiveMaximum": 1000000000000000000,
                    "multipleOf": 0.01
                  },
                  "totalPaid": {
                    "type": "number",
                    "minimum": 0,
                    "exclusiveMaximum": 1000000000000000000,
                    "multipleOf": 0.01
                  },
                  "serviceYears": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 99
                  },
                  "lastMonthlySalary": {
                    "type": "number",
                    "minimum": 0,
                    "exclusiveMaximum": 1000000000000000000,
                    "multipleOf": 0.01
                  }
                },
                "required": [
                  "accumulableIncome",
                  "nonAccumulableIncome",
                  "totalPaid",
                  "serviceYears",
                  "lastMonthlySalary"
                ],
                "additionalProperties": false
              },
              "incapacities": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "days": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 2147483647
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "01",
                        "02",
                        "03",
                        "04"
                      ]
                    },
                    "amount": {
                      "type": "number",
                      "minimum": 0,
                      "exclusiveMaximum": 1000000000000000000,
                      "multipleOf": 0.01
                    }
                  },
                  "required": [
                    "days",
                    "type"
                  ],
                  "additionalProperties": false
                }
              },
              "deductions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "minLength": 3,
                      "maxLength": 15,
                      "pattern": "^[^|]+$",
                      "description": "Employer-assigned internal payroll accounting code, not the SAT type code"
                    },
                    "description": {
                      "description": "Optional payroll concept description",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100,
                      "pattern": "^[^|]+$"
                    },
                    "type": {
                      "description": "Known SAT payroll deduction-type code.",
                      "x-exac-sat-catalog": "payroll-deduction-types",
                      "oneOf": [
                        {
                          "type": "string",
                          "title": "SAT c_TipoDeduccion",
                          "description": "Consulta códigos y nombres vigentes [aquí](/docs/sat-catalogs/payroll#payroll-deduction-types).",
                          "enum": [
                            "100",
                            "101",
                            "102",
                            "103",
                            "104",
                            "105",
                            "106",
                            "107",
                            "108",
                            "109",
                            "110",
                            "111",
                            "112",
                            "113",
                            "114",
                            "115",
                            "001",
                            "002",
                            "003",
                            "004",
                            "005",
                            "006",
                            "007",
                            "008",
                            "009",
                            "010",
                            "011",
                            "012",
                            "013",
                            "014",
                            "015",
                            "016",
                            "017",
                            "018",
                            "019",
                            "020",
                            "021",
                            "022",
                            "023",
                            "024",
                            "025",
                            "026",
                            "027",
                            "028",
                            "029",
                            "030",
                            "031",
                            "032",
                            "033",
                            "034",
                            "035",
                            "036",
                            "037",
                            "038",
                            "039",
                            "040",
                            "041",
                            "042",
                            "043",
                            "044",
                            "045",
                            "046",
                            "047",
                            "048",
                            "049",
                            "050",
                            "051",
                            "052",
                            "053",
                            "054",
                            "055",
                            "056",
                            "057",
                            "058",
                            "059",
                            "060",
                            "061",
                            "062",
                            "063",
                            "064",
                            "065",
                            "066",
                            "067",
                            "068",
                            "069",
                            "070",
                            "071",
                            "072",
                            "073",
                            "074",
                            "075",
                            "076",
                            "077",
                            "078",
                            "079",
                            "080",
                            "081",
                            "082",
                            "083",
                            "084",
                            "085",
                            "086",
                            "087",
                            "088",
                            "089",
                            "090",
                            "091",
                            "092",
                            "093",
                            "094",
                            "095",
                            "096",
                            "097",
                            "098",
                            "099"
                          ]
                        }
                      ]
                    },
                    "amount": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "exclusiveMaximum": 1000000000000000000,
                      "multipleOf": 0.01
                    }
                  },
                  "required": [
                    "code",
                    "type",
                    "amount"
                  ],
                  "additionalProperties": false
                }
              },
              "otherPayments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "minLength": 3,
                      "maxLength": 15,
                      "pattern": "^[^|]+$",
                      "description": "Employer-assigned internal payroll accounting code, not the SAT type code"
                    },
                    "description": {
                      "description": "Optional payroll concept description",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100,
                      "pattern": "^[^|]+$"
                    },
                    "type": {
                      "description": "Known SAT payroll other-payment code.",
                      "x-exac-sat-catalog": "payroll-other-payment-types",
                      "oneOf": [
                        {
                          "type": "string",
                          "title": "SAT c_TipoOtroPago",
                          "description": "Consulta códigos y nombres vigentes [aquí](/docs/sat-catalogs/payroll#payroll-other-payment-types).",
                          "enum": [
                            "999",
                            "001",
                            "002",
                            "003",
                            "004",
                            "005",
                            "006",
                            "007",
                            "008",
                            "009"
                          ]
                        }
                      ]
                    },
                    "amount": {
                      "type": "number",
                      "minimum": 0,
                      "exclusiveMaximum": 1000000000000000000,
                      "multipleOf": 0.01,
                      "description": "Zero is allowed only for type 002."
                    },
                    "compensation": {
                      "description": "Required for 004. Current-year balances support periods wholly within December; mixed-month current-year periods are not yet supported.",
                      "type": "object",
                      "properties": {
                        "balance": {
                          "type": "number",
                          "minimum": 0,
                          "exclusiveMaximum": 1000000000000000000,
                          "multipleOf": 0.01
                        },
                        "year": {
                          "type": "integer",
                          "minimum": 2016,
                          "maximum": 32767
                        },
                        "remainingBalance": {
                          "type": "number",
                          "minimum": 0,
                          "exclusiveMaximum": 1000000000000000000,
                          "multipleOf": 0.01
                        }
                      },
                      "required": [
                        "balance",
                        "year",
                        "remainingBalance"
                      ],
                      "additionalProperties": false
                    },
                    "employmentSubsidy": {
                      "description": "Required for 002, at least amount; omitted for other types.",
                      "type": "number",
                      "minimum": 0,
                      "exclusiveMaximum": 1000000000000000000,
                      "multipleOf": 0.01
                    }
                  },
                  "required": [
                    "code",
                    "type",
                    "amount"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "paidOn",
              "periodStartedOn",
              "periodEndedOn",
              "paidDays",
              "employee",
              "earnings"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "kind",
          "employeeId",
          "payroll"
        ],
        "additionalProperties": false,
        "title": "CFDI N · payroll"
      },
      "InvoiceTransferInput": {
        "type": "object",
        "properties": {
          "pdfCustomSection": {
            "type": "string"
          },
          "emissionDate": {
            "description": "Emission instant with UTC offset; validated against the certification window at stamping.",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "customerId": {
            "type": "string",
            "minLength": 1
          },
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "product"
                    },
                    "productId": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Existing Exac product ID"
                    },
                    "quantity": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "unitPrice": {
                      "type": "number",
                      "const": 0
                    }
                  },
                  "required": [
                    "kind",
                    "productId",
                    "quantity",
                    "unitPrice"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "custom"
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1
                    },
                    "quantity": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "unitPrice": {
                      "type": "number",
                      "const": 0
                    },
                    "satProductCode": {
                      "type": "string",
                      "minLength": 1,
                      "description": "SAT product/service code"
                    },
                    "satUnitCode": {
                      "type": "string",
                      "minLength": 1,
                      "description": "SAT unit code"
                    }
                  },
                  "required": [
                    "kind",
                    "description",
                    "quantity",
                    "unitPrice",
                    "satProductCode",
                    "satUnitCode"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "kind": {
            "type": "string",
            "const": "transfer"
          }
        },
        "required": [
          "customerId",
          "items",
          "kind"
        ],
        "additionalProperties": false,
        "title": "CFDI T · transfer"
      },
      "InvoiceCreditNoteInput": {
        "type": "object",
        "properties": {
          "pdfCustomSection": {
            "type": "string"
          },
          "emissionDate": {
            "description": "Emission instant with UTC offset; validated against the certification window at stamping.",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "customerId": {
            "type": "string",
            "minLength": 1
          },
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "product"
                    },
                    "productId": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Existing Exac product ID"
                    },
                    "quantity": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "unitPrice": {
                      "type": "number",
                      "minimum": 0,
                      "description": "Unit price in pesos"
                    },
                    "discount": {
                      "type": "number",
                      "minimum": 0
                    },
                    "taxIncluded": {
                      "type": "boolean"
                    },
                    "deliveredOutsideBorderRegion": {
                      "description": "Border issuers: delivered or rendered outside the region, so no border IVA stimulus.",
                      "type": "boolean"
                    },
                    "borderOperation": {
                      "description": "Completed operation paid within ten calendar days after the border decree expires.",
                      "type": "object",
                      "properties": {
                        "completedOn": {
                          "type": "string",
                          "format": "date",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                          "description": "Date goods were delivered or services completed in the border region"
                        },
                        "paidOn": {
                          "type": "string",
                          "format": "date",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                          "description": "Date the consideration was paid"
                        }
                      },
                      "required": [
                        "completedOn",
                        "paidOn"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "kind",
                    "productId",
                    "quantity",
                    "unitPrice"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "custom"
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1
                    },
                    "quantity": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "unitPrice": {
                      "type": "number",
                      "minimum": 0,
                      "description": "Unit price in pesos"
                    },
                    "satProductCode": {
                      "type": "string",
                      "minLength": 1,
                      "description": "SAT product/service code"
                    },
                    "satUnitCode": {
                      "type": "string",
                      "minLength": 1,
                      "description": "SAT unit code"
                    },
                    "discount": {
                      "type": "number",
                      "minimum": 0
                    },
                    "taxIncluded": {
                      "type": "boolean"
                    },
                    "taxRate": {
                      "description": "The IVA rate you expect; the rules in force decide it and refuse another. A credit note keeps a rate its related invoice charged.",
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "taxability": {
                      "type": "string",
                      "enum": [
                        "standard",
                        "zero",
                        "exempt"
                      ]
                    },
                    "taxCategory": {
                      "description": "What the concept bills, for withholdings (service: professional fees). Optional: without it the CFDI states only the withholdings every operation type shares.",
                      "type": "string",
                      "pattern": "^[a-z][A-Za-z0-9]{0,63}$"
                    },
                    "deliveredOutsideBorderRegion": {
                      "description": "Border issuers: delivered or rendered outside the region, so no border IVA stimulus.",
                      "type": "boolean"
                    },
                    "borderOperation": {
                      "description": "Completed operation paid within ten calendar days after the border decree expires.",
                      "type": "object",
                      "properties": {
                        "completedOn": {
                          "type": "string",
                          "format": "date",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                          "description": "Date goods were delivered or services completed in the border region"
                        },
                        "paidOn": {
                          "type": "string",
                          "format": "date",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                          "description": "Date the consideration was paid"
                        }
                      },
                      "required": [
                        "completedOn",
                        "paidOn"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "kind",
                    "description",
                    "quantity",
                    "unitPrice",
                    "satProductCode",
                    "satUnitCode"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "kind": {
            "type": "string",
            "const": "credit_note"
          },
          "exchangeRate": {
            "description": "MXN per document-currency unit. Use 1 for MXN; this is not the payment document equivalence rate.",
            "type": "number",
            "exclusiveMinimum": 0
          },
          "formCode": {
            "description": "Known SAT payment-form code.",
            "x-exac-sat-catalog": "payment-forms",
            "oneOf": [
              {
                "type": "string",
                "title": "SAT c_FormaPago",
                "description": "Consulta códigos y nombres vigentes [aquí](/docs/sat-catalogs/invoicing#payment-forms).",
                "enum": [
                  "12",
                  "13",
                  "14",
                  "15",
                  "17",
                  "23",
                  "24",
                  "25",
                  "26",
                  "27",
                  "28",
                  "29",
                  "30",
                  "31",
                  "99",
                  "01",
                  "02",
                  "03",
                  "04",
                  "05",
                  "06",
                  "08"
                ]
              }
            ]
          },
          "methodCode": {
            "type": "string",
            "enum": [
              "PPD",
              "PUE"
            ],
            "description": "Known SAT payment-method code. Defaults to PUE when omitted.",
            "x-exac-sat-catalog": "payment-methods"
          },
          "relatedDocuments": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "relationship": {
                  "type": "string",
                  "enum": [
                    "01",
                    "02",
                    "03",
                    "04",
                    "05",
                    "06",
                    "07"
                  ],
                  "description": "Known SAT CFDI relationship-type code.",
                  "x-exac-sat-catalog": "relationship-types"
                },
                "documents": {
                  "minItems": 1,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": "Related CFDI UUIDs"
                }
              },
              "required": [
                "relationship",
                "documents"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "customerId",
          "items",
          "kind",
          "formCode",
          "relatedDocuments"
        ],
        "additionalProperties": false,
        "title": "CFDI E · credit_note"
      },
      "InvoiceIncomeInput": {
        "type": "object",
        "properties": {
          "pdfCustomSection": {
            "type": "string"
          },
          "emissionDate": {
            "description": "Emission instant with UTC offset; validated against the certification window at stamping.",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "customerId": {
            "type": "string",
            "minLength": 1
          },
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "product"
                    },
                    "productId": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Existing Exac product ID"
                    },
                    "quantity": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "unitPrice": {
                      "type": "number",
                      "minimum": 0,
                      "description": "Unit price in pesos"
                    },
                    "discount": {
                      "type": "number",
                      "minimum": 0
                    },
                    "taxIncluded": {
                      "type": "boolean"
                    },
                    "deliveredOutsideBorderRegion": {
                      "description": "Border issuers: delivered or rendered outside the region, so no border IVA stimulus.",
                      "type": "boolean"
                    },
                    "borderOperation": {
                      "description": "Completed operation paid within ten calendar days after the border decree expires.",
                      "type": "object",
                      "properties": {
                        "completedOn": {
                          "type": "string",
                          "format": "date",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                          "description": "Date goods were delivered or services completed in the border region"
                        },
                        "paidOn": {
                          "type": "string",
                          "format": "date",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                          "description": "Date the consideration was paid"
                        }
                      },
                      "required": [
                        "completedOn",
                        "paidOn"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "kind",
                    "productId",
                    "quantity",
                    "unitPrice"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "custom"
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1
                    },
                    "quantity": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "unitPrice": {
                      "type": "number",
                      "minimum": 0,
                      "description": "Unit price in pesos"
                    },
                    "satProductCode": {
                      "type": "string",
                      "minLength": 1,
                      "description": "SAT product/service code"
                    },
                    "satUnitCode": {
                      "type": "string",
                      "minLength": 1,
                      "description": "SAT unit code"
                    },
                    "discount": {
                      "type": "number",
                      "minimum": 0
                    },
                    "taxIncluded": {
                      "type": "boolean"
                    },
                    "taxRate": {
                      "description": "The IVA rate you expect; the rules in force decide it and refuse another. A credit note keeps a rate its related invoice charged.",
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "taxability": {
                      "type": "string",
                      "enum": [
                        "standard",
                        "zero",
                        "exempt"
                      ]
                    },
                    "taxCategory": {
                      "description": "What the concept bills, for withholdings (service: professional fees). Optional: without it the CFDI states only the withholdings every operation type shares.",
                      "type": "string",
                      "pattern": "^[a-z][A-Za-z0-9]{0,63}$"
                    },
                    "deliveredOutsideBorderRegion": {
                      "description": "Border issuers: delivered or rendered outside the region, so no border IVA stimulus.",
                      "type": "boolean"
                    },
                    "borderOperation": {
                      "description": "Completed operation paid within ten calendar days after the border decree expires.",
                      "type": "object",
                      "properties": {
                        "completedOn": {
                          "type": "string",
                          "format": "date",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                          "description": "Date goods were delivered or services completed in the border region"
                        },
                        "paidOn": {
                          "type": "string",
                          "format": "date",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                          "description": "Date the consideration was paid"
                        }
                      },
                      "required": [
                        "completedOn",
                        "paidOn"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "kind",
                    "description",
                    "quantity",
                    "unitPrice",
                    "satProductCode",
                    "satUnitCode"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "kind": {
            "type": "string",
            "const": "income"
          },
          "exchangeRate": {
            "description": "MXN per document-currency unit. Use 1 for MXN; this is not the payment document equivalence rate.",
            "type": "number",
            "exclusiveMinimum": 0
          },
          "inventoryImpact": {
            "description": "Optional stock deduction on issuance; null disables. Location must hold every location-assigned product.",
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "locationId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "cfdiUse": {
            "description": "Known SAT CFDI-use code.",
            "x-exac-sat-catalog": "cfdi-uses",
            "oneOf": [
              {
                "type": "string",
                "title": "SAT c_UsoCFDI",
                "description": "Consulta códigos y nombres vigentes [aquí](/docs/sat-catalogs/invoicing#cfdi-uses).",
                "enum": [
                  "CN01",
                  "CP01",
                  "D01",
                  "D02",
                  "D03",
                  "D04",
                  "D05",
                  "D06",
                  "D07",
                  "D08",
                  "D09",
                  "D10",
                  "G01",
                  "G02",
                  "G03",
                  "I01",
                  "I02",
                  "I03",
                  "I04",
                  "I05",
                  "I06",
                  "I07",
                  "I08",
                  "S01"
                ]
              }
            ]
          },
          "payment": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "timing": {
                    "type": "string",
                    "const": "single_payment"
                  },
                  "formCode": {
                    "description": "Known SAT payment-form code.",
                    "x-exac-sat-catalog": "payment-forms",
                    "oneOf": [
                      {
                        "type": "string",
                        "title": "SAT c_FormaPago",
                        "description": "Consulta códigos y nombres vigentes [aquí](/docs/sat-catalogs/invoicing#payment-forms).",
                        "enum": [
                          "12",
                          "13",
                          "14",
                          "15",
                          "17",
                          "23",
                          "24",
                          "25",
                          "26",
                          "27",
                          "28",
                          "29",
                          "30",
                          "31",
                          "99",
                          "01",
                          "02",
                          "03",
                          "04",
                          "05",
                          "06",
                          "08"
                        ]
                      }
                    ]
                  },
                  "conditions": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "timing",
                  "formCode"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "timing": {
                    "type": "string",
                    "const": "deferred_or_installments"
                  },
                  "formCode": {
                    "type": "string",
                    "const": "99"
                  },
                  "dueDate": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                    "description": "Calendar date in YYYY-MM-DD format"
                  },
                  "settlementTerms": {
                    "type": "object",
                    "properties": {
                      "installmentCount": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      },
                      "firstDue": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "transaction_date"
                              }
                            },
                            "required": [
                              "kind"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "months_after_transaction"
                              },
                              "months": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 60
                              }
                            },
                            "required": [
                              "kind",
                              "months"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "fixed_date"
                              },
                              "date": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind",
                              "date"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "recurrence": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "anchor_day"
                              }
                            },
                            "required": [
                              "kind"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "day_of_month"
                              },
                              "day": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 31
                              }
                            },
                            "required": [
                              "kind",
                              "day"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "last_day"
                              }
                            },
                            "required": [
                              "kind"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "required": [
                      "installmentCount",
                      "firstDue",
                      "recurrence"
                    ],
                    "additionalProperties": false
                  },
                  "conditions": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "timing",
                  "formCode"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "customerId",
          "items",
          "kind",
          "cfdiUse",
          "payment"
        ],
        "additionalProperties": false,
        "title": "CFDI I · income"
      }
    }
  }
}
```

[OpenAPI 3.1](/openapi.json)

## Herramientas MCP equivalentes

- [`create_invoice_draft`](/docs/mcp/tools/create_invoice_draft.md)

- [`create_payroll_invoice_draft`](/docs/mcp/tools/create_payroll_invoice_draft.md)

Documentación completa: https://exac.mx/docs.md
Índice para agentes: https://exac.mx/docs/llms.txt
