---
title: "Update expense transactions"
method: PUT
path: "/companies/{companyId}/sync/expenses/expense-transactions/{transactionId}"
tags: ["Expenses"]
---

# Update expense transactions

`PUT /companies/{companyId}/sync/expenses/expense-transactions/{transactionId}`

The *Update expense* endpoint updates an existing [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) in the accounting software for a given company's connection. 

[Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) represent transactions made with a company debit or credit card. 

### Supported integrations
The following integrations are supported for the [Payment](https://docs.codat.io/expenses/sync-process/expense-transactions#transaction-types) transaction `type` only: 
| Integration           | Supported |
|-----------------------|-----------|
| FreeAgent             | Yes       |
| QuickBooks Desktop    | Yes       |
| QuickBooks Online     | Yes       |
| Oracle NetSuite       | Yes       |
| Sage Intacct          | Yes       |
| Xero                  | Yes       |
| Zoho Books            | Yes       |

#### Integration-specific behavior

| Integration           | Specifics |
|-----------------------|-----------|
| Sage Intacct          | To sync **debit card expenses**, map the debit card to a Credit Card with the account type set to `Debit`.|

## Request body

- UpdateExpenseRequest
  - `type` 'Payment' | 'Refund' | 'Reward' | 'Chargeback', required — The type of transaction.
  - `issueDate` string, required — Date the transaction was recorded.
  - `currency` string, required — Currency the transaction was recorded in.
  - `currencyRate` CurrencyRate — unresolved $ref
  - `contactRef` ExpenseContactRef
    - `id` string, required — Identifier of supplier or customer.
    - `type` 'Supplier' — The type of contact.
  - `bankAccountRef` object
    - `id` string — Identifier of the bank account.
  - `merchantName` string — Name of the merchant where the purchase took place
  - `lines` ExpenseTransactionLine[] — Array of transaction lines.
    - `netAmount` number, required — Amount of the line, exclusive of tax.
    - `taxAmount` number — Amount of tax for the line.
    - `taxRateRef` RecordRef
      - `id` string — Identifier of linked reference from mapping options.
    - `accountRef` RecordRef
      - `id` string — Identifier of linked reference from mapping options.
    - `itemRef` ItemRef, nullable
      - `id` string — Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both.
    - `trackingRefs` TrackingRef[], nullable
      - `id` string — Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer.
      - `dataType` 'trackingCategories' | 'customers' — The type of the linked reference
    - `invoiceTo` InvoiceTo, nullable — Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop.
      - `id` string — identifier of customer.
      - `type` 'customer' — The type of contact.
  - `notes` string — Any private, company notes about the transaction.

## Response `202`

Accepted

- UpdateExpenseResponse
  - `syncId` string — Unique identifier for the update expense sync.

## Other responses

- `400` — The request made is not valid.
- `401` — Your API request was not properly authorized.
- `402` — An account limit has been exceeded. The type of limit is described in the error property: - You have exceeded the 50-company limit that applies to a Free plan. Delete any companies you no longer need and retry the request. - The requested sync schedule is not allowed. You requested an hourly sync schedule but this functionality is not included in the Free plan. - Your Free account is older than 365 days and has expired. Contact support@codat.io.
- `403` — You are using an outdated API key or a key not associated with that resource.
- `404` — One or more of the resources you referenced could not be found. This might be because your company or data connection id is wrong, or was already deleted.
- `422` — The requests made can't be processed. This may be due to differences in platform support.
- `429` — Too many requests were made in a given amount of time. Wait a short period and then try again.
- `500` — There is a problem with our server. Please try again later.
- `503` — The Codat API is temporarily offline for maintenance. Please try again later.

---

[API](https://skmtc.net/codatio/apis/sync-for-expenses-v1.md) · [All operations](https://skmtc.net/codatio/apis/sync-for-expenses-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/codatio/sync-for-expenses-v1/revisions/3a810b6f9c66/schema)
