{"openapi":"3.1.0","info":{"title":"Receipt Book API","version":"1.1.0","description":"Receipts for small businesses. Receipt Book never holds or moves money. Amounts are whole US cents; timestamps are UTC ISO 8601."},"servers":[{"url":"https://getreceiptbook.com/api/v1"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Create a key in the app under Settings, then send Authorization: Bearer vw_... Each key has scopes; see x-required-scope on each operation."},"connect":{"type":"oauth2","description":"Connect with Receipt Book: authorization code with PKCE (S256), no client registration. Send client_name with the request. The token is a long-lived API key the person can remove in Settings.","flows":{"authorizationCode":{"authorizationUrl":"https://getreceiptbook.com/app/connect","tokenUrl":"https://getreceiptbook.com/api/v1/connect/token","scopes":{"account:read":"See your account","account:write":"See and change your account","rent:read":"See your receipts","rent:write":"See and change your receipts"}}}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Money":{"type":"integer"}}},"paths":{"/auth/email/start":{"post":{"summary":"Send a 6-digit sign-in code by email","tags":["Sign-in"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Retry safely: the first answer is replayed for 24 hours"}],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/email/verify":{"post":{"summary":"Check a sign-in code and start a session","tags":["Sign-in"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Retry safely: the first answer is replayed for 24 hours"}],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"code":{"type":"string"}},"required":["email","code"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/signout":{"post":{"summary":"End the session","tags":["Sign-in"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Retry safely: the first answer is replayed for 24 hours"}],"security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me":{"get":{"summary":"The caller and whether they have a receipt book","tags":["Account"],"x-required-scope":"account:read","security":[{"apiKey":["account:read"]},{"connect":["account:read"]},{}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/connect/token":{"post":{"summary":"Connect with Receipt Book: swap a one-time code (with its PKCE verifier) for an API key","tags":["Connect"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Retry safely: the first answer is replayed for 24 hours"}],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grant_type":{"enum":["authorization_code"]},"code":{"type":"string"},"redirect_uri":{"type":"string"},"code_verifier":{"type":"string"}},"required":["grant_type","code","redirect_uri","code_verifier"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}