Docs
MCP serverAvailable tools

Create sales receipt

Create a POS sales receipt without stamping a CFDI. Paid and credit lines without productId require satProductCode and satUnitCode at creation; catalog products supply their own fiscal identity.

MCP toolcreate_sales_receipt

Purpose

Use when
A point-of-sale transaction has been completed.
Do not use when
You need to create a fiscal CFDI directly.
Required permissions
receipts:create
Side effects
Writes data
Idempotency
Idempotent

Input schema

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        }      ]    }  }}

Output schema

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"      ]    }  ]}

Related workflow

See the canonical workflows in Quickstart

Related tools