Skip to main content

Update Barcode

Update an existing barcode's value or type.

Endpointโ€‹

PATCH /v1/barcodes/{id}

Required Scopeโ€‹

products:write

Path Parametersโ€‹

ParameterTypeDescription
idintegerThe barcode ID

Request Bodyโ€‹

FieldTypeRequiredDescription
barcode_valuestringNoNew barcode value (must be unique)
barcode_typestringNoNew barcode type

Request Exampleโ€‹

curl -X PATCH "https://app.equipdash.com/api/v1/barcodes/1" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"barcode_value": "BIKE-MTN-001-UPDATED",
"barcode_type": "qr"
}'

Responseโ€‹

{
"data": {
"id": 1,
"barcode_value": "BIKE-MTN-001-UPDATED",
"barcode_type": "qr",
"barcode_type_label": "QR Code",
"is_auto_generated": false,
"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-15T11:00:00Z"
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2024-01-15T12:00:00Z"
}
}

Error Responsesโ€‹

Barcode Not Foundโ€‹

{
"error": {
"code": "resource_not_found",
"message": "The requested barcode was not found."
},
"meta": {
"request_id": "req_abc123"
}
}

Duplicate Valueโ€‹

{
"error": {
"code": "validation_error",
"message": "The given data was invalid.",
"details": [
{
"field": "barcode_value",
"message": "This barcode value is already in use."
}
]
},
"meta": {
"request_id": "req_abc123"
}
}