Create customers
const url = 'https://customer.shopgate.io/v1/merchants/example/customers';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"customers":[{"externalCustomerNumber":"10001","firstName":"John","middleName":"Doug","lastName":"Doe","emailAddress":"john.doe@shopgate.com","password":"superSecurePassword","status":"active","isAnonymous":false,"taxExempt":false,"taxClass":"example","contacts":[{"externalContactCode":"357709b0-9378-470b-976e-1b040e29b97b","status":"active","firstName":"John","middleName":"Doug","lastName":"Doe","companyName":"Shopgate Inc","address1":"12 Somestreet","address2":"","address3":"","address4":"","city":"Austin","postalCode":"78732","region":"TX","country":"US","additionalFields":{"dhlPostBoxNumber":"example","dhlPostNumber":"example"},"phone":"000-000-0000","fax":"000-000-0000","mobile":"000-000-0000","emailAddress":"somelocation@someRetailer.com","isDefaultShipping":false,"isDefaultBilling":false,"externalUpdateDate":"2026-04-15T12:00:00Z"}],"attributes":[{"code":"tshirtSize","value":{"code":"l"}},{"code":"nameOfCat","value":"Some Cats Name"}],"settings":{"defaultLocale":"en-us","defaultCurrency":"USD","communicationPreferences":["sms","push"],"defaultLocationCode":"DERetail001","marketingOptIn":false},"externalUpdateDate":"2026-04-15T12:00:00Z"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://customer.shopgate.io/v1/merchants/example/customers \ --header 'Content-Type: application/json' \ --data '{ "customers": [ { "externalCustomerNumber": "10001", "firstName": "John", "middleName": "Doug", "lastName": "Doe", "emailAddress": "john.doe@shopgate.com", "password": "superSecurePassword", "status": "active", "isAnonymous": false, "taxExempt": false, "taxClass": "example", "contacts": [ { "externalContactCode": "357709b0-9378-470b-976e-1b040e29b97b", "status": "active", "firstName": "John", "middleName": "Doug", "lastName": "Doe", "companyName": "Shopgate Inc", "address1": "12 Somestreet", "address2": "", "address3": "", "address4": "", "city": "Austin", "postalCode": "78732", "region": "TX", "country": "US", "additionalFields": { "dhlPostBoxNumber": "example", "dhlPostNumber": "example" }, "phone": "000-000-0000", "fax": "000-000-0000", "mobile": "000-000-0000", "emailAddress": "somelocation@someRetailer.com", "isDefaultShipping": false, "isDefaultBilling": false, "externalUpdateDate": "2026-04-15T12:00:00Z" } ], "attributes": [ { "code": "tshirtSize", "value": { "code": "l" } }, { "code": "nameOfCat", "value": "Some Cats Name" } ], "settings": { "defaultLocale": "en-us", "defaultCurrency": "USD", "communicationPreferences": [ "sms", "push" ], "defaultLocationCode": "DERetail001", "marketingOptIn": false }, "externalUpdateDate": "2026-04-15T12:00:00Z" } ] }'Create customers
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Body
Section titled “Request Body”object
object
External Customer number
Example
10001First name of the customer
Example
JohnMiddle name of the customer
Example
DougLast name of the customer
Example
DoeExample
john.doe@shopgate.comExample
superSecurePasswordExample
activeIndicates anonymous/guest customer.
Example
trueIndicates if customer is exempted from tax.
Example
trueTax class of the customer.
object
External identifier of the contact
Example
357709b0-9378-470b-976e-1b040e29b97bExample
activeExample
JohnExample
DougExample
DoeExample
Shopgate IncExample
12 SomestreetExample
Example
Example
Example
AustinExample
78732Example
TXExample
USobject
Number of a postbox
Number of a post
Validated according to country code
Example
000-000-0000Validated according to country code
Example
000-000-0000Validated according to country code
Example
000-000-0000Example
somelocation@someRetailer.comExample
trueExample
trueCustom customer attribute
object
Code of the defined customer attribute
Example
tshirtSizeValue for this attribute. Its a free text field for attributes where no values are set. Attributes which have value set should contains the code in an object. For instance value: { "code": "fish" }
Example
LHuman readable name of the attribute
Example
T-Shirt sizeExample
[ { "code": "tshirtSize", "value": { "code": "l" } }, { "code": "nameOfCat", "value": "Some Cats Name" }]All customer settings which are defined by Shopgate
object
Example
en-usExample
USDCommunication Preferences.
Example
[ "email", "push", "sms"]Example
DERetail001Responses
Section titled “Responses”Customer created
object
object
(optional) The original validation error that occured.
object
The index of the element the error refers to in the list of elements passed, starting from 0.
Example
{ "ids": [ "57de7a67-bd83-46e9-8276-c1206c301380" ], "errors": [ { "code": 409, "message": "customer already exists", "entity": "customer", "entityIndex": 0, "entityId": "7a81af64-a25d-11e9-8352-0bb2329f4819" }, { "code": 400, "message": "Validation error.", "validationError": { "code": "INVALID_TYPE", "message": "Request validation failed: Parameter (externalUpdateDate) at index 1 is not a valid date: today", "paramName": "externalUpdateDate", "paramValue": "today" }, "entity": "customer", "entityIndex": 1, "entityId": null } ]}Bad request (mostly missing or invalid parameters/values)
object
object
The parameter-field, that failed to validate, like “shopNumber”
The value, that was sent, like “xxx”
Machine readable error code
Human readable error code
Example
{ "errors": [ { "code": "ENUM_MISMATCH" } ]}Merchant not found
default
Section titled “default”Unexpected error
object
Machine readable error code
Human readable error code
Examplegenerated
{ "code": "example", "message": "example"}
