Zum Inhalt

Reference

Invoices

GET/api/v1/invoicesList invoices

Lists invoices and drafts the way the invoice list does, newest first, 50 per page: number, company, order, date, gross, status and payment state. finance.manage only.scope invoices

Query

statusone of draft, issuing, issued, cancelled[]
querystringWords to find in number, company, order or customer reference.
pageinteger1-based page of 50 rows. Omit for the first page.

Response 200

items[]object[]
items[].idstring
items[].numberstring | null
items[].companystring
items[].orderstring | null
items[].invoice_datestring | null
items[].gross_centsinteger | null
items[].statusone of draft, issuing, issued, cancelled
items[].paymentone of unsent, open, partially_paid, paid, overdue, cancelled | null
items[].urlstring
pageinteger
totalinteger
has_moreboolean
Schema
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "company": {
            "type": "string"
          },
          "order": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoice_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "gross_cents": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "issuing",
              "issued",
              "cancelled"
            ]
          },
          "payment": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "unsent",
                  "open",
                  "partially_paid",
                  "paid",
                  "overdue",
                  "cancelled"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "number",
          "company",
          "order",
          "invoice_date",
          "gross_cents",
          "status",
          "payment",
          "url"
        ],
        "additionalProperties": false
      }
    },
    "page": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "total": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "has_more": {
      "type": "boolean"
    }
  },
  "required": [
    "items",
    "page",
    "total",
    "has_more"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

POST/api/v1/invoicesCreate invoice draft

Creates an invoice draft, as the signed-in person -- never issued; a person reviews and issues it on the page the answer links. source "contract": the due charges of an order's sales contract, all of them or the keys from list_invoice_sources. source "service_report": one issued service report, as a whole. source "free": an empty draft for a company (an active customer), with a business unit and optionally an order of that company; add its lines with update_invoice_draft. finance.manage only.scope invoices

Body (JSON)

sourcerequiredone of contract, service_report, free
orderstringOrder id or number. Required for "contract"; optional for "free".
keysstring[]"contract" only: charge keys from list_invoice_sources. Default: every due charge.
service_reportstring"service_report" only: the report's id or number.
companystring"free" only: the company's id (search_companies).
business_unitstring"free" only: name or id of a business unit (list_business_units). Default: the default unit.

Response 200

idstring
numberstring | null
kindstring
statusone of draft, issuing, issued, cancelled
paymentone of unsent, open, partially_paid, paid, overdue, cancelled | null
invoice_datestring | null
companystring
orderstring | null
business_unitstring | null
customer_referencestring | null
lines[]object[]
lines[].idstring
lines[].positioninteger
lines[].sourcestring
lines[].namestring
lines[].descriptionstring | null
lines[].period_fromstring | null
lines[].period_tostring | null
lines[].quantitystring
lines[].unitstring
lines[].unit_price_centsinteger
lines[].net_centsinteger
totalsobject
totals.net_centsinteger
totals.vat_centsinteger
totals.gross_centsinteger
payments[]object[]
payments[].idstring
payments[].paid_onstring | null
payments[].amount_centsinteger
payments[].notestring | null
payments[].originone of hand, bank, reversal, cancellation
payments[].bank_transaction_idstring | null
payments[].cancelledobject | null
payments[].cancelled.onstring | null
payments[].cancelled.bystring
payments[].cancelled.reasonstring
urlstring
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "number": {
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "issuing",
        "issued",
        "cancelled"
      ]
    },
    "payment": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "unsent",
            "open",
            "partially_paid",
            "paid",
            "overdue",
            "cancelled"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "invoice_date": {
      "type": [
        "string",
        "null"
      ]
    },
    "company": {
      "type": "string"
    },
    "order": {
      "type": [
        "string",
        "null"
      ]
    },
    "business_unit": {
      "type": [
        "string",
        "null"
      ]
    },
    "customer_reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "source": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "period_from": {
            "type": [
              "string",
              "null"
            ]
          },
          "period_to": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "unit_price_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "net_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "position",
          "source",
          "name",
          "description",
          "period_from",
          "period_to",
          "quantity",
          "unit",
          "unit_price_cents",
          "net_cents"
        ],
        "additionalProperties": false
      }
    },
    "totals": {
      "type": "object",
      "properties": {
        "net_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "vat_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "gross_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "net_cents",
        "vat_cents",
        "gross_cents"
      ],
      "additionalProperties": false
    },
    "payments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "paid_on": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "origin": {
            "type": "string",
            "enum": [
              "hand",
              "bank",
              "reversal",
              "cancellation"
            ]
          },
          "bank_transaction_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "cancelled": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "on": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "by": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "on",
                  "by",
                  "reason"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "paid_on",
          "amount_cents",
          "note",
          "origin",
          "bank_transaction_id",
          "cancelled"
        ],
        "additionalProperties": false
      }
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "number",
    "kind",
    "status",
    "payment",
    "invoice_date",
    "company",
    "order",
    "business_unit",
    "customer_reference",
    "lines",
    "totals",
    "payments",
    "url"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

