Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 5 Nov 2026. What's built · Install 0.3.0
jadpo
ReferenceCommerce and logistics

LanguageValues and typesStandard typesCommerce and logistics

Barcode

On this page

What a barcode encodes, and which kind of barcode it is.

Use it when one field can hold several kinds, such as tickets and products together. If you only have product codes, Ean13 or UpcA alone is simpler.

Shape

One of these, each with its own fields:

Variant Field Type Required?
Barcode.ean13 data Ean13 Yes
Barcode.upc_a data UpcA Yes
Barcode.code128 data Text Yes
Barcode.qr_code data Text Yes

Example

example
Barcode.qr_code { data: "https://example.com/tickets/42" }

Good to know

  • The others are Barcode.ean13, Barcode.upc_a and Barcode.code128, each with data. An ean13 checks its digits. code128 takes printable ASCII only.
  • It holds the data, not an image of the barcode.
  • == tells you whether two are the same. < and list.sort_by don't take it.

In JSON

An object of its variant's name, as tag, and the variant's fields, in a request, a response or json.write:

json
{"tag":"ean13","data":"4006381333931"}{"tag":"upc_a","data":"036000291452"}{"tag":"code128","data":"CTN-0042"}

Details

Text form, storage, how it is shown, and operations

Barcode is in the group Commerce and logistics, and has been in Jadpo since 0.1.0.

Text form

It has no single text form, so text.from and text.parse don't take it.

How it is stored

It is stored in 2 columns, each named for the field, _ and its suffix. This is {"tag":"code128","data":"CTN-0042"}:

Column Type Holds
<field>_kind text 'code128'
<field>_data text 'CTN-0042'

How it is shown to people

text.format(value, locale:) shows it to people in their locale.

With locale: Locale.en_gb:

Value Shown
{"tag":"ean13","data":"4006381333931"} 4006381333931
{"tag":"upc_a","data":"036000291452"} 036000291452
{"tag":"code128","data":"CTN-0042"} CTN-0042
{"tag":"qr_code","data":"https://example.com/a1"} https://example.com/a1

Operations

It also takes text.format, json.read, json.write and ==. How every standard type behaves says how they work.

Markdown for agents: /docs/types/type-barcode.md.Built from Jadpo main at aee2e8f.