---
title: "UPC-A Barcode Image API — 12-digit UPC barcodes | Imejis"
description: "Generate North-American UPC-A retail barcodes from 12-digit codes, overriding the value on every API call. Create UPC barcode images free with Imejis."
url: "https://www.imejis.io/components/barcode/upc-a"
---

# UPC-A Barcode Image API — 12-digit UPC barcodes | Imejis

North-American retail barcode (12-digit UPC).

## Use cases

- US and Canada retail packaging
- Point-of-sale labels
- Product listing images with scannable UPCs

## Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `string` | — | The raw value encoded into the barcode. |
| `format` | `string` | `"code128"` | Barcode symbology (bwip-js bcid), e.g. 'code128', 'ean13', 'upca'. |
| `barColor` | `color` | `"#000000"` | Color of the bars (dark modules). |
| `backgroundColor` | `color` | `"#ffffff"` | Background color behind the barcode. |
| `displayValue` | `boolean` | `true` | Show the human-readable text below the bars. |
| `textColor` | `color` | — | Human-readable text color (defaults to barColor). |
| `opacity` | `number` | `1` | Overall component opacity from 0 (transparent) to 1 (opaque). |
| `borderWidth` | `number` | `0` | Border thickness in pixels around the component. |
| `borderColor` | `color` | `"transparent"` | Border color (any CSS color). |
| `borderStyle` | `'solid' \| 'dashed' \| 'dotted' \| 'double' \| 'none'` | `"solid"` | Border line style. |
| `borderRadius` | `number` | `0` | Corner radius in pixels. |
| `boxShadow` | `string` | — | CSS box-shadow applied to the component, e.g. "0 4px 6px rgba(0,0,0,0.1)". |

## Design JSON (this variant)

```json
{
  "title": "Barcode sample",
  "description": "A dynamic Code 128 barcode",
  "dimensions": {
    "width": 800,
    "height": 420
  },
  "background": {
    "color": "#ffffff"
  },
  "components": [
    {
      "id": "sample-barcode",
      "key": "sku",
      "type": "barcode",
      "position": {
        "x": 240,
        "y": 140
      },
      "rotation": 0,
      "size": {
        "width": 320,
        "height": 140
      },
      "dynamic": true,
      "properties": {
        "value": "036000291452",
        "format": "upca",
        "barColor": "#000000",
        "backgroundColor": "#ffffff",
        "displayValue": true,
        "opacity": 1
      }
    }
  ]
}
```

## Examples

### US retail packaging

A 12-digit UPC placed on packaging artwork for North-American retail.

API overrides that reproduce this example:

```json
{
  "sku.format": "upca",
  "sku.value": "042100005264"
}
```

### Point-of-sale price tag

A compact UPC-A strip for a checkout-scannable shelf price tag.

API overrides that reproduce this example:

```json
{
  "sku.format": "upca",
  "sku.value": "012345678905"
}
```

## API overrides

Encode a different SKU/ticket per render via '<key>.value' (or just '<key>'); format and colors can also be overridden.

Flat override payload (`key.property` addressing) with the sample design's current values — send only the keys you want to change:

```json
{
  "sku.value": "012345678905",
  "sku.format": "code128",
  "sku.barColor": "#000000",
  "sku.backgroundColor": "#ffffff",
  "sku.displayValue": true,
  "sku.opacity": 1
}
```

```bash
curl --location 'https://render.imejis.io/v1/{{YOUR_DESIGN_ID}}' \
--header 'dma-api-key: {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "sku.value": "012345678905",
    "sku.format": "code128",
    "sku.barColor": "#000000",
    "sku.backgroundColor": "#ffffff",
    "sku.displayValue": true,
    "sku.opacity": 1
}'
```

`{{YOUR_DESIGN_ID}}` and `{{YOUR_API_KEY}}` are placeholders: first create
the design in your account (paste the sample design JSON above into the
editor at https://app.imejis.io, or create it programmatically via the
imejis MCP server's `create_design` + `update_design` tools), then render
it with the design's id and one of your API keys.

Agents: the MCP server at https://api.imejis.io/api/mcp exposes this same
catalog as structured data via the `list_component_types` tool (property
kinds, allowed values, bounds, ready-to-use sample designs).

## Related

- [Barcode component](https://www.imejis.io/components/barcode.md) — full reference and FAQs
- [EAN-13](https://www.imejis.io/components/barcode/ean-13.md) — Retail product barcode used outside North America (13-digit GTIN).
- [Bars only](https://www.imejis.io/components/barcode/bars-only.md) — No human-readable text — for tight layouts where the value is printed elsewhere.
