{"openapi":"3.1.0","info":{"title":"Kambak API","version":"1.0.0","description":"REST API to connect Kambak with your POS, online store or Zapier. Full guide: https://kambak.app/en/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":"Account"},{"name":"customers","description":"Customers"},{"name":"cards","description":"Cards"},{"name":"programs","description":"Programs"},{"name":"campaigns","description":"Campaigns and notices"},{"name":"stats","description":"Stats"},{"name":"webhooks","description":"Webhooks"}],"paths":{"/me":{"get":{"operationId":"me.get","tags":["me"],"summary":"Current business and key","description":"Perfect first call: confirms your key works.\n\nMinimum plan: `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":"List or search customers","description":"Scope: `customers:read`.\n\nMinimum plan: `starter`.","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size (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":"`nextCursor` of the previous page.","x-description-es":"El `nextCursor` de la página anterior.","schema":{"type":"string","maxLength":200}},{"name":"q","in":"query","required":false,"description":"Search by name, email or phone.","x-description-es":"Buscar por nombre, email o teléfono.","schema":{"type":"string","minLength":2,"maxLength":100}},{"name":"email","in":"query","required":false,"description":"Exact email (case-insensitive).","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":"Create a customer","description":"Promotions need real consent: send `consentSource`. Duplicate email → 409 `customer_exists`.\n\nScope: `customers:write`.\n\nMinimum plan: `starter`.\n\nErrors: `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":"Get a customer","description":"Scope: `customers:read`.\n\nMinimum plan: `starter`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"Update a customer","description":"`null` clears a field. Granting consent needs `consentSource`; withdrawing does not.\n\nScope: `customers:write`.\n\nMinimum plan: `pro`.\n\nErrors: `email_taken`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"Cards of a customer","description":"Scope: `cards:read`.\n\nMinimum plan: `starter`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"List cards","description":"Scope: `cards:read`.\n\nMinimum plan: `pro`.","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size (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":"`nextCursor` of the previous page.","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":"Issue a card","description":"Creates the customer card in an active program and returns the Wallet links. If it exists, returns it (200).\n\nScope: `cards:write`.\n\nMinimum plan: `starter`.\n\nErrors: `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":"Get a card","description":"Scope: `cards:read`.\n\nMinimum plan: `starter`.\n\nErrors: `card_not_found`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"Find by pass QR code","description":"Send what the scanner read (URL-encoded).\n\nScope: `cards:read`.\n\nMinimum plan: `starter`.\n\nErrors: `card_not_found`.","parameters":[{"name":"code","in":"path","required":true,"description":"Content of the pass QR code.","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":"Card history","description":"Scope: `cards:read`.\n\nMinimum plan: `starter`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"Add-to-Wallet links","description":"Scope: `cards:read`.\n\nMinimum plan: `starter`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"Add, subtract or redeem","description":"Same rules as the scanner: history, Wallet and undo. Subtract = `adjust` with a negative `delta`.\n\nScope: `cards:write`.\n\nMinimum plan: `starter`.\n\nErrors: `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":"Resource id.","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":"Undo the last action","description":"Within 5 minutes.\n\nScope: `cards:write`.\n\nMinimum plan: `starter`.\n\nErrors: `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":"List programs","description":"Scope: `programs:read`.\n\nMinimum plan: `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":"Get a program","description":"Scope: `programs:read`.\n\nMinimum plan: `starter`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"List campaigns","description":"Scope: `campaigns:read`.\n\nMinimum plan: `pro`.","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size (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":"`nextCursor` of the previous page.","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":"Create a notice (draft)","description":"Scope: `campaigns:write`.\n\nMinimum plan: `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":"Monthly quota","description":"Scope: `campaigns:read`.\n\nMinimum plan: `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":"Available segments","description":"Scope: `campaigns:read`.\n\nMinimum plan: `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":"Campaign and report","description":"Scope: `campaigns:read`.\n\nMinimum plan: `pro`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"Send now","description":"Goes through the reviewer, consent, the plan quota and the 3-per-pass-per-24h cap.\n\nScope: `campaigns:write`.\n\nMinimum plan: `pro`.\n\nErrors: `campaign_review_failed`, `campaign_no_recipients`, `campaign_limit_reached`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"Schedule","description":"Scope: `campaigns:write`.\n\nMinimum plan: `pro`.\n\nErrors: `invalid_schedule`, `campaign_limit_reached`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"Cancel a scheduled one","description":"Scope: `campaigns:write`.\n\nMinimum plan: `pro`.\n\nErrors: `campaign_not_cancellable`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"Period overview","description":"Scope: `stats:read`.\n\nMinimum plan: `pro`.","parameters":[{"name":"days","in":"query","required":false,"description":"7, 30 or 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":"List webhooks","description":"Scope: `webhooks:read`.\n\nMinimum plan: `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":"Create a webhook","description":"Returns the `secret` to verify signatures (only once). Each event needs its read scope: `customer.*` → `customers:read`; the rest → `cards:read`.\n\nScope: `webhooks:write`.\n\nMinimum plan: `pro`.\n\nErrors: `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":"Get a webhook","description":"Scope: `webhooks:read`.\n\nMinimum plan: `pro`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"Update or re-enable a webhook","description":"Events need the same read scope as on create.\n\nScope: `webhooks:write`.\n\nMinimum plan: `pro`.\n\nErrors: `webhook_url_not_allowed`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"Delete a webhook","description":"Scope: `webhooks:write`.\n\nMinimum plan: `pro`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"204":{"description":"No content","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":"Send a test event","description":"Scope: `webhooks:write`.\n\nMinimum plan: `pro`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"Recent deliveries","description":"Scope: `webhooks:read`.\n\nMinimum plan: `pro`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","x-description-es":"Id del recurso.","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"description":"Page size (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":"`nextCursor` of the previous page.","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":"Resend a delivery","description":"Scope: `webhooks:write`.\n\nMinimum plan: `pro`.","parameters":[{"name":"id","in":"path","required":true,"description":"Resource id.","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":"New customer","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":"Received (2xx)"}}}},"card.created":{"post":{"summary":"New card","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":"Received (2xx)"}}}},"card.stamped":{"post":{"summary":"Stamps added","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":"Received (2xx)"}}}},"card.points_changed":{"post":{"summary":"Points earned","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":"Received (2xx)"}}}},"card.balance_changed":{"post":{"summary":"Gift card balance used","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":"Received (2xx)"}}}},"card.adjusted":{"post":{"summary":"Manual adjustment","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":"Received (2xx)"}}}},"card.action_undone":{"post":{"summary":"Action undone","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":"Received (2xx)"}}}},"reward.redeemed":{"post":{"summary":"Reward or coupon redeemed","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":"Received (2xx)"}}}},"membership.checked":{"post":{"summary":"Membership checked","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":"Received (2xx)"}}}},"membership.payment_received":{"post":{"summary":"Membership paid","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":"Received (2xx)"}}}},"membership.payment_reverted":{"post":{"summary":"Payment reverted","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":"Received (2xx)"}}}},"membership.cancelled":{"post":{"summary":"Membership cancelled","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":"Received (2xx)"}}}},"pass.saved":{"post":{"summary":"Pass saved to 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":"Received (2xx)"}}}},"pass.removed":{"post":{"summary":"Pass removed from 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":"Received (2xx)"}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable snake_case code.","x-description-es":"Código estable en snake_case."},"message":{"type":"string","description":"Human-readable message (Spanish).","x-description-es":"Mensaje para mostrar (en español)."},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"Error response.","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":"Location of the key: card actions are recorded there.","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":"What the plan includes: `pos` (Starter: POS operations) or `full` (Pro and Multi-location).","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":"YYYY-MM-DD.","x-description-es":"AAAA-MM-DD."},"consentMarketing":{"type":"boolean","description":"Opted in to promotions.","x-description-es":"Aceptó recibir promociones."},"consentMarketingAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When they opted in.","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":"A customer of your business.","x-description-es":"Un cliente de tu comercio."},"CustomerList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"nextCursor":{"description":"Pass it as `cursor` for the next page.","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":"Phone (WhatsApp), with country code.","x-description-es":"Teléfono (WhatsApp), con código de país."},"birthDate":{"type":"string","format":"date","description":"YYYY-MM-DD.","x-description-es":"AAAA-MM-DD."},"consentMarketing":{"default":false,"description":"Only `true` if the customer actively opted in to promotions.","x-description-es":"Solo `true` si el cliente aceptó recibir promociones.","type":"boolean"},"consentSource":{"type":"string","minLength":3,"maxLength":200,"description":"How the customer opted in (e.g. \"Checkbox at web checkout\"). Required to grant consent.","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":"Phone (WhatsApp), with country code.","x-description-es":"Teléfono (WhatsApp), con código de país."},{"type":"null"}]},"birthDate":{"anyOf":[{"type":"string","format":"date","description":"YYYY-MM-DD.","x-description-es":"AAAA-MM-DD."},{"type":"null"}]},"consentMarketing":{"description":"`false` withdraws consent.","x-description-es":"`false` retira el consentimiento.","type":"boolean"},"consentSource":{"type":"string","minLength":3,"maxLength":200,"description":"How the customer opted in (e.g. \"Checkbox at web checkout\"). Required to grant consent.","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 string.","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":"Card state by program type.","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":"Member number shown on the pass.","x-description-es":"N° de socio del pase."},"summary":{"type":"string","description":"What the pass shows (e.g. \"7 of 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":"A loyalty card (one per customer and program).","x-description-es":"Una tarjeta (una por cliente y programa)."},"CardList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Card"}},"nextCursor":{"description":"Pass it as `cursor` for the next page.","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":"An active program.","x-description-es":"Un programa activo."}},"required":["customerId","programId"]},"IssueCardResult":{"type":"object","properties":{"card":{"$ref":"#/components/schemas/Card"},"created":{"type":"boolean","description":"`false` if the card already existed.","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":"Apple Wallet .pkpass URL.","x-description-es":"Link al .pkpass de Apple.","type":["string","null"]},"google":{"description":"\"Save to Google Wallet\" URL.","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":"Action that created it.","x-description-es":"Acción que lo generó."},"label":{"type":"string"},"delta":{"type":"string","description":"Signed change (decimal string).","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":"Confirms it is not a double scan (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":"Confirms it is not a double scan (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":"Purchase amount.","x-description-es":"Importe de la compra."},"confirmRepeat":{"description":"Confirms it is not a double scan (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":"Cost of the reward.","x-description-es":"Costo del premio."},"confirmRepeat":{"description":"Confirms it is not a double scan (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":"Amount in currency units, up to 2 decimals.","x-description-es":"Monto en unidades, hasta 2 decimales."},"confirmRepeat":{"description":"Confirms it is not a double scan (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":"Confirms it is not a double scan (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":"Amount in currency units, up to 2 decimals.","x-description-es":"Monto en unidades, hasta 2 decimales."},"confirmRepeat":{"description":"Confirms it is not a double scan (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":"Signed: negative subtracts.","x-description-es":"Con signo: negativo resta."},"reason":{"type":"string","minLength":3,"maxLength":200},"confirmRepeat":{"description":"Confirms it is not a double scan (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":"Same actions as the in-store scanner.","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":"Short benefit text.","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":"Direct notice to these customers.","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":"Pass it as `cursor` for the next page.","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":"Direct notice to these customers.","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":"Up to 40 characters.","x-description-es":"Hasta 40 caracteres."},"text":{"type":"string","minLength":1,"maxLength":300,"description":"Up to 300 characters.","x-description-es":"Hasta 300 caracteres."},"programId":{"type":"string","format":"uuid"},"segmentId":{"description":"A saved segment.","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":"Direct notice to these customers (1–500). Counts as one campaign.","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":"Without segment = every card of the program. Only customers who opted in receive it.","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":"Local time of the business (YYYY-MM-DDTHH:mm).","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` (its API key was revoked or its owner left) or `plan` (paused until the plan includes webhooks again).","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` (its API key was revoked or its owner left) or `plan` (paused until the plan includes webhooks again).","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":"Signing secret. Shown only once: `null` in an idempotent replay (rotate it from the 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":"HTTPS URL on a public host.","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":"HTTPS URL on a public host.","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":"Pass it as `cursor` for the next page.","x-description-es":"Pasalo como `cursor` para seguir.","type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string","description":"Event id (same across retries).","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":"Body of every webhook request.","x-description-es":"Cuerpo de cada pedido del webhook."}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"`kbk_live_…` or `kbk_test_…` key from Panel › Integrations."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per operation (e.g. a UUID). Retrying with the same key returns the original response.","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: Invalid data (`validation_error`). · 401: Missing, invalid or revoked key. · 403: Missing scope (`insufficient_scope`), plan (`plan_upgrade_required`, with `details.requiredPlan`) or inactive business (`merchant_inactive`). · 404: Not found in your business. · 409: Conflict with the current state. · 429: Too many requests (`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}}}