Docs
Servidor MCPHerramientas disponibles

Actualizar estado CFDI

Consulta al SAT el estado actual de un CFDI timbrado y concilia el estado local.

Herramienta MCPrefresh_cfdi_status

Propósito

Consulta al SAT el estado actual de un CFDI timbrado y concilia el estado local.

Usar cuando
Un CFDI timbrado requiere verificación oficial de estado.
No usar cuando
Sigue en borrador o necesitas emitir otro documento.
Permisos requeridos
invoices:manage
Efectos secundarios
Efecto externo
Idempotencia
Idempotente

Esquema de entrada

JSON Schema
{  "type": "object",  "properties": {    "documentRef": {      "type": "string",      "pattern": "^cfdi:",      "description": "Stamped CFDI documentRef"    },    "idempotencyKey": {      "type": "string",      "minLength": 1,      "maxLength": 200,      "description": "Unique retry key for this exact operation. Reuse it only when retrying the same request."    }  },  "required": [    "documentRef",    "idempotencyKey"  ],  "$schema": "http://json-schema.org/draft-07/schema#",  "additionalProperties": false}

Esquema de salida

JSON Schema
{  "type": "object",  "properties": {    "data": {      "type": "object",      "properties": {        "source": {          "type": "string",          "enum": [            "webhook",            "sat_query",            "sat_bulk"          ]        },        "documentStatus": {          "type": "string",          "enum": [            "valid",            "canceled",            "not_found"          ]        },        "cancellability": {          "type": "string",          "enum": [            "unknown",            "not_cancellable",            "without_acceptance",            "with_acceptance"          ]        },        "cancellation": {          "oneOf": [            {              "type": "object",              "properties": {                "state": {                  "type": "string",                  "const": "unchanged"                }              },              "required": [                "state"              ],              "additionalProperties": false            },            {              "type": "object",              "properties": {                "state": {                  "type": "string",                  "const": "none"                }              },              "required": [                "state"              ],              "additionalProperties": false            },            {              "type": "object",              "properties": {                "state": {                  "type": "string",                  "const": "pending"                },                "phase": {                  "type": "string",                  "enum": [                    "requested",                    "verifying"                  ]                }              },              "required": [                "state",                "phase"              ],              "additionalProperties": false            },            {              "type": "object",              "properties": {                "state": {                  "type": "string",                  "const": "rejected"                }              },              "required": [                "state"              ],              "additionalProperties": false            },            {              "type": "object",              "properties": {                "state": {                  "type": "string",                  "const": "expired"                }              },              "required": [                "state"              ],              "additionalProperties": false            },            {              "type": "object",              "properties": {                "state": {                  "type": "string",                  "const": "completed"                },                "resolution": {                  "type": "string",                  "enum": [                    "accepted",                    "without_acceptance",                    "timeout",                    "unknown"                  ]                }              },              "required": [                "state",                "resolution"              ],              "additionalProperties": false            }          ]        },        "observedAt": {          "$ref": "#/definitions/__schema0"        },        "cancellationDate": {          "allOf": [            {              "$ref": "#/definitions/__schema0"            }          ]        }      },      "required": [        "source",        "documentStatus",        "cancellability",        "cancellation",        "observedAt"      ],      "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,  "definitions": {    "__schema0": {      "type": "string",      "format": "date-time"    }  },  "oneOf": [    {      "required": [        "data"      ]    },    {      "required": [        "error"      ]    }  ]}

Flujo relacionado

Consulta los flujos canónicos en la introducción

Herramientas relacionadas