Update an expense report

Operation ID: updateExpenseReport

Group: Accounting › Expense Reports

Open in the interactive reference

PATCH /accounting/expense-reports/{id}

Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.

Updates an expense report with the fields you send. A field you leave out keeps its current value.

Use the report's id, not its expenseNumber.

This is true on the report and on each item in updateExpenseItems. Expense items change through three separate arrays, applied in this order: deleteExpenseItems, updateExpenseItems, createExpenseItems. Leave out all three to keep the items as they are.

On an updateExpenseItems item, amortization schedules change through createAmortizationSchedules, updateAmortizationSchedules, and deleteAmortizationSchedules. An attachments list you send on an item replaces that item's attachments, so include every attachment you want to keep. Leave attachments out to keep them.

The report's main fields and its expense items can change in one request.

One request can remove an item and add its replacement.

updateExpenseItems and deleteExpenseItems name items by their id on GET accounting/expense-reports/:id. For an item of another report, the request fails with ITEM_NOT_FOUND.

After the update, the report is reimbursable unless an item left on it sets reimbursable to false. The response is empty. Read the record with GET accounting/expense-reports/:id.

Parameters

Name In Type Required Description
Api-Version header string · v1 yes The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1.
Idempotency-Key header string no An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored.
id path string yes The unique identifier of the expense report you want to update. Example: "c7d2e910-3b45-4f68-8a91-2d3e4f5a6b78".

Request body

Required, application/json: updateExpenseReportInput.

