Additional Expenses REST Endpoint

We’re happy to announce a new feature for Sales Invoices. It is now possible to include additional expenses, such as bank fees, delivery fees, etc., on an invoice. To start using additional expenses on your invoices, first of all, the new additional expense categories have to be created. Once created, additional expenses can be added to all new or existing draft invoices.

Create an additional expense

Creating a new additional expense requires 3 pieces of information:

  • Additional expense name
  • Account number (which the additional expense amount will be credited on to)
  • VAT code (which the VAT for the additional expense will be credited on to)
POST /additional-expenses

{
        "name": "Test",
        "account": {
                "accountNumber": 1220001
        },
        "vatAccount": {
                "vatCode": "V22"
        }
}

A successful response would contain the newly created resource:

{
        "name": "Test",
        "account": {
                "accountNumber": 1220001,
                "self": "https://rest.reviso.com/accounts/1220001"
        },
        "vatAccount": {
                "vatCode": "V22",
                "self": "https://rest.reviso.com/vat-accounts/V22"
        },
        "isSystemCreated": false,
        "additionalExpenseNumber": 1,
        "self": "https://rest.reviso.com/additional-expenses/5"
}

Please note that additionalExpenseNumber, which will be used to create additional expense lines on an invoice, has been generated automatically.

Update an additional expense

PUT /additional-expenses/:additionalExpenseNumber

Please note that any changes to additional expense would propagate to all the draft invoices that use that expense.

Delete an existing additional expense

DELETE /additional-expenses/:additionalExpenseNumber

Please note that additional expenses that are used on at least one draft invoice (meaning the additional expense line amount is not 0) cannot be deleted. In order to delete the additional expense, either book those draft invoices or set the additional expense line amounts to 0.

Add additional expense lines to a draft invoice

Additional expense lines can be added to a draft invoice by including an additionalExpenseLines collection on a request to the Invoices endpoint.

POST /v2/invoices/drafts

{
        "additionalExpenseLines": [
        {
            "additionalExpense": {
                "additionalExpenseNumber": 1
            },
            "lineNumber": 1,
            "amount": 10,
            "vatAmount": 2.2
        },
                {
            "additionalExpense": {
                "additionalExpenseNumber": 2
            },
            "lineNumber": 2,
            "amount": 15,
            "vatAccount": {
                "vatCode": "V5",
            },
        }
        ],
    ...
}

Please note:
* If vatAccount is supplied, it will override the VAT account set up on the additional expense.
* vatAmount field is not required; if omitted, VAT amount will be calculated by the system and included in the response body. However, if the VAT amount is supplied but is incorrect, the system will return a validation error.

Book an invoice with additional expenses

Send a POST request to /v2/invoices/booked

For additional information, please refer to the API docs or contact us at api@reviso.com.

Leave a reply