WinShopAPI docs
ReferenceProduct

Create a product barcode

Registers a barcode for the product and returns it (201, `Location` header set). Requires `Permissions.Product.Create`.

POST
/api/products/{productId}/barcodes

Authorization

Bearer
headerAuthorizationBearer <token>

OAuth 2.0 client credentials. Obtain a client id/secret from Winshop support ([email protected]), then POST to the token URL.

Path Parameters

productId*integer
Formatint32

Request Body

application/json
  1. body

A barcode identifying a product, optionally down to one variant.

allowedWarehouseId?|
Formatint32
barcode?|
Lengthlength <= 50
batchId?|
Formatint32
colorId?|
Formatint32
createdAt?|
Formatdate-time
dimensionId?|
Formatint32
discountBillCustomerId?|
Formatint32
discountBillLimit?|
Formatdecimal
discountBillPercentage?|
Formatdecimal
ean128?boolean|null
ean13?boolean|null
ean39?boolean|null
expirationDate?|
Formatdate-time
financialPromotionId?|
Formatint32
forSaleOnlyInStock?boolean|null
guid?|
Formatguid
id?|
Formatint32
isInvalid?boolean|null
isMain?boolean|null
isNotPrintable?boolean|null
isWeight?boolean|null
lastModify?|
Formatdate-time
lengthId?|
Formatint32
originalQuantity?|
Formatdecimal
personalization?|
Formatint32
price?|
Formatdecimal
priceCoefficient?|
Formatdecimal
productId?|
Formatint32
quantity?|
Formatdecimal
quantityCoefficient?|
Formatdecimal
sizeId?|
Formatint32
unitId?|
Formatint32
usedAt?|
Formatint32
usedWarehouseId?|
Formatint32
userId?|
Formatint32
validFrom?|
Formatdate-time
validTo?|
Formatdate-time
variantId?|
Formatint32

Response Body

application/json
  1. response

A barcode identifying a product, optionally down to one variant.

allowedWarehouseId?|
Formatint32
barcode?|
Lengthlength <= 50
batchId?|
Formatint32
colorId?|
Formatint32
createdAt?|
Formatdate-time
dimensionId?|
Formatint32
discountBillCustomerId?|
Formatint32
discountBillLimit?|
Formatdecimal
discountBillPercentage?|
Formatdecimal
ean128?boolean|null
ean13?boolean|null
ean39?boolean|null
expirationDate?|
Formatdate-time
financialPromotionId?|
Formatint32
forSaleOnlyInStock?boolean|null
guid?|
Formatguid
id?|
Formatint32
isInvalid?boolean|null
isMain?boolean|null
isNotPrintable?boolean|null
isWeight?boolean|null
lastModify?|
Formatdate-time
lengthId?|
Formatint32
originalQuantity?|
Formatdecimal
personalization?|
Formatint32
price?|
Formatdecimal
priceCoefficient?|
Formatdecimal
productId?|
Formatint32
quantity?|
Formatdecimal
quantityCoefficient?|
Formatdecimal
sizeId?|
Formatint32
unitId?|
Formatint32
usedAt?|
Formatint32
usedWarehouseId?|
Formatint32
userId?|
Formatint32
validFrom?|
Formatdate-time
validTo?|
Formatdate-time
variantId?|
Formatint32
curl -X POST 'https://<your-instance>/api/products/0/barcodes' \  -H 'Authorization: Bearer <access-token>' \  -H 'Content-Type: application/json' \  -d '{  "allowedWarehouseId": 1,  "barcode": "1234567890123",  "batchId": 10,  "discountBillCustomerId": 50,  "discountBillLimit": 500,  "discountBillPercentage": 10,  "expirationDate": "2026-01-01T00:00:00",  "financialPromotionId": 0,  "forSaleOnlyInStock": false,  "isInvalid": false,  "isMain": true,  "isNotPrintable": false,  "isWeight": false,  "originalQuantity": 100,  "personalization": 1,  "price": 99.99,  "priceCoefficient": 1,  "productId": 123,  "quantity": 100,  "quantityCoefficient": 1,  "unitId": 1,  "usedAt": 0,  "usedWarehouseId": 0,  "validFrom": "2025-01-01T00:00:00",  "validTo": "2025-12-31T00:00:00"}'
{  "allowedWarehouseId": 0,  "barcode": "string",  "batchId": 0,  "colorId": 0,  "createdAt": "2019-08-24T14:15:22Z",  "dimensionId": 0,  "discountBillCustomerId": 0,  "discountBillLimit": 0,  "discountBillPercentage": 0,  "ean128": true,  "ean13": true,  "ean39": true,  "expirationDate": "2019-08-24T14:15:22Z",  "financialPromotionId": 0,  "forSaleOnlyInStock": true,  "guid": "string",  "id": 0,  "isInvalid": true,  "isMain": true,  "isNotPrintable": true,  "isWeight": true,  "lastModify": "2019-08-24T14:15:22Z",  "lengthId": 0,  "originalQuantity": 0,  "personalization": 0,  "price": 0,  "priceCoefficient": 0,  "productId": 0,  "quantity": 0,  "quantityCoefficient": 0,  "sizeId": 0,  "unitId": 0,  "usedAt": 0,  "usedWarehouseId": 0,  "userId": 0,  "validFrom": "2019-08-24T14:15:22Z",  "validTo": "2019-08-24T14:15:22Z",  "variantId": 0}