Invoices
Invoices let you issue, send, and manage customer invoices programmatically. Each invoice generates a hosted payment link and can be sent automatically by email. It is linked to a Customer and can contain one or more product line items.
The standard flow is: create an invoice (draft) → finalize → send
by email → wait for payment (paid).
Lifecycle
| Status | Meaning | Available action |
|---|---|---|
draft | Draft — editable, not sent. | /finalize/ to move to open. |
open | Finalized — payment link active. | /send/, /pay/, /void/. |
paid | Settled — payment received. | No action available. |
void | Canceled — link disabled. | Create a new Invoice. |
uncollectible | Declared uncollectible. | Manual action only. |
Endpoints
| Méthode | Endpoint | Description |
|---|---|---|
| POST | /invoices/ | Create an invoice (draft status) |
| GET | /invoices/ | List invoices |
| GET | /invoices/{id}/ | Retrieve an invoice |
| PATCH | /invoices/{id}/ | Update a draft invoice |
| POST | /invoices/{id}/finalize/ | Finalize (draft → open) |
| POST | /invoices/{id}/send/ | Send by email to the Customer |
| POST | /invoices/{id}/void/ | Cancel an open invoice |
| POST | /invoices/{id}/pay/ | Mark as paid manually |
Object schema
Create an Invoice
Creates an invoice with draft status. At this stage, it is fully
editable. No email is sent and no payment link is active.
customerRequisID of the Customer the invoice is addressed to. The Customer’s email and name will be used on the PDF invoice and in the email sent.
line_itemsRequisInvoice line items. Each line contains either a product or a free-form amount, a quantity, and a price.
Each item must contain: product (ID of an existing Product)
or description + unit_amount for a
free-form line. quantity is a positive integer (default: 1). VAT is
calculated automatically based on your App’s configuration.
currencyOptionnelCurrency code for the invoice. By default, your App’s main currency is used.
due_dateOptionnelPayment due date. Displayed on the PDF invoice and in the email sent.
En savoir plus
If not provided, the due date is set to 30 days after the
finalization date (not the creation date). Once the due date has
passed, the invoice stays open — Sangho does not send automatic
reminders. You can implement reminders via the invoice.payment_overdue webhooks.
descriptionOptionnelSubject or description of the invoice. Appears in the header of the PDF invoice and in the email.
metadataOptionnelFree-form data — purchase order reference, contract number, etc.
Finalize, Send, Cancel
Finalize (/finalize/): locks the invoice and
generates the payment link. The invoice moves to open. The line items and the
total amount can no longer be modified.
Send (/send/): sends the invoice by email to the
Customer with the payment link and the PDF attached. Can be called
multiple times (manual reminder).
You can call /finalize/ followed immediately by /send/. Or
pass auto_send: true in the body of /finalize/ to trigger the send automatically upon finalization.
Cancel (/void/): permanently invalidates the invoice.
The payment link is disabled. Irreversible — create a new Invoice if
needed.