# Update Outbound Payment

`PATCH /accounting/outbound-payments/{id}`

Group: Accounting › Outbound Payments · Operation ID: `updateOutboundPayment`

Updates the outbound payment with the given identifier. Only the fields in the request body change.

Only the fields in the request body change. Only a payment that has not been executed can be changed, the same states the delete endpoint accepts. A payment that has been applied, is processing, or has otherwise moved money fails with PAYMENT_NOT_EDITABLE. Void it instead with POST accounting/outbound-payments/:id/void. Payment items change through three arrays, applied in the order delete, update, create. updatePaymentItems and deletePaymentItems address items by the id the payment publishes, and an item id belonging to another payment fails with ITEM_NOT_FOUND. An update that would leave the payment with no items fails with NO_PAYMENT_ITEMS. Documents named by added or changed items go through the same payability checks as on create, DOCUMENT_NOT_PAYABLE, PAYMENT_AMOUNT_EXCEEDS_OPEN_AMOUNT and DOCUMENT_CURRENCY_MISMATCH. When an item's amount changes, the amount it already applies is credited back first, so re-sending the same amount is not read as a second payment. The response is empty. Read the record with GET accounting/outbound-payments/:id if you need its state after the update.

[Open in the interactive reference](https://docs.api.lensing.ai/?op=updateOutboundPayment)

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | `"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 for the outbound payment to update. |

## Request body

Required, `application/json`: updateOutboundPaymentInput.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountId` | string | no | The bank or cash account the payment is made from. See id on GET accounting/accounts/:id. |
| `paymentDate` | string (date) | no | The date the payment is made. Use format YYYY-MM-DD. |
| `paymentCurrency` | string | no | The currency of the payment. Format ISO 4217, for example 'USD'. Governs each item's amount unless the item names its own currency. |
| `commonDescription` | string | no | A description applied to the payment as a whole. |
| `externalUrl` | string | no | A link back to the payment in the upstream system. |
| `origin` | string | no | The source system this payment came from. |
| `senderAccountId` | string | no | A bank account identifier for the sender, supplied by an integration. It is free-form text, not a reference to an account record. |
| `actualExchangeRate` | string (decimal) | no | The exchange rate the bank actually applied, as a decimal. |
| `systemExchangeRate` | string (decimal) | no | The exchange rate the system derived, as a decimal. |
| `skipJournalEntry` | boolean | no | Whether to skip journal-entry creation for this payment. |
| `createPaymentItems` | array of object | no | Documents to add to this payment. Each has the same shape as on create, without an id. |
| `createPaymentItems[].documentId` | string | yes | The document being paid, of the kind this payment already pays. See id on GET accounting/vendor-bills/:id or GET accounting/expense-reports/:id. |
| `createPaymentItems[].entityId` | string | yes | The legal entity the document is posted under. See id on GET base/entities. |
| `createPaymentItems[].amount` | string (decimal) | yes | The amount applied to this document, as a decimal. |
| `createPaymentItems[].currency` | string | no | The currency for this item. Format ISO 4217, for example 'USD'. Omit to use the payment's currency. |
| `createPaymentItems[].description` | string | yes | What this item pays for. Required. |
| `updatePaymentItems` | array of object | no | Payment items to change, each addressed by the id the payment publishes. |
| `updatePaymentItems[].id` | string | yes | The unique identifier for the payment item to change. It must belong to this payment. |
| `updatePaymentItems[].documentId` | string | no | The document being paid. See id on GET accounting/vendor-bills/:id or GET accounting/expense-reports/:id. |
| `updatePaymentItems[].entityId` | string | no | The legal entity the document is posted under. See id on GET base/entities. |
| `updatePaymentItems[].amount` | string (decimal) | no | The amount applied to this document, as a decimal. |
| `updatePaymentItems[].currency` | string | no | The currency for this item. Format ISO 4217, for example 'USD'. |
| `updatePaymentItems[].description` | string | no | What this item pays for. |
| `deletePaymentItems` | array of string | no | The identifiers of payment items to remove, applied before the updates and creates. Each must belong to this payment. Removing them all is refused, so delete the payment instead. |

Example:

```json
{
  "accountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "paymentDate": "2026-08-28",
  "paymentCurrency": "<paymentCurrency>",
  "commonDescription": "August vendor run (revised)",
  "externalUrl": "<externalUrl>",
  "origin": "<origin>",
  "senderAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "actualExchangeRate": "19.99",
  "systemExchangeRate": "19.99",
  "skipJournalEntry": true,
  "createPaymentItems": [
    {
      "documentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "amount": "19.99",
      "currency": "<currency>",
      "description": "<description>"
    }
  ],
  "updatePaymentItems": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "documentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "amount": "19.99",
      "currency": "<currency>",
      "description": "<description>"
    }
  ],
  "deletePaymentItems": [
    "<deletePaymentItems>"
  ]
}
```

## Response

`200` Success

## Response headers

- `Idempotency-Replayed` — Present and `true` only when this response replays a previously stored one for the same Idempotency-Key, rather than reflecting a live execution. Absent on a live response - never sent as `false`.

## Errors

| Code | Status |
| --- | --- |
| `NOT_FOUND` | 400 |
| `PAYMENT_NOT_EDITABLE` | 400 |
| `REFERENCE_NOT_FOUND` | 400 |
| `ITEM_NOT_FOUND` | 400 |
| `NO_PAYMENT_ITEMS` | 400 |
| `DOCUMENT_NOT_PAYABLE` | 400 |
| `PAYMENT_AMOUNT_EXCEEDS_OPEN_AMOUNT` | 400 |
| `DOCUMENT_CURRENCY_MISMATCH` | 400 |
| `IDEMPOTENCY_KEY_CONFLICT` | 409 |
| `IDEMPOTENCY_PAYLOAD_MISMATCH` | 422 |

## Statuses

- `400` — Invalid request or business failure. Codes: NOT_FOUND, PAYMENT_NOT_EDITABLE, REFERENCE_NOT_FOUND, ITEM_NOT_FOUND, NO_PAYMENT_ITEMS, DOCUMENT_NOT_PAYABLE, PAYMENT_AMOUNT_EXCEEDS_OPEN_AMOUNT, DOCUMENT_CURRENCY_MISMATCH
- `401` — Missing or invalid access token
- `403` — Not authorized
- `404` — Not found
- `409` — The Idempotency-Key is still being processed by another request.
- `422` — The Idempotency-Key was already used with a different request payload.
- `429` — Too many requests
- `500` — Internal server error
