# Be findable by agents

Publish a signed profile so buyer agents learn that you accept Provenance, your rules and which agent sells for you, in the answers they already read.

Use this to publish your business's discovery profile: one signed document that tells any buyer agent that you accept Provenance approvals, the amount above which a person approves, the payment rails you take and which agent sells for you. Provenance serves it for you, so nothing has to change on your site.

**Before you begin:** verify one of your domains, either a store origin ([List or unlist your store](https://provenanceauth.com/docs/authorize/guides/list-your-store.md)) or a selling agent's origin ([Sell to agents](https://provenanceauth.com/docs/authorize/guides/sell-to-agents.md)).

## 1. Choose what the profile says

Open **Settings → Store → Discovery** in the console, or send [`PUT /v1/authorize/settings/discovery`](https://provenanceauth.com/docs/api/discovery.md#put-v1-authorize-settings-discovery). The profile holds only what you choose here, and never people, prices or volumes.

- `published` (boolean): Publish the profile. Needs a verified domain.
- `name` (string): The name agents see. Blank uses your branding name.
- `rails` (string[]): The rails you accept: `x402` (x402 v2), `acp`, `ap2` (maps to AP2 0.2) and `checkout`.
- `rules` (object): `person_required_over` (orders above it need a person's approval) and `currency`.
- `network_mandates` (boolean): You accept people's network permissions.
- `categories` (string[]): Slugs such as `data` or `office_supplies`, used by search.
- `selling` (object[]): Your selling agents: `agent_id`, optional `endpoints` (`a2a`, `mcp`, `offers`) and `categories`. Each must be selling, with a verified origin and an active key.

**curl**

```bash norun
curl -s -X PUT $PROVENANCE_API/v1/authorize/settings/discovery \
  -H "Authorization: Bearer $PROVENANCE_KEY" -H "Content-Type: application/json" \
  -d '{ "published": true, "rails": ["x402", "acp", "ap2", "checkout"], "rules": { "person_required_over": 1000, "currency": "USD" },
        "categories": ["data"], "selling": [{ "agent_id": "agt_01JDSAMPLE0TIDEPOOL0SALES00", "endpoints": { "a2a": "https://agents.saltmarsh.example/a2a" }, "categories": ["data", "reports"] }] }'
```

**Node**

```ts
const res = await fetch(`${process.env.PROVENANCE_API}/v1/authorize/settings/discovery`, {
  method: "PUT",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ published: true, rails: ["x402", "acp", "ap2", "checkout"], rules: { person_required_over: 1000, currency: "USD" }, categories: ["data"] }),
});
const settings = await res.json();
```

**Python**

```python
import os
import httpx

api, h = os.environ["PROVENANCE_API"], {"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}
settings = httpx.put(f"{api}/v1/authorize/settings/discovery", headers=h, json={"published": True, "rails": ["x402", "acp", "ap2", "checkout"], "rules": {"person_required_over": 1000, "currency": "USD"}}).json()
```

The response carries the signed `profile`, its `profile_url` and the status of each verified domain:

```json
{
  "object": "discovery_settings",
  "id": "biz_01JDSAMPLE0SALTMARSH0DATA00",
  "published": true,
  "verified_origins": ["https://agents.saltmarsh.example", "https://saltmarsh.example"],
  "profile_url": "https://api.provenanceauth.com/v1/public/businesses/biz_01JDSAMPLE0SALTMARSH0DATA00/profile",
  "serving": []
}
```

Every change signs the profile again and raises its `revision`. A revoked agent key, or an agent whose origin check fails, drops out of the profile at once.

## 2. Check the hosted profile

Anyone can read it, with no key, cached for 5 minutes. Look it up by business id, origin or host:

**curl**

```bash
curl -s "$PROVENANCE_API/v1/public/businesses/lookup?origin=https://saltmarsh.example"
```

**Node**

```ts
import { Provenance } from "@provenanceauth/sdk";

const prov = new Provenance({ apiKey: process.env.PROVENANCE_KEY!, baseUrl: process.env.PROVENANCE_API });
const profile = await prov.authorize.discovery.lookup("https://saltmarsh.example");
```

**Python**

```python
import os
from provenanceauth import Provenance

prov = Provenance(os.environ["PROVENANCE_KEY"], base_url=os.environ["PROVENANCE_API"])
profile = prov.authorize.discovery.lookup("https://saltmarsh.example")
```

```json
{
  "object": "provenance_profile",
  "version": "1",
  "business": { "id": "biz_01JDSAMPLE0SALTMARSH0DATA00", "name": "Saltmarsh Data", "origins": ["https://agents.saltmarsh.example", "https://saltmarsh.example"] },
  "accepts": { "approvals": true, "network_mandates": true, "rails": ["acp", "ap2", "checkout", "x402"] },
  "rules": { "person_required_over": 1000, "currency": "USD" },
  "categories": ["data"],
  "selling": [{
    "agent_id": "agt_01JDSAMPLE0TIDEPOOL0SALES00",
    "name": "Tidepool Sales",
    "kids": ["kOJ8b2…"],
    "origin": "https://agents.saltmarsh.example",
    "endpoints": { "a2a": "https://agents.saltmarsh.example/a2a", "offers": "https://agents.saltmarsh.example/offers" },
    "categories": ["data", "reports"],
    "seller_confirmation": { "offered": "never", "response_time": "1bd" }
  }],
  "profile_url": "https://api.provenanceauth.com/v1/public/businesses/biz_01JDSAMPLE0SALTMARSH0DATA00/profile",
  "directory_url": "https://provenanceauth.com/businesses/biz_01JDSAMPLE0SALTMARSH0DATA00",
  "schema": "https://provenanceauth.com/schemas/provenance-profile/v1.json",
  "revision": 1,
  "updated_at": "2026-10-31T12:00:00.000Z",
  "signature": "eyJhbGciOiJFUzI1NiIsInR5cCI6InByb3ZlbmFuY2UtcHJvZmlsZStqd3QifQ…"
}
```

`signature` is an ES256 JWS over the SHA-256 of the profile's canonical JSON, signed with the keys at `/.well-known/jwks.json`. A copy served anywhere verifies the same way. The format is described in [The discovery profile](https://provenanceauth.com/docs/authorize/reference/discovery-profile.md).

## 3. Serve it on your own domain (optional)

Agents that look at your site find the same profile at `/.well-known/provenance.json`. It replaces `provenance-store.json` and `provenance-agent.json` as the one file, and both older files keep working as proofs. Pick one way, easiest first:

| Way | What to do |
| --- | --- |
| Identify middleware or edge template | Nothing. They serve the file and add the `Link` header already. |
| SDK middleware | One line: `provenanceDiscovery()` in Node, `ProvenanceDiscovery(app)` in Python, `Discovery{}.Middleware` in Go. |
| Redirect | Redirect `/.well-known/provenance.json` to your `profile_url`. |
| Upload | Download `provenance.json` from **Settings → Store → Discovery** and serve it. Upload it again after each change. |

**Node**

```ts
import express from "express";
import { provenanceDiscovery } from "@provenanceauth/sdk";

const app = express();
// …your routes…
app.use(provenanceDiscovery({ baseUrl: process.env.PROVENANCE_API }).express()); // after your routes: your own files win
```

Pages served through the middleware carry `Link: </.well-known/provenance.json>; rel="provenance"`. When you publish no selling agent with an A2A endpoint, no agent card is served. When your domain has an A2A card of its own at `/.well-known/agent-card.json`, it stays: ours is served only where you have none.

We check each verified domain daily. A copy that doesn't match the signed profile shows as out of date in the console with reason `profile_stale`, and agents get the hosted profile until it matches.

## 4. Put the rules in your payment answers

Buyer agents read the 402, the checkout or the merchant agent they already talk to. `discoveryFields(profile)` returns the block for each rail, so you add it with one call where you build those answers:

**Node**

```ts
import { discoveryFields, x402Challenge, acpExtensionDeclaration, approvalChallenge } from "@provenanceauth/rails";

const f = discoveryFields(profile);
const challenge = x402Challenge({ resource, accepts, profile: f.x402.profile });          // x402 v2: extensions["com.provenanceauth.intent"].info.profile
const declaration = acpExtensionDeclaration({ profile: f.acp.profile });                 // ACP capability data
const merchantMetadata = { ...f.ap2 };                                                    // AP2 merchant agent metadata (maps to AP2 0.2)
const problem = approvalChallenge(order, { merchantName: "Saltmarsh Data", retryUrl, profileUrl: f.checkout.profileUrl });
```

| Rail | Where the block goes |
| --- | --- |
| x402 v2 | The 402's `com.provenanceauth.intent` extension gains `info.profile`: `person_required_over`, `currency`, the seller agent id and key ids, `seller_confirmation`, `offers_url` and `profile_url`. |
| ACP | The declared `com.provenanceauth.intent` extension carries the same block as `profile`, so an agent learns the rules when checkout starts. |
| AP2 (maps to AP2 0.2) | Your merchant agent's metadata carries `com.provenanceauth.profile` with `profile_url` and the seller agent id. Provenance never signs AP2 mandates. |
| Web checkout | The `Provenance-Intent` challenge's `approval_request` carries `profile_url`. |

Every block is present-only. An older client ignores it, and when you pass nothing your answers are unchanged.

## 5. Show the mark

**HTML**

```html
<script type="module" src="https://unpkg.com/@provenance/embed"></script>
<provenance-mark base-url="https://sandbox-api.provenanceauth.com"></provenance-mark>
```

The mark reads **Works with your agents** and links to your directory page. It checks the page's own origin against your published profile and renders only on your verified domains, so a copy on another site shows nothing.

## Errors you might see

| Code | What to do |
| --- | --- |
| [`discovery_origin_unverified`](https://provenanceauth.com/docs/platform/errors.md#discovery_origin_unverified) | Verify a store origin or a selling agent's origin, then publish. |
| [`profile_not_published`](https://provenanceauth.com/docs/platform/errors.md#profile_not_published) | The lookup found no published profile for that origin. Publish one, or check the origin. |
| `parameter_invalid` on `selling.0.agent_id` | The agent isn't selling, has no verified origin or no active key. See `eligible_agents`. |

## See also

- [Find a business](https://provenanceauth.com/docs/authorize/guides/find-a-business.md), for agent builders
- [The discovery profile](https://provenanceauth.com/docs/authorize/reference/discovery-profile.md)
- [Agent payments](https://provenanceauth.com/docs/authorize/guides/agent-payments.md)
- [Sell to agents](https://provenanceauth.com/docs/authorize/guides/sell-to-agents.md)
