# Deposit funds

Product: Account API
Guides follow API reference 0.3.0 and event reference 0.2.0.
Canonical page: https://docs.axiym.io/account-api/integration-guide/deposit-funds

A deposit is initiated outside the Account API. Send funds from an active
address book entry using the deposit instructions returned for the intended
Axiym account. Use the API to identify, track, and reconcile the resulting
deposit.

Complete [Select an address book entry](/account-api/integration-guide/register-external-account)
before initiating the payment.

## 1. Confirm the registered source

Confirm that the bank account or wallet from which the payment will originate:

* belongs to your organization;
* is registered and `ACTIVE`;
* uses the intended currency; and
* for a wallet, uses the intended blockchain network.

## 2. Select the Axiym account

List Axiym accounts and select the `accountId` whose currency and payment rail
match the funds you will send.

```sh
curl "https://partner-api.sandbox.axiym.io/api/v1/accounts" \
  --header "Authorization: Bearer $AXIYM_ACCESS_TOKEN"
```

## 3. Retrieve deposit instructions

```sh
curl \
  "https://partner-api.sandbox.axiym.io/api/v1/accounts/$ACCOUNT_ID/deposit-instructions" \
  --header "Authorization: Bearer $AXIYM_ACCESS_TOKEN"
```

Bank instructions return beneficiary and receiving-bank details and, when the
account is funded through a shared receiving account, an account-specific
`reference`. Wallet instructions return a `walletAddress` and `network`.

## 4. Send the funds

In production, initiate the bank or blockchain payment from the registered
account or wallet using the exact instructions returned for the Axiym account.
Include the returned reference, when present, on a bank transfer, and use the
returned network for a wallet transfer.

Bank deposits are matched to the receiving Axiym account by the supplied
reference, or by the receiving account number when no reference is returned;
wallet deposits are matched by the receiving address.

In sandbox, use the test process agreed with Axiym:

* use only the address book entry fixture and bank simulation process
  confirmed by Axiym; never send a real bank payment to sandbox details;
* use only the registered test wallet, test asset, and blockchain test network
  confirmed for the sandbox workflow; and
* verify the deposit, notification, account credit, and statement entry in the
  same way you would in production.

## 5. Find and track the deposit

```sh
curl \
  "https://partner-api.sandbox.axiym.io/api/v1/deposits?accountId=$ACCOUNT_ID" \
  --header "Authorization: Bearer $AXIYM_ACCESS_TOKEN"
```

Store the matching `depositId`, then retrieve that deposit when you need its
current status or complete details.

```sh
curl \
  "https://partner-api.sandbox.axiym.io/api/v1/deposits/$DEPOSIT_ID" \
  --header "Authorization: Bearer $AXIYM_ACCESS_TOKEN"
```

The Axiym account is credited when the deposit is `COMPLETED`. `HELD` is a
temporary processing hold; continue monitoring for a later status change.
`CANCELED` and `REJECTED` mean the deposit did not complete.

Deposit webhooks report each status change; see
[Events](/account-api/webhooks/events).

## 6. Reconcile the credit

Retrieve the Axiym account statement after completion:

```sh
curl \
  "https://partner-api.sandbox.axiym.io/api/v1/accounts/$ACCOUNT_ID/statement" \
  --header "Authorization: Bearer $AXIYM_ACCESS_TOKEN"
```

Use `relatedResourceType: DEPOSIT` and `relatedResourceId` equal to the
`depositId` to join the posted credit to the deposit record and resulting
running balance. See [Reconcile activity](/account-api/integration-guide/reconcile-activity).
