# GeraCode

> Make barcodes and QR codes for products, labels and inventory with GeraCode, a free image service. Turn a product number into an EAN-13, UPC-A, ITF-14 or EAN-8 barcode (the check digit is worked out or checked for you), a SKU into a Code 128, or a link into a QR code, as a PNG or a print-ready SVG.

App · 2 actions. Web page: https://docs.lodol.com/docs/integrations/geracode

## Actions

### Create a barcode

Turn a product number, SKU or shipping code into a barcode image (EAN-13, UPC-A, Code 128, ITF-14, EAN-8 or Code 39), ready for a label, a price tag or a document. Retail numbers can be given without their last digit, and it is worked out; a wrong last digit is caught before anything is drawn. The image is saved so later steps can attach or upload it.

**Inputs**

- Value (`value`, text, required): The number or text to put in the barcode. For EAN-13, UPC-A, ITF-14 and EAN-8 use digits only; you can leave off the last digit (the check digit). Code 128 takes letters, digits and symbols, up to 80 characters.
- Barcode type (`barcode_type`, text): EAN-13 is the product barcode used in most of the world; UPC-A is the US and Canada one. Code 128 suits SKUs, serial and order numbers with letters in them. ITF-14 is printed on shipping cartons. EAN-8 is for small packs, and Code 39 for older warehouse scanners. One of: `ean13` (EAN-13), `upca` (UPC-A), `code128` (Code 128), `itf14` (ITF-14), `ean8` (EAN-8), `code39` (Code 39). Default: `ean13`.
- File type (`file_type`, text): PNG suits email, documents and the web. Choose SVG for labels and print: it stays sharp at any size. One of: `png` (PNG image), `svg` (SVG (vector, for print)). Default: `png`.
- Bar width (`bar_width`, number): How thick the bars are, from 1 (thinnest) to 8. A wider setting makes a bigger image. A long Code 128 or Code 39 may need a thinner setting to save as PNG. From 1 to 8. Default: `3`.
- Height (mm) (`height_mm`, number): How tall the bars are, in millimetres, from 5 to 50. From 5 to 50. Default: `15`.
- Show the number underneath (`show_text`, true/false): Print the human-readable value under the bars. Default: `true`.
- Save as (`filename`, text): Optional. The name to save the image under, e.g. product-label.png. Without it, the name is made from what the code holds.

**Outputs**

- `barcode_type` (text): The kind of barcode drawn, e.g. EAN-13.
- `check_digit_added` (true/false): True when the last digit was missing and was worked out for you.
- `content_type` (text): File type of the image: image/png or image/svg+xml.
- `document_ref` (text): Reference to the saved image, for use by a later step.
- `documents` (list): The image, in the shape steps that send or upload files expect.
- `encoded_value` (text): Exactly what the barcode holds, including a check digit worked out for you.
- `filename` (text): Name the image was saved under.
- `image_url` (text): A public GeraCode link that always shows this same image. Use it in an email, a web page or a spreadsheet IMAGE() formula. Anyone with the link can see what the code holds.
- `size_bytes` (number): Size of the image in bytes.
- `url` (text): Download link for the saved image.

**Example output**

```json
{
  "barcode_type": "EAN-13",
  "check_digit_added": true,
  "content_type": "image/png",
  "document_ref": "doc_5e1f0a2b3c4d5e6f708192a3b4c5d6e7",
  "documents": [
    {
      "content_type": "image/png",
      "document_ref": "doc_5e1f0a2b3c4d5e6f708192a3b4c5d6e7",
      "filename": "ean-13-7891234567895.png",
      "size_bytes": 3011,
      "url": "/actions/core/serve-document/doc_5e1f0a2b3c4d5e6f708192a3b4c5d6e7?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "encoded_value": "7891234567895",
  "filename": "ean-13-7891234567895.png",
  "image_url": "https://www.geracodigo.com.br/api/v1/barcode?format=ean13&data=7891234567895&type=png&scale=3&height=15&text=1",
  "size_bytes": 3011,
  "url": "/actions/core/serve-document/doc_5e1f0a2b3c4d5e6f708192a3b4c5d6e7?teamId=6512a1b2c3d4e5f600000001"
}
```

### Create a QR code

Turn a link or any other text (up to 1,200 characters, accents and emoji included) into a QR code image, ready to email, print or drop into a document. The image is saved so later steps can attach or upload it.

**Inputs**

- Link or text (`content`, text, required): What the code should hold. A web address opens when scanned; anything else is shown as text.
- File type (`file_type`, text): PNG suits email, documents and the web. Choose SVG for labels and print: it stays sharp at any size. One of: `png` (PNG image), `svg` (SVG (vector, for print)). Default: `png`.
- Size (pixels) (`size`, number): How many pixels across the code is, from 100 to 1000. QR codes are square. From 100 to 1000. Default: `300`.
- Damage tolerance (`error_correction`, text): How much of the code can be scratched or covered and still scan. Higher levels make the pattern denser; Standard suits most uses. One of: `L` (Low (7% can be damaged)), `M` (Standard (15% can be damaged)), `Q` (High (25% can be damaged)), `H` (Highest (30% can be damaged)). Default: `M`.
- Border (`margin`, number): Blank space around the code, counted in code squares, from 0 to 10. Keep at least 2 so phones read it easily. From 0 to 10. Default: `2`.
- Save as (`filename`, text): Optional. The name to save the image under, e.g. menu-qr.png. Without it, the name is made from what the code holds.

**Outputs**

- `content_type` (text): File type of the image: image/png or image/svg+xml.
- `document_ref` (text): Reference to the saved image, for use by a later step.
- `documents` (list): The image, in the shape steps that send or upload files expect.
- `encoded_text` (text): The exact text stored in the code.
- `filename` (text): Name the image was saved under.
- `image_url` (text): A public GeraCode link that always shows this same image. Use it in an email, a web page or a spreadsheet IMAGE() formula. Anyone with the link can see what the code holds.
- `size_bytes` (number): Size of the image in bytes.
- `url` (text): Download link for the saved image.

**Example output**

```json
{
  "content_type": "image/png",
  "document_ref": "doc_9a8b7c6d5e4f30211a2b3c4d5e6f7081",
  "documents": [
    {
      "content_type": "image/png",
      "document_ref": "doc_9a8b7c6d5e4f30211a2b3c4d5e6f7081",
      "filename": "lodol-ai-qr-code.png",
      "size_bytes": 1342,
      "url": "/actions/core/serve-document/doc_9a8b7c6d5e4f30211a2b3c4d5e6f7081?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "encoded_text": "https://lodol.ai",
  "filename": "lodol-ai-qr-code.png",
  "image_url": "https://www.geracodigo.com.br/api/v1/qr?data=https%3A%2F%2Flodol.ai&type=png&size=300&ecc=M&margin=2",
  "size_bytes": 1342,
  "url": "/actions/core/serve-document/doc_9a8b7c6d5e4f30211a2b3c4d5e6f7081?teamId=6512a1b2c3d4e5f600000001"
}
```
