XooCode(){

Barcode

Barcode is a thin subtype of ImageObject for images that encode data in a barcode or QR code. It adds no properties of its own, so you use the full ImageObject vocabulary: contentUrl (the image file), encodingFormat (PNG, SVG, PDF), caption, embeddedTextCaption (the text encoded in the barcode), width, height.

The most common place Barcode appears is inside Ticket.ticketToken, inside Order.orderedItem for carrier scans, or inside Product.image when the barcode is the canonical product image. The embeddedTextCaption property is the barcode's decoded payload, useful both for accessibility and for consumers that want the payload without scanning.

Full example of schema.org/Barcode json-ld markup

The markup is verified as valid with Rich Results Test from Google.

Highlight legend:Required by GoogleRecommendedOptional
schema.org/Barcode
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Barcode",
  "name": "Jane Xoo at The Thunderdome - gate barcode",
  "contentUrl": "https://xoocode.com/tickets/jx-thunderdome-2026-08-14/9F2B7C1D.png",
  "encodingFormat": "image/png",
  "width": { "@type": "QuantitativeValue", "value": 400, "unitCode": "E37" },
  "height": { "@type": "QuantitativeValue", "value": 120, "unitCode": "E37" },
  "embeddedTextCaption": "JX-TDOME-20260814-9F2B7C1D",
  "caption": "Barcode to scan at the Thunderdome main gate"
}
</script>

Ticket barcodes and ticketToken

Gmail's event ticket markup reads ticketToken as either a plain string (URN or URL) or a Barcode. A Barcode ticketToken lets Gmail render the actual scan image at the gate. If you just have the payload string, send it as ticketToken directly; use Barcode when you are serving a rendered PNG or SVG.

Minimal valid version

The smallest markup that still produces a valid Barcode entity. Use it as the floor. Reach for the advanced example above when you want search engines and AI agents to understand more about your content.

schema.org/Barcode (minimal)
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Barcode",
  "contentUrl": "https://xoocode.com/tickets/9F2B7C1D.png",
  "embeddedTextCaption": "JX-TDOME-20260814-9F2B7C1D"
}
</script>

Google rich results this unlocks

Markup matching this example makes your page eligible for the following Google Search rich results. The primary target drives the required / recommended property classification in the advanced code block above.

  • Gmail event tickets (inside Ticket.ticketToken)primary
    Google docs

Common Barcode mistakes

Mistakes that pass validation but silently fail to earn rich results or mislead consumers walking the graph. Avoid these and your markup will be ahead of most sites in the wild.

  1. 01

    Barcode without a contentUrl

    Wrong
    Barcode with only name and embeddedTextCaption
    Right
    Barcode with contentUrl pointing to the actual PNG/SVG file

    Barcode is an ImageObject. Without contentUrl the consumer has no image to render. If you only have the decoded payload, use ticketToken directly with a URN/URL string instead of wrapping it as a Barcode.

  2. 02

    Encoding the payload as the image filename

    Wrong
    "contentUrl": "https://example.com/barcodes/JX-TDOME-20260814-9F2B7C1D"
    Right
    Serve a real image with an image MIME type and put the payload in embeddedTextCaption

    contentUrl must dereference to an actual image (PNG, SVG, PDF). A URL that returns text or HTML is not a valid image and will fail any accessibility or scan pipeline.

About the example data

The gate barcode on a Jane Xoo concert ticket for a Thunderdome show, rendered as a PNG with its encoded payload in embeddedTextCaption.

Comments

Loading comments...

Leave a comment