Expenses API (0.1)

Download OpenAPI specification:Download

The Expenses API allows you to manage accounting and expenses information.

Card Expenses

View and manage card expenses data.

List expenses

List expenses under the same account. Admin and bookkeeper have access to any expense, and regular users can only access their own.

SecurityOAuth2
Request
query Parameters
expand[]
Array of strings or null

location, department, and receipts.download_uris can be passed to expand[] query parameter to get expanded, e.g., ?expand[]=location&expand[]=receipts.download_uris.

user_id[]
Array of strings or null

Get expenses belong to provided user(s).

parent_expense_id[]
Array of strings or null

Get itemized expenses belong to provided parent expenses ID(s).

cursor
string or null
limit
integer or null <int32>
Responses
200

listExpenses 200 response

400

Bad request

401

Unauthorized

403

Forbidden

get/v1/expenses/card
Request samples
Response samples
application/json
{
  • "next_cursor": "string",
  • "items": [
    ]
}

Get an expense

Get an expense by its ID.

SecurityOAuth2
Request
path Parameters
expense_id
required
string
query Parameters
expand[]
Array of strings or null

location, department, and receipts.download_uris can be passed to expand[] query parameter to get expanded, e.g., ?expand[]=location&expand[]=receipts.download_uris.

Responses
200

getExpense 200 response

400

Bad request

401

Unauthorized

403

Forbidden

404

Not Found

get/v1/expenses/card/{expense_id}
Request samples
Response samples
application/json
{
  • "id": "string",
  • "memo": "string",
  • "location_id": "string",
  • "location": {
    },
  • "department_id": "string",
  • "department": {
    },
  • "updated_at": "2019-08-24T14:15:22Z",
  • "category": "ADVERTISING_AND_MARKETING",
  • "receipts": [
    ],
  • "budget_id": "string"
}

Update an expense

Update an expense. Admin and bookkeeper have access to any expense, and regular users can only access their own.

SecurityOAuth2
Request
path Parameters
expense_id
required
string
Request Body schema: application/json
memo
string or null

Expense memo.

Responses
200

updateExpense 200 response

400

Bad request

401

Unauthorized

403

Forbidden

404

Not Found

put/v1/expenses/card/{expense_id}
Request samples
application/json
{
  • "memo": "string"
}
Response samples
application/json
{
  • "id": "string",
  • "memo": "string",
  • "location_id": "string",
  • "department_id": "string",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "category": "ADVERTISING_AND_MARKETING",
  • "budget_id": "string"
}

Receipt Match

Upload receipt and match automatically.

Create a new receipt match

The uri will be a pre-signed S3 URL allowing you to upload the receipt securely. This URL can only be used for a PUT operation and expires 30 minutes after its creation. Once your upload is complete, we will try to match the receipt with existing expenses.

Refer to these docs on how to upload to this pre-signed S3 URL. We highly recommend using one of AWS SDKs if they're available for your language to upload these files.

Security
Request
Request Body schema: application/json
receipt_name
required
string

The name of the receipt (with the file extension). It will be used in the matching result email.

Responses
200

receiptMatch 200 response

400

Bad request

401

Unauthorized

post/v1/expenses/card/receipt_match
Request samples
application/json
{
  • "receipt_name": "string"
}
Response samples
application/json
{
  • "id": "string",
  • "uri": "string"
}

Receipt Upload

Create a new receipt upload

The uri will be a pre-signed S3 URL allowing you to upload the receipt securely. This URL can only be used for a PUT operation and expires 30 minutes after its creation. Once your upload is complete, we will try to match the receipt with existing expenses.

Refer to these docs on how to upload to this pre-signed S3 URL. We highly recommend using one of AWS SDKs if they're available for your language to upload these files.

Security
Request
path Parameters
expense_id
required
string
Request Body schema: application/json
receipt_name
required
string

The name of the receipt (with the file extension).

Responses
200

receiptUpload 200 response

400

Bad request

401

Unauthorized

403

Forbidden

404

Not Found

post/v1/expenses/card/{expense_id}/receipt_upload
Request samples
application/json
{
  • "receipt_name": "string"
}
Response samples
application/json
{
  • "id": "string",
  • "uri": "string"
}
Copyright © Brex 2019–2022. All rights reserved.