# 2. a) Get Customers by Segment

**GET** `/shopify/{{SHOPIFY_API_VERSION}}/segments/customers`

Product: [Connectors](https://devdocs.1spoc.com/docs/shopify.md)  
Version: [1.0](https://devdocs.1spoc.com/docs/shopify/1-0.md)  
Category: **2. Shopify APIs**  
Lifecycle: **active**

## Request overview

Full URL: `https://connectors.1spoc.com/shopify/{{SHOPIFY_API_VERSION}}/segments/customers`

Method: `GET`

Content type: `No request body`

## Authentication

This endpoint does not require authentication.

## Parameters

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `{SHOPIFY_API_VERSION` | string | Yes | Path value for {SHOPIFY_API_VERSION. |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | string | No | MAX = 250 |
| `org_id` | string | No | Request value for org id. |
| `segment_id` | string | No | Request value for segment id. |
| `shop_domain` | string | No | Request value for shop domain. |

### Request body fields

None.

## Request schema


```json
{
  "type": "object",
  "required": [
    "{SHOPIFY_API_VERSION"
  ],
  "properties": {
    "limit": {
      "type": "string",
      "description": "MAX = 250",
      "x-parameter-in": "query"
    },
    "org_id": {
      "type": "string",
      "x-parameter-in": "query"
    },
    "segment_id": {
      "type": "string",
      "x-parameter-in": "query"
    },
    "shop_domain": {
      "type": "string",
      "x-parameter-in": "query"
    },
    "{SHOPIFY_API_VERSION": {
      "type": "string",
      "description": "Path value for {SHOPIFY_API_VERSION."
    }
  }
}
```

## Request example


```json
{
  "limit": "2",
  "org_id": "30dcfb49-8ae0-44ed-8403-142205a40557",
  "segment_id": "gid://shopify/Segment/455341768819",
  "shop_domain": "dev-store-749237498237499135.myshopify.com"
}
```

## Response schema


```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "cursor": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "total_spent": {
            "type": "string"
          }
        }
      }
    },
    "isLastPage": {
      "type": "boolean"
    },
    "totalCount": {
      "type": "integer"
    },
    "isFirstPage": {
      "type": "boolean"
    },
    "nextPageInfo": {
      "type": "string"
    },
    "previousPageInfo": {
      "type": [
        "null"
      ]
    }
  }
}
```

## Response examples


```json
{
  "200": {
    "data": [
      {
        "id": "gid://shopify/CustomerSegmentMember/9648311730291",
        "email": "ayumu.hirano@example.com",
        "phone": "+16135550127",
        "cursor": "AAAIxmwxgHMAABBlMWNiZjk0NDZmYzcyZWQ3",
        "currency": "USD",
        "last_name": "Hirano",
        "first_name": "Ayumu",
        "total_spent": "0.0"
      },
      {
        "id": "gid://shopify/CustomerSegmentMember/9648311763059",
        "email": "karine.ruby@example.com",
        "phone": "+16135550142",
        "cursor": "AAAIxmwyAHMAABBlMWNiZjk0NDZmYzcyZWQ3",
        "currency": "USD",
        "last_name": "Ruby",
        "first_name": "Karine",
        "total_spent": "0.0"
      },
      {
        "id": "gid://shopify/CustomerSegmentMember/9648311795827",
        "email": "Russel.winfield@example.com",
        "phone": "+16135550135",
        "cursor": "AAAIxmwygHMAABBlMWNiZjk0NDZmYzcyZWQ3",
        "currency": "USD",
        "last_name": "Winfield",
        "first_name": "Russell",
        "total_spent": "0.0"
      },
      {
        "id": "gid://shopify/CustomerSegmentMember/9775456354419",
        "email": null,
        "phone": "+919049474610",
        "cursor": "AAAI5AaagHMAABBlMWNiZjk0NDZmYzcyZWQ3",
        "currency": "USD",
        "last_name": null,
        "first_name": "piyush",
        "total_spent": "0.0"
      },
      {
        "id": "gid://shopify/CustomerSegmentMember/9782293299315",
        "email": "srujal.keher@leadows.com",
        "phone": "+917020436591",
        "cursor": "AAAI5Z4eAHMAABBlMWNiZjk0NDZmYzcyZWQ3",
        "currency": "USD",
        "last_name": "khere",
        "first_name": "srujal",
        "total_spent": "0.0"
      },
      {
        "id": "gid://shopify/CustomerSegmentMember/9782576611443",
        "email": null,
        "phone": "+918329599610",
        "cursor": "AAAI5a8BAHMAABBlMWNiZjk0NDZmYzcyZWQ3",
        "currency": "USD",
        "last_name": null,
        "first_name": "Arun",
        "total_spent": "0.0"
      },
      {
        "id": "gid://shopify/CustomerSegmentMember/9799338950771",
        "email": "harshal.honde@leadows.com",
        "phone": "+917385024985",
        "cursor": "AAAI6ZYeAHMAABBlMWNiZjk0NDZmYzcyZWQ3",
        "currency": "USD",
        "last_name": "Honde",
        "first_name": "Harshal",
        "total_spent": "0.0"
      },
      {
        "id": "gid://shopify/CustomerSegmentMember/9799340982387",
        "email": "pranay.kharabe@leadows.com",
        "phone": "+917385551378",
        "cursor": "AAAI6ZY9AHMAABBlMWNiZjk0NDZmYzcyZWQ3",
        "currency": "USD",
        "last_name": "kharabe",
        "first_name": "Pranay",
        "total_spent": "0.0"
      },
      {
        "id": "gid://shopify/CustomerSegmentMember/9799342162035",
        "email": "sameeksha.bhoyar@leadows.com",
        "phone": "+919561027416",
        "cursor": "AAAI6ZZPAHMAABBlMWNiZjk0NDZmYzcyZWQ3",
        "currency": "USD",
        "last_name": "Bhoyar",
        "first_name": "Sameeksha",
        "total_spent": "0.0"
      },
      {
        "id": "gid://shopify/CustomerSegmentMember/9799397867635",
        "email": null,
        "phone": "+918798653894",
        "cursor": "AAAI6ZmhAHMAABBlMWNiZjk0NDZmYzcyZWQ3",
        "currency": "USD",
        "last_name": null,
        "first_name": "Rohit",
        "total_spent": "0.0"
      }
    ],
    "isLastPage": false,
    "totalCount": 11,
    "isFirstPage": true,
    "nextPageInfo": "AAAI6ZmhAHMAABBlMWNiZjk0NDZmYzcyZWQ3",
    "previousPageInfo": null
  },
  "400": {
    "message": "segment_id is required"
  }
}
```

## Status codes


```json
[
  {
    "code": 200,
    "description": "OK"
  },
  {
    "code": 400,
    "description": "Bad Request"
  },
  {
    "code": 400,
    "description": "Bad Request"
  }
]
```

## Generated integration examples

The following examples are generated from the published **GET /shopify/{{SHOPIFY_API_VERSION}}/segments/customers** contract and use placeholder credentials.

### cURL


```curl
curl --request GET 'https://connectors.1spoc.com/shopify/{{SHOPIFY_API_VERSION}}/segments/customers?limit=2&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&segment_id=gid%3A%2F%2Fshopify%2FSegment%2F455341768819&shop_domain=dev-store-749237498237499135.myshopify.com'
```

### JavaScript


```javascript
const response = await fetch('https://connectors.1spoc.com/shopify/{{SHOPIFY_API_VERSION}}/segments/customers?limit=2&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&segment_id=gid%3A%2F%2Fshopify%2FSegment%2F455341768819&shop_domain=dev-store-749237498237499135.myshopify.com', {
  method: 'GET',
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
console.log(data);
```

### NodeJS


```node
const response = await fetch('https://connectors.1spoc.com/shopify/{{SHOPIFY_API_VERSION}}/segments/customers?limit=2&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&segment_id=gid%3A%2F%2Fshopify%2FSegment%2F455341768819&shop_domain=dev-store-749237498237499135.myshopify.com', {
  method: 'GET',
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
console.log(data);
```

### Python


```python
import json
import requests

url = 'https://connectors.1spoc.com/shopify/{{SHOPIFY_API_VERSION}}/segments/customers?limit=2&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&segment_id=gid%3A%2F%2Fshopify%2FSegment%2F455341768819&shop_domain=dev-store-749237498237499135.myshopify.com'
headers = {}
response = requests.get(url, headers=headers)

response.raise_for_status()
print(response.json())
```

### Java


```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://connectors.1spoc.com/shopify/{{SHOPIFY_API_VERSION}}/segments/customers?limit=2&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&segment_id=gid%3A%2F%2Fshopify%2FSegment%2F455341768819&shop_domain=dev-store-749237498237499135.myshopify.com"))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();

var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
```

### PHP


```php
<?php
$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => 'https://connectors.1spoc.com/shopify/{{SHOPIFY_API_VERSION}}/segments/customers?limit=2&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&segment_id=gid%3A%2F%2Fshopify%2FSegment%2F455341768819&shop_domain=dev-store-749237498237499135.myshopify.com',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'GET',
]);
$response = curl_exec($curl);
if ($response === false) throw new Exception(curl_error($curl));
curl_close($curl);
echo $response;
```

### C#


```csharp
using System.Net.Http.Headers;
using System.Text;

using var client = new HttpClient();
var response = await client.GetAsync("https://connectors.1spoc.com/shopify/{{SHOPIFY_API_VERSION}}/segments/customers?limit=2&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&segment_id=gid%3A%2F%2Fshopify%2FSegment%2F455341768819&shop_domain=dev-store-749237498237499135.myshopify.com");
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

### Go


```go
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    request, err := http.NewRequest("GET", "https://connectors.1spoc.com/shopify/{{SHOPIFY_API_VERSION}}/segments/customers?limit=2&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&segment_id=gid%3A%2F%2Fshopify%2FSegment%2F455341768819&shop_domain=dev-store-749237498237499135.myshopify.com", nil)
    if err != nil { panic(err) }
    request.Header.Set("Accept", "application/json")
    response, err := http.DefaultClient.Do(request)
    if err != nil { panic(err) }
    defer response.Body.Close()
    data, err := io.ReadAll(response.Body)
    if err != nil { panic(err) }
    if response.StatusCode >= 400 { panic(fmt.Sprintf("HTTP %d: %s", response.StatusCode, data)) }
    fmt.Println(string(data))
}
```

## Related resources

- [Interactive documentation page](https://devdocs.1spoc.com/docs/shopify/1-0/2-a-get-customers-by-segment)
- [Version documentation](https://devdocs.1spoc.com/docs/shopify/1-0.md)
- [OpenAPI JSON](https://devdocs.1spoc.com/docs/shopify/1-0/openapi.json)
- [OpenAPI YAML](https://devdocs.1spoc.com/docs/shopify/1-0/openapi.yaml)
- [Postman collection](https://devdocs.1spoc.com/postman/shopify/1-0/collection.json)
- [Postman environment](https://devdocs.1spoc.com/postman/shopify/1-0/environment.json)
- [MCP setup](https://devdocs.1spoc.com/mcp-setup)
- [AI documentation index](https://devdocs.1spoc.com/llms.txt)
- [Complete AI documentation](https://devdocs.1spoc.com/llms-full.txt)
- [Node.js SDK](https://devdocs.1spoc.com/sdk/shopify/1-0/node.zip)
- [Python SDK](https://devdocs.1spoc.com/sdk/shopify/1-0/python.zip)
- [Java SDK](https://devdocs.1spoc.com/sdk/shopify/1-0/java.zip)

## Guidance for AI assistants

Treat this document and its linked OpenAPI contract as the source of truth for **GET /shopify/{{SHOPIFY_API_VERSION}}/segments/customers**.

- Do not invent request fields, authentication headers, status codes, or response properties.
- Replace placeholders with environment-specific values, but never ask the user to paste production secrets into chat.
- Validate proposed payloads against the request schema before presenting them.
- Explain which values are required and identify assumptions clearly.
- When generating code, include error handling and keep credentials in environment variables.
- Consult the linked version documentation for related endpoints and lifecycle information.
