# List or unlist your store

Register your store origin, publish its proof, choose categories, and show the Accepts Provenance mark, or take the store out of the directory.

Use this to put your store in the [store directory](https://provenanceauth.com/docs/authorize/concepts/directories.md), so agents and people can find it, or to take it out. Stores are listed automatically once their origin is proven and they use Provenance there; you choose categories and can opt out at any time.

**Before you begin:** accept agent orders on that origin with [network grants](https://provenanceauth.com/docs/authorize/guides/accept-network-orders.md), cart approvals or Identify.

## 1. Register the origin

**curl**

```bash
curl -s -X POST $PROVENANCE_API/v1/authorize/stores \
  -H "Authorization: Bearer $PROVENANCE_KEY" -H "Content-Type: application/json" \
  -d '{ "origin": "https://larkspur-paper.example" }'
```

**Node**

```ts
const entry = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/stores`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ origin: "https://larkspur-paper.example" }),
})).json();
```

**Python**

```python
import os
import httpx

api, h = os.environ["PROVENANCE_API"], {"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}
entry = httpx.post(f"{api}/v1/authorize/stores", headers=h, json={"origin": "https://larkspur-paper.example"}).json()
```

The response's `proof` says what to publish. You can also do this in **Settings → Store → Network → Store listing**.

## 2. Publish the proof

Publish either one; we check it daily.

- A file at `https://your-origin/.well-known/provenance-store.json` containing `{"store_id": "nst_…"}`, or
- A DNS TXT record at `_provenance.your-host` with the value `provenance-store=nst_…`.

Then check it now with [`POST /v1/authorize/stores/{id}/check`](https://provenanceauth.com/docs/api/network.md#post-v1-authorize-stores-id-check). The `listing` field says where it stands:

| `listing` | Meaning |
| --- | --- |
| `listed` | In the directory now |
| `no_recent_activity` | Proven, but no Provenance use on the origin in 30 days |
| `proof_failed` | The proof doesn't name this store id |
| `proof_unreachable` | The proof couldn't be reached; the listing is paused |
| `unlisted` | You chose not to list it |

## 3. Choose categories

[`PATCH /v1/authorize/stores/{id}`](https://provenanceauth.com/docs/api/network.md#patch-v1-authorize-stores-id) with up to five `categories` from the [fixed list](https://provenanceauth.com/docs/authorize/concepts/directories.md#reading-the-directories). Agents with network grants limited to categories can buy only at stores in them.

## 4. Show the mark

**HTML**

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

The badge checks the page's own origin against the directory and renders **Accepts Provenance** only while you're listed.

## Unlist your store

Send `{"listed": false}` to [`PATCH /v1/authorize/stores/{id}`](https://provenanceauth.com/docs/api/network.md#patch-v1-authorize-stores-id), or choose **Don't list my store** in the console. The store leaves the directory within an hour. Removing the origin with [`DELETE /v1/authorize/stores/{id}`](https://provenanceauth.com/docs/api/network.md#delete-v1-authorize-stores-id) also removes the entry.

## Errors you might see

| Code | What to do |
| --- | --- |
| `network_store_taken` | The origin is already registered. Use its existing entry. |
| `parameter_invalid` | The origin isn't an https origin, or a category isn't on the list. |

## See also

- [Store and agent directories](https://provenanceauth.com/docs/authorize/concepts/directories.md)
- [Accept network orders](https://provenanceauth.com/docs/authorize/guides/accept-network-orders.md)
