Docs
Servidor MCPHerramientas disponibles

Leer resumen de ventas

Consulta las ventas de recibos de caja de hoy, la semana (desde el lunes) o el mes, por forma de pago, con los principales clientes, productos y ubicaciones del mes.

Herramienta MCPget_sales_receipt_summary

Propósito

Usar cuando
Necesitas ventas POS, facturadas y no facturadas.
No usar cuando
Necesitas actividad CFDI reconocida.
Permisos requeridos
analytics:read
Efectos secundarios
Ninguno
Idempotencia
Idempotente

Esquema de entrada

JSON Schema
{  "type": "object",  "properties": {    "date": {      "description": "The period's last business day; defaults to the organization's current day",      "allOf": [        {          "type": "string",          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"        }      ]    },    "period": {      "description": "The organization's current day, its calendar week so far (from Monday), or its calendar month so far; defaults to month",      "allOf": [        {          "enum": [            "today",            "week",            "month"          ]        }      ]    },    "activityLimit": {      "description": "Top customers, products, and locations of the month; defaults to 4",      "allOf": [        {          "type": "integer",          "minimum": 1,          "maximum": 10        }      ]    }  },  "$schema": "http://json-schema.org/draft-07/schema#",  "additionalProperties": false}

Esquema de salida

JSON Schema
{  "type": "object",  "properties": {    "data": {      "type": "object",      "properties": {        "source": {          "const": "sales_receipts"        },        "currency": {          "const": "MXN"        },        "period": {          "enum": [            "today",            "week",            "month"          ]        },        "dateFrom": {          "$ref": "#/definitions/__schema0"        },        "dateTo": {          "$ref": "#/definitions/__schema0"        },        "includesInvoicedReceipts": {          "type": "boolean",          "const": true        },        "cfdiTotalsIncluded": {          "type": "boolean",          "const": false        },        "totals": {          "type": "object",          "properties": {            "netSales": {              "type": "number"            },            "receiptCount": {              "type": "number"            }          },          "required": [            "netSales",            "receiptCount"          ],          "additionalProperties": false        },        "byPaymentMethod": {          "type": "array",          "items": {            "type": "object",            "properties": {              "paymentMethod": {                "enum": [                  "cash",                  "card",                  "transfer",                  "credit",                  "other"                ]              },              "netSales": {                "type": "number"              },              "share": {                "type": "number"              }            },            "required": [              "paymentMethod",              "netSales",              "share"            ],            "additionalProperties": false          }        },        "top": {          "type": "object",          "properties": {            "month": {              "type": "string",              "pattern": "^\\d{4}-\\d{2}$"            },            "customers": {              "type": "array",              "items": {                "$ref": "#/definitions/__schema1"              }            },            "products": {              "type": "array",              "items": {                "$ref": "#/definitions/__schema1"              }            },            "locations": {              "type": "array",              "items": {                "$ref": "#/definitions/__schema1"              }            }          },          "required": [            "month",            "customers",            "products",            "locations"          ],          "additionalProperties": false        }      },      "required": [        "source",        "currency",        "period",        "dateFrom",        "dateTo",        "includesInvoicedReceipts",        "cfdiTotalsIncluded",        "totals",        "byPaymentMethod",        "top"      ],      "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": "^(invoice|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,  "definitions": {    "__schema0": {      "type": "string",      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"    },    "__schema1": {      "type": "object",      "properties": {        "name": {          "type": "string"        },        "amount": {          "type": "number"        },        "quantity": {          "type": "number"        },        "receiptCount": {          "type": "number"        },        "share": {          "type": "number"        }      },      "required": [        "name",        "amount",        "quantity",        "receiptCount",        "share"      ],      "additionalProperties": false    }  },  "oneOf": [    {      "required": [        "data"      ]    },    {      "required": [        "error"      ]    }  ]}

Flujo relacionado

Consulta los flujos canónicos en Inicio rápido

Herramientas relacionadas