Factures
Créez, envoyez et gérez les factures. Montants en cents (CAD). Statuts : DRAFTSENTPAIDOVERDUE
GETLister les factures
GET/invoices
| Paramètre | Type | Description |
|---|---|---|
| page | integer | Numéro de page (défaut : 1) |
| limit | integer | Éléments par page, max 100 (défaut : 20) |
| search | string | Recherche dans numéro et titre de facture |
| status | string | Filtrer par DRAFT | SENT | PAID | OVERDUE |
| customerId | string | Filtrer par ID client |
| dueAfter | date-time | Factures à échéance après cette date |
| dueBefore | date-time | Factures à échéance avant cette date |
| sort | string | createdAt | -createdAt | dueDate | -dueDate | amount | -amount |
curl "https://paymavo.com/api/v1/invoices?status=SENT&limit=10" \
-H "Authorization: Bearer sk_live_xxx"GETObtenir une facture
GET/invoices/{id}
curl https://paymavo.com/api/v1/invoices/clx123 \
-H "Authorization: Bearer sk_live_xxx"POSTCréer une facture
POST/invoices
| Paramètre | Type | Description |
|---|---|---|
| customerId* | string | ID client |
| title* | string | Titre de la facture (max 200 car.) |
| items* | array | Lignes — chacune avec description, quantity (int), unitPrice (cents) |
| description | string | Description de la facture (max 1000 car.) |
| dueDate | date-time | Date d'échéance |
| paymentTerms | string | ex. Net 30 |
| notes | string | Notes internes (max 2000 car.) |
| paymentMethod | string | BANK_TRANSFER | ONLINE_PAYMENT (défaut : ONLINE_PAYMENT) |
| discountType | string | percentage | fixed |
| discountValue | integer | Montant de la remise (cents si fixed) |
curl -X POST https://paymavo.com/api/v1/invoices \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"customerId": "clx...",
"title": "Web development — March",
"dueDate": "2026-04-15T00:00:00.000Z",
"items": [
{ "description": "UI design", "quantity": 1, "unitPrice": 300000 },
{ "description": "Development", "quantity": 8, "unitPrice": 25000 }
]
}'PATCHModifier une facture
PATCH/invoices/{id}
Tous les champs sont optionnels. Impossible de modifier une facture PAID — l'API renvoie 409.
curl -X PATCH https://paymavo.com/api/v1/invoices/clx123 \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{ "dueDate": "2026-05-01T00:00:00.000Z" }'DELETESupprimer une facture
DELETE/invoices/{id}
L'API renvoie 204. Impossible de supprimer une facture PAYÉE.
curl -X DELETE https://paymavo.com/api/v1/invoices/clx123 \
-H "Authorization: Bearer sk_live_xxx"POSTEnvoyer une facture par courriel
POST/invoices/{id}/send
Génère le PDF et l'envoie par courriel au client. Passe le statut à SENT.
curl -X POST https://paymavo.com/api/v1/invoices/clx123/send \
-H "Authorization: Bearer sk_live_xxx"POSTMarquer une facture comme payée
POST/invoices/{id}/mark-as-paid
Enregistre paidAt et définit le statut à PAID.
curl -X POST https://paymavo.com/api/v1/invoices/clx123/mark-as-paid \
-H "Authorization: Bearer sk_live_xxx"POSTDupliquer une facture
POST/invoices/{id}/duplicate
Crée une copie identique avec un nouveau numéro, statut DRAFT, et déclenche un nouveau lien de paiement. L'API renvoie 201.
curl -X POST https://paymavo.com/api/v1/invoices/clx123/duplicate \
-H "Authorization: Bearer sk_live_xxx"GETObtenir le PDF de la facture
GET/invoices/{id}/pdf
Renvoie l'URL Cloudinary du PDF. Le PDF est généré et envoyé au premier appel.
curl "https://paymavo.com/api/v1/invoices/clx123/pdf" \
-H "Authorization: Bearer sk_live_xxx"Docs
Guides
Documentation API