{"openapi":"3.0.3","info":{"title":"Repitoo API","version":"1.0.0"},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"A key from the panel: Settings → API (rpt_live_…)"},"partnerKey":{"type":"http","scheme":"bearer","description":"A partner's key from Repitoo (rpt_partner_… or rpt_test_…)"}},"schemas":{}},"paths":{"/health":{"get":{"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"database":{"type":"string","enum":["ok"]}},"required":["status","database"],"additionalProperties":false}}}}}}},"/v1/cards/{serialNumber}":{"get":{"description":"Public card status by wallet serial number","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"serialNumber","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"serialNumber":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerName":{"type":"string"},"businessName":{"type":"string"},"programName":{"type":"string"},"rewardDescription":{"type":"string"},"stampBalance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stampsRequired":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rewardsAvailable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["serialNumber","customerName","businessName","programName","rewardDescription","stampBalance","stampsRequired","rewardsAvailable"],"additionalProperties":false}}}}}}},"/v1/purchases":{"post":{"tags":["Purchases"],"description":"Records a sale: stamps the customer's card, and signs the customer up if the business doesn't know them yet. Send an Idempotency-Key (the invoice number works) so a retry never stamps twice.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customer":{"type":"object","properties":{"email":{"type":"string"},"phone":{"type":"string","minLength":8,"maxLength":20},"cardCode":{"type":"string","minLength":8},"name":{"type":"string","minLength":1,"maxLength":120}}},"programId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stamps":{"default":1,"type":"integer","minimum":1,"maximum":20},"amount":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":10000000},"reference":{"type":"string","maxLength":120},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["customer"]}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"in":"header","name":"idempotency-key","required":true}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"card":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serialNumber":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"url":{"type":"string"},"programId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"programName":{"type":"string"},"rewardDescription":{"type":"string"},"stampBalance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stampsRequired":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rewardsAvailable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"}},"required":["id","name","email","phone"],"additionalProperties":false}},"required":["id","serialNumber","url","programId","programName","rewardDescription","stampBalance","stampsRequired","rewardsAvailable","customer"],"additionalProperties":false},"stampsAdded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rewardEarned":{"type":"boolean"},"enrolled":{"type":"boolean"}},"required":["card","stampsAdded","rewardEarned","enrolled"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/cards/lookup":{"get":{"tags":["Cards"],"description":"Finds a customer's card by email, phone or the code under the QR.","parameters":[{"schema":{"type":"string"},"in":"query","name":"email","required":false},{"schema":{"type":"string","minLength":8,"maxLength":20},"in":"query","name":"phone","required":false},{"schema":{"type":"string","minLength":8},"in":"query","name":"cardCode","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"query","name":"programId","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serialNumber":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"url":{"type":"string"},"programId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"programName":{"type":"string"},"rewardDescription":{"type":"string"},"stampBalance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stampsRequired":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rewardsAvailable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"}},"required":["id","name","email","phone"],"additionalProperties":false}},"required":["id","serialNumber","url","programId","programName","rewardDescription","stampBalance","stampsRequired","rewardsAvailable","customer"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/cards/{cardId}/redemptions":{"post":{"tags":["Cards"],"description":"Redeems one reward: takes the stamps it needs off the card. Send an Idempotency-Key so a retry never redeems twice.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"cardId","required":true},{"schema":{"type":"string","minLength":1,"maxLength":200},"in":"header","name":"idempotency-key","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serialNumber":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"url":{"type":"string"},"programId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"programName":{"type":"string"},"rewardDescription":{"type":"string"},"stampBalance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stampsRequired":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rewardsAvailable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"}},"required":["id","name","email","phone"],"additionalProperties":false}},"required":["id","serialNumber","url","programId","programName","rewardDescription","stampBalance","stampsRequired","rewardsAvailable","customer"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/cards/{cardId}/stamps/reversals":{"post":{"tags":["Cards"],"description":"Takes back the stamps of a voided sale. Never below zero. Send an Idempotency-Key so a retry never takes them twice.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stamps":{"type":"integer","minimum":1,"maximum":20}},"required":["stamps"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"cardId","required":true},{"schema":{"type":"string","minLength":1,"maxLength":200},"in":"header","name":"idempotency-key","required":false}],"security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serialNumber":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"url":{"type":"string"},"programId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"programName":{"type":"string"},"rewardDescription":{"type":"string"},"stampBalance":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stampsRequired":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rewardsAvailable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"}},"required":["id","name","email","phone"],"additionalProperties":false}},"required":["id","serialNumber","url","programId","programName","rewardDescription","stampBalance","stampsRequired","rewardsAvailable","customer"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/programs":{"get":{"tags":["Programs"],"description":"The business's active programs, to know which programId to send.","security":[{"apiKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"stampsRequired":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rewardDescription":{"type":"string"}},"required":["id","name","stampsRequired","rewardDescription"],"additionalProperties":false}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/partner/":{"get":{"summary":"The partner behind the key","tags":["Partners"],"description":"Its brand, how its restaurants give stamps and the origins of its modal.","security":[{"partnerKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"mode":{"type":"string","enum":["live","test"]},"branding":{"type":"string","enum":["business","with_repitoo","partner"]},"stampModes":{"type":"string","enum":["visit","amount","both"]},"allowedOrigins":{"type":"array","items":{"type":"string"}}},"required":["name","status","mode","branding","stampModes","allowedOrigins"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}}}}}}},"/v1/partner/businesses":{"get":{"summary":"The partner's businesses","tags":["Partners"],"description":"Newest first. A test key lists only the businesses made with test keys.","security":[{"partnerKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"businesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"slug":{"type":"string"},"externalId":{"nullable":true,"type":"string"},"test":{"type":"boolean"},"deactivatedAt":{"nullable":true,"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","externalId","test","deactivatedAt","createdAt"],"additionalProperties":false}}},"required":["businesses"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}}}}}},"post":{"summary":"Turn on loyalty for a restaurant","tags":["Partners"],"description":"Creates the restaurant's business, its owner (who signs in to Repitoo with ownerEmail), its first stamp card and a key (rpt_live_…) for the stamps API, shown only here. Send externalId: the same id again returns the same business, with no new key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"ownerEmail":{"type":"string"},"ownerName":{"type":"string","minLength":1,"maxLength":80},"externalId":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":64},"currency":{"type":"string","enum":["CRC","USD","CAD","MXN","GTQ","HNL","NIO","PAB","DOP","COP","PEN","CLP","EUR"]},"program":{"type":"object","properties":{"name":{"default":"Sellos","type":"string","minLength":1,"maxLength":60},"stampsRequired":{"default":10,"type":"integer","minimum":2,"maximum":50},"rewardDescription":{"type":"string","minLength":1,"maxLength":120},"stampAmount":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":1000000}},"required":["rewardDescription"]}},"required":["name","ownerEmail","program"]}}}},"security":[{"partnerKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"business":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"slug":{"type":"string"},"externalId":{"nullable":true,"type":"string"},"test":{"type":"boolean"},"deactivatedAt":{"nullable":true,"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","externalId","test","deactivatedAt","createdAt"],"additionalProperties":false},"apiKey":{"type":"string","nullable":true,"enum":[null]},"created":{"type":"boolean","enum":[false]}},"required":["business","apiKey","created"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"business":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"slug":{"type":"string"},"externalId":{"nullable":true,"type":"string"},"test":{"type":"boolean"},"deactivatedAt":{"nullable":true,"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","externalId","test","deactivatedAt","createdAt"],"additionalProperties":false},"apiKey":{"type":"string"},"created":{"type":"boolean","enum":[true]}},"required":["business","apiKey","created"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}}}}}}},"/v1/partner/businesses/{businessId}/keys":{"post":{"summary":"A new key for one of the partner's businesses","tags":["Partners"],"description":"To replace a leaked key. The old one keeps working until the owner revokes it.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"businessId","required":true}],"security":[{"partnerKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string"}},"required":["apiKey"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}}}}}}},"/v1/partner/businesses/{businessId}/deactivate":{"post":{"summary":"Turn loyalty off for a restaurant","tags":["Partners"],"description":"When the restaurant stops paying for it: its panel reads only, its customers keep their stamps and it no longer counts as an active location.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"businessId","required":true}],"security":[{"partnerKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"business":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"slug":{"type":"string"},"externalId":{"nullable":true,"type":"string"},"test":{"type":"boolean"},"deactivatedAt":{"nullable":true,"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","externalId","test","deactivatedAt","createdAt"],"additionalProperties":false}},"required":["business"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}}}}}}},"/v1/partner/businesses/{businessId}/activate":{"post":{"summary":"Turn loyalty back on for a restaurant","tags":["Partners"],"description":"The restaurant gives stamps again and counts as an active location.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"businessId","required":true}],"security":[{"partnerKey":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"business":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"slug":{"type":"string"},"externalId":{"nullable":true,"type":"string"},"test":{"type":"boolean"},"deactivatedAt":{"nullable":true,"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","externalId","test","deactivatedAt","createdAt"],"additionalProperties":false}},"required":["business"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}}}}}}},"/v1/partner/businesses/{businessId}/embed-sessions":{"post":{"summary":"Open Repitoo inside your system for a restaurant","tags":["Partners"],"description":"Returns the address of a window (an iframe, or `<repitoo-modal>` of @repitoo/sdk) where the cashier looks up a customer, stamps and hands out the reward. It works for 30 minutes; ask for a new one each time the window opens. Only your allowed origins may frame it. Never send it to the browser before you need it.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"businessId","required":true}],"security":[{"partnerKey":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["url","expiresAt"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false}}}}}}}}}