Skip to main content
Version: v2alpha1

Corrective invoices using the API

Steps

1. Create corrective invoice

The creation of the corrective invoice is the only step that differs from an standard invoice issuing. The difference relies on the additional parameters to be provided.

A corrective invoice add incremental changes or a complete replacement for one or several standard invoices. The standard invoice(s) are specified at precedings, indicating the id of the invoice(s) you are correcting paired with the reason for the correction. These preceding invoice(s) to correct must share the seller account, and the buyer account and they must be of type standard.

With correction_options you determine the type of a correction that will be either complete or partial:

  • complete corrects all the data of the preceding invoice replacing it completely. A complete corrective does not allow negative amounts as it is a replacement.
  • partial corrects only some of the data of the preceding invoice. The partial correction works incrementally, e.g., the reference invoice will remain valid, but any addition (or subtraction) of a line items in the correction is added to it. A partial correction allow negative amounts as it can be a deduction.

A part from the correction_options and the precedings, all remaining information can be populated/adjusted like for any standard invoice by calling POST /invoices indicating the invoice type as corrective. All webhooks apply the same too.

Buyer notifications or invoice documents to generate are not retrieved from the preceding invoices and they must be indicated in the corrective invoice request.

Invoices series are specified the same way but each series can generate sequenced codes for a different type of invoices, so you must create different series for standard and corrective invoices.

Request

POST /invoices
{
"type": "corrective",
"code": {
"type": "generated",
"series_id": "ser_4ehg1mkv3mvt3256vcn8dspb4h" // Invoices series for corrective invoices
},
"correction_options": {
"type": "partial" // Or "complete"
},
"precedings": [
{
"id": "inv_4ehg1mkv3mvt3256vcn8dspb4h",
"reason": "Deduction of services"
}
],
"buyer": {
"notifications": [
{
"type": "email",
"to": [
"invoices@buyer.com"
]
}
]
},
[...]
}

Response

201 Created
{
"id": "inv_4acf7aac20714d549b83261580",
"type": "corrective",
"status": "initiated",
[...]
}