GET/api/v1/invoices/{id}Get invoice

One invoice or draft with its lines, totals, status and payment state, and the page to review it on. finance.manage only.scope invoices

Path

idrequiredstringThe invoice's id, or its number once issued.

Response 200

idstring
numberstring | null
kindstring
statusone of draft, issuing, issued, cancelled
paymentone of unsent, open, partially_paid, paid, overdue, cancelled | null
invoice_datestring | null
companystring
orderstring | null
business_unitstring | null
customer_referencestring | null
lines[]object[]
lines[].idstring
lines[].positioninteger
lines[].sourcestring
lines[].namestring
lines[].descriptionstring | null
lines[].period_fromstring | null
lines[].period_tostring | null
lines[].quantitystring
lines[].unitstring
lines[].unit_price_centsinteger
lines[].net_centsinteger
totalsobject
totals.net_centsinteger
totals.vat_centsinteger
totals.gross_centsinteger
payments[]object[]
payments[].idstring
payments[].paid_onstring | null
payments[].amount_centsinteger
payments[].notestring | null
payments[].originone of hand, bank, reversal, cancellation
payments[].bank_transaction_idstring | null
payments[].cancelledobject | null
payments[].cancelled.onstring | null
payments[].cancelled.bystring
payments[].cancelled.reasonstring
urlstring
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "number": {
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "issuing",
        "issued",
        "cancelled"
      ]
    },
    "payment": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "unsent",
            "open",
            "partially_paid",
            "paid",
            "overdue",
            "cancelled"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "invoice_date": {
      "type": [
        "string",
        "null"
      ]
    },
    "company": {
      "type": "string"
    },
    "order": {
      "type": [
        "string",
        "null"
      ]
    },
    "business_unit": {
      "type": [
        "string",
        "null"
      ]
    },
    "customer_reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "source": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "period_from": {
            "type": [
              "string",
              "null"
            ]
          },
          "period_to": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "unit_price_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "net_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "position",
          "source",
          "name",
          "description",
          "period_from",
          "period_to",
          "quantity",
          "unit",
          "unit_price_cents",
          "net_cents"
        ],
        "additionalProperties": false
      }
    },
    "totals": {
      "type": "object",
      "properties": {
        "net_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "vat_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "gross_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "net_cents",
        "vat_cents",
        "gross_cents"
      ],
      "additionalProperties": false
    },
    "payments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "paid_on": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "origin": {
            "type": "string",
            "enum": [
              "hand",
              "bank",
              "reversal",
              "cancellation"
            ]
          },
          "bank_transaction_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "cancelled": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "on": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "by": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "on",
                  "by",
                  "reason"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "paid_on",
          "amount_cents",
          "note",
          "origin",
          "bank_transaction_id",
          "cancelled"
        ],
        "additionalProperties": false
      }
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "number",
    "kind",
    "status",
    "payment",
    "invoice_date",
    "company",
    "order",
    "business_unit",
    "customer_reference",
    "lines",
    "totals",
    "payments",
    "url"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

PATCH/api/v1/invoices/{id}Update invoice draft

Changes a draft: adds free lines, removes lines, sets the customer reference, and on a free draft the business unit -- any of them, at least one. Every new line is checked first; if one is refused, nothing is written. Drafts only; a cancellation draft takes only a customer reference. finance.manage only.scope invoices

Path

idrequiredstringThe draft's id.

