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

# Custodial wallet quickstart

> Authenticate, create a customer, and provision an OMS custodial wallet with the API.

This quickstart provisions your first OMS custodial wallet through the API. You authenticate, create a customer to own the wallet, provision the wallet, and read its balance. OMS holds the keys, so there is no wallet SDK and no user signing.

> [!NOTE]
>
> Custodial wallets are in early access and require an OMS API key. [Request access](https://polygon.technology/get-access?utm_source=docs\&utm_medium=card\&utm_campaign=oms_access) if you do not have one yet.

**1. Get a bearer token**

You do not send the API key directly on requests. Exchange the key and secret for a short-lived bearer token at `POST /auth/token`, then send that token as `Authorization: Bearer {accessToken}` on every other call.

```bash Sandbox theme={null}
curl -X POST https://sandbox-api.polygon.technology/v0.13/auth/token \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "{api_key}",
    "apiSecret": "{api_secret}"
  }'
```

```bash Production theme={null}
curl -X POST https://api.polygon.technology/v0.13/auth/token \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "{api_key}",
    "apiSecret": "{api_secret}"
  }'
```

```json theme={null}
{
  "accessToken": "eyJhbGc...",
  "tokenType": "bearer",
  "expiresIn": 3600,
  "expiresAt": "2026-01-15T11:00:00Z"
}
```

The token is valid for 60 minutes. When a request returns `401`, exchange your key for a fresh token and retry. If `POST /auth/token` returns `429`, the endpoint is rate-limited: back off before retrying.

**2. Create a customer**

Every custodial wallet belongs to a customer. Create an individual with the identifying details OMS needs to clear them for custody:

```bash Sandbox theme={null}
curl -X POST https://sandbox-api.polygon.technology/v0.13/customers \
  -H "Authorization: Bearer {accessToken}" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: cst-wallet-quickstart-001" \
  -d '{
    "type": "individual",
    "firstName": "Jane",
    "lastName": "Smith",
    "email": "jane.smith@example.com",
    "phone": "+14155550123",
    "birthDate": "1990-05-15",
    "nationality": "US",
    "residentialAddress": {
      "line1": "100 Market St",
      "city": "San Francisco",
      "state": "CA",
      "zipCode": "94105",
      "country": "US"
    },
    "identifyingInformation": [
      { "type": "ssn", "issuingCountry": "US", "number": "{ssn}" }
    ]
  }'
```

```bash Production theme={null}
curl -X POST https://api.polygon.technology/v0.13/customers \
  -H "Authorization: Bearer {accessToken}" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: cst-wallet-quickstart-001" \
  -d '{
    "type": "individual",
    "firstName": "Jane",
    "lastName": "Smith",
    "email": "jane.smith@example.com",
    "phone": "+14155550123",
    "birthDate": "1990-05-15",
    "nationality": "US",
    "residentialAddress": {
      "line1": "100 Market St",
      "city": "San Francisco",
      "state": "CA",
      "zipCode": "94105",
      "country": "US"
    },
    "identifyingInformation": [
      { "type": "ssn", "issuingCountry": "US", "number": "{ssn}" }
    ]
  }'
```

You get back the customer with `201`:

```json theme={null}
{
  "id": "cst_01H9Xa...",
  "type": "individual",
  "name": "Jane Smith",
  "status": "active",
  "endorsements": [
    { "type": "basic", "status": "active" },
    { "type": "cryptoCustody", "status": "active" },
    { "type": "usd", "status": "active" }
  ],
  "createdAt": "2026-11-02T10:00:00.000Z",
  "updatedAt": "2026-11-02T10:00:00.000Z"
}
```

Store the `cst_` ID. `birthDate`, `residentialAddress`, and `identifyingInformation` are write-only, so they never appear in responses. A custodial wallet needs an `active` `cryptoCustody` [endorsement](https://docs.polygon.technology/payments/customers.md#endorsements); if the customer's `status` is still `pending`, wait for it to become `active` (poll `GET /customers/{customerId}` or listen for `customer.*` webhooks). A `202` response means onboarding is still running: resend the identical request with the same `Idempotency-Key` until you get `201`.

> [!WARNING]
>
> Projects that require identity verification need `email`, `birthDate` as `YYYY-MM-DD`, a US `phone` in E.164 format (`+1` and 10 digits), an `ssn` entry in `identifyingInformation`, and a US `residentialAddress` with a two-letter `state`. Addresses in New York, Texas, and Vermont are not supported on these projects. Don't send `endorsements` or `metadata` on create; the API rejects them today. Sandbox runs the same checks as production, so use well-formed synthetic data and avoid the word "test" in names and emails. If the request fails with `400`, the `cause` field names the field that failed; quote the `Request-Id` response header if you contact support.

**3. Create a custodial wallet**

Create the wallet with `POST /wallets`. Set `type` to `custodial` and name the `asset` and `network` in `details`. OMS derives the onchain address and manages the keys.

```bash Sandbox theme={null}
curl -X POST https://sandbox-api.polygon.technology/v0.13/wallets \
  -H "Authorization: Bearer {accessToken}" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: wlt-quickstart-001" \
  -d '{
    "customerId": "cst_01H9Xa...",
    "type": "custodial",
    "details": { "asset": "usdc", "network": "polygon" }
  }'
```

```bash Production theme={null}
curl -X POST https://api.polygon.technology/v0.13/wallets \
  -H "Authorization: Bearer {accessToken}" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: wlt-quickstart-001" \
  -d '{
    "customerId": "cst_01H9Xa...",
    "type": "custodial",
    "details": { "asset": "usdc", "network": "polygon" }
  }'
```

```json theme={null}
{
  "id": "wlt_01H9Xb...",
  "type": "walletCrypto",
  "customer": { "id": "cst_01H9Xa..." },
  "status": "active",
  "asset": "usdc",
  "network": "polygon",
  "address": "0xbeef4a2c891d56e72b67a3f21d0cf94f1d7c5911",
  "routing": { "claimStatus": "unclaimed" },
  "provider": "...",
  "balances": [
    { "asset": "usdc", "network": "polygon", "balance": "0.000000", "estimatedValueUsd": "0.00" }
  ],
  "createdAt": "2026-11-02T10:01:00.000Z",
  "updatedAt": "2026-11-02T10:01:00.000Z"
}
```

The `wlt_` ID is what you reference as a source or destination in quotes and transactions. In sandbox the `address` is on Polygon Amoy, the Polygon testnet. If the response is `202` instead of `201`, the wallet is still being provisioned: poll the URL in the `Location` header (`GET /wallets/operations/{operationId}`) until its `status` is `complete`, then read the wallet by the operation's `walletId`.

**4. Read the wallet balance**

`GET /wallets/{id}` returns the wallet with its current `balances`.

```bash Sandbox theme={null}
curl https://sandbox-api.polygon.technology/v0.13/wallets/wlt_01H9Xb... \
  -H "Authorization: Bearer {accessToken}"
```

```bash Production theme={null}
curl https://api.polygon.technology/v0.13/wallets/wlt_01H9Xb... \
  -H "Authorization: Bearer {accessToken}"
```

Each entry in `balances` carries the `asset`, `network`, `balance` as a decimal string at the asset's precision, and a USD estimate in `estimatedValueUsd`. A new wallet starts at zero. Fund it with a [fiat-to-crypto flow](https://docs.polygon.technology/payments/guides/fiat-to-crypto.md), then read the wallet again or subscribe to `customerWallet.*` and `transaction.*` [webhooks](https://docs.polygon.technology/api-reference/webhook-events.md) to track the balance. To list a customer's wallets, call `GET /wallets?customerId=cst_01H9Xa...`.

## What's next

> [card] [Custodial wallets reference](https://docs.polygon.technology/wallets/custodial-wallets.md)
>
> The wallet object, statuses, errors, claimed wallets, and webhook events.

> [card] [Fund a wallet](https://docs.polygon.technology/payments/guides/fiat-to-crypto.md)
>
> Bring fiat into the wallet with the cash-in or virtual account flows.

> [card] [Get started with OMS](https://docs.polygon.technology/payments/get-started.md)
>
> The end-to-end payments walkthrough, from customer to first transaction.
