/** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ export interface paths { '/v1/budget_programs': { /** * List Budget Programs * * @description * Lists Budget Programs belonging to this account */ get: operations['listBudgetPrograms'] /** * Create Budget Program * * @description * Creates a Budget Program. * If your account does not have access to budget program features, a 403 response status will be returned. * If this is the case and you want to gain access to this endpoint, please contact Brex support. */ post: operations['createBudgetProgram'] } '/v1/budget_programs/{id}': { /** * Get Budget Program * * @description * Retrieves a Budget Program by ID */ get: operations['getBudgetProgramById'] /** * Update Budget Program * * @description * Updates a Budget Program. * This endpoint requires budget management. If your account does not have access to budget management features, a 403 response status will be returned. * If this is the case and you want to gain access to this endpoint, please contact Brex support. */ put: operations['updateBudgetProgram'] /** * Delete Budget Program * * @description * Delete a Budget Program by ID. * This endpoint requires budget management. If your account does not have access to budget management features, a 403 response status will be returned. * If this is the case and you want to gain access to this endpoint, please contact Brex support. */ delete: operations['deleteBudgetProgram'] } '/v1/budgets': { /** * List Budgets * * @description * Lists Budgets belonging to this account */ get: operations['listBudgets'] /** * Create Budget * * @description * Creates a Budget. * This endpoint requires budget management. If your account does not have access to budget management features, a 403 response status will be returned. * If this is the case and you want to gain access to this endpoint, please contact Brex support. */ post: operations['createBudget'] } '/v1/budgets/{id}': { /** * Get Budget * * @description * Retrieves a Budget by ID */ get: operations['getBudgetById'] /** * Update Budget * * @description * Updates a Budget. * This endpoint requires budget management. If your account does not have access to budget management features, a 403 response status will be returned. * If this is the case and you want to gain access to this endpoint, please contact Brex support. */ put: operations['updateBudget'] } '/v1/budgets/{id}/archive': { /** * Archive a budget * * @description * Archives a budget, making it unusable for future expenses and removing it from the UI */ post: operations['archiveBudget'] } } export type webhooks = Record export interface components { schemas: { Budget: { /** * @description * Unique ID for the Budget. */ budget_id?: string /** * @description * The Brex account this Budget belongs to. */ account_id?: string /** * @description * The ID of the user who originally created this budget. */ creator_user_id?: string | null /** * @description * Name for the Budget. */ name?: string /** * @description * Description of what the Budget is used for. */ description?: string | null /** * @description * ID of parent Budget. */ parent_budget_id?: string | null /** * @description * User IDs of the owners of the Budget. */ owner_user_ids?: string[] /** * @description * User IDs of the members of the Budget. */ member_user_ids?: string[] period_type: components['schemas']['PeriodType'] /** * Format: date * @description * The UTC date when the Budget should start counting. */ start_date?: string | null /** * Format: date * @description * The UTC date when the Budget should stop counting. */ end_date?: string | null limit?: components['schemas']['Money'] budget_status: components['schemas']['BudgetStatus'] limit_type?: components['schemas']['LimitType'] spend_type: components['schemas']['SpendType'] current_period_balance?: components['schemas']['BudgetPeriodBalance'] } /** * @description * Blueprint for provisioning Budgets for a Budget Program. */ BudgetBlueprint: { id: string /** * @description * Name for the Budget. */ name?: string /** * @description * Description of what the Budget is used for. */ description?: string | null /** * @description * ID of parent Budget. */ parent_budget_id?: string /** * @description * User IDs of the owners of the Budget. */ owner_user_ids?: string[] period_type: components['schemas']['PeriodType'] /** * Format: date * @description * The UTC date when the Budget should start counting. */ start_date?: string | null /** * Format: date * @description * The UTC date when the Budget should stop counting. */ end_date?: string | null limit?: components['schemas']['Money'] limit_type: components['schemas']['LimitType'] spend_type: components['schemas']['SpendType'] } /** * @description * Current Budget period balance. */ BudgetPeriodBalance: { /** Format: date */ start_date?: string | null /** Format: date */ end_date?: string | null balance?: components['schemas']['Money'] } /** * @description * Budget Program used to create budgets for eligible users. */ BudgetProgram: { id: string name: string description?: string | null budget_blueprints: components['schemas']['BudgetBlueprint'][] /** * @description * IDs for existing budgets associated with this Budget Program. */ existing_budget_ids?: string[] | null employee_filter?: components['schemas']['EmployeeFilter'] budget_program_status: components['schemas']['BudgetProgramStatus'] creator_user_id?: string | null /** Format: date */ created_at: string /** Format: date */ updated_at: string } /** @enum {string} */ BudgetProgramStatus: | 'BUDGET_PROGRAM_STATUS_ACTIVE' | 'BUDGET_PROGRAM_STATUS_INACTIVE' | 'BUDGET_PROGRAM_STATUS_DELETED' /** * @description * Status of the Budget e.g. APPROVED. * * @enum {string} */ BudgetStatus: 'APPROVED' | 'EXPIRED' | 'TERMINATED' | 'DELETED' /** * @description * Determines if budget members are allowed to view the budget limit. * * @enum {string} */ BudgetLimitVisibilityType: 'SHARED' | 'PRIVATE' /** * @description * Blueprint for provisioning Budgets for a Budget Program. */ CreateBudgetBlueprintRequest: { /** * @description * Name for the Budget. */ name?: string /** * @description * Description of what the Budget is used for. */ description?: string /** * @description * ID of parent Budget. */ parent_budget_id?: string /** * @description * User IDs of the owners of the Budget. */ owner_user_ids?: string[] | null period_type: components['schemas']['PeriodType'] /** * Format: date * @description * The UTC date when the Budget should start counting. */ start_date?: string | null /** * Format: date * @description * The UTC date when the Budget should stop counting. */ end_date?: string | null limit: components['schemas']['Money'] limit_type: components['schemas']['LimitType'] spend_type: components['schemas']['SpendType'] limit_visibility: components['schemas']['BudgetLimitVisibilityType'] } /** * @description * Budget Program used to create budgets for eligible users. */ CreateBudgetProgramRequest: { /** * @description * IDs for existing budgets associated with this Budget Program. */ existing_budget_ids?: string[] | null budget_blueprints: components['schemas']['CreateBudgetBlueprintRequest'][] employee_filter?: components['schemas']['EmployeeFilter'] name: string description?: string | null } CreateBudgetRequest: { /** * @description * Name for the Budget. */ name?: string /** * @description * Description of what the Budget is used for. */ description?: string /** * @description * ID of parent Budget. */ parent_budget_id: string /** * @description * User IDs of the owners of the Budget. */ owner_user_ids?: string[] | null /** * @description * User IDs of the members of the Budget. */ member_user_ids?: string[] | null period_type: components['schemas']['PeriodType'] limit: components['schemas']['Money'] limit_type: components['schemas']['LimitType'] spend_type: components['schemas']['SpendType'] /** * Format: date * @description * The UTC date when the Budget should start counting. */ start_date?: string | null /** * Format: date * @description * The UTC date when the Budget should stop counting. */ end_date?: string | null limit_visibility: components['schemas']['BudgetLimitVisibilityType'] } /** * @description * A filter used to determine if a user adheres to a Budget Program. */ EmployeeFilter: { employment_status?: components['schemas']['EmploymentStatus'] employment_type?: components['schemas']['EmploymentType'] } /** * @description * A filter used to determine if a user adheres to a Budget Program. * * @enum {string} */ EmploymentStatus: | 'EMPLOYMENT_STATUS_ACTIVE' | 'EMPLOYMENT_STATUS_INACTIVE' | 'EMPLOYMENT_STATUS_PENDING' /** * @description * What kind of employment the employee has. * * @enum {string} */ EmploymentType: | 'EMPLOYMENT_TYPE_FULL_TIME' | 'EMPLOYMENT_TYPE_PART_TIME' | 'EMPLOYMENT_TYPE_CONTRACTOR' | 'EMPLOYMENT_TYPE_INTERN' | 'EMPLOYMENT_TYPE_FREELANCE' /** * @description * Whether the Budget limit blocks spend. * * @enum {string} */ LimitType: 'HARD' | 'SOFT' /** * @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_BudgetProgram_: { next_cursor?: string | null items: components['schemas']['BudgetProgram'][] } Page_Budget_: { next_cursor?: string | null items: components['schemas']['Budget'][] } /** * @description * Period type of the Budget e.g. MONTHLY. * * @enum {string} */ PeriodType: 'WEEKLY' | 'MONTHLY' | 'QUARTERLY' | 'YEARLY' | 'ONE_TIME' /** * @description * Whether this Budget only can be spent from by cards provisioned by this Budget. * * @enum {string} */ SpendType: | 'BUDGET_PROVISIONED_CARDS_ONLY' | 'NON_BUDGET_PROVISIONED_CARDS_ALLOWED' /** * @description * Blueprint for provisioning Budgets for a Budget Program. */ UpdateBudgetBlueprintRequest: { /** * @description * ID of budget blueprint to update, omit if adding new budget blueprint to budget program. */ id?: string | null /** * @description * Name for the Budget. */ name?: string | null /** * @description * Description of what the Budget is used for. */ description?: string | null /** * @description * ID of parent Budget. */ parent_budget_id?: string | null /** * @description * User IDs of the owners of the Budget. */ owner_user_ids?: string[] | null period_type?: components['schemas']['PeriodType'] /** * Format: date * @description * The UTC date when the Budget should start counting. */ start_date?: string | null /** * Format: date * @description * The UTC date when the Budget should stop counting. */ end_date?: string | null limit?: components['schemas']['Money'] limit_type?: components['schemas']['LimitType'] spend_type?: components['schemas']['SpendType'] } /** * @description * Budget Program used to create budgets for eligible users. */ UpdateBudgetProgramRequest: { /** * @description * IDs for existing budgets associated with this Budget Program. */ existing_budget_ids?: string[] | null /** * @description * The Blueprints to update the budget program with. Blueprints without an ID are treated as new blueprints to be created. * Blueprints that exist currently on the Budget Program, but are missing from the input, will be deleted. */ budget_blueprints?: | components['schemas']['UpdateBudgetBlueprintRequest'][] | null employee_filter?: components['schemas']['EmployeeFilter'] name?: string | null description?: string | null } UpdateBudgetRequest: { /** * @description * Name for the Budget. */ name?: string | null /** * @description * Description of what the Budget is used for. */ description?: string | null /** * @description * User IDs of the owners of the Budget. */ owner_user_ids?: string[] | null /** * @description * User IDs of the members of the Budget. */ member_user_ids?: string[] | null limit?: components['schemas']['Money'] limit_type?: components['schemas']['LimitType'] spend_type?: components['schemas']['SpendType'] /** * Format: date * @description * The UTC date when the Budget should start counting. */ start_date?: string | null /** * Format: date * @description * The UTC date when the Budget should stop counting. */ end_date?: string | null limit_visibility?: components['schemas']['BudgetLimitVisibilityType'] } } responses: never parameters: never requestBodies: never headers: never pathItems: never } export type $defs = Record export type external = Record export interface operations { /** * List Budget Programs * * @description * Lists Budget Programs belonging to this account */ listBudgetPrograms: { parameters: { query?: { cursor?: string | null limit?: number | null } } responses: { /** @description listBudgetPrograms 200 response */ 200: { content: { 'application/json': components['schemas']['Page_BudgetProgram_'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } } } /** * Create Budget Program * * @description * Creates a Budget Program. * If your account does not have access to budget program features, a 403 response status will be returned. * If this is the case and you want to gain access to this endpoint, please contact Brex support. */ createBudgetProgram: { parameters: { header: { 'Idempotency-Key': string } } requestBody: { content: { 'application/json': components['schemas']['CreateBudgetProgramRequest'] } } responses: { /** @description createBudgetProgram 200 response */ 200: { content: { 'application/json': components['schemas']['BudgetProgram'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } } } /** * Get Budget Program * * @description * Retrieves a Budget Program by ID */ getBudgetProgramById: { parameters: { path: { id: string } } responses: { /** @description getBudgetProgramById 200 response */ 200: { content: { 'application/json': components['schemas']['BudgetProgram'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } /** @description Not Found */ 404: { content: never } } } /** * Update Budget Program * * @description * Updates a Budget Program. * This endpoint requires budget management. If your account does not have access to budget management features, a 403 response status will be returned. * If this is the case and you want to gain access to this endpoint, please contact Brex support. */ updateBudgetProgram: { parameters: { header: { 'Idempotency-Key': string } path: { id: string } } requestBody: { content: { 'application/json': components['schemas']['UpdateBudgetProgramRequest'] } } responses: { /** @description updateBudgetProgram 200 response */ 200: { content: { 'application/json': components['schemas']['BudgetProgram'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } /** @description Not Found */ 404: { content: never } } } /** * Delete Budget Program * * @description * Delete a Budget Program by ID. * This endpoint requires budget management. If your account does not have access to budget management features, a 403 response status will be returned. * If this is the case and you want to gain access to this endpoint, please contact Brex support. */ deleteBudgetProgram: { parameters: { path: { id: string } } responses: { /** @description deleteBudgetProgram 200 response */ 200: { content: { 'application/json': components['schemas']['BudgetProgram'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } /** @description Not Found */ 404: { content: never } } } /** * List Budgets * * @description * Lists Budgets belonging to this account */ listBudgets: { parameters: { query?: { cursor?: string | null limit?: number | null } } responses: { /** @description listBudgets 200 response */ 200: { content: { 'application/json': components['schemas']['Page_Budget_'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } } } /** * Create Budget * * @description * Creates a Budget. * This endpoint requires budget management. If your account does not have access to budget management features, a 403 response status will be returned. * If this is the case and you want to gain access to this endpoint, please contact Brex support. */ createBudget: { parameters: { header: { 'Idempotency-Key': string } } requestBody: { content: { 'application/json': components['schemas']['CreateBudgetRequest'] } } responses: { /** @description createBudget 200 response */ 200: { content: { 'application/json': components['schemas']['Budget'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } } } /** * Get Budget * * @description * Retrieves a Budget by ID */ getBudgetById: { parameters: { path: { id: string } } responses: { /** @description getBudgetById 200 response */ 200: { content: { 'application/json': components['schemas']['Budget'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } /** @description Not Found */ 404: { content: never } } } /** * Update Budget * * @description * Updates a Budget. * This endpoint requires budget management. If your account does not have access to budget management features, a 403 response status will be returned. * If this is the case and you want to gain access to this endpoint, please contact Brex support. */ updateBudget: { parameters: { header: { 'Idempotency-Key': string } path: { id: string } } requestBody: { content: { 'application/json': components['schemas']['UpdateBudgetRequest'] } } responses: { /** @description updateBudget 200 response */ 200: { content: { 'application/json': components['schemas']['Budget'] } } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } /** @description Not Found */ 404: { content: never } } } /** * Archive a budget * * @description * Archives a budget, making it unusable for future expenses and removing it from the UI */ archiveBudget: { parameters: { path: { id: string } } responses: { /** @description archiveBudget 200 response */ 200: { content: never } /** @description Bad request */ 400: { content: never } /** @description Unauthorized */ 401: { content: never } /** @description Forbidden */ 403: { content: never } /** @description Not Found */ 404: { content: never } } } } export interface oasTypes { components: components external: external operations: operations paths: paths webhooks: webhooks } export default oasTypes