Skip to main content

Validate Barcode

Check if a barcode value is valid for a given type and available for use.

Endpointโ€‹

POST /v1/barcodes/validate

Required Scopeโ€‹

products:read

Request Bodyโ€‹

FieldTypeRequiredDescription
barcode_valuestringYesThe barcode value to validate
barcode_typestringYesThe barcode type to validate against

Request Exampleโ€‹

curl -X POST "https://app.equipdash.com/api/v1/barcodes/validate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"barcode_value": "123456789012",
"barcode_type": "ean13"
}'

Responseโ€‹

Valid and Availableโ€‹

{
"data": {
"valid": true,
"available": true,
"errors": []
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2024-01-15T12:00:00Z"
}
}

Invalid Formatโ€‹

{
"data": {
"valid": false,
"available": true,
"errors": [
"Barcode value is not valid for the specified type."
]
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2024-01-15T12:00:00Z"
}
}

Already In Useโ€‹

{
"data": {
"valid": true,
"available": false,
"errors": [
"Barcode value is already in use."
]
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2024-01-15T12:00:00Z"
}
}

Response Fieldsโ€‹

FieldTypeDescription
validbooleanWhether the value is valid for the barcode type
availablebooleanWhether the value is available (not already in use)
errorsarrayList of validation error messages

Validation Rules by Typeโ€‹

TypeValidation Rules
qrAny alphanumeric string
code128Alphanumeric with some special characters
code39Uppercase letters, digits, and special chars (- . $ / + % SPACE)
ean13Exactly 13 digits with valid check digit
ean8Exactly 8 digits with valid check digit
upcaExactly 12 digits with valid check digit