Skip to main content

Invoices

CreateInvoice

In order to create an invoice, use CreateInvoice. This is the first step in creating the invoice. In this step, the different lines of the invoice are defined. As you can see in the example below, the creditor OU as well as the debtor OU are defined here as well.

{
"Type": 1, // Check
"OrganizationUnitID": 3, // Debtor OU
"InvoiceDate": "2021-06-02", // Invoice date
"InvoiceNumber": 2222333, // InvoiceNumber (creditors number)
"Description": "xxxx", // Description
"OriginalTotalAmount": 563.26, // Amount in tax
"PaymentTermStartDate": "2021-06-08", // Bookingsdate of the invoice
"SupplierOrganizationUnitID": 70, // Creditor
"TaxReverseCharge": false // If on the invoice reverse charge is applicable
}

This service responds with the invoice ID, which can then be used to create the invoice amounts.

CreateInvoiceAdditionalAmount

With this service the amount can be booked on an invoice and a specified InvoiceAmountType.

{
"Amount": 465.5, // Amount without tax
"OriginalAmount": 465.5, // Original amount without tax
"InvoiceID": 82217, // Invoice id from the Create Invoice Service
"TaxCodeID": 1, // Tax code
"TypeID": 3 // Type of the amount, 3 is Cost of Goods
}

The additional amount is the amount excluding taxes, but including a TaxCodeID. The typeID refers to the type of amount booked.

ListShipmentsToInvoice

This service can be called to check those shipments which are not matched against an invoice yet.

{
"PageConfig": {
"Start": 0,
"Filter": {
"ShipFromOrganizationUnitID": 70
},
"Limit": 5
}
}

CreateInvoiceLines

The CreateInvoiceLines service makes sure that the shipment lines are matched against the invoice amount.

Take note: this is the point where disputes can arise. Mismatches can be found in either quantities or amounts. The lines could be an array of lines on the same shipment. The service expects a match against the ShipmentLineID. Since a shipment can have the same product multiple times in the shipment, it can be useful to check the ShipmentLineID’s of the shipment.

{
"InvoiceID": 82217,
"Lines": [
{
"ShipmentLineID": 362020,
"Quantity": 9,
"UnitPrice": 46.55,
"ExpectedQuantity": 10
}
]
}

With the service ListShipmentsToInvoice, EVA responds to all shipments on the creditor which could be used for invoice matching.

{
"PageConfig": {
"Start": 0,
"Filter": {
"ShipFromOrganizationUnitID": 70
},
"Limit": 5
}
}

After creating the invoice lines, an invoice can look like this when calling GetInvoice:

{
"Result": {
"PageConfig": {
"Filter": {
"ShipFromOrganizationUnitID": "70"
},
"Start": 0,
"Limit": 5,
"SortDirection": 0
},
"Page": [
{
"ID": 109216,
"OrderIDs": [
133320
],
"OrderBackendIDs": [
"7893771"
],
"ShipmentDate": "2021-06-29T20:26:04.12Z",
"LastDeliveryDate": "2021-06-29T20:26:18.747Z",
"CompletionTime": "2021-06-29T20:26:18.86Z",
"BackendID": "2222333",
"TrackingCode": "332211",
"TotalQuantityInvoiced": 0,
"TotalQuantityReceived": 10,
"TotalAmountReceived": 465.5,
"TotalAmountInvoiced": 0
},
{
"ID": 59717,
"OrderIDs": [
123794
],
"OrderBackendIDs": [
"12345"
],
"ShipmentDate": "2020-03-02T20:19:02.443Z",
"LastDeliveryDate": "2020-03-02T20:19:10.983Z",
"CompletionTime": "2020-03-02T20:19:11.003Z",
"BackendID": "56",
"TrackingCode": "66",
"TotalQuantityInvoiced": 0,
"TotalQuantityReceived": 10,
"TotalAmountReceived": 53.6,
"TotalAmountInvoiced": 0
},
{
"ID": 59716,
"OrderIDs": [
123794
],
"OrderBackendIDs": [
"12345"
],
"ShipmentDate": "2020-03-02T20:18:52.63Z",
"LastDeliveryDate": "2020-03-02T20:19:01.3Z",
"CompletionTime": "2020-03-02T20:19:01.327Z",
"BackendID": "5",
"TrackingCode": "5",
"TotalQuantityInvoiced": 0,
"TotalQuantityReceived": 555,
"TotalAmountReceived": 3069.15,
"TotalAmountInvoiced": 0
}
],
"Offset": 0,
"Limit": 5,
"Total": 3,
"SortDirection": 0,
"Filters": {
"ShipFromOrganizationUnitID": "70"
},
"NumberOfPages": 1,
"CurrentPage": 1
}
}

CreateInvoiceDispute

With this service an invoice amount can be booked which will be marked as an invoice dispute. These disputes must be attached to a specific invoice line. Disputes can be resolved or accepted. Additionally, a user can be attached to the disputes. You can also attach an email address to allow for follow-up emails.

{
"ID": 0,
"Amount": 56.33,
"InvoiceID": 82217,
"ReasonID": 1,
"Description": "xxx",
"Type": 0
}

This service responds with the ID for your newly created invoice dispute.

BookInvoice

This lets you book the invoice based on the invoice ID. Booking an invoice has the side effect of creating a payment on the order with the amount of the invoice.

{
"ID":814
}

CreateInvoiceAdditionalAmountType

With this service you can create additional amount types for the invoice. Examples of these types are Shipping costs or additional administrative costs. These types can then be used in the CreateInvoiceAdditionalAmount service. Specifying LedgerClassID allows you to filter in the financial events when creating certain ledger bookings.

Example:

{
"Name": "Shipping Costs",
"Description": "Shipping",
"LedgerClassID": "Shipping"
}

CreateInvoiceDisputeResolveAction

This service generates disputes on the invoice and additional financial events, which can be used to make specific creditor bookings or posting on accounts which need resolving actions. Therefore, you can also identify ledger classes.

{
"InvoiceDisputeID": 1,
"Amount": 1,
"Description": 1,
"LedgerClassID": 1,
}