# Create product draft

`POST /api/v1/Tenants/{tenantId}/Products`

Core API · Products · base URL `https://core-api.ancon.io` · auth: `Access-Token` header · docs: https://ancon.dev/api/core/products/create-product-draft

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `tenantId` | string (uuid) | yes |  |

## Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `correlationId` | string | no | Correlation Id for the request |

## Request body

Content type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `productGroupId` | string (uuid) | yes | Product group id for this product |
| `productOutletId` | string (uuid) or null | no | Outlet id this product belongs to |
| `name` | string | yes | Name of the product |
| `description` | string or null | no | Description of the product |
| `allergyInformation` | string or null | no | Allergy information for the product if any is available. For example (Contains traces of peanuts) |
| `hasVariants` | boolean | no | True means ths product has more than one variants for example a product named Coca-Cola can have two variants: 33cl, 50cl. False means that there will only be one variant |
| `mandatoryToPickVariant` | boolean | no | Gets a value indicating whether if it is mandatory to select variant instead of default selection. This applies only for standard products and when there are more than one variants. |
| `autoAccept` | boolean | no | Gets a value indicating whether auto accept mode is enabled for the product. |
| `availableInAllOutlets` | boolean | no | If true will make the product shared with all outlets within the tenant |
| `flowViewEnabled` | boolean | no | Gets a value indicating whether the flowview enabled for the product. Default value will be false (which means AccordianView). This should be only applicable to Standard Products and only available in POS. |
| `courseId` | string (uuid) or null | no | Optional course id this product will have by default when added to a check |

### Example

```json
{
  "productGroupId": "a6860aef-48dd-4792-b424-bf335b7e1905",
  "productOutletId": "0960d591-f688-4a29-b1b0-abc7b7246d09",
  "name": "Bacon burger",
  "description": "A nice bacon burger (200g)",
  "allergyInformation": "Contains traces of nuts",
  "hasVariants": false,
  "mandatoryToPickVariant": false,
  "autoAccept": true,
  "availableInAllOutlets": false,
  "flowViewEnabled": false,
  "courseId": null
}
```

## Responses

| Status | Description |
| --- | --- |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Not Found |

### 201 response (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | no |  |

#### Example (from schema)

```json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```

### 400 response (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | string or null | no |  |
| `errorCode` | string (uuid) | no |  |
| `additionalData` | any or null | no |  |

#### Delivery request is not valid

```json
{
  "message": "Delivery information is not valid!",
  "errorCode": "41fcedd1-dfef-4d0d-a5b3-2e28da7dfc9a",
  "additionalData": null
}
```

### 401 response (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | string or null | no |  |

#### Example (from schema)

```json
{
  "message": "string"
}
```

### 404 response (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | string or null | no |  |
| `errorCode` | string (uuid) | no |  |

#### Example (from schema)

```json
{
  "message": "string",
  "errorCode": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```

## Example request

```bash
curl -X POST "https://core-api.ancon.io/api/v1/Tenants/{tenantId}/Products" \
  -H "Access-Token: $ANCON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "productGroupId": "a6860aef-48dd-4792-b424-bf335b7e1905",
  "productOutletId": "0960d591-f688-4a29-b1b0-abc7b7246d09",
  "name": "Bacon burger",
  "description": "A nice bacon burger (200g)",
  "allergyInformation": "Contains traces of nuts",
  "hasVariants": false,
  "mandatoryToPickVariant": false,
  "autoAccept": true,
  "availableInAllOutlets": false,
  "flowViewEnabled": false,
  "courseId": null
}'
```
