/** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ export interface paths { '/v2/cards': { /** * List cards * * @description * Lists all cards by a `user_id`. * Only cards with `limit_type = CARD` have `spend_controls` */ get: operations['listCardsByUserId'] /** * Create card * * @description * Creates a new card. * The `spend_controls` field is required when `limit_type` = `CARD`. * The `mailing_address` field is required for physical cards and is the shipping address used to send the card; it is not the same as the billing and mailing address used for online purchases. * The first 2 lines of this address must be under 60 characters long. Each user can only have up to 10 active physical cards. * For Empower accounts, 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['createCard'] } '/v2/cards/{id}': { /** * Get card * * @description * Retrieves a card by ID. Only cards with `limit_type = CARD` have `spend_controls` */ get: operations['getCardById'] /** * Update card * * @description * Update an existing vendor card */ put: operations['updateCard'] } '/v2/cards/{id}/lock': { /** * Lock card * * @description * Locks an existing, unlocked card. And the card owner will receive a notification about it. */ post: operations['lockCard'] } '/v2/cards/{id}/pan': { /** * Get card number * * @description * Retrieves card number, CVV, and expiration date of a card by ID. */ get: operations['getCardNumber'] } '/v2/cards/{id}/secure_email': { /** * Create secure email to send card number * * @description * Creates a secure email to send card number, CVV, and expiration date of a card by ID to the specified email. * * This endpoint is currently gated. If you would like to request access, please reach out to * developer-access@brex.com */ post: operations['emailCardNumber'] } '/v2/cards/{id}/terminate': { /** * Terminate card * * @description * Terminates an existing card. The card owner will receive a notification about it. */ post: operations['terminateCard'] } '/v2/cards/{id}/unlock': { /** * Unlock card * * @description * Unlocks an existing card. */ post: operations['unlockCard'] } '/v2/company': { /** * Get company * * @description * This endpoint returns the company associated with the OAuth2 access token. */ get: operations['getCompany'] } '/v2/departments': { /** * List departments * * @description * This endpoint lists all departments. */ get: operations['listDepartments'] /** * Create department * * @description * This endpoint creates a new department */ post: operations['createDepartment'] } '/v2/departments/{id}': { /** * Get department * * @description * This endpoint gets a department by ID. */ get: operations['getDepartmentById'] } '/v2/locations': { /** * List locations * * @description * This endpoint lists all locations. */ get: operations['listLocations'] /** * Create location * * @description * This endpoint creates a new location. */ post: operations['createLocation'] } '/v2/locations/{id}': { /** * Get location * * @description * This endpoint gets a location by ID. */ get: operations['getLocationById'] } '/v2/titles': { /** * List titles * * @description * This endpoint lists all titles. */ get: operations['listTitles'] /** * Create title * * @description * This endpoint creates a new title */ post: operations['createTitle'] } '/v2/titles/{id}': { /** * Get title * * @description * This endpoint gets a title by ID. */ get: operations['getTitleById'] } '/v2/users': { /** * List users * * @description * This endpoint lists all users. To find a user id by email, you can filter using the `email` query parameter. */ get: operations['listUsers'] /** * Invite user * * @description * This endpoint invites a new user as an employee. * To update user's role, check out [this article](https://support.brex.com/how-do-i-change-another-user-s-role/). */ post: operations['createUser'] } '/v2/users/me': { /** * Get current user * * @description * This endpoint returns the user associated with the OAuth2 access token. */ get: operations['getMe'] } '/v2/users/{id}': { /** * Get user * * @description * This endpoint gets a user by ID. */ get: operations['getUserById'] /** * Update user * * @description * This endpoint updates a user. Any parameters not provided will be left unchanged. */ put: operations['updateUser'] } '/v2/users/{id}/limit': { /** * Get limit for the user * * @description * This endpoint gets the monthly limit for the user including the monthly available limit. */ get: operations['getUserLimit'] /** * Set limit for the user * * @description * This endpoint sets the monthly limit for a user. * The limit amount must be non-negative. * To unset the monthly limit of the user, just set `monthly_limit` to null. */ post: operations['setUserLimit'] } } export type webhooks = Record export interface components { schemas: { /** @enum {string} */ AccountType: 'BREX_CLASSIC' | 'BREX_EMPOWER' /** @description Company business address (must be in the US; no PO box or virtual/forwarding addresses allowed). */ Address: { /** @description Address line 1, no PO Box. */ line1?: string | null /** @description Address line 2 (e.g., apartment, suite, unit, or building). */ line2?: string | null /** @description City, district, suburb, town, or village. */ city?: string | null /** @description For US-addressed the 2-letter State abbreviation. For international-addresses the county, providence, or region. */ state?: string | null /** @description Two-letter country code (ISO 3166-1 alpha-2). */ country?: string | null /** @description ZIP or postal code. */ postal_code?: string | null /** @description Phone number. */ phone_number?: string | null } /** * @description * Only cards with limit_type = CARD have spend_controls */ Card: { id: string owner: components['schemas']['CardOwner'] status?: components['schemas']['CardStatus'] last_four: string card_name: string card_type?: components['schemas']['CardType'] limit_type: components['schemas']['LimitType'] spend_controls?: components['schemas']['SpendControl'] billing_address: components['schemas']['Address'] mailing_address?: components['schemas']['Address'] expiration_date: components['schemas']['CardExpiration'] /** * @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. */ metadata?: { [key: string]: string } | null /** @description The ID of the budget currently assigned to the card. */ budget_id?: string | null } CardAttributePreferences: { three_domain_secure_enabled_preference?: components['schemas']['ThreeDomainSecureEnabledPreference'] } /** * @description * Card expiration year and month. Cards expire on the last day of the expiration month. * * The expiration date is in UTC for cards starting with 555671, 428803 and 485932. * And the expiration date is in PST for cards starting with 511572. */ CardExpiration: { /** Format: int32 */ month: number /** Format: int32 */ year: number } /** * @description * Card number, CVV, and expiration date of a card. */ CardNumberResponse: { id: string number: string cvv: string expiration_date: components['schemas']['CardExpiration'] } CardOwner: components['schemas']['UserOwner'] /** @enum {string} */ CardStatus: 'ACTIVE' | 'SHIPPED' | 'LOCKED' | 'TERMINATED' /** @enum {string} */ CardType: 'VIRTUAL' | 'PHYSICAL' /** * @description * Reason for card termination. * * @enum {string} */ ChangeCardReason: | 'CARD_DAMAGED' | 'CARD_LOST' | 'CARD_NOT_RECEIVED' | 'DO_NOT_NEED_PHYSICAL_CARD' | 'DO_NOT_NEED_VIRTUAL_CARD' | 'FRAUD' | 'OTHER' CompanyResponse: { id: string legal_name: string mailing_address: components['schemas']['Address'] accountType: components['schemas']['AccountType'] } /** * @description * The `spend_controls` field is required when `limit_type` = `CARD`. * The `shipping_address` field is required for physical cards, and the first 2 lines of the address must be under 60 characters long. */ CreateCardRequest: { owner: components['schemas']['CardOwner'] card_name: string card_type: components['schemas']['CardType'] limit_type: components['schemas']['LimitType'] spend_controls?: components['schemas']['SpendControlRequest'] mailing_address?: components['schemas']['Address'] /** * @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. */ metadata?: { [key: string]: string } | null card_attribute_preferences?: components['schemas']['CardAttributePreferences'] } CreateDepartmentRequest: { /** @description Name of the department */ name: string /** @description Description of the department */ description?: string | null } CreateLocationRequest: { /** @description Name of the location */ name: string /** @description Description of the location */ description?: string | null } CreateTitleRequest: { /** @description Name of the title */ name: string } CreateUserRequest: { first_name: string last_name: string /** Format: email */ email: string manager_id?: string | null department_id?: string | null location_id?: string | null title_id?: string | null /** @description The metadata or customized attributes of the user. Maximum number of entries: 100 */ metadata?: { [key: string]: string } | null } DepartmentResponse: { id: string /** @description Name of the department */ name: string /** @description Description of the department */ description?: string | null } /** * @description * `limit_type = CARD` for vendor cards. Vendor cards must have a `card_type` of `VIRTUAL` * and do not rely on the user specific limit. * * For corporate cards, `limit_type = USER`. * * Learn more about different card types [here](https://support.brex.com/what-are-the-different-types-of-cards-i-can-get/). * * @enum {string} */ LimitType: 'CARD' | 'USER' LocationResponse: { id: string /** @description Name of the location */ name: string /** @description Description of the location */ description?: string | null } /** @description Parameters for locking a card. */ LockCardRequest: { /** @description Description for locking a card */ description?: string | null reason: components['schemas']['ChangeCardReason'] } /** * @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 } /** @enum {string} */ OwnerType: 'USER' Page_Card_: { next_cursor?: string | null items: components['schemas']['Card'][] } Page_DepartmentResponse_: { next_cursor?: string | null items: components['schemas']['DepartmentResponse'][] } Page_LocationResponse_: { next_cursor?: string | null items: components['schemas']['LocationResponse'][] } Page_TitleResponse_: { next_cursor?: string | null items: components['schemas']['TitleResponse'][] } Page_UserResponse_: { next_cursor?: string | null items: components['schemas']['UserResponse'][] } SecureEmailForCardDetailsRequest: { /** @description Email address to send card details to */ recipient_email?: string /** @description Sender name. Shows up in the subject of the email */ sender_name?: string /** @description Message to send with the card details */ message?: string | null /** * Format: int32 * @description Link expiry in number of days. Defaults to 30 */ expiry_days?: number | null } /** @description Request that sets the monthly user limit. */ SetUserLimitRequest: { monthly_limit?: components['schemas']['Money'] } SpendControl: { spend_limit: components['schemas']['Money'] spend_available: components['schemas']['Money'] spend_duration?: components['schemas']['SpendDuration'] reason?: string | null /** * Format: date * @description The `lock_after_date` is in UTC. */ lock_after_date?: string | null } /** * @description * When `limit_type = CARD`, `spend_controls` must be set. When `limit type = USER`, `spend_controls` must be `null`. */ SpendControlRequest: { spend_limit: components['schemas']['Money'] spend_duration: components['schemas']['SpendDuration'] reason?: string | null /** Format: date */ lock_after_date?: string | null /** * @description * If using the Empower platform, a new `budget` will be created for this card. You can specify a `parent_budget` that your new * `budget` will be nested under. If `parent_budget_id` is null, we will nest the new budget under the top-level account `budget`. */ parent_budget_id?: string | null } SpendControlUpdateRequest: { spend_limit?: components['schemas']['Money'] spend_duration?: components['schemas']['SpendDuration'] reason?: string | null /** Format: date */ lock_after_date?: string | null } /** * @description * Spend limit refresh frequency * - MONTHLY: The spend limit refreshes every month * - QUARTERLY: The spend limit refreshes every quarter * - YEARLY: The spend limit refreshes every year * - ONE_TIME: The limit does not refresh * * @enum {string} */ SpendDuration: 'MONTHLY' | 'QUARTERLY' | 'YEARLY' | 'ONE_TIME' /** @description Parameters for terminating a card. */ TerminateCardRequest: { /** @description Description for terminating a card */ description?: string | null reason: components['schemas']['ChangeCardReason'] } /** * @description * Whether to enable 3-D secure protocol on this card. * * @enum {string} */ ThreeDomainSecureEnabledPreference: | 'THREE_DOMAIN_SECURE_ENABLED' | 'THREE_DOMAIN_SECURE_DISABLED' TitleResponse: { id: string /** @description Name of the title */ name: string } UpdateCardRequest: { spend_controls?: components['schemas']['SpendControlUpdateRequest'] /** * @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. */ metadata?: { [key: string]: string } | null } UpdateUserRequest: { status?: components['schemas']['UpdateUserStatus'] /** @description The user id of the manager of this user */ manager_id?: string | null department_id?: string | null location_id?: string | null title_id?: string | null /** @description The metadata or customized attributes of the user. Maximum number of entries: 100 */ metadata?: { [key: string]: string } | null } /** * @description * Acceptable user status for update. To suspend a user, set status to 'disabled'. To unsuspend a user, set status to 'active'. * * @enum {string} */ UpdateUserStatus: 'ACTIVE' | 'DISABLED' UserLimitResponse: { monthly_limit?: components['schemas']['Money'] monthly_available?: components['schemas']['Money'] } UserOwner: { type: 'USER' } & Omit & { type: components['schemas']['OwnerType'] user_id: string } UserResponse: { id: string /** @description First name of the user */ first_name: string /** @description Last name of the user */ last_name: string /** @description Email address of the user */ email: string status?: components['schemas']['UserStatus'] /** @description The user id of the manager of this user */ manager_id?: string | null department_id?: string | null location_id?: string | null title_id?: string | null /** @description The metadata or customized attributes of the user. Maximum number of entries: 100 */ metadata?: { [key: string]: string } | null /** @description Identifier that is displayed on the IDP or HR system, eg, if OKTA identifies you as user xyz */ remote_display_id?: string | null } /** * @description Status of the user * @enum {string} */ UserStatus: | 'INVITED' | 'ACTIVE' | 'CLOSED' | 'DISABLED' | 'DELETED' | 'PENDING_ACTIVATION' | 'INACTIVE' } responses: never parameters: never requestBodies: never headers: never pathItems: never } export type $defs = Record export type external = Record export interface operations { /** * List cards * * @description * Lists all cards by a `user_id`. * Only cards with `limit_type = CARD` have `spend_controls` */ listCardsByUserId: { parameters: { query?: { user_id?: string | null cursor?: string | null limit?: number | null } } responses: { /** @description listCardsByUserId 200 response */ 200: { content: { 'application/json': components['schemas']['Page_Card_'] } } } } /** * Create card * * @description * Creates a new card. * The `spend_controls` field is required when `limit_type` = `CARD`. * The `mailing_address` field is required for physical cards and is the shipping address used to send the card; it is not the same as the billing and mailing address used for online purchases. * The first 2 lines of this address must be under 60 characters long. Each user can only have up to 10 active physical cards. * For Empower accounts, 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. */ createCard: { parameters: { header: { 'Idempotency-Key': string } } requestBody: { content: { 'application/json': components['schemas']['CreateCardRequest'] } } responses: { /** @description createCard 200 response */ 200: { content: { 'application/json': components['schemas']['Card'] } } } } /** * Get card * * @description * Retrieves a card by ID. Only cards with `limit_type = CARD` have `spend_controls` */ getCardById: { parameters: { path: { id: string } } responses: { /** @description getCardById 200 response */ 200: { content: { 'application/json': components['schemas']['Card'] } } } } /** * Update card * * @description * Update an existing vendor card */ updateCard: { parameters: { header?: { 'Idempotency-Key'?: string | null } path: { id: string } } requestBody: { content: { 'application/json': components['schemas']['UpdateCardRequest'] } } responses: { /** @description updateCard 200 response */ 200: { content: { 'application/json': components['schemas']['Card'] } } } } /** * Lock card * * @description * Locks an existing, unlocked card. And the card owner will receive a notification about it. */ lockCard: { parameters: { header?: { 'Idempotency-Key'?: string | null } path: { id: string } } requestBody: { content: { 'application/json': components['schemas']['LockCardRequest'] } } responses: { /** @description lockCard 200 response */ 200: { content: { 'application/json': components['schemas']['Card'] } } } } /** * Get card number * * @description * Retrieves card number, CVV, and expiration date of a card by ID. */ getCardNumber: { parameters: { path: { id: string } } responses: { /** @description getCardNumber 200 response */ 200: { content: { 'application/json': components['schemas']['CardNumberResponse'] } } } } /** * Create secure email to send card number * * @description * Creates a secure email to send card number, CVV, and expiration date of a card by ID to the specified email. * * This endpoint is currently gated. If you would like to request access, please reach out to * developer-access@brex.com */ emailCardNumber: { parameters: { header: { 'Idempotency-Key': string } path: { id: string } } requestBody: { content: { 'application/json': components['schemas']['SecureEmailForCardDetailsRequest'] } } responses: { /** @description emailCardNumber 200 response */ 200: { content: never } } } /** * Terminate card * * @description * Terminates an existing card. The card owner will receive a notification about it. */ terminateCard: { parameters: { header?: { 'Idempotency-Key'?: string | null } path: { id: string } } requestBody: { content: { 'application/json': components['schemas']['TerminateCardRequest'] } } responses: { /** @description terminateCard 200 response */ 200: { content: { 'application/json': components['schemas']['Card'] } } } } /** * Unlock card * * @description * Unlocks an existing card. */ unlockCard: { parameters: { header?: { 'Idempotency-Key'?: string | null } path: { id: string } } responses: { /** @description unlockCard 200 response */ 200: { content: { 'application/json': components['schemas']['Card'] } } } } /** * Get company * * @description * This endpoint returns the company associated with the OAuth2 access token. */ getCompany: { responses: { /** @description getCompany 200 response */ 200: { content: { 'application/json': components['schemas']['CompanyResponse'] } } } } /** * List departments * * @description * This endpoint lists all departments. */ listDepartments: { parameters: { query?: { cursor?: string | null limit?: number | null name?: string | null } } responses: { /** @description listDepartments 200 response */ 200: { content: { 'application/json': components['schemas']['Page_DepartmentResponse_'] } } } } /** * Create department * * @description * This endpoint creates a new department */ createDepartment: { parameters: { header?: { 'Idempotency-Key'?: string | null } } requestBody: { content: { 'application/json': components['schemas']['CreateDepartmentRequest'] } } responses: { /** @description createDepartment 200 response */ 200: { content: { 'application/json': components['schemas']['DepartmentResponse'] } } } } /** * Get department * * @description * This endpoint gets a department by ID. */ getDepartmentById: { parameters: { path: { id: string } } responses: { /** @description getDepartmentById 200 response */ 200: { content: { 'application/json': components['schemas']['DepartmentResponse'] } } } } /** * List locations * * @description * This endpoint lists all locations. */ listLocations: { parameters: { query?: { cursor?: string | null limit?: number | null name?: string | null } } responses: { /** @description listLocations 200 response */ 200: { content: { 'application/json': components['schemas']['Page_LocationResponse_'] } } } } /** * Create location * * @description * This endpoint creates a new location. */ createLocation: { parameters: { header?: { 'Idempotency-Key'?: string | null } } requestBody: { content: { 'application/json': components['schemas']['CreateLocationRequest'] } } responses: { /** @description createLocation 200 response */ 200: { content: { 'application/json': components['schemas']['LocationResponse'] } } } } /** * Get location * * @description * This endpoint gets a location by ID. */ getLocationById: { parameters: { path: { id: string } } responses: { /** @description getLocationById 200 response */ 200: { content: { 'application/json': components['schemas']['LocationResponse'] } } } } /** * List titles * * @description * This endpoint lists all titles. */ listTitles: { parameters: { query?: { cursor?: string | null limit?: number | null name?: string | null } } responses: { /** @description listTitles 200 response */ 200: { content: { 'application/json': components['schemas']['Page_TitleResponse_'] } } } } /** * Create title * * @description * This endpoint creates a new title */ createTitle: { parameters: { header?: { 'Idempotency-Key'?: string | null } } requestBody: { content: { 'application/json': components['schemas']['CreateTitleRequest'] } } responses: { /** @description createTitle 200 response */ 200: { content: { 'application/json': components['schemas']['TitleResponse'] } } } } /** * Get title * * @description * This endpoint gets a title by ID. */ getTitleById: { parameters: { path: { id: string } } responses: { /** @description getTitleById 200 response */ 200: { content: { 'application/json': components['schemas']['TitleResponse'] } } } } /** * List users * * @description * This endpoint lists all users. To find a user id by email, you can filter using the `email` query parameter. */ listUsers: { parameters: { query?: { cursor?: string | null limit?: number | null email?: string | null remote_display_id?: string | null 'expand[]'?: string[] | null } } responses: { /** @description listUsers 200 response */ 200: { content: { 'application/json': components['schemas']['Page_UserResponse_'] } } } } /** * Invite user * * @description * This endpoint invites a new user as an employee. * To update user's role, check out [this article](https://support.brex.com/how-do-i-change-another-user-s-role/). */ createUser: { parameters: { header?: { 'Idempotency-Key'?: string | null } } requestBody: { content: { 'application/json': components['schemas']['CreateUserRequest'] } } responses: { /** @description createUser 200 response */ 200: { content: { 'application/json': components['schemas']['UserResponse'] } } } } /** * Get current user * * @description * This endpoint returns the user associated with the OAuth2 access token. */ getMe: { responses: { /** @description getMe 200 response */ 200: { content: { 'application/json': components['schemas']['UserResponse'] } } } } /** * Get user * * @description * This endpoint gets a user by ID. */ getUserById: { parameters: { path: { id: string } } responses: { /** @description getUserById 200 response */ 200: { content: { 'application/json': components['schemas']['UserResponse'] } } } } /** * Update user * * @description * This endpoint updates a user. Any parameters not provided will be left unchanged. */ updateUser: { parameters: { header?: { 'Idempotency-Key'?: string | null } path: { id: string } } requestBody: { content: { 'application/json': components['schemas']['UpdateUserRequest'] } } responses: { /** @description updateUser 200 response */ 200: { content: { 'application/json': components['schemas']['UserResponse'] } } } } /** * Get limit for the user * * @description * This endpoint gets the monthly limit for the user including the monthly available limit. */ getUserLimit: { parameters: { path: { id: string } } responses: { /** @description getUserLimit 200 response */ 200: { content: { 'application/json': components['schemas']['UserLimitResponse'] } } } } /** * Set limit for the user * * @description * This endpoint sets the monthly limit for a user. * The limit amount must be non-negative. * To unset the monthly limit of the user, just set `monthly_limit` to null. */ setUserLimit: { parameters: { header?: { 'Idempotency-Key'?: string | null } path: { id: string } } requestBody: { content: { 'application/json': components['schemas']['SetUserLimitRequest'] } } responses: { /** @description setUserLimit 200 response */ 200: { content: { 'application/json': components['schemas']['UserLimitResponse'] } } } } } export interface oasTypes { components: components external: external operations: operations paths: paths webhooks: webhooks } export default oasTypes