# gigstack para agentes de IA

gigstack (siempre en minúscula) automatiza la facturación de negocios en México: convierte cada pago (Stripe, PayPal, Shopify, WooCommerce, Mercado Pago, Clip, Conekta o la API) en un CFDI 4.0 válido ante el SAT, con complementos de pago, cobranza y conciliación. Sitio: https://gigstack.pro

English instructions are below: [For agents, in English](#for-agents-in-english).

## Crear una cuenta para una persona

Es el camino sin formulario: abres una cuenta de prueba, emites una factura de prueba para que la persona vea el resultado, ella confirma con un código y al final le explicas cómo pasar a producción y cuánto pagaría. Nada se cobra ni se timbra ante el SAT hasta que ella active producción.

Si la persona te pegó este texto, síguelo paso a paso:

```text
Crea mi cuenta de gigstack, emite una factura de prueba y dime cuánto pagaría al mes.

Lee https://gigstack.pro/agents.md y sigue sus pasos:
1. Pregúntame mi correo y cuántas facturas emito al mes.
2. Crea mi cuenta de prueba con POST https://api.gigstack.io/v2/auth/sandbox y guarda la llave de prueba en un archivo .env local, nunca en el chat.
3. Emite una factura de prueba (PÚBLICO EN GENERAL, servicio de ejemplo) con esa llave y muéstrame el PDF.
4. Pídeme el código que me llegue por correo y reclama la cuenta.
5. Explícame qué falta para facturar de verdad: mi RFC, mi CSD, el manifiesto y una tarjeta en app.gigstack.pro.
6. Consulta los precios en https://api.gigstack.io/v2/pricing y calcula mi costo mensual antes y después de IVA, paso por paso. Usa sólo los precios que devuelve.
```

Los pasos, con sus llamadas:

1. Pregunta el correo de la persona y cuántas facturas emite al mes.
2. `POST https://api.gigstack.io/v2/auth/sandbox` con `{ "email", "name", "agent": { "client" } }` y el header `Idempotency-Key` (obligatorio, 8 a 128 caracteres). Crea una cuenta de prueba con una sola llave `sk_test_` (`livemode: false`): no timbra ante el SAT ni cobra nada. La llave sólo viene en la primera respuesta `201`; guárdala en un archivo `.env` local, nunca en el chat.
3. Emite una factura de prueba con esa llave, antes del reclamo, para que la persona vea su primera factura en minutos. El sandbox trae los datos fiscales y el CSD de prueba del SAT (revisa `test_issuer` en la respuesta del paso 2; si es `null`, sáltate este paso y dilo). `POST https://api.gigstack.io/v2/invoices/income` con `Authorization: Bearer <llave sk_test_>` y este cuerpo:

```json
{
  "client": {
    "name": "PUBLICO EN GENERAL",
    "legal_name": "PUBLICO EN GENERAL",
    "tax_id": "XAXX010101000",
    "tax_system": "616",
    "address": {
      "country": "MEX",
      "zip": "<test_issuer.zip>"
    }
  },
  "use": "S01",
  "payment_method": "PUE",
  "payment_form": "01",
  "currency": "MXN",
  "global": {
    "periodicity": "04",
    "months": "<mes actual, 01 a 12>",
    "year": "<año actual, número>"
  },
  "items": [
    {
      "description": "Servicio de ejemplo",
      "product_key": "01010101",
      "unit_key": "E48",
      "quantity": 1,
      "unit_price": 100,
      "taxes": [
        {
          "type": "IVA",
          "rate": 0.16,
          "factor": "Tasa",
          "inclusive": false,
          "withholding": false
        }
      ]
    }
  ],
  "automation_type": "none",
  "send_email": false
}
```

   Con un receptor PÚBLICO EN GENERAL el SAT pide el periodo de factura global: pon en `global` el mes (`months`, dos dígitos) y el año actuales, y en `address.zip` el código postal de `test_issuer`. Guarda el `uuid` de la respuesta y descarga el PDF con `GET https://api.gigstack.io/v2/invoices/{uuid}/files` (cada elemento de `data` trae `type` y `content` en base64). Guárdalo como archivo local y ábreselo o dile dónde quedó. Aclárale que es una factura de prueba, sin validez fiscal.
4. La persona recibe un código de seis dígitos por correo. Pídeselo y llama `POST https://api.gigstack.io/v2/auth/sandbox/claim` con `{ "team_id", "code" }`. Al reclamarla recibe un enlace para crear su contraseña y entrar a https://app.gigstack.pro, donde ya está la factura de prueba.
5. Explícale qué falta para facturar de verdad, todo en https://app.gigstack.pro: cambiar los datos fiscales de prueba por los de su RFC, subir su CSD (el .cer, el .key y su contraseña; los captura ella, nunca en el chat), firmar el manifiesto del SAT y agregar una tarjeta. Agregar la tarjeta no genera cargo; la cuota por RFC empieza al activar producción, junto con los créditos de bienvenida.
6. Cotiza con `GET https://api.gigstack.io/v2/pricing` (ver [Precios](#precios)) y el volumen del paso 1. Muestra el costo antes y después de IVA, paso por paso, y usa sólo los precios que devuelve.

Detalles que debes respetar:

- Si la ruta responde `404 not_found`, el registro por agente está desactivado: manda a la persona a https://app.gigstack.pro/register.
- Si no puedes hacer llamadas `POST` (por ejemplo, un chat que sólo lee páginas), pregunta su volumen, cotiza con los precios públicos (paso 6) y mándala a https://app.gigstack.pro/register para crear su cuenta. No digas que la creaste.
- Si leíste este archivo desde una URL con `?ref=<campaña>` (por ejemplo `agents.md?ref=g-facturama`), agrega la campaña a `agent.client` así: `"<tu nombre> ref:<campaña>"` (por ejemplo `"claude-code ref:g-facturama"`, hasta 64 caracteres). Sin ref, manda sólo tu nombre.
- Límites: 3 sandboxes por hora y 10 por día por IP, 50 por día por dominio de empresa, 3 códigos por hora por correo. Los correos desechables se rechazan (`400 email_not_allowed`). Un correo con un sandbox abierto responde `409 sandbox_pending_claim` y reenvía el código.
- Antes de reclamarla, la llave de prueba sólo maneja datos de prueba (clientes, servicios, pagos, recibos, facturas, catálogos); usuarios, llaves, facturación, portales, webhooks y activación responden `403 sandbox_unclaimed`.
- Un sandbox sin reclamar expira a los 7 días: sus llaves se revocan.
- El código funciona una vez y se bloquea tras 5 intentos fallidos.

Referencia: https://docs.gigstack.io/reference/createAgentSandbox.md · https://docs.gigstack.io/reference/claimAgentSandbox.md · https://docs.gigstack.io/reference/getPublicPrices.md

## Precios

- Lista legible por máquina: `GET https://api.gigstack.io/v2/pricing` (sólo lectura, sin llave, `?country=MEX` por omisión). Cacheable cinco minutos.
- Montos en MXN antes de IVA (`taxes_included: false`). El IVA en México es del 16%.
- Campos de `data`: `units` (escala por documento y por uso, con `tiers[].up_to` / `unit_price` y `automatic_multiplier`), `features` (cuota por RFC en `taxpayer` con `extra_tiers`, add-ons con `monthly_price`, `scope` y `per_account_with_connect`), `free_documents`, `signup_credits` y `billing_threshold`.
- Si el endpoint no responde, usa https://gigstack.pro/precios y no inventes un precio que la lista no traiga.

Resumen a la fecha de este archivo (el endpoint manda si difieren):

- **Cuota por RFC**: $199 al mes por el primer RFC. RFC adicionales: $99 del 2 al 10, $49 del 11 al 50 y $29 del 51 en adelante.
- **Créditos de bienvenida**: 11 créditos (1 crédito = $1 MXN de uso), una sola vez al activar producción y válidos 30 días. No hay documentos incluidos cada mes.
- **CFDI timbrados (escala graduada, por RFC y por mes, desde el primer documento)**: del 1 al 50 $2.10, del 51 al 200 $1.80, del 201 al 1,000 $1.30, del 1,001 al 5,000 $0.55 y del 5,001 en adelante $0.40 por documento. Cuentan ingreso, egreso, complemento de pago, traslado y retención. Las facturas de ingreso y los complementos de pago emitidos en automático (integraciones, automatizaciones) pagan el 50%; egresos, traslados y retenciones pagan el precio completo.
- **Otros usos**: pago cobrado $0.03, recibo de venta $0.25, XML descargado del SAT $0.20. Cancelaciones: gratis.
- **API, webhooks y MCP**: incluidos sin costo.
- **Add-ons (por RFC al mes)**: autofactura $399, portal de clientes $199, factura global automática $149, eventos recurrentes $99, descarga masiva del SAT $99, soporte prioritario $499.
- **Connect** (multi-empresa y plataformas que facturan por sus clientes): $4,900 al mes por cuenta. Con Connect, cada add-on excepto descarga masiva del SAT se cobra una sola vez por cuenta, no por RFC.
- **Cobro anticipado**: si el uso antes del corte pasa de $500 MXN, se cobra por adelantado.
- **Modo de prueba gratis** y sin tarjeta hasta que activas producción. Los documentos de prueba no tienen validez fiscal.

## Documentación

- Índice para LLMs: https://docs.gigstack.io/llms.txt
- Guía para agentes: https://docs.gigstack.io/agents.md
- OpenAPI: https://docs.gigstack.io/openapi.json
- MCP de la documentación (sólo busca, no opera cuentas): https://docs.gigstack.io/mcp
- Servidor MCP para operar una cuenta (ChatGPT, Claude, Cursor y otros clientes): https://mcp.gigstack.io/v2/mcp · docs: https://mcp.gigstack.io/docs · metadatos OAuth: https://mcp.gigstack.io/.well-known/oauth-protected-resource/v2/mcp
- Resumen del sitio: https://gigstack.pro/llms.txt · versión completa: https://gigstack.pro/llms-full.txt

## Reglas de seguridad

- Timbrar un CFDI es un acto fiscal vinculante y no se deshace; cancelar también tiene efectos ante el SAT. Muestra montos e impuestos y espera la confirmación explícita de la persona antes de timbrar con una llave live.
- Las llaves de prueba (`sk_test_`) nunca timbran ante el SAT. No presentes un documento de prueba como factura real.
- Nunca pidas contraseñas, números de tarjeta ni archivos del CSD en el chat. La persona los captura sólo en https://app.gigstack.pro.
- No guardes llaves, certificados ni datos de clientes en logs o commits.

## For agents, in English

gigstack automates invoicing for businesses in Mexico: every payment (Stripe, PayPal, Shopify, WooCommerce, Mercado Pago, Clip, Conekta or the API) becomes a CFDI 4.0 e-invoice stamped with the SAT (Mexico's tax authority), with payment complements, collections and reconciliation. API, webhooks and MCP are included at no extra cost.

### Create an account for a person

If the person pasted this request, follow it step by step:

```text
Create my gigstack account, issue a test invoice and tell me how much I would pay per month.

Read https://gigstack.pro/agents.md and follow its steps:
1. Ask me for my email and how many invoices I issue per month.
2. Create my test account with POST https://api.gigstack.io/v2/auth/sandbox and save the test key in a local .env file, never in the chat.
3. Issue a test invoice (PÚBLICO EN GENERAL, a sample service) with that key and show me the PDF.
4. Ask me for the code I receive by email and claim the account.
5. Explain what is missing to invoice for real: my RFC, my CSD (digital seal certificate), the SAT manifest and a card in app.gigstack.pro.
6. Get the prices from https://api.gigstack.io/v2/pricing and work out my monthly cost before and after VAT (IVA), step by step. Use only the prices it returns.
```

1. Ask for the person's email and how many invoices they issue per month.
2. `POST https://api.gigstack.io/v2/auth/sandbox` with `{ "email", "name", "agent": { "client" } }` and an `Idempotency-Key` header (required, 8 to 128 characters). It creates a test account with a single `sk_test_` key (`livemode: false`): nothing is stamped with the SAT or charged. The key is only returned in the first `201` response; store it in a local `.env` file, never in the chat.
3. Issue a test invoice with that key, before the claim. The sandbox carries SAT's test fiscal data and CSD (check `test_issuer` in the step 2 response; if it is `null`, skip this step and say so). `POST https://api.gigstack.io/v2/invoices/income` with the body in the Spanish section above: receiver PÚBLICO EN GENERAL (`XAXX010101000`, regime `616`, use `S01`, the zip of `test_issuer`), a `global` period for the current month and year, and one sample service with 16% IVA. Fetch the PDF with `GET https://api.gigstack.io/v2/invoices/{uuid}/files` (base64 `content` in each `data` entry), save it locally and open it or tell the person where it is. It is a test invoice with no tax validity.
4. The person receives a six-digit code by email. Ask for it and call `POST https://api.gigstack.io/v2/auth/sandbox/claim` with `{ "team_id", "code" }`. Claiming sends them a link to set a password and sign in to https://app.gigstack.pro, where the test invoice is waiting.
5. Explain what is missing to invoice for real, all at https://app.gigstack.pro: replace the test fiscal data with their own RFC, upload their CSD (digital seal certificate; they enter it themselves, never in the chat), sign the SAT manifest and add a card. Adding the card does not charge it; the per-RFC fee starts when production is activated.
6. Quote with `GET https://api.gigstack.io/v2/pricing` (no key) and the volume from step 1. Amounts are MXN before VAT (`taxes_included: false`); VAT (IVA) is 16%. Use only the prices it returns.

If the route answers `404 not_found`, agent signup is turned off: send the person to https://app.gigstack.pro/register. If you cannot make `POST` requests (for example, a chat that can only read pages), ask for their volume, quote with the public prices (step 6) and send the person to https://app.gigstack.pro/register; do not claim you created the account. If you read this file from a URL with `?ref=<campaign>`, send `agent.client` as `"<your name> ref:<campaign>"` (up to 64 characters). Rate limits, error codes and the 7-day expiry of unclaimed sandboxes are listed in the Spanish section above.

### Pricing in brief

$199 MXN per RFC (taxpayer) per month, plus a graduated per-document scale per RFC per month that starts at the first CFDI (no documents are included); a one-time 11 welcome credits (1 credit = $1 MXN) when production is activated, valid 30 days; automatic income invoices and payment complements pay 50%. Free, unlimited test mode until production is activated. Full list: https://gigstack.pro/precios.

### Safety rules

- Stamping a CFDI is a binding tax act and cannot be undone; cancelling also has effects with the SAT. Show amounts and taxes and wait for the person's explicit confirmation before stamping with a live key.
- Test keys (`sk_test_`) never stamp with the SAT. Do not present a test document as a real invoice.
- Never ask for passwords, card numbers or CSD files in the chat. The person enters them only at https://app.gigstack.pro.
