The Brex (Staging) API allows you to automate financial operations and integrate with Brex's suite of financial services. This API can be leveraged to synchronize transactions, manage cards, and automate accounting processes, providing real-time insights into your business finances. Using Pipedream, these capabilities can be harnessed to create custom workflows that trigger actions based on financial events, reconcile expenses, and streamline financial reporting.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
brex_staging: {
type: "app",
app: "brex_staging",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://platform.staging.brexapps.com/v2/cards`,
headers: {
Authorization: `Bearer ${this.brex_staging.$auth.oauth_access_token}`,
},
})
},
})
Automated Expense Reporting: Track expenses by triggering a Pipedream workflow that listens for new transactions on a Brex card. Once a transaction is detected, categorize the expense and automatically send a report to a Google Sheet for accounting reconciliation.
Real-Time Budget Alerts: Create a workflow on Pipedream that monitors your Brex account balances and transaction activity. When spending approaches a set budget limit, automatically send an alert via email or Slack to the finance team to prevent budget overruns.
Streamlined Employee Onboarding: Automate the process of issuing Brex cards for new employees. When a new employee is added to your HR system (like BambooHR), trigger a Pipedream workflow that sends a request to the Brex API to issue a new card and set spending limits according to their role.
Emit new event for new failed or processed events
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 (Staging) uses OAuth authentication. When you connect your Brex (Staging) account, Pipedream will open a popup window where you can sign into Brex (Staging) 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 (Staging) 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
budgets
GET
https://accounts-api.staging.brexapps.com/oauth2/default/v1/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://accounts-api.staging.brexapps.com/oauth2/default/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-api.staging.brexapps.com/oauth2/default/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}}