> ## Documentation Index
> Fetch the complete documentation index at: https://docs.closient.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting Up Resolver Rules

> Configure where your GS1 Digital Link barcodes direct consumers and partners.

Resolver rules control what happens when someone scans a 2D barcode (QR code) on your product. You can direct scanners to your product page, a promotional landing page, a traceability portal, or different destinations based on time, location, or product batch.

<Tip>
  Running a fixed scanning station on a static IP? Publish a DNS `LOC` record to
  pin every scan from that IP to your facility's exact surveyed coordinates — see
  [Pin a Facility's Location with a DNS LOC Record](/user-guides/loc-dns-location).
</Tip>

## What Is a Resolver Rule

When a consumer or partner scans a GS1 Digital Link barcode on your product, Closient evaluates your resolver rules to determine where to redirect them. Rules are evaluated in priority order — the first matching rule wins.

## Creating a Rule

Navigate to **Resolver > Rules** in your Dashboard, or open a specific product and go to its **Resolver** tab.

### Basic Setup

<Steps>
  <Step title="Choose a scope">
    Select what the rule applies to:

    * **Organization** — applies to all your products (catch-all)
    * **Brand** — applies to all products under a specific brand
    * **Product** — applies to a single GTIN
    * **Batch** — applies to a specific production lot
    * **Serial** — applies to a specific individual item
  </Step>

  <Step title="Set the destination">
    Choose where scanners are sent:

    * **Hosted Page** — Closient generates a product information page for you automatically
    * **Custom URL** — redirect to your own page (e.g., your brand website, a landing page, or a traceability portal)
  </Step>

  <Step title="Set priority">
    If you have multiple rules for the same scope, set the **order index**. Lower numbers = higher priority.
  </Step>
</Steps>

### Custom URL Fallback

When using a custom URL, configure what happens if your URL goes down:

| Option                 | Behavior                                      |
| ---------------------- | --------------------------------------------- |
| **Skip rule**          | Move to the next rule in priority order       |
| **Fallback to hosted** | Show the Closient-hosted product page instead |

Closient monitors your custom URLs automatically and tracks consecutive failures.

## Time-Based Rules

You can make rules active only during certain times — useful for seasonal campaigns, business hours, or limited-time promotions.

| Criteria          | Example Use Case                                                        |
| ----------------- | ----------------------------------------------------------------------- |
| **Date range**    | Holiday campaign: Dec 1 to Jan 15                                       |
| **Annual window** | Back-to-school: Aug 1 to Sep 15 (every year)                            |
| **Days of week**  | Weekday-only B2B portal, weekend consumer page                          |
| **Time of day**   | Business hours: 9am-5pm show B2B portal, after hours show consumer page |

All time criteria are AND-ed — if you set both days of week and time of day, the rule only matches when both are satisfied.

<Tip>
  Set your organization's routing timezone in **Settings > Resolver** so time-based rules use your local time, not UTC.
</Tip>

## Rule Priority (Scope Hierarchy)

When multiple rules could match a scan, Closient evaluates from most specific to least specific:

1. **Serial** — a rule for this exact serial number
2. **Batch** — a rule for this production batch
3. **Product** — a rule for this GTIN
4. **Brand** — a rule for all products under this brand
5. **Organization** — a catch-all for all your products

Within each scope level, rules are evaluated by order index (lowest first).

### Example

A beverage brand sets up:

* **Organization rule** → brand website (catch-all)
* **Product rule** for their new energy drink → dedicated landing page
* **Batch rule** for recalled lot #2026-Q1 → recall notice page

When someone scans:

* The recalled batch → recall notice (batch rule wins)
* The energy drink (non-recalled batch) → landing page (product rule wins)
* Any other product → brand website (organization rule wins)

## Link Type Rules

You can also scope rules by GS1 link type. When the resolver receives a request for a specific link type, it only considers rules matching that type:

| Link Type                                 | Use Case                       |
| ----------------------------------------- | ------------------------------ |
| Product info (`gs1:pip`)                  | Main product page              |
| Certifications (`gs1:certificationInfo`)  | Certification portal           |
| Sustainability (`gs1:sustainabilityInfo`) | Environmental impact page      |
| Traceability (`gs1:traceability`)         | Supply chain visibility portal |
| Recipe (`gs1:recipeInfo`)                 | Recipe or usage page           |

## Monitoring Rule Health

The Dashboard shows health status for each custom URL rule:

* **Healthy** — URL responding normally
* **Degraded** — intermittent failures detected
* **Down** — consecutive failures, fallback behavior active

You'll receive notifications when a custom URL starts failing.

<CardGroup cols={2}>
  <Card title="Understanding Analytics" icon="chart-line" href="/user-guides/analytics">
    Track how consumers interact with your resolved barcodes.
  </Card>

  <Card title="GS1 Digital Link (Technical)" icon="link" href="/guides/digital-link-resolution">
    Deep dive into the resolution protocol and URI format.
  </Card>
</CardGroup>
