Skip to content

Update customer

POST
/merchants/{merchantCode}/customers/{customerId}
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.

merchantCode
required
string
customerId
required
string
localeCode
string

Locale code to change the language of the attributes

ignoreInternalAttributes
boolean

Ignores internal attributes in the result set

Media typeapplication/json
object
externalCustomerNumber

External Customer number

string
Example
10001
firstName

First name of the customer

string
Example
John
middleName

Middle name of the customer

string | null
Example
Doug
lastName

Last name of the customer

string
Example
Doe
emailAddress
string format: email
Example
john.doe@shopgate.com
status
string
default: active
Allowed values: active inactive deleted
Example
active
isAnonymous

Indicates anonymous/guest customer.

boolean
Example
true
taxExempt

Indicates if customer is exempted from tax.

boolean
Example
true
taxClass

Tax class of the customer.

string | null
contacts
Array
object
id

API identifier for the contact

string
Example
55a94ee0-6671-11e9-bb49-13684cb7b248
externalContactCode

External identifier of the contact

string | null
Example
357709b0-9378-470b-976e-1b040e29b97b
status
string
default: active
Allowed values: active inactive deleted
Example
active
firstName
string
Example
John
middleName
string | null
Example
Doug
lastName
string
Example
Doe
companyName
string | null
Example
Shopgate Inc
address1
string
Example
12 Somestreet
address2
string | null
Example
address3
string | null
Example
address4
string | null
Example
city
string
Example
Austin
postalCode
string
Example
78732
region
string
Example
TX
country
string
Example
US
additionalFields
object
dhlPostBoxNumber

Number of a postbox

string | null
>= 1 characters <= 5 characters
dhlPostNumber

Number of a post

string | null
>= 1 characters <= 10 characters
phone

Validated according to country code

string | null
Example
000-000-0000
fax

Validated according to country code

string | null
Example
000-000-0000
mobile

Validated according to country code

string | null
Example
000-000-0000
emailAddress
string format: email
Example
somelocation@someRetailer.com
isDefaultBilling
boolean
Example
true
isDefaultShipping
boolean
Example
true
externalUpdateDate
string format: date-time
attributes
Array

Custom customer attribute

object
code
required

Code of the defined customer attribute

string
Example
tshirtSize
value

Value 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
L
name

Human readable name of the attribute

string
Example
T-Shirt size
Example
[
{
"code": "tshirtSize",
"value": {
"code": "l"
}
},
{
"code": "nameOfCat",
"value": "Some Cats Name"
}
]
settings

All customer settings which are defined by Shopgate

object
defaultLocale
string
Example
en-us
defaultCurrency
string
Example
USD
communicationPreferences

Communication Preferences.

Array<string>
default: sms,push
Allowed values: sms email push
Example
[
"email",
"push",
"sms"
]
defaultLocationCode
string
Example
DERetail001
marketingOptIn
boolean
externalUpdateDate
string format: date-time

Customer updated

Media typeapplication/json

Merchant or customer not found

Media typeapplication/json

Customer number already taken by other customer or cannot delete required customer attributes

Media typeapplication/json

Unexpected error

Media typeapplication/json
object
code

Machine readable error code

string
message
required

Human readable error code

string
Examplegenerated
{
"code": "example",
"message": "example"
}