Update invoice

An overview of the typical use case to update an invoice, to generate a new invoice for the customer and to correct taxes.

It can happen that invoices have been created but need to be updated due to changes on customer side (e.g. the customer has changed his address in between the order creation and the order invoicing date) or because of changes due to taxes (e.g. the tax rate has changed between the time when the order has been placed and when the product has been shipped or when the invoice has been created).

When updating invoice information, the following rules apply:

  • Important note: The customer identifier cannot be changed with this process.
  • Invoice positions can only be changed for order positions that have not yet been returned or received a goodwill (i.e. all positions within the order must be either delivered or cancelled).
  • In all cases, the gross price can be reduced but not increased

How it works

When updating an invoice, the following process steps will take place:

  1. (Prerequisite) Order has been placed following create webshop order.
  2. (Prerequisite) Order positions have been invoiced using create invoice for webshop order or cancelled using create cancellation.
  3. (Prerequisite) Order position has NOT yet been reduced by create goodwill or return webshop order.
  4. Customer requests change of status (e.g. from private to business customer) OR tax change between order creation and invoicing dates OR merchant needs to correct wrong invoices.
  5. Merchant passes change request to Accounting as a Service.
  6. Accounting as a Service adapts data according to received information and creates new customer invoice.
  7. Accounting as a Service corrects the tax booking if applicable.
  8. (Optional) Accounting as a Service refunds partial amounts to the end customer
High-level process description
An overview using BPMN to describe the process flow
Checkout the BPMN illustration to get an overview of the process, including the various activities and participating main actors.

How to implement

Update invoice

To update an invoice, make a PUT /accounting/{version}/businesses/{businessCode}/customers/{customerNumber}/orders/{orderReference}/invoices/{invoiceReference} request, where {businessCode} is the ID of the related business entity, {customerNumber} is the identifier of the affected customer, {orderReference} is the reference of the related order and invoiceReference is the reference (as indicated during the creation) of the invoice to be updated.

For more information, please refer to the related endpoint description within the API Explorer.

Sample request
POST /accounting/v1/businesses/1000/customers/TFI2021072801/orders/ODE12345678901/invoices/IDE12345678901 HTTP/1.1
Host: api-uat.accounting.riverty.io
X-Subscription-Key: YOUR_API_SUBSCRIPTION_TOKEN
Content-Type: application/json

{
    "goodwillReference": "GDE12345678901",
    "invoice": {
        "dispatchDate": "2018-11-06",
        "dueDate": "2018-11-05",
        "invoiceDate": "2018-11-04",
        "invoiceReference": "IDE12345678901",
        "items": [{
            "orderItemReference": 1
        }],
        "shipmentReference": "S01234567"
    },
    "order": {
        "billToAddress": {
            ...
        },
        "currency": "EUR",
        "orderType": "DIGITAL_GOODS",
        "orderDate": "2015-12-10T00:00:00.0000000",
        "items": [
            {
                "grossUnitPrice": 11.9,
                "orderItemReference": 1,
                "quantity": 1,
                "vatAmount": 1.9,
                "vatPercent": 19,
                "vatType": "NORMAL",
                "productId": "WKD12346512A/1",
                "description": "Best wishes (Digital card)",
                "positionType": "SALES_ARTICLE"
            }
        ],
        "orderReference": "ODE12345678901",
        "paymentReference": {
            ...
        },
        "processAfterDunning": "HAND_OVER_FOR_DEBT_COLLECTION",
        "orderChannel": "ECOM",
        "supplyingCountry": "DE",
        "vatDeclarationCountry": "DE"
    }
}
Sample response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "internalRequestId": "23c9579b-baaf-468f-a529-f876226e183c"
}

See also