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

# Buy fund shares

> Buy tokenized money market fund shares with stablecoins from a registered wallet.

Use the deposit endpoint to buy fund shares from a [registered wallet](https://docs.privy.io/wallets/actions/earn/tokenized-money-market-funds/register-wallets.md). Privy sends the wallet's stablecoins to WisdomTree. Privy then tracks the order as a wallet action until the shares reach the wallet.

### Purchase flow

1. Privy creates the order as a wallet action with status `pending`, and sends the wallet's stablecoins to WisdomTree.
2. WisdomTree fills the order. A `secondary` order fills from the fund's onchain pool. A `primary` order fills at the daily NAV strike.
3. The status moves to `succeeded` once the shares reach the wallet.

> [!WARNING]
>
> A `primary` order settles at the fund's daily NAV strike. An order placed after the 3:30 PM ET
> cutoff settles on the next business day. So a `primary` order will stay `pending` until it
> settles.

## Usage

To buy fund shares, send a `POST` request to:

```bash theme={"system"}
https://api.privy.io/v1/wallets/{wallet_id}/earn/tmmf/deposit
```

### Parameters

The body describes the order.

**amount** `string` *required*

The amount of `deposit_asset` to invest, as a decimal string in the asset's standard unit, e.g.
`"1000.00"`.

**deposit\_asset** `string` *required*

The currency the wallet sends, e.g. `"USDC"`. Case-insensitive.

**chain** `string` *required*

The chain the order trades on. Use `ethereum_sepolia` in the sandbox.

**fund** `string` *required*

The fund ticker, e.g. `"WTGXX"`. Case-insensitive.

**environment** `'sandbox' | 'production'`

The WisdomTree environment the order trades in. Defaults to `production`. Use `sandbox` to test.
See [how the sandbox
works](https://docs.privy.io/wallets/actions/earn/tokenized-money-market-funds/sandbox.md#how-the-sandbox-works).

**order\_type** `'primary' | 'secondary'` *required*

How the order fills: `secondary` from the fund's onchain pool, which is faster, or `primary`
directly with the fund at the daily NAV strike.

**reference\_id** `string`

Your app's identifier for the order. Privy returns it on the wallet action.

**nonce** `string`

A unique value of at least 24 characters that prevents replaying a signed request.

> [!NOTE]
>
> Wallets with `owner_id` present must provide an [authorization
> signature](https://docs.privy.io/api-reference/authorization-signatures.md) as a request header.

### Returns

The endpoint returns the order as a wallet action.

**id** `string`

The wallet action ID of the order. Use this to poll status with [get wallet action](https://docs.privy.io/api-reference/wallets/actions/get.md).

**wallet\_id** `string`

The ID of the wallet that placed the order.

**type** `string`

The action type. Always `"tmmf_deposit"` for this endpoint.

**status** `'pending' | 'succeeded' | 'rejected' | 'failed'`

The current status of the order.

**reference\_id** `string | null`

The `reference_id` of the request, if any.

**failure\_reason** `object | undefined`

Why the order was rejected or failed, with `message` and `details`.

**created\_at** `string`

ISO 8601 timestamp of when the order was created.

**steps** `array | undefined`

The order's steps. Only returned if `?include=steps` is provided on a GET request.

**wisdomtree\_settlement step**

**type** `'wisdomtree_settlement'`

The step type.

**status** `'preparing' | 'queued' | 'pending' | 'confirmed' | 'rejected' | 'failed'`

`pending` while WisdomTree fills the order and Privy tracks the chain state, then `confirmed` once the order reaches the wallet.

**caip2** `string | null`

The CAIP-2 identifier of the chain the order trades on.

**order\_type** `'primary' | 'secondary' | null`

How the order fills.

**requested** `object | null`

What the wallet sends, e.g. `{"deposit_asset": "USDC", "amount": "10"}`.

**received** `object | null`

What the wallet received, e.g. `{"fund": "WTGXX", "amount": "9.99"}`. `null` until the order reaches the wallet.

**settlement\_transaction\_hash** `string | null`

The transaction that delivered the shares. `null` until the order reaches the wallet.

### Example

This request buys 10 USDC of WTGXX from the fund's pool.

```bash theme={"system"}
curl -X POST https://api.privy.io/v1/wallets/{wallet_id}/earn/tmmf/deposit \
  -H "privy-app-id: <your-app-id>" \
  -H "Authorization: Basic <credentials>" \
  -H "privy-authorization-signature: <authorization-signature>" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "10.00",
    "deposit_asset": "USDC",
    "chain": "ethereum_sepolia",
    "fund": "WTGXX",
    "order_type": "secondary",
    "environment": "sandbox"
  }'
```

```json Example response theme={"system"}
{
  "id": "<action-id>",
  "wallet_id": "<your-wallet-id>",
  "type": "tmmf_deposit",
  "status": "pending",
  "reference_id": null,
  "created_at": "2026-11-01T12:00:00.000Z"
}
```

> [!NOTE]
>
> **Idempotency on errors:** This endpoint returns `pending` immediately. Replaying the same key
> returns the cached response. On a synchronous 5xx, Privy deletes the record so the same key
> retries fresh. Action outcomes (`rejected`, `failed`, `succeeded`) arrive via
> [webhooks](https://docs.privy.io/wallets/actions/webhooks.md) and [polling](https://docs.privy.io/wallets/actions/status.md). Policy violations
> always allow fresh retries.

## Statuses and failures

An order has one of four statuses. Every status but `pending` is final.

| Status | Meaning |
| - | - |
| `pending` | Privy is sending the stablecoins, or waiting for WisdomTree to deliver the shares. |
| `succeeded` | The shares purchased reached the wallet. |
| `rejected` | The order stopped before any funds moved, for example because the fund's pool could no longer fill it. Place a new order. |
| `failed` | WisdomTree failed or refunded the order after the transfer (`order_refunded`). Read the action's `steps` and `failure_reason`. |

### Common errors

The endpoint returns an error, and creates no order, when it cannot place the order.

| Status | Cause |
| - | - |
| `400` | The order is invalid. For example, the fund is not currently tradable, WisdomTree has not approved the wallet or its user, or the wallet balance is too low. |
| `403` | The order uses `production`, and the app has no production access. |
| `409` | The fund's pool cannot fill a `secondary` order. Retry later, or use a `primary` order. |

> [!TIP]
>
> To know when the shares reach the wallet, poll [get wallet
> action](https://docs.privy.io/api-reference/wallets/actions/get.md). Or listen for the
> `wallet_action.tmmf_deposit.succeeded`
> [webhook](https://docs.privy.io/wallets/actions/earn/tokenized-money-market-funds/webhooks.md).

## Next steps

Once the order succeeds, show the new position. Or sell shares back for stablecoins.

> [card] [List positions](https://docs.privy.io/wallets/actions/earn/tokenized-money-market-funds/get-positions.md)
>
> Show the wallet's shares, their value, and pending orders.

> [card] [Sell fund shares](https://docs.privy.io/wallets/actions/earn/tokenized-money-market-funds/sell.md)
>
> Sell fund shares for stablecoins.
