Aller au contenu principal
Facturation

Créer un brouillon de facture

Crée un brouillon sur le dossier matterId, avec des activités déjà saisies (activityIds) et, dans le même appel, des lignes à créer (activities, même contrat que POST /v1/activities). Tout est créé, ou rien : si le brouillon est refusé, les lignes créées pour lui sont retirées. Créer des lignes exige activities:write et activities:view. Aucune facture n’est émise par l’API.

POST
/v1/invoices
Authorizationstringheaderobligatoire

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

idempotency-keystringheader

Clé de reprise choisie par le client (8 à 255 caractères). Quand elle est fournie, une reprise portant la même clé et la même charge ne crée rien : elle rend la ressource déjà créée, relue au moment de la reprise. La même clé sur une charge différente est refusée.

Corps

application/json
activitiesobject[]

Lignes à CRÉER dans le dossier puis à rattacher au brouillon, même contrat que POST /v1/activities (sans matterId, status, billable, billed). Tout ou rien : si le brouillon est refusé, ces lignes sont retirées. Exige activities:write.

Maximum array length: 200
activityIdsstring[]

Activités DÉJÀ saisies à rattacher au brouillon (toutes du dossier, encore facturables, de la même partie prenante). Elles sont réservées par le brouillon.

Maximum array length: 200
billingContactIdstringobligatoire
Motif: ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
currencyenum<string>default:EUR
Options disponibles: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SOS, SRD, SSP, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL
dueDatestring | nulldefault:null
Motif: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
freeTextstring | nulldefault:null
Maximum string length: 5000
fxRatenumber | null
Plage requise: 0 < x
fxRateSourceenum<string> | null
Options disponibles: ecb, manual
languageenum<string>default:fr
Options disponibles: fr, en
matterIdstringobligatoire
Motif: ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
paymentTermsenum<string> | nulldefault:null
Options disponibles: on_receipt, net_7, net_15, net_30, net_30_eom, net_45, net_45_eom, net_60, custom

Réponse

application/json
RateLimit-Limitintegerheader

Plafond de requêtes de la fenêtre d’une minute, pour le compteur le plus proche de sa limite (client ou cabinet).

RateLimit-Remainingintegerheader

Requêtes encore permises dans la fenêtre en cours.

RateLimit-Resetintegerheader

Secondes avant la remise à zéro du compteur.

ETagstringheader

Version de la ressource, opaque. À renvoyer dans If-Match pour qu’une modification soit refusée (412) si la ressource a changé depuis.

baseCurrencyenum<string>obligatoire

Devise de base du cabinet : celle de totals, des lignes, des avoirs, de remainingAmountCents, remainingNetCents et du amountCents des règlements. currency est celle du DOCUMENT.

Options disponibles: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SOS, SRD, SSP, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL
billingContactIdstring | nullobligatoire
Motif: ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
billingContactNamestring | nullobligatoire
createdAtstringobligatoire
Motif: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
createdBystring | nullobligatoire
Motif: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
createdByNamestring | nullobligatoire
creditNoteErrorstring | nullobligatoire
creditNoteNumberstring | nullobligatoire
creditNoteProviderIdstring | nullobligatoire
creditNoteReasonstring | nullobligatoire
creditNotesobject[]obligatoire
creditedAtstring | nullobligatoire
Motif: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
currencyenum<string>obligatoire
Options disponibles: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLE, SOS, SRD, SSP, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZWL
currencyRemainingAmountCentsinteger | nullobligatoire

Reste dû du document ; null si la devise est la base, ou inconnu. Entier en unités mineures de currency (devise du document).

Plage requise: -999999999999999 <= x <= 999999999999999
currencyTotalTtcCentsinteger | nullobligatoire

Total TTC du document ; null si la devise est la base, ou inconnu. Entier en unités mineures de currency (devise du document).

Plage requise: -999999999999999 <= x <= 999999999999999
documentsobject[]obligatoire
dueDatestring | nullobligatoire
Motif: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
einvoicingBusinessStateenum<string> | nullobligatoire
Options disponibles: pending, delivered, accepted, rejected, paid, not_transmitted
einvoicingInvoiceNumberstring | nullobligatoire
einvoicingProviderInvoiceIdstring | nullobligatoire
einvoicingStatusstring | nullobligatoire
einvoicingSubmittedAtstring | nullobligatoire
Motif: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
einvoicingSyncedAtstring | nullobligatoire
Motif: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
freeTextstring | nullobligatoire
fxRatenumber | nullobligatoire
Plage requise: 0 < x
fxRateSourceenum<string> | nullobligatoire
Options disponibles: ecb, manual
idstringobligatoire
Motif: ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
issueErrorstring | nullobligatoire
issuedAtstring | nullobligatoire
Motif: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
languageenum<string>obligatoire
Options disponibles: fr, en
linesobject[]obligatoire
matterIdstringobligatoire
Motif: ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
matterNamestring | nullobligatoire
matterReferencestring | nullobligatoire
paidAtstring | nullobligatoire
Motif: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
paymentStateenum<string> | nullobligatoire
Options disponibles: paid, partially_paid, unpaid, late, cancelled
paymentStatusenum<string> | nullobligatoire
Options disponibles: paid, partially_paid, unpaid, late, cancelled
paymentStatusRawstring | nullobligatoire
paymentSyncedAtstring | nullobligatoire
Motif: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
paymentTermsenum<string> | nullobligatoire
Options disponibles: on_receipt, net_7, net_15, net_30, net_30_eom, net_45, net_45_eom, net_60, custom
paymentsobject[]obligatoire
providerenum<string> | nullobligatoire
Options disponibles: pennylane, import, sellsy, qonto
providerInvoiceIdstring | nullobligatoire
providerInvoiceNumberstring | nullobligatoire
recurringPlanIdstring | nullobligatoire
Motif: ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
remainingAmountCentsinteger | nullobligatoire

Reste dû BRUT (avant avoirs) ; null = inconnu. Entier en unités mineures de baseCurrency.

Plage requise: -999999999999999 <= x <= 999999999999999
remainingNetCentsinteger | nullobligatoire

Reste dû NET des avoirs, plancher à zéro ; null = inconnu. Entier en unités mineures de baseCurrency.

Plage requise: -999999999999999 <= x <= 999999999999999
remindersobject[]obligatoire
remindersEnabledbooleanobligatoire
specialMentionstring | nullobligatoire
statusenum<string>obligatoire
Options disponibles: draft, issuing, issued, crediting, partially_credited, cancelled
totalsobjectobligatoire

Totaux de la facture. Entier en unités mineures de baseCurrency.

updatedAtstringobligatoire
Motif: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$