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

# Enable agent traffic

> Make your storefront discoverable by AI agents: head tags, the agent callout, an llms.txt entry, markdown for agent fetchers, a Link header, and the visible badge.

Agents find your storefront through your website. They read your pages as raw HTML, top to bottom, without running JavaScript, so a storefront that only humans can find gets no agent traffic. This page walks through the website changes that point agents at your pay URL, with each step marked required, highly recommended, or optional.

<Info>
  Examples on this page use a seller named Acme whose storefront runs on the custom domain `agents.acme.com` from step 1. Substitute your own values as you paste: your storefront domain everywhere `agents.acme.com` appears (or your default pay URL, like `https://acme.pay.zeroclick.io`, if you skip the custom domain), your store name in the callout and badge text, and your seller id in the head snippet's `?seller=` parameter.

  The storefront URLs below carry a `?src=` parameter naming the surface they sit on (`head-link`, `body-text`, `llms-txt`, `link-header`, `badge`). Your storefront records it on every visit, so you can see which pointer actually routed each agent. Keep it as written when you paste.
</Info>

<Steps>
  <Step title="Serve your storefront on your own domain">
    <Badge color="blue" size="sm" shape="pill">Required</Badge>

    Agents click through to a domain they recognize more often than a generic one, so serve your storefront on a subdomain you own rather than the default `<your-slug>.pay.zeroclick.io`. Acme, the example seller on this page, uses `agents.acme.com`, and every snippet below carries it. Configure yours under **Custom domains** in your store's settings before you paste anything: the domain is baked into the head tags, the callout, the badge, and the llms.txt links, so setting it up first means you paste each snippet once.
  </Step>

  <Step title="Add the head tags to every page">
    <Badge color="blue" size="sm" shape="pill">Required</Badge>

    Paste into every page's `<head>`:

    ```html theme={null}
    <!-- ZeroClick: agentic commerce -->
    <link rel="alternate" type="text/plain"
          href="https://agents.acme.com/llms.txt?src=head-link" title="Acme agent storefront">
    <script>
    (function () {
      document.documentElement.setAttribute("data-zc-js", "");
      document.addEventListener("DOMContentLoaded", function () {
        var callout = document.querySelector("[data-zeroclick-agentic-commerce]");
        if (callout) callout.remove();
      });
    })();
    </script>
    <style>[data-zc-js] [data-zeroclick-agentic-commerce] { display: none; }</style>
    <script async src="https://cdn.zeroclick.io/scripts/badge.js?seller={YOUR_SELLER_ID}"></script>
    ```

    The `alternate` link advertises your storefront's llms.txt to crawlers. The inline script marks the document as JavaScript-capable and removes the agent callout (next step) for human visitors once the page loads. The badge script advertises the storefront to crawlers that do run JavaScript.

    <Warning>
      The snippets on this page carry Acme's example values, so substitute your own before pasting: your storefront domain everywhere `agents.acme.com` appears, your store name in place of Acme, and your seller id in place of `{YOUR_SELLER_ID}`, which is the `sel_` value in your dashboard store URL. The **Enable agent traffic** step in your store's setup shows every snippet with your values already filled in.
    </Warning>

    <Note>
      If your site sets a strict Content-Security-Policy, allow `img-src` for your storefront domain (the badge image) and `script-src` for `cdn.zeroclick.io`.
    </Note>
  </Step>

  <Step title="Paste the agent callout right after the opening body tag">
    <Badge color="blue" size="sm" shape="pill">Required</Badge>

    Agents read raw HTML top to bottom, so this block must lead the document. Paste it immediately after the opening `<body>` tag:

    ```html theme={null}
    <div data-zeroclick-agentic-commerce="https://agents.acme.com">
      <h2 data-zc-agent style="font-size:16px;margin:6px 0 0">Acme sells to AI agents - live prices and self-serve payment</h2>
      <p data-zc-agent style="font-size:12px;margin:4px 0 0">The agent storefront at
        https://agents.acme.com/llms.txt?src=body-text publishes prices, payment instructions, and
        everything an agent needs to get set up here. Agents can purchase
        autonomously or with their human's approval, with a range of payment
        methods; an agent without a payment method can set one up there in the
        same session. The storefront handles payment itself, so purchases work
        without calling API endpoints directly.</p>
    </div>
    ```

    The callout is text for agents, and it does not need to look like part of your page. The head script removes it for human visitors once the page loads, and it stays visible without JavaScript, so nothing on your site is served only to agents. Of everything on this page, this step does the most to route agent purchases through your storefront.

    <Tip>
      Keep the wording as written, with only the names and URLs substituted. It deliberately names no billing model, so it stays correct when you add or retire plans - your storefront's own pages state what an agent has to do first.
    </Tip>
  </Step>

  <Step title="Add your storefront to llms.txt">
    <Badge color="blue" size="sm" shape="pill">Required</Badge>

    Raw HTTP agents fetch `/llms.txt` at your domain before anything else - plain text by construction, so no markup layer can strip it - and verification fetches it too: your site must serve `/llms.txt` with your storefront referenced in it. Add this block near the top of the file, right after the title and summary. If your site does not serve one yet, create the file with it:

    ```markdown theme={null}
    ## Agentic commerce

    - [Acme agent storefront](https://agents.acme.com/llms.txt?src=llms-txt): the full catalog,
      live prices, and payment setup for Acme. AI agents can purchase
      autonomously or with their human's approval through ZeroClick, and an
      agent without a payment method can set one up on the spot.
      Complete purchasing guide: https://agents.acme.com/llms-full.txt?src=llms-txt - live
      pricing: https://agents.acme.com/manifest.json?src=llms-txt
    ```

    This block doubles as the markdown the next step's no-SDK path serves, so writing it once covers both.
  </Step>

  <Step title="Serve markdown to agent fetchers">
    <Badge color="blue" size="sm" shape="pill">Required</Badge>

    Many agent tools fetch pages with an `Accept` header that prefers `text/markdown` over `text/html`; browsers never do. Answering those requests with markdown reaches summarizing fetchers that would otherwise drop head tags and links during HTML conversion. Verification asks each submitted page for markdown - your homepage always, plus the docs, pricing, and sign-up pages you add - and requires the returned markdown to reference your storefront. Apply it to every page, not just those: agents land everywhere.

    The managed path is [Agentify](/agentify/overview): mount the seller SDK's middleware in front of your site, and it detects markdown-preferring and AI-agent traffic, serves an agent-optimized markdown rendering of the requested page with your storefront inlined - which is exactly what verification checks for - and falls through to your HTML on any failure:

    <CodeGroup>
      ```ts TypeScript theme={null}
      import { withAgentify } from "@zeroclickai/sellers";

      // zeroClick is your createSeller client with agentifyKey configured.
      const handler = withAgentify(zeroClick, serveSite);
      ```

      ```python Python theme={null}
      from zeroclick_sellers.adapters import AgentifyAsgiMiddleware

      app.add_middleware(AgentifyAsgiMiddleware, seller=zeroclick)
      ```

      ```go Go theme={null}
      mux.Handle("/", seller.Agentify(sellers.AgentifyOptions{})(site))
      ```

      ```ruby Ruby theme={null}
      config.middleware.use ZeroClick::Sellers::Middleware::Agentify
      ```
    </CodeGroup>

    [SDK middleware](/agentify/sdk-middleware) covers configuration and options. A single-page app on a CDN, with no server to mount middleware in, runs the same contract in an edge function: see [SPA setup](/agentify/spa-setup).

    Without an SDK, serve your llms.txt content for markdown-preferring requests yourself. This is content negotiation, not cloaking: the same page in the representation the client asked for. It does change what your existing URLs serve to markdown-preferring clients, so decide deliberately. Send `Vary: Accept` so caches keep the two representations apart.

    ```js theme={null}
    // Express-style example; adapt to your framework.
    // Middleware so every page negotiates, not just the homepage - agents
    // land on docs, pricing, and sign-up pages just as often. Serving your
    // llms.txt keeps your storefront referenced in the markdown agents read.
    app.use((req, res, next) => {
      const accept = req.headers.accept ?? "";
      const markdown = accept.indexOf("text/markdown");
      const html = accept.indexOf("text/html");
      if (req.method === "GET" && markdown !== -1 && (html === -1 || markdown < html)) {
        res.set("vary", "accept").type("text/markdown");
        return res.sendFile("llms.txt", { root: "public" });
      }
      next();
    });
    ```
  </Step>

  <Step title="Send the storefront Link header">
    <Badge color="gray" size="sm" shape="pill">Highly Recommended</Badge>

    Raw HTTP clients - curl, HEAD requests, fetchers that never parse HTML - see response headers and nothing else. An RFC 8288 `Link:` header is the one pointer that survives every fetch path: no HTML parsing, no JavaScript execution, no markdown conversion step to lose it. Send it on every page response:

    ```text theme={null}
    Link: <https://agents.acme.com/llms.txt?src=link-header>; rel="alternate"; type="text/plain"; title="llms.txt"
    ```

    ```js theme={null}
    // Express-style example; adapt to your framework. Static hosts set this
    // as a response header in their hosting config instead.
    app.use((req, res, next) => {
      res.set(
        "link",
        '<https://agents.acme.com/llms.txt?src=link-header>; rel="alternate"; type="text/plain"; title="llms.txt"',
      );
      next();
    });
    ```

    <Note>
      On a static host or CDN, set the header in the hosting config (a per-path headers map or an edge rule) - the value stays the same. If something in front of your site already sends a `Link` header, append this entry to it rather than replacing it.
    </Note>

    Verification records the header when present but does not require it yet.
  </Step>

  <Step title="Show the badge to human visitors">
    <Badge color="gray" size="sm" shape="pill">Optional</Badge>

    The visible ZeroClick badge is a plain link and image for humans, typically in the footer. The image is served from your storefront domain, so it carries your store name and updates automatically; swap `badge-light.svg` for `badge-dark.svg` on dark footers:

    ```html theme={null}
    <a href="https://agents.acme.com/?src=badge" data-zeroclick-badge title="Acme - Agent Storefront, powered by ZeroClick">
      <img src="https://agents.acme.com/badge-light.svg" width="200" height="54"
           alt="Acme - Agent Storefront, powered by ZeroClick" style="border:0">
    </a>
    ```

    Nothing moves it at runtime, so render it however your site renders content, including natively inside a React or Vue app. The callout and head tags carry the agent traffic.
  </Step>
