My Products
Help
HansK2
CONTRIBUTOR *

Caching bug in new ERP service url

by HansK2

Hi!

 

With the new ERP service url (https://api.finance.visma.net) if I do the following with sync code (no erp_api_background):

Get https://api.finance.visma.net/v1/customer/32339039 to see if the customer exists.

Post https://api.finance.visma.net/v1/customer to create the customer

Get https://api.finance.visma.net/v1/location/32339040 to get the default locations

 

then most often the location call returns an empty list instead of the correct list of locations.

 

I create the customer with this code (might be incorrect, the forum adjusted it somehow?):

{"number":{"value":"32339040"},"name":{"value":"f sad"},"customerClassId":{"value":"10"},"invoiceToDefaultLocation":{"value":true},"vatZoneId":{"value":"01"},"mainAddress":{"value":{"addressLine1":{"value":"asdf"},"addressLine2":{"value":"asdf"},"postalCode":{"value":"asdf"},"city":{"value":"asdf"},"countryId":{"value":"SE"}}},"mainContact":{"value":{"name":{"value":"f sad"},"phone1":{"value":""},"phone2":{"value":""}}},"overrideNumberSeries":{"value":true}}

I tried to replicate it with the old url but I get the following error on customer creation that I don't know how to fix:
Error: Inserting  'General ledger account' record raised at least one error. Please review the errors.\r\nError: 'Account' cannot be empty.\r\nThe post summary function cannot be used for companies that must report VAT to the government.\r\n"
1 REPLY 1

by Oskar Jansson

Hi, thanks for posting this. I'll look into it.