My Products
Help
gordana_jlmwms
CHAMPION *

Insert supplier

by gordana_jlmwms

I am using 

https://integration.visma.net/API/controller/api/v1/supplier endpoint.

 

 

json body "supplier"

 

{"number":{"value":"1"},"name":{"value":"Simplehuman"},"status":{"value":"Active"},"supplierClassId":{"value":"20"},"overrideWithClassValues":false,"documentLanguage":{"value":"en-GB"},"currencyId":{"value":"EUR"},"vatRegistrationId":{"value":"GB 831 1308 70"},"corporateId":{"value":"831 1308 70"},"accountUsedForPayment":{"value":""},"mainAddress":{"value":{"addressLine1":{"value":"5 Thames Court, High Street, Goring-on-Thames"},"addressLine2":{"value":"5 Thames Court, High Street, Goring-on-Thames"},"postalCode":{"value":"RG8 9AQ"},"city":{"value":"Oxfordshire"},"countryId":{"value":"GB"},"county":{"value":"UNITED KINGDOM"}}},"supplierContact":{"value":{"name":{"value":""}}}}

 

I get error i response 

 

 

{"message":"Error inserting the supplier. Error: An error in processing of field Postcode value RG8 9AQ Error: The postcode is invalid."}

 

Same error i get with all foreign suppliers (write from Sweden)

5 REPLIES 5
gordana_jlmwms
CHAMPION *

by gordana_jlmwms

should city and country have the same value (city)?

I'm guessing based on the postcode that what you want is:

Country: GB

County: Oxfordshire

City: Goring

by Magnus Johnsen

Hi,

There were some fields causing issues in your payload, for example the "accountUsedForPayment" was left empty, and the "county" field was incorrect. 

With the payload below we were able to create the supplier, please try this:

{
    "number": {
        "value": "1"
    },
    "name": {
        "value": "Simplehuman"
    },
    "status": {
        "value": "Active"
    },
    "documentLanguage": {
        "value": "en-GB"
    },
    "supplierClassId": {
        "value": "20"
    },
    "overrideWithClassValues": false,
    "currencyId": {
        "value": "EUR"
    },
    "vatRegistrationId": {
        "value": "GB 831 1308 70"
    },
    "corporateId": {
        "value": "831 1308 70"
    },
    "mainAddress": {
        "value": {
            "addressLine1": {
                "value": "5 Thames Court, High Street, Goring-on-Thames"
            },
            "addressLine2": {
                "value": "5 Thames Court, High Street, Goring-on-Thames"
            },
            "postalCode": {
                "value": "RG8 9AQ"
            },
            "city": {
                "value": "Oxfordshire"
            },
            "countryId": {
                "value": "GB"
            },
            "county": {
                "value": "Oxfordshire"
            }
        }
    },
}
gordana_jlmwms
CHAMPION *

what is diff between mine and yours postal code?

 

mine   "postalCode":{"value":"RG8 9AQ"}

yours   "postalCode": {  "value": "RG8 9AQ"

Accepted solution
Magnus Johnsen
VISMA

That field is the same, however, the county field and some other fields were incorrect which in turn triggered the error incorrectly.