Skip to main content
POST
/
api
/
expenses
Create a new expense transaction.
curl --request POST \
  --url https://api.example.com/api/expenses \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'organization-id: <organization-id>' \
  --data '
{
  "referenceNo": "INV-123456",
  "paymentDate": "2021-01-01",
  "paymentAccountId": 1,
  "description": "This is a description",
  "exchangeRate": 1,
  "currencyCode": "USD",
  "publish": true,
  "payeeId": 1,
  "branchId": 1,
  "categories": [
    {
      "index": 1,
      "expenseAccountId": 1,
      "amount": 100,
      "description": "This is a description",
      "landedCost": true,
      "projectId": 1
    }
  ],
  "attachments": [
    {
      "key": "123456"
    }
  ]
}
'

Headers

Authorization
string
required

Value must be 'Bearer ' where is an API key prefixed with 'bc_' or a JWT token.

Example:

"Bearer bc_1234567890abcdef"

organization-id
string
required

Required if Authorization is a JWT token. The organization ID to operate within.

Body

application/json
referenceNo
string
required

The reference number of the expense

Example:

"INV-123456"

paymentDate
string<date-time>
required

The payment date of the expense

Example:

"2021-01-01"

paymentAccountId
number
required

The payment account id of the expense

Example:

1

description
string
required

The description of the expense

Example:

"This is a description"

exchangeRate
number
required

The exchange rate of the expense

Example:

1

currencyCode
string
required

The currency code of the expense

Example:

"USD"

publish
boolean
required

The publish status of the expense

Example:

true

payeeId
number
required

The payee id of the expense

Example:

1

branchId
number
required

The branch id of the expense

Example:

1

categories
string[]
required

The categories of the expense

Example:
[
{
"index": 1,
"expenseAccountId": 1,
"amount": 100,
"description": "This is a description",
"landedCost": true,
"projectId": 1
}
]
attachments
string[]
required

The attachments of the expense

Example:
[{ "key": "123456" }]

Response

201 - undefined