{"openapi":"3.1.0","info":{"title":"Kambak API","version":"1.0.0","description":"API REST para integrar Kambak con tu caja, tu tienda online o Zapier. Guía completa: https://kambak.app/desarrolladores","contact":{"name":"Kambak","email":"hola@kambak.app","url":"https://kambak.app"}},"servers":[{"url":"https://api.kambak.app/api/v1"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"me","description":"Cuenta"},{"name":"customers","description":"Clientes"},{"name":"cards","description":"Tarjetas"},{"name":"programs","description":"Programas"},{"name":"campaigns","description":"Campañas y avisos"},{"name":"stats","description":"Estadísticas"},{"name":"webhooks","description":"Webhooks"}],"paths":{"/me":{"get":{"operationId":"me.get","tags":["me"],"summary":"Comercio y clave actuales","description":"Ideal para la primera llamada: confirma que la clave anda.\n\nPlan mínimo: `starter`.","responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-plan":"starter"}},"/customers":{"get":{"operationId":"customers.list","tags":["customers"],"summary":"Listar o buscar clientes","description":"Scope: `customers:read`.\n\nPlan mínimo: `starter`.","parameters":[{"name":"limit","in":"query","required":false,"description":"Tamaño de página (1–100).","x-description-es":"Tamaño de página (1–100).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"El `nextCursor` de la página anterior.","x-description-es":"El `nextCursor` de la página anterior.","schema":{"type":"string","maxLength":200}},{"name":"q","in":"query","required":false,"description":"Buscar por nombre, email o teléfono.","x-description-es":"Buscar por nombre, email o teléfono.","schema":{"type":"string","minLength":2,"maxLength":100}},{"name":"email","in":"query","required":false,"description":"Email exacto (sin distinguir mayúsculas).","x-description-es":"Email exacto (sin distinguir mayúsculas).","schema":{"type":"string","maxLength":254,"format":"email"}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerList"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"customers:read","x-kambak-plan":"starter"},"post":{"operationId":"customers.create","tags":["customers"],"summary":"Crear un cliente","description":"Promociones solo con consentimiento real: mandá `consentSource`. Email repetido → 409 `customer_exists`.\n\nScope: `customers:write`.\n\nPlan mínimo: `starter`.\n\nErrores: `customer_exists`.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerInput"}}}},"responses":{"201":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"customers:write","x-kambak-plan":"starter","x-kambak-idempotent":true}},"/customers/{id}":{"get":{"operationId":"customers.get","tags":["customers"],"summary":"Obtener un cliente","description":"Scope: `customers:read`.\n\nPlan mínimo: `starter`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"customers:read","x-kambak-plan":"starter"},"patch":{"operationId":"customers.update","tags":["customers"],"summary":"Actualizar un cliente","description":"`null` borra un dato. Dar el consentimiento exige `consentSource`; retirarlo, no.\n\nScope: `customers:write`.\n\nPlan mínimo: `pro`.\n\nErrores: `email_taken`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomerInput"}}}},"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"customers:write","x-kambak-plan":"pro","x-kambak-idempotent":true}},"/customers/{id}/cards":{"get":{"operationId":"customers.cards","tags":["customers"],"summary":"Tarjetas de un cliente","description":"Scope: `cards:read`.\n\nPlan mínimo: `starter`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardList"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"cards:read","x-kambak-plan":"starter"}},"/cards":{"get":{"operationId":"cards.list","tags":["cards"],"summary":"Listar tarjetas","description":"Scope: `cards:read`.\n\nPlan mínimo: `pro`.","parameters":[{"name":"limit","in":"query","required":false,"description":"Tamaño de página (1–100).","x-description-es":"Tamaño de página (1–100).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"El `nextCursor` de la página anterior.","x-description-es":"El `nextCursor` de la página anterior.","schema":{"type":"string","maxLength":200}},{"name":"customerId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"programId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardList"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"cards:read","x-kambak-plan":"pro"},"post":{"operationId":"cards.issue","tags":["cards"],"summary":"Emitir una tarjeta","description":"Crea la tarjeta del cliente en un programa activo y devuelve los links de Wallet. Si ya existía, la devuelve (200).\n\nScope: `cards:write`.\n\nPlan mínimo: `starter`.\n\nErrores: `program_not_active`, `customer_not_found`.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueCardInput"}}}},"responses":{"201":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueCardResult"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"cards:write","x-kambak-plan":"starter","x-kambak-idempotent":true}},"/cards/{id}":{"get":{"operationId":"cards.get","tags":["cards"],"summary":"Obtener una tarjeta","description":"Scope: `cards:read`.\n\nPlan mínimo: `starter`.\n\nErrores: `card_not_found`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"cards:read","x-kambak-plan":"starter"}},"/cards/by-code/{code}":{"get":{"operationId":"cards.byCode","tags":["cards"],"summary":"Buscar por el QR del pase","description":"Pasá lo que leyó el lector (URL-encoded).\n\nScope: `cards:read`.\n\nPlan mínimo: `starter`.\n\nErrores: `card_not_found`.","parameters":[{"name":"code","in":"path","required":true,"description":"Lo que lee el QR del pase.","x-description-es":"Lo que lee el QR del pase.","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"cards:read","x-kambak-plan":"starter"}},"/cards/{id}/events":{"get":{"operationId":"cards.events","tags":["cards"],"summary":"Historial de la tarjeta","description":"Scope: `cards:read`.\n\nPlan mínimo: `starter`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardEventList"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"cards:read","x-kambak-plan":"starter"}},"/cards/{id}/wallet-links":{"get":{"operationId":"cards.walletLinks","tags":["cards"],"summary":"Links para agregar a Wallet","description":"Scope: `cards:read`.\n\nPlan mínimo: `starter`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletLinks"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"cards:read","x-kambak-plan":"starter"}},"/cards/{id}/actions":{"post":{"operationId":"cards.action","tags":["cards"],"summary":"Sumar, restar o canjear","description":"Mismas reglas que el escáner: historial, Wallet y deshacer. Restar = `adjust` con `delta` negativo.\n\nScope: `cards:write`.\n\nPlan mínimo: `starter`.\n\nErrores: `recent_action`, `card_inactive`, `reward_pending`, `reward_not_available`, `not_enough_points`, `insufficient_balance`, `coupon_used`, `max_stamps_per_visit`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardActionInput"}}}},"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardActionResult"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"cards:write","x-kambak-plan":"starter","x-kambak-idempotent":true}},"/cards/{id}/events/{eventId}/undo":{"post":{"operationId":"cards.undo","tags":["cards"],"summary":"Deshacer la última acción","description":"Dentro de los 5 minutos.\n\nScope: `cards:write`.\n\nPlan mínimo: `starter`.\n\nErrores: `undo_expired`, `not_last_action`, `already_undone`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardActionResult"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"cards:write","x-kambak-plan":"starter","x-kambak-idempotent":true}},"/programs":{"get":{"operationId":"programs.list","tags":["programs"],"summary":"Listar programas","description":"Scope: `programs:read`.\n\nPlan mínimo: `starter`.","responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramList"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"programs:read","x-kambak-plan":"starter"}},"/programs/{id}":{"get":{"operationId":"programs.get","tags":["programs"],"summary":"Obtener un programa","description":"Scope: `programs:read`.\n\nPlan mínimo: `starter`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Program"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"programs:read","x-kambak-plan":"starter"}},"/campaigns":{"get":{"operationId":"campaigns.list","tags":["campaigns"],"summary":"Listar campañas","description":"Scope: `campaigns:read`.\n\nPlan mínimo: `pro`.","parameters":[{"name":"limit","in":"query","required":false,"description":"Tamaño de página (1–100).","x-description-es":"Tamaño de página (1–100).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"El `nextCursor` de la página anterior.","x-description-es":"El `nextCursor` de la página anterior.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignList"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"campaigns:read","x-kambak-plan":"pro"},"post":{"operationId":"campaigns.create","tags":["campaigns"],"summary":"Crear un aviso (borrador)","description":"Scope: `campaigns:write`.\n\nPlan mínimo: `pro`.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCampaignInput"}}}},"responses":{"201":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"campaigns:write","x-kambak-plan":"pro","x-kambak-idempotent":true}},"/campaigns/quota":{"get":{"operationId":"campaigns.quota","tags":["campaigns"],"summary":"Cupo del mes","description":"Scope: `campaigns:read`.\n\nPlan mínimo: `pro`.","responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignQuota"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"campaigns:read","x-kambak-plan":"pro"}},"/segments":{"get":{"operationId":"campaigns.segments","tags":["campaigns"],"summary":"Segmentos disponibles","description":"Scope: `campaigns:read`.\n\nPlan mínimo: `pro`.","responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentList"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"campaigns:read","x-kambak-plan":"pro"}},"/campaigns/{id}":{"get":{"operationId":"campaigns.get","tags":["campaigns"],"summary":"Campaña y reporte","description":"Scope: `campaigns:read`.\n\nPlan mínimo: `pro`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDetail"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"campaigns:read","x-kambak-plan":"pro"}},"/campaigns/{id}/send":{"post":{"operationId":"campaigns.send","tags":["campaigns"],"summary":"Mandar ahora","description":"Pasa por el revisor, el consentimiento, el cupo del plan y el tope de 3 avisos por pase cada 24 h.\n\nScope: `campaigns:write`.\n\nPlan mínimo: `pro`.\n\nErrores: `campaign_review_failed`, `campaign_no_recipients`, `campaign_limit_reached`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"campaigns:write","x-kambak-plan":"pro","x-kambak-idempotent":true}},"/campaigns/{id}/schedule":{"post":{"operationId":"campaigns.schedule","tags":["campaigns"],"summary":"Programar","description":"Scope: `campaigns:write`.\n\nPlan mínimo: `pro`.\n\nErrores: `invalid_schedule`, `campaign_limit_reached`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleCampaignInput"}}}},"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"campaigns:write","x-kambak-plan":"pro","x-kambak-idempotent":true}},"/campaigns/{id}/cancel":{"post":{"operationId":"campaigns.cancel","tags":["campaigns"],"summary":"Cancelar una programada","description":"Scope: `campaigns:write`.\n\nPlan mínimo: `pro`.\n\nErrores: `campaign_not_cancellable`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"campaigns:write","x-kambak-plan":"pro","x-kambak-idempotent":true}},"/stats":{"get":{"operationId":"stats.get","tags":["stats"],"summary":"Resumen del período","description":"Scope: `stats:read`.\n\nPlan mínimo: `pro`.","parameters":[{"name":"days","in":"query","required":false,"description":"7, 30 o 90.","x-description-es":"7, 30 o 90.","schema":{"default":30,"type":"number"}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stats"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"stats:read","x-kambak-plan":"pro"}},"/webhook-endpoints":{"get":{"operationId":"webhooks.list","tags":["webhooks"],"summary":"Listar webhooks","description":"Scope: `webhooks:read`.\n\nPlan mínimo: `pro`.","responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"webhooks:read","x-kambak-plan":"pro"},"post":{"operationId":"webhooks.create","tags":["webhooks"],"summary":"Crear un webhook","description":"Devuelve el `secret` para verificar la firma (una sola vez). Cada evento pide su scope de lectura: `customer.*` → `customers:read`; el resto → `cards:read`.\n\nScope: `webhooks:write`.\n\nPlan mínimo: `pro`.\n\nErrores: `webhook_url_not_allowed`, `webhook_limit_reached`.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpointInput"}}}},"responses":{"201":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"webhooks:write","x-kambak-plan":"pro","x-kambak-idempotent":true}},"/webhook-endpoints/{id}":{"get":{"operationId":"webhooks.get","tags":["webhooks"],"summary":"Obtener un webhook","description":"Scope: `webhooks:read`.\n\nPlan mínimo: `pro`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"webhooks:read","x-kambak-plan":"pro"},"patch":{"operationId":"webhooks.update","tags":["webhooks"],"summary":"Editar o reactivar un webhook","description":"Los eventos piden el mismo scope de lectura que al crear.\n\nScope: `webhooks:write`.\n\nPlan mínimo: `pro`.\n\nErrores: `webhook_url_not_allowed`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookEndpointInput"}}}},"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"webhooks:write","x-kambak-plan":"pro","x-kambak-idempotent":true},"delete":{"operationId":"webhooks.delete","tags":["webhooks"],"summary":"Borrar un webhook","description":"Scope: `webhooks:write`.\n\nPlan mínimo: `pro`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"Sin contenido","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"webhooks:write","x-kambak-plan":"pro","x-kambak-idempotent":true}},"/webhook-endpoints/{id}/test":{"post":{"operationId":"webhooks.test","tags":["webhooks"],"summary":"Mandar un evento de prueba","description":"Scope: `webhooks:write`.\n\nPlan mínimo: `pro`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"201":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"webhooks:write","x-kambak-plan":"pro","x-kambak-idempotent":true}},"/webhook-endpoints/{id}/deliveries":{"get":{"operationId":"webhooks.deliveries","tags":["webhooks"],"summary":"Entregas recientes","description":"Scope: `webhooks:read`.\n\nPlan mínimo: `pro`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"description":"Tamaño de página (1–100).","x-description-es":"Tamaño de página (1–100).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"El `nextCursor` de la página anterior.","x-description-es":"El `nextCursor` de la página anterior.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"webhooks:read","x-kambak-plan":"pro"}},"/webhook-deliveries/{id}/retry":{"post":{"operationId":"webhooks.retry","tags":["webhooks"],"summary":"Reenviar una entrega","description":"Scope: `webhooks:write`.\n\nPlan mínimo: `pro`.","parameters":[{"name":"id","in":"path","required":true,"description":"Id del recurso.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"x-kambak-scope":"webhooks:write","x-kambak-plan":"pro","x-kambak-idempotent":true}}},"webhooks":{"customer.created":{"post":{"summary":"Cliente nuevo","description":"`type: \"customer.created\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}},"card.created":{"post":{"summary":"Tarjeta nueva","description":"`type: \"card.created\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}},"card.stamped":{"post":{"summary":"Sumó sellos","description":"`type: \"card.stamped\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}},"card.points_changed":{"post":{"summary":"Sumó puntos","description":"`type: \"card.points_changed\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}},"card.balance_changed":{"post":{"summary":"Usó saldo de gift card","description":"`type: \"card.balance_changed\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}},"card.adjusted":{"post":{"summary":"Ajuste manual","description":"`type: \"card.adjusted\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}},"card.action_undone":{"post":{"summary":"Acción deshecha","description":"`type: \"card.action_undone\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}},"reward.redeemed":{"post":{"summary":"Canjeó un premio o cupón","description":"`type: \"reward.redeemed\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}},"membership.checked":{"post":{"summary":"Validó la membresía","description":"`type: \"membership.checked\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}},"membership.payment_received":{"post":{"summary":"Pagó la membresía","description":"`type: \"membership.payment_received\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}},"membership.payment_reverted":{"post":{"summary":"Pago de membresía revertido","description":"`type: \"membership.payment_reverted\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}},"membership.cancelled":{"post":{"summary":"Canceló el débito","description":"`type: \"membership.cancelled\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}},"pass.saved":{"post":{"summary":"Guardó el pase en Wallet","description":"`type: \"pass.saved\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}},"pass.removed":{"post":{"summary":"Eliminó el pase de Wallet","description":"`type: \"pass.removed\"`","parameters":[{"name":"Kambak-Signature","in":"header","required":true,"schema":{"type":"string"},"description":"t=<unix>,v1=<hex HMAC-SHA256(\"<t>.<body>\")>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Recibido (2xx)"}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Código estable en snake_case.","x-description-es":"Código estable en snake_case."},"message":{"type":"string","description":"Mensaje para mostrar (en español).","x-description-es":"Mensaje para mostrar (en español)."},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"Respuesta de error.","x-description-es":"Respuesta de error."},"Me":{"type":"object","properties":{"merchant":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"plan":{"type":"string","enum":["free","starter","pro","multisite"]},"timezone":{"type":"string"},"locale":{"type":"string","enum":["es","en"]}},"required":["id","name","plan","timezone","locale"],"additionalProperties":false},"apiKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"mode":{"type":"string","enum":["live","test"]},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["customers:read","customers:write","cards:read","cards:write","programs:read","campaigns:read","campaigns:write","stats:read","webhooks:read","webhooks:write"]}},"locationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Sucursal de la clave: las acciones de tarjeta quedan registradas ahí.","x-description-es":"Sucursal de la clave: las acciones de tarjeta quedan registradas ahí."}},"required":["id","name","mode","prefix","scopes","locationId"],"additionalProperties":false},"access":{"type":"object","properties":{"level":{"type":"string","enum":["pos","full"]},"rateLimitPerMinute":{"type":"integer"}},"required":["level","rateLimitPerMinute"],"additionalProperties":false,"description":"Qué incluye el plan: `pos` (Inicial: lo de la caja) o `full` (Pro y Multisede).","x-description-es":"Qué incluye el plan: `pos` (Inicial: lo de la caja) o `full` (Pro y Multisede)."},"livemode":{"type":"boolean"}},"required":["merchant","apiKey","access","livemode"],"additionalProperties":false},"Customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"birthDate":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"AAAA-MM-DD.","x-description-es":"AAAA-MM-DD."},"consentMarketing":{"type":"boolean","description":"Aceptó recibir promociones.","x-description-es":"Aceptó recibir promociones."},"consentMarketingAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Cuándo aceptó.","x-description-es":"Cuándo aceptó."},"createdVia":{"type":"string","enum":["qr","nfc","link","panel","import","api","mcp"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","email","phone","birthDate","consentMarketing","consentMarketingAt","createdVia","createdAt","updatedAt"],"additionalProperties":false,"description":"Un cliente de tu comercio.","x-description-es":"Un cliente de tu comercio."},"CustomerList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"nextCursor":{"description":"Pasalo como `cursor` para seguir.","x-description-es":"Pasalo como `cursor` para seguir.","type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"CreateCustomerInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","maxLength":254,"format":"email"},"phone":{"type":"string","pattern":"^\\+?[0-9\\s().-]{6,24}$","description":"Teléfono (WhatsApp), con código de país.","x-description-es":"Teléfono (WhatsApp), con código de país."},"birthDate":{"type":"string","format":"date","description":"AAAA-MM-DD.","x-description-es":"AAAA-MM-DD."},"consentMarketing":{"default":false,"description":"Solo `true` si el cliente aceptó recibir promociones.","x-description-es":"Solo `true` si el cliente aceptó recibir promociones.","type":"boolean"},"consentSource":{"type":"string","minLength":3,"maxLength":200,"description":"Cómo aceptó el cliente (p. ej. \"Casilla en el checkout web\"). Obligatorio para dar el consentimiento.","x-description-es":"Cómo aceptó el cliente (p. ej. \"Casilla en el checkout web\"). Obligatorio para dar el consentimiento."}}},"UpdateCustomerInput":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","pattern":"^\\+?[0-9\\s().-]{6,24}$","description":"Teléfono (WhatsApp), con código de país.","x-description-es":"Teléfono (WhatsApp), con código de país."},{"type":"null"}]},"birthDate":{"anyOf":[{"type":"string","format":"date","description":"AAAA-MM-DD.","x-description-es":"AAAA-MM-DD."},{"type":"null"}]},"consentMarketing":{"description":"`false` retira el consentimiento.","x-description-es":"`false` retira el consentimiento.","type":"boolean"},"consentSource":{"type":"string","minLength":3,"maxLength":200,"description":"Cómo aceptó el cliente (p. ej. \"Casilla en el checkout web\"). Obligatorio para dar el consentimiento.","x-description-es":"Cómo aceptó el cliente (p. ej. \"Casilla en el checkout web\"). Obligatorio para dar el consentimiento."}}},"CardState":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"stamps"},"stamps":{"type":"integer"},"required":{"type":"integer"},"reward":{"type":"string"},"rewardDetails":{"type":["string","null"]},"rewardAvailable":{"type":"boolean"},"maxPerVisit":{"type":"integer"}},"required":["type","stamps","required","reward","rewardDetails","rewardAvailable","maxPerVisit"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"points"},"points":{"type":"integer"},"pointsPerUnit":{"type":"number"},"unitAmount":{"type":"number"},"currency":{"type":"string"},"rewards":{"type":"array","items":{"type":"object","properties":{"points":{"type":"integer"},"reward":{"type":"string"},"available":{"type":"boolean"}},"required":["points","reward","available"],"additionalProperties":false}},"nextReward":{"anyOf":[{"type":"object","properties":{"points":{"type":"integer"},"reward":{"type":"string"},"missing":{"type":"integer"}},"required":["points","reward","missing"],"additionalProperties":false},{"type":"null"}]}},"required":["type","points","pointsPerUnit","unitAmount","currency","rewards","nextReward"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"giftcard"},"balance":{"type":"string","description":"Decimal en texto.","x-description-es":"Decimal en texto."},"currency":{"type":"string"},"partialRedemption":{"type":"boolean"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"expired":{"type":"boolean"}},"required":["type","balance","currency","partialRedemption","expiresAt","expired"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"membership"},"status":{"type":"string","enum":["active","grace","expired","inactive"]},"planName":{"type":"string"},"benefits":{"type":"array","items":{"type":"string"}},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"graceUntil":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["type","status","planName","benefits","expiresAt","graceUntil"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"coupon"},"uses":{"type":"integer"},"usage":{"type":"string","enum":["single","multiple"]},"maxUses":{"anyOf":[{"type":"integer"},{"type":"null"}]},"remaining":{"anyOf":[{"type":"integer"},{"type":"null"}]},"discount":{"type":"string"},"minPurchase":{"type":["number","null"]},"currency":{"type":"string"},"validFrom":{"type":["string","null"]},"validUntil":{"type":["string","null"]},"availability":{"type":"string","enum":["available","used","expired","not_started"]}},"required":["type","uses","usage","maxUses","remaining","discount","minPurchase","currency","validFrom","validUntil","availability"],"additionalProperties":false}],"description":"Estado de la tarjeta según el tipo de programa.","x-description-es":"Estado de la tarjeta según el tipo de programa."},"Card":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"programId":{"type":"string","format":"uuid"},"customerId":{"type":"string","format":"uuid"},"programType":{"type":"string","enum":["stamps","points","membership","coupon","giftcard"]},"programName":{"type":"string"},"status":{"type":"string","enum":["active","suspended","expired","revoked"]},"memberNumber":{"type":"string","description":"N° de socio del pase.","x-description-es":"N° de socio del pase."},"summary":{"type":"string","description":"Lo que muestra el pase (\"7 de 10\").","x-description-es":"Lo que muestra el pase (\"7 de 10\")."},"state":{"$ref":"#/components/schemas/CardState"},"wallet":{"type":"object","properties":{"google":{"type":"boolean"},"apple":{"type":"boolean"}},"required":["google","apple"],"additionalProperties":false},"canEarn":{"type":"boolean"},"blockedReason":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","programId","customerId","programType","programName","status","memberNumber","summary","state","wallet","canEarn","blockedReason","createdAt","lastUsedAt"],"additionalProperties":false,"description":"Una tarjeta (una por cliente y programa).","x-description-es":"Una tarjeta (una por cliente y programa)."},"CardList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Card"}},"nextCursor":{"description":"Pasalo como `cursor` para seguir.","x-description-es":"Pasalo como `cursor` para seguir.","type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"IssueCardInput":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid"},"programId":{"type":"string","format":"uuid","description":"Un programa activo.","x-description-es":"Un programa activo."}},"required":["customerId","programId"]},"IssueCardResult":{"type":"object","properties":{"card":{"$ref":"#/components/schemas/Card"},"created":{"type":"boolean","description":"`false` si ya existía.","x-description-es":"`false` si ya existía."},"wallet":{"$ref":"#/components/schemas/WalletLinks"}},"required":["card","created","wallet"],"additionalProperties":false},"WalletLinks":{"type":"object","properties":{"apple":{"description":"Link al .pkpass de Apple.","x-description-es":"Link al .pkpass de Apple.","type":["string","null"]},"google":{"description":"Link de Google Wallet.","x-description-es":"Link de Google Wallet.","type":["string","null"]},"errors":{"type":"object","properties":{"apple":{"type":"string","enum":["not_configured","unavailable","error","test_mode"]},"google":{"type":"string","enum":["not_configured","unavailable","error","test_mode"]}},"additionalProperties":false}},"required":["apple","google","errors"],"additionalProperties":false},"CardEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["stamp","points","redeem","scan","membership_payment","adjust","enroll","pass_saved","pass_removed"]},"kind":{"type":"string","description":"Acción que lo generó.","x-description-es":"Acción que lo generó."},"label":{"type":"string"},"delta":{"type":"string","description":"Variación con signo.","x-description-es":"Variación con signo."},"field":{"anyOf":[{"type":"string","enum":["stamps","points","balance","uses"]},{"type":"null"}]},"origin":{"type":"string","enum":["panel","mcp","api","system","import","copilot"]},"createdAt":{"type":"string","format":"date-time"},"locationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"reason":{"type":["string","null"]},"undoOf":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"undone":{"type":"boolean"},"undoableUntil":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","type","kind","label","delta","field","origin","createdAt","locationId","reason","undoOf","undone","undoableUntil"],"additionalProperties":false},"CardEventList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CardEvent"}}},"required":["data"],"additionalProperties":false},"CardActionInput":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"stamp"},"count":{"default":1,"type":"integer","minimum":1,"maximum":5},"confirmRepeat":{"description":"Confirma que no es un doble escaneo (409 `recent_action`).","x-description-es":"Confirma que no es un doble escaneo (409 `recent_action`).","type":"boolean"},"locationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"redeem_stamps"},"confirmRepeat":{"description":"Confirma que no es un doble escaneo (409 `recent_action`).","x-description-es":"Confirma que no es un doble escaneo (409 `recent_action`).","type":"boolean"},"locationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"add_points"},"amount":{"type":"number","exclusiveMinimum":0,"maximum":100000000,"description":"Importe de la compra.","x-description-es":"Importe de la compra."},"confirmRepeat":{"description":"Confirma que no es un doble escaneo (409 `recent_action`).","x-description-es":"Confirma que no es un doble escaneo (409 `recent_action`).","type":"boolean"},"locationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["action","amount"]},{"type":"object","properties":{"action":{"type":"string","const":"redeem_points"},"rewardPoints":{"type":"integer","minimum":1,"description":"Costo del premio.","x-description-es":"Costo del premio."},"confirmRepeat":{"description":"Confirma que no es un doble escaneo (409 `recent_action`).","x-description-es":"Confirma que no es un doble escaneo (409 `recent_action`).","type":"boolean"},"locationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["action","rewardPoints"]},{"type":"object","properties":{"action":{"type":"string","const":"giftcard_debit"},"amount":{"type":"number","exclusiveMinimum":0,"maximum":100000000,"description":"Monto en unidades, hasta 2 decimales.","x-description-es":"Monto en unidades, hasta 2 decimales."},"confirmRepeat":{"description":"Confirma que no es un doble escaneo (409 `recent_action`).","x-description-es":"Confirma que no es un doble escaneo (409 `recent_action`).","type":"boolean"},"locationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["action","amount"]},{"type":"object","properties":{"action":{"type":"string","const":"membership_check"},"confirmRepeat":{"description":"Confirma que no es un doble escaneo (409 `recent_action`).","x-description-es":"Confirma que no es un doble escaneo (409 `recent_action`).","type":"boolean"},"locationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"coupon_use"},"purchaseAmount":{"type":"number","exclusiveMinimum":0,"maximum":100000000,"description":"Monto en unidades, hasta 2 decimales.","x-description-es":"Monto en unidades, hasta 2 decimales."},"confirmRepeat":{"description":"Confirma que no es un doble escaneo (409 `recent_action`).","x-description-es":"Confirma que no es un doble escaneo (409 `recent_action`).","type":"boolean"},"locationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"adjust"},"field":{"type":"string","enum":["stamps","points","balance","uses"]},"delta":{"type":"number","description":"Con signo: negativo resta.","x-description-es":"Con signo: negativo resta."},"reason":{"type":"string","minLength":3,"maxLength":200},"confirmRepeat":{"description":"Confirma que no es un doble escaneo (409 `recent_action`).","x-description-es":"Confirma que no es un doble escaneo (409 `recent_action`).","type":"boolean"},"locationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["action","field","delta","reason"]}],"description":"Las mismas acciones del escáner.","x-description-es":"Las mismas acciones del escáner."},"CardActionResult":{"type":"object","properties":{"card":{"$ref":"#/components/schemas/Card"},"event":{"$ref":"#/components/schemas/CardEvent"},"message":{"type":"string"},"rewardAvailable":{"type":"boolean"},"replayed":{"type":"boolean"}},"required":["card","event","message","rewardAvailable","replayed"],"additionalProperties":false},"Program":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["stamps","points","membership","coupon","giftcard"]},"name":{"type":"string"},"description":{"type":["string","null"]},"terms":{"type":["string","null"]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"benefit":{"type":"string","description":"Frase corta del beneficio.","x-description-es":"Frase corta del beneficio."},"rules":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","type","name","description","terms","status","benefit","rules","createdAt","updatedAt"],"additionalProperties":false},"ProgramList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Program"}}},"required":["data"],"additionalProperties":false},"Campaign":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"programId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"segmentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"segmentPreset":{"type":["string","null"]},"customerIds":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid"}},{"type":"null"}],"description":"Aviso directo a estos clientes.","x-description-es":"Aviso directo a estos clientes."},"title":{"type":["string","null"]},"text":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","cancelled","failed"]},"origin":{"type":"string","enum":["manual","automation","ai","mcp","api"]},"scheduledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","programId","segmentId","segmentPreset","customerIds","title","text","status","origin","scheduledAt","sentAt","createdAt","updatedAt"],"additionalProperties":false},"CampaignList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}},"nextCursor":{"description":"Pasalo como `cursor` para seguir.","x-description-es":"Pasalo como `cursor` para seguir.","type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"CampaignDetail":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"programId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"segmentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"segmentPreset":{"type":["string","null"]},"customerIds":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid"}},{"type":"null"}],"description":"Aviso directo a estos clientes.","x-description-es":"Aviso directo a estos clientes."},"title":{"type":["string","null"]},"text":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","cancelled","failed"]},"origin":{"type":"string","enum":["manual","automation","ai","mcp","api"]},"scheduledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"report":{"type":"object","properties":{"audience":{"anyOf":[{"type":"integer"},{"type":"null"}]},"recipients":{"anyOf":[{"type":"integer"},{"type":"null"}]},"sent":{"type":"integer"},"skipped":{"type":"object","properties":{"noConsent":{"type":"integer"},"noWallet":{"type":"integer"},"dailyCap":{"type":"integer"}},"required":["noConsent","noWallet","dailyCap"],"additionalProperties":false},"failed":{"type":"integer"},"pending":{"type":"integer"},"byPlatform":{"type":"object","properties":{"google":{"type":"object","properties":{"sent":{"type":"integer"},"capped":{"type":"integer"},"failed":{"type":"integer"},"skipped":{"type":"integer"},"pending":{"type":"integer"}},"required":["sent","capped","failed","skipped","pending"],"additionalProperties":false},"apple":{"type":"object","properties":{"sent":{"type":"integer"},"capped":{"type":"integer"},"failed":{"type":"integer"},"skipped":{"type":"integer"},"pending":{"type":"integer"}},"required":["sent","capped","failed","skipped","pending"],"additionalProperties":false}},"required":["google","apple"],"additionalProperties":false},"googleMode":{"anyOf":[{"type":"string","enum":["broadcast","objects"]},{"type":"null"}]}},"required":["audience","recipients","sent","skipped","failed","pending","byPlatform","googleMode"],"additionalProperties":false}},"required":["id","programId","segmentId","segmentPreset","customerIds","title","text","status","origin","scheduledAt","sentAt","createdAt","updatedAt","report"],"additionalProperties":false},"CampaignQuota":{"type":"object","properties":{"plan":{"type":"string"},"month":{"type":"string"},"max":{"anyOf":[{"type":"integer"},{"type":"null"}]},"used":{"type":"integer"},"remaining":{"anyOf":[{"type":"integer"},{"type":"null"}]},"timezone":{"type":"string"}},"required":["plan","month","max","used","remaining","timezone"],"additionalProperties":false},"CreateCampaignInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":40,"description":"Hasta 40 caracteres.","x-description-es":"Hasta 40 caracteres."},"text":{"type":"string","minLength":1,"maxLength":300,"description":"Hasta 300 caracteres.","x-description-es":"Hasta 300 caracteres."},"programId":{"type":"string","format":"uuid"},"segmentId":{"description":"Un segmento guardado.","x-description-es":"Un segmento guardado.","type":"string","format":"uuid"},"segmentPreset":{"type":"string","enum":["inactive_30","one_stamp_left","birthday_month","new_this_week","vip_10","wallet_removed_30"]},"customerIds":{"description":"Aviso directo a estos clientes (1–500). Cuenta como una campaña.","x-description-es":"Aviso directo a estos clientes (1–500). Cuenta como una campaña.","minItems":1,"maxItems":500,"type":"array","items":{"type":"string","format":"uuid"}}},"required":["title","text","programId"],"description":"Sin segmento = todas las tarjetas del programa. Solo les llega a quienes aceptaron.","x-description-es":"Sin segmento = todas las tarjetas del programa. Solo les llega a quienes aceptaron."},"ScheduleCampaignInput":{"type":"object","properties":{"sendAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$","description":"Hora local del comercio.","x-description-es":"Hora local del comercio."}},"required":["sendAt"]},"SegmentList":{"type":"object","properties":{"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"programId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},"required":["id","name","programId"],"additionalProperties":false}},"presets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["key","name","description"],"additionalProperties":false}}},"required":["segments","presets"],"additionalProperties":false},"Stats":{"type":"object","properties":{"period":{"type":"object","properties":{"days":{"type":"integer"},"from":{"type":"string"},"to":{"type":"string"},"timezone":{"type":"string"}},"required":["days","from","to","timezone"],"additionalProperties":false},"kpis":{"type":"object","properties":{"newCustomers":{"type":"object","properties":{"value":{"type":"integer"},"previous":{"type":"integer"}},"required":["value","previous"],"additionalProperties":false},"visits":{"type":"object","properties":{"value":{"type":"integer"},"previous":{"type":"integer"}},"required":["value","previous"],"additionalProperties":false},"rewardsRedeemed":{"type":"object","properties":{"value":{"type":"integer"},"previous":{"type":"integer"}},"required":["value","previous"],"additionalProperties":false},"returningCustomers":{"type":"object","properties":{"value":{"type":"integer"},"previous":{"type":"integer"}},"required":["value","previous"],"additionalProperties":false},"activePasses":{"type":"object","properties":{"google":{"type":"integer"},"apple":{"type":"integer"}},"required":["google","apple"],"additionalProperties":false},"passesSaved":{"type":"object","properties":{"value":{"type":"integer"},"previous":{"type":"integer"},"google":{"type":"integer"},"apple":{"type":"integer"}},"required":["value","previous","google","apple"],"additionalProperties":false},"passesRemoved":{"type":"object","properties":{"value":{"type":"integer"},"previous":{"type":"integer"},"google":{"type":"integer"},"apple":{"type":"integer"}},"required":["value","previous","google","apple"],"additionalProperties":false}},"required":["newCustomers","visits","rewardsRedeemed","returningCustomers","activePasses","passesSaved","passesRemoved"],"additionalProperties":false},"visitsByDay":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"visits":{"type":"integer"}},"required":["day","visits"],"additionalProperties":false}}},"required":["period","kpis","visitsByDay"],"additionalProperties":false},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string","enum":["customer.created","card.created","card.stamped","card.points_changed","card.balance_changed","card.adjusted","card.action_undone","reward.redeemed","membership.checked","membership.payment_received","membership.payment_reverted","membership.cancelled","pass.saved","pass.removed"]}},"enabled":{"type":"boolean"},"disabledReason":{"anyOf":[{"type":"string","enum":["manual","failures","key_revoked","plan"]},{"type":"null"}],"description":"`manual`, `failures`, `key_revoked` (revocaron su clave o su dueño ya no lo es) o `plan` (pausado hasta que el plan vuelva a incluir webhooks).","x-description-es":"`manual`, `failures`, `key_revoked` (revocaron su clave o su dueño ya no lo es) o `plan` (pausado hasta que el plan vuelva a incluir webhooks)."},"consecutiveFailures":{"type":"integer"},"lastSuccessAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastFailureAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","url","description","events","enabled","disabledReason","consecutiveFailures","lastSuccessAt","lastFailureAt","createdAt","updatedAt"],"additionalProperties":false},"WebhookEndpointList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"required":["data"],"additionalProperties":false},"WebhookEndpointWithSecret":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string","enum":["customer.created","card.created","card.stamped","card.points_changed","card.balance_changed","card.adjusted","card.action_undone","reward.redeemed","membership.checked","membership.payment_received","membership.payment_reverted","membership.cancelled","pass.saved","pass.removed"]}},"enabled":{"type":"boolean"},"disabledReason":{"anyOf":[{"type":"string","enum":["manual","failures","key_revoked","plan"]},{"type":"null"}],"description":"`manual`, `failures`, `key_revoked` (revocaron su clave o su dueño ya no lo es) o `plan` (pausado hasta que el plan vuelva a incluir webhooks).","x-description-es":"`manual`, `failures`, `key_revoked` (revocaron su clave o su dueño ya no lo es) o `plan` (pausado hasta que el plan vuelva a incluir webhooks)."},"consecutiveFailures":{"type":"integer"},"lastSuccessAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastFailureAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"secret":{"description":"Secreto para firmar. Se muestra una sola vez: `null` en una respuesta repetida (rotalo desde el panel).","x-description-es":"Secreto para firmar. Se muestra una sola vez: `null` en una respuesta repetida (rotalo desde el panel).","type":["string","null"]},"notice":{"type":"string"}},"required":["id","url","description","events","enabled","disabledReason","consecutiveFailures","lastSuccessAt","lastFailureAt","createdAt","updatedAt","secret"],"additionalProperties":false},"CreateWebhookEndpointInput":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri","description":"URL HTTPS de un host público.","x-description-es":"URL HTTPS de un host público."},"events":{"minItems":1,"maxItems":14,"type":"array","items":{"type":"string","enum":["customer.created","card.created","card.stamped","card.points_changed","card.balance_changed","card.adjusted","card.action_undone","reward.redeemed","membership.checked","membership.payment_received","membership.payment_reverted","membership.cancelled","pass.saved","pass.removed"]}},"description":{"type":"string","maxLength":200}},"required":["url","events"]},"UpdateWebhookEndpointInput":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri","description":"URL HTTPS de un host público.","x-description-es":"URL HTTPS de un host público."},"events":{"minItems":1,"maxItems":14,"type":"array","items":{"type":"string","enum":["customer.created","card.created","card.stamped","card.points_changed","card.balance_changed","card.adjusted","card.action_undone","reward.redeemed","membership.checked","membership.payment_received","membership.payment_reverted","membership.cancelled","pass.saved","pass.removed"]}},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"enabled":{"type":"boolean"}}},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"endpointId":{"type":"string","format":"uuid"},"eventId":{"type":"string"},"eventType":{"type":"string"},"status":{"type":"string","enum":["pending","succeeded","failed"]},"attempts":{"type":"integer"},"responseStatus":{"anyOf":[{"type":"integer"},{"type":"null"}]},"error":{"type":["string","null"]},"livemode":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"lastAttemptAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","endpointId","eventId","eventType","status","attempts","responseStatus","error","livemode","createdAt","lastAttemptAt","deliveredAt"],"additionalProperties":false},"WebhookDeliveryList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"nextCursor":{"description":"Pasalo como `cursor` para seguir.","x-description-es":"Pasalo como `cursor` para seguir.","type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string","description":"Id del evento (igual en cada reintento).","x-description-es":"Id del evento (igual en cada reintento)."},"type":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"livemode":{"type":"boolean"},"merchantId":{"type":"string","format":"uuid"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","createdAt","livemode","merchantId","data"],"additionalProperties":false,"description":"Cuerpo de cada pedido del webhook.","x-description-es":"Cuerpo de cada pedido del webhook."}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Clave `kbk_live_…` o `kbk_test_…` de Panel › Integraciones."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"description":"Único por operación (p. ej. un UUID). Un reintento con la misma clave devuelve la respuesta original.","schema":{"type":"string","minLength":1,"maxLength":255}}},"headers":{"RateLimitLimit":{"schema":{"type":"integer"},"description":"Requests per minute."},"RateLimitRemaining":{"schema":{"type":"integer"},"description":"Requests left."},"RateLimitReset":{"schema":{"type":"integer"},"description":"Seconds to reset."}},"responses":{"Error":{"description":"400: Datos inválidos (`validation_error`). · 401: Falta la clave, es inválida o está revocada. · 403: Sin el permiso (`insufficient_scope`), sin el plan (`plan_upgrade_required`, con `details.requiredPlan`) o comercio inactivo (`merchant_inactive`). · 404: No existe en tu comercio. · 409: Conflicto con el estado actual. · 429: Demasiados pedidos (`rate_limited`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"x-kambak-scopes":["customers:read","customers:write","cards:read","cards:write","programs:read","campaigns:read","campaigns:write","stats:read","webhooks:read","webhooks:write"],"x-kambak-plans":{"starter":{"rateLimitPerMinute":60,"maxKeys":20},"pro":{"rateLimitPerMinute":120,"maxKeys":20},"multisite":{"rateLimitPerMinute":600,"maxKeys":200}}}