---
title: "Convert a draft fattura into a scontrino"
method: POST
path: "/v1/invoices/{id}/convert-to-scontrino"
tags: ["Invoices"]
---

# Convert a draft fattura into a scontrino

`POST /v1/invoices/{id}/convert-to-scontrino`

## Request

- Base URL: `https://api.officina.it`
- URL: `https://api.officina.it/v1/invoices/{id}/convert-to-scontrino`
- Auth: HTTP bearer

Swaps a non-emessa, worksheet-backed draft invoice for a draft
scontrino on the same scheda lavoro — the same conversion the web
performs (POST /hx/private/invoices/{id}/convert-to-scontrino).

Payments move onto the new receipt; the source invoice is
soft-deleted; `worksheets.fiscal_document_type` flips to scontrino.
Line items are not copied (both documents project the worksheet).

No request body. Server re-validates every convertibility guard:
draft only, worksheet-backed, no blocking e-invoice (past draft),
no linked nota di credito, no ritenuta d'acconto.

Returns 422 when any guard fails. The invoice is gone after a
successful conversion — navigate to the returned receipt.

## Response `201`

The freshly created draft scontrino (full detail shape).

- Receipt: Receipt is the serialized form of entity.Receipt for the /v1/receipts endpoints. Same conventions as Invoice: money floats are display values, computed names are inlined, line_items appear on detail responses only.
  - `object` string, required: always "receipt"
  - `id` string, required
  - `title` string, nullable, required
  - `comments` string, nullable, required
  - `internal_comments` string, nullable, required: Optional — the electronic receipt PDF is delivered here.
  - `email` string, nullable, required
  - `customer_id` string, nullable, required
  - `vehicle_id` string, nullable, required
  - `worksheet_id` string, nullable, required
  - `sezionale_id` string, nullable, required
  - `seq_number` integer, required: Progressive number. 0 until the receipt is issued.
  - `type` string, required: Derived: "draft" | "issued" | "voided".
  - `status` string, required: "sale" | "return".
  - `issued_at` string, date-time, nullable, required
  - `voided_at` string, date-time, nullable, required
  - `payment_method` string, nullable, required
  - `total_before_tax` number, required
  - `total_tax` number, required
  - `total_after_tax` number, required
  - `total_discount` number, required
  - `total_after_discount` number, required
  - `total_payments` number, required
  - `outstanding_payments` number, required
  - `customer_name` string, nullable, required
  - `vehicle_name` string, nullable, required
  - `vehicle_license` string, nullable, required
  - `created_by_full_name` string, required
  - `sezionale_code` string, nullable, required: Latest electronic-receipt transmission (empty when none / module off).
  - `e_receipt_status` string, nullable, required
  - `e_receipt_document_number` string, nullable, required: ElectronicReceiptsEnabled — the company transmits scontrini to the AdE.
  - `electronic_receipts_enabled` boolean, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `deleted_at` string, date-time, nullable, required: Detail responses only.
  - `line_items` ReceiptLineItem[]
    - `object` string, required: always "receipt_line_item"
    - `id` string, required
    - `line_type` 'item' | 'note' | 'separator', required: `item` is a priced line. `note` is a description-only line and `separator` an empty spacer row: both print without quantity, price and VAT and carry zero amounts (ignore their numeric fields). Lines from documents without types report `item`.
    - `article_id` string, nullable, required
    - `description` string, required
    - `quantity` number, required
    - `unit_type` string, required
    - `unit_price` number, required
    - `unit_discount_rate` number, required
    - `tax_rate` number, required
    - `vat_code` string, nullable, required
    - `total_price` number, required
    - `created_at` string, date-time, required

## 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.
- `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)