Body (JSON)

add_lines[]object[]
add_lines[].namerequiredstring
add_lines[].descriptionstring
add_lines[].period_fromrequiredstringYYYY-MM-DD.
add_lines[].period_torequiredstringYYYY-MM-DD, not before period_from.
add_lines[].quantityrequiredstringDecimal, at most two places, e.g. "2" or "7.5"; hours only in quarter hours.
add_lines[].unitrequiredone of HUR, C62, MON, DAY
add_lines[].unit_pricerequiredstringNet euros per unit, e.g. "750.00" or "750,00".
remove_linesstring[]Line ids from get_invoice.
customer_referencestringThe customer's own reference; empty clears it.
business_unitstringA free draft's business unit: name or id (list_business_units).

Response 200

idstring
numberstring | null
kindstring
statusone of draft, issuing, issued, cancelled
paymentone of unsent, open, partially_paid, paid, overdue, cancelled | null
invoice_datestring | null
companystring
orderstring | null
business_unitstring | null
customer_referencestring | null
lines[]object[]
lines[].idstring
lines[].positioninteger
lines[].sourcestring
lines[].namestring
lines[].descriptionstring | null
lines[].period_fromstring | null
lines[].period_tostring | null
lines[].quantitystring
lines[].unitstring
lines[].unit_price_centsinteger
lines[].net_centsinteger
totalsobject
totals.net_centsinteger
totals.vat_centsinteger
totals.gross_centsinteger
payments[]object[]
payments[].idstring
payments[].paid_onstring | null
payments[].amount_centsinteger
payments[].notestring | null
payments[].originone of hand, bank, reversal, cancellation
payments[].bank_transaction_idstring | null
payments[].cancelledobject | null
payments[].cancelled.onstring | null
payments[].cancelled.bystring
payments[].cancelled.reasonstring
urlstring
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "number": {
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "issuing",
        "issued",
        "cancelled"
      ]
    },
    "payment": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "unsent",
            "open",
            "partially_paid",
            "paid",
            "overdue",
            "cancelled"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "invoice_date": {
      "type": [
        "string",
        "null"
      ]
    },
    "company": {
      "type": "string"
    },
    "order": {
      "type": [
        "string",
        "null"
      ]
    },
    "business_unit": {
      "type": [
        "string",
        "null"
      ]
    },
    "customer_reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "source": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "period_from": {
            "type": [
              "string",
              "null"
            ]
          },
          "period_to": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "unit_price_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "net_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "position",
          "source",
          "name",
          "description",
          "period_from",
          "period_to",
          "quantity",
          "unit",
          "unit_price_cents",
          "net_cents"
        ],
        "additionalProperties": false
      }
    },
    "totals": {
      "type": "object",
      "properties": {
        "net_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "vat_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "gross_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "net_cents",
        "vat_cents",
        "gross_cents"
      ],
      "additionalProperties": false
    },
    "payments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "paid_on": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "origin": {
            "type": "string",
            "enum": [
              "hand",
              "bank",
              "reversal",
              "cancellation"
            ]
          },
          "bank_transaction_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "cancelled": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "on": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "by": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "on",
                  "by",
                  "reason"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "paid_on",
          "amount_cents",
          "note",
          "origin",
          "bank_transaction_id",
          "cancelled"
        ],
        "additionalProperties": false
      }
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "number",
    "kind",
    "status",
    "payment",
    "invoice_date",
    "company",
    "order",
    "business_unit",
    "customer_reference",
    "lines",
    "totals",
    "payments",
    "url"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

DELETE/api/v1/invoices/{id}Delete invoice draft

Deletes a draft outright. An issued invoice is never deleted: it is cancelled, by a person, in nxva.base. finance.manage only.scope invoices

Path

idrequiredstringThe draft's id.

Response 200

