> ## Documentation Index
> Fetch the complete documentation index at: https://docs.statproxies.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Customer Orders

> Retrieve all orders and proxy details for a specific customer ID.

Retrieve all orders associated with a specific customer ID, including proxy details.

## Request

### Headers

| Header          | Value                   | Required |
| --------------- | ----------------------- | -------- |
| `Authorization` | `Bearer {your_api_key}` | Yes      |

### Path Parameters

<ParamField path="customer_id" type="string" required>
  The customer ID to search for. Must be lowercase letters only (a-z).
</ParamField>

### Example Request

```bash theme={null}
curl -X GET "https://dashboard.statproxies.com/api/v2/order/fetch/customer/clientabc" \
  -H "Authorization: Bearer {your_api_key}"
```

## Response

### Success Response

```json theme={null}
{
  "response": "success",
  "customer_id": "clientabc",
  "total_orders": 2,
  "orders": [
    {
      "order_id": "sub_1rqjp3jb4g9i6pkhdwmkpjob",
      "subscription_id": "sub_1RqJP3JB4G9i6PKHDwmKPJOb",
      "product_type": "captcha",
      "product_name": "Captcha Proxies",
      "quantity": 10,
      "unix_purchase_date": 1753815092,
      "unix_expiration_date": 1756493492,
      "proxy_username": "sub_1rqjp3jb4g9i6pkhdwmkpjob",
      "proxy_password": "stat261",
      "customer": "clientabc",
      "proxies": [
        "31.193.191.6:3128:sub_1rqjp3jb4g9i6pkhdwmkpjob:stat261",
        "31.193.191.7:3128:sub_1rqjp3jb4g9i6pkhdwmkpjob:stat261"
      ]
    },
    {
      "order_id": "sub_2abcd4jb4g9i6pkhdwmkxyz",
      "subscription_id": "sub_2ABCD4JB4G9i6PKHDwmKXYZ",
      "product_type": "x1",
      "product_name": "X1 Fiber ISP",
      "quantity": 5,
      "unix_purchase_date": 1753900000,
      "unix_expiration_date": 1756578400,
      "proxy_username": "sub_2abcd4jb4g9i6pkhdwmkxyz",
      "proxy_password": "stat789",
      "customer": "clientabc",
      "proxies": [
        "192.168.1.1:3128:sub_2abcd4jb4g9i6pkhdwmkxyz:stat789"
      ]
    }
  ]
}
```

### Response Fields

<ResponseField name="response" type="string">
  Status of the request.
</ResponseField>

<ResponseField name="customer_id" type="string">
  The customer ID that was searched.
</ResponseField>

<ResponseField name="total_orders" type="integer">
  Total number of orders found for this customer.
</ResponseField>

<ResponseField name="orders" type="array">
  Array of order objects with proxy details.
</ResponseField>

### Order Object Fields

| Field                  | Type    | Description                   |
| ---------------------- | ------- | ----------------------------- |
| `order_id`             | string  | Unique order identifier       |
| `subscription_id`      | string  | Stripe subscription ID        |
| `product_type`         | string  | Product type identifier       |
| `product_name`         | string  | Human-readable product name   |
| `quantity`             | integer | Number of proxies             |
| `unix_purchase_date`   | integer | Purchase timestamp            |
| `unix_expiration_date` | integer | Expiration timestamp          |
| `proxy_username`       | string  | Proxy authentication username |
| `proxy_password`       | string  | Proxy authentication password |
| `customer`             | string  | Customer identifier           |
| `proxies`              | array   | List of proxy strings         |

### Error Responses

#### 400 Bad Request - Invalid Customer ID

```json theme={null}
{
  "error": "Invalid customer ID format. Only lowercase letters are allowed"
}
```

#### 404 Not Found - No Orders

```json theme={null}
{
  "response": "success",
  "message": "No orders found for this customer ID",
  "orders": []
}
```

## Use Case

The customer ID feature is useful for:

* **Resellers**: Track orders for specific clients
* **Enterprises**: Organize proxies by department or project
* **Automation**: Programmatically manage proxies per customer

When creating orders via the API, you can specify a `customer` parameter to tag orders for later retrieval using this endpoint.

## Example Workflow

```bash theme={null}
# 1. Create an order with customer ID
curl -X POST "https://dashboard.statproxies.com/api/v2/order/newscale" \
  -H "Authorization: Bearer {your_api_key}" \
  -H "Content-Type: application/json" \
  -d '{"quantity": 10, "product_type": "captcha", "customer": "projectalpha"}'

# 2. Later, retrieve all orders for that customer
curl -X GET "https://dashboard.statproxies.com/api/v2/order/fetch/customer/projectalpha" \
  -H "Authorization: Bearer {your_api_key}"
```
