API - VatCodes

I am trying to set the VatCodes as servrc. I have this in a purchase. I tried just servrc and I tried the string listed in the API doc; but i can’t get it to work and receive the error: “18The element ‘VatCodes’ in namespace ‘https://api.quickfile.co.uk’ cannot contain text. List of possible elements expected […]”

Here the sample part of the json, how do I set this correctly?

        "PurchaseData": {
            "SupplierID": "3957198",
            "ReceiptDate": "2023-10-31",
            "TermDays": "0",
            "SupplierReference": "V140298",
            "Currency": "USD",
            "VatCodes": "servrc (Reverse Charge (Services))"

Quick follow up, if I set “VatCodes”: “” it works, so there must be an issue with the string and the endpoint is purchase_create.

Hi @goetz

Two things here - the code is just “servrc” (without the description in brackets). The brackets are just in the documentation for reference.

The other thing is, it needs a “Code” key. So, if you give this a go, this should work:

      "PurchaseData": {
          "SupplierID": "3957198",
          "ReceiptDate": "2023-10-31",
          "TermDays": "0",
          "Currency": "USD",
          "SupplierReference": "V140298", 
          "VatCodes": {
             "Code": "servrc"
          }
      }

Perfect, thank you, that works!

1 Like