/** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ export interface paths { '/v2/accounts/card': { /** * List card accounts * * @description * This endpoint lists all accounts of card type. */ get: operations['listCardAccounts'] } '/v2/accounts/card/primary/statements': { /** * List primary card account statements. * * @description * This endpoint lists all finalized statements for the primary card account. */ get: operations['listPrimaryCardStatements'] } '/v2/accounts/cash': { /** * List cash accounts * * @description * This endpoint lists all the existing cash accounts with their status. */ get: operations['listAccounts'] } '/v2/accounts/cash/primary': { /** * Get primary cash account * * @description * This endpoint returns the primary cash account with its status. There will always be only one primary account. */ get: operations['getPrimaryAccount'] } '/v2/accounts/cash/{id}': { /** * Get cash account by ID * * @description * This endpoint returns the cash account associated with the provided ID with its status. */ get: operations['getAccount'] } '/v2/accounts/cash/{id}/statements': { /** * List cash account statements. * * @description * This endpoint lists all finalized statements for the cash account by ID. */ get: operations['listCashStatements'] } '/v2/transactions/card/primary': { /** * List transactions for all card accounts. * * @description * This endpoint lists all settled transactions for all card accounts. * Regular users may only fetch their own "PURCHASE","REFUND" and "CHARGEBACK" settled transactions. */ get: operations['listPrimaryCardTransactions'] } '/v2/transactions/cash/{id}': { /** * List transactions for the selected cash account. * * @description * This endpoint lists all transactions for the cash account with the selected ID. */ get: operations['listCashTransactions'] } } export type webhooks = Record export interface components { schemas: { CardAccount: { /** @description ID of the card account */ id: string status?: components['schemas']['Status'] current_balance?: components['schemas']['Money'] available_balance?: components['schemas']['Money'] account_limit?: components['schemas']['Money'] current_statement_period: components['schemas']['StatementPeriod'] } CardTransaction: { id: string /** @description ID of the card used for the transaction. Null when type is REWARDS_CREDIT or COLLECTION. */ card_id?: string | null /** @description Description of the transaction */ description: string amount: components['schemas']['Money'] /** * Format: date * @description ISO 8601 date string */ initiated_at_date: string /** * Format: date * @description ISO 8601 date string */ posted_at_date: string type?: components['schemas']['CardTransactionType'] merchant?: components['schemas']['Merchant'] /** * @description * Set of key value pairs associated with this object. Please do not store any personally identifiable or sensitive information here. * Limitations: maximum of 50 keys, keys cannot exceed 40 characters, values cannot exceed 500 characters. */ card_metadata?: { [key: string]: string } | null /** @description The expense ID related to the card transaction. */ expense_id?: string | null } /** @enum {string} */ CardTransactionType: | 'PURCHASE' | 'REFUND' | 'CHARGEBACK' | 'REWARDS_CREDIT' | 'COLLECTION' | 'BNPL_FEE' CashAccount: { /** @description ID of the cash account */ id: string name: string status?: components['schemas']['Status'] current_balance: components['schemas']['Money'] available_balance: components['schemas']['Money'] account_number: string routing_number: string /** @description Whether or not this account is the primary account. There will always be only one primary account. */ primary: boolean } CashTransaction: { id: string /** @description Description of the transaction */ description: string amount?: components['schemas']['Money'] /** * Format: date * @description ISO 8601 date of when the payment is initiated */ initiated_at_date: string /** * Format: date * @description ISO 8601 date of when the payment is posted */ posted_at_date: string type?: components['schemas']['CashTransactionType'] /** @description Transfer ID to fetch additional metadata about the transaction using `https://developer.brex.com/openapi/payments_api/#operation/getTransfersById` */ transfer_id?: string | null } /** @enum {string} */ CashTransactionType: | 'PAYMENT' | 'DIVIDEND' | 'FEE' | 'ADJUSTMENT' | 'INTEREST' | 'CARD_COLLECTION' | 'REWARDS_REDEMPTION' | 'RECEIVABLES_OFFERS_ADVANCE' | 'FBO_TRANSFER' | 'RECEIVABLES_OFFERS_REPAYMENT' | 'RECEIVABLES_OFFERS_COLLECTION' | 'BREX_OPERATIONAL_TRANSFER' | 'INTRA_CUSTOMER_ACCOUNT_BOOK_TRANSFER' | 'BOOK_TRANSFER' | 'CRYPTO_BRIDGE' Merchant: { /** @description Merchant descriptor, it can be the merchant name. */ raw_descriptor: string /** @description A four-digit number listed in ISO 18245 for retail financial services, e.g. 4121 for Taxicabs and Rideshares. Please refer to https://en.wikipedia.org/wiki/Merchant_category_code for more details. */ mcc: string /** @description Merchant's country, in ISO 3166-1 alpha-3 format. */ country: string } /** * @description * Money fields can be signed or unsigned. Fields are signed (an unsigned value will be interpreted as positive). The amount of money will be represented in the smallest denomination * of the currency indicated. For example, USD 7.00 will be represented in cents with an amount of 700. */ Money: { /** * Format: int64 * @description The amount of money, in the smallest denomination of the currency indicated by currency. For example, when currency is USD, amount is in cents. */ amount?: number /** @description The type of currency, in ISO 4217 format. Default to USD if not specified */ currency?: string | null } Page_CardTransaction_: { next_cursor?: string | null items: components['schemas']['CardTransaction'][] } Page_CashAccount_: { next_cursor?: string | null items: components['schemas']['CashAccount'][] } Page_CashTransaction_: { next_cursor?: string | null items: components['schemas']['CashTransaction'][] } Page_Statement_: { next_cursor?: string | null items: components['schemas']['Statement'][] } Statement: { id: string start_balance?: components['schemas']['Money'] end_balance?: components['schemas']['Money'] period: components['schemas']['StatementPeriod'] } StatementPeriod: { /** * Format: date * @description Start date of the statement period */ start_date: string /** * Format: date * @description End date of the statement period */ end_date: string } /** @enum {string} */ Status: 'ACTIVE' } responses: never parameters: never requestBodies: never headers: never pathItems: never } export type $defs = Record export type external = Record export interface operations { /** * List card accounts * * @description * This endpoint lists all accounts of card type. */ listCardAccounts: { responses: { /** @description listCardAccounts 200 response */ 200: { content: { 'application/json': components['schemas']['CardAccount'][] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } } } /** * List primary card account statements. * * @description * This endpoint lists all finalized statements for the primary card account. */ listPrimaryCardStatements: { parameters: { query?: { cursor?: string | null limit?: number | null } } responses: { /** @description listPrimaryCardStatements 200 response */ 200: { content: { 'application/json': components['schemas']['Page_Statement_'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } } } /** * List cash accounts * * @description * This endpoint lists all the existing cash accounts with their status. */ listAccounts: { responses: { /** @description listAccounts 200 response */ 200: { content: { 'application/json': components['schemas']['Page_CashAccount_'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } } } /** * Get primary cash account * * @description * This endpoint returns the primary cash account with its status. There will always be only one primary account. */ getPrimaryAccount: { responses: { /** @description getPrimaryAccount 200 response */ 200: { content: { 'application/json': components['schemas']['CashAccount'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } } } /** * Get cash account by ID * * @description * This endpoint returns the cash account associated with the provided ID with its status. */ getAccount: { parameters: { path: { id: string } } responses: { /** @description getAccount 200 response */ 200: { content: { 'application/json': components['schemas']['CashAccount'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } } } /** * List cash account statements. * * @description * This endpoint lists all finalized statements for the cash account by ID. */ listCashStatements: { parameters: { query?: { cursor?: string | null limit?: number | null } path: { id: string } } responses: { /** @description listCashStatements 200 response */ 200: { content: { 'application/json': components['schemas']['Page_Statement_'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } } } /** * List transactions for all card accounts. * * @description * This endpoint lists all settled transactions for all card accounts. * Regular users may only fetch their own "PURCHASE","REFUND" and "CHARGEBACK" settled transactions. */ listPrimaryCardTransactions: { parameters: { query?: { cursor?: string | null limit?: number | null user_ids?: string[] | null /** * @description * Shows only transactions with a `posted_at_date` on or after this date-time. This parameter is the date-time notation as defined by [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6) * * @example 2022-12-12T23:59:59.999 */ posted_at_start?: string | null 'expand[]'?: string[] | null } } responses: { /** @description listPrimaryCardTransactions 200 response */ 200: { content: { 'application/json': components['schemas']['Page_CardTransaction_'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } } } /** * List transactions for the selected cash account. * * @description * This endpoint lists all transactions for the cash account with the selected ID. */ listCashTransactions: { parameters: { query?: { cursor?: string | null limit?: number | null /** * @description * Shows only transactions with a `posted_at_date` on or after this date-time. This parameter is the date-time notation as defined by [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6) * * @example 2022-12-12T23:59:59.999 */ posted_at_start?: string | null } path: { id: string } } responses: { /** @description listCashTransactions 200 response */ 200: { content: { 'application/json': components['schemas']['Page_CashTransaction_'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } } } } export interface oasTypes { components: components external: external operations: operations paths: paths webhooks: webhooks } export default oasTypes