Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@maroo-us/brex-api

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maroo-us/brex-api

Unofficial JS/TS wrapper for Brex (c) API.

  • 0.8.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

brex-api NPM Test

Unofficial JS/TS wrapper for Brex (c) API.

Installation

yarn add @maroo-us/brex-api

Usage

import { BrexClient } from '@maroo-us/brex-api'

const brex = new BrexClient({
  accessToken: 'your_access_token',
})

// ES async/await
;(async () => {
  const response = await brex.vendors.list()
  console.log(response.list)
})()

// Promises
brex.vendors.list().then((response) => {
  console.log(response.list)
})

Follow Brex developer documentation to obtain an access token.

Working with transfers:

// List existing transfers
const listTransferRes = await brex.transfers.list()

// Create a new transfer
const createTransferRes = await brex.transfers.create({
  amount: {
    // Transfer Amount as cents
    amount: 12340,
    currency: 'USD',
  },
  description: 'Test transfer',
  counterparty: {
    type: 'VENDOR',
    paymentInstrumentId: 'vendor_payment_instrument_id',
  },
  externalMemo: 'ACH PMT',
  cashAccountId: 'your_cash_account_id',
})

// Get existing transfer
const getTransferRes = await brex.transfers.get('transfer_id')

If you want to connect to Brex staging environment, you can specify optional environment property in the initialization options:

import { BrexClient, BrexEnvironment } from '@maroo-us/brex-api'

const brex = new BrexClient({
  accessToken: 'your_access_token',
  environment: BrexEnvironment.Staging,
})

By default, the production environment is used.

Development

# Install dependencies
> yarn install

# Lint project files
> yarn lint:fix

# Format project files
> yarn format:fix

# Build the project
> yarn build

# Generate TS declaration file
> yarn types

# Create dist tarball
> yarn dist

# Prepare a new release
> npm version patch|minor|major
> npm publish --access=public
> git push && git push --tags

License

Maroo-us/brex-api — Licensed under the MIT License.

“Brex” and the Brex logo — registered trademarks of ”Brex Inc.”

Pull/feature requests and issue posting are highly appreciated!

Keywords

FAQs

Package last updated on 21 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc