The below change to the API will be released as a patch this Wednesday, 2016-02-03. We are aware this is changed on a short notice but the effects of leaving this possibility to create incorrect supplier invoices open, is even more problematic.

In an earlier blog post we informed on how to create supplier invoices via the API with VAT types REVERSE and EUINTERNAL. Still, we are experiencing that many integrations are not using this functionality as intended which causes problems for our customers and many support issues.

To prevent this problem we will implement a validation that generates an error message if you create supplier invoices with any of these two mentioned VAT types and specify VAT rows without supplying matching row codes (field Code). The same error message will also be returned if the supplied row codes don’t match the sales type (field SalesType). The below table lists the possible combinations of values:

VAT Type Sales Type Code Description
EUINTERNAL STOCK PRD Product VAT Debit
PRC Product VAT Credit
SERVICE SRD Service VAT Debit
SRC Service VAT Credit
REVERSE STOCK /
SERVICE
CND Construction VAT Debit
CNC Construction VAT Credit

 

Example 1: Vat Type EUINTERNAL without specified row codes

{
  "SupplierInvoice": {
    "AdministrationFee": "0",
    "Comments": "Test EUINTERNAL product",
    "CostCenter": "",
    "DueDate": "2015-12-23",
    "ExternalInvoiceNumber": "",
    "ExternalInvoiceSeries": "",
    "Freight": "0",
    "InvoiceDate": "2015-12-13",
    "InvoiceNumber": "",
    "OCR": "",
    "OurReference": "",
    "RoundOffValue": "0",
    "SupplierInvoiceRows": [ 
    {
      "Account": 2645,
      "ArticleNumber": null,
      "Code": "",
      "CostCenter": "",
      "AccountDescription": "Debiterad ingående moms",
      "ItemDescription": null,
      "Debit": 2500,
      "DebitCurrency": 2500,
      "Credit": 0,
      "CreditCurrency": 0,
      "TransactionInformation": "",
      "Price": 0,
      "Quantity": 0,
      "Total": 2500,
      "Unit": null
    },
    {
      "Account": 2615,
      "ArticleNumber": null,
      "Code": "",
      "CostCenter": "",
      "ItemDescription": null,
      "Debit": 0,
      "DebitCurrency": 0,
      "Credit": 2500,
      "CreditCurrency": 2500,
      "TransactionInformation": "",
      "Price": 0,
      "Quantity": 0,
      "Total": -2500,
      "Unit": null
    },
    {
      "Account": 4515,
      "ArticleNumber": null,
      "Code": "",
      "CostCenter": "",
      "Debit": 10000,
      "DebitCurrency": 10000,
      "Credit": 0,
      "CreditCurrency": 0,
      "TransactionInformation": "",
      "Price": 0,
      "Quantity": 0,
      "Total": 10000,
      "Unit": null
    } 
    ],
    "SupplierNumber": "17",
    "Total": "10000",
    "VAT": "0",
    "YourReference": "",
    "VATType": "EUINTERNAL",
    "SalesType": "STOCK"
    }
}

Error message returned

{
    "ErrorInformation": {
      "error": 1,
       "message": "Momsrader för momstyp EUINTERNAL måste vara märkta med motsvarande CODE",
       "code": 2003114
    }
}

Example 2: Vat Type REVERSE without specified row codes

{
  "SupplierInvoice": {
    "AdministrationFee": "0",
    "Comments": "Test REVERSE product",
    "CostCenter": "",
    "DueDate": "2015-12-23",
    "ExternalInvoiceNumber": "",
    "ExternalInvoiceSeries": "",
    "Freight": "0",
    "InvoiceDate": "2015-12-13",
    "InvoiceNumber": "",
    "OCR": "",
    "OurReference": "",
    "RoundOffValue": "0",
    "SupplierInvoiceRows": [ 
    {
      "Account": 2645,
      "ArticleNumber": null,
      "Code": "",
      "CostCenter": "",
      "AccountDescription": "Debiterad ingående moms",
      "ItemDescription": null,
      "Debit": 2500,
      "DebitCurrency": 2500,
      "Credit": 0,
      "CreditCurrency": 0,
      "TransactionInformation": "",
      "Price": 0,
      "Quantity": 0,
      "Total": 2500,
      "Unit": null
    },
    {
      "Account": 2615,
      "ArticleNumber": null,
      "Code": "",
      "CostCenter": "",
      "ItemDescription": null,
      "Debit": 0,
      "DebitCurrency": 0,
      "Credit": 2500,
      "CreditCurrency": 2500,
      "TransactionInformation": "",
      "Price": 0,
      "Quantity": 0,
      "Total": -2500,
      "Unit": null
    },
    {
      "Account": 4515,
      "ArticleNumber": null,
      "Code": "",
      "CostCenter": "",
      "Debit": 10000,
      "DebitCurrency": 10000,
      "Credit": 0,
      "CreditCurrency": 0,
      "TransactionInformation": "",
      "Price": 0,
      "Quantity": 0,
      "Total": 10000,
      "Unit": null
    } 
    ],
    "SupplierNumber": "17",
    "Total": "10000",
    "VAT": "0",
    "YourReference": "",
    "VATType": "REVERSE",
    "SalesType": "STOCK"
    }
}

Error message returned

{
    "ErrorInformation": {
      "error": 1,
      "message": "Momsrader för momstyp REVERSE måste vara märkta med motsvarande CODE",
      "code": 2003115
      }
}