Stable Pro API · v1
Invoicing examples
Four complete cases: partial invoicing, a credit note, replacing a rejected document and an invoiced advance.
These examples show the order of calls to Stable Pro. All identifiers are fictional. Your connected software issues the documents; Stable Pro records their references. With EUR, amounts are in cents.
Before each issue, read the amount still available with GET /charges or GET /adjustments, reserve it with POST /external-documents/reservations and move the reservation to sending. Issue the document in your software only after POST /external-documents/reservations/{id}/sending returns 200. Use a new Idempotency-Key for each POST request. If you repeat the same request after losing its response, reuse the same key. See Connect invoicing software for the full flow.
Invoice a charge in two parts
Charge 11111111-1111-4111-8111-111111111111 is €100.00 and has amount_to_invoice: 10000. You want to issue a €60.00 invoice first.
- Reserve
6000cents. The201response contains the reservation id, here33333333-3333-4333-8333-333333333333.
{
"key": "invoice-part-1",
"covers": [
{
"object": "charge",
"id": "11111111-1111-4111-8111-111111111111",
"amount": 6000
}
]
}
- Call
POST /external-documents/reservations/{id}/sending. Only after a200response, issue the €60.00 invoice in your software. - Record it with
POST /external-documents, using the reservation id and the samecovers.
{
"external_id": "invoice-part-1",
"kind": "invoice",
"number": "FT-2026-001",
"issue_date": "2026-11-20",
"currency": "EUR",
"reservation_id": "33333333-3333-4333-8333-333333333333",
"covers": [
{
"object": "charge",
"id": "11111111-1111-4111-8111-111111111111",
"amount": 6000
}
]
}
Stable Pro returns 201, and the charge now has amount_to_invoice: 4000. For the remaining €40.00, read the charge again and repeat the three steps with a new reservation, a new document and new idempotency keys. The second document covers 4000, not 10000; the first stays recorded.
Record a credit note after a discount
An invoice has already been issued. Stable Pro then records a €15.00 discount: GET /adjustments returns adjustment aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa with amount_to_invoice: -1500. Your software decides how to issue the credit note under the applicable tax rules.
- Reserve the adjustment for
-1500, then callPOST /external-documents/reservations/{id}/sending.
{
"key": "credit-demo-001",
"covers": [
{
"object": "adjustment",
"id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
"amount": -1500
}
]
}
- After
sendingreturns200, issue the credit note in your software. Record it in Stable Pro withkind: credit_note,reservation_idand the same negative coverage.
{
"external_id": "credit-demo-001",
"kind": "credit_note",
"number": "NC-2026-001",
"issue_date": "2026-11-21",
"currency": "EUR",
"reservation_id": "cccccccc-cccc-4ccc-8ccc-cccccccccccc",
"covers": [
{
"object": "adjustment",
"id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
"amount": -1500
}
]
}
The example id cccccccc-cccc-4ccc-8ccc-cccccccccccc is returned by the reservation: use the actual id in a real request. The credit note covers the adjustment; it does not create another discount in Stable Pro. If it directly corrects an invoice already recorded, also read the corrects.id rules in Documents from connected software.
Replace a rejected document
The external software definitely rejects an invoice already recorded in Stable Pro. The original document has id eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee and covered €35.00 of charge bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb.
- Report the rejection with
POST /external-documents/{id}/status-changesand a newIdempotency-Key.
{
"status": "rejected"
}
- Read the charge again. When
amount_to_invoiceshows3500again, reserve that amount and move the new reservation tosending. - Issue the replacement in the external software and record it with a new
external_id. Pointreplaces_idto the rejected document.
{
"external_id": "invoice-replacement-001",
"kind": "invoice",
"number": "FT-2026-002",
"issue_date": "2026-11-22",
"currency": "EUR",
"reservation_id": "dddddddd-dddd-4ddd-8ddd-dddddddddddd",
"replaces_id": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee",
"covers": [
{
"object": "charge",
"id": "bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb",
"amount": 3500
}
]
}
The example id dddddddd-dddd-4ddd-8ddd-dddddddddddd also stands for the id returned by the new reservation. The rejected document remains in the history and no longer counts toward invoiced amounts. Its number may be reused, but the example uses a new number to make the replacement clear. For a cancelled document, the old number remains reserved.
Invoice an advance and deduct it in the final invoice
A customer pays a €100.00 advance with no charges. GET /payments shows a payment movement with money_amount: 10000 and customer_credit_amount: 10000; GET /credit-entries?payment=<id> shows credit entry 12121212-1212-4121-8121-121212121212, with source: "acconto_pagamenti" and invoiceable: true.
- If your software invoices the advance, reserve and record the advance invoice on the credit entry, with the same three steps as the other cases:
{
"external_id": "advance-001",
"kind": "invoice",
"number": "FT-2026-010",
"issue_date": "2026-12-01",
"currency": "EUR",
"reservation_id": "14141414-1414-4141-8141-141414141414",
"covers": [
{
"object": "credit_entry",
"id": "12121212-1212-4121-8121-121212121212",
"amount": 10000
}
]
}
-
Later a €60.00 lesson, charge
13131313-1313-4131-8131-131313131313, is paid with that credit. The charge showsamount_invoiced: 0,amount_invoiced_through_advance: 6000andamount_to_invoice: 0: it is already covered by the advance invoice, and Stable Pro does not ask for another invoice. On the credit entry,invoiced_breakdownison_charges: 6000andopen: 4000. -
If your software issues the final invoice for the lesson instead, the same invoice deducts the advance with a negative amount. Reserve and record both lines:
{
"external_id": "final-001",
"kind": "invoice",
"number": "FT-2026-011",
"issue_date": "2026-12-05",
"currency": "EUR",
"reservation_id": "15151515-1515-4151-8151-151515151515",
"covers": [
{
"object": "charge",
"id": "13131313-1313-4131-8131-131313131313",
"amount": 6000
},
{
"object": "credit_entry",
"id": "12121212-1212-4121-8121-121212121212",
"amount": -6000
}
]
}
Now the lesson has amount_invoiced: 6000 and amount_invoiced_through_advance: 0: the €60.00 are invoiced only once. If you record the final invoice without the negative line on the advance, the same amount is documented twice and the owner sees it among the accounting checks.
- If €30.00 of the advance still open are refunded to the customer,
GET /paymentsshows arefundwithmoney_amount: -3000andcustomer_credit_amount: -3000, and the advance hasinvoiced_breakdown.awaiting_correction: 3000. Record the credit note that corrects the advance invoice: it covers the advance with-3000and gives incorrects.idthe id of the advance invoice returned by Stable Pro. After the note,awaiting_correctiongoes back to0.