{"openapi":"3.1.0","info":{"title":"POST /api/v1/fx/rates","version":"1.0.0","description":"Upsert FX rate"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/fx/rates":{"post":{"tags":["fx-rates"],"summary":"Upsert FX rate","description":"Create or update an FX rate for a (base, quote) pair on a date.","operationId":"upsert_fx_rate_api_v1_fx_rates_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FxRateUpsertRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FxRateResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"FxRateResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"base_currency":{"type":"string","title":"Base Currency"},"quote_currency":{"type":"string","title":"Quote Currency"},"rate":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Rate"},"as_of_date":{"type":"string","format":"date","title":"As Of Date"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","base_currency","quote_currency","rate","as_of_date","created_at","updated_at"],"title":"FxRateResponse","description":"An FX rate row."},"FxRateUpsertRequest":{"properties":{"base_currency":{"type":"string","maxLength":3,"minLength":3,"title":"Base Currency"},"quote_currency":{"type":"string","maxLength":3,"minLength":3,"title":"Quote Currency"},"rate":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Rate","description":"base = quote * rate."},"as_of_date":{"type":"string","format":"date","title":"As Of Date"},"source":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Source"}},"type":"object","required":["base_currency","quote_currency","rate","as_of_date"],"title":"FxRateUpsertRequest","description":"Create or update an FX rate for a (base, quote) pair on a date."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}