Skip to main content
POST
/
api
/
v1
/
expenses
/
import
Import Expenses
curl --request POST \
  --url https://api.example.com/api/v1/expenses/import \
  --header 'Content-Type: application/json' \
  --data '
{
  "expenses": [
    {}
  ]
}
'
{
  "imported": 2,
  "skipped": 1,
  "errors": []
}
Bulk-imports expenses. Server-side validation and deduplication are applied. Maximum 500 expenses per import, batch-inserted in 100-row chunks.

Request Body

expenses
array
required
Array of expense objects to import. Each object must have:
  • category (string, required) — Valid expense category
  • amount (integer, required) — Amount in cents
  • date (string, required) — Date in YYYY-MM-DD format
  • description (string, optional) — Description text

Request

curl -X POST \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "expenses": [
      {"category": "travel", "amount": 4500, "date": "2025-02-15", "description": "Gas"},
      {"category": "meals", "amount": 1200, "date": "2025-02-15", "description": "Lunch"},
      {"category": "travel", "amount": 4500, "date": "2025-02-15", "description": "Gas"}
    ]
  }' \
  https://app.taxhomebase.com/api/v1/expenses/import

Response

{
  "imported": 2,
  "skipped": 1,
  "errors": []
}
imported
integer
Number of expenses successfully imported.
skipped
integer
Number of duplicate expenses skipped. Deduplication is by (category, amount, date).
errors
array
Array of error objects for rows that failed validation.

Errors

StatusCause
400Empty array, exceeds 500 limit, or all rows invalid