---
title: "Action scan_barcode"
description: "Recognizes a barcode on an image by URL and saves the value to a constant."
---

# Action `scan_barcode`

> **System ID:** `action_scan_barcode`

## Description

Downloads an image from `source_url`, recognizes a barcode of the specified type, and writes the result to a constant (`set_to` or `scanned_barcode`). URL and type support placeholders.

## Events (scenario branches)

| Event | When it occurs |
|-------|----------------|
| **recognized** | Barcode recognized and saved |
| **not_recognized** | Failed to download the image or find a barcode |

## Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `source_url` | string | yes | — | Image URL with the barcode (placeholders) |
| `type` | string | yes | `ean13` | Barcode type (`ean13`, `code128`, `ean8`, etc.) |
| `set_to` | string | no | `scanned_barcode` | Constant for the result |

## Configuration example

```json
{
  "source_url": "{{product_image_url}}",
  "type": "ean13",
  "set_to": "scanned_barcode"
}
```

## Related docs

- [Actions reference](/en/actionjail/reference/actions-reference.md)