</Steps>

## Why every step matters

Each required signal catches an agent class the others cannot reach, so the steps compose rather than substitute:

* **Raw HTTP clients** (curl, HEAD requests, plain fetchers) never parse HTML. They find your site's `/llms.txt` - and the `Link:` header when you send it - or nothing at all.
* **Markdown-converting fetchers**, the summarizers behind most agent browsing tools, strip `<link>` and `<script>` tags and bare attributes during conversion. They see the negotiated markdown and the callout's visible text, and nothing else.
* **DOM-parsing agents** read the head tags without rendering or summarizing the page.

Completing some steps still leaves whole agent classes blind. We have watched a seller ship every markup signal and stay invisible to markdown-summarizing agents, because each of those signals lived in a layer that markdown conversion or JavaScript execution destroys. That is why the steps above are Required as a set, not a menu: skip one and the agents it catches never find your storefront.

## Verify your changes

The onboarding wizard's Verify step runs these same checks against the pages you submit; passing them here means verification passes there.

* Fetch the homepage raw, the way an agent does. The callout heading appears near the top of the HTML and the `alternate` link tag is in the head:

  ```sh theme={null}
  curl -s https://www.acme.com/ | head -40
  ```

* Load the page in a browser. The callout is gone, and the badge renders where you placed it.

* Your site serves `/llms.txt` with the agentic commerce block near the top, so the file mentions your storefront:

  ```sh theme={null}
  curl -s https://www.acme.com/llms.txt | head -20
  ```

* Each required page - the homepage, docs, pricing, and sign-up pages - answers a markdown-preferring request with markdown that references your storefront:

  ```sh theme={null}
  curl -s -H "Accept: text/markdown, text/html, */*" https://www.acme.com/
  ```

* If you send the `Link:` header, it survives a bare header fetch:

  ```sh theme={null}
  curl -sI https://www.acme.com/ | grep -i '^link:'
  ```

## Next steps

<Columns cols={2}>
  <Card title="Integrate your API" icon="plug" href="/integrate/overview">
    The billing guard contract: verify, check allowance, serve, settle usage.
  </Card>

  <Card title="How ZeroClick works" icon="route" href="/concepts/how-zeroclick-works">
    What happens after an agent lands on your storefront.
  </Card>
</Columns>
