curl -H "Authorization: Bearer $API_KEY" \
"https://api.truthlocks.com/v1/attestations/550e8400-e29b-41d4-a716-446655440000/barcode?width=400&height=100" \
--output attestation-barcode.png
const barcodeImage = await client.attestations.getBarcode(attestationId, {
width: 400,
height: 100
});
fs.writeFileSync('attestation-barcode.png', Buffer.from(barcodeImage));
"<string>"Attestations
Get Barcode
GET
/
v1
/
attestations
/
{id}
/
barcode
curl -H "Authorization: Bearer $API_KEY" \
"https://api.truthlocks.com/v1/attestations/550e8400-e29b-41d4-a716-446655440000/barcode?width=400&height=100" \
--output attestation-barcode.png
const barcodeImage = await client.attestations.getBarcode(attestationId, {
width: 400,
height: 100
});
fs.writeFileSync('attestation-barcode.png', Buffer.from(barcodeImage));
"<string>"Generate a Code 128 barcode image for an attestation. The barcode encodes only the attestation ID, making it compact enough for physical labels, receipts, and packaging.
Use cases
- Supply chain labels and inventory tags
- Physical receipts and access cards
- Printed documents where space is limited
- Barcode scanner-friendly environments (warehouses, retail)
Response
Returns a PNG image withContent-Type: image/png.
The response includes aggressive cache headers (Cache-Control: public, max-age=31536000, immutable) since barcodes for a given attestation never change.
Encoded data
The barcode contains the raw attestation UUID string. To verify, scan the barcode with any Code 128 reader, then look up the attestation using the ID.QR code vs barcode: when to use which
| Scenario | Use QR | Use Barcode |
|---|---|---|
| Digital certificates | Yes | No |
| Physical labels | Maybe | Yes |
| Supply chain | No | Yes |
| Email badges | Yes | No |
| Access cards | Either | Either |
| Mobile sharing | Yes | No |
curl -H "Authorization: Bearer $API_KEY" \
"https://api.truthlocks.com/v1/attestations/550e8400-e29b-41d4-a716-446655440000/barcode?width=400&height=100" \
--output attestation-barcode.png
const barcodeImage = await client.attestations.getBarcode(attestationId, {
width: 400,
height: 100
});
fs.writeFileSync('attestation-barcode.png', Buffer.from(barcodeImage));
Authorizations
APIKeyBearerAuth
API key for machine-to-machine authentication
Path Parameters
id owned by your workspace.
Query Parameters
Required range:
100 <= x <= 800Required range:
40 <= x <= 200Response
PNG image. Generating a code does not establish that a record exists or passes verification.
The response is of type file.

