{"openapi":"3.1.0","info":{"title":"GET /api/v1/fx/exposure","version":"1.0.0","description":"FX exposure preview"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/fx/exposure":{"get":{"tags":["fx-rates"],"summary":"FX exposure preview","description":"Per-currency open AR/AP exposure and unrealized gain/loss.","operationId":"fx_exposure_api_v1_fx_exposure_get","parameters":[{"name":"as_of_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Revaluation date.","title":"As Of Date"},"description":"Revaluation date."},{"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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FxRevaluationResponse"}}}},"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":{"FxCurrencyExposure":{"properties":{"currency":{"type":"string","title":"Currency"},"receivable_foreign":{"type":"integer","title":"Receivable Foreign","description":"Open AR balance in the foreign currency (cents).","default":0},"payable_foreign":{"type":"integer","title":"Payable Foreign","description":"Open AP balance in the foreign currency (cents).","default":0},"booked_rate":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Booked Rate"},"current_rate":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Current Rate"},"receivable_gain_loss":{"type":"integer","title":"Receivable Gain Loss","description":"AR revaluation gain(+)/loss(-) in base cents.","default":0},"payable_gain_loss":{"type":"integer","title":"Payable Gain Loss","description":"AP revaluation gain(+)/loss(-) in base cents.","default":0},"net_gain_loss":{"type":"integer","title":"Net Gain Loss","description":"Net gain(+)/loss(-) in base cents.","default":0}},"type":"object","required":["currency"],"title":"FxCurrencyExposure","description":"Per-currency open AR/AP exposure and computed gain/loss (cents)."},"FxRevaluationResponse":{"properties":{"as_of_date":{"type":"string","format":"date","title":"As Of Date"},"base_currency":{"type":"string","title":"Base Currency"},"exposures":{"items":{"$ref":"#/components/schemas/FxCurrencyExposure"},"type":"array","title":"Exposures"},"total_gain_loss":{"type":"integer","title":"Total Gain Loss","description":"Net unrealized FX gain(+)/loss(-) in base cents.","default":0},"journal_entry_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Journal Entry Id","description":"Posted adjusting JE id (null for a preview)."},"posted":{"type":"boolean","title":"Posted","default":false}},"type":"object","required":["as_of_date","base_currency","exposures"],"title":"FxRevaluationResponse","description":"Result/preview of an FX revaluation as of 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":[]}]}