Record payments
An issued invoice is settled only once its payment is recorded. By recording each payment in Scribee, you satisfy two obligations with a single entry: the invoice's collection status, which automatically moves to 212 Collected as soon as the invoice's settled amount reaches the amount due for payment, and the e-reporting declaration of payments for B2C and international B2B services invoices whose VAT is due on collection, when the issuing company is subject to that obligation. Your system captures the payment; Scribee derives the rest.
What Scribee does for you
- Automatic collection status: when the invoice's settled amount reaches
payable_amount, the invoice moves to212Collected, from any of the statuses where recording a payment is accepted - intermediate statuses are optional, an invoice in200Deposited status moves directly to212. If a correction or a deletion pushes the total back below that amount, the invoice stays212Collected: Scribee writes a corrective212event andremaining_amountshows the sum owed again (see A collected invoice stays collected). On a purchase invoice, no212event is written, neither at collection nor at its correction (see Pay a purchase invoice). - The amount to settle is the amount due for payment, not the total including tax: Scribee measures settlement against
payable_amount(BT-115, the amount due for payment), not againsttax_inclusive_amount(BT-112, the total including tax). On an invoice that carries no already-paid amount - the vast majority - the two values are equal and nothing changes for you. They diverge as soon as part of the invoice was collected at issuance: that amount is exposed underprepaid_amount(BT-113), andpayable_amountcarries only the rest. An invoice of35.11including tax whoseprepaid_amountis20.00has apayable_amountof15.11: it is settled by a15.11payment, andremaining_amountstarts at15.11, not35.11. If you reconcile your payments againstremaining_amount, compare it topayable_amount, never totax_inclusive_amount. - Deducted advances include their VAT: on an invoice from an accounting integration,
prepaid_amountrepresents the amount already paid including VAT in the invoice currency. For example, an advance of100.00excluding tax with20.00VAT represents120.00already paid. For an invoice total of240.00including tax without rounding,payable_amountis then120.00. Invoice VAT remains calculated before the advance is deducted. - A
payable_amountof0is a fully prepaid invoice: it is not a missing value.remaining_amountis then0from issuance and the invoice is considered settled without any payment being recorded. On invoices deposited by a Scribee accounting integration - never on an invoice created or imported through the partner API, even one declared already paid (Issue a sales invoice) - the move to212Collected is asynchronous: it happens once the invoice becomes eligible, never in the response to a call, and a status read straight afterwards can still be the previous one. The matching212event is dated from the collection; the collected amount is read underprepaid_amounton the invoice, never on the lifecycle event, and the payment list stays empty. The only missing-value case is apayable_amountofnull, which some imported invoices do not carry: Scribee then falls back totax_inclusive_amount. - The settled amount is not always the sum of your payments: on workspaces where early-payment discount handling is enabled, an applied discount counts toward the settled amount just like a payment. The invoice can therefore move to
212while the invoice'spaid_totalfield stays belowpayable_amount. The authoritative field isremaining_amount, which accounts for both; do not recompute the balance frompaid_totalalone. - What you still have to refund: when
payable_amountis negative, the seller owes the sum to the buyer, andremaining_amount, which never goes below0, is0there. The invoice'srefund_remaining_amountfield then gives what is still to be refunded: the absolute value ofpayable_amount, less the refunds recorded (see Refund a negative-amount invoice). It is0on any invoice whosepayable_amountis not negative. - Inherited currency:
currency_codeis never sent and cannot be changed; each payment takes on the invoice's currency, server-side. - Payment declaration kept up to date: for a sales invoice whose VAT tax point code is absent, equal to
72, or equal to432- the two codes name the same tax point, on two UNTDID lists -, or which is a down-payment invoice (retainer_invoice,self_billed_retainer_invoice) with a services framework (or a mixed one, on a B2C sale), whatever that code, and whose issuing company is subject to the payment reporting obligation on the payment date, every payment creation, correction, or deletion is reflected in the period's e-reporting declaration, broken down by VAT rate (see Declare payments). All three conditions must hold: any othertax_due_date_codeoutside down-payment invoices with a services framework (or a mixed one, on a B2C sale), any purchase invoice, and any VAT regime without a payment reporting obligation are excluded - with no error and no signal on the API side. A sale whose VAT breakdowns are all in categoryGorO, not subject to VAT in France, is excluded the same way. Correction and deletion do not behave the same way once the obligation goes away: moving an already-declared payment to a date not subject to it leaves the line on its original report, whereas deletion always removes it (Declare payments). Only the sales that e-reporting covers are declared - an international B2B sale, whose buyer is identified without a SIREN or carries a SIREN but is established outside the French VAT territory, or a B2C sale, whose buyer carries no identifier - and some sales are excluded as well whatever their tax-point code: a buyer identified by a SIREN or a SIRET and established in the French VAT territory, whose212Collected status declares the collection; a seller established in French Guiana, Mayotte, an overseas collectivity or the TAAF; a wholly reverse-charged sale; a delivery of goods, unless it is a down-payment invoice (retainer_invoiceorself_billed_retainer_invoice) - a sale under the margin scheme for second-hand goods, works of art, or collector's items stays excluded, down-payment invoices included. A sale is declared only for its breakdowns other thanAE,GandO, a double invoice only for its services share, and amounts are declared in euros, at the payment date's rate. When the declaration cannot be established, the payment is recorded with no declaration line, with no signal on the API side (Declare payments).
Record a payment
This call creates a payment on the invoice, in your production account. Nothing is transmitted to the invoice's recipient. For a sales invoice covered by the payments declaration (see above), the payment is added to its period's payments declaration, unless that declaration has already been transmitted: the write is then set aside, without failing the call (see Declare payments).
POST /api/v1/invoices/{invoice_id}/payments accepts amount and payment_date (required), plus payment_means_code, reference, note, payer_role, and allocations (optional, the last two described below). The token must carry the write scope. The invoice must be in one of the following statuses: 200 Deposited, 202 Received, 203 Made available, 204 Taken in charge, 205 Approved, 206 Partially approved, 207 Disputed, 208 Suspended, 211 Payment sent, or 212 Collected. Any other status - including 000 Draft, 210 Refused, 213 Rejected, 220 Cancelled, and 221 Routing error - is refused.
curl -X POST https://app.scribee.tech/api/v1/invoices/YOUR_INVOICE_ID/payments \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"payment": {
"amount": 1000.0,
"payment_date": "2025-01-10",
"payment_means_code": "30",
"reference": "VIR-2025-0110"
}
}'
The response is a 201 Created:
{
"data": {
"id": 87,
"amount": 1000.0,
"payment_date": "2025-01-10",
"payment_means_code": "30",
"currency_code": "EUR",
"reference": "VIR-2025-0110",
"note": null,
"payer_role": "buyer",
"allocations": [],
"created_at": "2025-01-10T09:15:00Z"
}
}
payment_means_code follows the UNTDID 4461 list restricted to the values 1, 10, 20, 30, 31, 48, 49, 57, 58, 59, and 97 - notably 30 bank transfer, 48 payment card, 49 direct debit, 58 SEPA credit transfer, 59 SEPA direct debit.
amount is stored exactly as you send it, or refused: it is never rounded. It has at most 6 decimals and 19 digits; a minus sign counts as one digit, the decimal point does not, and neither do trailing zeros in the decimal part. A decimal string is written with digits, an optional sign and a dot: a comma, exponent notation ("1e3"), NaN and Infinity are refused. A JSON number is judged on the decimal value it writes, read from your request with no float in between, under the same limits as a string. The rule applies at creation as on correction (see 422: amount out of precision below); amount must also stay strictly positive.
Partial payments are recorded the same way: several calls, one payment each. The invoice's status changes only once the cumulative total reaches the amount due for payment (payable_amount).
On a sales invoice, every payment nonetheless writes a 212 lifecycle event carrying its own amount, never the running paid total: Annexe 7 rule P1.15 declares the sum received at each collection, and a partial payment is a collection. So the two cases read differently:
- A payment that settles the invoice fires the
collecttransition:lifecycle_statemoves tocollectedand the event carries that payment's amount. - A partial payment writes its
212event without movinglifecycle_state. - A deleted or reduced payment writes a corrective
212event without movinglifecycle_state: acollectedinvoice stays so.
A 212 event in the history is therefore not enough to conclude that the invoice is collected, and lifecycle_state set to collected is not enough to conclude that it is settled. lifecycle_state tells you whether the invoice reached collection; remaining_amount tells you what is still owed, including after a collection is cancelled. If you would rather declare the collection yourself than derive it from a payment, the transition endpoint accepts collect with a collected_amount field; see The invoice lifecycle.
Transmission of the 212 event to the PPF (Portail Public de Facturation) is reserved for invoices whose VAT is due on collection: tax_due_date_code at 72 (or 432), any retainer invoice, or, without a tax_due_date_code, any invoice whose invoicing framework (BT-23) is not a goods framework (a code starting with B). An invoice whose tax_due_date_code is 5, 3, 29 or 35 does not declare its 212 events to the PPF.
Pay a purchase invoice
On a purchase invoice (direction: "purchases"), the same POST records the payment you make to the supplier and answers 201 Created. The Collected status (212) is the seller's, never the buyer's: the payment settles the invoice without declaring anything.
- No
212event is written, and nothing is sent to the PPF or to the supplier's platform. - When the payments settle the invoice,
lifecycle_statebecomescollected, with no event in the history. - Modifying or deleting the payment writes no
212event either. A deletion leaves the invoicecollected, andremaining_amountshows the sum owed again. - A payment recorded before this rule may have written its own
212event. Modifying or deleting it still writes a corrective212event in the history, delivered byinvoice.lifecycle_event.created, but nothing is sent to the PPF or to the supplier.
A self-billed purchase invoice you issued follows its own rule: a payment never moves it to Collected (Issue a self-billed invoice). The collect transition is refused on every purchase invoice (The invoice lifecycle).
Refund a negative-amount invoice
On a sales invoice - not a credit note - whose tax_inclusive_amount (BT-112) and payable_amount (BT-115) are both negative, the same POST records the refund the seller pays the buyer, in the same statuses as a payment, and answers 201 Created. amount stays positive: it is the sum refunded.
- Each refund writes a
212event with a negative amount, a décaissement within the meaning of Annexe 7 rule P1.17, whosereasoncarries the refund motif - like the settlement of a credit note. - When the refunds add up to the absolute value of
payable_amount, the invoice moves to212Collected:lifecycle_statebecomescollected. refund_remaining_amounttells you what is still to be refunded;remaining_amountstays0throughout.
On the purchase side, the same POST records the refund the supplier pays you, and answers 201 Created, on two documents: a purchase invoice - not a credit note - whose tax_inclusive_amount (BT-112) and payable_amount (BT-115) are both negative, and a purchase credit note. amount stays positive: it is the sum received.
- No
212event is written, as for any payment on a purchase invoice (see Pay a purchase invoice). - When the refunds settle the document,
lifecycle_statebecomescollected, with no event in the history. - On the negative-amount invoice,
refund_remaining_amounttells you what is still to be refunded to you andremaining_amountstays0throughout; on the credit note, it isremaining_amount. - Modifying or deleting that refund writes no
212event either. A deletion makes the document read as owed again.
The refund is refused with 422 on an invoice where only payable_amount is negative (tax_inclusive_amount positive) and on a credit note whose payable_amount is negative (see 422: refund not recordable below).
State the payer and the split by rate
By default, a payment is taken to be paid by the buyer, and Scribee itself spreads the amount of its 212 event across the invoice's VAT rates, pro rata. Two optional fields replace those two assumptions when they do not hold, typically when a share of the invoice is paid by a third party - an insurer, a body paying a subsidy, a set-off - and that share appears on the invoice under prepaid_amount (BT-113).
payer_role:buyer(the default) orthird_party_payer.third_party_payerdesignates the third party paying the share carried byprepaid_amount. The third party is not identified in the payment.allocations: a list ofvat_rate/amountblocks. When provided, it is exactly the split that this payment's212event declares, in place of the pro rata. When absent, the pro rata applies. Every payment returnspayer_roleandallocations, the latter empty when no split was provided.
Example: an invoice of 1200.00 including VAT at the 20 % rate, of which an insurer covers 900.00. It carries prepaid_amount at 900.00, hence payable_amount at 300.00. The buyer pays its 300.00 by declaring the total at the invoice's rate, minus the third party's share at rate 0:
curl -X POST https://app.scribee.tech/api/v1/invoices/YOUR_INVOICE_ID/payments \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"payment": {
"amount": 300.0,
"payment_date": "2025-01-10",
"payer_role": "buyer",
"allocations": [
{ "vat_rate": 20, "amount": 1200.0 },
{ "vat_rate": 0, "amount": -900.0 }
]
}
}'
The insurer pays its share, declared at rate 0:
curl -X POST https://app.scribee.tech/api/v1/invoices/YOUR_INVOICE_ID/payments \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"payment": {
"amount": 900.0,
"payment_date": "2025-01-12",
"payer_role": "third_party_payer",
"allocations": [
{ "vat_rate": 0, "amount": 900.0 }
]
}
}'
The following rules are checked on recording. A breach is refused with 422 and nothing is recorded:
- The blocks'
amountvalues add up exactly to the payment'samount. - Each
vat_rateis a rate carried by the invoice, or0. - A given
vat_rateappears at most once per sign: at rate0, one positive block and one negative block may coexist; no other rate repeats. - Each block
amountis non-zero, has at most two decimals, and can only be negative at rate0. A payment whoseamountcarries more than two decimals therefore cannot be split: its blocks would never add up to it exactly, and the first rule's refusal quotes the payment amount rounded to two decimals. - For the buyer, negative blocks at rate
0deduct the third party's share: their total, across all of the buyer's payments on the invoice, does not exceedprepaid_amount. - For
third_party_payer, the invoice must carry a strictly positiveprepaid_amount,allocationsis required and each of its blocks is positive, and the total of the third party's payments on the invoice does not exceedprepaid_amount.
What the payer changes:
- Every payment writes one
212event and only one, carrying its own amount, whether it comes from the buyer or from the third party. - On an invoice with an amount still due (
payable_amountgreater than zero), the third party's payment settles a share thatpayable_amountalready deducts: it writes its212, but never moves the invoice to212Collected and is not counted inpaid_total. Only the buyer's payments settlepayable_amount. - On a fully prepaid invoice (
payable_amountat0), the collection is recorded once, whoever the payer, and for exactlyprepaid_amount: a payment of another amount is refused, and so is a second payment. To correct it, modify or delete the existing payment.
View an invoice's payments
GET /api/v1/invoices/{invoice_id}/payments returns all of the invoice's payments, most recent first (payment_date, then created_at). The list is not paginated: no meta, no page parameter, no filter. The read scope is enough.
curl https://app.scribee.tech/api/v1/invoices/YOUR_INVOICE_ID/payments \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
"data": [
{
"id": 88,
"amount": 770.0,
"payment_date": "2025-01-20",
"payment_means_code": "59",
"currency_code": "EUR",
"reference": "PM0012ABCDEF",
"note": null,
"payer_role": "buyer",
"allocations": [],
"created_at": "2025-01-20T04:02:11Z"
},
{
"id": 87,
"amount": 1000.0,
"payment_date": "2025-01-10",
"payment_means_code": "30",
"currency_code": "EUR",
"reference": "VIR-2025-0110",
"note": null,
"payer_role": "buyer",
"allocations": [],
"created_at": "2025-01-10T09:15:00Z"
}
]
}
A single payment can be read at GET /api/v1/invoices/{invoice_id}/payments/{id}, with the same fields. amount is returned there at six decimals, as a JSON number, as it is in GET /api/v1/invoices/{id}?include=payments: past about 15 significant digits, the number read back is no longer exact.
Not every listed payment comes from you
The list also contains the payments Scribee recorded itself: a collected GoCardless direct debit, a bank reconciliation confirmed in the interface, a supplier payment batch marked processed (Payment batches). No field in the response indicates the source. Two hints only: a GoCardless direct debit carries payment_means_code 59 and a reference equal to the GoCardless payment identifier; a payment from bank reconciliation carries in reference the reference of its bank operation's accounting entry, BQ-YYYY-MM-NNNN: BQ, the entry's year and month - normally the operation's; a later correction of the operation's date does not change them -, then the operation's Scribee identifier - the one bank_operation_id returns - on at least four digits, for example BQ-2026-07-0144 (Bank accounting entries). A GoCardless payment disappears from the list when the customer's bank takes the direct debit back after its payout (Collect and refund by direct debit).
These payments used to carry a different reference. Those still carrying the value assigned when they were created have been moved to this format; their id has not changed. If you kept the former reference to find one of these payments, match it on its id from now on.
So do not assume every listed payment is deletable, or fully editable, and keep the identifiers returned by your own POST calls if you need to tell your entries apart from the others.
Correct a payment
This call updates the payment in place, declares the amount difference under a 212 event - positive if the payment grows, negative if it shrinks, none if it does not change, nor on a purchase invoice (Pay a purchase invoice) -, moves the invoice to 212 Collected if it is now settled, and recalculates, where applicable, the e-reporting declaration - the VAT-rate breakdown is recomputed, and the payment is moved to another period's declaration if payment_date changes. If the invoice has left the scope of the payments declaration since the payment was carried into it - buyer now identified by a SIREN and established in the French VAT territory, lines now all goods (unless it is a down-payment invoice, retainer_invoice or self_billed_retainer_invoice: a sale under the margin scheme for second-hand goods, works of art, or collector's items stays excluded, down-payment invoices included), VAT switched to reverse charge or, down-payment invoices with a services framework (or a mixed one, on a B2C sale) aside, to the debit option -, the correction removes the line from the declaration; if that declaration is closed, the removal is deferred (Declare payments). Exception: a payment from a confirmed bank reconciliation only accepts note, and that change recalculates nothing (see below).
PATCH /api/v1/invoices/{invoice_id}/payments/{id} accepts the same fields as creation; only the fields sent change. The response is a 200 carrying the updated payment. The token must carry the write scope.
payer_role cannot be changed: sending it back with the recorded value goes through, any other value is refused with 422 - delete the payment and record it again. allocations, when sent, replaces the payment's whole set of blocks; when omitted, the existing blocks are kept.
Changing amount on a payment that carries blocks requires sending allocations again: the kept blocks would no longer add up to the amount, and the request is refused with 422. When the split changes, the amount difference is no longer enough to describe it: Scribee writes a 212 event that cancels the previous one in full - the payment's amount before the change, with the opposite sign, with its blocks, if any, with the opposite sign -, then a 212 that declares the payment with its new split.
A payment from a GoCardless direct debit is only partly editable: amount, payment_date and payment_means_code are refused with a 422 (see below), and only reference and note stay editable. The refusal fires on the key being present in the payload, not on a value that differs: sending back the amount already recorded is refused too.
A payment from a confirmed bank reconciliation only accepts note: any other key is refused with a 422 dependent_records (see below), even when sent with the value already recorded, and the request is then refused whole - the note it carried is not applied either. A PATCH carrying only note changes the note and nothing else: the amount, the date, the reference, the invoice and the link to the bank operation stay as they are, the invoice's collection status does not move, no lifecycle event is recorded - so no invoice.lifecycle_event.created is emitted -, and neither the e-reporting declaration nor the operation's accounting entry is recalculated. This PATCH carries no version check: two concurrent note changes apply one after the other, and the last one wins.
curl -X PATCH https://app.scribee.tech/api/v1/invoices/YOUR_INVOICE_ID/payments/YOUR_PAYMENT_ID \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "payment": { "amount": 900.0 } }'
{
"data": {
"id": 87,
"amount": 900.0,
"payment_date": "2025-01-10",
"payment_means_code": "30",
"currency_code": "EUR",
"reference": "VIR-2025-0110",
"note": null,
"payer_role": "buyer",
"allocations": [],
"created_at": "2025-01-10T09:15:00Z"
}
}
Delete a payment
This call deletes the payment and removes the corresponding line from its period's payments declaration, with the same proviso for a declaration already transmitted. It never changes lifecycle_state: a 212 Collected invoice stays so, even if the total falls back below the amount due for payment (see A collected invoice stays collected).
The deletion writes a 212 event for the payment's amount, with the opposite sign; if the payment carried blocks, that event restates them, signs reversed. On a purchase invoice, it writes none, except for a payment that had written its own (Pay a purchase invoice).
DELETE /api/v1/invoices/{invoice_id}/payments/{id} responds 204 with no body. The token must carry destroy or write.
Three refusals are possible, 422: a payment from a GoCardless direct debit is never deletable, nor is a payment from a confirmed bank reconciliation, nor is a payment recorded by a payment batch marked processed. These cases are detailed below.
curl -X DELETE https://app.scribee.tech/api/v1/invoices/YOUR_INVOICE_ID/payments/YOUR_PAYMENT_ID \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
A collected invoice stays collected
Deleting a payment of a 212 Collected invoice, or reducing its amount, never moves the invoice backward. lifecycle_state stays collected, the invoice never moves back to 211 Payment sent, and the 212 events already written stay in the history. The cancellation is declared by a corrective 212 event, which follows the same transmission rules on the regulatory flows as any 212 (see above):
- On any other invoice, its amount is negative: it is the sum taken back, a décaissement within the meaning of Annexe 7 rule P1.17, and its
reasoncarries the cancellation motif. - On a credit note, or on a negative-amount invoice whose payment is a refund, the collection is negative: the correction is positive and carries no motif.
- Its VAT-rate breakdown follows the rule of any
212: the payment's blocks, signs reversed, or failing that the pro rata.
A payment on a purchase invoice, which declared no 212, declares none either when it is modified or deleted (see Pay a purchase invoice).
The balance tells you what is owed again: paid_total and remaining_amount no longer count the sum taken back. Read remaining_amount to know whether the invoice is still to be paid; lifecycle_state set to collected no longer tells you. A payment recorded later, or an amount raised by PATCH, writes a 212 event for the new sum only - positive, except on a credit note or on a negative-amount invoice whose payment is a refund, where it is negative and carries its motif; the invoice, already collected, does not change state.
On a negative-amount invoice, deleting a refund makes the invoice read as owed again: it is refund_remaining_amount that goes back up by the amount deleted, while remaining_amount stays 0.
Received self-billed invoice, offer without sales invoicing
A self-billed invoice received over the e-invoicing network, of which your company is the seller, stays readable even when the company's subscribed offer does not include sales invoicing. Its payments then stay open: you record, correct, and delete them as on any sales invoice, and a lowered amount or a deletion records a corrective 212. The other writes on this invoice depend on the offer (The invoice lifecycle).
What happens next
- Every
212event a payment writes - the move to212Collected, a partial payment, or a corrective event after a deletion or a reduction - is recorded on the invoice and triggers theinvoice.lifecycle_event.createdevent toward your notification endpoints (see Webhooks). The status details are in The invoice lifecycle. - For a B2C or international B2B sales invoice whose VAT is due on collection, and whose issuing company is subject to the payment reporting obligation, the payment is broken down by VAT rate, in euros, in its period's e-reporting declaration, created if necessary. Purchase invoices, sales carrying any other tax point code, down-payment invoices with a services framework (or a mixed one, on a B2C sale) aside, sales whose VAT breakdowns are all in category
GorO, and companies whose VAT regime does not carry that obligation give rise to no payment declaration: recording there only serves to track settlement. The exclusions specific to the sale - a buyer identified by a SIREN or a SIRET and established in the French VAT territory, whose212Collected status declares the collection, a seller established outside the VAT territory, a wholly reverse-charged sale, a delivery of goods (unless it is a down-payment invoice,retainer_invoiceorself_billed_retainer_invoice: a sale under the margin scheme for second-hand goods, works of art, or collector's items stays excluded, down-payment invoices included) - are detailed in Declare payments. - Nothing is transmitted to the DGFiP at the time of the call: the payment joins its period's declaration, or waits until it can be written again, and its content is described in Declare payments.
Errors and edge cases
401 Unauthorized
Missing, expired, or invalid token. Empty body; request a new token at /oauth/token (Authentication).
403 Forbidden: insufficient scope
Reads on this page require read. Creation and update require write; deletion accepts destroy or write. Request read write to cover every call on this page:
{
"error": "forbidden",
"message": "Vous n'êtes pas autorisé à effectuer cette action"
}
Request a new token with scope="read write" (Authentication).
An archived company (archived_at set) does not refuse the calls on this page: recording, correcting and deleting a payment stay open on its invoices, because they record or correct the collection (212) it still owes (Companies and establishments).
404 Not Found
Three causes: the invoice or the payment does not exist; the invoice belongs to a workspace outside your application's scope, or to one whose allowed-IP list rejects your call; the invoice is a sales invoice and the company's offer does not cover sales invoicing.
{
"error": "not_found",
"message": "La ressource demandée est introuvable"
}
A 404 on an identifier you know to be correct comes from the last two causes, not from a typo.
422: incompatible invoice status
A POST on an invoice that is not in one of the statuses listed above is refused:
{
"error": "unprocessable_entity",
"code": "validation_failed",
"message": "La validation a échoué",
"details": {
"base": ["Les paiements ne peuvent être enregistrés que sur des factures émises."]
}
}
Deposit the invoice first (Issue a sales invoice), then record the payment. PATCH and DELETE do not re-check the status: a payment already recorded stays editable if the invoice changes status afterwards.
422: refund not recordable
A POST on an invoice whose payable_amount is negative is refused when that payment cannot be a refund: only payable_amount is negative (tax_inclusive_amount positive), or the invoice is a credit note (see Refund a negative-amount invoice):
{
"error": "unprocessable_entity",
"code": "validation_failed",
"message": "La validation a échoué",
"details": {
"base": ["Un remboursement ne peut être enregistré que sur une facture dont le montant TTC (BT-112) est négatif, ou sur un avoir d'achat. Il est refusé sur une facture dont seul le net à payer (BT-115) est négatif et sur un avoir dont le net à payer est négatif."]
}
}
422: GoCardless payment
A payment created by the collection of a GoCardless direct debit is never deletable through the API:
{
"error": "unprocessable_entity",
"code": "validation_failed",
"message": "La validation a échoué",
"details": {
"base": ["Les paiements GoCardless ne peuvent pas être supprimés manuellement. Contactez le support si une correction est nécessaire."]
}
}
PATCH is blocked too, but only in part. As soon as the payload carries amount, payment_date or payment_means_code - the key being present is enough, the value sent is never compared with the recorded one:
{
"error": "unprocessable_entity",
"code": "validation_failed",
"message": "La validation a échoué",
"details": {
"base": ["Le montant, la date et le moyen de paiement d'un paiement GoCardless ne peuvent pas être modifiés. Seules la référence et la note peuvent être mises à jour."]
}
}
A PATCH carrying only reference and note goes through: they are local annotations, with no GoCardless counterpart.
422: payment from a bank reconciliation
A payment created by confirming a bank reconciliation cannot be deleted through this endpoint, and a PATCH carrying any key other than note is refused whole, even when that key carries the value already recorded. The response carries the code dependent_records and, in details.bank_operation_id, the Scribee identifier of the reconciled bank operation:
{
"error": "unprocessable_entity",
"code": "dependent_records",
"message": "Ce paiement provient d'une opération bancaire rapprochée et ne peut pas être supprimé. Contactez le support si une correction est nécessaire.",
"details": {
"base": ["Ce paiement provient d'une opération bancaire rapprochée et ne peut pas être supprimé. Contactez le support si une correction est nécessaire."],
"bank_operation_id": [30144]
}
}
The PATCH refusal has the same shape, with its own message:
{
"error": "unprocessable_entity",
"code": "dependent_records",
"message": "Le montant, la date, le moyen de paiement et la référence d'un paiement issu d'une opération bancaire rapprochée ne peuvent pas être modifiés. Seule la note peut être mise à jour.",
"details": {
"base": ["Le montant, la date, le moyen de paiement et la référence d'un paiement issu d'une opération bancaire rapprochée ne peuvent pas être modifiés. Seule la note peut être mise à jour."],
"bank_operation_id": [30144]
}
}
Nothing is written, and sending the same call again will be refused again. To undo this payment, undo the confirmed allocation that created it, and only that one:
- Find it with
GET /api/v1/bank_operations/{bank_operation_id}/allocationsfiltered bystatus=confirmedand byinvoice_document_idequal to this invoice's identifier (Listing allocations). Itsidis the allocation's identifier. - Undo it with
DELETE /api/v1/bank_operations/{bank_operation_id}/reconciliationwithallocation_idsnarrowed to thatid(Undoing a confirmation): the allocation becomesunconfirmedand its payment is removed as one act.
Do not omit allocation_ids. Without the key, every confirmed allocation on the operation is undone: on an operation split across several invoices, the other invoices' payments would be removed along with this one.
422: payment recorded by a batch marked processed
When a sepa_file payment batch is marked processed in the Scribee application, each of its instructions still in progress moves to settled, and the invoice it pays records a payment - unless the instruction pays no invoice, the invoice takes no payment, it owes nothing more or it is a supplier credit note (Payment batches). Such a payment cannot be deleted through this endpoint, and a PATCH carrying any key other than note is refused whole, as for a payment from a bank reconciliation. The response carries its own code, manual_settlement_payment, and its message in details.base; no bank operation is named:
{
"error": "unprocessable_entity",
"code": "manual_settlement_payment",
"message": "Ce paiement provient d'un lot SEPA marqué comme traité : il ne peut pas être supprimé ici. Il sera remplacé lorsque l'opération bancaire correspondante sera rapprochée du lot.",
"details": {
"base": ["Ce paiement provient d'un lot SEPA marqué comme traité : il ne peut pas être supprimé ici. Il sera remplacé lorsque l'opération bancaire correspondante sera rapprochée du lot."]
}
}
The PATCH refusal has the same shape, with its own message:
{
"error": "unprocessable_entity",
"code": "manual_settlement_payment",
"message": "Ce paiement provient d'un lot SEPA marqué comme traité : seule sa note peut être modifiée ici.",
"details": {
"base": ["Ce paiement provient d'un lot SEPA marqué comme traité : seule sa note peut être modifiée ici."]
}
}
Nothing is written. This payment is removed only when a bank operation is confirmed for the instruction that recorded it: the bank reconciliation's payment replaces it, and the invoice is paid once.
422: invalid fields
amount must be strictly positive, payment_date is required, and payment_means_code, if provided, must belong to the list of accepted codes. The messages arrive in details.base.
422: amount out of precision
An amount that would have to be rounded to be stored, at creation as on correction:
{
"error": "unprocessable_entity",
"code": "validation_failed",
"message": "La validation a échoué",
"details": {
"amount": ["comporte plus de 6 décimales"]
}
}
Unlike the other invalid fields, this refusal does not arrive in details.base but under details.amount. The message reads comporte plus de 6 décimales, comporte plus de 19 chiffres (un signe moins compte pour un) or n'est pas un nombre décimal (des chiffres, un signe facultatif et un point comme séparateur décimal). Nothing is stored: on a POST the payment is not created, and on a PATCH the stored amount stays unchanged.
422: payer or split refused
Each breached rule of the split by rate adds its message to details.base. On a fully prepaid invoice whose collection is already recorded, a second POST is refused like this:
{
"error": "unprocessable_entity",
"code": "validation_failed",
"message": "La validation a échoué",
"details": {
"base": ["Cette facture était déjà payée à son émission et son encaissement est déjà enregistré : corrigez ou supprimez ce paiement au lieu d'en ajouter un autre."]
}
}
A PATCH that changes payer_role is refused like this:
{
"error": "unprocessable_entity",
"code": "validation_failed",
"message": "La validation a échoué",
"details": {
"base": ["Le payeur d'un paiement enregistré ne peut pas être modifié. Supprimez le paiement puis enregistrez-le à nouveau."]
}
}
Related pages
- The invoice lifecycle - the details of statuses
211and212 - Receive supplier invoices - track settlement of your purchase invoices
- API reference: list an invoice's payments
- API reference: record a payment