Real-time inventory

Know when an account's inventory reflects the transactions you've sent, by webhook or by polling.

Part of Build tax center experiences. Taxbit recalculates an account's inventory in the background after each transaction it processes, so a read straight after a send can come before the recalculation. This page shows two ways to know the inventory has caught up: a webhook that tells you, or a check you run yourself.

The newest transaction for an account is usually reflected in under a second when transactions arrive in order. A transaction that lands earlier in an account's history is a historical change and has no SLA. See SLAs & async behavior.

By the end of this page your app refreshes an account's inventory only once it reflects the latest transaction.

Before you begin

Refresh on the webhook

With a webhook subscription, Taxbit delivers an INVENTORY_UPDATE event when an account's inventory changes. Each delivery wraps its events in a data array; iterate over it rather than reading only the first entry.

{
  "timestamp": "2026-07-15T13:05:41Z",
  "data": [
    {
      "id": "evt_3f81c2d0",
      "event_type": "INVENTORY_UPDATE",
      "account_id": "acct_5f2e7d10",
      "latest_transaction_datetime": "2026-07-15T13:05:40Z",
      "update_from_datetime": "2026-07-15T13:05:40Z",
      "latest_transaction_id": "trade_88214",
      "update_from_transaction_id": "trade_88214"
    }
  ]
}

When it arrives, re-read the account's inventory with GET /v1/inventory/summaries or GET /v1/inventory, as in Retrieve inventory. update_from_datetime is the start of the affected range: figures from that point forward may have changed, including gains you've already shown. When transactions were deleted, the event carries no *_transaction_id fields, so rely on the datetimes. The Webhooks guide has the full event reference.

Check by polling

Without a subscription, compare what the inventory reflects with what you sent. The summary in GET /v1/inventory and in each entry of GET /v1/inventory/summaries carries:

  • latest_transaction_datetime: the datetime of the latest transaction for the asset.
  • client_modified_by_transaction_id: your id for that transaction.
curl -G $BASE_URL/v1/inventory/summaries \
  -H "Authorization: Bearer $TOKEN" \
  --data-urlencode "account_id=acct_5f2e7d10"
{
  "data": [
    {
      "asset": { "code": "ETH", "name": "Ethereum", "type": "Crypto", "uuid": "b7a005b5-f4d5-44ea-ae80-d4f9e8313558" },
      "summary": {
        "total_quantity": "1.5",
        "total_quantity_with_cost_basis": "1.5",
        "total_cost": "4875.00",
        "average_unit_cost": "3250.00",
        "latest_transaction_datetime": "2026-07-15T13:05:40Z",
        "client_modified_by_transaction_id": "trade_88214"
      }
    }
  ]
}

When those match the last transaction you sent for that asset, the inventory reflects it. If they don't yet, read again after a short wait.

Where to go next

Display unrealized gain/loss turns current inventory into gain and loss figures at your prices. Back to Build tax center experiences.