Envoyer une facture
Elle part chez le client par e-mail, avec votre mot s’il y en a un.
Un brouillon s’émet d’abord ; sans adresse, ou si l’e-mail ne passe pas, il reste émis et « sent_at » reste null — son lien se copie à la main. Déjà émise, elle repart : un client qui n’a rien reçu se relance. Une facture annulée ne part plus.
Les en-têtes
Ce qu’on envoie
Un corps JSON. Ce qui n’est pas requis peut être omis.
La demande
curl https://api.payiz.app/v1/invoices/fac_01j9xp6vb2n4rtw8kd3m/send \
-H "Authorization: Bearer sk_test_…" \
-H "Idempotency-Key: factures-envoyer-01" \
-H "Content-Type: application/json" \
-d '{
"message": "Bonjour Awa, voici la facture de vos pagnes."
}'La réponse
{
"object": "invoice",
"id": "fac_01j9xp6vb2n4rtw8kd3m",
"number": "FAC-2026-0045",
"customer": "cli_01j9xn4rt6m8wqv2hc5d",
"customer_name": "Awa Houénou",
"customer_email": "awa.h@exemple.bj",
"customer_phone": "+229 01 •• •• 21 07",
"status": "open",
"overdue": false,
"currency": "XOF",
"subtotal": 23000,
"total_discount": 1000,
"total_tax": 4140,
"total": 27140,
"fees_paid_by": "merchant",
"template": null,
"note": "Merci de votre confiance.",
"lines": [
{
"object": "invoice_line",
"id": "lgf_01j9xp8wd3k5tzm7qr2v",
"description": "Pagne wax 6 yards",
"detail": "bleu indigo",
"product": "prd_01j9xm2hp7t4wzq6vc3k",
"price": "prx_01j9xm3kq8v2tzr5wd7n",
"quantity": 2,
"unit_amount": 10000,
"discount": 0,
"tax_rate_bps": 1800,
"amount": 20000,
"tax": 3600
},
{
"object": "invoice_line",
"id": "lgf_01j9xp8wd3k5tzm7qr2w",
"description": "Retouches",
"detail": "ourlet et cintrage",
"product": null,
"price": null,
"quantity": 1,
"unit_amount": 4000,
"discount": 1000,
"tax_rate_bps": 1800,
"amount": 3000,
"tax": 540
}
],
"payment_link": "lnk_01j9xq2mt7c4vwd8hr5n",
"payment_url": "https://pay.payiz.app/l/fac-2026-0045-k3f8",
"payment": null,
"due_date": 1792594892,
"finalized_at": 1790002892,
"sent_at": 1790002893,
"paid_at": null,
"canceled_at": null,
"cancellation_reason": null,
"created": 1790002092,
"livemode": false
}Ce qu’on reçoit
200 · un objet invoice