Docs
Servidor MCPHerramientas disponibles

Leer resumen CFDI

Consulta agregados financieros de documentos CFDI por periodo.

Herramienta MCPget_cfdi_summary

Propósito

Consulta agregados financieros de documentos CFDI por periodo.

Usar cuando
Necesitas ingresos, gastos o nómina fiscal reconocidos.
No usar cuando
Necesitas ventas POS o impuestos declarados oficiales.
Permisos requeridos
analytics:read
Efectos secundarios
Ninguno
Idempotencia
Idempotente

Esquema de entrada

JSON Schema
{  "type": "object",  "properties": {    "monthFrom": {      "description": "First included month in YYYY-MM; defaults to 2020-01",      "allOf": [        {          "$ref": "#/definitions/__schema0"        }      ]    },    "monthTo": {      "description": "Last included month in YYYY-MM; defaults to current month",      "allOf": [        {          "$ref": "#/definitions/__schema1"        }      ]    },    "contributorLimit": {      "description": "Top contributors per category; defaults to 5",      "allOf": [        {          "$ref": "#/definitions/__schema2"        }      ]    }  },  "$schema": "http://json-schema.org/draft-07/schema#",  "additionalProperties": false,  "definitions": {    "__schema0": {      "type": "string"    },    "__schema1": {      "type": "string"    },    "__schema2": {      "type": "integer",      "minimum": 1,      "maximum": 10    }  }}

Esquema de salida

JSON Schema
{  "type": "object",  "properties": {    "data": {      "type": "object",      "properties": {        "source": {          "type": "string",          "const": "cfdi_activity"        },        "currency": {          "type": "string",          "const": "MXN"        },        "period": {          "type": "object",          "properties": {            "monthFrom": {              "$ref": "#/definitions/__schema0"            },            "monthTo": {              "$ref": "#/definitions/__schema0"            }          },          "required": [            "monthFrom",            "monthTo"          ],          "additionalProperties": false        },        "accountingBasis": {          "type": "string",          "enum": [            "cash",            "accrual"          ]        },        "receiptSalesIncluded": {          "type": "boolean",          "const": false        },        "totals": {          "type": "object",          "properties": {            "recognizedIncome": {              "type": "number"            },            "recognizedExpenses": {              "type": "number"            },            "payrollPaid": {              "type": "number"            },            "payrollReceived": {              "type": "number"            },            "balance": {              "type": "number"            },            "payrollIncludedInBalance": {              "type": "boolean",              "const": false            }          },          "required": [            "recognizedIncome",            "recognizedExpenses",            "payrollPaid",            "payrollReceived",            "balance",            "payrollIncludedInBalance"          ],          "additionalProperties": false        },        "contributors": {          "type": "object",          "properties": {            "source": {              "type": "string",              "const": "cfdi_activity"            },            "income": {              "type": "array",              "items": {                "$ref": "#/definitions/__schema1"              }            },            "expenses": {              "type": "array",              "items": {                "$ref": "#/definitions/__schema1"              }            },            "payroll": {              "type": "array",              "items": {                "type": "object",                "properties": {                  "name": {                    "$ref": "#/definitions/__schema2"                  },                  "amount": {                    "$ref": "#/definitions/__schema3"                  },                  "isOther": {                    "$ref": "#/definitions/__schema4"                  },                  "direction": {                    "type": "string",                    "enum": [                      "paid",                      "received"                    ]                  }                },                "required": [                  "name",                  "amount",                  "isOther",                  "direction"                ],                "additionalProperties": false              }            }          },          "required": [            "source",            "income",            "expenses",            "payroll"          ],          "additionalProperties": false        }      },      "required": [        "source",        "currency",        "period",        "accountingBasis",        "receiptSalesIncluded",        "totals",        "contributors"      ],      "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",      "pattern": "^\\d{4}-\\d{2}$"    },    "__schema1": {      "type": "object",      "properties": {        "name": {          "$ref": "#/definitions/__schema2"        },        "amount": {          "$ref": "#/definitions/__schema3"        },        "isOther": {          "$ref": "#/definitions/__schema4"        }      },      "required": [        "name",        "amount",        "isOther"      ],      "additionalProperties": false    },    "__schema2": {      "type": "string"    },    "__schema3": {      "type": "number"    },    "__schema4": {      "type": "boolean"    }  },  "oneOf": [    {      "required": [        "data"      ]    },    {      "required": [        "error"      ]    }  ]}

Flujo relacionado

Consulta los flujos canónicos en la introducción

Herramientas relacionadas