---
title: "Create a credit note from an invoice"
method: POST
path: "/v1/credit-notes"
tags: ["CreditNotes"]
---

# Create a credit note from an invoice

`POST /v1/credit-notes`

## Request

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

A credit note is a derivative document — every credit note
is created FROM an existing invoice. The body carries the
source `invoice_id` (required) plus optional `title` and
`sezionale_id`. All other fields (totals, customer, vehicle,
seq number, timestamps) are derived from the source invoice
or assigned server-side.

The source invoice MUST belong to the authenticated user's
company. Unknown / cross-tenant invoice_ids return 404.

## Request body

- CreditNoteCreateRequest: Body of `POST /v1/credit-notes`. Credit notes are derivative documents — created from an existing invoice. The source invoice MUST belong to the authenticated user's company. Server-derived / immutable fields are NOT accepted: `id`, `company_id` (from source invoice), `created_by` (from auth), `seq_number` (server-assigned), totals (copied from invoice), timestamps.
  - `invoice_id` string, required: Source invoice UUID (must belong to caller's company).
  - `title` string, nullable
  - `sezionale_id` string, nullable

## Response `201`

Credit note created.

- 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

- `400`: Request body is unparseable or X-API-Version is missing.
- `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.
- `415`: Content-Type is not `application/json`, or Accept rejects JSON.
- `422`: A request field is missing or invalid (fast-fail).
- `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)
