{"openapi":"3.1.0","info":{"title":"blip for shop owners","version":"0.1.0","description":"Run a shop on blip from your own agent. Sign the owner in with a code texted to their mobile, see what's waiting, and answer. Never answer for the owner: ask them first."},"servers":[{"url":"https://blip.diwas.ai"}],"components":{"securitySchemes":{"session":{"type":"http","scheme":"bearer","description":"The session from sign-in"}}},"paths":{"/api/owner/sign-in":{"post":{"operationId":"ownerSignIn","summary":"Sign the shop owner in","description":"Call with just the phone: blip texts a 6-digit code and returns a session. Call again with the phone, the code the owner reads out, and that session.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone"],"properties":{"phone":{"type":"string","description":"The shop owner's mobile number"},"code":{"type":"string","description":"The 6-digit code, once the owner has it"},"session":{"type":"string","description":"The session from the first call"}}}}}},"responses":{"200":{"description":"Code sent, or signed in","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"session":{"type":"string"},"signed_in":{"type":"boolean"},"shops":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/owner/waiting":{"get":{"operationId":"whatsWaiting","summary":"What's waiting on the owner","description":"Booking requests, orders, approvals and customer messages waiting on the owner, newest first, each with an id. Check this in the background and tell the owner when something new appears.","security":[{"session":[]}],"responses":{"200":{"description":"Waiting items","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"waiting":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"shop":{"type":"string"},"kind":{"type":"string"},"text":{"type":"string"},"since":{"type":"string"}}}}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/owner/answer":{"post":{"operationId":"answer","summary":"Answer one waiting item","description":"Only after the owner has said what to do. 'yes' confirms or approves, 'no' declines, 'ready' marks an order ready. The customer is told, with the note if there is one.","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","decision"],"properties":{"id":{"type":"string","description":"The item's id, like J-1001"},"decision":{"type":"string","enum":["yes","no","ready"]},"note":{"type":"string","description":"Optional words for the customer"}}}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"id":{"type":"string"},"decision":{"type":"string"}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/owner/connect-booking":{"post":{"operationId":"connectBooking","summary":"Connect the shop's booking system","description":"Only when the owner asked. Give the booking page customers use, or the business's website; blip works out the system (Mindbody, Cal.com, Square Appointments, Acuity, Arketa). status: connected; needs_approval (the owner taps approve_url once, then call again with the same link); needs_key (ask for the key named, then call again with it).","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["link"],"properties":{"link":{"type":"string","description":"The booking page or the business's website"},"shop":{"type":"string","description":"The shop's id, if the owner has several"},"api_key":{"type":"string","description":"Acuity or Arketa only"},"user_id":{"type":"string","description":"Acuity only, if the link doesn't show it"},"partner_id":{"type":"string","description":"Arketa only"}}}}}},"responses":{"200":{"description":"What happened","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"shop":{"type":"string"},"status":{"type":"string","enum":["connected","needs_approval","needs_key"]},"system":{"type":"string"},"approve_url":{"type":"string"},"services":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}