---
title: "Stamp CFDI"
description: "Irreversibly stamp an existing CFDI draft. Review the draft first with get_document. Safe retries require reusing the same idempotencyKey."
language: en
canonical_url: "https://exac.mx/docs/en/mcp/tools/stamp_cfdi"
md_url: "https://exac.mx/docs/en/mcp/tools/stamp_cfdi.md"
---

# Stamp CFDI

Irreversibly stamp an existing CFDI draft. Review the draft first with get_document. Safe retries require reusing the same idempotencyKey.

Tool: `stamp_cfdi`

## Purpose

Irreversibly submit a CFDI draft for SAT stamping.

### Use when

The draft has been reviewed and is ready for issuance.

### Do not use when

The draft still needs edits or the document is not a CFDI.

| Detail | Value |
| --- | --- |
| Permissions | invoices:manage |
| Side effects | Destructive and external |
| Idempotency | Idempotent |

## Input schema

```json
{
  "type": "object",
  "properties": {
    "documentRef": {
      "type": "string",
      "pattern": "^cfdi:",
      "description": "CFDI documentRef returned by search_documents"
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Unique retry key for this exact operation. Reuse it only when retrying the same request."
    },
    "emissionDate": {
      "description": "Optional SAT-valid emission timestamp to apply while stamping the draft",
      "allOf": [
        {
          "$ref": "#/definitions/__schema0"
        }
      ]
    }
  },
  "required": [
    "documentRef",
    "idempotencyKey"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "definitions": {
    "__schema0": {
      "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))$"
    }
  }
}
```

## Output schema

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "documentRef": {
          "type": "string",
          "pattern": "^cfdi:.+$"
        },
        "status": {
          "type": "string",
          "const": "valid"
        },
        "uuid": {
          "type": "string"
        },
        "stampedLocalDateTime": {
          "type": "string",
          "pattern": "^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,9}))?$"
        }
      },
      "required": [
        "documentRef",
        "status",
        "uuid"
      ],
      "additionalProperties": false
    },
    "error": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "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"
          ]
        },
        "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
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": false
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "oneOf": [
    {
      "required": [
        "data"
      ]
    },
    {
      "required": [
        "error"
      ]
    }
  ]
}
```

## Related tools

- [`get_document`](/docs/en/mcp/tools/get_document.md) — **Get document**: Retrieve one document by its public documentRef. Sales receipt details include stable lineRef values and remaining refundable amounts for sales receipt refunds.

- [`refresh_cfdi_status`](/docs/en/mcp/tools/refresh_cfdi_status.md) — **Refresh CFDI status**: Consult SAT directly for the current status of a stamped CFDI and reconcile the local document state. This requires verification data captured from its XML.

- [`send_document`](/docs/en/mcp/tools/send_document.md) — **Send document**: Send a document to a recipient. CFDI documents support the document or cancellation_receipt attachment set; sales receipts and quotes support document only.

## Related workflow

[See the canonical workflows in the introduction](/docs/en.md)

## Equivalent REST operations

- [`POST /v1/cfdis/{documentRef}/stamp`](/docs/en/api/documents/cfdi/stamp-cfdi.md)

Complete documentation: https://exac.mx/docs/en.md
Agent documentation index: https://exac.mx/docs/en/llms.txt
