Skip to main content
This guide takes a brand from nothing to a scannable product: create the brand and its product, read the GS1 Digital Link its QR code encodes, attach a typed link, and see where a phone and a machine reader each end up when they scan it. Every sample uses the Python SDK with a client built once, from an API key issued to your organization. The scans in steps 7 and 8 use a plain HTTP client standing in for a phone:
The samples import:
Every request and response on this page was recorded from a real run of this journey against the Closient API. The journey runs every night and fails if any exchange differs from what is shown here, so the examples cannot silently go stale. Source: tools/api-conformance/api_conformance/journeys/brand_resolver.py.

1. Create the brand

A brand belongs to an organization. Your API key is scoped to one, so the organization_id is the one that key was issued for.
Request headers:
Request body:
Response body:
Creating a product under your organization claims its GTIN for you. The response carries digital_link: the exact URL a QR code for this product encodes. Print that, or hand it to any QR generator. If your organization has a verified custom resolver hostname with an active certificate, the link uses it. POST /qr/ builds a QR image for you, but it always encodes the platform resolver domain, so with a custom hostname print digital_link instead.
Request headers:
Request body:
Response body:

3. See what your claim still needs before the resolver will serve your URLs

A new claim starts unverified. While blocks_resolver_serving is true, a scan lands on the product’s Closient-hosted page whatever rules you set: that is what stops someone who claims a GTIN they do not own from redirecting its shoppers. The checklist lists what promotes the claim.
Request headers:
Response body:
Links are typed by GS1 link relation. The product’s hosted page shows each type in its own section, with your URL as that section’s call to action, and the resolver advertises the type to machine readers (step 8).
Request headers:
Request body:
Response body:

5. Try to send scans to your own site

A rule decides where a scan goes. Sending it to a URL of your own needs a verified claim, so an unverified one is refused with a 422 that says why.
Request headers:
Request body:
Response body:

6. Send scans to the hosted product page

A HOSTED_PAGE rule is always allowed: it sends the scan to the page Closient hosts for the product, which shows your product data and links.
Request headers:
Request body:
Response body:

7. Scan the code like a phone

A phone camera opens the Digital Link in a browser, which asks for HTML. The QR domain only redirects: one hop hands the scan to the resolver, which redirects it on to the product’s hosted page.
Request headers:
Location: https://www.closient.com/01/<gtin14>?via=gtin.oneResponse body:
Request headers:
Location: https://www.closient.com/pip/<gtin14>/?via=gtin.one
Request headers:
Response body:
A machine reader asks for application/linkset+json instead. The QR domain sends it to the resolver with the same one hop, and the resolver answers there, with no further redirect: the product’s links keyed by link relation. Each typed link points at its section of the hosted page (#recipeInfo here), where your URL is the call to action.
Request headers:
Location: https://www.closient.com/01/<gtin14>?via=gtin.oneResponse body:
Request headers:
Response body:

Next

  • Verify the claim to unlock CUSTOM_URL rules: the checklist from step 3 says what is missing.
  • Add more typed links; the linkset grows with them.