API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

Creating customer with the API

0

Im trying to create a customer and im following http://restdocs.e-conomic.com/#customers.

Where can i figure out what object is required in the field 'customerGroup','paymentTerms' and 'vatZone'?

This is the data i send

 

$data = [
   'AppID'    => 'MY-APP-ID',
   'AccessID' => 'MY-ACCESS-ID',
   'currency' => 'DKK',
   'customerGroup' => [],
   'name'=> 'test forhandler',
   'paymentTerms' => [],
   'vatZone' => []
];

and this is the response i get

 

{"message":"Schema validation failed.","errorCode":"E00500","developerHint":"Check your request against the schema.","logId":"3db7a42d-f892-4fc5-9cbb-6d009698cc56","httpStatusCode":400,"errors":["Invalid type. Expected Object but got Array. Line 1, position 148.","Invalid type. Expected Object but got Array. Line 1, position 191.","Invalid type. Expected Object but got Array. Line 1, position 204."],"logTime":"2015-04-20T10:34:42","schemaPath":"https://restapi.e-conomic.com/schema/customers.post.schema.json"}

 

and i asume the error occors because the objects are empty, but where can i find out what im suposted to fill in the objects?

created Apr 20, 2015 by Siop
50% Accept Rate
Q 2 A 0 C 0

1 Answer

0
 
Best answer
Have a look at the relevant end-points:

CustomerGroup: /customer-groups

PaymentTerms: /payment-terms

vatZone: /vat-zones

 

I'd highly recommend you take a look at the output of a GET with ?demo=true in the URL to the endpoint to get an example of the object you're looking to create.
answered Apr 20, 2015 by olej
selected Apr 20, 2015 by Siop
Visma e-conomic A/S
...