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โ
| Field | Type | Required | Description |
|---|---|---|---|
barcode_value | string | Yes | The barcode value to validate |
barcode_type | string | Yes | The 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โ
| Field | Type | Description |
|---|---|---|
valid | boolean | Whether the value is valid for the barcode type |
available | boolean | Whether the value is available (not already in use) |
errors | array | List of validation error messages |
Validation Rules by Typeโ
| Type | Validation Rules |
|---|---|
qr | Any alphanumeric string |
code128 | Alphanumeric with some special characters |
code39 | Uppercase letters, digits, and special chars (- . $ / + % SPACE) |
ean13 | Exactly 13 digits with valid check digit |
ean8 | Exactly 8 digits with valid check digit |
upca | Exactly 12 digits with valid check digit |