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

# Shop Category Model

> The shop category data model represents the mappings between shops and categories in the Cobi system.

<Note>
  **Important**: The shop category model has dependencies on both the shop and
  category models. The `shop_id` field must reference an existing shop and the
  `category_id` field must reference an existing category. It's recommended to
  upload shop and category data before uploading shop category mappings.
</Note>

## Schema

```json theme={null}
{
  "type": "object",
  "required": ["shop_category_id", "shop_id", "category_id", "region"],
  "properties": {
    "shop_category_id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier for the shop category mapping"
    },
    "shop_id": {
      "type": "string",
      "format": "uuid",
      "description": "ID of the shop (must reference an existing shop)"
    },
    "category_id": {
      "type": "string",
      "format": "uuid",
      "description": "ID of the category (must reference an existing category)"
    },
    "region": {
      "type": "string",
      "description": "Geographic region (2-letter country code, ISO 3166-1 alpha-2)"
    },
    "created": {
      "type": "string",
      "format": "date-time",
      "nullable": true,
      "description": "Timestamp when the record was created"
    },
    "updated": {
      "type": "string",
      "format": "date-time",
      "nullable": true,
      "description": "Timestamp when the record was last updated"
    },
    "is_deleted": {
      "type": "boolean",
      "nullable": true,
      "description": "Flag indicating if the record is marked as deleted"
    }
  }
}
```

## Field Descriptions

### Required Fields

| Field              | Type   | Format | Description                                                      |
| ------------------ | ------ | ------ | ---------------------------------------------------------------- |
| `shop_category_id` | string | UUID   | Unique identifier for the shop category mapping                  |
| `shop_id`          | string | UUID   | ID of the shop (must reference an existing shop)                 |
| `category_id`      | string | UUID   | ID of the category (must reference an existing category)         |
| `region`           | string | -      | Geographic region (2-letter country code, e.g., "CA" for Canada) |

### Optional Fields

| Field        | Type    | Format    | Description                                        |
| ------------ | ------- | --------- | -------------------------------------------------- |
| `created`    | string  | date-time | Timestamp when the record was created              |
| `updated`    | string  | date-time | Timestamp when the record was last updated         |
| `is_deleted` | boolean | -         | Flag indicating if the record is marked as deleted |

## Example

```json theme={null}
{
  "shop_category_id": "550e8400-e29b-41d4-a716-446655440000",
  "shop_id": "550e8400-e29b-41d4-a716-446655440001",
  "category_id": "550e8400-e29b-41d4-a716-446655440002",
  "region": "CA",
  "created": "2023-01-15T14:30:00Z",
  "updated": "2023-06-22T09:15:30Z",
  "is_deleted": false
}
```

## Best Practices

1. **UUID Format**: Use valid UUID v4 format for all ID fields
2. **Data Dependencies**: Ensure shop\_id references an existing shop and category\_id references an existing category
3. **Region Codes**: Use ISO 3166-1 alpha-2 country codes (e.g., "CA" for Canada, "US" for United States)
4. **Data Consistency**: Ensure consistent data across all shop category mapping records

Need help? Contact our support team at [support@hellocobi.com](mailto:support@hellocobi.com)
