# 1. Get Segments

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

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`

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 |
| --- | --- | --- | --- |
| `filter` | string | No | search with name |
| `org_id` | string | No | Request value for org id. |
| `shop_domain` | string | No | Request value for shop domain. |

### Request body fields

None.

## Request schema


```json
{
  "type": "object",
  "required": [
    "{SHOPIFY_API_VERSION"
  ],
  "properties": {
    "filter": {
      "type": "string",
      "description": "search with name",
      "x-parameter-in": "query"
    },
    "org_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
{
  "filter": "Customers who",
  "org_id": "30dcfb49-8ae0-44ed-8403-142205a40557",
  "shop_domain": "dev-store-749237498237499135.myshopify.com"
}
```

## Response schema


```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "properties": {
              "queryUsedBySegment": {
                "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/Segment/455341768819",
        "name": "Customers who haven't purchased",
        "details": {
          "queryUsedBySegment": "number_of_orders = 0"
        }
      },
      {
        "id": "gid://shopify/Segment/455341801587",
        "name": "Customers who have purchased more than once",
        "details": {
          "queryUsedBySegment": "number_of_orders > 1"
        }
      },
      {
        "id": "gid://shopify/Segment/455341834355",
        "name": "Abandoned checkouts in the last 30 days",
        "details": {
          "queryUsedBySegment": "abandoned_checkout_date >= -30d"
        }
      },
      {
        "id": "gid://shopify/Segment/455341867123",
        "name": "Email subscribers",
        "details": {
          "queryUsedBySegment": "email_subscription_status = 'SUBSCRIBED'"
        }
      },
      {
        "id": "gid://shopify/Segment/455341899891",
        "name": "Customers who have purchased at least once",
        "details": {
          "queryUsedBySegment": "number_of_orders >= 1"
        }
      },
      {
        "id": "gid://shopify/Segment/460980977779",
        "name": "VIP Customers",
        "details": {
          "queryUsedBySegment": "orders_placed MATCHES (\n  count >= 3,\n  sum_amount >= 1000,\n  date >= -90d\n)"
        }
      },
      {
        "id": "gid://shopify/Segment/461002309747",
        "name": "More than 3 orders",
        "details": {
          "queryUsedBySegment": "orders_placed MATCHES (\n  count >= 3,\n  date >= -90d\n)"
        }
      },
      {
        "id": "gid://shopify/Segment/461002342515",
        "name": "More Than 1000 USD",
        "details": {
          "queryUsedBySegment": "amount_spent > 1000\nAND products_purchased MATCHES (\n  tag CONTAINS ''\n)"
        }
      },
      {
        "id": "gid://shopify/Segment/461002375283",
        "name": "High Purches",
        "details": {
          "queryUsedBySegment": "predicted_spend_tier = 'HIGH'"
        }
      },
      {
        "id": "gid://shopify/Segment/461002408051",
        "name": "US Customers",
        "details": {
          "queryUsedBySegment": "customer_countries CONTAINS 'US'"
        }
      }
    ],
    "isLastPage": false,
    "totalCount": 11,
    "isFirstPage": true,
    "nextPageInfo": "eyJsaW1pdCI6MTAsInNvcnRfZmllbGRzIjoiY3JlYXRlZF9hdCIsInNvcnRfZGlyIjoiYXNjIiwibGFzdF9pZCI6NDYxMDAyNDA4MDUxLCJsYXN0X3ZhbHVlIjpbIjIwMjYtMDMtMDUgMTI6Mjc6MDMuNzY5MjA2Il0sImRpcmVjdGlvbiI6Im5leHQifQ==",
    "previousPageInfo": null
  },
  "400": {
    "message": "shop_domain is required"
  },
  "404": {
    "message": "Shop not found."
  }
}
```

## Status codes


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

## Generated integration examples

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

### cURL


```curl
curl --request GET 'https://connectors.1spoc.com/shopify/{{SHOPIFY_API_VERSION}}/segments?filter=Customers+who&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&shop_domain=dev-store-749237498237499135.myshopify.com'
```

### JavaScript


```javascript
const response = await fetch('https://connectors.1spoc.com/shopify/{{SHOPIFY_API_VERSION}}/segments?filter=Customers+who&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&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?filter=Customers+who&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&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?filter=Customers+who&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&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?filter=Customers+who&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&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?filter=Customers+who&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&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?filter=Customers+who&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&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?filter=Customers+who&org_id=30dcfb49-8ae0-44ed-8403-142205a40557&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/1-get-segments)
- [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**.

- 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.
