Update a customer
PUT https://{handle}.myshopline.com/admin/openapi/v20260301/customers/:id.json
handle : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is open001.myshopline.com , the store handle is open001 .Update a customer in the store. You can use this interface to update the customer's subscription status, address, and other information.
Path Parameters
- id string requiredThe unique identifier for the customer.Maximum length: 64Example:
4211465524
Request Headers
- Content-Type string requiredThe field must be set to the fixed value
application/json; charset=utf-8. - Authorization string requiredThe access token for the API resource. Refer to App authorization to obtain the access token, and then pass the obtained token in the Bearer format.Example:
Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
Request Body
customerobject
Customer information.accepts_marketing booleanWhether the customer accepts to subscribe to marketing information via email.DEPRECATED: This parameter is deprecated from API version v20250601.Example:trueaddressesobject[]
A list of customer addresses.Maximum size: 50address1 stringThe first line of the customer's address. This typically includes information such as the street address or a post office box number.Maximum length: 255Example:7720 Cherokee Roadaddress2 stringThe second line of the customer's address. This typically includes information such as apartment, suite, or unit number.Maximum length: 255Example:Apartment 2city stringThe city in the address.Maximum length: 64Example:Hagermancompany stringThe company name.Maximum length: 255country stringThe country or region in the address.Maximum length: 64Example:United Statescountry_code stringA two-letter country or region code that follows the ISO 3611-1 (alpha 2) standard, used to identify a specific country or region in the address.Example:UScountry_name stringStandardized country or region name in address.DEPRECATED: This parameter is deprecated from API version v20250601.Example:United Statescustomer_id stringThe unique identifier for the customer.Maximum length: 64Example:4201825054default booleanWhether the address is set as the default address. Valid values are:true: The default addressfalse: Not the default address
Default value:falsefirst_name stringThe first name of the customer.Maximum length: 128Example:Bobid stringThe unique identifier for the address.Maximum length: 64Example:207119551last_name stringThe last name of the customer.Maximum length: 128Example:Normanname stringThe customer's nickname.DEPRECATED: This parameter is deprecated from API version v20250601.Example:NormanBobphone stringThe customer’s mobile phone number. The input format for the mobile number must be in the format of 00 + country calling code + mobile number.Maximum length: 20Example:001123-***-7890province stringThe province in the address.Maximum length: 64Example:Kentuckyprovince_code stringThe custom code for the province in the address.DEPRECATED: This parameter is deprecated from API version v20250601Example:KYzip stringThe postal code information of the address.Maximum length: 64Example:40202birthday stringThe birthday of the customer. Format: yyyyMMdd.Example:19970102email stringThe email of the customer.Maximum length: 50Example:*********@example.comemail_marketing_consentobject
Email marketing subscription information.consent_collected_from stringSubscription information source.Maximum length: 50Example:popconsent_updated_at stringThe date and time when the subscription was updated. Format: ISO 8601.Example:2022-05-31T15:32:46+08:00opt_in_level integerSubscription method. Valid values are:0: unknown1: single opt-in2: confirmed opt-in
The default value varies depending on whether the option is enabled under SHOPLINE Admin > Settings > Customer Account > Marketing options.- Enabled: Default value is
2. - Disabled: Default value is
1.
Example:2state integerEmail subscription status. Valid values are:0: Unsubscribed1: Subscribed2: Not subscribed3: Awaiting confirmation
This field must be passed when any other subfields underemail_marketing_consenthave values.Example:2first_name stringThe first name of the customer.Maximum length: 128Example:Bobgender integerThe gender of the customer. Valid values are:0: unknown1: male2: female3: secret
Default value:0Example:1last_name stringThe last name of the customer.Maximum length: 128Example:Normanmultipass_identifier stringA unique identifier for the customer that logs in with Multipass login.Maximum length: 100Example:multipassIdentifiernote stringMerchant's notes on the customer.Maximum length: 1000Example:Placed an order that had a fraud warningpassword stringCustomer's password. If it is passed in, the customer state changes fromnot invitedtoregistered. The customer state is represented by thecustomer.statein the response.Password length: 6-18 charactersAllowed characters: uppercase letters, lowercase letters, numbers, and symbolsDEPRECATED: This parameter is deprecated from API version v20250601.Example:123456password_confirmation stringThe customer's second password input for confirmation.Password length: 6-18 charactersAllowed characters: uppercase letters, lowercase letters, numbers, and symbolsDEPRECATED: This parameter is deprecated from API version v20250601.Example:123456phone stringThe phone number of the customer.Maximum length: 20Example:001467326483sms_marketing_consentobject
SMS marketing subscription information.consent_collected_from stringSubscription information source.Maximum length: 50Example:popconsent_updated_at stringThe date and time when the subscription was updated. Format: ISO 8601.Example:2022-05-31T15:32:46+08:00opt_in_level integerSubscription method. Valid values are:0: unknown1: single opt-in2: confirmed opt-in
Example:1state integerSMS subscription status. Valid values are:0: Unsubscribed1: Subscribed2: Not subscribed
This field must be passed when any other subfields undersms_marketing_consenthave values.Example:1tags stringAdd tags for customers, and separate different tags with a comma. Maximum number of tags allowed: 100Maximum length per tag: 128Maximum length total: 1000Example:loyalverified_email booleanWhether the email has been verified. Valid values are:true: verifiedfalse: unverified
Default value:falseExample:true
Status Codes
- 200
- 401
- 429
For the complete list of codes and messages, see Http status code.
Response Headers
traceId
A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.
Response Body
customerobject
Customer information.accepts_marketing booleanWhether the customer accepts to subscribe to marketing information via email.DEPRECATED: This parameter is deprecated from API version v20250601.accepts_marketing_updated_at stringThe time when the customer updated their subscription to email marketing.DEPRECATED: This parameter is deprecated from API version v20250601.accepts_mobile_marketing_updated_at stringWhether the customer accepts to subscribe to marketing information via mobile phone number.DEPRECATED:This parameter is deprecated from API version v20250601.accepts_phone_marketing booleanThe time when the customer updated the subscription to mobile phone number marketing.This parameter is deprecated from API version v20250601.addressesobject[]
A list of customer addresses.address1 stringThe first line of the customer's address. This typically includes information such as the street address or a post office box number.address2 stringThe second line of the customer's address. This typically includes information such as apartment, suite, or unit number.city stringThe city in the address.company stringThe company name.country stringThe country or region in the address.country_code stringA two-letter country or region code that follows the ISO 3611-1 (alpha 2) standard, used to identify a specific country or region in the address.customer_id stringThe unique identifier for the customer.default booleanWhether the address is set as the default address. Valid values are:true: Default address.false: No default address.
first_name stringThe first name of the customer.id stringThe unique identifier for the address.last_name stringThe last name of the customer.phone stringThe phone number of the customer.province stringThe province in the address.province_code stringThe custom code for the province in the address.DEPRECATED: This parameter is deprecated from API version v20250601province_code_v2 stringThe code for the province in the address, which is a two-digit ISO 3166-2 international code.zip stringThe postal code information of the address.asid stringThe unique identifier for the Facebook login.created_at stringThe data and time when the customer was created.currency stringThe currency used by the customer to place an order. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard.default_addressobject
Default address.address1 stringThe first line of the customer's address. This typically includes information such as the street address or a post office box number.address2 stringThe second line of the customer's address. This typically includes information such as apartment, suite, or unit number.city stringThe city in the address.company stringThe company name.country stringThe country or region in the address.country_code stringA two-letter country or region code that follows the ISO 3611-1 (alpha 2) standard, used to identify a specific country or region in the address.customer_id stringThe unique identifier for the customer.default booleanAlways returnstrue, indicating that the address is set as the default address.first_name stringThe first name of the customer.id stringThe unique identifier for the address.last_name stringThe last name of the customer.phone stringThe phone number of the customer.province stringThe province in the address.province_code stringThe custom code for the province in the address.DEPRECATED: This parameter is deprecated from API version v20250601province_code_v2 stringThe code for the province in the address, which is a two-digit ISO 3166-2 international code.zip stringThe postal code information of the address.email stringThe email of the customer.email_marketing_consentobject
Email marketing subscription information.consent_collected_from stringSubscription information source.consent_updated_at stringThe date and time when the subscription was updated. Format: ISO 8601.opt_in_level integerSubscription method. Valid values are:0: unknown1: single opt-in2: confirmed opt-in
state integerEmail subscription status. Valid values are:0: Unsubscribed1: Subscribed2: Not subscribed3: Awaiting confirmation
email_subscribe_flag integerThe final subscription status of the customer's email. Returned based on theemail_marketing_consentrelated input information. Valid values are:0: Unsubscribed1: Subscribed2: Not subscribed
first_name stringThe first name of the customer.id stringThe unique identifier for the customer.last_name stringThe last name of the customer.last_order_id stringThe unique identifier for the most recent order.last_order_name stringThe custom number for the most recent order.mobile_subscribe_flag integerThe final subscription status of the customer's mobile phone number. Returned based on thesms_marketing_consentrelated input information. Valid values are:0: Unsubscribed1: Subscribed2: Not subscribed
multipass_identifier stringA unique identifier for the customer that's used with Multipass login.note stringMerchant's notes on the customer.orders_count longThe number of orders placed by the customer.phone stringThe phone number of the customer.sms_marketing_consentobject
SMS marketing subscription information.consent_collected_from stringSubscription information source.consent_updated_at stringThe date and time when the subscription was updated. Format: ISO 8601.opt_in_level integerSubscription method. Valid values are:0: unknown1: single opt-in2: confirmed opt-in
state integerSMS subscription status. Valid values are:0: Unsubscribed1: Subscribed2: Not subscribed3: Awaiting confirmation
state integerThe status of the customer. Valid values are:0: Blacklist1: Not invited2: Invited3: Registered
tags stringThe tags of the customer.total_spent stringTotal amount spent by the customer, displayed in the store currency.updated_at stringThe date and time when the customer was updated.Format: ISO 8601.verified_email booleanWhether the email has been verified. Valid values are:true: verifiedfalse: unverified
API Explorer
Debugger
Examples
Was this article helpful to you?