Add

[POST] .../v1/barcode/add

Creates a new barcode. Use this method to create a barcode for an item after choosing a barcode type or generating an EAN13 value with Barcode/GenerateEan13. It creates one barcode and returns new_id after validating item_id, barcode_type_id and a non-empty value no longer than 128 characters. The caller must have barcode add permission; missing body, invalid identifiers or value, denied access, duplicate barcode conflicts and storage errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
barcode_type_id Int64 Required Barcode type ID.
forced Boolean Optional <false | null> - the barcode is not added if it is found among barcodes of other items. true - the barcode is added if it is not a duplicate for the specified item.
item_id Int64 Required Item ID.
value String Required Barcode value.

Request Example

{
  "barcode_type_id": 1,
  "forced": true,
  "item_id": 1,
  "value": "string"
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Insert Created record result.

Response Example

{
  "ok": true,
  "result": {
    "new_id": 1
  }
}