# Create product group

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

Core API · ProductGroups · base URL `https://core-api.ancon.io` · auth: `Access-Token` header · docs: https://ancon.dev/api/core/product-groups/create-product-group

**Deprecated.**

## 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 |
| --- | --- | --- | --- |
| `name` | string | yes |  |
| `taxes` | array<object> or null | no |  |
| `taxes[].id` | string (uuid) | no |  |
| `taxes[].orderFormats` | integer (int32) | yes | Allowed values: `0`, `1`, `2`, `4`, `8`, `16`, `32`, `64`, `128`, `159`, `191`. |
| `outletProductGroupSettings` | array<object> | yes |  |
| `outletProductGroupSettings[].outletId` | string (uuid) | no |  |
| `outletProductGroupSettings[].accountNumber` | string or null | no |  |
| `outletProductGroupSettings[].voucherTracking` | object or null | no |  |
| `outletProductGroupSettings[].voucherTracking.costCenter` | string or null | no |  |
| `outletProductGroupSettings[].voucherTracking.project` | string or null | no |  |
| `outletProductGroupSettings[].custom1` | string or null | no |  |
| `outletProductGroupSettings[].custom2` | string or null | no |  |
| `outletProductGroupSettings[].custom3` | string or null | no |  |
| `outletProductGroupSettings[].custom4` | string or null | no |  |
| `outletProductGroupSettings[].custom5` | string or null | no |  |
| `tags` | array<object> or null | no |  |
| `tags[].id` | string (uuid) or null | no |  |
| `tags[].name` | string or null | no |  |

### Example (from schema)

```json
{
  "name": "string",
  "taxes": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "orderFormats": 0
    }
  ],
  "outletProductGroupSettings": [
    {
      "outletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "accountNumber": "string",
      "voucherTracking": {
        "costCenter": "string",
        "project": "string"
      },
      "custom1": "string",
      "custom2": "string",
      "custom3": "string",
      "custom4": "string",
      "custom5": "string"
    }
  ],
  "tags": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name": "string"
    }
  ]
}
```

## Responses

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

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `productGroup` | object or null | no |  |
| `productGroup.id` | string (uuid) | no |  |
| `productGroup.name` | string or null | no |  |
| `productGroup.type` | integer (int32) | no | Allowed values: `0`, `1`, `2`, `3`, `4`, `5`. |
| `productGroup.taxes` | array<object> or null | no |  |
| `productGroup.taxes[].id` | string (uuid) | no |  |
| `productGroup.taxes[].rate` | number (double) | no |  |
| `productGroup.taxes[].orderFormats` | integer (int32) | no | Allowed values: `0`, `1`, `2`, `4`, `8`, `16`, `32`, `64`, `128`, `159`, `191`. |
| `productGroup.accounts` | array<object> or null | no |  |
| `productGroup.accounts[].id` | string (uuid) | no |  |
| `productGroup.accounts[].orderFormats` | integer (int32) | no | Allowed values: `0`, `1`, `2`, `4`, `8`, `16`, `32`, `64`, `128`, `159`, `191`. |
| `productGroup.accounts[].number` | string or null | no |  |
| `productGroup.outletProductGroupSettings` | array<object> or null | no |  |
| `productGroup.outletProductGroupSettings[].outletId` | string (uuid) | no |  |
| `productGroup.outletProductGroupSettings[].outletName` | string or null | no |  |
| `productGroup.outletProductGroupSettings[].accountNumber` | string or null | no |  |
| `productGroup.outletProductGroupSettings[].accountId` | string (uuid) or null | no |  |
| `productGroup.outletProductGroupSettings[].voucherTracking` | object or null | no |  |
| `productGroup.outletProductGroupSettings[].voucherTracking.costCenter` | string or null | no |  |
| `productGroup.outletProductGroupSettings[].voucherTracking.project` | string or null | no |  |
| `productGroup.outletProductGroupSettings[].custom1` | string or null | no |  |
| `productGroup.outletProductGroupSettings[].custom2` | string or null | no |  |
| `productGroup.outletProductGroupSettings[].custom3` | string or null | no |  |
| `productGroup.outletProductGroupSettings[].custom4` | string or null | no |  |
| `productGroup.outletProductGroupSettings[].custom5` | string or null | no |  |
| `productGroup.tags` | array<object> or null | no |  |
| `productGroup.tags[].id` | string (uuid) | no |  |
| `productGroup.tags[].name` | string or null | no |  |

#### Example (from schema)

```json
{
  "productGroup": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "string",
    "type": 0,
    "taxes": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "rate": 0,
        "orderFormats": 0
      }
    ],
    "accounts": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "orderFormats": 0,
        "number": "string"
      }
    ],
    "outletProductGroupSettings": [
      {
        "outletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "outletName": "string",
        "accountNumber": "string",
        "accountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "voucherTracking": {
          "costCenter": "string",
          "project": "string"
        },
        "custom1": "string",
        "custom2": "string",
        "custom3": "string",
        "custom4": "string",
        "custom5": "string"
      }
    ],
    "tags": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "name": "string"
      }
    ]
  }
}
```

### 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}/ProductGroups" \
  -H "Access-Token: $ANCON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "taxes": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "orderFormats": 0
    }
  ],
  "outletProductGroupSettings": [
    {
      "outletId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "accountNumber": "string",
      "voucherTracking": {
        "costCenter": "string",
        "project": "string"
      },
      "custom1": "string",
      "custom2": "string",
      "custom3": "string",
      "custom4": "string",
      "custom5": "string"
    }
  ],
  "tags": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name": "string"
    }
  ]
}'
```
