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

# Add a paywall

> Price a route under a service. Agents hit the URL, pay the 402, and get your API response.

A **paywall** is where the money happens. It protects one route: price in USDC, methods, path — Proceeds generates the public payment URLs.

## Before you start

* An existing [service](/quickstart/create-a-service)
* For the API path: an API key with `paywalls:write`

## Using the dashboard

<Steps>
  <Step title="Open the service">
    On **Paywalls**, expand the service and click **New Paywall**.
  </Step>

  <Step title="Fill in the form">
    | Field                             | Example                                   |
    | --------------------------------- | ----------------------------------------- |
    | Name                              | `Current weather`                         |
    | Slug                              | `current-weather` (or click **Generate**) |
    | Allowed HTTP methods              | `GET`                                     |
    | Path                              | Upstream path under the service base URL  |
    | Query parameters / custom headers | Optional                                  |
    | Price                             | Amount in USDC                            |
  </Step>

  <Step title="Save & Activate">
    Copy the payment URLs:

    ```
    https://myproceeds.xyz/api/x402/pay/{serviceId}/{slug}
    https://myproceeds.xyz/api/mpp/pay/{serviceId}/{slug}
    ```
  </Step>
</Steps>

<Tip>
  Use clear slugs and descriptions — they show up in transactions, events, and [API discovery](/guides/api-discovery).
</Tip>

## Using the API

<Note>
  In the API, `price` is USDC in **smallest units** (6 decimals) as a string. `"50000"` = `$0.05`.
</Note>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.myproceeds.xyz/v1/paywalls \
    -H "Authorization: Bearer mpk_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "serviceId": "YOUR_SERVICE_ID",
      "slug": "current-weather",
      "name": "Current weather",
      "description": "Latest conditions for a location",
      "targetType": "PROXY",
      "targetUrl": "https://api.example.com/v1/weather/current",
      "price": "50000",
      "currency": "USDC",
      "allowedMethods": ["GET"],
      "networks": ["base-sepolia", "tempo-testnet"],
      "enabled": true
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.myproceeds.xyz/v1/paywalls", {
    method: "POST",
    headers: {
      Authorization: "Bearer mpk_your_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      serviceId: "YOUR_SERVICE_ID",
      slug: "current-weather",
      name: "Current weather",
      description: "Latest conditions for a location",
      targetType: "PROXY",
      targetUrl: "https://api.example.com/v1/weather/current",
      price: "50000", // $0.05 USDC
      currency: "USDC",
      allowedMethods: ["GET"],
      networks: ["base-sepolia", "tempo-testnet"],
      enabled: true,
    }),
  });

  const { data: paywall } = await response.json();
  ```
</CodeGroup>

Full reference: [Create a paywall (API)](/api-reference/create-a-paywall).

## Verify the challenge

```bash theme={null}
curl -i https://myproceeds.xyz/api/x402/pay/{serviceId}/current-weather
```

You should get `402 Payment Required`.

## Next

<Card title="Set up an agent wallet" icon="wallet" href="/quickstart/set-up-an-agent-wallet">
  Fund an agent with real USDC, then pay the 402.
</Card>
