# Deposit processing lifecycle

> Standalone deposit flow from address assignment through confirmation to balance credit.

See [Deposit statuses](https://docs.cryptonly.net/guides/deposits/statuses.md) for the full status table and integration notes.

## Create, listen, then settle

1. Create a deposit through the API (`POST /deposit`) with `accountId`, `cryptoCurrencyCode`, and `orderId`
2. Show the customer the deposit address, QR code, or payment link
3. Listen for `deposit.statusChanged` webhook events
4. Update your internal balance or fulfilment logic when the deposit reaches `completed`

## Deposit lifecycle

1. **Merchant creates a deposit request**

   A deposit can be created either:

   * through the **admin panel**
   * via the **API**

   When creating a deposit through the API, the merchant provides:

   * `accountId`
   * `cryptoCurrencyCode`
   * `orderId` (idempotency key)

   Optional fields include `customerId` and `webhookUrl`.

1. **Cryptonly assigns a unique deposit address**

   Cryptonly assigns a deposit address that is used for this deposit only and returns a payment link, QR code, and `expiresAt` timestamp (default **20 minutes**).

   The customer can send any amount at or above the currency minimum. The [network fee](https://docs.cryptonly.net/guides/fees-and-commissions.md#deposit-network-fee) for moving the funds off this address is fixed at this point and withheld from the received amount.

   If the payment arrives after `expiresAt` but within **4 hours** after expiry, it is still processed through the steps below (the deposit moves from `expired` to `processing`). See [Late payments](https://docs.cryptonly.net/guides/deposits/statuses.md#late-payments).

1. **Customer sends crypto to the deposit address**

   Unlike invoice payments, the amount is flexible as long as it meets the minimum deposit requirement for the selected currency.

1. **Cryptonly waits for the required on-chain confirmation(s)**

   Once the transfer is detected on-chain, Cryptonly waits for the required number of blockchain confirmations before proceeding. See [Onchain confirmations](https://docs.cryptonly.net/guides/onchain-confirmations.md) for the number required per chain.

   The deposit moves to `processing` at this stage.

1. **Cryptonly performs an AML check**

   After the required confirmations, Cryptonly screens the transaction. It can pass and continue, be flagged for review, or be held.

1. **If the AML check passes, the deposit is completed and the balance is credited**

   Cryptonly marks the deposit as `completed` and credits the merchant's internal balance with the received amount minus the network fee and commission.

1. **Cryptonly sends webhooks on status changes**

   Cryptonly sends a `deposit.statusChanged` webhook on each deposit status transition.

   The webhook endpoint can be defined in the admin panel, set as an organization default, or passed directly in the deposit creation API call.

## Related pages

- [Statuses](https://docs.cryptonly.net/guides/deposits/statuses.md): Status table and late payments
- [Onchain confirmations](https://docs.cryptonly.net/guides/onchain-confirmations.md): How many confirmations each network requires
- [Fees and commissions](https://docs.cryptonly.net/guides/fees-and-commissions.md): Network fee withheld from the received amount
- [Webhooks](https://docs.cryptonly.net/api-reference/webhooks.md): Verify deposit.statusChanged
