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

# Merchant Setup

> Configure forwardToArbiter() to send responses to the arbiter for evaluation.

### Prerequisites

* A deployed delivery protection operator (see [Deploy an Operator](/sdk/deploy-operator#delivery-protection-operator))
* An arbiter service endpoint (see [Arbiter Setup](/sdk/delivery-arbiter))

<Steps>
  <Step title="Install dependencies">
    <CodeGroup>
      ```bash npm theme={null}
      npm install @x402r/helpers
      ```

      ```bash pnpm theme={null}
      pnpm add @x402r/helpers
      ```

      ```bash bun theme={null}
      bun add @x402r/helpers
      ```
    </CodeGroup>
  </Step>

  <Step title="Configure forwardToArbiter()">
    Add the `forwardToArbiter()` hook to your x402 resource server. After every successful `auth-capture` settlement, it POSTs to your arbiter service fire-and-forget:

    ```typescript theme={null}
    import { forwardToArbiter } from '@x402r/helpers'
    import { AuthCaptureEvmScheme } from '@x402r/evm/auth-capture/server'

    const resourceServer = new x402ResourceServer(facilitatorConfig)
      .register(networkId, new AuthCaptureEvmScheme())
      .onAfterSettle(
        forwardToArbiter('http://your-arbiter:3001', {
          onError: (err) => console.error('Arbiter unreachable:', err),
        }),
      )
    ```

    The hook POSTs to `{arbiterUrl}/verify` with:

    ```json theme={null}
    {
      "responseBody": "the HTTP response body as a string",
      "transaction": "0xsettlement_tx_hash",
      "paymentInfoWire": {
        "operator": "0x...",
        "payer": "0x...",
        "receiver": "0x...",
        "token": "0x...",
        "maxAmount": "10000",
        "preApprovalExpiry": 1740758554,
        "authorizationExpiry": 1740762154,
        "refundExpiry": 1741276954,
        "minFeeBps": 0,
        "maxFeeBps": 500,
        "feeReceiver": "0x...",
        "salt": "0x..."
      }
    }
    ```

    The helper reconstructs `PaymentInfoWire` from the verified `SettleResultContext`. The arbiter consumes `req.body.paymentInfoWire` and runs it through `PaymentInfo.fromWire(...)` to recover the `bigint`-typed struct expected by SDK actions. See [forwardToArbiter() docs](/sdk/helpers/forward-to-arbiter) for the full payload shape.

    <Warning>
      `forwardToArbiter()` is fire-and-forget. If the arbiter service is unreachable, funds stay in escrow until timeout. Add monitoring for arbiter availability.
    </Warning>
  </Step>

  <Step title="Share addresses with the arbiter">
    The arbiter service needs `operatorAddress` and `escrowPeriodAddress` from your [deployment](/sdk/deploy-operator#delivery-protection-operator) to construct its SDK client. Share these via config, environment variables, or a shared registry.
  </Step>
</Steps>

## Next Steps

<CardGroup cols={2}>
  <Card title="Arbiter Setup" icon="shield-check" href="/sdk/delivery-arbiter">
    Build the service that evaluates responses and releases funds.
  </Card>

  <Card title="Deploy Operator" icon="rocket" href="/sdk/deploy-operator">
    Full deployment config and condition slot details.
  </Card>
</CardGroup>
