# PATCH /api/v1/invoices/{invoice_id}/payments/{payment_id}

> Update payment on invoice

- **Tag:** invoices
- **Operation ID:** `update_invoice_payment_api_v1_invoices__invoice_id__payments__payment_id__patch`

## Description

Edit the amount or date of an existing payment record.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `invoice_id` (path, string · uuid, required)
- `payment_id` (path, string · uuid, required)

## Request body

Schema: `InvoicePaymentUpdateRequest`

- `amount` (integer) — New payment amount in cents.  Must be > 0 and <= the remaining unallocated amount on the transaction (excluding the current payment's allocation).
- `paid_on` (string · date-time) — Override payment date (ISO 8601).

## Responses

### 200 — Successful Response

Schema: `InvoicePaymentResponse`

- `id` (string · required) — Payment record UUID.
- `invoice_id` (string · required) — UUID of the invoice being paid.
- `transaction_id` (string · required) — UUID of the bank transaction.
- `amount` (integer · required) — Allocated payment amount in cents.
- `currency` (string) — Currency (USD, CAD, AUD, EUR, or GBP).
- `paid_on` (string · date-time · required) — Effective payment date.
- `created_at` (string · date-time · required) — Record creation timestamp.
- `updated_at` (string · date-time · required) — Last update timestamp.
- `business_id` (string · required) — Business UUID.
- `transaction` (InvoicePaymentTransactionSummary) — Linked bank transaction summary. Included when listing payments.

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 404 — Not Found - Resource does not exist

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X PATCH 'https://api.ondayzero.com/api/v1/invoices/{invoice_id}/payments/{payment_id}' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "amount": 0,
  "paid_on": "2026-01-01T00:00:00Z"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/invoices/{invoice_id}/payments/{payment_id}', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "amount": 0,
  "paid_on": "2026-01-01T00:00:00Z"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {
  "amount": 0,
  "paid_on": "2026-01-01T00:00:00Z"
}

response = httpx.patch("https://api.ondayzero.com/api/v1/invoices/{invoice_id}/payments/{payment_id}", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/invoices/update-invoice-payment
- OpenAPI slice: https://www.ondayzero.com/docs/reference/invoices/update-invoice-payment/openapi.json
- Other endpoints in **invoices**: https://www.ondayzero.com/docs/reference/invoices
