{"openapi":"3.1.0","info":{"title":"Doop API","version":"1.0.0","description":"Conecta tu POS o ERP. Autenticación: Authorization: Bearer pp_live_... Todos los POST requieren Idempotency-Key. Webhooks firmados con PP-Signature (t=…,v1=HMAC-SHA256(secret, \"t.body\")). Eventos: customer.joined, stamp.added, reward.earned, reward.redeemed, promotion.redeemed."},"servers":[{"url":"/api/v1"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"security":[{"bearer":[]}],"paths":{"/customers/lookup":{"get":{"summary":"Buscar cliente por QR, código corto, email o teléfono","parameters":[{"name":"token","in":"query","schema":{"type":"string"}},{"name":"code","in":"query","schema":{"type":"string"}},{"name":"email","in":"query","schema":{"type":"string"}},{"name":"phone","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: { data: ... }"},"4XX":{"description":"{ error: { code, message } }"}}}},"/customers/{customerId}/card":{"get":{"summary":"Tarjeta de sellos y recompensas del cliente","parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK: { data: ... }"},"4XX":{"description":"{ error: { code, message } }"}}}},"/stamps":{"post":{"summary":"Sumar un sello (idempotente por externalId)","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid"},"customerToken":{"type":"string","description":"Contenido del QR del cliente"},"branchId":{"type":"string","format":"uuid"},"amountCents":{"type":"integer"},"occurredAt":{"type":"string","format":"date-time"},"externalId":{"type":"string","description":"Id de la venta en tu sistema"}},"required":["branchId","externalId"]}}}},"responses":{"200":{"description":"OK: { data: ... }"},"4XX":{"description":"{ error: { code, message } }"}}}},"/rewards/{rewardId}/redeem":{"post":{"summary":"Canjear una recompensa","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":100}},{"name":"rewardId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"branchId":{"type":"string","format":"uuid"}},"required":[]}}}},"responses":{"200":{"description":"OK: { data: ... }"},"4XX":{"description":"{ error: { code, message } }"}}}},"/promotions":{"get":{"summary":"Promociones vigentes","parameters":[{"name":"customerId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"branchId","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK: { data: ... }"},"4XX":{"description":"{ error: { code, message } }"}}}},"/promotions/{promotionId}/redeem":{"post":{"summary":"Canjear una promoción","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":100}},{"name":"promotionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid"},"branchId":{"type":"string","format":"uuid"},"externalId":{"type":"string"}},"required":["customerId","externalId"]}}}},"responses":{"200":{"description":"OK: { data: ... }"},"4XX":{"description":"{ error: { code, message } }"}}}},"/notifications":{"post":{"summary":"Enviar o programar un aviso push (usa la cuota del plan)","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":60},"body":{"type":"string","maxLength":180},"url":{"type":"string"},"audience":{"type":"object","description":"{\"type\":\"all\"} | {\"type\":\"branch\",\"branchId\"} | {\"type\":\"inactive\",\"days\"}"},"scheduledAt":{"type":"string","format":"date-time"}},"required":["title","body"]}}}},"responses":{"200":{"description":"OK: { data: ... }"},"4XX":{"description":"{ error: { code, message } }"}}}}}}