**Version: 202201**

# Create Collect

**POST** `/openapi/2022-01/collects`

Associates a product with a collection by creating a collect object.

## Request

**application/json**

**Body | Example**

**Body**

- `collect` object

  - `collection_id` string

    Collection's ID, for example: `0097cfc8-63c3-45ed-ab9f-6f2231b700k9`
  - `product_id` string

    Product's ID, for example: `0097cfc8-63c3-45ed-ab9f-6f2231b700k9`

```json
{
  "collect": {
    "collection_id": "string",
    "product_id": "string"
  }
}
```

## Responses

**200 | 422**

200

**application/json**

**Schema | Example | Result**

**Schema**

- `collect` object

  - `id` string

    **Example:** `c0bcd1a9-8a42-4b8d-b2eb-b8a11b742da6`
  - `collection_id` string

    **Example:** `a60fe556-43ad-4e07-9125-507ac1bf71f7`
  - `product_id` string

    **Example:** `ea8f38ba-a152-4c64-a12c-50ea77ac4245`
  - `position` integer

    **Default value:** `0`

    **Example:** `2`
  - `created_at` string

    **Example:** `2024-04-16T11:34:32Z`
  - `updated_at` string

    **Example:** `2024-04-16T11:34:32Z`

```json
{
  "collect": {
    "id": "c0bcd1a9-8a42-4b8d-b2eb-b8a11b742da6",
    "collection_id": "a60fe556-43ad-4e07-9125-507ac1bf71f7",
    "product_id": "ea8f38ba-a152-4c64-a12c-50ea77ac4245",
    "position": 2,
    "created_at": "2024-04-16T11:34:32Z",
    "updated_at": "2024-04-16T11:34:32Z"
  }
}
```

```json
{
    "collect": {
        "id": "c0bcd1a9-8a42-4b8d-b2eb-b8a11b742da6",
        "collection_id": "a60fe556-43ad-4e07-9125-507ac1bf71f7",
        "product_id": "ea8f38ba-a152-4c64-a12c-50ea77ac4245",
        "position": 2,
        "created_at": "2024-04-16T11:34:32Z",
        "updated_at": "2024-04-16T11:34:32Z"
    }
}
```

422

**application/json**

**Schema | Example | Result**

**Schema**

- `errors` string[]

```json
{
  "errors": [
    "ProductId is required"
  ]
}
```

```json
{
  "errors": [
    "ProductId is required"
  ]
}
```
