CustomerAdd( object Customer )
Add a Customer.
- The customer name is required and must be unique.
- All other fields are optional, except a contact name which is required.
- On Error, no data will be saved.
Request
Request Data:
- The customer object contains all the information.
- (string) Name (required and unique) – Set the Customer Name.
- (object) PrimaryContact (required)
- (string) FirstName (required)
- (string) LastName (required)
{ "Customer": { "Address": <string>, "AliasAdd": <string>, "City": <string>, "Country": <string>, "Fields": [ { "Field": <string>, "Value": <string> }, // .... more fields ], "Name": <string>, "Contacts": [{ "Email": <string>, "FirstName": <string>, "LastName": <string>, "PhoneBusiness": { "Number": <string> }, "PhoneFax": { "Number": <string> }, "PhoneHome": { "Number": <string> }, "PhoneOther": { "Number": <string> }, "Salutation": <string>, "Title": <string>, "IsPrimary": <bool> }, // This API request only allows one contact that will be made the primary contact ], "StateProvince": <string>, "Website": <string>, "ZipPostalCode": <string> } }
Response
Same structure as api/Customer
Errors
- “A customer name is required”
- “A unique customer name is required”