My Products
Help
Anonymous
Not applicable

Posting several suppliers in short succession leads to 4000 Error - SupplierAlreadyExistsException

by Anonymous

Hi,

I am having some unexpected issues that I hope you can help me with.

Description 
With the end goal of submitting an array of transactions into supplierInvoiceDrafts, I am making a few different API calls to retrieve necessary information for making a call to POST https://eaccountingapi-sandbox.test.vismaonline.com/v2/supplierinvoicedrafts
The calls are chained meaning that the transaction arrary is iterated to make sure the data required for POST supplierInvoiceDrafts is present.

Error Description
To get all the required supplier details an attempt to fetch a supplier is made using GET https://eaccountingapi-sandbox.test.vismaonline.com/v2/suppliers, if there is no matching supplier, a POST https://eaccountingapi-sandbox.test.vismaonline.com/v2/suppliers call gets made which leads to the issue. When several suppliers are missing from Visma, several subsequent POST suppliers calls are made leading to a 4000 SupplierAlreadyExistsException.

Endpoint

POST https://eaccountingapi-sandbox.test.vismaonline.com/v2/suppliers


Request body

{
  "My JSON":{
    "Name": "3333 ATM DEB_I18",
    "TermsOfPaymentId": "eee02b7c-a93b-4daf-9fdd-02f544219ddb"
  }
}



Response body

{
  "Servers JSON": {
    "ErrorCode": 4000,
    "DeveloperErrorMessage": 'SupplierAlreadyExistsException - A supplier with 
    the provided id or number already exists.',
    "ErrorId": '3f16879c-508d-406e-91f0-23e555b37288',
    "Errors": null
  }
}

 
Expected behaviour
The calls are all successful and return a unique supplierId for each new supplier.


Thanks in advance,

David

2 REPLIES 2
Accepted solution
Yıldırım
VISMA

by Yıldırım

Hello David,

this community is for Visma.net Financials ERP API. Visma eAccounting API related inquiries should be either posted at  Community:Visma eAccounting API or sent to api_eaccounting@visma.com inbox.

Thanks.

Accepted solution
Anonymous
Not applicable

by Anonymous

Sorry, I'll post in the eAccounting section instead. Feel free to remove this post