The Brex API enables developers to programmatically manage their Brex account and cardholders. With the API, developers can create and manage cardholders, retrieve transactions, and more.
Here are some examples of what you can build with the Brex API:
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
brex: {
type: "app",
app: "brex",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://platform.brexapis.com/v2/users/me`,
headers: {
Authorization: `Bearer ${this.brex.$auth.oauth_access_token}`,
},
})
},
})
Lists all settled transactions for the primary card account. See the docs here.
Lists all transactions for the specified cash account. See the docs here.
Brex uses OAuth authentication. When you connect your Brex account, Pipedream will open a popup window where you can sign into Brex and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Brex API.
Pipedream requests the following authorization scopes when you connect your account:
openid
offline_access
users
cards
locations
departments
vendors
transactions.card.readonly
transactions.cash.readonly
accounts.cash.readonly
transfers
https://onboarding.brexapis.com/referrals
GET
https://accounts.brex.com/oauth2/v1/auth
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://accounts.brex.com/oauth2/v1/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://accounts.brex.com/oauth2/v1/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}