# Barcode

## Generate a barcode image

> Generates a barcode or QR code image in PNG format with customizable colors and dimensions.\
> \
> \## Supported Barcode Types\
> \- \*\*QR Code\*\*: 2D matrix barcode with error correction\
> \- \*\*PDF417\*\*: High-capacity 2D stacked barcode\
> \- \*\*UPC-A/UPC-E\*\*: Universal Product Code for retail\
> \- \*\*EAN-8/EAN-13\*\*: European Article Number for retail\
> \- \*\*Code 39/93/128\*\*: Linear barcodes for various applications\
> \- \*\*ITF-14\*\*: Interleaved 2 of 5 for shipping containers\
> \
> \## Color Parameters\
> \- Colors must be specified as 6-digit hex values (without #)\
> \- Example: \`fg=000000\` for black, \`bg=FFFFFF\` for white\
> \
> \## Dimensions\
> \- For QR codes: width acts as a sizing hint (height is ignored)\
> \- For linear barcodes: both width and height are applied\
> \
> \## Caching\
> Generated images are cached for 100 days based on query parameters.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"Barcode"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"paths":{"/api/{tenantId}/barcode/{type}/{data}":{"get":{"tags":["Barcode"],"summary":"Generate a barcode image","description":"Generates a barcode or QR code image in PNG format with customizable colors and dimensions.\n\n## Supported Barcode Types\n- **QR Code**: 2D matrix barcode with error correction\n- **PDF417**: High-capacity 2D stacked barcode\n- **UPC-A/UPC-E**: Universal Product Code for retail\n- **EAN-8/EAN-13**: European Article Number for retail\n- **Code 39/93/128**: Linear barcodes for various applications\n- **ITF-14**: Interleaved 2 of 5 for shipping containers\n\n## Color Parameters\n- Colors must be specified as 6-digit hex values (without #)\n- Example: `fg=000000` for black, `bg=FFFFFF` for white\n\n## Dimensions\n- For QR codes: width acts as a sizing hint (height is ignored)\n- For linear barcodes: both width and height are applied\n\n## Caching\nGenerated images are cached for 100 days based on query parameters.","parameters":[{"name":"data","in":"path","description":"Data to encode.","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","description":"Barcode symbology to generate.","required":true,"schema":{"$ref":"#/components/schemas/BarcodeType"}},{"name":"fg","in":"query","description":"Foreground color as HTML hex without the leading #.","schema":{"type":"string","default":"000000"}},{"name":"bg","in":"query","description":"Background color as HTML hex without the leading #.","schema":{"type":"string","default":"FFFFFF"}},{"name":"w","in":"query","description":"Target image width; for QR, acts as a hint.","schema":{"type":"integer","format":"int32","default":300}},{"name":"h","in":"query","description":"Image height; ignored for QR.","schema":{"type":"integer","format":"int32","default":50}},{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}}},"components":{"schemas":{"BarcodeType":{"enum":["PDF417","UPCA","UPCE","CODE39","CODE93","CODE128","ITF14","EAN13","EAN8","QRCODE"],"type":"string"}}}}
```
