{"openapi":"3.1.0","info":{"title":"agentpromocode API","version":"0.1.0","description":"Resolve promotional codes for agent-driven checkout. Free for agents; mandatory feedback contract."},"servers":[{"url":"https://api.agentpromocode.com"}],"paths":{"/health":{"get":{"summary":"Health","responses":{"200":{"description":"OK"}}}},"/v1/me":{"get":{"summary":"Consumer contract health","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"}}}},"/v1/resolve":{"post":{"summary":"Resolve best offers for a merchant domain + basket","security":[{"bearerAuth":[]},{}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string"},"basket":{"type":"object"},"agent_id":{"type":"string"}}}}}},"responses":{"200":{"description":"Offers"},"403":{"description":"Contract breached"}}}},"/v1/feedback":{"post":{"summary":"Report checkout outcome (mandatory data contract)","security":[{"bearerAuth":[]},{}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["attribution_token","outcome"],"properties":{"attribution_token":{"type":"string"},"token":{"type":"string"},"code":{"type":"string"},"outcome":{"type":"string","enum":["worked","expired","ineligible","error"]},"basket_value":{"type":"number"},"geo":{"type":"string"}}}}}},"responses":{"200":{"description":"OK"}}}},"/v1/postback":{"post":{"summary":"Affiliate postback stub (V1 logs only; unauthenticated — add signing before prod)","responses":{"200":{"description":"OK"}}}},"/developer-keys":{"post":{"summary":"Create a free developer API key instantly","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"project_name":{"type":"string"},"email":{"type":"string","format":"email"}}}}}},"responses":{"201":{"description":"Created"},"429":{"description":"Rate limited"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}}}