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

# Develop with Atum SDK

> Integrate x402 payment initiation directly into your agent's code with the @atumlabs/x402-atum-escrow client package.

## 1. Install the package

```bash theme={null}
npm install @atumlabs/x402-atum-escrow @x402/core @x402/fetch ethers
```

## 2. Register the scheme and wrap fetch

```ts theme={null}
import { ethers } from "ethers";
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerAtumEscrowScheme } from "@atumlabs/x402-atum-escrow/client";

const client = new x402Client();
registerAtumEscrowScheme(client, { signer: new ethers.Wallet(PRIVATE_KEY) });

const fetchWithPayment = wrapFetchWithPayment(fetch, client);

// Call it exactly like fetch — your agent's tool-call code doesn't need to
// branch on whether the resource is x402-gated.
const res = await fetchWithPayment("https://merchant.example/paid");
```

`registerAtumEscrowScheme` reads the selected `402` option's `extra.atum` (destination, deadlines, settlement vault/proxy/role addresses), builds the Atum payment request, and signs the source-side Permit2 authorization for the settlement vault deposit.

## 3. Restrict source networks (optional)

`registerAtumEscrowScheme` registers under the `eip155:*` wildcard by default — pass an explicit `networks` list to restrict which source chains your agent will fund from:

```ts theme={null}
registerAtumEscrowScheme(client, {
  signer: new ethers.Wallet(PRIVATE_KEY),
  networks: ["eip155:8453"], // illustrative CAIP-2 id (Base mainnet) — substitute the source chains you fund from
});
```

<Note>
  Chain IDs, tokens, and addresses in these snippets are **illustrative placeholders**. Use [Supported networks](/get-started/reference/supported-networks) and [Supported assets](/get-started/reference/supported-assets) for the live catalog.
</Note>

<Warning>
  The source token must already have an [`approve(Permit2)`](/get-started/concepts/permit2-and-approvals) allowance covering the spend, or the settlement vault deposit reverts at settlement. Arranging that is your agent/app's responsibility — the mechanism assumes it and does not check on-chain. See the Permit2 allowance prerequisite in [Agentic sends](/payment-protocols/x402/make-payments/agentic-payment-initiation) for a preflight pattern.
</Warning>

## 4. Build a payment without sending it (optional)

If you'd rather build a payment without immediately sending the request — for example to inspect it, log it, or drive a facilitator's `/verify` directly — read the `402` yourself and build the payload from the HTTP client wrapper (`x402HTTPClient`, which wraps your `x402Client`): `httpClient.createPaymentPayload(paymentRequired)`, instead of using `wrapFetchWithPayment`.

## Next steps

| Topic                              | Link                                                                              |
| ---------------------------------- | --------------------------------------------------------------------------------- |
| Run the demo first                 | [Agentic sends](/payment-protocols/x402/make-payments/agentic-payment-initiation) |
| Merchant-side guide                | [Accept payments](/payment-protocols/x402/accept-payments/overview)               |
| Facilitator API reference          | [x402 Facilitator API](/api-reference/x402/introduction)                          |
| Supported chains and tokens        | [Supported kinds](/api-reference/x402/supported)                                  |
| Agent-initiated payouts (not x402) | [Agentic payouts](/get-started/use-cases/agentic-payouts)                         |
