---
title: "Add a barcode to a colour bar item"
method: POST
path: "/v1/locations/{locationId}/colour-bar-items/{colourBarItemId}/eans"
tags: ["Colour bar items"]
---

# Add a barcode to a colour bar item

`POST /v1/locations/{locationId}/colour-bar-items/{colourBarItemId}/eans`

## Request

- Base URL: `https://api.cliento.com`
- URL: `https://api.cliento.com/v1/locations/{locationId}/colour-bar-items/{colourBarItemId}/eans`
- Auth: HTTP bearer

Gives the item a barcode of its own, as when a delivery row was matched by its article number and its barcode is new. A barcode that another item or a product of the location has is refused with `duplicate`.

## Path parameters

- `locationId` string, required
- `colourBarItemId` string, required

## Headers

- `Idempotency-Key` string

## Request body

- ColourBarBarcode
  - `ean` string, required: The barcode, at most 50 characters.

## Response `200`

OK

- ColourBarItem: Represents one thing a location mixes from at its colour bar: one shade of a colour, one strength of a developer, one tub of bleach. Belongs to a colour bar range and to the range's location. Holds its own balance in the location's stock, counted in packs, and how much has been taken from the pack that is open. It is not a product: it is never sold at a point of sale.
  - `articleNumber` string: The supplier's article number, as read from a delivery note.
  - `catalogueEans` string[], required: Read-only. Those of `eans` that the item has from the article in a supplier's catalogue it was made from. They are not the item's own and cannot be removed from it. Can be empty.
  - `createdAt` string, date-time, required
  - `eans` string[], required: The item's barcodes: its own, and those in `catalogueEans`. Can be empty.
  - `gramsLeft` integer: Read-only. Grams left in all the item's packs together. Left out when the item has no pack size.
  - `id` string, required: Colour bar item id.
  - `listPrice` string: The list price of one pack, VAT excluded, where the item differs from its range. Left out when the item follows the range's `listPrice`.
  - `listPriceInUse` string: Read-only. The list price that applies: the item's own, otherwise its range's.
  - `locationId` string, required
  - `name` string, required: What the item is called. An item without a name of its own is called by its `shade`, and follows it when the shade is changed.
  - `openLeft` integer: Read-only. Grams left in the open pack. Left out when no pack is open or the item has no pack size.
  - `openUsed` integer, required: Read-only. Grams taken from the open pack. `0` when no pack is open.
  - `packSize` integer: Grams in one pack, where the item differs from its range. Left out when the item follows the range's `packSize`.
  - `packSizeInUse` integer: Read-only. The pack size that applies: the item's own, otherwise its range's. Left out for an item used a whole pack at a time.
  - `packs` integer, required: Read-only. The packs in stock, the open one included. Never negative.
  - `rangeId` string, required: The range the item belongs to. Set when the item is created.
  - `shade` string: The shade of a colour, as the supplier writes it.
  - `strengthPercent` string: The strength of a developer in per cent, as a decimal string.
  - `unopenedPacks` integer, required: Read-only. The packs that are not opened.
  - `updatedAt` string, date-time, required: When the item last changed, which includes its stock and its own barcodes.

## Other responses

- `default`: Any failure. See the Errors section.

---

[API](https://skmtc.dev/cliento/apis/cliento-api.md) · [All operations](https://skmtc.dev/cliento/apis/cliento-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cliento/apis/cliento-api/revisions/29ca811bc061?raw)
