<!-- tempo-docs-context -->
> Source: [/docs/zones/deposit](https://tempo.xyz/developers/docs/zones/deposit.md)
> Section: [Zones](https://tempo.xyz/developers/docs/zones.md). Connect to a Zone and work with private balances, deposits, and withdrawals. Zones is in limited preview; see the introduction for access. Earlier testnet sandbox guides describe a separate integration.
> [Documentation index](https://tempo.xyz/developers/llms.txt) · [Docs skill](https://tempo.xyz/developers/SKILL.md)

> Tempo MCP: Use `search`, `find_pages`, `read_page`, and `code` at `https://mcp.tempo.xyz` for Tempo and related documentation.
> If an indexed page is missing or reflects an older site, read this site’s [documentation index](https://tempo.xyz/developers/llms.txt) and Markdown pages directly.

<span id="deposit-into-a-zone" />

# Deposit Into a Zone

Deposit stablecoins through the Zone's portal on Tempo, then confirm the private account's credit.

## Overview

A deposit moves stablecoins from Tempo into a [Zone](https://tempo.xyz/developers/docs/zones), a private stablecoin ledger connected to Tempo. You send them to the Zone's portal (`ZonePortal`), a contract on Tempo that locks the backing assets. After Tempo finality, the Zone mints the same amount, less fees, to a private account. Only that account and the operator can read its balance.

This page uses an authenticated Zone RPC connection and the deployment details from [Connect to a Zone](https://tempo.xyz/developers/docs/zones/connect): the Zone ID, chain ID, portal address, and enabled assets. The Zone's operator, who runs the deployment, also supplies the tooling that encrypts deposits and calls the portal.

<span id="submit-an-encrypted-deposit" />

## Setup

<span id="check-the-asset-and-recipient" />

:::steps
### Prepare the Deposit

Confirm that the deployment accepts the token. Confirm that its access rules, which the operator sets, permit the depositor and recipient. Choose the private recipient and memo. Also choose a public refund recipient (`tempoRefundRecipient`), a Tempo address that gets the funds back if the Zone can't credit the deposit.

<span id="check-the-deposit-fees" />

#### Calculate Deposit Fees

Call the deployed portal's `calculateDepositFee()` and `calculateBouncebackFee()`. The deposit fee is a fixed processing fee that comes out of the amount sent. The bounce-back fee is deducted only if a failed deposit is refunded to Tempo, and the deposit must be large enough to cover it. Show the expected net credit before the depositor signs. The [deposit fee rules](https://tempo.xyz/developers/docs/protocol/zones/execution#deposit-fees) define the exact calculation.

<span id="encrypt-and-authorize-the-deposit" />

<span id="send-funds" />

### Submit the Deposit

Use the operator's supported tooling to encrypt the private recipient and memo with the operator's published encryption key. Approve the portal to spend the token if your tooling requires an approval. Then call `ZonePortal.depositEncrypted` on Tempo with the token, amount, encrypted payload, and refund recipient. The portal appends each deposit to a queue that the Zone processes in order. Save the queue hash the call returns, which identifies this deposit in [Track the Deposit](https://tempo.xyz/developers/docs/zones/deposit#track-the-deposit).

The token, amount, depositor, and refund recipient stay public, as the [privacy model](https://tempo.xyz/developers/docs/zones/privacy) describes.

<span id="confirm-the-private-credit" />

<span id="confirm-arrival" />

### Confirm the Credit

After the Tempo transaction finalizes, [check the Zone credit](https://tempo.xyz/developers/docs/zones/balances) with the recipient's authenticated connection. Store the queue hash with the private balance change it produced, so you can match each public deposit to its credit.
:::

## Track the Deposit

Read the deposit outcome with the hosted [Zone status API](https://tempo.xyz/developers/docs/api/zones). Look it up by the queue hash that `ZonePortal.depositEncrypted` returns, not by its transaction hash.

The API needs a Tempo API key with `data:read` and access to that Zone, created in [Tempo Console](https://tempo.xyz/developers/docs/api/authentication#api-keys). In the playground, select **Try**. Enter the queue hash and the Zone's numeric `chainId` from the operator. The request tool includes language examples and the response.

`GET /v1/zones/deposits/{depositHash}`

Get Zone deposit

[API reference](https://tempo.xyz/developers/docs/api/zones#getzonedeposit) — request parameters, authentication, and response schema. The examples below use editable sample values.

Requires a [Tempo API key](https://tempo.xyz/developers/docs/api/console/api-keys). Replace `YOUR_API_KEY` before running this request.

**cURL**

```bash
curl 'https://api.tempo.xyz/v1/zones/deposits/0x1111111111111111111111111111111111111111111111111111111111111111?chainId=1424310003' \
  --header 'tempo-api-key: YOUR_API_KEY'
```

**TypeScript**

```ts
fetch('https://api.tempo.xyz/v1/zones/deposits/0x1111111111111111111111111111111111111111111111111111111111111111?chainId=1424310003', {
  headers: {
    'tempo-api-key': 'YOUR_API_KEY'
  }
})
```

The response `status` is `pending`, `completed` (the Zone credited the recipient), or `failed`. For a `failed` deposit, `refund` names the refund recipient, and `refund.status` is `pending` while the refund's delivery is unverified. Confirm the refund before you retry. Read the private account's ledger with authenticated [balance and activity reads](https://tempo.xyz/developers/docs/zones/balances).

## Handle Deposit Failures

A deposit fails in the Zone when decryption fails or the Zone can't mint to the recipient, such as when a token policy blocks it. The inbox (`ZoneInbox`) then queues a refund to the refund recipient on Tempo, less the bounce-back fee. If that Tempo transfer also fails, the portal records a refund that the refund recipient claims with `claimRefund(token)`. The [encrypted deposit rules](https://tempo.xyz/developers/docs/protocol/zones/bridging#encrypted-deposits) cover each case. Confirm the eventual credit or refund before you retry a deposit.

If funds start on another network, [route them to Tempo](https://tempo.xyz/developers/docs/routes) first. Then deposit through the portal.

<span id="try-a-sandbox-deposit" />

## Related

[Balances and Activity](https://tempo.xyz/developers/docs/zones/balances): Use for confirming the private credit with an authenticated read.

[Bridging](https://tempo.xyz/developers/docs/protocol/zones/bridging): Covers encrypted deposits, the deposit lifecycle, and refunds.

[Deposit OUSD](https://tempo.xyz/developers/docs/guide/private-zones/deposit-to-a-zone): Use for trying a deposit with OUSD test funds in the testnet sandbox.

[Withdraw From a Zone](https://tempo.xyz/developers/docs/zones/withdraw): Use for returning funds to Tempo and tracking delivery.
