Créer une facture récurrente
POST /firms/FIRM_ID/recurring_invoices.json
Création d’une nouvelle facture. On obtient en retour le code JSON de l’enregistrement créé, avec l’ID qui lui a été attribué.
Une facture doit au moins contenir une ligne de facturation (champs items)
Le total de chaque ligne de facturation ainsi que le total de la facture sont calculés automatiquement et ne doivent pas être transmis.
Requête
curl -i -S -u IdentifiantApi:CleApi -H 'User-Agent: MonApp (patrick@seniordev.test)' \
-H 'Content-Type: application/json; charset=utf-8' \
-X POST -d '{
"frequency": "30",
"draft": "0",
"customer_id": "1",
"next_run_on": "2026-09-09",
"currency": "EUR",
"title": "Emplacement publicitaire",
"items": [
{
"position": "1",
"style": "",
"title": "Affichage publicité",
"product_id": "",
"quantity_measure": "1",
"vat": "0.2",
"unit_price": "250",
"nature": "9"
}
],
"rebate_percentage": "0",
"language": "fr",
"pay_before": "30",
"mailing": "1",
"email": {
"to": "laurent@test.com",
"cc": "",
"bcc": "",
"subject": "Votre facture",
"message": "Bonjour\r\n\r\nVeuillez trouver ci-joint la facture %{reference} à régler avant le %{echeance}.\r\nEn vous remerciant,\r\n\r\nCordialement,\r\nAds Corp"
}
}' \
"https://www.facturation.pro/firms/FIRM_ID/recurring_invoices.json"
Réponse
Status: 201 Created
Location: /firms/FIRM_ID/invoices/1.json
{
"api_custom": null,
"api_id": null,
"category_id": null,
"currency": "EUR",
"customer_id": 180366,
"external_ref": null,
"discount": null,
"draft": false,
"id": 411588,
"information": null,
"invoice_ref": "201307-4",
"invoiced_on": "2013-07-29",
"language": "fr",
"paid_on": null,
"pay_before": "60fm",
"payment_mode": 0,
"payment_ref": null,
"penalty": "0.0",
"precompte": null,
"quote_id": null,
"rebate_percentage": "0.0",
"service_personne": false,
"tax_percent": null,
"tax_title": null,
"term_on": "2013-09-30",
"title": "Facturation mensuelle",
"total": "700.0",
"vat_exemption": null,
"items": [
{
"id": 949167,
"nature": 9,
"optional": false,
"position": 1,
"product_id": null,
"quantity": "1.0",
"style": null,
"title": "Affichage pub 1",
"total": "500.0",
"unit_price": "500.0",
"vat": "0.200"
},
{
"id": 949168,
"nature": 9,
"optional": false,
"position": 2,
"product_id": null,
"quantity": "1.0",
"style": null,
"title": "Affichage pub 2",
"total": "200.0",
"unit_price": "200.0",
"vat": "0.200"
}
]
}