autopilot

Create Credit Note

Open a TD04 draft crediting one issued invoice (AP-090).

Omitting lines credits the whole document; passing them credits part of it. Either way the result is a draft: it is transmitted by POST /invoices/{id}/issue like any other, which is what keeps one number sequence per user and year and means a mistaken credit note can still be deleted before it exists to SdI.

Two status codes, and the split matters:

  • 404 — no invoice of that id for this caller. Unknown, somebody else's and soft-deleted stay indistinguishable, exactly as they do everywhere else on this router;
  • 409 — the id names a real invoice of theirs that cannot be credited: still a draft or in flight, rejected by SdI (that is a re-issue, not a credit), already a credit note itself, or already credited up to its own total. The store's own message is passed through here rather than replaced with one of ours, because each of those four says something different about what to do next and the row is one the caller can already read — so naming the reason leaks nothing a GET would not.

Carries the AP-099 write limiter: it writes a row and reads two aggregates, and it is the one write reachable against a document the caller can no longer edit.

post/api/autopilot/invoices/{invoice_id}/credit-note

Request

  • Base URL: https://api.taxcompass.it (the document declares no server; this is the origin it was published from)
  • URL: https://api.taxcompass.it/api/autopilot/invoices/{invoice_id}/credit-note
  • Auth: HTTP bearer

Path parameters

invoice_idstring uuid required

Request body

issue_datestring date nullable
causalestring nullable

Response

Successful Response

client_idstring uuid nullable
atecostring nullable
issue_datestring date nullable
due_datestring date nullable
causalestring nullable
idstring uuid required
yearinteger required
numberinteger nullable
doc_typestring
status'draft' | 'sending' | 'issued' | 'delivered' | 'not_delivered' | 'rejected' | 'error' | 'imported'
total_amountstring
bollo_appliedboolean
credit_note_ofstring uuid nullable
client_labelstring nullable
created_atstring date-time nullable
updated_atstring date-time nullable

Changes

No recorded changes to this operation across all 1 revision of this API.