---
title: "Soft-delete a credit note"
method: DELETE
path: "/v1/credit-notes/{id}"
tags: ["CreditNotes"]
---

# Soft-delete a credit note

`DELETE /v1/credit-notes/{id}`

## Request

- Base URL: `https://api.officina.it`
- URL: `https://api.officina.it/v1/credit-notes/{id}`
- Auth: HTTP bearer

Stamps `deleted_at`; the row stays in the database, and
subsequent GET/PATCH/DELETE all 404.

If the credit note has an already-transmitted SDI electronic
counterpart, deletion would orphan the electronic document
and is refused with 409 `conflict`.

Returns the deleted resource (200) for shape consistency
and so the client can render an undo banner.

## Response `200`

Credit note soft-deleted.

- CreditNote: A credit note (nota di credito) — a derivative document created from a source invoice. Multi-tenant: belongs to one company. Totals mirror the source invoice and are not client-editable. The only mutable field is `title`.
  - `object` 'credit_note', required
  - `id` string, required
  - `invoice_id` string, required: Source invoice UUID. Immutable.
  - `seq_number` integer, nullable: Per-company / per-sezionale monotonic number. May be null on freshly created credit notes that have not yet been issued — clients render "Bozza" / draft when absent.
  - `title` string, nullable
  - `sezionale_id` string, nullable
  - `sezionale_code` string, nullable: Denormalized sezionale code for display. Read-only; mutate via `sezionale_id` at creation time.
  - `customer_name` string, required: Denormalized display string of the source invoice's customer.
  - `vehicle_name` string, required: Denormalized display string of the linked vehicle.
  - `vehicle_license` string, required
  - `sdi_status` string, required: Italian SDI e-invoice lifecycle status. Empty string when no e-credit-note exists.
  - `latest_sdi_status` string, required: Most recent terminal SDI status observed for this credit note's electronic counterpart.
  - `total_before_tax` number, double, required
  - `total_tax` number, double, required
  - `total_after_tax` number, double, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `deleted_at` string, date-time, nullable: Soft-deletion timestamp. Populated on the response from DELETE /v1/credit-notes/{id}. Credit notes with a non-null deleted_at are not returned by list/detail endpoints — this field appears for the delete response only.

## Other responses

- `401`: Missing, malformed, expired, or wrong-audience bearer token.
- `402`: The company has no active subscription, or its plan does not include API access. API access is included in the Business and Illimitato plans.
- `403`: The authenticated user lacks the required permission.
- `404`: Resource does not exist OR belongs to a different company. The two cases are intentionally indistinguishable.
- `409`: The request conflicts with the current state of the resource. Examples: issuing an invoice that has already been issued; back-dating an issuance that would violate the monotonic per-company sequence; deleting a credit note whose SDI electronic counterpart has already been transmitted and cannot be retracted; mutating a worksheet whose linked invoice has been issued (the worksheet is frozen — its totals are now part of the issued invoice's accounting record and must not desync).
- `500`: Unhandled server error. Detail is logged, not exposed.

---

[API](https://skmtc.dev/officina/apis/officina-it-api.md) · [All operations](https://skmtc.dev/officina/apis/officina-it-api/llms.txt) · [OpenAPI document](https://skmtc.dev/officina/apis/officina-it-api/revisions/7da3fccfe551?raw)
