Get a customer
GET https://{handle}.myshopline.com/admin/openapi/v20260301/customers/v2/: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 .Get a customer's information by ID.
Path Parameters
- id string requiredThe unique identifier for the customer.Maximum length:64Example:
4211465524
Query Parameters
- fields stringSpecify the fields to be returned, with multiple fields separated by commas. For available fields, refer to the top-level child parameters under the
customerobject in the response.Example:id,email,first_name
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
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 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 the subscription to mobile phone number marketing.This parameter is deprecated from API version v20250601.Example:2022-05-31T15:32:46+08:00addressesobject[]
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.Example:7720 Cherokee Roadaddress2 stringThe second line of the customer's 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.country 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 the customer.Example:4201825054default 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.Example:Bobid stringThe unique identifier for the address.Example:207119551last_name stringThe last name of the customer.Example:Normanphone stringThe phone number of the customer.province stringThe province in the address.Example:Kentuckyprovince_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.Example:KYzip stringThe postal code information of the address.Example:40202asid stringThe unique identifier for the Facebook login.Example:481007156599455birthday stringThe birthday of the customer. Format: yyyyMMdd.Example:19970102created_at stringThe data and time when the customer was created. Format: ISO 8601.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 stringThe first line of the customer's address. This typically includes information such as the street address or a post office box number.Example:7720 Cherokee Roadaddress2 stringThe second line of the customer's 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.country 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 the customer.Example:4201825054default booleanAlways returnstrue, indicating that the address is set as the default address.Example:truefirst_name stringThe first name of the customer.Example:Bobid stringThe unique identifier for the address.Example:207119551last_name stringThe last name of the customer.Example:Normanphone stringThe phone number of the customer.province stringThe province in the address.Example:Kentuckyprovince_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.Example:KYzip stringThe postal code information of the address.Example:40202email 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.Example:2022-09-07T10:53:31+08:00opt_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_consentinput when creating or updating a customer. Valid values are:0: Unsubscribed1: Subscribed2: Not subscribed
first_name stringThe first name of the customer.Example:Bobgender stringThe gender of the customer. Valid values are:unknown: not setmale: malefemale: femalesecret: secret
id stringThe unique identifier for the customer.Example:4201825054language stringThe language used by the customer.Example:enlast_name stringThe last name of the customer.Example:Normanlast_order_id stringThe unique identifier for the most recent order.Example:2005473211984312275741last_order_name stringThe custom number for the most recent order.Example:#20279Mmobile_subscribe_flag integerThe final subscription status of the customer's mobile phone number. Returned based on thesms_marketing_consentinput when creating or updating a customer. Valid values are:0: Unsubscribed1: Subscribed2: Not subscribed
multipass_identifier stringA unique identifier for the customer that's used with Multipass login.nick_name stringThe nickname of the customer.Example:BobNormannote stringMerchant's notes on the customer.Example:Placed an order that had a fraud warningorders_count longThe number of orders placed by the customer.Example:12phone stringThe phone number of the customer.Example:0086139****1234sms_marketing_consentobject
SMS marketing subscription information.consent_collected_from stringSubscription information source.Example:Popconsent_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
state integerSMS subscription status. Valid values are:0: Unsubscribed1: Subscribed2: Not subscribed3: Awaiting confirmation
social_customer arrayThe unique identifier for the social media.DEPRECATED: This parameter is deprecated from API version v20250601state integerThe status of the customer. Valid values are:0: Blacklist1: Not invited2: Invited3: Registered
tags stringThe tags of the customer.Example:loyaltotal_spent stringTotal amount spent by the customer, displayed in the store currency.Example:100updated_at stringThe date and time when the customer information was updated. Format: ISO 8601.Example:2022-09-07T10:53:31+08:00verified_email booleanWhether the email has been verified. Valid values are:true: verifiedfalse: unverified
API Explorer
Debugger
Examples
Was this article helpful to you?