[POST] .../v1/barcode/setbase
Makes barcode primary. Use this method to set one barcode as the primary barcode for an item before item lookup, printing or POS exchange workflows use it. It returns row_affected and accepts either a positive barcode id or, when id is not provided, item_id plus value up to 128 characters to identify the barcode. The caller must have barcode edit permission; missing body, invalid identifiers or value, denied access, missing barcode records and persistent errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | Int64 | Optional | Barcode ID. When this value is positive, item_id and value are not validated by the controller. |
| item_id | Int64 | Optional | Item ID. Required together with value only when id is not provided. |
| value | String | Optional | Barcode value. Required together with item_id and limited to 128 characters only when id is not provided. |
Request Example
{
"id": 1,
"item_id": 1,
"value": "string"
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Update | Update operation result. |
Response Example
{
"ok": true,
"result": {
"ids": [
null
],
"row_affected": 1
}
}