# Reconcile activity

Join withdrawals, deposits, account movements, events, and external settlement records.

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/reconcile-activity

Store identifiers from the moment a withdrawal is created or a deposit is
detected:

| Record           | Identifiers to retain                                                                  |
| ---------------- | -------------------------------------------------------------------------------------- |
| Your instruction | External reference, creation idempotency key, and confirmation idempotency key         |
| Withdrawal       | `withdrawalId`, payment `code` where returned, source `accountId`, and `destinationId` |
| Deposit          | `depositId`, payment `code` where returned, and the credited `accountId`               |
| Webhook          | Event ID, type, timestamp, and resource identifiers                                    |
| External outcome | Bank reference or blockchain `transactionHash` where applicable                        |

## Retrieve a statement period

Set `ACCOUNT_ID` to the account identifier and `AXIYM_ACCESS_TOKEN` to
your sandbox token. Replace the example dates with the period to reconcile.

```sh
curl \
  "https://partner-api.sandbox.axiym.io/api/v1/accounts/$ACCOUNT_ID/statement?from=2026-07-01&to=2026-07-31&first=100" \
  --header "Authorization: Bearer $AXIYM_ACCESS_TOKEN"
```

`from` and `to` are inclusive UTC calendar dates applied to the posting time
of each movement. Omit them for the account's full history.

When `pageInfo.hasNextPage` is true, send `pageInfo.endCursor` as `after` on
the next request. Keep the account, period, and filters unchanged.

## Match a withdrawal debit

For each completed withdrawal, find the statement entry with:

* `relatedResourceType: WITHDRAWAL`;
* `relatedResourceId` equal to its `withdrawalId`;
* `type: DEBIT`; and
* `amount` and `currency` matching the withdrawal's `sourceAmount`.

The fee is already included in that debit. The recipient receives
`destinationAmount`, equal to `sourceAmount` less `fee`; do not add the fee
again when reconciling the source account.

Compare the external receipt with the withdrawal details, using the bank
reference or wallet `transactionHash` where available. Sandbox bank scenarios
have simulated external outcomes; wallet transfers can be verified on testnet.

## Match a deposit credit

For each completed deposit, find the statement entry with:

* `relatedResourceType: DEPOSIT`;
* `relatedResourceId` equal to its `depositId`;
* `type: CREDIT`; and
* `amount` and `currency` matching the deposit `amount`.

Compare the deposit with the sender's payment record, using the deposit
`code`, `remitterName`, or wallet `transactionHash` where available.

## Reconcile the period

Check the statement totals:

```text
openingBalance + totalCredited - totalDebited = closingBalance
```

Entry amounts are positive; `type` determines the direction. Use `balanceAfter`
and, where present, `balanceBefore` to check running balances in posting order.
A current account balance alone cannot identify a particular withdrawal or
deposit.

Statements may include other activity. `CONVERSION` and `PAYOUT` links refer
to resources of other Axiym APIs; retain their identifiers. Entries without a
linked resource can be direct ledger adjustments.

Investigate completed withdrawals without a matching debit or external
outcome, and completed deposits without a matching credit. Use withdrawal and
deposit reads for processing status and events as an audit input.
Preserve unknown states rather than forcing them into a successful or failed result.