idstring
deletedboolean
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "deleted": {
      "type": "boolean",
      "const": true
    }
  },
  "required": [
    "id",
    "deleted"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

GET/api/v1/invoices/{id}/checkCheck invoice

Runs the check the draft page runs before issuing: what is missing on the company profile, the customer or the lines (problems, which block issuing), what a person should look at (warnings), and the e-invoice validation of the rendered document. Changes nothing; takes a few seconds. A clean result is what a person needs before issuing on the page.scope invoices

Path

idrequiredstringThe draft's id.

Response 200

readyboolean
problems[]object[]
problems[].codestring
problems[].messagestring
warnings[]object[]
warnings[].codestring
warnings[].messagestring
validationobject | null
validation.statusone of valid, invalid, unavailable
validation.errorsstring[]
validation.noticesstring[]
urlstring
Schema
{
  "type": "object",
  "properties": {
    "ready": {
      "type": "boolean"
    },
    "problems": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      }
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      }
    },
    "validation": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "valid",
                "invalid",
                "unavailable"
              ]
            },
            "errors": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "notices": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "status",
            "errors",
            "notices"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "ready",
    "problems",
    "warnings",
    "validation",
    "url"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.

POST/api/v1/invoices/{id}/paymentsRecord payment

Records a payment received for an issued invoice: the day, the gross amount in cents (negative for a refund), and a note. Payments are recorded by hand and are never deducted automatically; a recorded one is corrected by cancel_payment and recording it again. Only an issued invoice that no cancellation corrects.scope invoices

Path

idrequiredstringThe invoice's id or number, e.g. "RE-2026-0042".

Body (JSON)

paid_onrequiredstringYYYY-MM-DD, not in the future.
amount_centsrequiredintegerGross, in cents; negative for a refund.
notestring

Response 200

idstring
numberstring | null
kindstring
statusone of draft, issuing, issued, cancelled
paymentone of unsent, open, partially_paid, paid, overdue, cancelled | null
invoice_datestring | null
companystring
orderstring | null
business_unitstring | null
customer_referencestring | null
lines[]object[]
lines[].idstring
lines[].positioninteger
lines[].sourcestring
lines[].namestring
lines[].descriptionstring | null
lines[].period_fromstring | null
lines[].period_tostring | null
lines[].quantitystring
lines[].unitstring
lines[].unit_price_centsinteger
lines[].net_centsinteger
totalsobject
totals.net_centsinteger
totals.vat_centsinteger
totals.gross_centsinteger
payments[]object[]
payments[].idstring
payments[].paid_onstring | null
payments[].amount_centsinteger
payments[].notestring | null
payments[].originone of hand, bank, reversal, cancellation
payments[].bank_transaction_idstring | null
payments[].cancelledobject | null
payments[].cancelled.onstring | null
payments[].cancelled.bystring
payments[].cancelled.reasonstring
urlstring
Schema
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "number": {
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "issuing",
        "issued",
        "cancelled"
      ]
    },
    "payment": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "unsent",
            "open",
            "partially_paid",
            "paid",
            "overdue",
            "cancelled"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "invoice_date": {
      "type": [
        "string",
        "null"
      ]
    },
    "company": {
      "type": "string"
    },
    "order": {
      "type": [
        "string",
        "null"
      ]
    },
    "business_unit": {
      "type": [
        "string",
        "null"
      ]
    },
    "customer_reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "source": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "period_from": {
            "type": [
              "string",
              "null"
            ]
          },
          "period_to": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "unit_price_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "net_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "position",
          "source",
          "name",
          "description",
          "period_from",
          "period_to",
          "quantity",
          "unit",
          "unit_price_cents",
          "net_cents"
        ],
        "additionalProperties": false
      }
    },
    "totals": {
      "type": "object",
      "properties": {
        "net_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "vat_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "gross_cents": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "net_cents",
        "vat_cents",
        "gross_cents"
      ],
      "additionalProperties": false
    },
    "payments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "paid_on": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "origin": {
            "type": "string",
            "enum": [
              "hand",
              "bank",
              "reversal",
              "cancellation"
            ]
          },
          "bank_transaction_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "cancelled": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "on": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "by": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "on",
                  "by",
                  "reason"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "paid_on",
          "amount_cents",
          "note",
          "origin",
          "bank_transaction_id",
          "cancelled"
        ],
        "additionalProperties": false
      }
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "number",
    "kind",
    "status",
    "payment",
    "invoice_date",
    "company",
    "order",
    "business_unit",
    "customer_reference",
    "lines",
    "totals",
    "payments",
    "url"
  ],
  "additionalProperties": false
}

Refusals are problems with a code — see Errors.