Create a customer
POST https://{handle}.myshopline.com/admin/openapi/v20260301/customers.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 .Create a new customer in the store. You need to provide detailed information such as the customer's email or mobile phone number.
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. The customer's email address is required when modifying the subscription status.DEPRECATED: This parameter is deprecated from API version v20250601.Example:trueaddressesobject[]
Customer address list.Maximum size: 50address1 stringCustomer address information such as the street address or a post office box number.Maximum length: 255Example:7720 Cherokee Roadaddress2 stringThe second line of the 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: 255Example:Joycountry 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:US.Example:UScountry_name stringStandardized country or region name in addresses.DEPRECATED: This parameter is deprecated from API version v20250601.Example:United Statesdefault booleanWhether the address is set as the default address. Valid values are:true: The default addressfalse: Not the default address
Default value:falseExample:truefirst_name stringThe customer's first name.Maximum length: 128Example:Boblast_name stringThe customer's last name.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.Maximum length: 20Example:001467326483province stringThe province in the address.Maximum length: 64Example:Kentuckyprovince_code stringThe code for the province in the address, which can be a custom code or a two-digit ISO 3166-2 international code.Example:KYzip stringThe postal code information of the address.Maximum length: 64Example:40202birthday stringCustomer's birthday. Format: yyyyMMdd.Example:20210831Example:19970102email stringCustomer's email.Maximum length: 50Example:gungcherny@gamil.comemail_marketing_consentobject
Email marketing subscription information.consent_collected_from stringSubscription information source.Maximum length: 50consent_updated_at stringThe date and time when the subscription was updated. Format: ISO 8601.Example:2024-08-31T02:20:26+08:00Example:2022-09-07T10:53:31+08:00opt_in_level integerSubscription method. Valid values are:0: unknown1: single opt-in2: confirmed opt-in
The default value depends on whether the Marketing options setting is enabled in the SHOPLINE Admin.- Enabled: Default value is
2. - Disabled: Default value is
1.
Example:1state 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:1first_name stringThe customer's first name.Maximum length: 128Example:Bobgender integerCustomer's gender. Valid values are:0: unknown1: male2: female3: secret
Default value:0Example:1last_name stringThe customer's last name.Maximum length: 128Example:Normanmultipass_identifier stringA unique identifier for the customer that logs in with Multipass login.Maximum length: 100note 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 from “not invited” to “registered”. The customer state is represented by thecustomer.statein the response.Password length: 6-18 charactersAllowed characters: uppercase letters, lowercase letters, numbers, and symbolsExample:31233password_confirmation stringThe customer's second password input for confirmation.Password length: 6-18 charactersAllowed characters: uppercase letters, lowercase letters, numbers, and symbolsExample:31233phone stringThe customer's mobile phone number.Maximum length: 20Example:001467326483sms_marketing_consentobject
SMS marketing subscription information.consent_collected_from stringSubscription information source.Maximum length: 50consent_updated_at stringThe date and time when the subscription was updated. Format: ISO 8601.Example:2024-08-31T02:20:26+08:00Example:2022-09-07T10:53:31+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, separating different tags with commas.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. The customer's email address is required when modifying the subscription status.DEPRECATED: This parameter is deprecated from API version v20250601.Example:trueaccepts_marketing_updated_at stringThe time when the customer renewed their subscription to email marketing.DEPRECATED: This parameter is deprecated from API version v20250601.Example:2022-05-31T15:32:46+08:00accepts_mobile_marketing booleanWhether the customer accepts to subscribe to marketing information via mobile phone number.DEPRECATED:This parameter is deprecated from API version v20250601.Example:trueaccepts_mobile_marketing_updated_at stringThe time when the customer updated his subscription to mobile phone number marketing.This parameter is deprecated from API version v20250601.Example:2022-05-31T15:32:46+08:00addressesobject[]
Customer address list.address1 stringCustomer address information such as the street address or a post office box number.Example:7720 Cherokee Roadaddress2 stringThe second line of the address. This typically includes information such as apartment, suite, or unit number.Example:Apartment 2city stringThe city in the address.Example:Hagermancompany stringThe company name.Example:Joycountry stringThe country or region in the address.Example: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:UScustomer_id stringThe unique identifier for customer.Example:4201825054default booleanWhether the address is set as the default address. Valid values are:true: Default address.false: No default address.
Example:truefirst_name stringThe customer's first name.Example:Bobid stringThe unique identifier for the addresses.Example:207119551last_name stringThe customer's last name.Example:Normanphone stringThe customer's mobile phone number.Example:001467326483province stringThe province in the address.Example:Kentuckyprovince_code stringThe code for the province in the address, which can be a custom code or a two-digit ISO 3166-2 international code.DEPRECATED: This parameter is deprecated from API version v20250601Example:KYprovince_code_v2 stringThe code for the province in the address, which can be a custom code or a two-digit ISO 3166-2 international code.Example:KYzip stringThe postal code information of the address.Example:40202asid stringThe unique identifier for the facebook login.Example:481007156599455birthday stringCustomer's birthday.Example:19970102created_at stringThe data and time when the customer was created.Example:2022-09-07T10:53:31+08:00currency 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.Example:USDdefault_addressobject
Default address.address1 stringCustomer address information such as the street address or a post office box number.Example:7720 Cherokee Roadaddress2 stringThe second line of the address. This typically includes information such as apartment, suite, or unit number.Example:Apartment 2city stringThe city in the address.Example:Hagermancompany stringThe company name.Example:Joycountry stringThe country or region in the address.Example: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:UScustomer_id stringThe unique identifier for customer.Example:4201825054default booleanWhether the address is set as the default address.Example:truefirst_name stringThe customer's first name.Example:Bobid stringThe unique identifier for the addresses.Example:207119551last_name stringThe customer's last name.Example:Normanphone stringThe customer's mobile phone number.Example:001467326483province stringThe province in the address.Example:Kentuckyprovince_code stringThe code for the province in the address, which can be a custom code or a two-digit ISO 3166-2 international code.DEPRECATED: This parameter is deprecated from API version v20250601Example:KYprovince_code_v2 stringThe code for the province in the address, which can be a custom code or a two-digit ISO 3166-2 international code.zip stringThe postal code information of the address.Example:40202email stringCustomer's email.Example:gungcherny@gamil.comemail_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.Example:2022-09-07T10:53:31+08:00opt_in_level integerSubscription method. Valid values are:0: unknown1: single opt-in2: confirmed opt-in
Example:1state integerEmail subscription status. Valid values are:0: Unsubscribed1: Subscribed2: Not subscribed3: Awaiting confirmation
Example:1email_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
Example:1first_name stringThe customer's first name.Example:Bobgender stringCustomer's gender. Valid values are:others: unknownmale: malefemale: femalesecret: secret
Example:femaleid stringThe customer's unique ID .Example:4201825054language stringCustomer language.Example:enlast_name stringThe customer's last name.Example:Normanlast_order_id stringThe unique identifier for the customer's last recent order.Example:2005473211984312275741last_order_name stringThe most recent custom order number.Example:#20269Mmobile_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.Example:Placed an order that had a fraud warningorders_count longThe order quantity by the customer.Example:12phone stringThe customer's mobile phone number.Example:001467326483sms_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.Example:2022-09-07T10:53:31+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 subscribed3: Awaiting confirmation
Example:1social_customer arrayThe customer's unique ID on social media.DEPRECATED: This parameter is deprecated from API version v20250601Example:["[6612273988815231]"]state integerCustomer's status. Valid values are:0: Blacklist1: Not invited2: Invited3: Registered
Example:2tags stringCustomer's tags.Example:loyaltotal_spent stringTotal amount spent by the customer.Example:100verified_email booleanWhether the email has been verified. Valid values are:true: verifiedfalse: unverified
API Explorer
Debugger
Examples
Was this article helpful to you?