---
title: "Archivar CFDI"
description: "Archiva o restaura un CFDI sin cambiar su estado fiscal."
language: es-MX
canonical_url: "https://exac.mx/docs/api/documents/cfdi/archive-cfdi"
md_url: "https://exac.mx/docs/api/documents/cfdi/archive-cfdi.md"
---

# Archivar CFDI

Archiva o restaura un CFDI sin cambiar su estado fiscal.

## Solicitud

`PUT /v1/cfdis/{documentRef}/archive`

- **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": "PUT",
  "path": "/v1/cfdis/{documentRef}/archive",
  "operation": {
    "operationId": "archiveCfdi",
    "tags": [
      "CFDI"
    ],
    "summary": "Archivar CFDI",
    "description": "Archiva o restaura un CFDI sin cambiar su estado fiscal.",
    "security": [
      {
        "bearerAuth": []
      }
    ],
    "parameters": [
      {
        "name": "documentRef",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^cfdi:.+$"
        }
      },
      {
        "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": {
            "type": "object",
            "properties": {
              "archived": {
                "type": "boolean",
                "description": "true archives a fiscal document; false restores it"
              }
            },
            "required": [
              "archived"
            ],
            "additionalProperties": false
          },
          "example": {
            "archived": true
          }
        }
      }
    },
    "responses": {
      "200": {
        "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": "valid",
                "archived": true,
                "uuid": "00000000-0000-4000-8000-000000000001",
                "counterpartyName": "Estudio Jacaranda",
                "total": {
                  "amount": 11600,
                  "currency": "MXN"
                },
                "documentRef": "cfdi:invoice-example",
                "category": "cfdi",
                "issuedLocalDateTime": "2026-07-15T12:00:00",
                "series": "A",
                "folio": "1042",
                "fiscal": {
                  "subtotal": 10000,
                  "ivaTransferred": 1600,
                  "totalMxn": 11600,
                  "placeOfIssue": "82110",
                  "exportation": "01",
                  "cfdiUse": "G03",
                  "stampedLocalDateTime": "2026-07-15T12:01:00"
                },
                "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
      }
    }
  }
}
```

[OpenAPI 3.1](/openapi.json)

## Herramientas MCP equivalentes

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

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