Skip to main content

Auto-Generate Barcodes

Auto-generate barcode values and assign them to products or inventory items. The system will generate a unique value based on your supplier settings.

Auto-Generate for Productโ€‹

Endpointโ€‹

POST /v1/barcodes/products/auto-generate

Required Scopeโ€‹

products:write

Request Bodyโ€‹

FieldTypeRequiredDescription
product_idintegerYesThe product ID
barcode_typestringNoBarcode type (uses supplier default if not specified)

Request Exampleโ€‹

curl -X POST "https://app.equipdash.com/api/v1/barcodes/products/auto-generate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"product_id": 123,
"barcode_type": "qr"
}'

Responseโ€‹

{
"data": {
"id": 1,
"barcode_value": "RENT-P123-A7B3C9",
"barcode_type": "qr",
"barcode_type_label": "QR Code",
"is_auto_generated": true,
"entity_type": "product",
"entity_id": 123,
"entity": {
"type": "product",
"id": 123,
"name": "Mountain Bike",
"sku": "MTB-2024"
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2024-01-15T12:00:00Z"
}
}

Auto-Generate for Inventory Itemโ€‹

Endpointโ€‹

POST /v1/barcodes/inventory/auto-generate

Required Scopeโ€‹

products:write

Request Bodyโ€‹

FieldTypeRequiredDescription
inventory_idintegerYesThe inventory item ID
barcode_typestringNoBarcode type (uses supplier default if not specified)

Request Exampleโ€‹

curl -X POST "https://app.equipdash.com/api/v1/barcodes/inventory/auto-generate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"inventory_id": 456
}'

Responseโ€‹

{
"data": {
"id": 2,
"barcode_value": "RENT-I456-X9Y8Z7",
"barcode_type": "qr",
"barcode_type_label": "QR Code",
"is_auto_generated": true,
"entity_type": "inventory",
"entity_id": 456,
"entity": {
"type": "inventory",
"id": 456,
"identifier": "MTB-001",
"product_id": 123,
"product_name": "Mountain Bike",
"variation_id": null
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2024-01-15T12:00:00Z"
}
}

Generate Value Onlyโ€‹

Generate a barcode value without creating a barcode record. Useful for previewing or validation.

Endpointโ€‹

POST /v1/barcodes/generate-value

Required Scopeโ€‹

products:read

Request Bodyโ€‹

FieldTypeRequiredDescription
barcode_typestringNoBarcode type for format validation

Request Exampleโ€‹

curl -X POST "https://app.equipdash.com/api/v1/barcodes/generate-value" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"barcode_type": "code128"}'

Responseโ€‹

{
"data": {
"barcode_value": "RENT-001-K4L5M6"
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2024-01-15T12:00:00Z"
}
}