---
title: "Crear borrador de CFDI"
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/cfdi/create-cfdi-draft"
md_url: "https://exac.mx/docs/api/documents/cfdi/create-cfdi-draft.md"
---

# Crear borrador de CFDI

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/cfdis`

- **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/cfdis",
  "operation": {
    "operationId": "createCfdiDraft",
    "tags": [
      "CFDI"
    ],
    "summary": "Crear borrador de CFDI",
    "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/CfdiDraftInput"
          },
          "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": 100
                  }
                ],
                "kind": "transfer"
              }
            },
            "payroll": {
              "summary": "Payroll CFDI",
              "value": {
                "kind": "payroll",
                "employeeId": "employee-example",
                "payroll": {
                  "paidOn": "2026-07-15",
                  "periodStartedOn": "2026-07-01",
                  "periodEndedOn": "2026-07-15",
                  "paidDays": 15,
                  "employee": {
                    "curp": "GODE561231HDFRRN09",
                    "employeeNumber": "E-100",
                    "employmentStartedOn": "2025-01-01",
                    "contractType": "01",
                    "regimeType": "02",
                    "paymentFrequency": "04",
                    "stateCode": "CMX"
                  },
                  "earnings": [
                    {
                      "type": "001",
                      "taxableAmount": 1000,
                      "exemptAmount": 0
                    }
                  ]
                }
              }
            },
            "paymentComplement": {
              "summary": "Payment complement · automatic taxes",
              "value": {
                "kind": "payment_complement",
                "customerId": "customer-example",
                "payment": {
                  "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",
                "payment": {
                  "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/CfdiDetail"
                }
              },
              "required": [
                "data"
              ],
              "additionalProperties": false
            },
            "example": {
              "data": {
                "direction": "issued",
                "status": "draft",
                "archived": false,
                "counterpartyName": "Estudio Jacaranda",
                "total": {
                  "amount": 11600,
                  "currency": "MXN"
                },
                "documentRef": "cfdi:invoice-example",
                "category": "cfdi",
                "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`.",
        "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",
              "not_found",
              "method_not_allowed",
              "conflict",
              "idempotency_conflict",
              "operation_in_progress",
              "recovery_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- `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- `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": {
              "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
              }
            },
            "additionalProperties": false
          },
          "status": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "code",
          "message",
          "status"
        ],
        "additionalProperties": false
      },
      "CfdiDetail": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CfdiIncomeComplete"
          },
          {
            "$ref": "#/components/schemas/CfdiIncomePartial"
          },
          {
            "$ref": "#/components/schemas/CfdiCreditNoteComplete"
          },
          {
            "$ref": "#/components/schemas/CfdiCreditNotePartial"
          },
          {
            "$ref": "#/components/schemas/CfdiTransferComplete"
          },
          {
            "$ref": "#/components/schemas/CfdiTransferPartial"
          },
          {
            "$ref": "#/components/schemas/CfdiPayrollComplete"
          },
          {
            "$ref": "#/components/schemas/CfdiPayrollPartial"
          },
          {
            "$ref": "#/components/schemas/CfdiPaymentComplementComplete"
          },
          {
            "$ref": "#/components/schemas/CfdiPaymentComplementPartial"
          }
        ]
      },
      "CfdiPaymentComplementPartial": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "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
          },
          "receivablePlanId": {
            "type": "string"
          },
          "documentRef": {
            "type": "string",
            "pattern": "^cfdi:.+$"
          },
          "category": {
            "type": "string",
            "const": "cfdi"
          },
          "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)))$"
              }
            },
            "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"
              },
              "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": {
                      "type": "number"
                    },
                    "relatedCfdis": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "uuid": {
                            "type": "string"
                          },
                          "series": {
                            "type": "string"
                          },
                          "folio": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "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
      },
      "CfdiPaymentComplementComplete": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "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
          },
          "receivablePlanId": {
            "type": "string"
          },
          "documentRef": {
            "type": "string",
            "pattern": "^cfdi:.+$"
          },
          "category": {
            "type": "string",
            "const": "cfdi"
          },
          "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)))$"
              }
            },
            "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"
              },
              "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": {
                      "type": "number"
                    },
                    "relatedCfdis": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "uuid": {
                            "type": "string"
                          },
                          "series": {
                            "type": "string"
                          },
                          "folio": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "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
      },
      "CfdiPayrollPartial": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "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
          },
          "receivablePlanId": {
            "type": "string"
          },
          "documentRef": {
            "type": "string",
            "pattern": "^cfdi:.+$"
          },
          "category": {
            "type": "string",
            "const": "cfdi"
          },
          "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)))$"
              }
            },
            "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"
              },
              "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": {
              "paidDays": {
                "type": "number"
              },
              "earnings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "taxableAmount": {
                      "type": "number"
                    },
                    "exemptAmount": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "deductions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "otherPayments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    },
                    "employmentSubsidy": {
                      "type": "number"
                    }
                  },
                  "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"
                  },
                  "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
      },
      "CfdiPayrollComplete": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "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
          },
          "receivablePlanId": {
            "type": "string"
          },
          "documentRef": {
            "type": "string",
            "pattern": "^cfdi:.+$"
          },
          "category": {
            "type": "string",
            "const": "cfdi"
          },
          "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)))$"
              }
            },
            "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"
              },
              "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": {
              "paidDays": {
                "type": "number"
              },
              "earnings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "taxableAmount": {
                      "type": "number"
                    },
                    "exemptAmount": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "deductions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "otherPayments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    },
                    "employmentSubsidy": {
                      "type": "number"
                    }
                  },
                  "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"
                  },
                  "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
      },
      "CfdiTransferPartial": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "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
          },
          "receivablePlanId": {
            "type": "string"
          },
          "documentRef": {
            "type": "string",
            "pattern": "^cfdi:.+$"
          },
          "category": {
            "type": "string",
            "const": "cfdi"
          },
          "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)))$"
              }
            },
            "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"
              },
              "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
      },
      "CfdiTransferComplete": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "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
          },
          "receivablePlanId": {
            "type": "string"
          },
          "documentRef": {
            "type": "string",
            "pattern": "^cfdi:.+$"
          },
          "category": {
            "type": "string",
            "const": "cfdi"
          },
          "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)))$"
              }
            },
            "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"
              },
              "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
      },
      "CfdiCreditNotePartial": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "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
          },
          "receivablePlanId": {
            "type": "string"
          },
          "documentRef": {
            "type": "string",
            "pattern": "^cfdi:.+$"
          },
          "category": {
            "type": "string",
            "const": "cfdi"
          },
          "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)))$"
              }
            },
            "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"
              },
              "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"
              },
              "effectiveRemainingBalance": {
                "type": "number"
              },
              "manualAdjustmentNeedsReview": {
                "type": "boolean"
              },
              "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
      },
      "CfdiCreditNoteComplete": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "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
          },
          "receivablePlanId": {
            "type": "string"
          },
          "documentRef": {
            "type": "string",
            "pattern": "^cfdi:.+$"
          },
          "category": {
            "type": "string",
            "const": "cfdi"
          },
          "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)))$"
              }
            },
            "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"
              },
              "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"
              },
              "effectiveRemainingBalance": {
                "type": "number"
              },
              "manualAdjustmentNeedsReview": {
                "type": "boolean"
              },
              "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
      },
      "CfdiIncomePartial": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "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
          },
          "receivablePlanId": {
            "type": "string"
          },
          "documentRef": {
            "type": "string",
            "pattern": "^cfdi:.+$"
          },
          "category": {
            "type": "string",
            "const": "cfdi"
          },
          "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)))$"
              }
            },
            "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"
              },
              "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"
              },
              "effectiveRemainingBalance": {
                "type": "number"
              },
              "manualAdjustmentNeedsReview": {
                "type": "boolean"
              },
              "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
      },
      "CfdiIncomeComplete": {
        "type": "object",
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "issued",
              "received"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "valid",
              "canceled"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "uuid": {
            "type": "string"
          },
          "counterpartyName": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          },
          "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
          },
          "receivablePlanId": {
            "type": "string"
          },
          "documentRef": {
            "type": "string",
            "pattern": "^cfdi:.+$"
          },
          "category": {
            "type": "string",
            "const": "cfdi"
          },
          "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)))$"
              }
            },
            "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"
              },
              "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"
              },
              "effectiveRemainingBalance": {
                "type": "number"
              },
              "manualAdjustmentNeedsReview": {
                "type": "boolean"
              },
              "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
      },
      "CfdiDraftInput": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CfdiIncomeInput"
          },
          {
            "$ref": "#/components/schemas/CfdiCreditNoteInput"
          },
          {
            "$ref": "#/components/schemas/CfdiTransferInput"
          },
          {
            "$ref": "#/components/schemas/CfdiPayrollInput"
          },
          {
            "$ref": "#/components/schemas/CfdiPaymentComplementInput"
          }
        ]
      },
      "CfdiPaymentComplementInput": {
        "type": "object",
        "properties": {
          "pdfCustomSection": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "const": "payment_complement"
          },
          "customerId": {
            "type": "string",
            "minLength": 1
          },
          "payment": {
            "type": "object",
            "properties": {
              "formCode": {
                "description": "Active 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",
                      "02",
                      "06",
                      "01",
                      "05",
                      "04",
                      "03",
                      "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": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "taxes": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "auto",
                          "description": "Let Exac calculate payment-level taxes from a related CFDI already known to the organization"
                        },
                        {
                          "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"
                        }
                      ],
                      "description": "Use auto for known CFDIs; otherwise send taxObject and rows"
                    }
                  },
                  "required": [
                    "uuid",
                    "amount",
                    "installment",
                    "previousBalance",
                    "taxes"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "formCode",
              "documents"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "kind",
          "customerId",
          "payment"
        ],
        "additionalProperties": false,
        "title": "CFDI P · payment_complement"
      },
      "CfdiPayrollInput": {
        "type": "object",
        "properties": {
          "pdfCustomSection": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "kind": {
            "type": "string",
            "const": "payroll"
          },
          "employeeId": {
            "type": "string",
            "minLength": 1
          },
          "payroll": {
            "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])))$"
              },
              "periodStartedOn": {
                "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])))$"
              },
              "periodEndedOn": {
                "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])))$"
              },
              "paidDays": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "employee": {
                "type": "object",
                "properties": {
                  "curp": {
                    "type": "string",
                    "minLength": 1
                  },
                  "employeeNumber": {
                    "type": "string",
                    "minLength": 1
                  },
                  "socialSecurityNumber": {
                    "type": "string",
                    "minLength": 1
                  },
                  "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])))$"
                  },
                  "contractType": {
                    "description": "Active 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": "Active 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": "Active 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": "Active 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",
                          "CHP",
                          "CHH",
                          "COA",
                          "COL",
                          "CMX",
                          "DUR",
                          "GUA",
                          "GRO",
                          "HID",
                          "JAL",
                          "MEX",
                          "MIC",
                          "MOR",
                          "NAY",
                          "NLE",
                          "OAX",
                          "PUE",
                          "QUE",
                          "ROO",
                          "SLP",
                          "SIN",
                          "SON",
                          "TAB",
                          "TAM",
                          "TLA",
                          "VER",
                          "YUC",
                          "ZAC"
                        ]
                      }
                    ]
                  },
                  "positionRisk": {
                    "type": "string",
                    "enum": [
                      "1",
                      "2",
                      "3",
                      "4",
                      "5",
                      "99"
                    ],
                    "description": "Active SAT payroll position-risk code.",
                    "x-exac-sat-catalog": "payroll-position-risks"
                  },
                  "integratedDailySalary": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                },
                "required": [
                  "curp",
                  "employeeNumber",
                  "employmentStartedOn",
                  "contractType",
                  "regimeType",
                  "paymentFrequency",
                  "stateCode"
                ],
                "additionalProperties": false
              },
              "earnings": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "description": "Active 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"
                          ]
                        }
                      ]
                    },
                    "taxableAmount": {
                      "type": "number",
                      "minimum": 0
                    },
                    "exemptAmount": {
                      "type": "number",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "type",
                    "taxableAmount",
                    "exemptAmount"
                  ],
                  "additionalProperties": false
                }
              },
              "deductions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "minLength": 1,
                      "description": "SAT deduction type code"
                    },
                    "amount": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "type",
                    "amount"
                  ],
                  "additionalProperties": false
                }
              },
              "otherPayments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "description": "Active 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",
                      "exclusiveMinimum": 0
                    },
                    "employmentSubsidy": {
                      "type": "number",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "type",
                    "amount"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "paidOn",
              "employee",
              "earnings"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "kind",
          "employeeId",
          "payroll"
        ],
        "additionalProperties": false,
        "title": "CFDI N · payroll"
      },
      "CfdiTransferInput": {
        "type": "object",
        "properties": {
          "pdfCustomSection": {
            "type": "string"
          },
          "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"
                    }
                  },
                  "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": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "taxability": {
                      "type": "string",
                      "enum": [
                        "standard",
                        "zero",
                        "exempt"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "description",
                    "quantity",
                    "unitPrice",
                    "satProductCode",
                    "satUnitCode"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "kind": {
            "type": "string",
            "const": "transfer"
          }
        },
        "required": [
          "customerId",
          "items",
          "kind"
        ],
        "additionalProperties": false,
        "title": "CFDI T · transfer"
      },
      "CfdiCreditNoteInput": {
        "type": "object",
        "properties": {
          "pdfCustomSection": {
            "type": "string"
          },
          "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"
                    }
                  },
                  "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": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "taxability": {
                      "type": "string",
                      "enum": [
                        "standard",
                        "zero",
                        "exempt"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "description",
                    "quantity",
                    "unitPrice",
                    "satProductCode",
                    "satUnitCode"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "kind": {
            "type": "string",
            "const": "credit_note"
          },
          "formCode": {
            "description": "Active 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",
                  "02",
                  "06",
                  "01",
                  "05",
                  "04",
                  "03",
                  "08"
                ]
              }
            ]
          },
          "methodCode": {
            "type": "string",
            "enum": [
              "PPD",
              "PUE"
            ],
            "description": "Active 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": [
                    "07",
                    "03",
                    "06",
                    "01",
                    "02",
                    "04",
                    "05"
                  ],
                  "description": "Active 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"
      },
      "CfdiIncomeInput": {
        "type": "object",
        "properties": {
          "pdfCustomSection": {
            "type": "string"
          },
          "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"
                    }
                  },
                  "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": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "taxability": {
                      "type": "string",
                      "enum": [
                        "standard",
                        "zero",
                        "exempt"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "description",
                    "quantity",
                    "unitPrice",
                    "satProductCode",
                    "satUnitCode"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "kind": {
            "type": "string",
            "const": "income"
          },
          "cfdiUse": {
            "description": "Active 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": [
                  "G01",
                  "D06",
                  "I07",
                  "I06",
                  "I01",
                  "I05",
                  "D09",
                  "G02",
                  "D04",
                  "I04",
                  "I03",
                  "D08",
                  "G03",
                  "D03",
                  "D02",
                  "D01",
                  "D05",
                  "I02",
                  "CN01",
                  "I08",
                  "CP01",
                  "D10",
                  "D07",
                  "S01"
                ]
              }
            ]
          },
          "payment": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "timing": {
                    "type": "string",
                    "const": "single_payment"
                  },
                  "formCode": {
                    "description": "Active 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",
                          "02",
                          "06",
                          "01",
                          "05",
                          "04",
                          "03",
                          "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_cfdi_draft`](/docs/mcp/tools/create_cfdi_draft.md)

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