---
title: "Update the metadata of an existing credit note"
method: PATCH
path: "/zatca/simplified-credit-notes/{id}/"
tags: ["Simplified Credit Note"]
---

# Update the metadata of an existing credit note

`PATCH /zatca/simplified-credit-notes/{id}/`

## Request

- Base URL: `https://api.wafeq.com/v1`
- URL: `https://api.wafeq.com/v1/zatca/simplified-credit-notes/{id}/`
- Auth: API key in header `Authorization`

Update the `metadata` of an existing credit note. The keys you send are merged into the credit note's metadata: new keys are added, existing keys are overwritten, and keys you leave out are kept as they are. Set a key to `null` to remove it.

Only `metadata` can be updated; the rest of the credit note is what was reported to ZATCA and cannot change. Metadata values must be non-empty strings, and keys cannot contain `.` or start with `$`.

## Path parameters

- `id` string, required

## Headers

- `X-ZATCA-Branch` string
- `X-ZATCA-Connected-Account-Id` string
- `X-ZATCA-Environment` string

## Request body

- PatchedapiV1ZatcaDocumentMetadataUpdateWrite: Metadata changes to merge into the document.
  - `metadata` object: The metadata keys to set. Keys left out are kept as they are; set a key to `null` to remove it.

## Response `200`

The document with its merged metadata

- ApiV1ZatcaDetailRead: A document reported to ZATCA, with its content, reporting status, and ZATCA response.
  - `created_ts` string, date-time, required: The datetime in UTC when the document was created.
  - `document` ApiV1ZatcaDocumentDetailRead, required: The details of the reported ZATCA document content.
    - `document_number` string, required: The document number.
    - `id` string, required: The id of the object.
    - `issue_datetime` string, date-time, required: The issue datetime.
    - `supply_date` string, date, required: The supply date.
  - `metadata` object, required: The metadata of the document.
  - `qr_code_data` string, required: Base64 encoded QR code data.
  - `reference` string, required: The reference of the document.
  - `reported_ts` string, date-time, nullable, required: The datetime in UTC when the document was reported/cleared.
  - `response` unknown, required
  - `sent_ts` string, date-time, nullable, required: The datetime in UTC when the document was sent.
  - `status` string, required: The status of the document.

## Other responses

- `400`: The metadata is invalid

## Changes

- **2026-11-03** `6b4a622bbb4f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/wafeq/apis/wafeq-zatca-api/changes/zatca/simplified-credit-notes/:id/patch.md)

---

[API](https://skmtc.dev/wafeq/apis/wafeq-zatca-api.md) - [All operations](https://skmtc.dev/wafeq/apis/wafeq-zatca-api/llms.txt) - [OpenAPI document](https://skmtc.dev/wafeq/apis/wafeq-zatca-api/revisions/6b4a622bbb4f?raw)