Field Type Required Description
employeeId string no The employee the report belongs to, given as an id. See id on GET people/person/:id. Omit to leave unchanged.
entityId string no The legal entity the report is posted under, given as an id. See id on GET base/entities. Omit to leave unchanged.
reimbursementCurrency string no The currency the employee is reimbursed in. Format ISO 4217, for example 'USD'. Omit to leave unchanged.
submittedDate date no The date the report is submitted. Use format YYYY-MM-DD. Omit to leave unchanged.
departmentId string no The department the report is charged to, given as an id. See id on GET people/departments/:id. Omit to leave unchanged.
offsetAccountId string no The GL offset account for the reimbursement, given as an id. See id on GET accounting/accounts/:id. Omit to leave unchanged.
externalExpenseReportId string no The identifier this report has in the upstream system that produced it. Omit to leave unchanged.
externalUrl string no A link to the report in the upstream system that produced it. Omit to leave unchanged.
origin string no The source system this report came from, as free-form text. Omit to leave unchanged.
markAsPaid boolean no Whether the report is marked paid. Omit to leave unchanged.
createExpenseItems array<object> no The expense items to add. Omit for no additions. Example: [{"amount":"12.50","currency":"EUR","billDate":"2026-08-21","merchant":"Taxi","expenseType":"Pur"}].
createExpenseItems[].amount decimal yes The amount of the expense, as a decimal in this item's own currency.
createExpenseItems[].currency string yes The currency the expense was incurred in. Format ISO 4217, for example 'USD'. Governs this item's amount, and need not match the report's reimbursementCurrency.
createExpenseItems[].billDate date yes The date on the receipt. Use format YYYY-MM-DD.
createExpenseItems[].merchant string yes The merchant the expense was paid to, as printed on the receipt.
createExpenseItems[].expenseType string yes The kind of expense. Values include 'Pur' (purchase), 'Dis' (distance traveled) and 'PerDiem'.
createExpenseItems[].description string no A description of the expense.
createExpenseItems[].categoryId string no The expense category this item is booked under. See id on GET accounting/expense-categories/:id.
createExpenseItems[].accountId string no The general ledger account this item's journal entry uses. See id on GET accounting/accounts/:id. Omit to let the category decide.
createExpenseItems[].reimbursable boolean no Whether this item is reimbursed to the employee. Defaults to true.
createExpenseItems[].externalExpenseItemId string no The identifier this item has in the upstream system that produced it.
createExpenseItems[].origin string no The source system this item came from, as free-form text.
createExpenseItems[].attendees string no Who attended, when the item's category requires it. Free text.
createExpenseItems[].attachments array<object> no Receipts for this item, each naming an already-uploaded file by its id. Required when the category sets requireAttachment. On an existing item, omitting this leaves its attachments untouched, and an empty array clears them.
createExpenseItems[].attachments[].fileName string yes The display name of the attached file.
createExpenseItems[].attachments[].fileId string yes The identifier of the already-uploaded file. There is no endpoint for it.
createExpenseItems[].amortizationSchedules array<object> no The amortization schedules to defer this item over, one per accounting book. A new item has nothing to change or remove, so this is a plain array, the same shape POST accounting/expense-reports takes.
createExpenseItems[].amortizationSchedules[].bookId string no The accounting book this schedule posts into. See id on GET accounting/books/:id. Omit it on a single-book entity to use that entity's default transaction book.
createExpenseItems[].amortizationSchedules[].deferredAccountId string no The general ledger account the deferred balance sits on until it is recognized. See id on GET accounting/accounts/:id. Defaults to the item's own accountId.
createExpenseItems[].amortizationSchedules[].recognitionAccountId string yes The general ledger account each installment recognizes the expense into. See id on GET accounting/accounts/:id.
createExpenseItems[].amortizationSchedules[].amortizationMethod string yes How the schedule spreads its total. Values include 'exactDays', 'pointInTime', 'straightLine', 'straightLineProRateFirstLast' and 'usageBased'.
createExpenseItems[].amortizationSchedules[].amortizationStartDate date yes The first day the schedule amortizes over. Format YYYY-MM-DD. It must not be after amortizationEndDate.
createExpenseItems[].amortizationSchedules[].amortizationEndDate date yes The last day the schedule amortizes over, inclusive. Format YYYY-MM-DD.
createExpenseItems[].amortizationSchedules[].term decimal yes The number of months the schedule spreads over. A count, not an amount, so it carries no currency.
createExpenseItems[].amortizationSchedules[].description string no A note to record against the schedule.
updateExpenseItems array<object> no The expense items to change, each addressed by the id the report publishes. Every field but the id is optional, and omitting one leaves it unchanged. Omit for no changes.
updateExpenseItems[].id string yes The unique identifier for the expense item to change. It must belong to this report.
updateExpenseItems[].amount decimal no The amount of the expense, as a decimal in this item's own currency.
updateExpenseItems[].currency string no The currency the expense was incurred in. Format ISO 4217, for example 'USD'. Governs this item's amount, and need not match the report's reimbursementCurrency.
updateExpenseItems[].billDate date no The date on the receipt. Use format YYYY-MM-DD.
updateExpenseItems[].merchant string no The merchant the expense was paid to, as printed on the receipt.
updateExpenseItems[].expenseType string no The kind of expense. Values include 'Pur' (purchase), 'Dis' (distance traveled) and 'PerDiem'.
updateExpenseItems[].description string no A description of the expense.
updateExpenseItems[].categoryId string no The expense category this item is booked under. See id on GET accounting/expense-categories/:id.
updateExpenseItems[].accountId string no The general ledger account this item's journal entry uses. See id on GET accounting/accounts/:id. Omit to let the category decide.
updateExpenseItems[].reimbursable boolean no Whether this item is reimbursed to the employee. Defaults to true.
updateExpenseItems[].externalExpenseItemId string no The identifier this item has in the upstream system that produced it.
updateExpenseItems[].origin string no The source system this item came from, as free-form text.
updateExpenseItems[].attendees string no Who attended, when the item's category requires it. Free text.
updateExpenseItems[].attachments array<object> no Receipts for this item, each naming an already-uploaded file by its id. Required when the category sets requireAttachment. On an existing item, omitting this leaves its attachments untouched, and an empty array clears them.
updateExpenseItems[].attachments[].fileName string yes The display name of the attached file.
updateExpenseItems[].attachments[].fileId string yes The identifier of the already-uploaded file. There is no endpoint for it.
updateExpenseItems[].createAmortizationSchedules array<object> no Amortization schedules to add to this item, each with no id. Omit for no additions. Send none of the three amortization arrays to leave this item's schedules exactly as they are.
updateExpenseItems[].createAmortizationSchedules[].bookId string no The accounting book this schedule posts into. See id on GET accounting/books/:id. Omit it on a single-book entity to use that entity's default transaction book.
updateExpenseItems[].createAmortizationSchedules[].deferredAccountId string no The general ledger account the deferred balance sits on until it is recognized. See id on GET accounting/accounts/:id. Defaults to the item's own accountId.
updateExpenseItems[].createAmortizationSchedules[].recognitionAccountId string yes The general ledger account each installment recognizes the expense into. See id on GET accounting/accounts/:id.
updateExpenseItems[].createAmortizationSchedules[].amortizationMethod string yes How the schedule spreads its total. Values include 'exactDays', 'pointInTime', 'straightLine', 'straightLineProRateFirstLast' and 'usageBased'.
updateExpenseItems[].createAmortizationSchedules[].amortizationStartDate date yes The first day the schedule amortizes over. Format YYYY-MM-DD. It must not be after amortizationEndDate.
updateExpenseItems[].createAmortizationSchedules[].amortizationEndDate date yes The last day the schedule amortizes over, inclusive. Format YYYY-MM-DD.
updateExpenseItems[].createAmortizationSchedules[].term decimal yes The number of months the schedule spreads over. A count, not an amount, so it carries no currency.
updateExpenseItems[].createAmortizationSchedules[].description string no A note to record against the schedule.
updateExpenseItems[].updateAmortizationSchedules array<object> no Amortization schedules to change, each addressed by the id the report publishes. A schedule that has already started recognizing is refused with AMORTIZATION_SCHEDULE_POSTED. Omit for no changes.
updateExpenseItems[].updateAmortizationSchedules[].id string yes The identifier of the schedule to change. It must be one this item already carries.
updateExpenseItems[].updateAmortizationSchedules[].bookId string no The accounting book this schedule posts into. See id on GET accounting/books/:id. Omit to leave unchanged.
updateExpenseItems[].updateAmortizationSchedules[].deferredAccountId string no The general ledger account the deferred balance sits on until it is recognized. See id on GET accounting/accounts/:id. Omit to leave unchanged.
updateExpenseItems[].updateAmortizationSchedules[].recognitionAccountId string no The general ledger account each installment recognizes the expense into. See id on GET accounting/accounts/:id. Omit to leave unchanged.
updateExpenseItems[].updateAmortizationSchedules[].amortizationMethod string no How the schedule spreads its total. Values include 'exactDays', 'pointInTime', 'straightLine', 'straightLineProRateFirstLast' and 'usageBased'. Omit to leave unchanged.
updateExpenseItems[].updateAmortizationSchedules[].amortizationStartDate date no The first day the schedule amortizes over. Format YYYY-MM-DD. Omit to leave unchanged.
updateExpenseItems[].updateAmortizationSchedules[].amortizationEndDate date no The last day the schedule amortizes over, inclusive. Format YYYY-MM-DD. Omit to leave unchanged.
updateExpenseItems[].updateAmortizationSchedules[].term decimal no The number of months the schedule spreads over. Omit to leave unchanged.
updateExpenseItems[].updateAmortizationSchedules[].description string no A note to record against the schedule. Omit to leave unchanged.
updateExpenseItems[].deleteAmortizationSchedules array<string> no The identifiers of amortization schedules to remove from this item. Each must be one this item carries, and one that has not started recognizing. Removing a schedule leaves this item's other books untouched.
deleteExpenseItems array<string> no The ids of expense items to remove, applied before the updates and creates. Each must belong to this report. Omit for no deletions. Removing an item also removes the amortization schedules it carried.
{
  "employeeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "reimbursementCurrency": "<reimbursementCurrency>",
  "submittedDate": "2026-01-15",
  "departmentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "offsetAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "externalExpenseReportId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "externalUrl": "<externalUrl>",
  "origin": "<origin>",
  "markAsPaid": true,
  "createExpenseItems": [
    {
      "amount": "12.50",
      "currency": "EUR",
      "billDate": "2026-08-21",
      "merchant": "Taxi",
      "expenseType": "Pur"
    }
  ],
  "updateExpenseItems": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "amount": "19.99",
      "currency": "<currency>",
      "billDate": "2026-01-15",
      "merchant": "<merchant>",
      "expenseType": "<expenseType>",
      "description": "<description>",
      "categoryId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "accountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "reimbursable": true,
      "externalExpenseItemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "origin": "<origin>",
      "attendees": "<attendees>",
      "attachments": [
        {
          "fileName": "<fileName>",
          "fileId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
        }
      ],
      "createAmortizationSchedules": [
        {
          "bookId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "deferredAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "recognitionAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "amortizationMethod": "<amortizationMethod>",
          "amortizationStartDate": "2026-01-15",
          "amortizationEndDate": "2026-01-15",
          "term": "19.99",
          "description": "<description>"
        }
      ],
      "updateAmortizationSchedules": [
        {
          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "bookId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "deferredAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "recognitionAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "amortizationMethod": "<amortizationMethod>",
          "amortizationStartDate": "2026-01-15",
          "amortizationEndDate": "2026-01-15",
          "term": "19.99",
          "description": "<description>"
        }
      ],
      "deleteAmortizationSchedules": [
        "<deleteAmortizationSchedules>"
      ]
    }
  ],
  "deleteExpenseItems": [
    "<deleteExpenseItems>"
  ]
}

Response

200 Success

{
  "data": {},
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}

Response headers

Errors

Code Status
NOT_FOUND 400
REFERENCE_NOT_FOUND 400
ITEM_NOT_FOUND 400
AMORTIZATION_SCHEDULE_NOT_FOUND 400
AMORTIZATION_SCHEDULE_POSTED 400
AMORTIZATION_NOT_ALLOWED_ON_LINE 400
AMORTIZATION_DATE_RANGE_INVALID 400
AMORTIZATION_BOOK_NOT_CONFIGURED 400
DUPLICATE_AMORTIZATION_BOOK 400
AMORTIZATION_TERM_MISMATCH 400
AMORTIZATION_METHOD_INVALID 400
TOO_MANY_LINES 400
CATEGORY_REQUIREMENT_UNMET 400
CATEGORY_INACTIVE 400
ITEM_NEEDS_CATEGORY_OR_ACCOUNT 400
IDEMPOTENCY_KEY_CONFLICT 409
IDEMPOTENCY_PAYLOAD_MISMATCH 422

Statuses