Update customer
const url = 'https://customer.shopgate.io/v1/merchants/example/customers/example?ignoreInternalAttributes=false';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"externalCustomerNumber":"10001","firstName":"John","middleName":"Doug","lastName":"Doe","emailAddress":"john.doe@shopgate.com","status":"active","isAnonymous":false,"taxExempt":true,"taxClass":"example","contacts":[{"id":"55a94ee0-6671-11e9-bb49-13684cb7b248","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","isDefaultBilling":false,"isDefaultShipping":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/example?ignoreInternalAttributes=false' \ --header 'Content-Type: application/json' \ --data '{ "externalCustomerNumber": "10001", "firstName": "John", "middleName": "Doug", "lastName": "Doe", "emailAddress": "john.doe@shopgate.com", "status": "active", "isAnonymous": false, "taxExempt": true, "taxClass": "example", "contacts": [ { "id": "55a94ee0-6671-11e9-bb49-13684cb7b248", "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", "isDefaultBilling": false, "isDefaultShipping": 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" }'Update customer. To update sub-entities (contacts, attributes):
- Existing sub entities that are not passed at all will be DELETED.
- To KEEP existing sub entities, pass their codes without values.
- To ADD or UPDATE sub entities pass their codes and the value(s) to be added or updated.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Locale code to change the language of the attributes
Ignores internal attributes in the result set
Request Body
Section titled “Request Body”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
activeIndicates anonymous/guest customer.
Example
trueIndicates if customer is exempted from tax.
Example
trueTax class of the customer.
object
API identifier for the contact
Example
55a94ee0-6671-11e9-bb49-13684cb7b248External 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 updated
Merchant or customer not found
Customer number already taken by other customer or cannot delete required customer attributes
default
Section titled “default”Unexpected error
object
Machine readable error code
Human readable error code
Examplegenerated
{ "code": "example", "message": "example"}
