niiko/developers

Kiipu · invoicing v1 current

kiipu.draft_voided

Voids a DRAFT invoice (one created with kiipu.invoice_proposed and not yet issued), by its id or by the client's name when it is their only draft. Does not void issued invoices: that is for a person in Kiipu.

Last updated

POST /api/v1/actions/kiipu.draft_voided
Key scope
kiipu.draft_voided@1
Workspace permission
api.kiipu.draft_voided off by default
Two permissions, not one

Both are needed: a key with that scope, and the workspace owner having switched the permission on. Holding the key is not enough — they are two decisions made by different people.

Request

fieldtyperules
invoiceIdstring (uuid)optional
clientstringoptionalmin 1 · max 200

Response — output when status is done

fieldtyperules
invoiceIdstringrequired
clientIdstringrequired
clientNamestringrequired
totalUsdstringrequired
status"void"required

Example

# One request, one idempotency key: retrying with the same key never runs twice.
curl -X POST https://niiko.org/api/v1/actions/kiipu.draft_voided \
  -H "Authorization: Bearer nk_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
# 200 → done · 202 → pending_approval (a person signs later) · 4xx → refused, with a named reason

Why it may refuse

Each reason names who can fix it and how. With reason stale, detail.message says what to do.

cliente_no_encontradocliente_ambiguodemasiados_clientesborrador_no_encontradovarios_borradoresno_es_borradorsin_permiso

In the clients

@vorluno/niiko-sdkniiko.voidedDraft()
niiko (Python)niiko.voided_draft()
niiko-cliniiko run kiipu.draft_voided
n8n-nodes-niikokiipuDraftVoided
niiko-mcp-serverkiipu_draft_voided

History