# Invoice on approval

> An n8n trigger on parcel.approved: you are told, and the invoice goes out with the parcel’s code as its reference. How to do it with colis, what to watch, and where it is written down.

Canonical: https://colis-site.vercel.app/en/use-cases/facturer-a-la-validation · Markdown: https://colis-site.vercel.app/en/use-cases/facturer-a-la-validation.md · Français: https://colis-site.vercel.app/use-cases/facturer-a-la-validation

An n8n trigger on parcel.approved: you are told, and the invoice goes out with the parcel’s code as its reference.

```text
Colis Trigger        events: parcel.approved
 ├─ Slack            "{{ $json.data.filename }} validé le {{ $json.data.decidedAt }}"
 │                   {{ $json.data.url }}
 └─ Invoicing node   reference: {{ $json.data.code }}

+ parcel.changes_requested
 └─ If {{ $json.type }}  →  {{ $json.data.comment }} to the freelancer
```

## What is actually going on.
### The problem
The client approves on a Tuesday evening, you notice on Thursday, the invoice leaves the week after. In between, nothing ties the approval to what you invoice.

### What colis does about it
A Colis Trigger on `parcel.approved` starts the workflow. In parallel: a Slack message or an email with the file name, the time of approval and the link; and the invoicing node you use, with the parcel’s code as its reference so the two can be matched. Add `parcel.changes_requested` and an If on the type to route the client’s comment to you instead.

## The things that are easy to get wrong.
- **The deployment does not subscribe on its own** — Paste the trigger’s production URL into `DROP_WEBHOOK_URL`, the same secret into `DROP_WEBHOOK_SECRET`, and redeploy.
- **Deduplicate on webhook-id** — An event is tried three times at most, and a retry carries the same id.
- **A receiver that stays down misses the event** — Nothing is replayed after the third attempt. `colis statut` is still there to check.

Packages: n8n-nodes-colis. [The n8n node, in full](https://github.com/mamadouwhile/colis/blob/main/packages/n8n-nodes-colis/README.md)
