Servidor MCPHerramientas disponibles
Crear recibo de venta
Crea un recibo de venta de caja sin timbrar un CFDI. Las partidas de ventas pagadas o a crédito sin productId requieren satProductCode y satUnitCode al crearlas; los productos de catálogo aportan su identidad fiscal.
Herramienta MCP
create_sales_receiptPropósito
- Usar cuando
- Se completó una venta de punto de venta.
- No usar cuando
- Necesitas crear directamente un CFDI fiscal.
- Permisos requeridos
- Efectos secundarios
- Modifica datos
- Idempotencia
- Idempotente
Esquema de entrada
JSON Schema{ "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": { "oneOf": [ { "type": "object", "properties": { "items": { "$ref": "#/definitions/__schema0" }, "currency": { "$ref": "#/definitions/__schema5" }, "locationId": { "$ref": "#/definitions/__schema6" }, "pricesIncludeIva": { "$ref": "#/definitions/__schema7" }, "notes": { "$ref": "#/definitions/__schema8" }, "customFields": { "$ref": "#/definitions/__schema9" }, "saleType": { "const": "paid" }, "paymentForm": { "enum": [ "12", "13", "14", "15", "17", "23", "24", "25", "26", "27", "28", "29", "30", "31", "99", "01", "02", "03", "04", "05", "06", "08" ], "description": "Known SAT payment-form code.", "x-exac-sat-catalog": "payment-forms" }, "customer": { "allOf": [ { "$ref": "#/definitions/__schema10" } ] } }, "required": [ "items", "saleType", "paymentForm" ], "additionalProperties": false }, { "type": "object", "properties": { "items": { "$ref": "#/definitions/__schema0" }, "currency": { "$ref": "#/definitions/__schema5" }, "locationId": { "$ref": "#/definitions/__schema6" }, "pricesIncludeIva": { "$ref": "#/definitions/__schema7" }, "notes": { "$ref": "#/definitions/__schema8" }, "customFields": { "$ref": "#/definitions/__schema9" }, "saleType": { "const": "credit" }, "paymentForm": { "const": "99" }, "customer": { "type": "object", "properties": { "kind": { "const": "stored" }, "customerId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "customerId" ], "additionalProperties": false } }, "required": [ "items", "saleType", "paymentForm", "customer" ], "additionalProperties": false }, { "type": "object", "properties": { "items": { "$ref": "#/definitions/__schema0" }, "currency": { "$ref": "#/definitions/__schema5" }, "locationId": { "$ref": "#/definitions/__schema6" }, "pricesIncludeIva": { "$ref": "#/definitions/__schema7" }, "notes": { "$ref": "#/definitions/__schema8" }, "customFields": { "$ref": "#/definitions/__schema9" }, "saleType": { "const": "courtesy" }, "customer": { "allOf": [ { "$ref": "#/definitions/__schema10" } ] } }, "required": [ "items", "saleType" ], "additionalProperties": false } ] } }, "required": [ "idempotencyKey", "input" ], "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "definitions": { "__schema0": { "minItems": 1, "type": "array", "items": { "type": "object", "properties": { "productId": { "type": "string" }, "description": { "type": "string", "minLength": 1 }, "quantity": { "type": "number", "exclusiveMinimum": 0 }, "unitPrice": { "type": "number", "minimum": 0 }, "discount": { "type": "number" }, "taxIncluded": { "type": "boolean" }, "satProductCode": { "description": "Required for paid/credit lines without productId: specific SAT c_ClaveProdServ, never 01010101. Catalog products supply their own.", "allOf": [ { "type": "string" } ] }, "satUnitCode": { "description": "Required SAT c_ClaveUnidad for paid/credit lines without productId.", "allOf": [ { "type": "string" } ] }, "taxability": { "description": "IVA for custom lines; defaults to standard. Omit with productId.", "allOf": [ { "enum": [ "standard", "zero", "exempt" ] } ] } }, "required": [ "description", "quantity", "unitPrice" ], "additionalProperties": false } }, "__schema5": { "type": "string", "pattern": "^[A-Z]{3}$" }, "__schema6": { "type": "string" }, "__schema7": { "type": "boolean" }, "__schema8": { "type": "string" }, "__schema9": { "type": "array", "items": { "type": "object", "properties": { "fieldName": { "type": "string", "minLength": 1 }, "value": { "type": "string" } }, "required": [ "fieldName", "value" ], "additionalProperties": false } }, "__schema10": { "oneOf": [ { "type": "object", "properties": { "kind": { "const": "stored" }, "customerId": { "type": "string", "minLength": 1 } }, "required": [ "kind", "customerId" ], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "const": "walk_in" }, "name": { "type": "string", "minLength": 1 }, "email": { "type": "string", "format": "email", "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" } }, "required": [ "kind" ], "additionalProperties": false } ] } }}Esquema de salida
JSON Schema{ "type": "object", "properties": { "data": { "type": "object", "properties": { "documentRef": { "type": "string", "pattern": "^sales_receipt:.+$" }, "status": { "enum": [ "open", "invoiced", "global_invoiced", "canceled" ] } }, "required": [ "documentRef", "status" ], "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, "oneOf": [ { "required": [ "data" ] }, { "required": [ "error" ] } ]}Flujo relacionado
Consulta los flujos canónicos en Inicio rápidoHerramientas relacionadas
Guardar configuración
Crea o actualiza una sucursal o campo de recibo de la organización. Crear un campo con un nombre normalizado existente devuelve conflict; consúltalo con get_configuration y usa operation: update con su entryId. Al actualizar un campo, omite values para conservar sus opciones; un arreglo enviado las reemplaza todas y un arreglo vacío las borra. Nunca uses una vista previa incompleta como reemplazo.
Cancelar recibo de venta
Cancela un recibo abierto y conserva su historial de venta.