{"openapi":"3.1.0","info":{"title":"ASWAQOS Merchant API","version":"1.0.0","description":"Merchant-scoped catalog and order operations. Prices use the store currency. Order exports omit customer contact details."},"servers":[{"url":"https://aswaqos.com"}],"security":[{"merchantKey":[]}],"components":{"securitySchemes":{"merchantKey":{"type":"http","scheme":"bearer","bearerFormat":"aswaq_api_<opaque key>"}},"schemas":{"Product":{"type":"object","required":["sku","name","price","stock"],"properties":{"sku":{"type":"string","maxLength":50},"name":{"type":"string","maxLength":120},"arabic_name":{"type":"string","maxLength":120},"unit":{"type":"string","maxLength":80},"price":{"oneOf":[{"type":"number","exclusiveMinimum":0,"maximum":100000},{"type":"string","pattern":"^\\d+(\\.\\d{1,3})?$"}]},"stock":{"type":"integer","minimum":0,"maximum":1000000},"active":{"type":"integer","enum":[0,1]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}}}}},"paths":{"/api/v1/health":{"get":{"security":[],"responses":{"200":{"description":"Service and database available"}}}},"/api/v1/products":{"get":{"summary":"Read catalog · catalog:read","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}},{"in":"query","name":"after","schema":{"type":"string"},"description":"next cursor from the preceding response"}],"responses":{"200":{"description":"Products, currency, and next cursor"},"401":{"description":"Missing or revoked API key"},"403":{"description":"Key lacks this scope"},"429":{"description":"120 requests per minute exceeded"}}},"post":{"summary":"Import products · catalog:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["products"],"properties":{"products":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/Product"}},"replace_stock":{"type":"boolean","default":false,"description":"Existing stock is preserved by default. Replacement is blocked while orders are open."}}}}}},"responses":{"200":{"description":"Import committed atomically"},"400":{"description":"Validation failed; no import confirmed"},"401":{"description":"Missing or revoked API key"},"403":{"description":"Key lacks this scope"},"409":{"description":"Open orders block stock replacement"},"429":{"description":"120 requests per minute exceeded"}}}},"/api/v1/orders":{"get":{"summary":"Read orders · orders:read","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}},{"in":"query","name":"after","schema":{"type":"string"},"description":"next cursor from the preceding response"}],"responses":{"200":{"description":"Order totals, statuses, payment state, and line items; next cursor"},"401":{"description":"Missing or revoked API key"},"403":{"description":"Key lacks this scope"},"429":{"description":"120 requests per minute exceeded"}}}}}}