Skip to main content

Lookup Barcode

Lookup a barcode by its value. This is the primary endpoint for barcode scanner integrations.

Endpointโ€‹

POST /v1/barcodes/lookup

Required Scopeโ€‹

products:read

Request Bodyโ€‹

FieldTypeRequiredDescription
barcode_valuestringYesThe scanned barcode value

Request Exampleโ€‹

curl -X POST "https://app.equipdash.com/api/v1/barcodes/lookup" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"barcode_value": "RENT-001-A7B3C9"}'

Responseโ€‹

Barcode Foundโ€‹

{
"data": {
"barcode": {
"id": 1,
"barcode_value": "RENT-001-A7B3C9",
"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"
},
"product": {
"id": 123,
"name": "Mountain Bike",
"sku": "MTB-2024"
},
"inventory": {
"id": 456,
"identifier": "MTB-001",
"product_id": 123,
"variation_id": null
}
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2024-01-15T12:00:00Z"
}
}

Barcode Not Foundโ€‹

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

Response Fieldsโ€‹

FieldTypeDescription
barcodeobjectFull barcode details (null if not found)
productobjectAssociated product summary
inventoryobjectAssociated inventory item (if barcode is on inventory)

Use Casesโ€‹

Pickup/Return Processingโ€‹

Scan a barcode to identify the inventory item being picked up or returned:

# Scan barcode
RESULT=$(curl -s -X POST "https://app.equipdash.com/api/v1/barcodes/lookup" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"barcode_value": "RENT-001-A7B3C9"}')

# Get inventory ID from response
INVENTORY_ID=$(echo $RESULT | jq '.data.inventory.id')

Workshop Check-inโ€‹

Scan an item to add it to the workshop for maintenance:

# Lookup barcode to get inventory ID
RESULT=$(curl -s -X POST "https://app.equipdash.com/api/v1/barcodes/lookup" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"barcode_value": "RENT-001-A7B3C9"}')

# Add to workshop
curl -X POST "https://app.equipdash.com/api/v1/workshop" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"inventory_id\": $(echo $RESULT | jq '.data.inventory.id'), \"reason\": \"Routine maintenance\"}"