# Stores

A store is a sales channel connected to your ShipWave account, such as a Shopify shop or another marketplace. Every order belongs to a store. Use this endpoint to find the `storeId` that order endpoints accept.

## List Stores

```
GET /api/v1/stores
```

Requires the `read:orders` scope. The response is not paginated.

```bash
curl https://shipwave.app/api/v1/stores \
  -H "Authorization: Bearer sw_live_abc123..."
```

```typescript
const res = await fetch("https://shipwave.app/api/v1/stores", {
  headers: { Authorization: "Bearer sw_live_abc123..." },
});
const { data: stores } = await res.json();
```

### Response

```json
{
  "data": [
    {
      "id": "clw9store1",
      "platform": "shopify",
      "shopDomain": "example-shop.myshopify.com",
      "isActive": true,
      "createdAt": "2026-01-15T14:02:11.000Z"
    }
  ]
}
```

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Pass this as `storeId` when creating or filtering orders |
| `platform` | string | The connected platform, for example `shopify` |
| `shopDomain` | string | The store's domain on that platform |
| `isActive` | boolean | Inactive stores keep their history but cannot be selected automatically |
| `createdAt` | string | When the store was connected (ISO 8601) |

## When `storeId` Is Optional

On `POST /api/v1/orders`, you can leave out `storeId` if your account has exactly one active store. ShipWave uses that store. If you have no active store, or more than one, the request returns `400 VALIDATION_ERROR` and you must pass `storeId`.

## Errors

| Status | Code | Cause |
|--------|------|-------|
| 401 | `UNAUTHORIZED` | Missing, invalid, revoked, or expired key |
| 403 | `FORBIDDEN` | The key lacks `read:orders` |
