{"openapi":"3.0.0","info":{"version":"1.0.0","title":"Account Balances API","description":"The Account Balances API allows the consumer to pull financial account balances from Fortis Core.\n"},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/fortisbank/account-balance-api/1.0.0"}],"tags":[{"name":"APIs","description":"A set of APIs to query and pull financial accounts balances"}],"paths":{"/balances":{"get":{"summary":"Retrieve a financial account balances","description":"This API looks for a financial accounts balance given an account Id & account Type.\n     \n","operationId":"getBalances","parameters":[{"name":"x-correlation-id","in":"header","required":true,"description":"A UUID value compliant with RFC 4122 used to identify an API Request. The value is echoed back in the response header. See [Authentication](/api/authentication/#correlation-id) for more details.","schema":{"type":"string"}},{"name":"accountId","in":"query","required":true,"description":null,"schema":{"type":"string"}},{"name":"accountType","in":"query","required":true,"description":null,"schema":{"type":"string","enum":["D"]}},{"name":"balanceType","in":"query","required":false,"description":null,"schema":{"type":"string","default":"Ledger","enum":["Available","Ledger","Collected"]}}],"responses":{"200":{"description":"Successful balance retrieval response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/getBalancesResponse"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"409":{"description":"Conflict.\n  The API was unable to process the request due to business validation rules.\n","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"errorDetails":{"allOf":[{"$ref":"#/components/schemas/ErrorDetails"},{"type":"object","properties":{"code":{"example":409},"reason":{"example":"CONFLICT"},"details":{"example":"Unauthorized Financial Account","enum":["Unauthorized Financial Account"]}}}]}}}]}}}},"500":{"description":"API Internal Error.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"errorDetails":{"allOf":[{"$ref":"#/components/schemas/ErrorDetails"},{"type":"object","properties":{"code":{"example":500},"reason":{"example":"INTERNAL_SERVER_ERROR"},"details":{"example":"Recipe function call failed (id: 61178786, job_id: j-AT6HQhcH-YGmr8a): Statement ID is not valid at line: 19092"}}}]}}}]}}}}},"security":[{"oAuth2_ClientCredentials":[]}],"tags":["APIs"]}}},"components":{"securitySchemes":{"oAuth2_ClientCredentials":{"type":"oauth2","description":"OAuth 2 [Client Credentials Flow](https://docs.workato.com/api-mgmt/oauth2.html#how-to-setup-oauth-2-0)","flows":{"clientCredentials":{"tokenUrl":"https://apim.workato.com/oauth2/token","scopes":{}}}}},"responses":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"errorDetails":{"allOf":[{"$ref":"#/components/schemas/ErrorDetails"},{"type":"object","properties":{"code":{"example":400},"reason":{"example":"BAD_REQUEST"},"details":{"example":"Please verify input parameters."}}}]}}}]}}}},"401":{"description":"Unauthorized.\n\n  :::info 401 errors\n  There are two different error schemas for 401 errors, one when the API credentials sent are wrong or invalid and another one when the API credentials are valid but the operation is prohibited for the consumer.\n  :::\n  \n","content":{"application/json":{"schema":{"oneOf":[{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"errorDetails":{"allOf":[{"$ref":"#/components/schemas/ErrorDetails"},{"type":"object","properties":{"code":{"example":401},"reason":{"example":"UNAUTHORIZED"},"details":{"example":"Permission denied."}}}]}}}]},{"type":"object","properties":{"error":{"type":"string","example":"Access to this API has been disallowed"}}}]}}}},"500":{"description":"API Internal Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":{"xCorrelationId":{"name":"x-correlation-id","in":"header","required":true,"description":"A UUID value compliant with RFC 4122 used to identify an API Request. The value is echoed back in the response header. See [Authentication](/api/authentication/#correlation-id) for more details.","schema":{"type":"string","minLength":36,"maxLength":36}},"xTimestamp":{"name":"x-timestamp","in":"header","required":true,"description":"The timestamp used to support the message signature. Should contain only numbers.\n\n  :::warning  Rejected Timestamps\n  Requests with timestamp > 5min will be rejected\n  :::\n","schema":{"type":"string","example":"1746197323"}},"xSignature":{"name":"x-signature","in":"header","required":true,"description":"Payload signature used by the API Client to validate message authenticity. Signature is calculated via **HMAC SHA256** algorithm and is composed by: \n\n    -`HTTP_VERB + HTTP_URL + PAYLOAD + TIMESTAMP`.\n    \nThe key will be provided to API Consumer\n","schema":{"type":"string","minLength":64,"maxLength":64}}},"schemas":{"getBalancesResponse":{"type":"object","properties":{"balanceType":{"type":"string","example":"Available","enum":["Available","Ledger","Collected"]},"availableBalance":{"type":"number","example":0.0},"currentBalance":{"type":"number","description":"The current balance.","example":0.0},"collectedBalance":{"type":"number","description":"The collected balance.","example":0.0},"yesterdaysBalance":{"type":"number","description":"Yesterday's balance.","example":0.0},"holdAmount":{"type":"number","description":"The hold amount.","example":0.0},"overdraft":{"type":"object","properties":{"protectionAmount":{"type":"number","description":"The amount of overdraft protection (credit line) this account has.","example":0.0},"limit":{"type":"number","description":"The overdraft limit.","example":0.0}}},"totals":{"type":"object","properties":{"totalCreditAmount":{"type":"number","description":"The total credit amount of transactions on a given business day."},"totalDebitAmount":{"type":"number","description":"The total debit amount of transactions on a given business day."}}}}},"Error":{"required":["apiName","version","correlationId","timestamp","errorDetails"],"properties":{"apiName":{"type":"string","example":"Account Balance API"},"version":{"type":"string","example":"v1"},"correlationId":{"type":"string","example":"679751e0-36ba-49a1-b992-599c75beec66"},"timestamp":{"type":"string","example":"2025-06-05T10:12:43.642286-07:00"},"errorDetails":{"type":"object","properties":{"code":{"type":"string"},"reason":{"type":"string"},"details":{"type":"string"}}}}},"ErrorDetails":{"type":"object","properties":{"code":{"type":"string","description":"HTTP standard error code"},"reason":{"type":"string","description":"Integration error identification code"},"details":{"type":"string","description":"Error descriptive description"}}}}}}