---
title: "Archivar factura de una cuenta"
description: "Archiva o restaura una factura PPD en cuentas por cobrar o por pagar sin modificar su saldo fiscal ni ocultarla en otras secciones."
language: es-MX
canonical_url: "https://exac.mx/docs/mcp/tools/archive_account_document"
md_url: "https://exac.mx/docs/mcp/tools/archive_account_document.md"
---

# Archivar factura de una cuenta

Archiva o restaura una factura PPD en cuentas por cobrar o por pagar sin modificar su saldo fiscal ni ocultarla en otras secciones.

Herramienta: `archive_account_document`

## Propósito

Archiva o restaura una factura PPD en cuentas por cobrar o por pagar sin modificar su saldo fiscal ni ocultarla en otras secciones.

### Úsala cuando

Una factura ya no requiere seguimiento de cobro o pago, o debe regresar a las cuentas activas.

### No la uses cuando

Necesitas registrar un pago, emitir una nota de crédito o modificar el estado fiscal.

| Detalle | Valor |
| --- | --- |
| Permisos | Según input.kind: receivable → receivables:manage; payable → payables:manage |
| Efectos secundarios | Destructivo |
| Idempotencia | Idempotente |

## Esquema de entrada

```json
{
  "type": "object",
  "properties": {
    "idempotencyKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Unique retry key for this exact operation. Reuse it only when retrying the same request."
    },
    "input": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "archived": {
              "$ref": "#/definitions/__schema0"
            },
            "kind": {
              "const": "receivable"
            },
            "customerId": {
              "type": "string"
            },
            "documentRef": {
              "type": "string",
              "pattern": "^cfdi:.+$"
            }
          },
          "required": [
            "archived",
            "kind",
            "customerId",
            "documentRef"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "archived": {
              "$ref": "#/definitions/__schema0"
            },
            "kind": {
              "const": "payable"
            },
            "supplierId": {
              "type": "string"
            },
            "documentRef": {
              "type": "string",
              "pattern": "^cfdi:.+$"
            }
          },
          "required": [
            "archived",
            "kind",
            "supplierId",
            "documentRef"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "idempotencyKey",
    "input"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "definitions": {
    "__schema0": {
      "type": "boolean"
    }
  }
}
```

## Esquema de salida

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "archived": {
          "type": "boolean"
        }
      },
      "required": [
        "archived"
      ],
      "additionalProperties": false
    },
    "error": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "code": {
          "enum": [
            "validation_error",
            "unauthenticated",
            "forbidden",
            "payment_required",
            "not_found",
            "method_not_allowed",
            "conflict",
            "idempotency_conflict",
            "operation_in_progress",
            "recovery_required",
            "migration_required",
            "rate_limited",
            "provider_unavailable",
            "internal"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "object",
          "properties": {
            "document": {
              "type": "object",
              "properties": {
                "documentRef": {
                  "type": "string",
                  "pattern": "^(cfdi|withholding|sales_receipt|declaration|tax_compliance_opinion|sales_receipt_refund):.+$"
                },
                "editable": {
                  "type": "boolean"
                }
              },
              "required": [
                "documentRef",
                "editable"
              ],
              "additionalProperties": false
            },
            "issues": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    }
                  },
                  "message": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "path",
                  "message"
                ],
                "additionalProperties": false
              }
            },
            "retryable": {
              "type": "boolean"
            },
            "retryAfterSeconds": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            "reason": {
              "type": "string"
            },
            "balanceMinor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "topUpUrl": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": false
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "oneOf": [
    {
      "required": [
        "data"
      ]
    },
    {
      "required": [
        "error"
      ]
    }
  ]
}
```

## Herramientas relacionadas

- [`get_accounts`](/docs/mcp/tools/get_accounts.md) — **Leer cuentas**: Busca cuentas por cobrar o por pagar y consulta sus movimientos.

## Flujo relacionado

[Consulta los flujos canónicos en la introducción](/docs.md)

## Operaciones REST equivalentes

- [`POST /v1/accounts/receivables/{customerId}/invoices/{documentRef}/archive`](/docs/api/accounts-payments/accounts/set-receivable-archived.md)

- [`POST /v1/accounts/payables/{supplierId}/invoices/{documentRef}/archive`](/docs/api/accounts-payments/accounts/set-payable-archived.md)

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