Get customers
GET https://{handle}.myshopline.com/admin/openapi/v20260301/v2/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 .Get customers within the store. You can query customer information based on specified parameters.
Query Parameters
- page_info stringThe unique identifier for pagination queries, used to locate a specific page.This parameter value is obtained from the
linkvalue in the response header of this API after you have queried the pagination information.For example, if thelinkvalue you obtained is<https://{handle}.myshopline.com/admin/openapi/{version}/v2/customers.json?limit=1&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9>; rel="next", the value ofpage_infoiseyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9.For more information on how to use pagination, refer to Paging Mechanism. - since_id stringThe ID of a specific customer. Start querying customers from this specified ID.Example:
4201825024 - updated_at_max stringSpecify the latest update date and time for customers to query. Customers updated on and before this time are returned. Format: ISO 8601.Example:
2021-08-31T02:20:26+08:00 - updated_at_min stringSpecify the earliest update date and time for customers to query. Customers updated on and after this time are returned. Format: ISO 8601.Example:
2021-08-31T02:20:26+08:00 - created_at_max stringSpecify the latest creation date and time for customers to query. Customers created on and before this time are returned. Format: ISO 8601.Example:
2021-08-31T02:20:26+08:00 - ids stringThe list of customer IDs, with multiple IDs separated by commas.Maximum length: 64Example:
4201825024,4201825025 - created_at_min stringSpecify the earliest creation date and time for customers to query. Customers created on and after this time are returned. Format: ISO 8601.Example:
2021-08-31T02:20:26+08:00 - 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
customersobject in the response.Example:id,email,first_name - limit stringSpecify the maximum number of customers to return.Value range: 1-250Default value: 50
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
link
The URL link that provides the pagination data. You can obtainpage_infofrom this parameter for subsequent pagination requests.This parameter is returned when the requested page has a previous or next page.For more information on how to use pagination, refer to Paging Mechanism.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
customersobject[]
A list of customers.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.accepts_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.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.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.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.Example:Bobid stringThe unique identifier for the address.last_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.birthday stringThe birthday of the customer. Format: yyyyMMdd.Example:19970102created_at stringThe data and time when the customer was created. Format: ISO 8601.Example:2022-05-31T15:32:46+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.default booleanAlways returnstrue, indicating that the address is set as the default address.first_name stringThe first name of the customer.Example:Bobid stringThe unique identifier for the address.last_name stringThe last name of the customer.Example:Normanphone stringThe phone number of the customer.Example:001123-***-7890province 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.Example:*********@example.comemail_marketing_consentobject
Email 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:2021-08-31T02:20:26+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:0: unknown1: male2: female
Example:1id stringThe unique identifier for the customer.language stringThe language used by 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_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:NormanBobnote stringMerchant's notes on the customer.orders_count longThe order quantity by the customer.phone stringThe phone number of the customer.Example:001123-***-7890sms_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:2021-08-31T02:20:26+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 customer's unique ID on 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.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.Example:2022-05-31T15:32:46+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?