{"openapi":"3.1.0","info":{"title":"AgiPay Agent Checkout","version":"1.0.0","description":"Order-based Base USDC checkout and private digital delivery. Check live availability before attempting payment."},"servers":[{"url":"https://agipay402.com"}],"x-payment-ready":false,"components":{"securitySchemes":{"orderToken":{"type":"http","scheme":"bearer","description":"Secret per-order token returned when creating a quote."}}},"paths":{"/api/health":{"get":{"operationId":"getAvailability","responses":{"200":{"description":"paymentReady and procurementReady must both be true"}}}},"/api/catalog":{"get":{"operationId":"listProducts","responses":{"200":{"description":"Live CNY catalog and payment availability"},"502":{"description":"Live catalog unavailable"}}}},"/api/products/{productId}/checkout-options":{"get":{"operationId":"listCheckoutSkus","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Available automatically fulfilled SKUs with current CNY prices"},"409":{"description":"Product unavailable or requires manual fulfillment"},"503":{"description":"Checkout disabled or unavailable"}}}},"/api/orders":{"post":{"operationId":"createQuote","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productId","skuId"],"properties":{"productId":{"type":"integer","minimum":1},"skuId":{"type":"integer","minimum":1}}}}}},"responses":{"201":{"description":"Order quote with id, secret token, exact USDC amount and five-minute expiry; save the token"},"409":{"description":"Stock unavailable"},"503":{"description":"Checkout disabled or unavailable"}}}},"/api/orders/{id}/pay":{"post":{"operationId":"payOrder","security":[{"orderToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"PAYMENT-SIGNATURE","in":"header","schema":{"type":"string"},"description":"Base64 x402 v2 payload; use the order-bound nonce supplied by the 402 response."}],"responses":{"200":{"description":"Existing order status; never submit another charge"},"202":{"description":"Payment submitted, awaiting chain confirmation and fulfillment"},"402":{"description":"Payment requirements, or payment verification failed","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64 x402 v2 payment challenge when a challenge is issued"}}},"404":{"description":"Order or bearer token invalid"},"410":{"description":"Quote expired"},"503":{"description":"Checkout unavailable"}}}},"/api/orders/{id}":{"get":{"operationId":"getOrderDelivery","security":[{"orderToken":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Order state and private delivery only when delivered; poll at most once every 15 seconds"},"404":{"description":"Order or bearer token invalid"}}}}}}