openapi: 3.0.1 info: title: Modern Treasury AccountCapability BalanceReport API version: v1 contact: name: Modern Treasury Engineering Team url: https://moderntreasury.com description: The Modern Treasury REST API. Please see https://docs.moderntreasury.com for more details. servers: - url: http://localhost:3000 - url: https://app.moderntreasury.com tags: - name: BalanceReport paths: /api/internal_accounts/{internal_account_id}/balance_reports: get: summary: list balance_reports tags: - BalanceReport description: Get all balance reports for a given internal account. operationId: listBalanceReports security: - basic_auth: [] parameters: - name: internal_account_id in: path schema: type: string required: true - name: as_of_date in: query schema: type: string format: date required: false description: The date of the balance report in local time. - name: balance_report_type in: query schema: type: string enum: - intraday - other - previous_day - real_time required: false description: The specific type of balance report. One of `intraday`, `previous_day`, `real_time`, or `other`. - name: after_cursor in: query schema: type: string nullable: true required: false - name: per_page in: query required: false schema: type: integer responses: '200': description: successful headers: X-After-Cursor: schema: type: string nullable: true required: false description: The cursor for the next page. Including this in a call as `after_cursor` will return the next page. X-Per-Page: schema: type: integer nullable: true description: The current `per_page`. content: application/json: schema: type: array items: $ref: '#/components/schemas/balance_report' '403': description: forbidden content: application/json: schema: $ref: '#/components/schemas/error_message' post: summary: create balance reports tags: - BalanceReport operationId: createBalanceReport security: - basic_auth: [] parameters: - name: internal_account_id in: path schema: type: string required: true - name: Idempotency-Key in: header required: false description: This key should be something unique, preferably something like an UUID. schema: type: string responses: '201': description: successful content: application/json: schema: $ref: '#/components/schemas/balance_report' '422': description: unsuccessful content: application/json: schema: $ref: '#/components/schemas/error_message' requestBody: content: application/json: schema: $ref: '#/components/schemas/balance_report_create_request' /api/internal_accounts/{internal_account_id}/balance_reports/{id}: get: summary: get balance_report tags: - BalanceReport description: Get a single balance report for a given internal account. operationId: getBalanceReport security: - basic_auth: [] parameters: - name: internal_account_id in: path schema: type: string required: true - name: id in: path required: true description: Either the unique identifier of the balance report or 'latest' for the latest balance report. schema: anyOf: - type: string - type: string enum: - latest responses: '200': description: successful content: application/json: schema: $ref: '#/components/schemas/balance_report' '404': description: not found content: application/json: schema: $ref: '#/components/schemas/error_message' delete: summary: delete balance_report tags: - BalanceReport description: Deletes a given balance report. operationId: deleteBalanceReport security: - basic_auth: [] parameters: - name: internal_account_id in: path schema: type: string required: true - name: id in: path schema: type: string required: true description: Either the unique identifier of the balance report or 'latest' for the latest balance report. responses: '204': description: no content '403': description: forbidden content: application/json: schema: $ref: '#/components/schemas/error_message' '404': description: not found content: application/json: schema: $ref: '#/components/schemas/error_message' '422': description: not allowed content: application/json: schema: $ref: '#/components/schemas/error_message' components: schemas: balance: type: object properties: id: type: string format: uuid object: type: string live_mode: type: boolean description: This field will be true if this object exists in the live environment or false if it exists in the test environment. created_at: type: string format: date-time updated_at: type: string format: date-time amount: type: integer description: The balance amount. currency: $ref: '#/components/schemas/currency' description: The currency of the balance. balance_type: type: string enum: - closing_available - closing_ledger - current_available - current_ledger - opening_available - opening_available_next_business_day - opening_ledger - other - previously_closed_book description: The specific type of balance reported. One of `opening_ledger`, `closing_ledger`, `current_ledger`, `opening_available`, `opening_available_next_business_day`, `closing_available`, `current_available`, 'previously_closed_book', or `other`. vendor_code: type: string description: The code used by the bank when reporting this specific balance. vendor_code_type: type: string nullable: true description: The type of `vendor_code` being reported. Can be one of `bai2`, `bankprov`, `bnk_dev`, `cleartouch`, `currencycloud`, `cross_river`, `dc_bank`, `dwolla`, `evolve`, `goldman_sachs`, `iso20022`, `jpmc`, `mx`, `signet`, `silvergate`, `swift`, or `us_bank`. as_of_date: type: string nullable: true format: date description: The date on which the balance became true for the account. as_of_time: type: string nullable: true format: time description: The time on which the balance became true for the account. value_date: type: string nullable: true format: date description: The date on which the balance becomes available. additionalProperties: false minProperties: 13 required: - id - object - live_mode - created_at - updated_at - amount - currency - balance_type - vendor_code - vendor_code_type - as_of_date - as_of_time - value_date balance_report: type: object properties: id: type: string format: uuid object: type: string live_mode: type: boolean description: This field will be true if this object exists in the live environment or false if it exists in the test environment. created_at: type: string format: date-time updated_at: type: string format: date-time balance_report_type: type: string enum: - intraday - other - previous_day - real_time description: The specific type of balance report. One of `intraday`, `previous_day`, `real_time`, or `other`. as_of_date: type: string format: date description: The date of the balance report in local time. as_of_time: type: string nullable: true format: time description: The time (24-hour clock) of the balance report in local time. balances: type: array description: An array of `Balance` objects. items: $ref: '#/components/schemas/balance' internal_account_id: type: string format: uuid description: The ID of one of your organization's Internal Accounts. additionalProperties: false minProperties: 10 required: - id - object - live_mode - created_at - updated_at - balance_report_type - as_of_date - as_of_time - balances - internal_account_id balance_report_create_request: type: object properties: as_of_date: type: string format: date description: The date of the balance report in local time. as_of_time: type: string description: The time (24-hour clock) of the balance report in local time. balance_report_type: type: string enum: - intraday - other - previous_day - real_time description: The specific type of balance report. One of `intraday`, `previous_day`, `real_time`, or `other`. balances: type: array items: $ref: '#/components/schemas/balance_create_request' description: An array of `Balance` objects. required: - as_of_date - as_of_time - balance_report_type - balances currency: type: string enum: - AED - AFN - ALL - AMD - ANG - AOA - ARS - AUD - AWG - AZN - BAM - BBD - BCH - BDT - BGN - BHD - BIF - BMD - BND - BOB - BRL - BSD - BTC - BTN - BWP - BYN - BYR - BZD - CAD - CDF - CHF - CLF - CLP - CNH - CNY - COP - CRC - CUC - CUP - CVE - CZK - DJF - DKK - DOP - DZD - EEK - EGP - ERN - ETB - ETH - EUR - EURC - FJD - FKP - GBP - GBX - GEL - GGP - GHS - GIP - GMD - GNF - GTQ - GYD - HKD - HNL - HRK - HTG - HUF - IDR - ILS - IMP - INR - IQD - IRR - ISK - JEP - JMD - JOD - JPY - KES - KGS - KHR - KMF - KPW - KRW - KWD - KYD - KZT - LAK - LBP - LKR - LRD - LSL - LTL - LVL - LYD - MAD - MDL - MGA - MKD - MMK - MNT - MOP - MRO - MRU - MTL - MUR - MVR - MWK - MXN - MYR - MZN - NAD - NGN - NIO - NOK - NPR - NZD - OMR - OP - PAB - PEN - PGK - PHP - PKR - PLN - PYG - PYUSD - QAR - RON - RSD - RUB - RWF - SAR - SBD - SCR - SDG - SEK - SGD - SHP - SKK - SLE - SLL - SOS - SRD - SSP - STD - STN - SVC - SYP - SZL - THB - TJS - TMM - TMT - TND - TOP - TRY - TTD - TWD - TZS - UAH - UGX - USD - USDB - USDC - USDG - USDP - USDT - UYU - UZS - VEF - VES - VND - VUV - WST - XAF - XAG - XAU - XBA - XBB - XBC - XBD - XCD - XCG - XDR - XFU - XOF - XPD - XPF - XPT - XTS - YER - ZAR - ZMK - ZMW - ZWD - ZWG - ZWL - ZWN - ZWR description: Three-letter ISO currency code. error_message: type: object properties: errors: type: object properties: code: type: string enum: - parameter_invalid - parameter_missing - resource_not_found - not_found - forbidden - invalid_ip - invalid_key - header_invalid - expired_key - conflict - too_many_requests message: type: string parameter: type: string required: - errors balance_create_request: type: object properties: amount: type: integer description: The balance amount. balance_type: type: string enum: - closing_available - closing_ledger - current_available - current_ledger - opening_available - opening_available_next_business_day - opening_ledger - other - previously_closed_book description: The specific type of balance reported. One of `opening_ledger`, `closing_ledger`, `current_ledger`, `opening_available`, `opening_available_next_business_day`, `closing_available`, `current_available`, 'previously_closed_book', or `other`. vendor_code: type: string description: The code used by the bank when reporting this specific balance. vendor_code_type: type: string nullable: true description: The type of `vendor_code` being reported. Can be one of `bai2`, `bankprov`, `bnk_dev`, `cleartouch`, `currencycloud`, `cross_river`, `dc_bank`, `dwolla`, `evolve`, `goldman_sachs`, `iso20022`, `jpmc`, `mx`, `signet`, `silvergate`, `swift`, or `us_bank`. additionalProperties: false minProperties: 4 required: - amount - balance_type - vendor_code - vendor_code_type securitySchemes: basic_auth: type: http scheme: basic