Create invoice

Issue and stamp a CFDI 4.0 invoice for a client with one or more lines.

MCP tool facturama_write → create_invoice

write Confirm

Issues a CFDI 4.0 invoice of type ingreso and stamps it with the SAT, so there is no draft: the invoice is final once the call succeeds. Returns the invoice_id, series, folio, UUID and totals. It uses one folio of your plan and does not email the invoice: use email_invoice for that. A wrong invoice is fixed by cancel_invoice or create_credit_note. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: create_invoice
NameTypeDescription
client_id string required string Client ID from list_clients or create_client.
items array required array Lines. Each has description, quantity, unit_price and tax_rate (0.16 for 16% IVA), plus optional product_id from list_products.
payment_form string string How the client pays, for example transfer or cash.
payment_method string string Single payment or installments.
series string string Invoice series. Default: your default series.

tools/call

JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "facturama_write",
    "arguments": {
      "operation": "create_invoice",
      "arguments": {
        "client_id": "cl_4821",
        "items": [
          {
            "description": "Design review hour",
            "quantity": 2,
            "unit_price": 500,
            "tax_rate": 0.16
          }
        ],
        "payment_form": "transfer",
        "payment_method": "single payment"
      }
    }
  }
}

Example response

JSON

{
  "content": [
    {
      "type": "text",
      "text": "{ ... same JSON as structuredContent ... }"
    }
  ],
  "structuredContent": {
    "invoice_id": "Y61TLX-Ls_ZJFqzjanPN1w2",
    "series": "FAC",
    "folio": "101",
    "uuid": "6f1c2a90-3b7e-4d55-9a1e-0c52b8e4d7a1",
    "cfdi_type": "ingreso",
    "status": "issued",
    "issued_at": "2026-10-14T10:32:00-06:00",
    "client": {
      "client_id": "cl_4821",
      "rfc": "XAXX010101000",
      "name": "Estudio Norte SA de CV"
    },
    "items": [
      {
        "description": "Design review hour",
        "quantity": 2,
        "unit_price": 500,
        "subtotal": 1000,
        "tax_rate": 0.16,
        "tax": 160,
        "total": 1160
      }
    ],
    "subtotal": 1000,
    "tax_total": 160,
    "total": 1160,
    "currency": "MXN"
  },
  "isError": false
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.