My Products
Help
dyadka
CONTRIBUTOR *

Can not create a customer via API

by dyadka

Hi guys.
I can not create a customer via API (https://integration.visma.net/API-index/#operations-Customer-Customer_Post)

"Get customers" request works:

curl -X GET -H 'ipp-company-id: 3199999' -H 'authorization: Bearer 4178...' https://integration.visma.net/API/controller/api/v1/customer

and returns:

[{"internalId":17853,"number":"10000","name":"hjhjhg","status":"Active", ...}]

 

But "Create customer" request does not work:

curl -X POST -H 'ipp-company-id: 3199999' -H 'authorization: Bearer 4178...' -H 'Content-Type: application/json' -d '{"number":"10001","name":"Mikhatest","status":"Active","currencyId":"NOK","creditLimit":0,"creditDaysPastDue":0,"overrideWithClassValues":true,"customerClassId":"1","printInvoices":true,"acceptAutoInvoices":false,"sendInvoicesByEmail":false,"printStatements":true,"sendStatementsByEmail":false,"printMultiCurrencyStatements":true,"invoiceToDefaultLocation":true,"mainAddress":{"addressLine1":"Mikha-main-address","addressLine2":"","addressLine3":"","postalCode":"0100","city":"Oslo","countryId":"NO","county":"Norway"},"mainContact":{"name":"Mikha-main-contact","attention":"","email":"","web":"","phone1":"","phone2":"","fax":""},"creditVerification":"Disabled","invoiceAddress":{"addressLine1":"Mikha-invoice-address","addressLine2":"","addressLine3":"","postalCode":"0100","city":"Oslo","countryId":"NO","county":"Norway"},"invoiceContact":{"name":"Mikha-invoice-contact","attention":"","email":"","web":"","phone1":"","phone2":"","fax":""},"statementType":"OpenItem"}' https://integration.visma.net/API/controller/api/v1/customer

and returns:

{"message":"Error inserting the customer. Input data not valid. New customer must have a name specified."}

But name is specified.

What is wrong here?

0 REPLIES 0