{"openapi":"3.1.0","info":{"title":"Demo Café pickup orders","version":"1.0.0","description":"Order ahead from Demo Café and collect at Demo Café counter.","x-guidance":"GET /api/catalog for the menu. POST /api/orders with items, the customer's email and rail 'x402'. Then POST the returned pay link with an x402 payment (USDC). The customer receives a QR by email and shows it at the counter. To fetch the pass again later, GET /api/orders/{id}/pass with the claim POST /api/orders returned (X-Pickup-Claim header), or sign in with the paying wallet.","contact":{"email":"hello@agentpickup.app"}},"paths":{"/api/catalog":{"get":{"security":[],"operationId":"getCatalog","summary":"Menu, merchant details and enabled payment methods","responses":{"200":{"description":"Catalog"}}}},"/api/orders":{"post":{"security":[],"operationId":"createOrder","summary":"Create a pickup order. Prices come from the catalog.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","properties":{"id":{"type":"string","enum":["flat-white","long-black","almond-croissant","banana-bread","babyccino"]},"qty":{"type":"integer","minimum":1,"maximum":20}},"required":["id","qty"]}},"email":{"type":"string","format":"email","description":"Where the pickup QR is sent"},"name":{"type":"string","maxLength":60},"rail":{"type":"string","enum":["x402","test"]}},"required":["items","rail"]}}}},"responses":{"201":{"description":"Order created, with the next step (redirect, x402 pay link, or done)"}}}},"/api/orders/{id}":{"get":{"security":[],"operationId":"getOrder","summary":"Order status. No pass, code or email.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Order status"}}}},"/api/orders/{id}/pay":{"post":{"operationId":"payOrder","summary":"Pay for an order over x402. The pickup QR is emailed once the payment settles.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.50","max":"2200.00"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Paid. Returns the order, the pass link and a signed receipt."},"402":{"description":"Payment Required"},"409":{"description":"The order is not awaiting payment"}}}},"/api/orders/{id}/pass":{"get":{"security":[{"siwx":[]},{"pickupClaim":[]}],"operationId":"getPass","summary":"Fetch the pickup pass again: with the claim the order was created with, or by signing in with the wallet that paid","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Pass link, pickup code and QR content"},"402":{"description":"Sign-in challenge"},"403":{"description":"Signed in, but not the payer"},"404":{"description":"No order matches that id and claim"},"409":{"description":"Not paid yet"}}}},"/api/x402/order":{"get":{"operationId":"orderAndPay","summary":"Order and pay in one call over x402. The response carries the pickup pass.","parameters":[{"name":"items","in":"query","required":false,"description":"id:qty pairs, comma-separated. With none, one of the first menu item.","schema":{"type":"string","example":"flat-white:1"}},{"name":"name","in":"query","required":false,"description":"Name for the order, shown to staff","schema":{"type":"string","maxLength":60}}],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.50","max":"2200.00"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Paid. Returns the order and the pickup pass link."},"400":{"description":"Unknown items or quantities"},"402":{"description":"Payment Required"}}},"post":{"operationId":"orderAndPayWithEmail","summary":"Order and pay in one call over x402, with the pickup QR emailed too.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","properties":{"id":{"type":"string","enum":["flat-white","long-black","almond-croissant","banana-bread","babyccino"]},"qty":{"type":"integer","minimum":1,"maximum":20}},"required":["id","qty"]}},"email":{"type":"string","format":"email","description":"Where the pickup QR is sent"},"name":{"type":"string","maxLength":60}}}}}},"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.50","max":"2200.00"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Paid. Returns the order and the pickup pass link."},"400":{"description":"Unknown items or quantities"},"402":{"description":"Payment Required"}}}}},"components":{"securitySchemes":{"siwx":{"type":"apiKey","in":"header","name":"SIGN-IN-WITH-X","description":"x402 Sign-In-With-X (CAIP-122) proof"},"pickupClaim":{"type":"apiKey","in":"header","name":"X-Pickup-Claim","description":"The claim POST /api/orders returned with the order"}}}}