# Bill Object (/api-reference/schema/bill)
# Business Object (/api-reference/schema/business)
# Check Object (/api-reference/schema/check)
# Credit Memo Object (/api-reference/schema/credit-memo)
# Customer Object (/api-reference/schema/customer)
# Document Object (/api-reference/schema/document)
# External Account Object (/api-reference/schema/external-account)
# Invoice Object (/api-reference/schema/invoice)
# Journal Entry Object (/api-reference/schema/journal-entry)
# Ledger Object (/api-reference/schema/ledger)
# Tag Field Object (/api-reference/schema/tag-field)
# Tag Value Object (/api-reference/schema/tag-value)
# Task Object (/api-reference/schema/task)
# Transaction Object (/api-reference/schema/transaction)
# Trip Object (/api-reference/schema/trip)
# Vehicle Object (/api-reference/schema/vehicle)
# Vendor Credit Object (/api-reference/schema/vendor-credit)
# Vendor Object (/api-reference/schema/vendor)
# Webhook Object (/api-reference/schema/webhook)
# API Authentication (/apioverview/authentication)
Asset's API uses OAuth 2.0 for authentication. All API requests require a valid access token, included in the `Authorization` header.
## **Getting an Access Token** [#getting-an-access-token]
1. **Set Up Your Tenant Account**
- A Tenant Account is required to authenticate with Asset's API. If you don't have one, reach out via our Contact form.
- Once set up, you can manage OAuth credentials in the Asset Dashboard.
2. **Obtain Client Credentials**
- Register an application in the Asset Dashboard to receive a `client_id` and `client_secret`.
- Separate credentials exist for **Production** and **Sandbox** environments.
3. **Request a Token**
Use your client credentials to request an access token:
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/auth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'client_id=' \
--data 'client_secret=The oauth client secret'
```
A successful response returns:
```bash
{
"access_token": "your-access-token",
"token_type": "Bearer",
"expires_in": 1777657168
}
```
### Scoping the access token to a business [#scoping-the-access-token-to-a-business]
You can scope the access token to a business by passing the business id as a body parameter
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/auth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'client_id=' \
--data 'client_secret=The oauth client secret' \
--data business_id=biz_GA6EG2qFxA97NZHtxeLPUy
```
### Scoping the access token to a resource [#scoping-the-access-token-to-a-resource]
You can scope the access token to a subset of resources and actions that can be done on that resource.
For example, to create an access token to only create, read and update the ledgers, you can add the
list of scopes to the request:
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/auth/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'client_id=' \
--data 'client_secret=The oauth client secret' \
--data 'scope=ledger:create ledger:update ledger:read'
```
## **Authenticating API Requests** [#authenticating-api-requests]
Include the access token in the `Authorization` header:
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business?page_size=100" \
--header "Authorization: Bearer YOUR_ACCESS_TOKEN"
```
Access tokens expire after a set time and must be renewed using the same OAuth flow. Manage credentials in the Asset Dashboard.
Credentials and tokens should always be kept secure—never share them outside
your organization and exercise caution when sharing internally.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Headers (/apioverview/headers)
### Authorization [#authorization]
This is a required header in the form of `Bearer `. It is used to authenticate all requests against the API.
### x-user-id [#x-user-id]
Some Asset API operations accept an optional `x-user-id` request header. When you send it, we associate the call with
that identifier so we can **track user actions on specific resources** .
The header is **optional**. Endpoints behave the same whether or not you include it.
Use a stable value your platform already uses to represent a person or service account (for example, the user's email
address). In the **API Reference** tab, each operation documents this header when it is supported.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Pagination (/apioverview/pagination)
Most Asset API endpoints that return lists of objects support pagination, allowing you to retrieve data in smaller chunks. Asset uses **cursor-based pagination**, which ensures no records are skipped between pages and provides better performance than offset-based pagination.
## Paginating Through Records [#paginating-through-records]
When an endpoint supports pagination, the API response includes pagination tokens:
```json
{
"next_page_token": "xK8QZ5JpT0L4FzDc6VaRb1MNhgAAAAABk9cXz3G2hJn7Yx2K1Nv==",
"previous_page_token": "pT0L4FzDc6VaRb1MNhxK8QZ5JgAAAAABk9cXz3G2hJn7Yx2K1Nv==",
"records": []
}
```
* **Use** `next_page_token` to request the next page.
* **Use** `previous_page_token` to request the previous page.
* If either token is `null`, there are no additional pages in that direction.
To retrieve the next page, include the `page_token` parameter in your request:
```bash
curl --request GET \
--url "https://api.asset.com/v0/business?page_token=" \
--header "Authorization: Bearer "
```
To request the previous page:
```bash
curl --request GET \
--url "https://api.asset.com/v0/business?page_token=" \
--header "Authorization: Bearer "
```
## Page Size [#page-size]
By default, the API returns 50 records per page, with a maximum of 100 records per page. You can adjust this by setting the `page_size` parameter:
```bash
curl --request GET \
--url 'https://api.asset.com/v0/business?page_token=&page_size=100' \
--header 'Authorization: Bearer '
```
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Rate Limits (/apioverview/rate_limits)
Asset applies rate limits to API requests to ensure reliable performance across our Platform. Rate limits protect the system from sudden spikes in traffic, ensuring consistent availability and response times for everyone.
### **Request Limits** [#request-limits]
Asset enforces the following API rate limits:
* **Tenant-level requests**: 300 requests per minute
* **Business-level requests**: 300 requests per minute
Limits are applied independently at the [Tenant](/getstarted/CoreConcepts#tenants-your-platform) and [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) levels, preventing heavy usage in one area from affecting others.
### **API Response Headers** [#api-response-headers]
Every API response includes headers to help you monitor your usage and stay within rate limits:
| Header | Description |
| ----- | ----- |
| x-ratelimit-limit | The maximum number of requests permitted per minute. |
| x-ratelimit-remaining | The number of requests remaining in the current time window. |
| x-ratelimit-reset | The time (in UNIX timestamp format) when the rate limit resets. |
Using these headers, your application can manage its request patterns.
### **Exceeding Rate Limits** [#exceeding-rate-limits]
If you exceed these limits, Asset APIs return:
* **HTTP status code**: 429 Too Many Requests
The response body will include a clear message indicating you've reached your limit.
### **Managing Your Requests** [#managing-your-requests]
To ensure optimal performance and avoid exceeding rate limits, we recommend:
* Monitoring the rate-limit headers returned with each response to proactively manage your usage.
* Implementing retry mechanisms with exponential backoff.
* Spacing requests evenly and batching API calls whenever possible.
If you have questions or anticipate higher usage needs, contact Asset support—we're here to help.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Webhooks (/apioverview/webhooks)
Asset uses **webhooks** to send notifications regarding specific requests and updates about
the platform.
## **Configuring Webhooks** [#configuring-webhooks]
- In the **Asset Dashboard**, go to **Developers → Webhooks**.
- Enter your `Endpoint URL` (HTTPS only).
- _(Optional)_ Add custom `Headers` such as an `Authorization` token or an `x-asset-signature` secret.
- Click **Save**.
## **Disabling Webhooks** [#disabling-webhooks]
There might be times in which you want to temporarily disable webhooks. To do this, follow the steps below:
1. In the **Asset Dashboard**, open **Developers → Webhooks**.
2. Toggle `Enabled` off.
3. Click **Save**.
## **Retries** [#retries]
If there is non-200 response or the request times out, Asset will retry the request up to four more times,
each with an exponential backoff. The first delay will be 10 seconds, and subsequent delays will double from there.
## **Catching Up on Missed Webhooks** [#catching-up-on-missed-webhooks]
If your endpoint was down or you missed some deliveries, you can replay past notifications with the
[Load webhook notifications](/api-reference/webhooks/load-webhook-notifications) endpoint:
```
GET /v0/tenant/webhook/notifications
```
- Pass `webhook_id` (the `asset-id` header of the last webhook you received) to get all notifications created after it.
- Filter by delivery status with the `status` query parameter (`pending`, `sent`, `error`), comma-separated for multiple values.
- Results are paginated.
Each item in the response contains the notification `id`, the `datetime` it was sent (or created if it has not
been sent yet), and the original `notification` message, so you can process missed events exactly as if they had
been delivered to your endpoint.
## **Headers** [#headers]
Every webhook request comes with two headers `asset-id` and `asset-signature`. The `asset-id` header uniquely
identifies the webhook request, and `asset-signature` is the signature of the request. You can use the public key
at `https://api.getasset.com/.well-known/jwks.json` to validate the signature. Below is a sample Python code snippet
that shows how to validate the signature.
```python
import base64
import requests
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import padding
from jwcrypto import jwk
def base64url_decode(val):
val += "=" * (-len(val) % 4) # Fix padding
return base64.urlsafe_b64decode(val)
asset_id = ""
asset_signature = ""
asset_signature_kid = ""
raw_body = b""
# Fetch the published keys and pick the one that signed this delivery.
jwks = requests.get("https://api.getasset.com/.well-known/jwks.json").json()
key_data = next(k for k in jwks["keys"] if k["kid"] == asset_signature_kid)
public_key = serialization.load_pem_public_key(
jwk.JWK(**key_data).export_to_pem()
)
# Validate the signature
public_key.verify(
base64url_decode(asset_signature),
asset_id.encode() + b"." + raw_body,
padding.PKCS1v15(),
hashes.SHA256(),
)
```
## **Notifications** [#notifications]
### Plaid connections [#plaid-connections]
For bank integrations, we have the following notifications available:
- **PLAID_ACCOUNT_CONNECTED**: Sent when a new account is connected via Plaid.
- **PLAID_ACCOUNT_DISCONNECTED**: Sent when an existing account is disconnected through the Plaid link flow.
- **PLAID_ACCOUNT_EXPIRED**: Sent when Plaid detects that the account connection is not active. This means the account must be reconnected.
- **PLAID_SYNC_STARTED**: Sent when a transactions sync starts for a Plaid-connected account.
- **PLAID_TRANSACTIONS_SYNCED**: Sent when new transactions have been synced for a Plaid-connected account.
- **ACCOUNT_BALANCE_UPDATED**: Sent when the balance is updated on an account.
All notifications above have the same message structure:
```json
{
"type": "",
"content": {
"business_id": "biz_Pk2fNFDd8wj7EFeLWJywc7",
"timestamp": "",
"account_id": ""
}
}
```
### Bookkeeping requests [#bookkeeping-requests]
As the books are being completed for a business, Asset will send requests that lists the set of tasks that need to be completed by the
business owner.
Message structure:
```json
{
"type": "TASK_REQUEST",
"content": {
"business_id": "biz_Pk2fNFDd8wj7EFeLWJywc7",
"task_types": [
"categorize_transaction",
"reconnect_account",
"request_other_document",
"request_receipt",
"request_statement",
"review_personal_transaction",
"other"
]
}
}
```
In addition, when the business owner has completed the tasks, a notification is also sent.
Message structure:
```json
{
"type": "TASKS_REQUEST_COMPLETED",
"content": {
"business_id": "biz_Pk2fNFDd8wj7EFeLWJywc7",
"timestamp": ""
}
}
```
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch) or email
[support@getasset.com](mailto:support@getasset.com).
### Business notifications [#business-notifications]
We have the following notifications when a Business changes state:
- **BUSINESS_CREATED**: Sent when a business is created.
- **BUSINESS_ACTIVATED**: Sent when an inactive business is activated.
- **BUSINESS_DEACTIVATED**: Sent when an active business is deactivated.
Message structure:
```json
{
"type": "BUSINESS_CREATED",
"content": {
"business_id": "biz_Pk2fNFDd8wj7EFeLWJywc7",
"business_external_id": "",
"timestamp": ""
}
}
```
### Document notifications [#document-notifications]
We have the following notifications for uploaded documents:
- **RECEIPT_MATCHED**: Sent when a receipt document is matched to a transaction.
Message structure:
```json
{
"type": "RECEIPT_MATCHED",
"content": {
"document_id": "doc_2xPQDLmNeWsrahR4bj3oGc9i6Nb",
"transaction_id": "txn_3yQRENoPfXtsbhS5ck4pHd0j7Oc",
"timestamp": ""
}
}
```
- **STATEMENT_IMPORTED**: Sent when an uploaded bank statement finishes importing into an account.
Message structure:
```json
{
"type": "STATEMENT_IMPORTED",
"content": {
"business_id": "biz_Pk2fNFDd8wj7EFeLWJywc7",
"account_id": "",
"document_id": "doc_2xPQDLmNeWsrahR4bj3oGc9i6Nb",
"timestamp": ""
}
}
```
# Access Logs (/bookkeeping/accesslogs)
See the API calls made with your credentials, and find the one you're looking for by its request ID.
### **Overview** [#overview]
Asset keeps an **access log** of the API calls made with your credentials. Use it to answer questions such as:
- Did this call reach Asset, and what status did it get back?
- Which calls failed this week, and why?
- Who called an endpoint, from where?
The access log records the **calls**. To see the changes made to a Business' books, see the [Audit Log](/bookkeeping/auditlog).
Access log data is kept for **30 days**.
### **What a record contains** [#what-a-record-contains]
| Field | What it tells you |
| :---------------------------- | :------------------------------------------------------------------- |
| `request_id` | The ID of the call. It is the `X-Request-Id` header of the response. |
| `timestamp` | When Asset received the call. |
| `client_id` | The API client that made the call. |
| `business_id` | The Business the call acted on, if any. |
| `method` | The HTTP method. |
| `endpoint` | The endpoint that was called, as a route template. |
| `path` | The path that was called, without the query string. |
| `status` | The HTTP status Asset returned. |
| `error` | For a failed call, the error returned. |
| `error_details` | For a validation error, which fields failed and why. |
| `ip_address` and `user_agent` | Where the call came from, and the `User-Agent` header it sent. |
### **Find a call by its request ID** [#find-a-call-by-its-request-id]
Every response carries an `X-Request-Id` header. Keep it in your own logs next to the call, and you can look the call up later, or quote it when you ask us about it.
Call `GET /v0/tenant/access-log/{request_id}` with the ID:
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/tenant/access-log/" \
--header 'Authorization: Bearer '
```
### **List calls** [#list-calls]
Call `GET /v0/tenant/access-log` to list calls, newest first. All the filters are optional, and you can combine them:
| Parameter | Filters by |
| :------------- | :----------------------------------------------- |
| `start`, `end` | A time range. |
| `status` | One status code, such as `404`. |
| `status_class` | A class of status: `2xx`, `3xx`, `4xx` or `5xx`. |
| `failed` | Send `true` to list only the calls that failed. |
| `business_id` | The Business a call acted on. |
| `client_id` | The API client that made the call. |
| `endpoint` | The endpoint that was called. |
| `method` | `GET`, `POST`, `PUT`, `PATCH` or `DELETE`. |
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/tenant/access-log?failed=true&status_class=4xx" \
--header 'Authorization: Bearer '
```
The list is [paginated](/apioverview/pagination): send `page_size`, up to 100, and `page_token` to move between pages.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Accounting Platform (/bookkeeping/accountingbasics)
Asset is a **double-entry accounting platform** that keeps **cash and accrual books at the same time**. This guide explains both ideas, because everything else in Asset, from categorizing a [Transaction](/getstarted/CoreConcepts#transactions) to reading a report, builds on them.
## **Double-entry accounting** [#double-entry-accounting]
In double-entry accounting, every financial event is recorded twice: once where the value came from and once where it went. In Asset, each event is a [Journal Entry](/getstarted/CoreConcepts#journal-entry) made of two or more Lines, and the total of the **debits** must always equal the total of the **credits**. An entry that doesn't balance is rejected.
Each Line points to a [Ledger](/getstarted/CoreConcepts#ledgers). The Ledger's type decides which side makes its balance grow:
| Ledger Type | Balance grows with a | Example |
| :---------- | :------------------- | :-------------------------------- |
| Assets | Debit | Bank account, Accounts Receivable |
| Expenses | Debit | Rent, Software |
| Liabilities | Credit | Loans, Accounts Payable |
| Equity | Credit | Owner's contributions |
| Revenue | Credit | Sales |
Some Ledgers are the exception. Owner's distributions, for example, grow with a debit.
### **How a Transaction becomes a Journal Entry** [#how-a-transaction-becomes-a-journal-entry]
When a bank [Transaction](/getstarted/CoreConcepts#transactions) arrives, Asset records it as a Journal Entry. One Line is on the account the Transaction came from. The other is on the Ledger that explains it, which is the Transaction's category. For example, a customer pays you $500 into your checking account:
| Ledger | Debit ($) | Credit ($) |
| :------- | :-------- | :--------- |
| Checking | 500 | |
| Sales | | 500 |
Until a Transaction is [categorized](/bookkeeping/categorization), its other Line sits on an **Uncategorized Inflow** or **Uncategorized Outflow** Ledger, so the books always balance. Categorizing it moves that Line to the right Ledger.
### **Correcting the books** [#correcting-the-books]
An entry that comes from a Transaction can't be deleted on its own. To fix it, change the Transaction, and Asset rebuilds the entry. To correct anything else, record an adjusting Journal Entry.
## **Cash and accrual** [#cash-and-accrual]
The two methods differ in **when** income and expenses are recorded:
- **Accrual:** when you earn or owe the money. An invoice counts as revenue the day you send it, and a bill counts as an expense the day you receive it, even if nothing has been paid yet.
- **Cash:** when the money actually moves. An invoice counts as revenue when the payment arrives, and a bill when you pay it.
Most accounting software makes you choose one. Asset records both, and you choose a **view** when you read a report.
### **How Asset keeps both** [#how-asset-keeps-both]
Every Journal Entry is tagged with the views it belongs to: **accrual**, **cash**, or **both**.
| Where the entry comes from | Appears in |
| :-------------------------------------------------------------------------------------- | :------------------------------------- |
| Bank and card Transactions, transfers, opening balances, and Journal Entries you create | Both views |
| An invoice you send, or a bill you enter | Accrual only |
| A payment against an invoice or bill | One entry in each view, as shown below |
Reports and balances include the entries tagged for the view you ask for, plus the ones tagged for both. So most of your books are the same in both views. They only differ for invoices, bills and their payments.
### **Example: an invoice and its payment** [#example-an-invoice-and-its-payment]
You send a customer a $1,000 invoice on January 5, and they pay it on February 10.
| Date | View | Ledger | Debit ($) | Credit ($) |
| :----- | :------ | :------------------ | :-------- | :--------- |
| Jan 5 | Accrual | Accounts Receivable | 1,000 | |
| Jan 5 | Accrual | Sales | | 1,000 |
| Feb 10 | Accrual | Checking | 1,000 | |
| Feb 10 | Accrual | Accounts Receivable | | 1,000 |
| Feb 10 | Cash | Checking | 1,000 | |
| Feb 10 | Cash | Sales | | 1,000 |
What each view shows:
- **Accrual:** $1,000 of revenue in January. The customer owes you $1,000 on the Balance Sheet from January 5 until February 10.
- **Cash:** $1,000 of revenue in February. There is no Accounts Receivable, because the invoice didn't count until it was paid.
Bills work the same way in reverse: an Accounts Payable entry in the accrual view, and the expense recorded at payment in the cash view. If a customer pays more than the invoice, the extra amount is kept as a customer credit.
You don't create these entries yourself. When you send an invoice or enter a bill, and when a bank Transaction is matched to it, Asset creates them. See [Invoice Reconciliation](/bookkeeping/invoices).
### **Choosing a view** [#choosing-a-view]
The Asset API calls the two views `accrual` and `modified_cash`. The cash view includes everything from your connected accounts plus payments recorded on the day the money moves. It leaves out invoices and bills until they're paid.
Pass `basis` to a report to choose a view:
```bash
curl --request GET \
--url 'https://api.sandbox.getasset.com/v0/business/b_123456/reports/profit-and-loss?basis=accrual' \
--header 'Authorization: Bearer '
```
| Endpoint | Parameter | Values | Default |
| :----------------------------------------------------------------------------------------------------- | :------------- | :-------------------------------- | :-------------- |
| Profit and Loss, Balance Sheet, Cash Flow, Trial Balance, Ledger Statement and GST/HST Summary reports | `basis` | `accrual`, `modified_cash` | `modified_cash` |
| List Journal Entries | `report_basis` | `accrual`, `modified_cash`, `all` | `modified_cash` |
Use `all` when listing Journal Entries to see every entry regardless of view. Payments then appear twice, once in each view.
The [General Ledger report](/api-reference/reports/retrieve-the-general-ledger-report) has no `basis` parameter, and lists every entry. A payment against an invoice or bill therefore appears twice.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# AP Overview (/bookkeeping/ap)
### **Overview** [#overview]
Accounts Payable (AP) is the money a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) owes its vendors for things it has bought but not yet paid for. In Asset, you record it by creating a **Bill** for a **Vendor**. Asset keeps the books as the Bill is paid, credited or cancelled.
| Object | What it is |
| :------------------------------------------------------- | :--------------------------------------------------------------------------- |
| **Vendor** | Someone the Business buys from. Every Bill belongs to one. |
| **[Bill](/api-reference/schema/bill)** | An amount the Business owes a Vendor, made up of one or more lines. |
| **Payment** | A bank Transaction, or Vendor Credit, applied to a Bill. |
| **[Vendor Credit](/api-reference/schema/vendor-credit)** | Money a Vendor owes back to the Business. It can be applied to future Bills. |
This is the mirror image of [Accounts Receivable](/bookkeeping/ar), where the Business is the one being paid.
Bills in a currency other than the Business' home currency are covered in a
separate guide.
---
### **Vendors** [#vendors]
Create a Vendor before you record a Bill from them, using [Create a new vendor](/api-reference/vendor/create-a-new-vendor).
| Request Parameter | Description |
| :---------------- | :-------------------------------------------- |
| name | Required. The Vendor's name. |
| external_id | Optional. Your own identifier for the Vendor. |
| contact_name | Optional. |
| email | Optional. |
| phone_number | Optional. |
You can retrieve, list, update and delete Vendors with the other Vendor endpoints.
---
### **Create a Bill** [#create-a-bill]
Call [Create Bills](/api-reference/bill/create-bills). The body is a list of up to 100 Bills.
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/bills \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '[
{
"business_id": "biz_GA6EG2qFxA97NZHtxeLPUy",
"number": "BILL-001",
"description": "Office supplies, January",
"issued_at": "2025-01-15T00:00:00Z",
"due_at": "2025-02-15T00:00:00Z",
"vendor_id": "ven_WQMDNUHpBThYSNh4AprDBo",
"lines": [
{
"description": "Paper and toner",
"amount": 240.00,
"ledger_id": "ldg_ErisumsAc7qgmbTctM7zKK"
},
{
"description": "Shipping",
"amount": 18.50
}
]
}
]'
```
| Request Parameter | Description |
| :---------------- | :-------------------------------------------------------------------------------- |
| business_id | Required. The Business the Bill belongs to. |
| number | Required. Must be unique within the Business. |
| description | Required. Shown on the Bill's Journal Entry. |
| issued_at, due_at | Required. `due_at` can't be earlier than `issued_at`. |
| vendor_id | Required. The Vendor the Bill is from. |
| lines | Required. Each line has a `description`, an `amount` and an optional `ledger_id`. |
| external_id | Optional. Your own identifier. Must be unique within the Business. |
| tags | Optional. [Tags](/bookkeeping/tagging) to put on the Bill. |
Send the `X-User-ID` header to record who created the Bill.
**Each Bill is created on its own.** The response has a `data` list with the Bills that were created and an `errors` list with the ones that weren't, for example because the number is already in use. One failure doesn't stop the others.
**What Asset books.** Asset records the expense as soon as the Bill is created, dated `issued_at`:
- **Debit** the Ledger on each line, which is normally an expense Ledger.
- **Credit** Accounts Payable for the total.
A line with no `ledger_id` is booked to Uncategorized Outflow and put in the review queue, and Asset then tries to categorize it in the background. A line with a negative amount, such as a discount, is credited to its Ledger and reduces the payable. Send a `ledger_id` on each line to skip the review. See [Chart of Accounts](/bookkeeping/coa).
You can also have Asset create Bills from uploaded documents. See [Bills from documents](#bills-from-documents).
---
### **Bill statuses** [#bill-statuses]
| Status | Meaning |
| :--------- | :-------------------------------------------------------------------- |
| **open** | Created and not fully paid. This includes Bills that are partly paid. |
| **paid** | Payments or credit have covered the full amount. |
| **voided** | Cancelled. It no longer affects the books. |
Asset sets **paid** for you when the payments add up to the Bill amount. The only status you set yourself is **voided**.
---
### **Pay a Bill** [#pay-a-bill]
Each payment is applied to a Bill, shown in its `payments` list. A Bill can be paid in several parts.
#### Automatic matching [#automatic-matching]
When a payment leaves a bank account, Asset looks for a Bill it settles. A Bill is matched when **all** of these are true:
- It is **open** and was issued on or before the payment date.
- Its total equals the payment amount exactly.
- Its number, or its Vendor's name, appears in the Transaction description.
Asset doesn't match a payment that is only part of a Bill, or one that covers several Bills. Apply those yourself.
#### Apply a payment yourself [#apply-a-payment-yourself]
Use [Apply Transaction to a Bill](/api-reference/bill/apply-transaction-to-a-bill) when Asset didn't match a payment, or matched it to the wrong Bill.
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/bill-payment \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"bill_id": "bil_Lq5AyApd4pdL1VvakpY5aJ",
"transaction_id": "txn_oiL7THC5RDi2PVUbVyyoJ"
}'
```
- **Whole Transaction:** without `payment_amount`, Asset applies as much of the Transaction as is still free, up to what the Bill has left.
- **Part of it:** send `payment_amount` to apply less. This lets you split one payment across several Bills.
- **Too much:** a `payment_amount` above the Bill's unpaid balance returns a 409.
- **Closed Bills:** you can't apply a payment to a paid or voided Bill, or apply the same Transaction to the same Bill twice. Either returns a 409.
Once the payments add up to the Bill amount, its status becomes **paid**.
#### Pay with Vendor Credit [#pay-with-vendor-credit]
To settle a Bill from a Vendor's credit instead of a bank Transaction, leave out `transaction_id` and send the `payment_amount`. Asset draws on the Vendor's available credit, the oldest first. The amount can't be more than the credit available or the Bill's unpaid balance.
#### Undo a payment [#undo-a-payment]
Call [Remove Bill Payment](/api-reference/bill/remove-bill-payment) with the payment's ID. The Bill's paid amount goes down, and a bank Transaction goes back to being unmatched. Credit that was used is returned to the Vendor.
---
### **Vendor Credits** [#vendor-credits]
A Vendor Credit is money a Vendor owes the Business, for example for returned goods or an overcharge. Create one with [Create one or more Vendor Credits](/api-reference/vendor-credit/create-one-or-more-vendor-credits-max-100).
| Request Parameter | Description |
| :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| vendor_id | Required. |
| number | Required. Must be unique within the Business. |
| amount | Required. Must be greater than zero. |
| memo | Optional. A note about the credit. |
| issued_at | Optional. Defaults to now. |
| ledger_id | Optional. The Ledger the credit is booked against, for example the expense account of the purchase being returned. Defaults to Purchase Returns & Allowances. |
| is_cash_backed | Optional. Set it when the credit stands for cash already paid to the Vendor. |
Apply the credit to a Bill as described in [Pay with Vendor Credit](#pay-with-vendor-credit). You can void a Vendor Credit with [Void a Vendor Credit](/api-reference/vendor-credit/void-a-vendor-credit), but only while none of it has been applied to a Bill.
---
### **Edit, void or delete a Bill** [#edit-void-or-delete-a-bill]
**Edit.** [Update a Bill](/api-reference/bill/update-a-bill) can change the `number`, `description`, `issued_at` and `due_at`, add or remove lines with `line_changes`, and change the `tags`. When the lines change, Asset recalculates the total and rebuilds the Journal Entries of the Bill and its payments. A voided Bill can't be edited.
```json
{
"line_changes": {
"create_lines": [{ "description": "Delivery fee", "amount": 25.0 }],
"delete_lines": ["bln_GkBo16N66u2teKfFuFMMwf"]
}
}
```
**Void.** To cancel a Bill entered by mistake, call Update a Bill with `"status": "voided"`. The Bill stays on record, and its Journal Entry is zeroed. A Bill with payments can't be voided, so remove the payments first. A voided Bill can't be reopened.
**Delete.** [Delete a Bill](/api-reference/bill/delete-a-bill) removes it completely, with its lines, Journal Entries and payments. Its payment Transactions go back to being unmatched, and any credit used is returned.
---
### **Bills from documents** [#bills-from-documents]
Your customer can upload a Bill instead of typing it in. Call [Upload Documents for a Business](/api-reference/document/upload-documents-for-a-business) with `document_type` set to `bill`.
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/document \
--header 'Authorization: Bearer ' \
--form 'files=@vendor-invoice.pdf' \
--form 'document_type=bill'
```
If you leave out `document_type`, Asset works out the type from the file. A bill or invoice received from a vendor is recognized as a Bill.
Asset reads the document and does the following:
1. **Finds or creates the Vendor.** It looks for an existing Vendor with the same name, allowing for small differences such as "ACME Corp" and "Acme Corporation". If there is none, it creates one.
2. **Creates the Bill.** It uses the number on the document, the document's date as `issued_at`, and its due date as `due_at`. If the document has no due date, Asset uses 30 days after the issue date. Each line item becomes a Bill line. If the document holds several Bills, each one is created separately.
3. **Picks Ledgers for the lines.** Asset proposes ledger assignments from the business's [Chart of Accounts](/bookkeeping/coa). Lines it cannot confidently place, and tax lines, are initially left without a ledger and pass through the usual categorization workflow.
The result, including what each status means, is in [Bill Documents](/bookkeeping/billdocuments). For the Invoices a Business sends to its customers, see [Invoice Documents](/bookkeeping/invoicedocuments).
---
### **See what's owed** [#see-whats-owed]
- [Aged Payables Report](/api-reference/reports/retrieve-the-aged-payables-report): the open balance owed to each Vendor, grouped by how late it is. Only Bills that are already due are included.
- [List all Bills](/api-reference/bill/list-all-bills): filter by `status`, `numbers`, `due_at_start` and `due_at_end`.
---
### **Scopes** [#scopes]
| Task | Scope |
| :-------------------------------------- | :------------------------------------------------ |
| Create, update and delete Vendors | `vendor:create`, `vendor:update`, `vendor:delete` |
| List or retrieve Vendors | `vendor:read` |
| Create Bills, apply a payment to a Bill | `bill:create` |
| List or retrieve Bills | `bill:read` |
| Update or void a Bill | `bill:update` |
| Delete a Bill, remove a payment | `bill:delete` |
| Create a Vendor Credit | `vendor_credit:create` |
| List or retrieve Vendor Credits | `vendor_credit:read` |
| Void a Vendor Credit | `vendor_credit:update` |
---
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# AR Overview (/bookkeeping/ar)
### **Overview** [#overview]
Accounts Receivable (AR) is the money a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) has earned but not yet collected. In Asset, you record it by creating an **Invoice** for a **Customer**. Asset keeps the books as the Invoice moves through payment, credit, write-off and refund.
| Object | What it is |
| :------------------------------------------- | :-------------------------------------------------------------------------------- |
| **Customer** | Someone the Business sells to. Every Invoice belongs to one. |
| **[Invoice](/api-reference/schema/invoice)** | An amount a Customer owes, made up of one or more lines. |
| **Payment** | A bank Transaction, or Customer Credit, applied to an Invoice. |
| **Customer Credit** | Money the Business owes back to a Customer. It can be applied to future Invoices. |
| **Credit Memo** | A credit issued to a Customer, which adds to their Customer Credit. |
| **Write-off** | A balance the Business gives up on collecting. |
| **Refund** | Money returned to a Customer for an Invoice they paid. |
This guide follows an Invoice from creation to collection. For the step-by-step matching of Transactions to Invoices and Refunds, see [Invoice Reconciliation](/bookkeeping/invoices).
Invoices in a currency other than the Business' home currency are covered in a
separate guide.
---
### **Customers** [#customers]
Create a Customer before you invoice them, using [Create a new customer](/api-reference/customer/create-a-new-customer).
| Request Parameter | Description |
| :---------------- | :-------------------------------------------------------------------------------------------- |
| name | Required. The Customer's name. |
| external_id | Optional. Your own identifier for the Customer. You can use it instead of the Asset ID later. |
| email | Optional. |
| phone_number | Optional. |
| billing_address | Optional. |
| shipping_address | Optional. |
You can list, update and delete Customers with the other Customer endpoints. A Customer that has been disabled is returned with `is_disabled: true`.
---
### **Create an Invoice** [#create-an-invoice]
Call [Create an Invoice](/api-reference/invoice/create-an-invoice). The body is a list of up to 100 Invoices.
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/invoice \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '[
{
"number": "INV-001",
"description": "Roof repair, 14 Elm Street",
"sent_at": "2025-01-15T00:00:00Z",
"due_at": "2025-02-15T00:00:00Z",
"customer_external_id": "customer_8841",
"lines": [
{
"description": "Labor",
"amount": 1200.00,
"ledger_id": "ldg_ErisumsAc7qgmbTctM7zKK"
},
{
"description": "Materials",
"amount": 380.50
}
]
}
]'
```
| Request Parameter | Description |
| :---------------------------------- | :-------------------------------------------------------------------------------- |
| number | Required. Must be unique within the Business. |
| description | Required. Shown on the Invoice's Journal Entry. |
| sent_at, due_at | Required. `due_at` can't be earlier than `sent_at`. |
| customer_id or customer_external_id | Required. Send exactly one. |
| lines | Required. Each line has a `description`, an `amount` and an optional `ledger_id`. |
| external_id | Optional. Your own identifier. Must be unique within the Business. |
| tags | Optional. [Tags](/bookkeeping/tagging) to put on the Invoice. |
| metadata | Optional. Free-form data stored with the Invoice. |
Send the `X-User-ID` header to record who created the Invoice.
**Each Invoice is created on its own.** The response has a `data` list with the Invoices that were created and an `errors` list with the ones that weren't, for example because the number is already in use or the Customer wasn't found. One failure doesn't stop the others.
**What Asset books.** Asset records the earned revenue as soon as the Invoice is created, dated `sent_at`:
- **Credit** the Ledger on each line, which is normally a revenue Ledger.
- **Debit** Accounts Receivable for the total.
A line with no `ledger_id` is booked to Uncategorized Inflow and put in the review queue, and Asset then tries to categorize it in the background. A line with a negative amount, such as a discount, is debited to its Ledger and reduces the receivable. Send a `ledger_id` on each line to skip the review. The Ledger has to belong to the Business. See [Chart of Accounts](/bookkeeping/coa).
---
### **Invoice statuses** [#invoice-statuses]
| Status | Meaning |
| :--------------------- | :-------------------------------------------------------------------------- |
| **open** | Created and not fully settled. This includes Invoices that are partly paid. |
| **paid** | Payments or credit have covered the full amount. |
| **uncollectible** | The balance was [written off](#write-off-an-invoice). |
| **partially_refunded** | Part of what the customer paid was [refunded](#refund-an-invoice). |
| **refunded** | All of it was refunded. |
| **voided** | Cancelled. It no longer affects the books. |
Asset sets every status except **voided** for you, as payments, write-offs and Refunds come in. Don't set `paid`, `refunded` or `partially_refunded` yourself.
---
### **Get Paid** [#get-paid]
Each payment is applied to an Invoice, shown in its `payments` list. An Invoice can be paid in several parts. Once the payments add up to the Invoice amount, its status becomes **paid**.
#### Automatic matching [#automatic-matching]
When money arrives in a bank account, Asset looks for an Invoice it pays. It only considers **open** Invoices with no payment yet that were sent on or before the deposit date.
1. If the Invoice number appears in the Transaction description, the Invoice is matched. If the description names several Invoices, the deposit is applied to them in order of due date.
2. Otherwise, Asset falls back to the amount. If an Invoice has the same amount as the deposit, that one is matched. If several do, the one due soonest is used.
If the deposit is more than the Invoice amount, the extra becomes [Customer Credit](#customer-credit).
These are the rules for payments Asset posts on its own. Choosing a suggested Invoice yourself, or using the endpoint below, is a manual application.
#### Apply a payment yourself [#apply-a-payment-yourself]
Use [Apply a Payment to an Invoice](/api-reference/invoice/apply-a-payment-to-an-invoice) when Asset didn't match a deposit, or matched it to the wrong Invoice.
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/invoice-payment \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"invoice_id": "inv_Lq5AyApd4pdL1VvakpY5aJ",
"transaction_id": "txn_oiL7THC5RDi2PVUbVyyoJ"
}'
```
Send `payment_amount` as well to apply only part of a Transaction, which lets you split one deposit across several Invoices. You can't apply a payment to a paid or voided Invoice, or apply the same Transaction to the same Invoice twice. Either returns a 409.
#### Pay with Customer Credit [#pay-with-customer-credit]
To settle an Invoice from a Customer's credit instead of a bank Transaction, leave out `transaction_id` and send the `payment_amount`. Asset draws on the credit that is available, the oldest first. The amount can't be more than the credit available or the Invoice's unpaid balance.
#### Undo a payment [#undo-a-payment]
Call [Remove Invoice Payment](/api-reference/invoice/remove-invoice-payment) with the payment's ID. The Invoice's paid amount goes down and, if it had become **paid** or **uncollectible**, it is **open** again. A bank Transaction goes back to being unmatched, and any credit that was used is returned. Removing a write-off's payment undoes the write-off.
---
### **Customer Credit** [#customer-credit]
Customer Credit is money the Business owes a Customer. It is held as a liability, and it comes from three places:
- A payment that is more than the Invoice amount.
- A [Credit Memo](#credit-memos).
- A [Refund given as credit](#refund-an-invoice).
Use the [Customer Credit Balance Report](/bookkeeping/reports/customercredit) to see how much each Customer has, and how much of it is still available.
#### Credit Memos [#credit-memos]
A Credit Memo issues credit to a Customer directly, for example for a returned item or a goodwill discount. Use [Create one or more Credit Memos](/api-reference/credit-memo/create-one-or-more-credit-memos-max-100).
| Request Parameter | Description |
| :---------------- | :----------------------------------------------------------------------------------------------------------------------------------------- |
| customer_id | Required. |
| number | Required. Must be unique within the Business. |
| amount | Required. Must be greater than zero. |
| memo | Optional. A note about the credit. |
| issued_at | Optional. Defaults to now. |
| ledger_id | Optional. The Ledger the credit is booked against, for example the revenue account of the original sale. Defaults to Returns & Allowances. |
| is_cash_backed | Optional. Set it when the credit stands for cash the Customer already paid. |
Apply the credit to an Invoice as described in [Pay with Customer Credit](#pay-with-customer-credit). You can void a Credit Memo with [Void a Credit Memo](/api-reference/credit-memo/void-a-credit-memo), but only while none of it has been applied to an Invoice.
---
### **Write off an Invoice** [#write-off-an-invoice]
When a Customer won't pay, write off what they owe with [Write Off an Invoice](/api-reference/invoice/write-off-an-invoice).
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/invoice/inv_Lq5AyApd4pdL1VvakpY5aJ/write-off \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"amount": 380.50,
"description": "Customer unreachable"
}'
```
- The Invoice has to be **open**.
- The `amount` has to be more than zero and no more than the unpaid balance.
- Asset books the amount to **Bad Debt Expense** and applies it to the Invoice as a payment.
- If the write-off covers the whole balance, the status becomes **uncollectible**. If it covers only part, the Invoice stays **open** with a smaller balance.
---
### **Refund an Invoice** [#refund-an-invoice]
A Refund returns money for an Invoice the Customer has paid. Call [Refund an Invoice](/api-reference/invoice/refund-an-invoice).
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/refund \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"amount": 100.00,
"refund_external_id": "refund_1042",
"refunded_at": "2025-03-01T00:00:00Z",
"method": "ach",
"is_return": true,
"memo": "Returned item",
"invoices_to_refund": [
{
"invoice_id": "inv_Lq5AyApd4pdL1VvakpY5aJ",
"invoice_line_id": "inl_GkBo16N66u2teKfFuFMMwf",
"amount": 100.00
}
]
}'
```
| Request Parameter | Description |
| :----------------- | :--------------------------------------------------------------------------------------------------------------------------- |
| amount | Required. The total Refund. It has to equal the sum of the amounts in `invoices_to_refund`. |
| refund_external_id | Required. Your own identifier for the Refund. |
| refunded_at | Required. When the Refund was made. |
| method | Required. `cash`, `check`, `credit_card`, `ach`, `credit_balance` or `other`. |
| invoices_to_refund | Required. One entry per Invoice, with `invoice_id` or `invoice_external_id`, an `amount`, and an optional `invoice_line_id`. |
| is_return | Optional. Set it when the goods came back. |
| memo, processor | Optional. |
| tags | Optional. [Tags](/bookkeeping/tagging) to put on the Refund. |
**Rules**
- The Invoice must have at least one payment. To cancel an Invoice nobody has paid, [void it](#void-or-delete-an-invoice) instead.
- A Refund can't be more than the Invoice has been paid, less what was already refunded.
- To refund part of an Invoice, send the `invoice_line_id`. Without it, the amount has to be the whole Invoice.
- A line can't be refunded for more than its amount, counting earlier Refunds.
- You can't refund an Invoice that is already **refunded** or **voided**.
Asset sets the Invoice to **partially_refunded** or **refunded** for you.
**How the money moves**
- **`credit_balance`:** the Refund becomes [Customer Credit](#customer-credit), and it is completed right away.
- **Any other method:** the Refund is **pending**. Asset books the amount to Returns & Allowances against Accounts Payable, then looks in the bank Transactions for the payout. You can match it yourself with [Apply Transaction to a Refund](/api-reference/invoice/apply-transaction-to-a-refund). When the matched Transactions cover the Refund, it is **completed**.
Use [Remove Refund Payment](/api-reference/invoice/remove-refund-payment) to undo a match, and `DELETE /v0/business/{business_id}/refund/{refund_id}` to remove a Refund.
---
### **Edit, void or delete an Invoice** [#edit-void-or-delete-an-invoice]
**Edit.** [Update an Invoice](/api-reference/invoice/update-an-invoice) can change the `number`, add or remove lines with `line_changes`, and change the `tags`. When the lines change, Asset recalculates the total and rebuilds the Journal Entries of the Invoice and its payments. A voided Invoice can't be edited.
```json
{
"line_changes": {
"create_lines": [{ "description": "Permit fee", "amount": 75.0 }],
"delete_lines": ["inl_GkBo16N66u2teKfFuFMMwf"]
}
}
```
#### Void or delete an Invoice [#void-or-delete-an-invoice]
- **Void** an Invoice sent by mistake: call Update an Invoice with `"status": "voided"`. The Invoice stays on record, and its Journal Entry is zeroed. An Invoice with payments can't be voided, so remove the payments first. A voided Invoice can't be reopened.
- **Delete** an Invoice to remove it completely, with its lines and Journal Entries, using [Delete an Invoice](/api-reference/invoice/delete-an-invoice). Its payment Transactions go back to being unmatched, and any credit used is returned.
---
### **See what's owed** [#see-whats-owed]
- [Aged Receivables Report](/bookkeeping/reports/agedreceivables): the open balance of each Customer, grouped by how late it is. An Invoice that isn't due yet is counted in the first group, 0 to 30 days.
- [Customer Credit Balance Report](/bookkeeping/reports/customercredit): the credit each Customer has.
- [List all Invoices](/api-reference/invoice/list-all-invoices): filter by `status`, `numbers`, `due_at_start` and `due_at_end`.
---
### **Scopes** [#scopes]
| Task | Scope |
| :--------------------------------------------------- | :------------------------------------------------------ |
| Create, update and delete Customers | `customer:create`, `customer:update`, `customer:delete` |
| List Customers | `customer:read` |
| Create an Invoice, apply a payment, create a Refund | `invoice:create` |
| List or retrieve Invoices and Refunds | `invoice:read` |
| Update or void an Invoice, write one off | `invoice:update` |
| Delete an Invoice, remove a payment, delete a Refund | `invoice:delete` |
| Create a Credit Memo | `credit_memo:create` |
| List or retrieve Credit Memos | `credit_memo:read` |
| Void a Credit Memo | `credit_memo:update` |
---
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Audit Log (/bookkeeping/auditlog)
Asset keeps a history of every change made to a Business' general ledger.
### **Overview** [#overview]
Asset keeps an **audit log** of the changes made to a [Business'](/getstarted/CoreConcepts#businesses-your-smb-customers) general ledger. Every time a change is applied, Asset records what changed, when, and who made the change. The books always show where a number came from.
Asset writes the audit log as the change happens, so there is nothing to call or maintain.
The audit log records changes to the books. To see the API calls made with your credentials, see [Access Logs](/bookkeeping/accesslogs).
### **What a record contains** [#what-a-record-contains]
Each change is saved as a **version** of the Journal Entry. A version has:
| Field | What it tells you |
| :---------- | :------------------------------------------------------------------------------------ |
| **Action** | The kind of change: created, updated or deleted. |
| **Summary** | A short description of what changed compared with the previous version. |
| **Time** | When the change was recorded. |
| **User** | Who made the change, when a person made it. |
| **Entry** | The entry as it was after the change: its description, date, review status and basis. |
| **Lines** | All the entry's lines as they were after the change. |
Because every version holds the whole entry, you can read any version on its own, and compare two of them to see exactly what moved.
### **Reviewing the history of an entry** [#reviewing-the-history-of-an-entry]
The audit log is there for the people who need to explain the books: your support team, a bookkeeper, an accountant or an auditor asking why a figure is what it is. It lets them answer:
- Who made the change, and when?
- What was it before?
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Reconciliation (/bookkeeping/autoreconciliation)
### **Overview** [#overview]
Reconciliation is how Asset proves the books agree with the bank. With **automatic reconciliation**, Asset does it for you. It compares what the books say an account holds with the balance the account's source reports, and when the two agree, the month is reconciled with no one doing anything.
When they don't agree, Asset doesn't stop. It works through the problem in order:
1. **Check** the balance again whenever something changes.
2. **Ask** for the statement of any month it needs.
3. **Fix** a mismatch, such as duplicate Transactions, when it can prove the fix.
4. **Hand over** to a bookkeeper when it can't.
### **Which Businesses use it** [#which-businesses-use-it]
A Business has a `reconciliation_method`, set when it is created and never changed afterwards:
| Method | How a month gets reconciled |
| :----------------------- | :----------------------------------------------------------------------------------------------------------------------- |
| **`auto`** (default) | Asset reconciles a month when the reported balance matches the books. |
| **`statement_verified`** | A person has to approve every month against a verified statement. A matching balance never completes a month on its own. |
Automatic reconciliation applies to Businesses on the `auto` method that are not on the [Core plan](/bookkeeping/plans). Core Businesses are never reconciled. It is also enabled per account, so ask Asset if a Business isn't being reconciled.
It reconciles **business accounts that have a Ledger**. Personal accounts are not reconciled.
### **What Asset compares** [#what-asset-compares]
For an account and a date, Asset compares two amounts:
| | |
| :------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Reported balance** | The balance the account's source reported for that date. It comes from a [Plaid](/importingdata/plaid) sync, from a statement's closing balance, or from a balance you set on a manual account. |
| **Ledger balance** | What the books say the account holds through that date, from the Journal Entries of its Transactions. |
[Outstanding checks](/bookkeeping/checks), checks written and recorded that the bank hasn't paid yet, are added to the reported balance first, because the books already count them.
The account is reconciled when **reported balance + outstanding checks − ledger balance is exactly zero**. A difference of one cent is a mismatch.
Asset reconciles one month at a time, in order, each against the balance that covers it. It works from the day after the account was last reconciled, so only the new period can be at fault.
### **What sets it off** [#what-sets-it-off]
Asset re-checks an account whenever something that could change the answer happens:
| Event | Why it matters |
| :--------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------- |
| **A Plaid sync** | New Transactions and a new reported balance arrived. |
| **A statement upload** | A statement brings a closing balance for a month. |
| **A balance update** | You set `external_balance` with [Update External Account](/api-reference/transaction/update-external-account) on a manual account. |
| **A Transaction change** | A Transaction was added, changed or deleted on an account with an open reconciliation. |
| **A change to the Business' start date** | The period the books cover moved. |
An account has **an open reconciliation** when it has a reported balance dated after the date it is reconciled through. Importing Transactions into an account that is already settled starts nothing.
### **When the balances match** [#when-the-balances-match]
Asset marks the period reconciled:
- Every Journal Entry on the account in the period is marked `is_reconciled`. You can filter on it when you [list Journal Entries](/api-reference/journal-entry/list-journal-entries-for-a-business).
- The account's Reconciliation Tasks for that month and any earlier month are completed.
- Any Statement request that was raised because of a mismatch is withdrawn, so the owner stops being asked for a statement that is no longer needed.
Asset then continues with the account's next reported balance, if there is one.
### **When they don't match** [#when-they-dont-match]
Asset works through the months since the account was last reconciled, one at a time.
#### 1. Ask for the statement [#1-ask-for-the-statement]
For each month that has no statement, Asset raises a **Statement** [Task](/bookkeeping/tasks) with the reason `balance_mismatch` in its metadata. If the first unreconciled month has no statement yet, Asset waits for it.
#### 2. Let the agent try [#2-let-the-agent-try]
Only a statement upload starts this attempt. A sync or an edit only re-checks the balance.
When a statement arrives for a month that does not reconcile, Asset can check for duplicate transactions and other discrepancies. Before applying a proposed correction, Asset simulates its effect. It applies the correction only if the difference reaches exactly zero, then verifies the balance again from the books. If Asset cannot reconcile the month automatically, it sends the discrepancy to a bookkeeper for review.
What Asset can change on the books is limited:
- Some Transactions are protected. It never merges or deletes check Transactions, deposits of received checks, or one side of a transfer, and it respects entries that are already reconciled and Transactions with payments or receipts attached.
- Statement Transactions are never deleted outright, only merged.
- If no correction brings the difference to zero, nothing is applied.
#### 3. A user takes over [#3-a-user-takes-over]
When Asset can't reconcile a month automatically, Asset assigns a **Reconciliation** Task for it to a user. The user investigates, usually by comparing the statement with the books and correcting them with an [adjusting Journal Entry](#create-an-adjusting-journal-entry). Closing that Reconciliation Task also counts as reconciling the month. If the balances later come to agree, Asset completes the task itself.
### **Create an adjusting Journal Entry** [#create-an-adjusting-journal-entry]
When the books and the statement differ because of an incorrect Transaction, correct them with an **adjusting Journal Entry** rather than editing history. Say a Business Owner bought a lawn mower on June 25, 2024, and the Transaction was recorded as 6,686 instead of 6,886. The adjusting entry records the missing $200.
Your application can offer this with a form for the corrected amount, the affected [Ledgers](/getstarted/CoreConcepts#ledgers) and a short description. When the user submits it, call [Create a Journal Entry](/api-reference/journal-entry/create-a-journal-entry) with the original Transaction date (06/25/2024), a clear description such as "Adjusting Entry - Correcting Bank Transaction Error", and the Ledger lines with their amounts and debit or credit direction:
| Ledger | Debit ($) | Credit ($) |
| :---- | :---- | :---- |
| Property, Plant, and Equipment (PPE) | 200 | |
| Chase Checking X1234 | | 200 |
The debit increases the asset to the correct purchase amount, and the credit adjusts the cash balance to match what was actually spent.
### **Helping a Business reconcile** [#helping-a-business-reconcile]
- **Keep the balance fresh.** Connect the account with Plaid, upload statements, or set `external_balance` on a manual account. Without a reported balance there is nothing to compare.
- **Answer Statement requests.** A statement is what lets Asset attempt an automatic correction.
- **Categorize and review Transactions.** Wrong or missing Transactions are what cause mismatches.
- **Record checks.** [Outstanding checks](/bookkeeping/checks) are part of the comparison, and a check that isn't recorded makes the books look short.
---
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Bank Transactions (/bookkeeping/banktransactions)
### **Overview** [#overview]
Every [Transaction](/getstarted/CoreConcepts#transactions) in Asset comes from an [External Account](/getstarted/CoreConcepts#external-accounts), such as a bank account or a credit card. There are two kinds:
- **Plaid-connected accounts:** your customer connects their bank once, and Asset keeps the account up to date automatically.
- **Manual accounts:** no connection to the bank. You, or your customer, send the data to Asset.
Both kinds work the same way once a Transaction is in Asset: it becomes a [Journal Entry](/getstarted/CoreConcepts#journal-entry), is [categorized](/bookkeeping/categorization), and is [reconciled](/bookkeeping/autoreconciliation).
| | Plaid-connected | Manual |
| :------------------------ | :--------------------------------------------------------- | :--------------------------------------------------------------------------------- |
| **Who provides the data** | Plaid, from the bank | You, through the API, or your customer, with statements |
| **How fresh it is** | Updated automatically | As fresh as what you send |
| **History on connect** | Up to 24 months, depending on the bank | Whatever you send |
| **Best for** | Banks and cards Plaid supports | Banks Plaid doesn't support, customers who won't connect, or data you already hold |
| **Ongoing work** | Reconnect when the bank asks the customer to sign in again | Send transactions, or upload a statement every month |
## **Plaid-connected accounts** [#plaid-connected-accounts]
Asset uses [Plaid](/importingdata/plaid) to read transactions from your customers' banks. Your customer connects their accounts with the Plaid Link component, and Asset creates an External Account for each one. See [Bank integrations](/importingdata/plaid) for the connection options.
### **What Asset imports** [#what-asset-imports]
- **History:** when an account is first connected, Asset requests up to 24 months of Transactions. How far back it goes depends on the bank. Transactions before the Business's start date are kept but not posted to the books.
- **New transactions:** Asset imports them when Plaid reports an update, and also runs a daily sync for every connected account.
- **Pending transactions:** a pending transaction is ignored until the bank posts it, so it only shows up in Asset once it has posted.
- **Changes at the bank:** if the bank changes a posted transaction's amount or date, or removes it, Asset updates the Transaction and rebuilds its Journal Entry, or deletes it.
- **Balance:** after each sync, Asset compares the balance the bank reports with the account's balance in the books. This applies to business accounts.
### **Notifications** [#notifications]
If you have a [webhook](/apioverview/webhooks), Asset tells you what is happening with each connection:
| Event | When it fires |
| :--------------------------- | :------------------------------------------------------------------------------ |
| `PLAID_ACCOUNT_CONNECTED` | After the first sync of a new account, and when a broken connection is repaired |
| `PLAID_SYNC_STARTED` | When a sync begins |
| `PLAID_TRANSACTIONS_SYNCED` | When a sync finishes |
| `PLAID_ACCOUNT_EXPIRED` | When the bank needs your customer to sign in again |
| `PLAID_ACCOUNT_DISCONNECTED` | When an account is removed from a connection |
### **When a connection needs attention** [#when-a-connection-needs-attention]
Banks sometimes ask a customer to sign in again, for example after they change their password. When that happens, syncing stops, Asset sends `PLAID_ACCOUNT_EXPIRED`, and a reconnect task is created for the Business. Your customer fixes it by going through Plaid Link again. Asset then resumes syncing, sends `PLAID_ACCOUNT_CONNECTED`, and completes the task.
### **Pausing and disconnecting** [#pausing-and-disconnecting]
Change an account's `status` with [Update External Account](/api-reference/transaction/update-external-account):
| Status | Effect |
| :------------- | :----------------------------------------------------------------------------- |
| `connected` | The account syncs normally. |
| `untracked` | The account is paused and stops syncing. Set it back to `connected` to resume. |
| `disconnected` | The account is marked as disconnected and stops syncing. |
Changing the status never removes data. Transactions and Journal Entries already in Asset stay as they are. To remove an account along with its Transactions, Journal Entries and documents, use [Delete External Account](/api-reference/transaction/delete-external-account). This can't be undone.
## **Manual accounts** [#manual-accounts]
Use a manual account when Plaid can't or shouldn't be used: a bank Plaid doesn't support, a customer who doesn't want to connect their bank, or data you already collect yourself.
### **Create the account** [#create-the-account]
Call [Create an External Account](/api-reference/transaction/create-an-external-account) with a `source` of `manual` or `statements`:
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_123456/external-account \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"name": "Chase Checking",
"mask": "1234",
"source": "manual",
"type": "business",
"financial_account_type": "bank_account"
}'
```
| Attribute | Request Parameter | Description |
| :----------- | :--------------------- | :---------------------------------------------------------------------------------------------------------------------------- |
| Name | name | The name shown for the account. |
| Mask | mask | The last four digits of the account number. Asset uses it to match an uploaded statement to the account, so keep it accurate. |
| Source | source | `manual` or `statements`. See below. |
| Type | type | `business` or `personal`. |
| Account Type | financial_account_type | The kind of account, such as `bank_account` or `credit_card`. |
| Currency | currency | The account's currency. Defaults to `USD`. |
A business account also needs `financial_account_type` or an existing `ledger_id`. If you only give the type, Asset creates a Ledger for the account. A personal account needs `financial_account_type` and two Ledgers, `contribution_ledger_id` and `distribution_ledger_id`. See [Personal Accounts](/bookkeeping/personaltransactions).
The two sources differ in who is expected to provide the data:
- **`manual`:** you send the Transactions with the API. Asset doesn't request statements.
- **`statements`:** your customer uploads a statement for each month. Asset creates a request for each month's statement.
### **Send transactions with the API** [#send-transactions-with-the-api]
Use [Create Transactions](/api-reference/transaction/create-transactions) to add up to 100 Transactions per request. See [API Import](/importingdata/apiimport) for the details. A few rules to know:
- Each Transaction needs a `transaction_id`. Sending the same one again is rejected as a duplicate.
- A Transaction dated before the Business's start date is rejected.
- A request can partly succeed. The response lists each Transaction that failed and why.
- If you include `line_items` on a Transaction, Asset uses them as the categorization and skips its own categorization steps.
### **Upload a statement** [#upload-a-statement]
Your customer can also add Transactions by uploading a bank statement with [Upload Documents for a Business](/api-reference/document/upload-documents-for-a-business), with the document type `statement`. This works for any manual account that is connected.
1. **Asset matches the statement to an account** using the account number on the statement and the account's `mask`.
2. **Asset reads the statement:** the opening balance, the closing balance, and every transaction.
3. **Asset adds the new Transactions.** Asset adds any missing trnsactions extracted from the statement.A transaction that is already in the account, with the same date, amount and description, is linked to the statement and not added again.
Asset sends a `STATEMENT_IMPORTED` webhook when a statement has been imported. Upload PDFs or images, up to 12 files per request. The same file can't be uploaded twice.
### **Tell Asset the balance** [#tell-asset-the-balance]
To let Asset check the books against the bank, update the account with the balance the bank shows:
```bash
curl --request PATCH \
--url https://api.sandbox.getasset.com/v0/business/biz_123456/external-account/eac_123456 \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{ "external_balance": 5230.75 }'
```
Asset records the balance with today's date and compares it with the account's balance in the books. A statement's closing balance is also recorded. See [Reconciliation](/bookkeeping/autoreconciliation) for what happens next.
### **Keeping a manual account current** [#keeping-a-manual-account-current]
Asset can't see a manual account, so it only knows what you send. For each one:
1. Send new Transactions, or have your customer upload each month's statement.
2. Keep the `mask` correct, so statements match the account.
3. Update the `external_balance` when you have a new balance, so Asset can reconcile.
## **After a transaction arrives** [#after-a-transaction-arrives]
Whether it came from Plaid, the API or a statement, a Transaction goes through the same steps:
1. Asset creates a Journal Entry from it.
2. Asset [categorizes](/bookkeeping/categorization) it, or leaves it uncategorized for your customer or a bookkeeper to review.
3. The account is [reconciled](/bookkeeping/autoreconciliation) against the balance from the bank, or from a statement.
You can change a Transaction later with [Update Transactions](/api-reference/transaction/update-transactions-for-a-business), and Asset rebuilds its Journal Entry. A Transaction that Plaid later changes or removes at the bank is updated the same way.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Bill Documents (/bookkeeping/billdocuments)
Instead of creating Bills through the API, you can upload the bill or invoice a Business received from a vendor, such as a PDF or an image. Asset reads it and creates the Bill for you.
Call **[Upload Documents for a Business](/api-reference/document/upload-documents-for-a-business)** with `document_type` set to `bill`:
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/document \
--header 'Authorization: Bearer ' \
--form 'files=@vendor-invoice.pdf' \
--form 'document_type=bill'
```
`document_type` is optional for bills. If you leave it out, Asset works out
the type from the file, and a bill or invoice received from a vendor is
recognized as a Bill. Send it anyway when you know what the file is. For the
Invoices a Business sends to its customers, see [Invoice
Documents](/bookkeeping/invoicedocuments), where it is required.
### What Asset does with it [#what-asset-does-with-it]
1. **Reads the document.** Asset extracts the vendor, the bill number, the dates, the line items and the total.
2. **Finds or creates the Vendor.** Asset looks for an existing Vendor with the same name, allowing for small differences such as "ACME Corp" and "Acme Corporation". If there is none, it creates one.
3. **Creates the Bill.** It uses the number on the document, the document's date as `issued_at`, and its due date as `due_at`. If the document has no due date, Asset uses 30 days after the issue date. Each line item becomes a Bill line. If a document holds several Bills, each one is created separately.
4. **Picks Ledgers for the lines.** Asset proposes ledger assignments from the business's [Chart of Accounts](/bookkeeping/coa). Lines it cannot confidently place, and tax lines, are initially left without a ledger and pass through the usual categorization workflow.
5. **Books it like any other Bill.** Asset creates the usual Journal Entry, which debits the line Ledgers and credits Accounts Payable. It links the document to the Bill, and then categorizes the lines that still have no Ledger.
From there the Bill works like one created through the API. See [Accounts Payable](/bookkeeping/ap) for [paying it](/bookkeeping/ap#pay-a-bill), editing it and voiding it.
### Result [#result]
Follow the outcome on the Document's `status`:
| Status | Meaning |
| :------------- | :--------------------------------------------------------------------------------------- |
| **processing** | Asset is reading the document. |
| **processed** | Asset finished reading the document. Check `bill_id` to see whether a Bill was created. |
| **failed** | Asset couldn't read the document. The `status_reason` says why. |
When a Bill was created, the Document's `bill_id` holds its ID. A `processed` Document with no `bill_id` means Asset read the file but didn't create a Bill, for example because the number is already used by another Bill. Create that Bill yourself with [Create Bills](/api-reference/bill/create-bills).
A `DOCUMENT_PROCESSED` webhook is sent when processing finishes, whatever the outcome.
- **Duplicates:** a file that matches one already uploaded for the Business is rejected, and the error names the existing document.
- **Unsupported files:** a file type that isn't supported, or a file that is too large, is rejected at upload.
- **Check the result:** review the Vendor, Ledgers and amounts on the new Bill, and correct them with [Update a Bill](/api-reference/bill/update-a-bill).
---
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Onboarding (/bookkeeping/businesses)
## **Onboarding** [#onboarding]
Before you can manage a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) in Asset, it must first be onboarded to ensure accurate bookkeeping. This process ensures essential information is stored in Asset —such as the business structure, financial tracking start date, and status—allowing Asset to configure the appropriate [Chart of Accounts](/getstarted/CoreConcepts#ledgers) and begin [Transaction](/getstarted/CoreConcepts#transactions) tracking. Proper onboarding ensures that financial data is categorized correctly, enabling seamless reporting and reconciliation.
To onboard a Business into Asset, call the **[Create a Business](/api-reference/business/create-a-business)** endpoint and include the required business details in your request. The following attributes must be provided
| Attribute | Request Parameter | Description |
| :---------- | :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Name | name | The Business’ name |
| Start Date | entries_start | The first date from which Asset should begin pulling Transactions. |
| Entity Type | entity_type | The Business structure, which determines the default Chart of Accounts. Supported types: Sole Proprietorships LLCs Partnerships S-Corporations C-Corporations |
| Fiscal Year | fiscal_year | The specific date the Business' fiscal year ends on |
| Status | status | Indicates whether the Business is active or inactive. Transactions cannot be pulled for inactive businesses |
Once a Business is created, Asset will automatically assign the appropriate default **Chart of Accounts based on the provided Entity Type** and begin tracking Transactions from the specified Start Date.
## **Ongoing Management** [#ongoing-management]
As a [Tenant](/getstarted/CoreConcepts#tenants-your-platform), you need visibility and control over all Businesses created in your platform. This includes updating Business details, retrieving Business information, and managing status (e.g., marking a Business as inactive due to delinquent payments).
Asset provides three API endpoints for Business management:
1. [Retrieve a Business](/api-reference/business/retrieve-a-business)
- This endpoint provides you with access to all the details of one specific Business
2. [Update a Business](/api-reference/business/update-a-business)
- Modify one or more attributes of a Business
- **Note:** The **Entity Type of a Business cannot be changed** after creation. If an entity type update is required, you must create a new Business.
3. [List all Businesses](/api-reference/business/list-all-businesses)
- Retrieve a list of all Businesses under your Tenant.
- The response always includes the Business ID and can be customized to include additional attributes such as Status and Entity Type based on request parameters.
## **Self-Onboarding** [#self-onboarding]
If you use Asset's UI components, you don't have to build your own onboarding form. The `AssetOnboarding` component is a wizard your customers use to create their own Business: they choose a bookkeeping plan, enter their company details and start date, and connect their bank accounts. It creates the Business through the same API as above, so the same details apply.
It works for both bookkeeping plans: **Done for you** and **Do it yourself**. By default your customer chooses between them in the first step. If you only offer one plan, pass it in `plans` and the step is skipped.
### **Render the wizard** [#render-the-wizard]
The wizard creates the Business, so it runs without a Business ID. Mint a token that can create a Business and connect accounts, and leave `businessId` off the `AssetProvider`. See [the component docs](/components/overview/getting-started) for the provider and the token endpoint.
```tsx
"use client";
import { AssetProvider } from "@get-asset/sdk";
import { AssetOnboarding } from "@get-asset/react";
import "@get-asset/react/theme.css";
import "@get-asset/react/styles.css";
const ONBOARDING_SCOPE =
"business:create plaid:create plaid:read ledger:read transaction:create";
async function fetchOnboardingToken() {
// No business_id: the Business doesn't exist yet
const res = await fetch("/api/asset-token", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ scope: ONBOARDING_SCOPE }),
});
return (await res.json()).access_token;
}
export function OnboardingWizard({ customerId }: { customerId: string }) {
return (
{
if (!business?.id) return;
await saveBusinessId(business.id); // your server stores it
// then go to your Asset screens
}}
onError={(error) => console.error(error)}
/>
);
}
```
Once the wizard creates the Business, the provider asks for a new token that is limited to it. The scopes above are also exported as `onboardingScopes` from `@get-asset/sdk/scopes`.
### **Component props** [#component-props]
| Prop | Description |
| :-------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `externalId` | **Required.** Your own identifier for this customer, usually your customer or organization ID. Asset stores it on the Business, so you can match the two without relying only on Asset's ID. It is written when the Business is created and is awkward to change later. |
| `plans` | The bookkeeping plans to offer: `"diy"` (Do it yourself), `"managed"` (Done for you), or both. Defaults to both. A single plan skips the plan step. |
| `defaultValues` | Pre-fill fields you already know, such as `businessName` and `entityType`. Your customer can still edit them. |
| `onComplete` | Called with the new Business and a reason: `"finished"` or `"skipped"`. |
| `onError` | Called when something fails. |
### **Handle completion** [#handle-completion]
`onComplete` is the most important part of the integration. A Business is created whether your customer finishes the wizard or skips the bank connection step, so handle **both** reasons the same way:
1. **Save the Business ID on your server.** Wait for the save to finish before you continue. If it fails, keep the wizard open and show an error. A Business that exists in Asset but is unknown to your app can't be reached by your customer.
2. **Update your app.** Refresh whatever tells your app the customer is onboarded, so your menu and screens change right away.
3. **Take the customer to their accounting screens.**
If the reason is `"skipped"`, the Business exists but has no bank accounts yet, so it will have no data. Show a prompt to connect an account when they arrive.
### **Keep the Business ID on your server** [#keep-the-business-id-on-your-server]
The Business ID belongs to your customer's record in your database. Read it from your session on the server when you mint tokens. Never keep it in `localStorage` or a query string, and never accept it from the browser. Your token endpoint is what stops one customer from reaching another customer's Business. See [Token exchange](/components/overview/getting-started#token-exchange) in the component docs.
To avoid creating a second Business for the same customer, refuse on your server to mint an onboarding token for a customer who already has a Business ID, and ignore a second attempt to save one.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Transaction categorization (/bookkeeping/categorization)
### **Overview** [#overview]
Categorization assigns [Transactions](/getstarted/CoreConcepts#transactions) to the correct [Ledger(s)](/getstarted/CoreConcepts#ledgers) in the Chart of Accounts, ensuring accurate financial reporting and compliance.
Accurate categorization is not just good bookkeeping—it’s a legal and financial necessity. Misclassified expenses can lead to tax complications, compliance issues, and financial misreporting. Yet, manual categorization is consistently reported as one of the most tedious responsibilities for [Business owners](/getstarted/CoreConcepts#businesses-your-smb-customers).
At Asset, we’ve built a **best-in-class categorization system** that reduces the time and effort required to categorize Transactions, ensuring accuracy while allowing Business Owners to focus on running their companies.
### **How Categorization Works in Asset** [#how-categorization-works-in-asset]
Categorization happens directly on the **Transaction**. Each Transaction carries a review status and a set of **line items** that record how the Transaction is categorized, and each line item assigns an amount to a Ledger (its category). A Transaction with a single line item is categorized to one Ledger; a Transaction with several line items is split across multiple categories, with the line item amounts always summing to the Transaction amount.
Asset uses rules, invoice and bill matching, transfer detection, and prior categorizations to suggest ledger assignments. AI-assisted review helps assess those assignments. Users can review the result, split a transaction across ledgers, or assign a category when Asset cannot determine one.
The lifecycle of a Transaction looks like this:
1. **Transaction Enters Asset**
- When a new Transaction enters Asset, it starts out uncategorized: it has no line items and its `posted` flag is `false`.
2. **Categorization**
- Asset suggests line items for the Transaction. If it cannot determine a category, the Transaction stays uncategorized until the customer provides one.
3. **Business Review and Finalization**
- Once line items are assigned, the Transaction is categorized, its `posted` to the GL, and it is ready for Business review.
- Asset recommends that [Tenants](/getstarted/CoreConcepts#tenants-your-platform) include a workflow step requiring Businesses to review and confirm assigned categories, ensuring accuracy.
- Any Uncategorized Transactions should be manually assigned to complete the books for the period.
### **Categorization Attributes in Asset** [#categorization-attributes-in-asset]
To support customizable workflows, Asset exposes the following categorization attributes on each Transaction:
| Attribute | Description |
| :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Posted** | Whether the Transaction is posted to the books: `false` while it is uncategorized, and `true` once it has been categorized. |
| **Status** | The categorization review status of the Transaction, derived from its journal entry: `bookkeeper_pending`, `business_pending`, or `confirmed`. A Transaction is finalized once its status is `confirmed`. Null when the Transaction has no status. |
| **Line Items** | The categorized allocations of the Transaction. Each line item carries the `ledger_id` (and `category` name) it is categorized to and the `amount` allocated to it, signed in the same direction as the Transaction amount. Null when the Transaction has no categorization. |
These attributes allow Tenants to build workflows that ensure Transactions are properly categorized while maintaining flexibility based on Business needs.
### **How to Categorize a Transaction in Asset** [#how-to-categorize-a-transaction-in-asset]
To categorize or re-categorize a Transaction, call the [Update Transactions for a Business](/api-reference/transaction/update-transactions-for-a-business) endpoint. The endpoint accepts an array, so one or more Transactions can be updated in a single request.
```bash
PATCH /v0/business/{business_id}/transactions
```
**Path Parameters:**
- **Business ID** – Specifies the Business where the Transactions are being updated.
**Request Body** – an array of update items, each with:
- **Transaction ID** (required) – Identifies the specific Transaction to update.
- **Type** (optional) – The updated type of the Transaction (`business` or `personal`).
- **Tags** (optional) – Inline tag input to merge into the Transaction's tags.
- **Line Items** (optional) – Replaces the Transaction's line items with a new set of categorized allocations. Each line item has:
- **Ledger ID** – The Ledger (category) to allocate the amount to.
- **Description** – The description of the line item.
- **Amount** – The amount allocated to the line item, signed in the same direction as the Transaction amount. Provide a single line item to change the category, or several to split the Transaction across categories; the amounts must sum to the Transaction amount.
**Re-categorize to a single category** (a $89.23 outflow assigned entirely to Office Supplies):
```json
[
{
"transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo",
"line_items": [
{
"ledger_id": "ldg_Ns6rRRLYVZPh4cVB7MDby5",
"description": "Office Supplies",
"amount": -89.23
}
]
}
]
```
**Split across multiple categories** (a $100 outflow split evenly between Office Supplies and Travel):
```json
[
{
"transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo",
"line_items": [
{
"ledger_id": "ldg_Ns6rRRLYVZPh4cVB7MDby5",
"description": "Office Supplies",
"amount": -50.0
},
{
"ledger_id": "ldg_WQMDNUHpBThYSNh4AprDBo",
"description": "Travel",
"amount": -50.0
}
]
}
]
```
Categorizing a Transaction—assigning its line items—is what confirms it: its `status` moves to `confirmed` and it is finalized on the books.
Once updated, the new categorization will reflect in the application. A typical Tenant workflow is to [List Transactions for a Business](/api-reference/transaction/list-transactions-for-a-business) (optionally filtering to unconfirmed Transactions), review each Transaction's line items, and call the update endpoint to set the correct Ledger on the line items, confirming the Transaction.
### **Categorizing High-Impact Transactions First** [#categorizing-high-impact-transactions-first]
Not all Transactions carry the same weight. To help Businesses clear the most outstanding value with the least effort, Asset groups similar unconfirmed Transactions and ranks those groups by **impact**—the share of outstanding dollar value each group represents. Categorizing a high-impact group at once clears more of the books in a single step.
**How it works.** Asset looks at the Business' unconfirmed Transactions, up to the 2,000 most recent, and groups the ones whose descriptions are alike, so `HOME DEPOT #0428 PHOENIX AZ` and `HOME DEPOT #1206 TEMPE AZ` land together. Income and expenses are never grouped together, even with the same description, and a group can include Transactions from several accounts. Groups are returned with the highest total dollar value first. Because the share each group represents changes whenever one is categorized, fetch the groups again after you make changes.
To fetch these groups, call the [List high-impact Transaction groups to categorize](/api-reference/categorization/list-high-impact-transaction-groups-to-categorize) endpoint:
```bash
GET /v0/business/{business_id}/categorization
```
**Query Parameters:**
- **limit** (optional) – Maximum number of Transaction groups to return (1–50, default 10).
- **account_ids** (optional) – Restrict to these External Account IDs, comma-separated.
Each group in the response contains:
| Field | Description |
| :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **transaction_ids** | The IDs of the unconfirmed Transactions in this group. Applying a category to all of them clears the whole group. |
| **transaction_count** | The number of Transactions in the group. |
| **total_amount** | The total dollar value of the Transactions in the group, summed as absolute amounts. |
| **impact** | The share of outstanding dollar value this group represents (`total_amount` divided by the total dollar value of all unconfirmed Transactions). Higher means categorizing this group clears more outstanding value. |
Example response:
```json
{
"data": [
{
"transaction_ids": [
"txn_WQMDNUHpBThYSNh4AprDBo",
"txn_2xPbN4qFxA97NZHtxeLPUy"
],
"transaction_count": 12,
"total_amount": 1480.32,
"impact": 0.18
}
]
}
```
A recommended bulk-categorization workflow:
1. **Fetch the high-impact groups** from `GET /v0/business/{business_id}/categorization`.
2. **Fetch the Transactions** in a group (using the returned `transaction_ids`) so the Business can confirm they belong together.
3. **Update them all at once** by passing every Transaction in the group to `PATCH /v0/business/{business_id}/transactions` with the chosen line items, categorizing the entire group in a single request.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Checks (/bookkeeping/checks)
### **Overview** [#overview]
Asset handles both kinds of checks a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) deals with:
- **Outgoing checks** are checks the Business writes to pay someone, such as a vendor.
- **Incoming checks** are checks the Business receives from someone else, such as a customer.
A check is never in the bank at the moment it is written or received. Asset therefore records it when it happens, and then matches it to the bank [Transaction](/getstarted/CoreConcepts#transactions) when the bank catches up. This keeps the books right even while checks are in the mail, and avoids counting the same money twice.
| | Outgoing checks | Incoming checks |
| :----------------------- | :---------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------- |
| **Record it with** | [Create Checks](/api-reference/check/create-checks) | [Create Received Checks](/api-reference/received-check/create-received-checks) |
| **Where it is recorded** | On the bank account the check is drawn on | On the **Undeposited Funds** account, until it is deposited |
| **Recorded on** | The date the check was written | The date the check was received |
| **Matched to** | The bank withdrawal that pays the check | The bank deposit that includes the check |
| **Statuses** | `issued`, `cleared`, `voided` | `received`, `deposited`, `returned`, `voided` |
| **Report** | [Outstanding Checks](/api-reference/reports/retrieve-the-outstanding-checks-report) | [Undeposited Checks](/api-reference/reports/retrieve-the-undeposited-checks-report) |
A Transaction that belongs to a check can't be deleted. To remove it, void the
check instead, as described below.
## **Upload a check image** [#upload-a-check-image]
Instead of entering a check yourself, you can upload a picture of it. Asset reads the image and records the check for you, as outgoing or incoming.
Call [Upload Documents for a Business](/api-reference/document/upload-documents-for-a-business) with `document_type` set to `check`.
| Request Parameter | Description |
| :---------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| document_type | Set to `check`. |
| entity_ids | Optional. The bank account the check is drawn on, for an outgoing check. If you leave it out, Asset finds the account from the account number on the check. |
| check_received_at | Optional. For an incoming check, the date it was received. Defaults to the date written on the check. |
### **What Asset reads** [#what-asset-reads]
Asset reads the payee, the payer, the amount in figures and in words, the date, the check number, the memo, and the bank numbers printed along the bottom of the check (the MICR line). It also notices whether the check is marked VOID.
- **Amount:** if the figures and the words disagree, Asset uses the amount in words.
- **Check number:** Asset uses the printed number, unless it differs from the number on the MICR line, which the bank reads. In that case it uses the MICR number.
### **Outgoing or incoming** [#outgoing-or-incoming]
- If the check is made out to the Business, Asset records an **incoming check**. It is dated with `check_received_at` or the date on the check, held in Undeposited Funds, and linked to a Customer when the payer's name exactly matches one.
- Otherwise, Asset records an **outgoing check**. It is drawn on the bank account you named, or else the account whose last digits match the account number on the check, and linked to a Vendor when the payee's name exactly matches one.
Asset never creates a Customer or a Vendor from an image. A new check is then categorized like any other Transaction, and everything else in this guide applies to it.
### **Duplicates and failures** [#duplicates-and-failures]
- **The same check again:** if the check is already recorded with the same number and amount, Asset attaches the image to it and creates nothing new.
- **A different amount:** if a check with the same number but a different amount exists, the document is marked `failed_check_conflict`.
- **A check marked VOID:** the image is processed, and no check is recorded.
- **Can't tell which account:** if the account number matches none of the Business's bank accounts, or differs from the account you named, the document is marked `failed_account_matching`.
- **Can't be read:** if Asset can't read the amount, the date, the payee (or, for an incoming check, the payer), or the date is in the future, the document is marked `parsing_failed`, with the reason.
You can follow the result on the Document's `status`, and a `DOCUMENT_PROCESSED` webhook is sent when processing finishes.
## **Outgoing checks** [#outgoing-checks]
### **Record a check** [#record-a-check]
Call [Create Checks](/api-reference/check/create-checks) when a check is written. You can send up to 100 checks in one request, and each check is handled on its own, so one that fails doesn't stop the others. The response lists any that failed and why.
| Attribute | Request Parameter | Description |
| :----------- | :------------------ | :-------------------------------------------------------------------------------------------------- |
| Bank Account | external_account_id | The business bank account the check is drawn on. A credit card or a personal account can't be used. |
| Payee | payee | The person or company the check is made out to. |
| Amount | amount | The amount of the check. It must be greater than zero. |
| Issue Date | issued_at | The date the check was written. It can't be before the Business' start date. |
| Check Number | check_number | Optional. It must be unique on the bank account among checks that aren't voided. |
| Vendor | vendor_id | Optional. Links the check to a Vendor. |
| Memo | memo | Optional. |
You don't send a category with a check. Asset creates a Transaction for it and [categorizes](/bookkeeping/categorization) it like any other, for example with a rule for the payee. If nothing matches, it is left for review.
### **What Asset records** [#what-asset-records]
Asset records the check on the day it was written. For example, a $500 check to ABC Plumbing, with a rule that categorizes the payee as Repairs and Maintenance:
| Ledger | Debit ($) | Credit ($) |
| :---------------------- | :-------- | :--------- |
| Repairs and Maintenance | 500 | |
| Checking | | 500 |
The bank balance doesn't change until the payee cashes the check. Until then the check is **outstanding**: it reduces the Business's books, but not yet the bank's balance.
### **Outstanding checks** [#outstanding-checks]
A check is `issued` until the bank pays it. The [Outstanding Checks](/api-reference/reports/retrieve-the-outstanding-checks-report) report lists the checks that were written by a date but not yet paid, with the number of days each has been outstanding. Pass `as_of` to see the list as it was on a past date, and `external_account_id` to see one account.
Outstanding checks also matter for [reconciliation](/bookkeeping/autoreconciliation). The bank's balance and the books differ by the outstanding checks, so Asset allows for them when it compares the two.
### **When the bank pays the check** [#when-the-bank-pays-the-check]
When the bank reports the withdrawal, Asset matches it to the check automatically if all of these are true:
- It is money going out of the same bank account.
- The amount is exactly the amount of the check.
- It is no more than 90 days after the check was written.
- If the bank gives a check number, Asset looks for the check with that number, and if there is none, for a check without a number.
- It matches exactly one check. If two checks could match, Asset leaves it for a person to decide.
When it matches, the bank's Transaction is merged into the check, so the money isn't counted twice. The check's status becomes `cleared`, and its entry **stays on the date the check was written**.
If a check isn't matched automatically, match it yourself with [Match a Check to a Bank Transaction](/api-reference/check/match-a-check-to-a-bank-transaction). The Transaction must be on the same bank account, and its amount must equal the check's. To undo a match, call [Unmatch a Check from its Bank Transaction](/api-reference/check/unmatch-a-check-from-its-bank-transaction). The bank's Transaction comes back and is categorized again.
### **Void or delete a check** [#void-or-delete-a-check]
| | Void | Delete |
| :----------------- | :-------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- |
| **Use it when** | A check was written but won't be used, for example a lost or cancelled check. | A check was recorded by mistake. |
| **What it does** | Adds an entry that reverses the check, dated the day it was voided. The original entry stays. | Removes the check and all of its entries, as if it had never been recorded. |
| **Endpoint** | [Void a Check](/api-reference/check/void-a-check) | [Delete a Check](/api-reference/check/delete-a-check) |
| **Cleared checks** | Not allowed. Unmatch the check first. | Not allowed. Unmatch the check first. |
A voided check's number can be used again. For a voided $500 check, voided on October 10:
| Ledger | Debit ($) | Credit ($) |
| :---------------------- | :-------- | :--------- |
| Checking | 500 | |
| Repairs and Maintenance | | 500 |
### **Paying a bill with a check** [#paying-a-bill-with-a-check]
To pay a [Bill](/api-reference/bill/apply-transaction-to-a-bill) with a check, record the check first, then apply the check's Transaction to the Bill. Use the check's `transaction_id` in the request. The payment entries use the date the check was written, even after the bank clears it.
## **Incoming checks** [#incoming-checks]
### **Record a check** [#record-a-check-1]
Call [Create Received Checks](/api-reference/received-check/create-received-checks) when a check arrives. Like outgoing checks, you can send up to 100 at a time.
| Attribute | Request Parameter | Description |
| :-------------------------- | :----------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |
| Payer | payer | The person or company that wrote the check. |
| Amount | amount | The amount of the check. It must be greater than zero. |
| Received Date | received_at | The date the check was received. It can't be before the Business' start date. |
| Customer | customer_id | Optional. Links the check to a Customer. |
| Check Number | check_number | Optional. |
| Routing and Account Numbers | payer_routing_number, payer_account_number | Optional. When the routing number, account number and check number are all given, Asset rejects the same physical check if it is recorded twice. |
| Memo | memo | Optional. |
### **Undeposited Funds** [#undeposited-funds]
A check you've received but not yet deposited isn't in the bank. Asset holds it on a special **Undeposited Funds** account, named "Received Checks", which it creates for the Business the first time it is needed. You can't create your own account on it, and it can't be used for outgoing checks.
Like an outgoing check, the Transaction is categorized. For a $250 check from a customer, categorized as Consulting Income:
| Ledger | Debit ($) | Credit ($) |
| :---------------- | :-------- | :--------- |
| Undeposited Funds | 250 | |
| Consulting Income | | 250 |
### **Paying an invoice with a check** [#paying-an-invoice-with-a-check]
To apply a check to an [Invoice](/bookkeeping/invoices), use [Apply a Payment to an Invoice](/api-reference/invoice/apply-a-payment-to-an-invoice) with the check's `transaction_id`. The payment entries use Undeposited Funds in place of the bank, for both the accrual and cash views. See [How Asset Accounting Works](/bookkeeping/accountingbasics). If the check is for more than the invoice, the extra amount becomes a customer credit.
### **When the check is deposited** [#when-the-check-is-deposited]
When the bank reports the deposit, Asset matches it to the check automatically if all of these are true:
- It is money coming in, with exactly the amount of the check.
- The check was received on or before the day of the deposit, and no more than 90 days before.
- It matches exactly one check. If two undeposited checks have the same amount, Asset leaves it for a person to decide.
The check's status becomes `deposited`. Asset records the deposit on the day of the bank Transaction, moving the money from Undeposited Funds to the bank. Nothing is recorded as revenue at this point, because that happened when the check was received.
| Ledger | Debit ($) | Credit ($) |
| :---------------- | :-------- | :--------- |
| Checking | 250 | |
| Undeposited Funds | | 250 |
**Several checks in one deposit.** Call [Match a Bank Deposit to Received Checks](/api-reference/received-check/match-a-bank-deposit-to-received-checks) with the bank Transaction and the list of checks. The checks must add up to exactly the amount of the deposit, and all be received on or before the deposit date. A deposit that mixes checks with cash, or covers only some of the checks, can't be matched this way.
To undo a deposit, call [Unmatch a Bank Deposit from its Received Checks](/api-reference/received-check/unmatch-a-bank-deposit-from-its-received-checks). The checks go back to `received`. This isn't possible after one of the checks was returned.
### **Void or return a check** [#void-or-return-a-check]
| | Void | Return |
| :-------------------- | :----------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------- |
| **Use it when** | A check was received but won't be deposited, or was recorded by mistake. | A deposited check bounced, and the bank took the money back. |
| **Endpoint** | [Void a Received Check](/api-reference/received-check/void-a-received-check) | [Return a Received Check](/api-reference/received-check/return-a-received-check) |
| **What you send** | Optionally, the date it was voided. | The bank's debit Transaction for the amount of the check. |
| **What it does** | Reverses the check's entries, dated the day it was voided. | Reverses the check's entries, dated the day of the bank's debit, using the bank account in place of Undeposited Funds. |
| **Invoices** | Invoices it paid become unpaid again. | Invoices it paid become unpaid again. |
| **Not allowed after** | The check is deposited or returned. For a deposited check, undo the deposit first or return the check. | The check was never deposited, or was already returned. |
A returned check can't be returned again, voided, applied to an invoice, or have its deposit undone. If the bank charged a fee for the bounced check, it arrives as its own Transaction and is categorized as usual.
### **Undeposited checks** [#undeposited-checks]
The [Undeposited Checks](/api-reference/reports/retrieve-the-undeposited-checks-report) report lists the checks received by a date that haven't been deposited, voided or returned, with how many days each has been held. It also shows the balance of Undeposited Funds and the `difference` between that balance and the total of the listed checks. A `difference` of zero means the books agree with the list.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Chart of Accounts (/bookkeeping/coa)
### **Overview** [#overview]
Every [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) has a **Chart of Accounts**: the complete list of its [Ledgers](/getstarted/CoreConcepts#ledgers). A Ledger is an account that holds a running balance, such as a bank account, a loan, or an expense like Rent. When you [categorize a Transaction](/bookkeeping/categorization), you choose the Ledger it belongs to, and the reports are built from the Ledgers.
When you create a Business, Asset builds its Chart of Accounts in one of two ways:
- **The default chart.** Asset picks a ready-made chart for the Business' entity type and country. This is what happens unless you say otherwise.
- **Your own chart.** You send a list of Ledgers in the `ledgers` field of [Create a Business](/api-reference/business/create-a-business), and those Ledgers become the chart instead.
Either way, you can add, rename, nest, and remove Ledgers afterwards.
---
### **Ledger types** [#ledger-types]
Each Ledger has a `type` and a `subtype`. The subtype has to belong to the type, and it sets the Ledger's normal balance (`debit_credit`) when you don't send one.
| Type | Subtypes | Normal balance |
| :---------- | :------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------ |
| `asset` | `current_asset`, `fixed_asset`, `other_asset`, `uncategorized_asset` | Debit |
| `liability` | `current_liability`, `long_term_liability` | Credit |
| `equity` | `contribution`, `distribution`, `common_stock`, `preferred_stock`, `additional_capital`, `retained_earnings`, `opening_balance` | Credit, except `distribution` (debit) |
| `revenue` | `operating_revenue`, `other_inflow` | Credit |
| `expense` | `cost_of_goods_sold`, `operating_expense`, `other_outflow` | Debit |
The other fields of a [Ledger](/api-reference/schema/ledger):
| Field | Description |
| :----------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | The name of the Ledger. It can be up to 255 characters. |
| `description` | Optional, up to 100 characters. |
| `sort_code` | Orders the Ledger in the chart and in reports. Codes that are numbers sort as numbers, so `999` comes before `1010`. |
| `financial_account_type` | For a Ledger that stands for a real-world account: `bank_account`, `credit_card`, `prepaid_card`, `payments`, `payroll`, `loan`, `accounts_receivable` or `accounts_payable`. |
| `report_cash_flow` | Whether the Ledger is included in the cash flow report. |
| `tax_category` | Optional. Used for tax estimates. It has to fit the type, for example `office_expenses` only goes on an `expense` Ledger. |
| `parent_id` | Nests the Ledger under another one. See [Nesting Ledgers](#nesting-ledgers). |
| `special_ledger_type` | The role Asset gives a system Ledger, or `null`. See [System Ledgers](#system-ledgers). |
| `is_deletable` | `false` for system Ledgers. |
---
### **The default chart** [#the-default-chart]
If you don't send `ledgers`, Asset creates the default chart for the Business' `entity_type`. It holds about 60 to 85 Ledgers, depending on the entity type: assets, liabilities, equity, revenue, and the usual expense categories.
| Country | Entity types |
| :------------ | :-------------------------------------------------------------------------------------- |
| United States | `sole-prop`, `llc`, `partnership`, `s-corp`, `c-corp`, `non-profit` |
| Canada | `canada-sole-prop`, `canada-partnership`, `canada-corporation`, `canada-not-for-profit` |
| Either | `household` |
Bank accounts, credit cards and loans are **not** in the default chart. Asset creates a Ledger for each one when you [connect or add the account](/bookkeeping/banktransactions), named after the account and its last digits.
A Business on the **core** plan gets a smaller chart that doesn't depend on a
country or entity type. When it upgrades onto a filing type, Asset grows the
chart instead of replacing it: the existing Ledgers and all their history
stay, the generic equity accounts are renamed for the filing type, and the
Ledgers the filing type adds are created. Upgrading doesn't move any Journal
Entry.
---
### **A custom chart when you create a Business** [#a-custom-chart-when-you-create-a-business]
If the Business already has a chart, for example one you keep in your own product, send it as `ledgers` when you [create the Business](/api-reference/business/create-a-business). Asset uses your Ledgers instead of the default chart. An empty list, or leaving `ledgers` out, gives the default chart.
Each Ledger takes the fields in the table above, and nests its children in a `children` list:
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"name": "Roofing Pros",
"entity_type": "llc",
"entries_start": "2025-01-01T00:00:00Z",
"fiscal_year": "12/31",
"external_id": "customer_8841",
"ledgers": [
{
"name": "Accounts Receivable",
"type": "asset",
"subtype": "current_asset",
"debit_credit": "debit",
"financial_account_type": "accounts_receivable",
"special_ledger_type": "accounts_receivable",
"sort_code": "1020",
"report_cash_flow": false
},
{
"name": "Sales",
"type": "revenue",
"subtype": "operating_revenue",
"debit_credit": "credit",
"sort_code": "4000",
"report_cash_flow": false,
"children": [
{
"name": "Roof Replacements",
"type": "revenue",
"subtype": "operating_revenue",
"debit_credit": "credit",
"sort_code": "4010",
"report_cash_flow": false
},
{
"name": "Repairs",
"type": "revenue",
"subtype": "operating_revenue",
"debit_credit": "credit",
"sort_code": "4020",
"report_cash_flow": false
}
]
}
]
}'
```
`name`, `type`, `subtype`, `debit_credit` and `report_cash_flow` are required on every Ledger. The rest are optional.
### **What Asset checks** [#what-asset-checks]
Asset checks the whole list before it creates the Business. If anything is wrong, the request fails with a `422` and **nothing is created, including the Business**.
- Ledger names are unique across the whole list, children included. Case and surrounding spaces are ignored, so `Rent` and ` rent` clash.
- The nesting is at most **four levels** deep.
- A child has the same `type`, `subtype`, `financial_account_type` and `report_cash_flow` as its parent.
- Each `special_ledger_type` is used at most once, and it has to be one the Business' default chart has. For example, GST/HST Ledgers are only valid on a Canadian Business.
- A Ledger with a special type matches the default chart's Ledger of that type on `type`, `subtype`, `debit_credit` and `financial_account_type`. It also can't be nested under another Ledger and can't have children.
- A Business on the **core** plan can't have custom Ledgers.
### **System Ledgers you leave out are added** [#system-ledgers-you-leave-out-are-added]
You don't have to list every system Ledger. Asset adds the ones you leave out from the default chart, at the top level, so the ones it depends on always exist. For example, if you don't send an Uncategorized Outflow Ledger, Asset creates one. They are added even when one of your Ledgers already uses the same name.
---
### **System Ledgers** [#system-ledgers]
Some Ledgers have a role in how Asset works. These are the **system Ledgers**, and they carry a `special_ledger_type`. The default chart of a US Business has these:
| `special_ledger_type` | Default name | What it's for |
| :-------------------------------- | :------------------------------- | :------------------------------------------------------------------------ |
| `accounts_receivable` | Accounts Receivable | Unpaid customer invoices |
| `accounts_payable` | Accounts Payable | Unpaid vendor bills |
| `undeposited_funds` | Undeposited Funds | [Checks received](/bookkeeping/checks) and not yet deposited |
| `transfers` | Transfer Clearing Account | Temporary holding for transfers between the Business' own accounts |
| `customer_credit` | Customer Credits | Credits owed to customers |
| `vendor_credit` | Vendor Credits | Credits owed to the Business by vendors |
| `inventory` | Inventory | Items held for resale |
| `sales_tax_payable` | Sales Tax Payable | Sales tax collected and owed |
| `contribution` | Owner's or Member's Contribution | Capital the owners put in |
| `distribution` | Owner's or Member's Draw | Money the owners take out |
| `opening_balances` | Opening Balance Equity | The balancing account for opening balances |
| `returns_and_allowances` | Returns & Allowances | Refunds, returns and credits given to customers |
| `purchase_returns_and_allowances` | Purchase Returns & Allowances | Refunds and credits received from vendors |
| `cost_of_goods_sold` | Cost of Goods Sold | Direct cost of what was sold |
| `bad_debt_expense` | Bad Debts Expense | Receivables that won't be collected |
| `uncategorized_inflow` | Uncategorized Inflow | Incoming Transactions that need review |
| `uncategorized_outflow` | Uncategorized Outflow | Outgoing Transactions that need review |
| `realized_fx_gain_loss` | Realized Currency Gain/Loss | Gains and losses from exchange rates on settled foreign-currency invoices |
A Canadian chart has `canada_taxes_payable` and `canada_taxes_recoverable` in place of `sales_tax_payable`. Because the roles are tied to the Ledger and not to its name, you can rename a system Ledger freely.
System Ledgers are protected:
- `is_deletable` is `false`, and you can't delete them.
- You can only change their `name` and `sort_code`. Changing any other field is refused.
---
### **Managing the chart** [#managing-the-chart]
Use these endpoints at any time after the Business is created:
| Endpoint | Scope |
| :--------------------------------------------------------------------------------------- | :-------------- |
| [List all Ledgers for a Business](/api-reference/ledger/list-all-ledgers-for-a-business) | `ledger:read` |
| [Retrieve a Ledger](/api-reference/ledger/retrieve-a-ledger) | `ledger:read` |
| [Create a Ledger](/api-reference/ledger/create-a-ledger) | `ledger:create` |
| [Update a Ledger](/api-reference/ledger/update-a-ledger) | `ledger:update` |
| [Delete a Ledger](/api-reference/ledger/delete-a-ledger) | `ledger:delete` |
The list comes back in chart order: by type, then subtype, then sort code, with each child directly after its parent.
### **Creating and updating** [#creating-and-updating]
When you create a Ledger, `debit_credit` is optional. Asset derives it from the `subtype`. To clear `description`, `sort_code`, `financial_account_type`, `tax_category` or `parent_id` when you update a Ledger, send it as `null`.
Create a Ledger for any new category you need. You don't have to create the Ledger for a bank account yourself: Asset does that when the account is added.
### **Nesting Ledgers** [#nesting-ledgers]
Use `parent_id` to group Ledgers under one another, for example `Sales` with `Roof Replacements` and `Repairs` under it. The rules are the same as for a custom chart:
- A Ledger can be at most four levels deep.
- A child has the same type, subtype, financial account type and cash flow setting as its parent.
- If you change one of those on a parent, Asset applies the change to all of its children.
- A Ledger can't be its own parent or sit under one of its own children.
### **Deleting a Ledger** [#deleting-a-ledger]
A Ledger can be deleted only if it isn't a system Ledger and nothing refers to it. If it still has Transactions, child Ledgers, or a linked account, the request fails with a `409` and you need to move or remove those first.
---
### **Opening balances** [#opening-balances]
If the Business has money in an account before its start date, set the Ledger's balance as of that date with [Set the Opening Balance for a Ledger](/api-reference/ledger/set-the-opening-balance-for-a-ledger) (`PUT /v0/business/{business_id}/ledger/{ledger_id}/opening-balance`). It needs the `ledger:update` scope.
| Request Parameter | Description |
| :----------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------ |
| amount | The balance as of the Business' `entries_start`. A positive amount is on the Ledger's normal side, and a negative amount is on the opposite side. |
| currency | For a foreign-currency account, the currency of `original_currency_amount`. Send it together with `original_currency_amount`. |
| original_currency_amount | For a foreign-currency account, the balance in the account's own currency, as a positive number. |
Asset books the other side of the opening balance to the **Opening Balance Equity** Ledger.
# Bookkeeping Copilot (/bookkeeping/copilot)
### **Overview** [#overview]
A [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) on the **DIY** [plan](/bookkeeping/plans) keeps its own books. Asset automates most of the work, but a few things only the owner can do: reconnect a broken bank connection, upload a missing statement, confirm a category. The **Bookkeeping Copilot** is how Asset guides them through it.
It answers three questions for the owner, month by month:
- **Are my books done?** Each month is `ready`, `in_progress`, `requires_attention` or waiting on an earlier month.
- **What is stopping them?** Each open item is a [Task](/bookkeeping/tasks) for that month.
- **How do I fix it?** The Task has a way to act on it: reconnect the account, upload the document, review the transactions.
### **How a month becomes ready** [#how-a-month-becomes-ready]
Asset works through the Business' months in order, from the month its books start (`entries_start`) up to the **last completed month**. The current month is never checked, because it isn't over. For each month it checks:
1. **Every connected account has its data.**
- A bank connection that covers the month must have synced through the end of it.
- If the bank's history doesn't reach back that far, Asset asks for the **statement** instead.
- A manual account waits until the month ends.
- An account that only takes statements asks the owner for each month's statement.
2. **Every transaction has been reviewed.** If any transactions in the month are unreviewed, Asset keeps a review Task open for the month.
A month with nothing pending is **ready**. Months are worked in order, so a month isn't ready until every month before it is. If March is waiting on something, April stays behind it, even if April itself is clean.
Asset re-runs the check when new bank data syncs and when entries change, so a month goes ready on its own as soon as the last Task is done.
### **What the Asset app shows** [#what-the-asset-app-shows]
In the app, a DIY owner sees the Copilot as a panel with two tabs:
- **Summary.** What needs doing now: accounts to reconnect, statements to upload and transactions to review, with a count on each.
- **Monthly Books.** The year at a glance, one entry for each month, with the tasks behind each one.
The panel refreshes on its own, so an owner who uploads a statement sees the month change without reloading. Managed Businesses with guided bookkeeping see the same content in a Copilot panel opened from the header.
### **Embedding the Copilot** [#embedding-the-copilot]
You have three ways to put the Copilot in your product. Pick based on how much of the interface you want to own.
#### Option 1: The Book Health component [#option-1-the-book-health-component]
The [SDK](/embedded/overview) has a ready-made card called **Book Health**. It shows a year of months, a count of how many are ready, a badge on each month with its open Tasks, and the Task list for the selected month. The owner can reconnect, upload and review without leaving it.
```tsx
import { AssetBookHealth } from "@get-asset/react";
export function Books({ onReview }) {
return onReview(task.month)} />;
}
```
- It reads the Business from the [AssetProvider](/embedded/embed-the-ui), so it needs no props to show live data.
- **Fiscal years.** The card follows the Business' fiscal year and offers a year picker once the Business has more than one.
- **Review hand-off.** Review Tasks are completed in your transactions screen. Pass `onReviewTask` to send the owner there for the Task's month. Until you do, the review button is hidden.
- **Plan gating.** Pass `locked` and an `upsell` to show the card blurred with an upgrade prompt for a Business that isn't entitled to it. Nothing is fetched for a locked viewer.
- **Scopes.** The token needs `business:read`, `request:read`, `plaid:create`, `document:create`, `journal_entry:read` and `journal_entry:create`. Reconnecting uses Plaid, uploading creates documents, and notes on a transaction use Journal Entries.
#### Option 2: The Tasks component [#option-2-the-tasks-component]
If you only want the to-do list, without the calendar, use **Tasks**. It groups the open work into Reconnect accounts, Upload documents and Review transactions, with the action on each row.
```tsx
import { AssetTasks } from "@get-asset/react";
openTransactions(task.month)} />;
```
Book Health uses this component under the calendar, so the two look the same side by side.
#### Option 3: Build your own with the API [#option-3-build-your-own-with-the-api]
For full control, use the two endpoints:
1. Call **books status** for the months, and draw a calendar.
2. Call **Tasks** for the pending work, and group it by `month`.
3. Complete each Task through its own endpoint. Upload the document with the Task's `task_id` to finish a document request, send the owner through Plaid to reconnect, and categorize the transactions to finish a review.
4. Refresh after each action. Use the Task webhooks to refresh without polling.
The SDK also exports **headless** building blocks (`BookHealth` and `Tasks` from `@get-asset/react`) if you want Asset's behavior with your own markup and styles.
### **Copilot best practices** [#copilot-best-practices]
- **Lead with the next step.** Show the oldest month that needs attention first. A later month can't be ready until it is, so fixing it unlocks the rest.
- **Tell the owner what is waiting on Asset.** An `in_progress` month isn't the owner's problem. Show it as "working on it", not as something to fix.
- **Refresh after every action.** The status updates a few moments after a Task is completed. Poll every ten seconds or so while the screen is open, as the Asset app does, or listen for webhooks.
- **Send the owner to the right place.** Reconnect, upload and review are three different actions. Put each one a single click away from the Task.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Canadian GST/HST (/bookkeeping/gsthst)
### **Overview** [#overview]
Canadian businesses that are registered for GST/HST collect it on their sales and pay it on their purchases, and report the difference to the CRA. Asset keeps the two apart from the sale or purchase itself, so the books always show how much tax is owed and how much can be claimed back.
| | |
| :--------------------- | :----------------------------------------------------------------------------------------------------------------------- |
| **Collected on sales** | Booked to a **GST/HST Payable** Ledger. It is money the Business owes the CRA. |
| **Paid on purchases** | Booked to a **GST/HST Recoverable** Ledger. It is money the Business can claim back, known as an input tax credit (ITC). |
| **The result** | The [GST/HST Summary](#gsthst-summary-report) reports both for any period, in the lines of the GST34 return. |
Asset prepares the numbers. It doesn't file the return.
### **Set up the Business** [#set-up-the-business]
How Asset treats tax depends on three fields on the [Business](/getstarted/CoreConcepts#businesses-your-smb-customers). Send them when you [create the Business](/api-reference/business/create-a-business), or change them later with [Update a Business](/api-reference/business/update-a-business).
| Field | Description |
| :---------------------- | :---------------------------------------------------------------------------------------------------------- |
| `country` | `CA` for a Canadian Business. The GST/HST Ledgers and the report are only available to Canadian Businesses. |
| `canada_gst_registered` | Whether the Business is registered for GST/HST. |
| `canada_tax_status` | `itc_eligible` if the Business can claim input tax credits, or `exempt`. |
A Canadian Business can also have a `region`, the province or territory.
**Asset separates the tax only when the Business is registered for GST/HST _and_ is `itc_eligible`.** For any other Business, such as one that isn't registered or whose supplies are exempt, Asset doesn't book tax to the GST/HST Ledgers. The tax is treated as part of the cost of the purchase or sale.
| Registered | Tax status | What Asset does with GST/HST |
| :------------- | :------------- | :------------------------------------------------------------------------- |
| Yes | `itc_eligible` | Books it to GST/HST Payable on sales and GST/HST Recoverable on purchases. |
| Yes | `exempt` | Doesn't use the GST/HST Ledgers. |
| No, or not set | any | Doesn't use the GST/HST Ledgers. |
If you create the Business without these fields, Asset doesn't split the tax. Set them as soon as you know them, because Asset reads them when it categorizes.
### **The two Ledgers** [#the-two-ledgers]
Every Canadian [Chart of Accounts](/bookkeeping/coa) has both as system Ledgers:
| Ledger | Type | What it holds |
| :---------------------- | :-------- | :------------------------------------------------------------------------------------------------------ |
| **GST/HST Payable** | Liability | GST/HST collected from customers and owed to the CRA. Its special type is `canada_taxes_payable`. |
| **GST/HST Recoverable** | Asset | GST/HST paid on purchases and recoverable from the CRA. Its special type is `canada_taxes_recoverable`. |
Asset finds them by their special type, not their name, so you can rename them without breaking anything. See [System Ledgers](/bookkeeping/coa#system-ledgers).
### **How tax gets booked** [#how-tax-gets-booked]
You can book tax yourself by setting the right `ledger_id` on a tax line. When you leave an Invoice or Bill line without a Ledger, Asset categorizes it, and for a registered, `itc_eligible` Business it follows these rules. Asset never changes a Ledger you set on a line.
#### Sales [#sales]
On an [Invoice](/bookkeeping/ar), a line for GST or HST is categorized to **GST/HST Payable**. Lines for any other tax go to the same Ledger as the product or service sold.
#### Purchases [#purchases]
On a [Bill](/bookkeeping/ap), a line for GST or HST is categorized to **GST/HST Recoverable**. A single tax line that doesn't say which tax it is, such as "Tax", is treated as GST. Lines for other taxes, such as PST, go to the same Ledger as the item bought.
This also applies to Invoices and Bills that Asset creates from uploaded documents. Asset leaves tax lines uncategorized when it reads them, and then categorizes them with the rules above. See [Invoice Documents](/bookkeeping/invoicedocuments) and [Bill Documents](/bookkeeping/billdocuments).
#### Receipts [#receipts]
When a receipt is matched to a Transaction, Asset splits the Transaction's entry so the GST/HST on the receipt has its own line in **GST/HST Recoverable**. The rest stays in the Ledger the Transaction was categorized to.
- A single tax line that doesn't say which tax it is, such as "Tax", is treated as GST.
- Other taxes, such as PST, stay in the same Ledger as the purchase.
- For **meals and entertainment**, only half of the GST/HST is recoverable. Asset books half to GST/HST Recoverable and keeps the other half with the purchase.
- The split lines always add up to the full amount of the Transaction.
For a Business that isn't registered and `itc_eligible`, Asset keeps all of the tax in the same Ledger as the purchase and doesn't split the entry.
### **GST/HST Summary report** [#gsthst-summary-report]
[Retrieve the GST/HST Summary Report](/api-reference/reports/retrieve-the-gsthst-summary-report) totals the tax for a period:
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/reports/canada/gst-summary?start_datetime=2025-01-01T00:00:00Z&end_datetime=2025-04-01T00:00:00Z" \
--header 'Authorization: Bearer '
```
| Request Parameter | Description |
| :---------------- | :-------------------------------------------------------------------------------------------------------------- |
| start_datetime | Required. The start of the period, inclusive. |
| end_datetime | Required. The end of the period, exclusive. To include a whole day, send midnight at the start of the next day. |
| basis | Optional. `modified_cash`, the default, or `accrual`. |
The response has three amounts, which follow the lines of the GST34 return:
```json
{
"data": {
"tax_collected": 1300.0,
"input_tax_credits": 450.0,
"net_tax": 850.0
}
}
```
| Field | GST34 line | Meaning |
| :------------------ | :--------- | :--------------------------------------------------------------------------------------------------------------------- |
| `tax_collected` | 105 | GST/HST collected on sales in the period. It is the net activity on GST/HST Payable. |
| `input_tax_credits` | 108 | GST/HST claimed on purchases in the period. It is the net activity on GST/HST Recoverable. |
| `net_tax` | 109 | `tax_collected` minus `input_tax_credits`. A positive amount is owed to the CRA, and a negative amount is recoverable. |
- The report is only available to Canadian Businesses. For any other Business it returns a 403.
- It needs the `report:read` scope.
- It is built from the two Ledgers, so it is only as complete as the tax booked to them. Tax that was booked to another Ledger, for example because the Business wasn't registered yet when it was recorded, isn't counted.
#### Paying the CRA [#paying-the-cra]
A payment to the CRA is a payment out of the Business' bank account. To clear what is owed, categorize it to **GST/HST Payable**, which brings that Ledger's balance down by the amount remitted.
---
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Invoice Documents (/bookkeeping/invoicedocuments)
Instead of creating Invoices through the API, you can upload the Invoice a Business sent to its customer, such as a PDF or an image. Asset reads it and creates the Invoice for you.
Call **[Upload Documents for a Business](/api-reference/document/upload-documents-for-a-business)** with `document_type` set to `invoice`:
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/document \
--header 'Authorization: Bearer ' \
--form 'files=@invoice-1042.pdf' \
--form 'document_type=invoice'
```
Always send `document_type`. Without it, Asset works out the type from the
file, and an invoice is treated as a vendor **bill** (money the Business
owes), not as an Invoice the Business sent.
### What Asset does with it [#what-asset-does-with-it]
1. **Reads the document.** Asset extracts the customer, the Invoice number, the dates, the line items and the total.
2. **Finds or creates the Customer.** Asset looks for an existing Customer with the same name, allowing for small differences such as "ACME Corp" and "Acme Corporation". If there is none, it creates one.
3. **Creates the Invoice.** It uses the number on the document, the issue date as `sent_at`, and the due date as `due_at`. If the document has no due date, Asset uses 30 days after the issue date. Each line item becomes an Invoice line. If a document holds several Invoices, each one is created separately.
4. **Picks Ledgers for the lines.** Asset proposes ledger assignments from the business's [Chart of Accounts](/bookkeeping/coa). Lines it cannot confidently place, and tax lines, are initially left without a ledger and pass through the usual categorization workflow.
5. **Books it like any other Invoice.** Asset creates the usual [Journal Entry](#1-create-an-invoice), links the document to the Invoice, and then categorizes the lines that still have no Ledger.
From there the Invoice works like one created through the API, including [matching payments](#2-match-payments-to-an-invoice).
### Result [#result]
Follow the outcome on the Document's `status`. When an Invoice was created, the Document's `invoice_id` holds its ID.
| Status | Meaning |
| :---------------------- | :------------------------------------------------------------------------------------------------------------------ |
| **processing** | Asset is reading the document. |
| **processed** | An Invoice was created from the document. |
| **partially_processed** | Asset read the document but didn't create an Invoice, for example because the number is already used by an Invoice. |
| **failed** | Asset couldn't read the document. The `status_reason` says why. |
A `DOCUMENT_PROCESSED` webhook is sent when processing finishes, whatever the outcome.
- **Duplicates:** a file that matches one already uploaded for the Business is rejected, and the error names the existing document.
- **Unsupported files:** a file type that isn't supported, or a file that is too large, is rejected at upload.
- **Check the result:** review the Customer, Ledgers and amounts on the new Invoice, and correct them with [Update an Invoice](/api-reference/invoice/update-an-invoice).
---
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Mileage Tracking (/bookkeeping/mileagetracking)
### **Overview** [#overview]
A [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) that uses a vehicle for work can deduct the miles it drives for business. To claim the deduction, it needs a record of every trip: when, how far, for what purpose, and in which vehicle. Asset keeps that record and works out the deduction for each business trip.
| Object | What it is |
| :------------ | :--------------------------------------------------------------------------------------------------------------------------------------------- |
| **Vehicle** | A car or truck the Business drives. Every trip belongs to one. |
| **Trip** | A single journey, with a date, a distance, a purpose, and where it started and ended. |
| **Deduction** | The amount the Business can claim for a business trip. Asset calculates it from the distance and the mileage rate in force on the trip's date. |
You can get trips into Asset in two ways: create them through the API, or upload the report your customer's mileage app exports and let Asset import it. The [Mileage Deduction Report](/bookkeeping/reports/mileage) then totals them for a period.
### **Vehicles** [#vehicles]
Create a Vehicle before you record trips for it, using [Create one or more vehicles](/api-reference/vehicle/create-one-or-more-vehicles-max-100). The body is a list of up to 100 Vehicles. Each is created on its own, and the response has the Vehicles created in `data` and the ones that failed in `errors`.
| Request Parameter | Description |
| :---------------------- | :------------------------------------------------------------------- |
| `description` | Required. A name a person will recognize, such as "2022 Ford F-150". |
| `make`, `model`, `year` | Optional. |
| `license_plate`, `vin` | Optional. |
| `external_id` | Optional. Your own identifier for the Vehicle. |
A Vehicle is `is_active`. A trip can only be added to an **active** Vehicle, so set `is_active` to `false` with [Update a vehicle](/api-reference/vehicle/update-a-vehicle) when a vehicle is sold or no longer used. Its existing trips stay. You can also list Vehicles and retrieve one by its ID.
### **Trips** [#trips]
Record trips with [Create one or more trips](/api-reference/mileage/create-one-or-more-trips-max-100). The body is a list of up to 100 trips. Each is created on its own, so one failure doesn't stop the others.
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/trips \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '[
{
"vehicle_id": "vhc_GA6EG2qFxA97NZHtxeLPUy",
"trip_date": "2026-04-22",
"distance": 42.5,
"distance_unit": "miles",
"purpose": "business",
"start_address": "123 Main St, San Francisco, CA",
"end_address": "456 Market St, San Francisco, CA",
"notes": "Client lunch meeting"
}
]'
```
| Request Parameter | Description |
| :----------------------------- | :--------------------------------------------------------------------------------------------------- |
| `vehicle_id` | Required. The Vehicle used. It has to be active. |
| `trip_date` | Required. The date of the trip. |
| `distance` | Required. Greater than zero. |
| `distance_unit` | Required. `miles` or `kilometers`. |
| `purpose` | Optional. `business` or `personal`. |
| `start_address`, `end_address` | At least one is required. Free text. |
| `notes` | Optional. |
| `external_id` | Optional. Your own identifier. It has to be unique within the Business, and a duplicate is rejected. |
#### The country sets the unit [#the-country-sets-the-unit]
Asset reads the country, and for Canada the province, from the trip's address. If it can't find one, it treats the trip as a US trip.
- **US trips must be in `miles`.**
- **Canadian trips must be in `kilometers`.**
A trip sent in the wrong unit for its country is rejected. Send a clear address, with a state or province, so Asset reads the country correctly.
#### Only business trips have a deduction [#only-business-trips-have-a-deduction]
When `purpose` is `business`, Asset works out the deduction and stores it on the trip as `amount`, with the reason in `amount_reason`. A personal trip, or a trip with no purpose, has no `amount`.
| Country | How the deduction is calculated |
| :---------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **United States** | A flat rate for each mile, set for the date of the trip. |
| **Canada** | Tiered rates. The first part of the calendar year's distance is paid at one rate and the rest at a second rate. Trips in the northern territories use a higher set of rates. |
Because the Canadian rate depends on how far the Business has already driven that year, **a trip's amount can change after it is created**. When you create, change or delete a business trip in Canada, Asset recalculates the amounts of that trip and all later trips in the same year, in date order. Changing a trip from business to personal clears its amount.
Amounts are calculated with the rates in force when the trip is saved. A later change to the published rates doesn't rewrite trips that were already saved.
#### Changing and removing trips [#changing-and-removing-trips]
- [Update a trip](/api-reference/mileage/update-a-trip) changes any of the fields above. If you change an address, Asset reads the country again, and the unit has to fit the new country.
- [Delete a trip](/api-reference/mileage/delete-a-trip) removes it, and recalculates later Canadian trips.
- [List trips for a business](/api-reference/mileage/list-trips-for-a-business) can be filtered by `vehicle_id`, `external_id`, `purpose`, and `trip_date_from` and `trip_date_to`, which are both inclusive. The result is paginated.
### **Import a mileage report** [#import-a-mileage-report]
If the Business already tracks its trips in a mileage app, you don't have to re-enter them. Upload the report the app exports with [Upload Documents for a Business](/api-reference/document/upload-documents-for-a-business), setting `document_type` to `mileage`.
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/document \
--header 'Authorization: Bearer ' \
--form 'files=@mileage-report-2026.csv' \
--form 'document_type=mileage'
```
Asset reads **MileIQ** and **Everlance** exports directly. A report from another app is read with AI extraction instead, which can be slower and is less reliable for very large reports.
Asset then:
1. **Creates the Vehicles.** A Vehicle that matches one the Business already has, by external ID or by description, is reused, so importing twice doesn't duplicate it.
2. **Creates the trips.** Each one goes through the same rules as a trip created through the API, including the unit rules and the deduction.
3. **Skips what it can't import.** A trip that already exists, or whose Vehicle can't be identified, is skipped.
Trips marked **business** in the report become business trips with a deduction. In a MileIQ report, a trip marked as anything else, such as commute, becomes a personal trip. In a report from another app, a trip whose purpose isn't clearly business or personal is imported with no purpose, and so has no deduction.
Follow the result on the Document's `status`. When it is `processed`, the Document's metadata has a `mileage_import` summary with `created_vehicles`, `created_trips` and `skipped_trips`. A `DOCUMENT_PROCESSED` webhook is sent when processing finishes.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Multicurrency (/bookkeeping/multicurrency)
### **Overview** [#overview]
A [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) keeps its books in one currency, its **home currency**. It can still hold bank accounts, and issue Invoices and Bills, in another. Asset records those in their own currency and converts them to the home currency at the exchange rate of the day, so the books always add up in one currency.
Asset supports many currencies.
| Term | Meaning |
| :-------------------------- | :------------------------------------------------------------------------------------------------------- |
| **Home currency** | The currency the Business' books and reports are in. |
| **Foreign currency** | Any other supported currency an account, Invoice or Bill is in. |
| **Exchange rate** | How much of the home currency one unit of the foreign currency buys on a given day. |
| **Realized gain or loss** | The difference that arises when a foreign amount is settled at a different rate than it was booked at. |
| **Unrealized gain or loss** | The change in value of foreign amounts the Business still holds, if they were converted at today's rate. |
---
### **Home currency** [#home-currency]
Each Business has a `home_currency`, a three-letter currency code.
- When you [create a Business](/api-reference/business/create-a-business), send `home_currency`. If you leave it out, the Business uses the **tenant's** `home_currency`.
- **It can't be changed after the Business is created.** The Business' update endpoint doesn't accept it.
- `has_multicurrency` on the Business is a read-only flag. It is `true` when the Business has an account, Invoice or Bill in a currency other than its home currency.
---
### **Exchange rates** [#exchange-rates]
Asset keeps an up-to-date list of exchange rates between the supported currencies, and uses it to convert every foreign amount. A foreign amount is converted at the rate for its date.
If there is no rate for a date, such as a weekend, Asset uses the most recent earlier one. If there is none at all, creating an Invoice, Bill or payment in that currency fails with a 409, instead of booking the amount unconverted.
---
### **Accounts and Transactions** [#accounts-and-transactions]
An account has a `currency`.
- For a manual account, send `currency` when you [create the External Account](/api-reference/transaction/create-an-external-account). It defaults to `USD`.
- For a [Plaid](/importingdata/plaid) account, Asset uses the currency Plaid reports for the account.
A Transaction is always in the currency of its account. Asset automarically converts it to the home currency at ingestion.
Opening balances work the same way. A foreign account's opening balance is converted at the rate for its date.
---
### **Invoices and Bills** [#invoices-and-bills]
Send a `currency` when you create an [Invoice](/bookkeeping/ar) or a [Bill](/bookkeeping/ap). The amounts on the lines are in that currency, and `total_amount` and `total_paid` stay in it too.
If you leave `currency` out, it defaults to `USD`, even when the Business'
home currency is a different one. Always send it. Invoices and Bills that Asset creates
from uploaded documents are different: they use the Business' home currency
unless the document names a currency with a currency code or a clear
symbol. A bare `$` is not enough to tell.
Asset converts the document at the rate for its **issue date**, `sent_at` for an Invoice and `issued_at` for a Bill. That rate is fixed, and it is the rate the receivable or payable is carried at.
---
### **Payments, credits and refunds** [#payments-credits-and-refunds]
A payment is measured in the **currency of the Invoice or Bill**, whatever currency the bank Transaction is in. Asset converts the Transaction to the document's currency to see how much of it was paid.
The receivable or payable is relieved at the rate it was booked at, and the cash is booked at the rate on the payment date. The difference is a **realized gain or loss**. Asset books it to the **Realized Currency Gain/Loss** Ledger, a system Ledger in every chart. For example, an Invoice for 1,000 in a foreign currency booked at 1.35 is carried as 1,350 in the home currency. If the customer pays when the rate is 1.40, the bank receives 1,400 in the home currency, and the extra 50 is a realized gain.
Some things can't mix currencies:
- **One Transaction settles documents in one currency.** A Transaction that already pays an Invoice in one currency can't also pay one in another. Applying it returns a 409, and an automatic match is skipped.
- **Credit is tracked per currency.** [Customer Credit](/bookkeeping/ar#customer-credit) and Vendor Credit in one currency can only pay an Invoice or Bill in that currency. Credit Memos and Vendor Credits have their own `currency`, and the [Customer Credit Balance Report](/bookkeeping/reports/customercredit) lists credit per currency.
- **A Refund settles Invoices in one currency.** It takes the currency of the Invoices it refunds.
---
### **Reports** [#reports]
Reports are in the **home currency**.
- **Aged Receivables and Aged Payables.** Each open balance is converted to the home currency at the rate it was booked at, so the buckets and totals add up.
- **Profit and Loss.** When a Business has foreign activity, a **Foreign Currency Adjustments** line appears with the **Realized Currency Gain/Loss**, from settled payments, and the **Unrealized Currency Gain/Loss**.
- **Balance Sheet and Trial Balance.** Foreign balances are shown revalued at the rate on the report date.
- **Cash Flow.** A **Currency Revaluation** line carries the change in value of foreign cash.
- **Ledger Statement.** A Ledger that holds a foreign currency also shows its balance in each currency, summed from the lines' own amounts. This needs multicurrency to be enabled for your account.
- **Outstanding Checks.** Totals are per currency, since accounts in different currencies can't be added together.
#### Unrealized gains and losses [#unrealized-gains-and-losses]
Money the Business holds or owes in a foreign currency changes in value as rates move, even before it is settled. Asset reports that change without booking it. At each report date, it revalues every foreign **monetary** balance at that day's rate and compares it with the value it is carried at. Monetary balances are cash and card accounts, loans, receivables, payables, and held customer and vendor credit. Income, expenses and equity keep the value they were booked at.
The difference is the unrealized gain or loss. It is calculated when the report is run and is never posted to the books, so it reverses itself as rates move, and becomes realized only when the amount is settled.
---
### **Reconciliation** [#reconciliation]
[Reconciliation](/bookkeeping/autoreconciliation) compares a foreign account in the account's own currency. The reported balance and the ledger balance are both in the account's currency, so a change in exchange rates doesn't cause a mismatch on its own.
---
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Personal Accounts (/bookkeeping/personaltransactions)
### **Overview** [#overview]
Asset has a **Personal Business Crossover** feature that allows business owners to efficiently manage the separation between personal and business finances. Many business owners use personal accounts for business transactions, which can lead to financial tracking issues, tax complications, and bookkeeping overhead.
This functionality provides a structured way to:
- Connect personal accounts through Plaid or manually
- Mark personal transactions as business when necessary
- Automatically generate journal entries with appropriate ledger mappings
- Revert business transactions back to personal when needed
## Key Concepts [#key-concepts]
### Personal External Accounts [#personal-external-accounts]
**Personal External Accounts** are financial accounts that belong to the business owner but are not primarily designated for business use. Common examples include:
- Personal bank accounts
- Personal credit cards
- Personal savings accounts
When connecting an external account, users must designate it as either **Personal** or **Business**. This designation determines how associated transactions will be treated.
### Ledger Mapping [#ledger-mapping]
Each Personal External Account requires specific ledger mappings:
1. **Contribution Ledger**: Used when expenses are paid from a personal account
2. **Distribution Ledger**: Used when revenue is received in a personal account
A **Personal** external account requires `financial_account_type`,
`contribution_ledger_id` and `distribution_ledger_id`, and the two Ledgers
must be different. Without them, we cannot track contributions or
distributions accurately.
## How It Works [#how-it-works]
### Connecting Personal External Accounts [#connecting-personal-external-accounts]
Personal external accounts can be connected in two ways:
#### 1. Plaid Integration [#1-plaid-integration]
1. The user selects their accounts through the Plaid Link component.
2. In the confirmation screen, they designate the account as **Personal**.
3. They select appropriate ledgers for Contributions and Distributions.
#### 2. Manual Creation [#2-manual-creation]
Users can manually create a personal external account by calling the **[Create an External Account](/api-reference/transaction/create-an-external-account)** endpoint:
```
POST /v0/business/{business_id}/external-account
```
Providing:
- Designation as `"type": personal`
- The account type, `financial_account_type`, such as `bank_account` or `credit_card`
- Ledger IDs for `contribution_ledger_id` and `distribution_ledger_id`
Example request:
```json
{
"name": "Personal Bank Account",
"mask": "1234",
"type": "personal",
"financial_account_type": "bank_account",
"source": "manual",
"contribution_ledger_id": "ldg_123456",
"distribution_ledger_id": "ldg_789012"
}
```
### Managing Personal Transactions [#managing-personal-transactions]
All transactions from personal accounts are automatically created with `"type": "personal"`. These transactions:
- Do not affect the business books until marked as business
- Can be filtered in the UI or API with `"type": "personal"`
- Appear in the "Personal Review" page for processing
### Marking Transactions as Business [#marking-transactions-as-business]
When a personal transaction should be treated as business:
1. The user marks the transaction as business through the UI or API by calling the **[Update Transactions for a Business](/api-reference/transaction/update-transactions-for-a-business)** endpoint:
```
PATCH /v0/business/{business_id}/transactions
```
Example request:
```json
[
{
"transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo",
"type": "business"
},
{
"transaction_id": "txn_ZXMPQRSfLmOaNBc5DqrEFp",
"type": "business"
}
]
```
2. The system automatically **generates a journal entry** to reflect the transaction on the books.
- **For expenses paid from a personal account**:
- **Debit**: Expense ledger (e.g., Meals, Office supplies)
- **Credit**: Contribution ledger (representing the owner’s money contributed)
- **For revenue received in a personal account**:
- **Debit**: Distribution ledger (representing funds drawn by the owner)
- **Credit**: Revenue ledger (e.g., Sales Revenue)
From an accounting perspective:
- Paying for a business expense from personal funds increases the business’s expenses, offset by an equity contribution.
- Receiving business revenue in a personal account increases the business’s revenue, offset by an equity distribution (or “owner’s draw”).
### Reverting to Personal [#reverting-to-personal]
If a transaction previously marked as business needs to be reverted:
1. The user updates the transaction’s type from `"business"` back to `"personal"` through the UI or API by calling the **[Update Transactions for a Business](/api-reference/transaction/update-transactions-for-a-business)** endpoint:
```
PATCH /v0/business/{business_id}/transactions
```
```json
[
{
"transaction_id": "txn_abc123",
"type": "personal"
}
]
```
2. The system automatically **deletes** the associated journal entry, removing its impact on the books.
## Common Use Cases [#common-use-cases]
### Case 1: Business Expenses on Personal Credit Card [#case-1-business-expenses-on-personal-credit-card]
A business owner pays \$100 for office supplies using their personal credit card:
1. The transaction appears as `personal` in the review page.
2. The owner marks the transaction as `business`.
3. The system creates a journal entry:
- **Debit**: Office Supplies \$100
- **Credit**: Owner’s Contribution \$100
### Case 2: Business Revenue in Personal Bank Account [#case-2-business-revenue-in-personal-bank-account]
A customer pays \$500 to the owner’s personal bank account:
1. The transaction appears as `personal` in the review page.
2. The owner marks the transaction as `business`.
3. The system creates a journal entry:
- **Debit**: Owner’s Distribution \$500 (or “Owner’s Draw”)
- **Credit**: Sales Revenue \$500
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
### Creating a Personal External Account [#creating-a-personal-external-account]
Call the **[Create an External Account](/api-reference/transaction/create-an-external-account)** endpoint:
```
POST /v0/business/{business_id}/external-account
```
Example request:
```json
{
"name": "Personal Bank Account",
"mask": "1234",
"type": "personal",
"financial_account_type": "bank_account",
"source": "manual",
"contribution_ledger_id": "ldg_123456",
"distribution_ledger_id": "ldg_789012"
}
```
### Creating Personal Transactions [#creating-personal-transactions]
Call the **[Create Transactions](/api-reference/transaction/create-transactions)** endpoint:
```
POST /v0/business/{business_id}/transactions
```
Transactions for personal external accounts are automatically marked `"personal"`.
### Listing Personal Transactions [#listing-personal-transactions]
Call the **[List Transactions for a Business](/api-reference/transaction/list-transactions-for-a-business)** endpoint, filtering by type:
```
GET /v0/business/{business_id}/transactions?type=personal&reviewed=false
```
### Converting Personal Transactions to Business [#converting-personal-transactions-to-business]
Call the **[Update Transactions for a Business](/api-reference/transaction/update-transactions-for-a-business)** endpoint:
```
PATCH /v0/business/{business_id}/transactions
```
```json
[
{
"transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo",
"type": "business"
},
{
"transaction_id": "txn_ZXMPQRSfLmOaNBc5DqrEFp",
"type": "business"
}
]
```
### Marking Transactions as Reviewed [#marking-transactions-as-reviewed]
Call the same **[Update Transactions for a Business](/api-reference/transaction/update-transactions-for-a-business)** endpoint, specifying `"reviewed": true`:
```
PATCH /v0/business/{business_id}/transactions
```
```json
[
{
"transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo",
"reviewed": true
},
{
"transaction_id": "txn_ZXMPQRSfLmOaNBc5DqrEFp",
"reviewed": true
}
]
```
### Disconnecting Personal External Accounts [#disconnecting-personal-external-accounts]
Call the **[Update External Account](/api-reference/transaction/update-external-account)** endpoint:
```
PATCH /v0/business/{business_id}/external-account/{external_account_id}
```
```json
{
"status": "disconnected"
}
```
(While the API also supports an `untracked` status, it is generally unused for the personal-business crossover use case.)
# Business Plans (/bookkeeping/plans)
### **Overview** [#overview]
Every [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) is on one of three plans. The plan decides how much of the books Asset sets up for the Business, and who keeps them up to date.
| Plan | `plan` | What it is |
| :---------- | :-------- | :------------------------------------------------------------------------------------------ |
| **Core** | `core` | The lightest setup. A profit and loss view of the Business, with no filing type to collect. |
| **DIY** | `diy` | Your customer keeps their own books, using Asset's automation and reports. |
| **Managed** | `managed` | A dedicated bookkeeper keeps the books accurate and up to date every month. |
You choose the plan with the `plan` field of [Create a Business](/api-reference/business/create-a-business). If you leave it out, the Business is created on **Managed**.
A Business can move **up** a plan later, from Core to DIY or Managed, or from DIY to Managed. It can never move down or go back to Core. See [Upgrading a Business](#upgrading-a-business).
---
### **What each plan includes** [#what-each-plan-includes]
| | Core | DIY | Managed |
| :------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------- | :--------------------------------------------- |
| **Filing type and fiscal year** | Not collected. Asset stores the entity type `core` and a fiscal year start of `01/01`. | Required when you create the Business | Required when you create the Business |
| **[Chart of Accounts](/bookkeeping/coa)** | A small chart: profit and loss accounts and the system accounts. No balance sheet accounts and no filing type equity. | The full chart for the entity type and country | The full chart for the entity type and country |
| **Custom Ledgers at creation** | Not supported | Supported | Supported |
| **Opening balances** | Not set up. They are established when the Business upgrades. | Derived for each connected account | Derived for each connected account |
| **Review of Transactions** | No review queue. Transactions are posted without a review. | The customer reviews Transactions in a review queue | A bookkeeper reviews them |
| **[Reconciliation](/bookkeeping/autoreconciliation)** | Never reconciled | Reconciled | Reconciled |
### **Create a Business on the Core plan** [#create-a-business-on-the-core-plan]
A Core Business needs less information, because the filing type and the fiscal year are collected only when it upgrades. Send `"plan": "core"` and leave out `entity_type` and `fiscal_year`:
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"name": "Roofing Pros",
"entries_start": "2025-01-01T00:00:00Z",
"external_id": "customer_8841",
"plan": "core"
}'
```
If you send an `entity_type` with the Core plan, Asset ignores it and uses
`core`. The value `core` is only valid on the Core plan, and Core Businesses
can't be created with a custom Chart of Accounts.
For DIY and Managed, send the `entity_type` and `fiscal_year` as described in [Onboarding](/bookkeeping/businesses).
---
### **Upgrading a Business** [#upgrading-a-business]
To move a Business up a plan, upgrade a Core Business onto a filing type:
`POST /v0/business/{business_id}/upgrade`
It needs the `business:update` scope. To record who made the change, send an optional `X-User-ID` header. It can be any identifier you use for the person, and Asset stores it with the plan change.
| From | Can move to |
| :---------- | :-------------------------- |
| **Core** | DIY or Managed |
| **DIY** | Managed |
| **Managed** | Nowhere, it is the top plan |
Asking for a move that isn't in this table, including a move to the plan the Business is already on, is refused.
### **Upgrade from Core to DIY or Managed** [#upgrade-from-core-to-diy-or-managed]
Leaving Core is the bigger step. A Core Business has no filing type, so you have to give one now.
| Request Parameter | Description |
| :---------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| plan | Required. `diy` or `managed`. |
| entity_type | Required. The filing type to adopt. In the US: `sole-prop`, `llc`, `partnership`, `s-corp` or `c-corp`. In Canada: `canada-sole-prop`, `canada-partnership` or `canada-corporation`. |
| fiscal_year | Required. The fiscal year start, as `MM/DD`. It sets the reporting periods and the year end from now on. |
| entries_start | Optional. A new date to open the books from, in UTC ISO 8601 format. Leave it out to keep the current one. |
The entity type has to belong to the Business' country. `household`, `non-profit` and `canada-not-for-profit` can't be upgraded to, because their charts have too little in common with the Core chart. A Business with one of those structures is created on DIY or Managed from the start.
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/upgrade \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--header 'X-User-ID: someone@example.com' \
--data '{
"plan": "diy",
"entity_type": "llc",
"fiscal_year": "01/01"
}'
```
The response is the updated [Business](/api-reference/schema/business), with the new `plan`, `entity_type` and `fiscal_year`.
### **What the upgrade does** [#what-the-upgrade-does]
The upgrade grows the books instead of replacing them, so nothing the Business already has is lost:
1. **The chart grows.** Every Ledger the Business has stays, with the same ID, so no history moves. Asset renames the generic equity accounts to the filing type's, for example Owner Distributions becomes Member's Draw on an LLC. It then adds the Ledgers the filing type needs. See [Chart of Accounts](/bookkeeping/coa).
2. **Opening balances are set.** Asset works out an opening balance for each connected account from the balance it already holds.
3. **No Journal Entry moves.**
4. **The plan change is recorded**, with who made it if you sent `X-User-ID`.
The upgrade is all or nothing. If any step fails, the Business stays on Core with its chart untouched.
### **Moving the start date** [#moving-the-start-date]
If you send `entries_start`, the date the books open from moves with the upgrade:
- **Earlier:** the Transactions between the new date and the old one are brought onto the books.
- **Later:** the Transactions before the new date are taken off the books.
This is finished in the background after the call returns. The Business comes back with the new date while its books are still settling.
### **Upgrade from DIY to Managed** [#upgrade-from-diy-to-managed]
Moving from DIY to Managed changes only the plan. The Business already has a filing type, a chart, and opening balances, so send just the plan:
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/upgrade \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{ "plan": "managed" }'
```
Sending `entity_type`, `fiscal_year` or `entries_start` is refused. Nothing in the books changes.
# Aged Payables Report (/bookkeeping/reports/agedpayables)
## **Overview** [#overview]
The **Aged Payables Report** shows what a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) owes its vendors for Bills that are past due, grouped by how late they are. It is the payables counterpart of the [Aged Receivables Report](/bookkeeping/reports/agedreceivables).
A Bill is included once its **due date** has passed and it still has an unpaid balance. A Bill that isn't due yet is not in the report.
Key components, for each Vendor:
* **Vendor ID** and **Vendor Name**
* **Overdue 0–30** – Amount past due by up to 30 days.
* **Overdue 31–60** – Amount past due by 31–60 days.
* **Overdue 61–90** – Amount past due by 61–90 days.
* **Overdue 90+** – Amount past due by more than 90 days.
* **Total Outstanding** – The sum of the Vendor's overdue Bills.
Amounts are in the Business' home currency. A Bill in another currency is converted at the rate it was booked at. See Multicurrency.
## **How to Generate an Aged Payables Report** [#how-to-generate-an-aged-payables-report]
Call [Retrieve the Aged Payables Report](/api-reference/reports/retrieve-the-aged-payables-report) with:
| Parameter | Description |
| :-- | :-- |
| `start_datetime` | Optional. The reference date the aging is measured from, in ISO-8601 format. Defaults to now. |
| `vendor_id` | Optional. Limit the report to one Vendor. |
| `status` | Optional. One or more Bill statuses, comma-separated: `open`, `paid` or `voided`. Defaults to `open`. |
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/reports/aged-payables" \
--header 'Authorization: Bearer '
```
The report needs the `report:read` scope. The response is a list with one line for each Vendor that has overdue Bills.
## **Aged Payables Best Practices** [#aged-payables-best-practices]
* **Leave `start_datetime` out for today's picture.** The default is the current moment, which is what a payment run needs.
* **Use `start_datetime` to choose the aging date.** Only Bills due on or before it are counted, and each is aged from its due date to that date.
* **Run it for one Vendor.** Pass `vendor_id` to limit the report to that Vendor. To list the Bills behind a balance, use [List all Bills](/api-reference/bill/list-all-bills) with `status=open` and a due date range, and group the Bills by `vendor_id`. The list can't be filtered by Vendor.
* **Don't expect paid Bills.** A Bill only counts while it has an unpaid balance, so leaving the `status` filter alone is almost always right.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Aged Receivables Report (/bookkeeping/reports/agedreceivables)
## **Overview** [#overview]
The **Aged Receivables Report** shows the open Invoices of a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers), grouped by how long they have been overdue.
Every open Invoice with an unpaid balance is included. An Invoice that is **not yet due** is counted in the first group, **0–30**, together with Invoices that are up to 30 days late. The report shows which customers owe money, how overdue it is, and the total outstanding balance.
Key components (per customer):
* **Customer ID** – Unique identifier for the customer.
* **Customer Name** – Display name of the customer.
* **Overdue 0–30** – Amount past due by up to 30 days, plus amounts not yet due.
* **Overdue 31–60** – Amount past due by 31–60 days.
* **Overdue 61–90** – Amount past due by 61–90 days.
* **Overdue 90+** – Amount past due by more than 90 days.
* **Total Outstanding** – Sum of all open Invoices for the customer.
Amounts are in the Business' home currency. An Invoice in another currency is converted at the rate it was booked at. See Multicurrency. For what the Business owes vendors, see the [Aged Payables Report](/bookkeeping/reports/agedpayables), which only counts Bills that are already due.
---
## **How to Generate an Aged Receivables Report** [#how-to-generate-an-aged-receivables-report]
1. Call the [Retrieve the Aged Receivables Report](/api-reference/reports/retrieve-the-aged-receivables-report) endpoint with:
* **Business ID**
* **start_datetime** (ISO‑8601) — the reference date the aging is measured from. It is required.
* **customer_id** — optional. Limit the report to one customer.
**Example request:**
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/reports/aged-receivables?start_datetime=2025-01-01T00:00:00Z" \
--header 'Authorization: Bearer '
```
2. Use the response to display customer-level balances across the standard aging buckets:
* **0–30 days**
* **31–60 days**
* **61–90 days**
* **90+ days**
* **Total Outstanding**
---
## **Aged Receivables Best Practices** [#aged-receivables-best-practices]
* **Use today's date for most cases.** Passing today's date as `start_datetime` ensures the aging reflects the current day, which aligns with standard collections workflows.
* **Don't read the first group as "overdue".** It also holds Invoices that aren't due yet. To tell them apart, use [List all Invoices](/api-reference/invoice/list-all-invoices) with `status=open`, compare each Invoice's `due_at` with today, and group the Invoices by `customer_id`. The list can't be filtered by customer.
* **Run it for one customer.** Pass `customer_id` to limit the report to that customer, for example when a collector opens a customer's page.
* **Provide drill-downs.** Users may need to inspect the Invoices behind a balance. Use the Accounts Receivable guide and [Invoice endpoints](/api-reference/schema/invoice) to retrieve details.
* **Handle time zones carefully.** The `start_datetime` parameter anchors the aging. A value without a time zone is read as UTC, so use UTC consistently or state clearly how local time zones are applied.
---
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Balance Sheet (/bookkeeping/reports/balancesheet)
## **Overview** [#overview]
The **Balance Sheet** provides a snapshot of a [Business’s](/getstarted/CoreConcepts#businesses-your-smb-customers) financial position at **a given point in time**, summarizing what the Business owns (assets), what it owes (liabilities), and the owner’s interest in the company (equity).
The Balance Sheet is based on the **fundamental accounting equation**:
*Assets* = *Liabilities* + *Equity*
Key components:
* **Assets** – Resources owned by the Business, such as cash, receivables, and equipment.
* **Liabilities** – Obligations owed to others, such as loans and unpaid bills.
* **Equity** – The Business’s net worth after liabilities are deducted from assets.
The Balance Sheet helps Businesses assess financial stability and creditworthiness.
## **How to Generate a Balance Sheet** [#how-to-generate-a-balance-sheet]
Call [Retrieve the Balance Sheet Report](/api-reference/reports/retrieve-the-balance-sheet-report) with:
| Parameter | Description |
| :-- | :-- |
| `end_datetime` | Required. The moment the Balance Sheet is as of, **exclusive**, in ISO-8601 format. To show the position at the end of March 31, send `2026-04-01T00:00:00Z`. A time without a time zone is read as UTC. |
| `basis` | Optional. `modified_cash`, the default, or `accrual`. |
The response has an entry with a `period` and its `records`: one line for each of **Assets**, **Liabilities** and **Equity**. Each line has a `total_amount` and `children`. Display the data using the following structure (backed by customer research for clarity):
* **Assets**
* **Current Assets** (e.g., cash, accounts receivable)
* **Fixed Assets** (e.g., equipment)
* **Other Assets**
* **Liabilities**
* **Current Liabilities** (e.g., accounts payable, short-term loans)
* **Long Term Liabilities** (e.g., long-term loans)
* **Equity**
* The equity Ledgers, such as Retained Earnings and the owner's or shareholders' equity
* **Net Profit (Current Fiscal Year)**
The totals are on the **Assets**, **Liabilities** and **Equity** lines. There are no separate total lines.
Since the Balance Sheet is a snapshot in time, all values reflect the financial position at the specified moment. A Business with foreign-currency balances has those balances shown at the rate on that date. See Multicurrency.
## **Balance Sheet Best Practices** [#balance-sheet-best-practices]
* **Handling Report Dates Accurately –** The Balance Sheet reflects a **single moment in time**. Because `end_datetime` is exclusive and time zones matter, send a full timestamp that matches the Business' local time zone, and tell users clearly that the Balance Sheet is a fixed point in time. For example, to show the position at the close of a day in New York, send midnight at the start of the next day in New York, converted to UTC.
* **Enable Ledger Drill-Downs** – Users may need to investigate specific balances. Use the [Ledger Statement](/bookkeeping/reports/ledgerstatement) report to provide transaction-level details.
* **Set Opening Balances Correctly** – When creating an [External Account](/getstarted/CoreConcepts#accounts), ensure the **Opening Balance** is accurate. Asset uses this as the starting point for running balances in the Balance Sheet. An incorrect Opening Balance will lead to misstated financials.
* **Export it** – Send an `Accept` header of `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` to receive the report as a spreadsheet.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Introduction to Reports (/bookkeeping/reports/creatingreports)
Generating accurate financial reports is essential for [Businesses](/getstarted/CoreConcepts#businesses-your-smb-customers) to file taxes, analyze performance, and make informed decisions. Asset’s APIs allow you to construct custom reports using [Journal Entry](/getstarted/CoreConcepts#journal-entry) and [Ledger](/getstarted/CoreConcepts#ledgers) data. To streamline report generation and accelerate time to value, Asset also provides pre-built endpoints for the reports below.
## **The reports** [#the-reports]
**Financial statements**
| Report | What it shows |
| :-- | :-- |
| **[Profit and Loss](/bookkeeping/reports/profitandloss)** (Income Statement) | Revenue, expenses and net profit over a period. |
| **[Simple Cash Flow](/bookkeeping/reports/simplecashflow)** | Cash in and out of the Business over a period, from the starting cash balance to the ending one. |
| **[Balance Sheet](/bookkeeping/reports/balancesheet)** | Assets, liabilities and equity at a point in time. |
| **[Trial Balance](/bookkeeping/reports/trialbalance)** | Every Ledger's balance at a point in time, in debit and credit columns. |
**Ledger detail**
| Report | What it shows |
| :-- | :-- |
| **[Ledger Statement](/bookkeeping/reports/ledgerstatement)** | The entries posted to one Ledger over a period. |
| **[General Ledger](/bookkeeping/reports/generalledger)** | The entries posted to every Ledger over a period, with running balances. |
**Receivables and payables**
| Report | What it shows |
| :-- | :-- |
| **[Aged Receivables](/bookkeeping/reports/agedreceivables)** | What customers owe, grouped by how late it is. |
| **[Aged Payables](/bookkeeping/reports/agedpayables)** | What the Business owes vendors that is past due, grouped by how late it is. |
| **[Customer Credit Balance](/bookkeeping/reports/customercredit)** | Credit the Business owes its customers. |
| **[Vendor Credit Balance](/bookkeeping/reports/vendorcredit)** | Credit vendors owe the Business. |
**Checks**
| Report | What it shows |
| :-- | :-- |
| **[Outstanding Checks](/bookkeeping/reports/outstandingchecks)** | Checks the Business has written that the bank hasn't paid. |
| **[Undeposited Checks](/bookkeeping/reports/undepositedchecks)** | Checks the Business has received that haven't been deposited. |
**Tax and mileage**
| Report | What it shows |
| :-- | :-- |
| **[GST/HST Summary](/api-reference/reports/retrieve-the-gsthst-summary-report)** | GST/HST collected, input tax credits and the net amount, for Canadian Businesses. |
| **[Mileage Deduction](/bookkeeping/reports/mileage)** | Business and personal distance, and the deduction for business trips. |
## **What every report has in common** [#what-every-report-has-in-common]
- **Scope.** Every report needs the `report:read` scope.
- **Currency.** Reports are in the Business' home currency. See Multicurrency.
- **Periods use an exclusive end.** Reports take a `start_datetime`, which is inclusive, and an `end_datetime`, which is **exclusive**. To include a whole day, send midnight at the start of the next day. For a period ending March 31, send `end_datetime=2026-04-01T00:00:00Z`. A time without a time zone is read as UTC. The Balance Sheet and Trial Balance, which are as of a moment in time, take only an `end_datetime`.
- **Basis.** The Profit and Loss, Cash Flow, Balance Sheet, Trial Balance, Ledger Statement and GST/HST Summary reports take a `basis` of `modified_cash`, the default, or `accrual`.
- **Periods.** The Profit and Loss and Cash Flow reports take a `period` of `month`, `quarter`, `year` or `all`, the default. The response then has one entry for each period.
- **Spreadsheets.** The Profit and Loss, Cash Flow, Balance Sheet, Trial Balance, General Ledger and Mileage reports can be returned as a spreadsheet. Send an `Accept` header of `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Customer Credit Balance Report (/bookkeeping/reports/customercredit)
## **Overview** [#overview]
The **Customer Credit Balance Report** shows all outstanding credits a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) owes its customers.
Customer credits are created when a payment exceeds the balance of an Invoice, when a Credit Memo is issued, or when a Refund is given as a **credit** rather than cash. These credits can later be applied to Invoices.
Key components, for each customer and currency:
* **Total Credits** – The total dollar value of credits issued to a customer.
* **Total Applied Credits** – The portion of credits already used against Invoices.
* **Total Available Credits** – The remaining credits that can still be applied.
This report helps Businesses track liabilities to customers and ensure credits are properly managed and applied. For the credit vendors owe the Business, see the [Vendor Credit Balance Report](/bookkeeping/reports/vendorcredit).
---
## **How to Generate a Customer Credit Balance Report** [#how-to-generate-a-customer-credit-balance-report]
1. Call the [Retrieve the Customer Credit Balance Report](/api-reference/reports/retrieve-the-customer-credit-balance-report) endpoint with:
* **Business ID**
2. Use the response to present customer-level credit balances. Each line has:
* **customer_id** – Unique identifier for the customer.
* **customer_name** – Display name of the customer.
* **currency** – The currency the amounts are in. A customer with credit in two currencies has two lines, because credit can only be applied to an Invoice in the same currency.
* **total_credits** – Value of all credits ever issued to this customer.
* **total_applied_credits** – Credits already applied to Invoices.
* **total_available_credits** – Credits still available to be applied.
---
## **Customer Credit Report Use Cases** [#customer-credit-report-use-cases]
* **Highlight Available Credits** – The `total_available_credits` field represents actionable credits that can be applied to reduce what a customer owes.
* **Apply to Invoices** – Credits are applied to an Invoice after it exists, using [Apply a Payment to an Invoice](/api-reference/invoice/apply-a-payment-to-an-invoice) without a `transaction_id`. Asset uses the oldest credit first.
* **Monitor Liability Exposure** – Credits represent an obligation of the Business. Regularly reviewing this report ensures liabilities to customers are properly accounted for.
---
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# General Ledger (/bookkeeping/reports/generalledger)
## **Overview** [#overview]
The **General Ledger** is the complete record of every entry in a [Business's](/getstarted/CoreConcepts#businesses-your-smb-customers) books for a period, grouped by [Ledger](/getstarted/CoreConcepts#ledgers). For each Ledger it lists the lines posted to it, in date order, with a running balance.
It is the full version of the [Ledger Statement](/bookkeeping/reports/ledgerstatement). The Ledger Statement shows one Ledger at a time. The General Ledger shows all of them at once, which is what an accountant or an auditor usually asks for.
## **How to Generate a General Ledger** [#how-to-generate-a-general-ledger]
Call [Retrieve the General Ledger Report](/api-reference/reports/retrieve-the-general-ledger-report) with:
| Parameter | Description |
| :-- | :-- |
| `start_datetime` | Required. The start of the period, inclusive, in ISO-8601 format. |
| `end_datetime` | Required. The end of the period, **exclusive**. To include a whole day, send midnight at the start of the next day, such as `2026-04-01T00:00:00Z` for a period ending March 31. |
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/reports/general-ledger?start_datetime=2026-01-01T00:00:00Z&end_datetime=2026-04-01T00:00:00Z" \
--header 'Authorization: Bearer '
```
The report needs the `report:read` scope.
## **What the report returns** [#what-the-report-returns]
The response has a list of `ledgers` and a `data_truncated` flag. Each entry in `ledgers` has the Ledger, and its lines:
| Field | Description |
| :-- | :-- |
| `ledger` | The Ledger's `id`, `name` and `sort_code`. |
| `lines` | The lines posted to the Ledger in the period, oldest first. |
Each line has:
| Field | Description |
| :-- | :-- |
| `date` | The date of the Journal Entry. |
| `journal_entry_id` | The [Journal Entry](/api-reference/schema/journal-entry) the line belongs to. |
| `memo` | The Journal Entry's description. |
| `split_ledgers` | The other Ledgers in the same Journal Entry, so you can see where the other side went. |
| `debit_credit` | Whether the line is a `debit` or a `credit`. |
| `amount` | The amount of the line. |
| `balance` | The Ledger's running balance after the line. It starts from the Ledger's balance at `start_datetime`, so it is correct even when the period doesn't begin at the start of the books. |
Only Ledgers with activity in the period appear. They are in the order of the Chart of Accounts.
**Large periods are cut off.** The report reads up to **10,000 Journal Entries**, oldest first. If the period has more, `data_truncated` is `true`, and the newest entries are missing. Shorten the period, for example one month at a time, to get everything.
## **General Ledger Best Practices** [#general-ledger-best-practices]
* **Check `data_truncated`.** Never present a truncated report as complete.
* **Use shorter periods for busy Businesses.** A month or a quarter keeps most Businesses under the limit.
* **Use the Ledger Statement for one Ledger.** It is paginated and is the better fit for an on-screen drill-down.
* **Export it.** Send an `Accept` header of `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` to receive the report as a spreadsheet.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Ledger Statement (/bookkeeping/reports/ledgerstatement)
## **Overview** [#overview]
A **Ledger Statement** provides a detailed view of the entries posted to one [Ledger](/getstarted/CoreConcepts#ledgers) over a given period, together with the Ledger's balances. It allows [Business Owners](/getstarted/CoreConcepts#businesses-your-smb-customers) to see what makes up a number on another report, helping them track spending patterns and identify unusual activity.
For example, if Operating Expenses are unexpectedly high, a Business Owner can review the Ledger Statement to pinpoint changes in spending and make informed decisions.
To see every Ledger at once, use the [General Ledger](/bookkeeping/reports/generalledger).
## **How to Generate a Ledger Statement** [#how-to-generate-a-ledger-statement]
Call [Retrieve the Ledger Statement Report](/api-reference/reports/retrieve-the-ledger-statement-report) for one Ledger. The Ledger ID goes in the path: `/v0/business/{business_id}/reports/ledger-statement/{ledger_id}`.
| Parameter | Description |
| :-- | :-- |
| `ledger_id` | Required, in the path. The Ledger to report on. |
| `start_datetime` | Required. The start of the period, inclusive, in ISO-8601 format. |
| `end_datetime` | Required. The end of the period, **exclusive**. For a period ending March 31, send `2026-04-01T00:00:00Z`. |
| `basis` | Optional. `modified_cash`, the default, or `accrual`. |
| `page_token`, `page_size` | Optional. The entries are paginated. |
The response has:
| Field | Description |
| :-- | :-- |
| `balances` | The Ledger's `all_time_balance`, its balance up to now, and its `range_balance`, the net movement in the period. When multicurrency is enabled it also has `original_currency_balances`, the same balances in each foreign currency the Ledger holds. |
| `entries` | The Journal Entries that touch the Ledger in the period, each with its description and its Line Entries. |
| `pagination` | The tokens for the next and previous pages. |
Use the returned data to show the entries made in that Ledger over the selected period.
## **Ledger Statement Best Practices** [#ledger-statement-best-practices]
* **Filter by date range** – Use a date picker with standard periods like months, quarters, and years to give users control. Remember that the end of the period is exclusive.
* **Page through the entries** – A busy Ledger has many entries. Follow the pagination tokens instead of assuming one response holds them all.
* **Enable drill-down into Transactions** – Users may want to inspect specific Transactions. Use the [Journal Entry endpoints](/api-reference/schema/journal-entry) to provide detailed transaction data.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Mileage Deduction Report (/bookkeeping/reports/mileage)
## **Overview** [#overview]
The **Mileage Deduction Report** totals the business and personal distance a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) drove in a period, and the deduction it can claim for the business trips. It is built from the Business' [trips](/api-reference/schema/trip).
Each business trip has an `amount`, worked out from the distance and the mileage rate in force on the trip's date. Personal trips have no deduction.
| Country | How the deduction is calculated |
| :-- | :-- |
| **United States** | A single flat rate for each unit of distance, set for the date of the trip. |
| **Canada** | Tiered rates. The first part of the year's distance is paid at one rate and the rest at a second one, so a trip's amount depends on the distance already driven that year. Trips in the northern territories use a higher set of rates. |
Each trip keeps the reason for its amount, in `amount_reason`, such as which rates were applied.
## **How to Generate a Mileage Deduction Report** [#how-to-generate-a-mileage-deduction-report]
Call Retrieve the Mileage Deduction Report (`GET /v0/business/{business_id}/reports/mileage`) with:
| Parameter | Description |
| :-- | :-- |
| `start_date` | Required. The first day of the period, inclusive, as `YYYY-MM-DD`. |
| `end_date` | Required. The last day of the period, **inclusive**, as `YYYY-MM-DD`. |
| `vehicle_id` | Optional. Limit the report to one vehicle. |
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/reports/mileage?start_date=2026-01-01&end_date=2026-12-31" \
--header 'Authorization: Bearer '
```
The report needs the `report:read` scope. Unlike most reports, its dates are plain dates and the end date is inclusive.
## **What the report returns** [#what-the-report-returns]
The response is a list with a single line for the whole period:
| Field | Description |
| :-- | :-- |
| `period` | `all`. |
| `total_amount` | The total deduction for the business trips. |
| `total_business_distance` | The distance driven on business trips. |
| `total_personal_distance` | The distance driven on personal trips. |
| `distance_unit` | `miles` or `kilometers`, taken from the trips. A period with no trips reports `miles`. |
## **Mileage Report Best Practices** [#mileage-report-best-practices]
* **Export the trips.** Send an `Accept` header of `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` to receive a spreadsheet. It adds the list of trips behind the totals, with each trip's date, vehicle, distance, purpose, amount, the reason for the amount, the addresses and any notes. This is what a Business keeps for its records.
* **Report one tax year at a time** for a Canadian Business, because the rates depend on the distance driven since the start of the year.
* **Filter by vehicle** to see how much each one contributes.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Outstanding Checks Report (/bookkeeping/reports/outstandingchecks)
## **Overview** [#overview]
The **Outstanding Checks Report** lists the checks a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) has written that the bank hasn't paid yet. A check is recorded in the books the day it is written, but the bank only takes the money out when the payee cashes it, so until then the books and the bank disagree by the amount of the check. See Checks.
A check is outstanding on a date when it was issued on or before that date and, by the end of the day, the bank hadn't paid it and it hadn't been voided.
This is the list Asset allows for when it compares the books with the bank's balance during reconciliation.
## **How to Generate an Outstanding Checks Report** [#how-to-generate-an-outstanding-checks-report]
Call [Retrieve the Outstanding Checks Report](/api-reference/reports/retrieve-the-outstanding-checks-report). It needs the `report:read` scope. Both parameters are optional:
| Parameter | Description |
| :-- | :-- |
| `as_of` | The date the report is as of, inclusive, as `YYYY-MM-DD`. Defaults to today. Pass a past date to see the list as it was then. |
| `external_account_id` | Limit the report to one bank account. |
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/reports/outstanding-checks?as_of=2026-09-30" \
--header 'Authorization: Bearer '
```
## **What the report returns** [#what-the-report-returns]
The response has the `as_of` date, a list of `accounts`, and `totals`.
Each account has:
| Field | Description |
| :-- | :-- |
| `external_account_id`, `external_account_name` | The bank account the checks were drawn on. |
| `currency` | The account's currency. |
| `checks` | The outstanding checks on the account, oldest first. |
| `total` | The total of the account's outstanding checks. |
Each check has its `check_id`, `check_number`, `issued_at`, `payee`, `vendor_id` if one was set, `amount`, and `days_outstanding`, the days from the issue date to the as-of date.
`totals` has one total per currency, since accounts in different currencies can't be added together.
## **Outstanding Checks Best Practices** [#outstanding-checks-best-practices]
* **Follow up on old checks.** Sort by `days_outstanding`. A check that has been outstanding for months may be lost, or may need to be voided and reissued.
* **Use it when a reconciliation doesn't balance.** Outstanding checks explain part of the gap between the bank and the books.
* **Show one account at a time** when the Business has several, using `external_account_id`.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Profit and Loss Report (/bookkeeping/reports/profitandloss)
## **Overview** [#overview]
The **Profit & Loss** (or Income Statement) summarizes a [Business’s](/getstarted/CoreConcepts#businesses-your-smb-customers) revenue and expenses over a specific period. It calculates net profit by subtracting expenses from revenue.
Key components:
* **Operating Revenue** – Money earned from Business operations, with **Total Income** as its total.
* **Cost of Sales** – Direct costs of producing goods or services.
* **Gross Profit** – Total Income minus Cost of Sales.
* **Operating Expenses** – Costs of running the Business (e.g., salaries, rent, utilities).
* **Total Operating Profit** – Gross Profit minus Operating Expenses.
* **Other Inflows** and **Other Outflows** – Income and costs outside normal operations, such as investment earnings or loan interest.
* **Net Profit** – The final profit or loss.
A Profit & Loss Report helps Businesses assess profitability and track financial performance over time.
## **How to Generate a Profit and Loss Report** [#how-to-generate-a-profit-and-loss-report]
Call [Retrieve the Profit and Loss Report](/api-reference/reports/retrieve-the-profit-&-loss-report) with:
| Parameter | Description |
| :-- | :-- |
| `start_datetime` | Required. The start of the period, inclusive, in ISO-8601 format. |
| `end_datetime` | Required. The end of the period, **exclusive**. For a period ending March 31, send `2026-04-01T00:00:00Z`. |
| `basis` | Optional. `modified_cash`, the default, or `accrual`. |
| `period` | Optional. `month`, `quarter`, `year` or `all`, the default. It splits the report into one block for each month, quarter or year. |
| `tags` | Optional. Limit the report to amounts allocated to [tags](/bookkeeping/tagging), as comma-separated `field:value` pairs such as `Job:Maple Street Remodel`. A report with several pairs covers any of them. |
| `vendor_id` | Optional. Limit the report to one Vendor's Bills, payments and credits. |
| `customer_id` | Optional. Limit the report to one Customer's Invoices, payments, credit memos and refunds. |
Use **only one** of `tags`, `vendor_id` and `customer_id` in a request.
The response has one entry for each period, each with a `period` label and its `records`. Each record is a line with a `name`, an `amount`, a `total_amount` that includes its children, and `children` for the Ledgers beneath it. Use the records to structure the report as follows:
1. **Operating Revenue**, with its Ledgers, and **Total Income**
2. **Cost of Sales**
3. **Gross Profit**
4. **Operating Expenses**
5. **Total Operating Profit**
6. **Other Inflows** and **Other Outflows**
7. **Foreign Currency Adjustments**, only for a Business with foreign-currency activity. It holds the **Realized Currency Gain/Loss** from settled payments and the **Unrealized Currency Gain/Loss**. See Multicurrency.
8. **Net Profit**
## **P\&L Best Practices** [#pl-best-practices]
* **Filter by date range** – Use a date picker with standard periods like months, quarters, and years to give users control. Remember that the end of the period is exclusive.
* **Use `period` to compare periods** – Request `month` or `quarter` to get a column for each in one call.
* **Hide zero-value [Ledgers](/getstarted/CoreConcepts#ledgers)** – Ledgers with a balance of $0 can appear in the response. Hiding them improves clarity.
* **Enable drill-down into ledgers** – Users may want to inspect specific ledgers. Use the [Ledger Statement](/bookkeeping/reports/ledgerstatement) report to provide detailed transaction data.
* **Export it** – Send an `Accept` header of `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` to receive the report as a spreadsheet.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Simple Cash Flow Report (/bookkeeping/reports/simplecashflow)
## **Overview** [#overview]
While traditional Cash Flow Statements are useful for investors and loan applications, most [SMB owners](/getstarted/CoreConcepts#businesses-your-smb-customers) struggle to interpret them. Asset’s **Simplified Cash Flow Report** provides a clearer, more actionable view of a Business’s cash movements over time.
This report helps Business owners quickly assess:
1. Start and End Cash Balances
2. Where cash entered the business (e.g., sales, loans)
3. Where cash left the business (e.g., expenses, loan payments)
Unlike the [Profit & Loss Report](/bookkeeping/reports/profitandloss), which includes non-cash items like depreciation, the Cash Flow Report focuses only on actual cash movements, giving a clear picture of financial liquidity.
## **How to Generate a Simplified Cash Flow Report** [#how-to-generate-a-simplified-cash-flow-report]
Call [Retrieve the Cash Flow Report](/api-reference/reports/retrieve-the-cash-flow-report) with:
| Parameter | Description |
| :-- | :-- |
| `start_datetime` | Required. The start of the period, inclusive, in ISO-8601 format. |
| `end_datetime` | Required. The end of the period, **exclusive**. For a period ending March 31, send `2026-04-01T00:00:00Z`. |
| `basis` | Optional. `modified_cash`, the default, or `accrual`. |
| `period` | Optional. `month`, `quarter`, `year` or `all`, the default. It splits the report into one block for each month, quarter or year. |
The response has one entry for each period. Each has a list of lines, with `children` for the accounts beneath them. Display them in this structure (backed by customer research for clarity):
1. **Starting Balances** – The cash the Business held at the start of the period, with each account beneath it.
2. **Cash Flow From Operations** – Cash in and out of the business from operating activities.
3. **Other Cash Flows** – Other movements, such as loans and interest payments.
4. **Effect of Exchange Rate Changes on Cash and Cash Equivalents** – Only for a Business that holds foreign currency. See Multicurrency.
5. **Ending Balances** – The cash the Business held at the end of the period.
6. **Net Change in Cash** – Ending Balances minus Starting Balances.
## **Cash Flow Best Practices** [#cash-flow-best-practices]
* **Filter by date range** – A date picker with standardized options (months, quarters, years) makes comparisons easy. Remember that the end of the period is exclusive.
* **Enable [Ledger](/getstarted/CoreConcepts#ledgers) drill-downs** – Users may want to explore details behind cash movements. Use the [Ledger Statement](/bookkeeping/reports/ledgerstatement) report to provide transaction-level data.
* **Export it** – Send an `Accept` header of `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` to receive the report as a spreadsheet.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Trial Balance (/bookkeeping/reports/trialbalance)
## **Overview** [#overview]
The **Trial Balance** lists every [Ledger](/getstarted/CoreConcepts#ledgers) of a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) with its balance at a point in time, split into a debit column and a credit column. Because every [Journal Entry](/getstarted/CoreConcepts#journal-entry) has equal debits and credits, the two columns add up to the same total. When they don't, something is wrong in the books.
It is the report an accountant starts from. It shows every account in one place, before it is arranged into the [Balance Sheet](/bookkeeping/reports/balancesheet) and the [Profit and Loss Report](/bookkeeping/reports/profitandloss).
## **How to Generate a Trial Balance** [#how-to-generate-a-trial-balance]
Call [Retrieve the Trial Balance Report](/api-reference/reports/retrieve-the-trial-balance-report) with:
| Parameter | Description |
| :-- | :-- |
| `end_datetime` | Required. The end of the period, **exclusive**, in ISO-8601 format. To include a whole day, send midnight at the start of the next day, such as `2026-04-01T00:00:00Z` for a period ending March 31. A time without a time zone is read as UTC. |
| `basis` | Optional. `modified_cash`, the default, or `accrual`. |
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/reports/trial-balance?end_datetime=2026-04-01T00:00:00Z" \
--header 'Authorization: Bearer '
```
The report needs the `report:read` scope.
## **What the report returns** [#what-the-report-returns]
The response is a list with one line per Ledger, in the order of the Chart of Accounts:
| Field | Description |
| :-- | :-- |
| `name` | The Ledger name. |
| `ledger_id`, `sort_code` | The Ledger it belongs to. |
| `ledger_type` | `asset`, `liability`, `equity`, `revenue` or `expense`. |
| `debit` | The balance if the Ledger carries a debit balance, otherwise `0`. |
| `credit` | The balance if the Ledger carries a credit balance, otherwise `0`. |
| `has_entries` | Whether the Ledger has any Journal Entries. |
Each Ledger appears in one column only. Total the `debit` values and the `credit` values to get the two column totals.
**Fiscal years.** Income and expense Ledgers show the **current fiscal year** only. Earlier fiscal years are rolled into Retained Earnings, the way a year-end close would, so the report balances without a closing entry.
**Foreign currency.** A Business with foreign-currency balances gets one extra line, **Unrealized Currency Gain/Loss**, with no `ledger_id`. It is calculated for the report and isn't posted. See Multicurrency.
## **Trial Balance Best Practices** [#trial-balance-best-practices]
* **Check that the columns match.** Total the debits and credits before relying on the report.
* **Hide Ledgers with `has_entries` set to `false`.** The report returns every Ledger, including ones that are never used.
* **Enable drill-downs.** Use the [Ledger Statement](/bookkeeping/reports/ledgerstatement) to show the entries behind a balance.
* **Export it.** Send an `Accept` header of `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` to receive the report as a spreadsheet.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Undeposited Checks Report (/bookkeeping/reports/undepositedchecks)
## **Overview** [#overview]
The **Undeposited Checks Report** lists the checks a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) has received but not yet deposited. A check someone hands the Business is recorded when it is received, on the Undeposited Funds account, and moves to the bank only when it is deposited. See Checks.
A check is undeposited on a date when it was received on or before that date and, by the end of the day, it hadn't been deposited, voided or returned. A check counts as deposited on the date of the bank Transaction matched to it.
## **How to Generate an Undeposited Checks Report** [#how-to-generate-an-undeposited-checks-report]
Call [Retrieve the Undeposited Checks Report](/api-reference/reports/retrieve-the-undeposited-checks-report). It needs the `report:read` scope and has one optional parameter:
| Parameter | Description |
| :-- | :-- |
| `as_of` | The date the report is as of, inclusive, as `YYYY-MM-DD`. Defaults to today. Pass a past date to see the list as it was then. |
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/reports/undeposited-checks?as_of=2026-09-30" \
--header 'Authorization: Bearer '
```
## **What the report returns** [#what-the-report-returns]
| Field | Description |
| :-- | :-- |
| `as_of` | The date the report is as of. |
| `currency` | The currency of the checks. |
| `checks` | The undeposited checks, oldest first. |
| `total` | The total of the undeposited checks. |
| `undeposited_funds_balance` | The balance of the Undeposited Funds Ledger at the end of the as-of date. |
| `difference` | `undeposited_funds_balance` minus `total`. It is zero when the Ledger is correct. |
Each check has its `received_check_id`, `check_number`, `received_at`, `payer`, `customer_id` if one was set, `amount`, the `invoice_ids` of the Invoices it pays, and `days_held`, the days from the received date to the as-of date.
## **Undeposited Checks Best Practices** [#undeposited-checks-best-practices]
* **Deposit promptly.** Sort by `days_held` to find checks that have been sitting too long.
* **Use `difference` as a check on the books.** When it isn't zero, the Undeposited Funds Ledger holds something other than the checks listed, such as a deposit that wasn't matched to its check.
* **Show the Invoices a check pays.** Use `invoice_ids` so the Business knows what a deposit will settle.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Vendor Credit Balance Report (/bookkeeping/reports/vendorcredit)
## **Overview** [#overview]
The **Vendor Credit Balance Report** shows the credits that Vendors have issued to a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers), and how much of each is still available to use. It is the counterpart of the [Customer Credit Balance Report](/bookkeeping/reports/customercredit).
A Vendor Credit is money a Vendor owes the Business, for example for returned goods or an overcharge. It can be applied to a future Bill to reduce what the Business has to pay.
Key components, for each Vendor and currency:
* **Total Credits** – The total value of the credits issued by the Vendor.
* **Total Applied Credits** – The part already applied to Bills.
* **Total Available Credits** – The part that can still be applied.
## **How to Generate a Vendor Credit Balance Report** [#how-to-generate-a-vendor-credit-balance-report]
Call Retrieve the Vendor Credit Balance Report (`GET /v0/business/{business_id}/reports/vendor-credits`) with the Business ID. It has no other parameters and needs the `report:read` scope.
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/reports/vendor-credits" \
--header 'Authorization: Bearer '
```
Each line of the response has:
| Field | Description |
| :-- | :-- |
| `vendor_id`, `vendor_name` | The Vendor. |
| `currency` | The currency the totals are in. A Vendor with credit in two currencies has two lines, because credit can only be applied to a Bill in the same currency. |
| `total_credits` | Credits issued by the Vendor. |
| `total_applied_credits` | Credits already applied to Bills. |
| `total_available_credits` | Credits still available. |
## **Vendor Credit Use Cases** [#vendor-credit-use-cases]
* **Show credit before paying a Bill.** `total_available_credits` is what can be applied. To use it, pay the Bill with Vendor Credit.
* **Track what vendors owe.** Credit is an amount owed to the Business, so reviewing the report keeps it from being forgotten.
* **Reconcile with the vendor.** Compare the report with the vendor's own statement.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Tagging (/bookkeeping/tagging)
### **Overview** [#overview]
Tags let you label [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) data with structured dimensions (for example **Job**, **Location**, or **Department**) so you can filter, report, and automate workflows consistently across entities.
Tagging works in three parts:
1. **Define tag fields**, the dimensions you want to tag by.
2. **Optionally define tag values**, a controlled list of values for a field.
3. **Set tags on entities** that support tagging, using each entity's **`tags`** field in the API.
---
### **Step 1: Create tag fields** [#step-1-create-tag-fields]
A **tag field** is the name of a dimension (for example `"Job"`). Tag fields fall into two scopes:
| Scope | What it means |
| :---------------------- | :------------------------------------------------------------------------------------------------------------------------- |
| **Global tag fields** | Created at the **tenant** level. Every business under the tenant can use these fields. |
| **Business tag fields** | Created for **one specific business**. Only that business uses them (for example a field that does not apply tenant-wide). |
A tag field's name has to be unique. A Business tag field can't have the same name as a global tag field or another of the Business' own fields.
**Global tag fields**
- [List global Tag Fields](/api-reference/tenant/list-global-tag-fields) — `GET /v0/tenant/tag-fields`
- [Create a global Tag Field](/api-reference/tenant/create-a-global-tag-field) — `POST /v0/tenant/tag-fields`
- [Update a global Tag Field](/api-reference/tenant/update-a-global-tag-field) — `PATCH /v0/tenant/tag-fields/{tag_field_id}`
- [Delete a global Tag Field](/api-reference/tenant/delete-a-global-tag-field) — `DELETE /v0/tenant/tag-fields/{tag_field_id}`
**Business tag fields**
- `POST /v0/business/{business_id}/tag-fields` creates a tag field for one Business.
- `PATCH /v0/business/{business_id}/tag-fields/{tag_field_id}` renames one. Global fields can't be changed here. Use the tenant endpoints.
**See the fields available to a Business**
- [List Tag Fields for a Business](/api-reference/tag/list-tag-fields-for-a-business) — `GET /v0/business/{business_id}/tag-fields`
It returns the global fields and the Business' own fields. Filter with `ids`, and add `includes=tag_values` to get each field's values in the same response.
The [Tag Field](/api-reference/schema/tag-field) object describes the shape returned by the API.
---
### **Step 2: Define tag values (optional)** [#step-2-define-tag-values-optional]
A **tag value** is one of the values a field can take, such as `"job-123"` or `"NYC"`. You don't have to create them first. When you tag an entity with a value that doesn't exist yet, Asset creates it for you. The **field** has to exist, though. Tagging with an unknown field is an error.
Create values yourself when you want a controlled list, for example the jobs your customer has open:
- [Create a Tag Value](/api-reference/tag/create-a-tag-value) — `POST /v0/business/{business_id}/tag-values`
- [List Tag Values for a Business](/api-reference/tag/list-tag-values-for-a-business) — `GET /v0/business/{business_id}/tag-values`
- [Get a Tag Value](/api-reference/tag/get-a-tag-value) — `GET /v0/business/{business_id}/tag-values/{tag_value_id}`
- [Update a Tag Value](/api-reference/tag/update-a-tag-value) — `PATCH /v0/business/{business_id}/tag-values/{tag_value_id}`
- [Delete a Tag Value](/api-reference/tag/delete-a-tag-value) — `DELETE /v0/business/{business_id}/tag-values/{tag_value_id}`
To retire a value, such as a finished job, update it with `"disable": true`. A disabled value is marked with `is_disabled`. You can bring it back with `"disable": false`.
The [Tag Value](/api-reference/schema/tag-value) object describes the shape returned by the API.
---
### **Step 3: Tag entities** [#step-3-tag-entities]
Once the field exists, set tags on an entity by sending a **`tags`** object when you create or update it. These entities support it:
| Entity | Where |
| :-- | :-- |
| [Transactions](/api-reference/transaction/create-transactions) | On create and update. |
| [Journal Entries](/api-reference/journal-entry/create-a-journal-entry) | On create. The tags apply to the Journal Entry's revenue and expense amounts. |
| [Invoices](/api-reference/invoice/create-an-invoice) | On create and update. |
| [Bills](/api-reference/bill/create-bills) | On create and update. |
| Refunds | On create. |
| Credit Memos | On create. |
Check the request schema for each endpoint. If it includes a **`tags`** property, you can use the patterns below.
**Simple tagging**
Keys are **tag field names** and values are **tag value names**:
```json
{
"Job": "job-123",
"Location": "NYC"
}
```
An entity takes one value per field this way, for the full amount.
**Splitting across values**
Sometimes one entity belongs to several values. Say a software license costs $500 for two locations, and you want to split the cost between them. Send a list of values, each with an `amount`:
```json
{
"Location": [
{ "value": "NYC", "amount": "300.00" },
{ "value": "LA", "amount": "200.00" }
]
}
```
The rules:
- **Amounts can't add up to more than the entity's amount.** A field that adds up to less is fine.
- **Leave all the amounts out to split evenly.** `[{"value": "NYC"}, {"value": "LA"}]` on a $500 entity gives each $250.
- **Don't mix.** Either give every value in a field an amount, or none.
- **List a value once.** Combine repeats into one.
**Pinning a value to a Ledger**
By default, a tag's amount is spread across the entity's revenue and expense [Ledgers](/getstarted/CoreConcepts#ledgers) in proportion. To attribute an amount to one Ledger instead, add its `ledger_id`:
```json
{
"Job": [
{ "value": "Maple Street Remodel", "amount": "3000.00", "ledger_id": "ldg_WQMDNUHpBThYSNh4AprDBo" },
{ "value": "Downtown Office Rewire", "amount": "1500.00", "ledger_id": "ldg_WQMDNUHpBThYSNh4AprDBo" }
]
}
```
- The Ledger has to be a revenue or expense Ledger of the Business. On an Invoice, a Bill or another document, it has to be a Ledger the document has a line on, and the pinned amounts can't total more than that Ledger's lines.
- A pinned value needs an explicit `amount`.
- A field's values are either **all pinned or all unpinned**.
- One value can appear several times in a field, once for each Ledger.
---
### **Changing and removing tags** [#changing-and-removing-tags]
On an update, `tags` is **merged** into the entity's tags. This applies to Transactions, Invoices and Bills:
| You send | What happens |
| :-- | :-- |
| A field with a string, `"Job": "job-123"` | Replaces all of that field's values with that one value. |
| A field with a list of values | Replaces all of that field's values with that list. |
| A field set to `null`, or an empty list | Removes all of that field's values. |
| A field you leave out | Stays as it was. |
```json
{
"Location": "NYC",
"Department": null
}
```
---
### **Automatic tagging** [#automatic-tagging]
You don't have to tag everything by hand. Asset tags a new Transaction automatically when it matches one of the Business' classification rules that sets tags. For each tag field, the first matching rule that sets it wins, so a later rule can fill in fields an earlier one left empty.
Automatic tagging skips personal Transactions and Transactions dated before the Business' start date.
---
### **Using tags in reports** [#using-tags-in-reports]
Tags are what make reports answer questions like "what did this job cost?". The [Profit and Loss Report](/bookkeeping/reports/profitandloss) takes a `tags` filter with comma-separated `field:value` pairs, such as `Job:Maple Street Remodel,Job:Downtown Office Rewire`. The report then covers the amounts tagged with any of them.
---
### **Scopes** [#scopes]
| Task | Scope |
| :-- | :-- |
| Create tag fields and tag values | `tag:create` |
| List or get tag fields and tag values | `tag:read` |
| Update tag fields and tag values | `tag:update` |
| Delete tag fields and tag values | `tag:delete` |
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Tasks & Notifications (/bookkeeping/tasks)
## **Tasks** [#tasks]
A **Task** is a specific action that has to happen before a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers)' books can be finalized, such as categorizing a Transaction, uploading a receipt or reconnecting a bank account. Asset creates many Tasks itself, and you can create others through the API.
Every Task has:
| Field | Description |
| :---------------------------------------- | :------------------------------------------------------------------------------------ |
| `task_type` | What the Task asks for. See [Task types](#task-types). |
| `status` | `pending` or `completed`. |
| `resolver` | Who is responsible for resolving it. See [Who resolves a Task](#who-resolves-a-task). |
| `description` | A short text to show the person who has to act. |
| `month` | The month of the books the Task belongs to, as `YYYY-MM`, when it has one. |
| `metadata` | Extra details that depend on the type, such as the reason a statement was requested. |
| `first_requested_at`, `last_requested_at` | When the Business was first and last asked for the Task. See [Requests](#requests). |
### **Task types** [#task-types]
| Type | What it asks for | Created |
| :--------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Transaction Categorization** (`categorize_transaction`) | The Business Owner to review and categorize a Transaction. | By Asset, when a Transaction's Journal Entry needs the Owner's review. It is completed when that review is no longer waiting on the Owner. You can also create one through the API. |
| **Review Personal Transactions** (`review_personal_transaction`) | The Owner to mark which Transactions in a [Personal Account](/bookkeeping/personaltransactions) are business-related. | Through the API only. The Business must have a personal account, or the call returns a 404. |
| **Reconnect Bank Account** (`reconnect_account`) | The Owner to reconnect an account. When a bank disconnects from Plaid, new Transactions stop syncing until the Owner goes through the Plaid Reconnect Flow. | By Asset, when a Plaid connection expires. You can also create one through the API. |
| **Receipt Request** (`request_receipt`) | A receipt for a Transaction. | By Asset, for Transactions that need a receipt, when automatic receipt requests are on. You can also create one through the API. Uploading a receipt for the Task completes it. |
| **Statement** (`request_statement`) | A bank statement for an account and month. | By Asset, when a statement is needed for a manual account, or to reconcile a month where the balances don't agree. In that case the Task's `metadata` carries `"reason": "balance_mismatch"`. You can also create one through the API. It is completed once the statement has been read. |
| **Payroll** (`request_payroll`) | The payroll documents for a month. | Through the API only. |
| **Other Document** (`request_other_document`) | Any other document needed to complete the books or answer a specific question. | Through the API only. |
| **Other** (`other`) | A general Task that doesn't fit the types above. | Through the API only. |
| **Review Transactions** (`review_transactions`) | The Owner to review a month's Transactions, for a Business whose books are kept by the Owner. | By Asset. |
| **Reconciliation** (`reconciliation`) | A bookkeeper to reconcile an account for a month that couldn't be reconciled automatically. | By Asset. |
The last two are created and managed by Asset. They appear in the Task list, but you can't create them through the API.
### **Who resolves a Task** [#who-resolves-a-task]
The `resolver` says who has to act:
- **`business`**: the Business Owner. Most Tasks are for the Owner.
- **`bookkeeper`**: a bookkeeper. A Reconciliation Task is handed to one when a month can't be reconciled automatically.
- **`agent`**: Asset is working on it in the background. These are not shown to the Business.
The Task list returns the Tasks for the `business` and the `bookkeeper`.
### **Working with Tasks** [#working-with-tasks]
#### Listing Tasks [#listing-tasks]
Use [Get all Tasks for a Business](/api-reference/request/get-all-tasks-for-a-business). It returns **pending** Tasks by default, together with a count for each Task type. Pass `status=completed` to see completed Tasks, and one or more `task_type` values to narrow the list. The result is paginated.
#### Creating a Task [#creating-a-task]
Use [Create a Task for a Business](/api-reference/request/create-a-task-for-a-business). Send a `description` and a `task_type`, plus what the type needs:
| Task type | Required |
| :------------------ | :-------------------------------- |
| `request_receipt` | `transaction_id` |
| `request_statement` | `external_account_id` and `month` |
| `request_payroll` | `month` |
You can create `categorize_transaction`, `review_personal_transaction`, `reconnect_account`, `request_receipt`, `request_statement`, `request_payroll`, `request_other_document` and `other` Tasks.
Only one pending Task of the same type can exist on a Transaction. A second one returns a 409.
A Receipt Request you create yourself is marked `"requested_manually": true`
in its `metadata`.
#### Updating and deleting a Task [#updating-and-deleting-a-task]
[Update a Task for a Business](/api-reference/request/update-a-task-for-a-business) changes a Task's `description` or `status`. To close a Task yourself, set its `status` to `completed`.
[Delete a Task for a Business](/api-reference/request/delete-a-task-for-a-business) removes a Task. Only a pending Task can be deleted. Deleting a completed one returns a 409.
## **Notifications** [#notifications]
Tasks are created as things happen, such as a Transaction being imported or a connection expiring, and a Business may get several at once. Asset therefore doesn't notify anyone every time a Task is created. Notifications are sent in these ways instead.
### **Requests** [#requests]
**Requesting** Tasks is what tells the Business that they have work to do. Asset records it on each Task as `first_requested_at` and `last_requested_at`, and sends a `TASK_REQUEST` webhook to you.
- Asset requests the Receipt Requests it raises as it raises them.
- You request other Tasks yourself with `POST /v0/business/{business_id}/request`, sending the IDs of the Tasks. It needs the `request:create` scope. Use it to decide when, and how often, a Business is notified.
The `TASK_REQUEST` webhook has the `business_id` and the `task_types` that were requested. Use it to tell the Business in your own app, by email or by push notification.
### **Tasks completed** [#tasks-completed]
When the last pending Task for a Business is completed, or removed because it is no longer needed, Asset sends a `TASKS_REQUEST_COMPLETED` webhook with the `business_id` and a `timestamp`. Only Tasks that the Business or a bookkeeper has to resolve count. A Task Asset is working on in the background doesn't hold it back.
### **Text messages** [#text-messages]
If the [SMS integraiton](/messaging/sms) is enabled, Asset will send text messages to the Business Owner requesting information needed to complete the bokos. This is separate from the webhooks, and the owner can reply to it with the necessary information.
# Year-End Package (/bookkeeping/yearend)
### **Overview** [#overview]
At the end of the year, a [Business's](/getstarted/CoreConcepts#businesses-your-smb-customers) owner needs to hand their books to a CPA to file taxes. The **Year-End Package** is a single spreadsheet with everything the CPA asks for, produced in one call:
| Sheet | What it has |
| :---------------------------- | :---------------------------------------------------------------------- |
| **Introduction** | A cover page with the Business' name and the period the package covers. |
| **Balance Sheet** | What the Business owns and owes at the end of the period. |
| **Trial Balance** | The debit and credit balance of every Ledger at the end of the period. |
| **Profit and Loss** | Income and expenses for the period. |
| **General Ledger** | Every entry in the period, grouped by Ledger. |
| **Adjusting Journal Entries** | A blank template for the adjustments the CPA wants to make. |
The first four financial sheets are the same reports you can get one by one. See [Balance Sheet](/bookkeeping/reports/balancesheet), [Trial Balance](/bookkeeping/reports/trialbalance), [Profit and Loss](/bookkeeping/reports/profitandloss) and [General Ledger](/bookkeeping/reports/generalledger). The package puts them in one file, so the Business doesn't have to export and assemble them.
### **How to generate the package** [#how-to-generate-the-package]
Call `GET /v0/business/{business_id}/reports/year-end` with:
| Parameter | Description |
| :--------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `start_datetime` | Required. The start of the period, inclusive, in ISO-8601 format. |
| `end_datetime` | Required. The end of the period, **exclusive**. To include the whole of December 31, send midnight at the start of the next day, such as `2027-01-01T00:00:00Z`. |
| `basis` | Optional. `modified_cash` (the default) or `accrual`. |
| `period` | Optional. How the Profit and Loss is split into columns: `month`, `quarter`, `year` or `all` (the default). |
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/reports/year-end?start_datetime=2026-01-01T00:00:00Z&end_datetime=2027-01-01T00:00:00Z&basis=accrual&period=month" \
--header 'Authorization: Bearer ' \
--header 'Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' \
--output year-end-2026.xlsx
```
The response is the spreadsheet itself, not JSON. Save the body as an `.xlsx` file. The package needs the `report:read` scope.
### **What is in each sheet** [#what-is-in-each-sheet]
**Introduction.** The Business' name and a title such as _January 2026 - December 2026 Year-End Financial Package_. The end date is shown as the last day included, so an exclusive `end_datetime` of `2027-01-01` reads as December 2026.
**Balance Sheet and Trial Balance.** Both are as of the end of the period, on the `basis` you chose. Income and expense Ledgers show the **current fiscal year** only. Earlier fiscal years are rolled into Retained Earnings, so the sheets balance without a closing entry. The trial balance leaves out Ledgers with no balance and no activity, and totals the debit and credit columns so the CPA can see that they match.
**Profit and Loss.** The period's income and expenses. With `period=all` it is one column. With `period=month` or `quarter` it has a column for each, which is useful for a CPA who wants to see the year's shape. Ledgers with no activity are left out.
**General Ledger.** Every entry in the period, grouped by Ledger, with a running balance. It reads up to 10,000 Journal Entries, oldest first. If the period has more, the sheet carries a warning with the latest date it reached, and the entries after that are missing. See [General Ledger](/bookkeeping/reports/generalledger).
**Adjusting Journal Entries.** A blank table for the CPA, with columns for the adjustment number, posting date, account name, debit, credit, a rationale and the author. It is empty so tax adjustments can be proposed in one place and then booked by the bookkeeper. Asset doesn't fill it in or read it back.
### **Before you generate it** [#before-you-generate-it]
The package is only as good as the books behind it. A CPA will stop at the first number that looks wrong, so check these first:
- **Books are caught up.** Every [Transaction](/bookkeeping/categorization) for the year is categorized, and bank accounts are [reconciled](/bookkeeping/autoreconciliation) through December.
- **Open [Tasks](/bookkeeping/tasks) are resolved.** Anything still waiting on the Business, such as a missing receipt or an uncategorized transaction, changes the numbers when it is answered.
- **Use the right period.** For a Business whose fiscal year isn't the calendar year, send its fiscal year, such as `2026-04-01` to `2027-04-01`.
- **Pick the basis the CPA files on.** `modified_cash` shows income and expenses when they are paid. `accrual` shows them when they are issued. Ask the CPA which they expect.
- **Generate it again after changes.** The package is built on request from the books as they are at that moment. A package downloaded in January is out of date if the books are corrected in February.
### **What the package doesn't include** [#what-the-package-doesnt-include]
- **A cash flow statement.** Use the [Cash Flow Report](/bookkeeping/reports/simplecashflow) if the CPA asks for one.
- **Tax-specific reports.** [Canadian GST/HST](/bookkeeping/gsthst) returns and [mileage](/bookkeeping/mileagetracking) deductions are separate. Send them with the package when the Business needs them.
- **Supporting documents.** Receipts, invoices and bills stay attached to their Transactions. The package has the figures, and the CPA can ask for the documents behind any line.
- **A closing entry.** Retained Earnings are calculated for the report, and no entry is posted to the books. For partnerships and LLCs, any year-end close beyond that is made by the bookkeeper as a Journal Entry, often from the CPA's adjustments.
### **Year-End Package best practices** [#year-end-package-best-practices]
- **Give the CPA the spreadsheet as it is.** The sheets are formatted for review, and the trial balance totals use formulas.
- **Check the General Ledger warning.** If the period was cut off, generate the General Ledger separately in smaller periods and send it with the package.
- **Book the adjustments, then regenerate.** After the CPA's adjusting entries are posted, generate the package again so the final statements reflect them.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Embed the UI (/embedded/embed-the-ui)
This guide continues from the [overview](/embedded/overview). You need your OAuth credentials and the ID of a demo Business, which the [Quickstart](/getstarted/quickstart) shows how to create.
By the end of this guide you will have an Asset component rendering live data from a demo Business in your app. The examples use Next.js (App Router), but the steps work in any React framework. The only Asset-specific pieces are a server endpoint that mints tokens and a provider that wraps your components.
## **Step 1: Install the packages** [#step-1-install-the-packages]
```bash
npm install @get-asset/sdk @get-asset/react
```
`@get-asset/sdk` provides the `AssetProvider`, and `@get-asset/react` provides the styled components. Both are public on npm, so no extra registry setup is needed.
## **Step 2: Add your credentials** [#step-2-add-your-credentials]
Create `.env.local` in your project root:
```bash
# Server-only: never prefix these with NEXT_PUBLIC_
ASSET_CLIENT_ID=your_client_id
ASSET_CLIENT_SECRET=your_client_secret
# Use the sandbox while you build
NEXT_PUBLIC_ASSET_API_URL=https://api.sandbox.getasset.com
# The demo Business you created
NEXT_PUBLIC_ASSET_BUSINESS_ID=biz_xxxxxxxxxxxxxxxxxxxx
```
The API URL already includes `https://`. Next.js only reads `.env.local` at startup, so restart your dev server after editing it.
## **Step 3: Create a token endpoint** [#step-3-create-a-token-endpoint]
This route runs on your server and trades your credentials for an access token for one Business. Call the [Get an Access Token](/api-reference/authentication/get-an-access-token) endpoint, passing the Business and the scopes the token may use.
```ts
// app/api/asset-token/route.ts
export async function POST(req: Request) {
const { business_id, scope } = await req.json();
const body = new URLSearchParams({
client_id: process.env.ASSET_CLIENT_ID!,
client_secret: process.env.ASSET_CLIENT_SECRET!,
grant_type: "client_credentials",
scope,
});
// Leave it out when there is no Business yet, such as during onboarding
if (business_id) body.set("business_id", business_id);
const res = await fetch(
`${process.env.NEXT_PUBLIC_ASSET_API_URL}/v0/auth/token`,
{
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body,
},
);
if (!res.ok) {
console.error("Asset token request failed:", res.status, await res.text());
return Response.json({ error: "token_request_failed" }, { status: 502 });
}
const { access_token } = await res.json();
return Response.json({ access_token });
}
```
This version trusts `business_id` and `scope` from the request, which is fine
for a sandbox demo. Before you go to production, read the Business from your
customer's session and choose the scopes on the server. Otherwise any visitor
can request a token for any Business. See [Keep the Business ID on your
server](/bookkeeping/businesses#keep-the-business-id-on-your-server).
## **Step 4: Wrap your app with the AssetProvider** [#step-4-wrap-your-app-with-the-assetprovider]
The `AssetProvider` gives every Asset component below it the Business and a way to get tokens.
```tsx
// app/dashboard/layout.tsx
"use client";
import { AssetProvider } from "@get-asset/sdk";
const BUSINESS_ID = process.env.NEXT_PUBLIC_ASSET_BUSINESS_ID!;
async function fetchAccessToken() {
const res = await fetch("/api/asset-token", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
business_id: BUSINESS_ID,
scope: "report:read business:read",
}),
});
return (await res.json()).access_token;
}
export default function DashboardLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
{children}
);
}
```
A few details that matter:
- **Pass a function, not a token.** The provider calls `accessToken` whenever it needs a token and asks for a new one shortly before the current one expires, or after a request fails with a 401. Define the function once, outside your component, so it stays the same between renders.
- **Set `baseUrl`.** It defaults to the production API, so a sandbox integration must pass it.
- **Keep the scope narrow.** A token can only do what its scopes allow. The revenue card in the next step only reads reports and the Business, so that is all it asks for.
## **Step 5: Add your first component** [#step-5-add-your-first-component]
```tsx
// app/dashboard/page.tsx
"use client";
import { AssetRevenueCard } from "@get-asset/react";
import "@get-asset/react/theme.css";
import "@get-asset/react/styles.css";
export default function DashboardPage() {
return ;
}
```
Both CSS imports are required, or the component renders unstyled. The card fetches revenue for the current period and handles its own loading and error states.
## **Step 6: Run it** [#step-6-run-it]
```bash
npm run dev
```
Open `http://localhost:3000/dashboard`. You should see the revenue card with data from your demo Business.
If something isn't right:
| What you see | Likely cause |
| :------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------- |
| The card shows an error, and `/api/asset-token` returns `401` | The credentials are wrong, or belong to a different environment than the API URL |
| An error mentioning `https://https://` | The API URL has the scheme twice. It belongs in the variable only |
| The token request succeeds but the card still errors | The Business doesn't exist in this environment, or the token is missing a scope the component needs |
| The Business ID is `undefined` in the browser | The variable is missing the `NEXT_PUBLIC_` prefix, or the dev server wasn't restarted |
| The card renders but looks unstyled | One of the CSS imports is missing |
| Edited `.env.local` but nothing changed | Restart the dev server |
## **Next Steps** [#next-steps]
Now that one component works, see [Managing Businesses](/bookkeeping/businesses#self-onboarding) to let each of your customers create their own Business, and browse the [Components](/components/overview) for more to embed.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Embedded Overview (/embedded/overview)
## **What is Embedded?** [#what-is-embedded]
In the Embedded model, accounting lives inside your product. Your [Tenant](/getstarted/CoreConcepts#tenants-your-platform) platform uses the Asset API for the accounting logic and Asset's UI components for the screens, so your customers never leave your app.
Embedded is made of two parts, and you can use either one or both:
| Part | What it gives you | Package |
| :---------------- | :--------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------- |
| **API** | Every accounting feature, available to your backend or frontend. Use it to build any experience you want. | None, call the [API](/api-reference) directly |
| **UI components** | Ready-made screens (dashboards, reports, transactions, bank connections) that fetch their own data and handle loading, error and empty states. | `@get-asset/react`, built on `@get-asset/sdk` |
- `@get-asset/sdk` contains the headless primitives and API interactions, with no styling.
- `@get-asset/react` uses those primitives to provide styled components.
Most integrations use `@get-asset/react` and reach for the headless components only where they need full control over the markup. See [Components](/components/overview) for the full catalog.
## **How it fits together** [#how-it-fits-together]
Your backend holds your Asset credentials and hands short-lived access tokens to your frontend. The credentials never reach the browser.
1. **Your backend requests a token.** It calls the Asset API with your `client_id` and `client_secret`, and asks for a token for one [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) with only the scopes it needs.
2. **Your backend gives the token to your app.** Your frontend passes it to the `AssetProvider`.
3. **Components load their own data.** Every Asset component inside the `AssetProvider` uses the token to fetch and render what it needs. You don't write any data fetching.
If you only use the API, steps 1 and 2 are the whole integration: generate a token and use it to call the API from your backend or your frontend.
## **Environments** [#environments]
Every Tenant has a **sandbox** and a **production** environment, with separate credentials. Build against sandbox first.
| Environment | API URL |
| :---------- | :--------------------------------- |
| Sandbox | `https://api.sandbox.getasset.com` |
| Production | `https://api.getasset.com` |
Credentials and tokens only work in the environment they were created in. A
sandbox token is rejected by the production API, and the other way around.
## **Before you start** [#before-you-start]
You will need:
1. **OAuth credentials** (`client_id` and `client_secret`) for your environment. You can create them in the Tenant dashboard.
2. **A demo Business** in the sandbox. The [Quickstart](/getstarted/quickstart) shows how to create one. Keep its ID.
3. **A backend server** that can mint access tokens. A fully static site can't keep your secret safe.
4. **A React app** (React 18 or newer) to render the components.
## **Next Steps** [#next-steps]
Follow the guides in order:
1. [Embed the UI](/embedded/embed-the-ui): render your first Asset component, using the credentials and demo Business above.
2. [Managing Businesses](/bookkeeping/businesses#self-onboarding): when you go live, let each of your customers create their own Business.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Core Concepts (/getstarted/CoreConcepts)
### **Overview** [#overview]
The Asset API is infrastructure to build accounting software. It enables a company to easily offer accounting services to its customers. This page outlines key accounting terms and Asset specific definitions which will help you utilize our APIs.
## **Tenants \- Your Platform** [#tenants---your-platform]
A Tenant is Asset’s representation of our Customers: the company that is providing accounting features to their SMB customers. Tenants integrate with the Asset API and manage their [Businesses](#businesses-your-smb-customers).
## **Businesses \- Your SMB Customers** [#businesses---your-smb-customers]
A Business represents a business entity (SMB) in Asset. Each Business has its own profile, defining financial details, legal information, and authorized users. A Business has its own set of financial records within Asset (i.e. their “books”).
## **Ledgers** [#ledgers]
Ledgers represent the financial activity and value within a Business. Ledgers have one of five types:
* **Revenues** – Money earned.
* **Expenses** – Money spent.
* **Assets** – Resources owned by the Business.
* **Liabilities** – Debts or financial obligations owed by the Business.
* **Equity** – The residual value in the business liabilities are deducted from assets.
Each Business has a **Chart of Accounts**, a unique and complete set of Ledgers used to track financial activity. While no two Businesses are identical, standard accounting principles influence how accounts are structured. Asset provides a default Chart of Accounts to streamline setup, which can be customized as needed.
Asset supports **ledger subtypes** to further classify accounts based on standard accounting practices. For example, assets can be divided into current assets (e.g., cash, accounts receivable) and non-current assets (e.g., real estate, long-term investments).
## **Journal Entry** [#journal-entry]
A Journal Entry records the movement of value between **Ledgers**, consisting of two or more **Lines**. Each Journal Entry must be balanced, meaning total **debits** must equal total **credits**.
Journal Entries fall into two categories:
* **Cash Entries**: Transactions where money changes hands.
* **Accrual Entries**: Transactions where value is recorded before cash moves. Examples include:
* **Accounts Receivable**: A sale is recorded when an invoice is issued, even if payment hasn’t been received.
* **Depreciation**: A business records the decline in an asset’s value over time, even though no money is exchanged.
Asset supports both **cash and accrual accounting**, providing flexibility in how financial activity is tracked and reported.
Each Line in the Journal Entry has:
* **An amount** – The value being recorded.
* **Direction** – Debit (value added to a ledger) or Credit (value removed from a ledger).
* **Ledger** – The specific account affected by the transaction.
* **Date** \- The date the transaction occurs
#### **What are Debits and Credits?** [#what-are-debits-and-credits]
* **Debits** typically represent money going into something valuable (e.g., increasing cash, buying equipment, paying rent).
* **Credits** typically represent money going out or obligations increasing (e.g., decreasing cash, taking on a loan, earning revenue)
## **Transactions** [#transactions]
A Transaction represents a real-world financial activity, such as a payment, deposit, or expense, that occurs within a Business. Transactions contain key financial details, including amount, date, description, and account information. They may also include additional metadata, such as merchant details or payment methods, when available.
Transactions in Asset are imported via the API or through native data integrations with external financial systems. Each Transaction is categorized and recorded in the ledger for accurate financial tracking.
#### **Key Transaction Fields** [#key-transaction-fields]
* **Amount** – The monetary value of the transaction.
* **Date** – The date when the transaction occurred.
* **Description** – A brief summary of the transaction.
* **Account** – The source or destination ledger for the transaction.
#### **Transaction Integrity in Asset** [#transaction-integrity-in-asset]
Once a Transaction is posted in Asset, **it cannot be directly edited** by a Tenant. This ensures data integrity and auditability in the accounting system. Any necessary adjustments must be made through **adjusting Journal Entries**, preserving a clear financial record. If a Transaction is updated or deleted by the source (e.g. Plaid) the corresponding Journal Entry will be deleted and a new one created.
## **External Accounts** [#external-accounts]
In Asset, External Accounts are the origin of Transaction data, representing external financial sources where actual business activity occurs. The most common example is **bank accounts**, but other sources include payroll providers (e.g., Gusto) and merchant processors (e.g., Square). These External Accounts act as the entry point for financial transactions that flow into Asset
#### **Accounts Attributes in Asset** [#accounts-attributes-in-asset]
| Attribute | API Request Field | Description |
| :---- | :---- | :---- |
| Institution Name | institution\_name | The name of the financial institution (e.g., "Wells Fargo"). Set for accounts connected through Plaid, and read-only |
| Account Type | financial\_account\_type | Defines the type of financial account. Allowed values: *bank\_account*, *credit\_card, prepaid\_card, payments, payroll, loan, accounts\_receivable, accounts\_payable* |
| External Account Balance | external\_balance | The External Account balance as provided by the data source at the end of the reporting period. |
| Account Status | status | Whether the account is being tracked. Accepted values: *connected*, *disconnected*, *untracked*. Accounts that aren't *connected* are not synced. *untracked* pauses an account without disconnecting it |
| (Optional) Disconnected Date | disconnected\_at | The date the External Account was marked as disconnected. Transactions are not synced for it after this date |
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Use the docs with AI (/getstarted/ai)
Connect your AI assistant to the Asset docs MCP server, so it can search and read this documentation while it helps you build your integration.
The Asset docs have their own [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server. Connect it to Claude, Cursor, VS Code or any other MCP client, and your assistant can search these docs and read their pages while it helps you build, instead of relying on what it remembers.
```
https://docs.getasset.com/mcp
```
It needs no account or token, and it only serves the public documentation.
This server gives your assistant the **documentation**. To let it query a
business's accounting data, use [Asset's MCP server](/mcp/overview), at
`https://api.getasset.com/mcp`. You can connect both.
## **Tools** [#tools]
| Tool | What it does |
| :------------ | :--------------------------------------------------------------------------- |
| `search_docs` | Searches the guides, the API reference and the component docs, and returns the matching pages with excerpts. |
| `get_page` | Returns a page as markdown, from its URL or path (e.g. `/getstarted/quickstart`). |
## **Connecting from an AI client** [#connecting-from-an-ai-client]
### Claude Code [#claude-code]
```bash
claude mcp add --transport http asset-docs https://docs.getasset.com/mcp
```
### Claude [#claude]
In **Settings → Connectors**, choose **Add custom connector** and enter `https://docs.getasset.com/mcp`.
### Cursor [#cursor]
Add the server to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project-scoped):
```json
{
"mcpServers": {
"asset-docs": {
"url": "https://docs.getasset.com/mcp"
}
}
}
```
### VS Code [#vs-code]
Add the server to `.vscode/mcp.json`:
```json
{
"servers": {
"asset-docs": {
"type": "http",
"url": "https://docs.getasset.com/mcp"
}
}
}
```
## **Without MCP** [#without-mcp]
Every page is also available as markdown: add `.md` to its URL, like [`/getstarted/quickstart.md`](/getstarted/quickstart.md). [`/llms.txt`](/llms.txt) lists every page, and [`/llms-full.txt`](/llms-full.txt) has all of them in one file.
# Quickstart (/getstarted/quickstart)
## **Getting Started** [#getting-started]
To begin using the Asset API, follow these steps:
1. **Sign Up**: [Register for an Asset Tenant Account](https://www.getasset.com/get-in-touch) to obtain your API credentials.
2. **Obtain API Tokens**: After registration, retrieve your API Tokens from the Asset Tenant dashboard.
3. **Authentication**: Authenticate your application using the provided credentials.
## **Making Your First API Call** [#making-your-first-api-call]
Once authenticated, you can start making API requests. For instance, to [Create your first Business](/api-reference/business/create-a-business) in the sandbox. The token needs the `business:create` scope.
**Request:**
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"name": "Roofing Pros",
"entity_type": "c-corp",
"entries_start": "2025-01-01T00:00:00Z",
"fiscal_year": "01/01",
"external_id": "customer_1234"
}'
```
**Response:**
A successful request returns `201`, with the Business inside `data`:
```json
{
"data": {
"id": "biz_GA6EG2qFxA97NZHtxeLPUy",
"tenant_id": "ten_Vl1a3f7JlZ9pZ5hL2wNfLn",
"name": "Roofing Pros",
"entity_type": "c-corp",
"entries_start": "2025-01-01T00:00:00Z",
"fiscal_year": "01/01",
"external_id": "customer_1234",
"status": "active",
"plan": "managed"
}
}
```
The response has more fields than shown here.
## **Verify the Business** [#verify-the-business]
Check that the Business exists, and that you saved the right ID, by [retrieving it](/api-reference/business/retrieve-a-business). It needs the `business:read` scope.
```bash
curl --request GET \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy \
--header 'Authorization: Bearer '
```
You should get a `200` with the same Business. Check that `data.id` matches the ID you saved and that `data.external_id` is the one you sent.
## **Next Steps** [#next-steps]
Learn key accounting terms and Asset specific definitions which will help
you utilize our APIs
Explore our detailed API documentation
Learn how our Authentication works
Learn how to create your first Business in Asset
# Bank integrations (/importingdata/plaid)
Asset integrates with Plaid to securely access banking data from financial institutions in the U.S. and Canada. Leveraging Plaid is crucial for automating the collection of [Transaction](/getstarted/CoreConcepts#transactions) data from your [Businesses'](/getstarted/CoreConcepts#businesses-your-smb-customers). Plaid connections allow you to pull up to 24 months of historical Transactions and keep new Transactions synced automatically.
There are two ways to connect with Plaid in Asset:
1. Use Asset’s Plaid Connection
2. Use your own Plaid Connection
### How to use Asset’s Plaid Integration [#how-to-use-assets-plaid-integration]
If your platform doesn’t already have a Plaid integration, Asset makes it simple to connect to your Businesses' [bank accounts and credit cards](/getstarted/CoreConcepts#accounts). We take care of all the technical details for you.
1. **Add the Plaid Link Component**
Insert Asset’s Plaid Link component into your product. This component will securely connect to your Businesses’ accounts and guide them through granting read-only access to their financial data.
2. **Begin Importing Data**
After a Business grants access, Asset automatically ingests the Transaction data from Plaid and converts it into [Journal Entries](/getstarted/CoreConcepts#journal-entry).
### How to use your own Plaid Integration [#how-to-use-your-own-plaid-integration]
If your platform already has a Plaid integration, you can grant Asset access to your Businesses' Transaction data via a [Plaid Processor Token](https://plaid.com/docs/api/processors/). Here are the steps to do this:
1. **Obtain a Processor Token from Plaid**
Generate a Processor Token associated with the bank accounts you wish to share with Asset. Use [Processor/Token/Create](https://plaid.com/docs/api/processors/#processortokencreate) from Plaid’s APIs.
2. **Provide the Token to Asset**
Send the Processor Token to Asset through the secure API. This enables Asset to link your existing Plaid integration to its accounting tools.
3. **Confirm Connection**
Once the token is validated, Asset will begin ingesting Transaction data from your Businesses’ connections. Transactions are then automatically transformed into Journal Entries.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# QuickBooks import (/importingdata/quickbooks)
The QuickBooks import feature allows users to migrate their financial data from their QuickBooks
account to Asset, starting from 2 full fiscal years before the Business' entries start date.
### How to use Asset’s QuickBooks Integration [#how-to-use-assets-quickbooks-integration]
Within Asset's platform, click `Add Account` in the Business' account page,
and select `Connect QuickBooks Online`. You will be redirected to QuickBooks Online login page
to authorize Asset to access your account. Follow the instructions on the wizard until the
account is connected. **Note that it may take up to 20 minutes to complete the import.**
### What gets imported [#what-gets-imported]
- The QuickBooks chart of accounts are imported and matched to Asset's standard ledgers.
- Unmatched QuickBooks accounts are created as new Ledgers in Asset.
- Unused QuickBooks accounts are not imported.
- Accounts balances are also imported and consolidated at the end of the 2 full fiscal years.
- Open accrual objects like Invoices, Bills and Credits are also imported.
- QBO projects are converted to Tags and the corresponding entries are proplery tagged in Asset.
- All accounting entries from 2 full fiscal years to the business' entries start date.
### What happens after data is imported [#what-happens-after-data-is-imported]
Asset will ensure that bank accounts from QuickBooks are properly matched to connected accounts
in Asset. You can also perform this action within Asset from the chart of accounts page, by
selecting `Move Line Entries` for a Ledger, and following the instructions in the
wizard.
### How to delete a Business' QuickBooks data [#how-to-delete-a-business-quickbooks-data]
In case a user wants to remove their QuickBooks data, they can go to the Accounts page
in the Asset platform and remove the connection. This will remove all of the imported
data including accounting data, ledgers that are unused and the balances that where
created during the import.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# API Import (/importingdata/apiimport)
Use Asset’s [Create Transactions](/api-reference/transaction/create-transactions) endpoint to quickly add one or more new [Transactions](/getstarted/CoreConcepts#transactions) for a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers). This is especially useful when you need to capture Transactions that aren’t automatically retrieved via [Plaid](/importingdata/plaid), ensuring a complete record of money flowing in and out of accounts on a daily basis.
**How to Import Transactions**
**Call the [Create Transactions](/api-reference/transaction/create-transactions) Endpoint:** Make a POST request to the Create Transactions endpoint, including an array of Transaction objects and the Business ID. Each Transaction object should have:
* Description
* Transaction datetime (UTC ISO-8601)
* Amount
* transaction\_id
* external\_account\_id
* Metadata (optional)
**Automatic Journal Entries and [Categorization](/bookkeeping/categorization)**
After submission, Asset automatically:
1. Converts each Transaction into a [Journal Entry](/getstarted/CoreConcepts#journal-entry).
2. Categorizes the Journal Entry, unless the Transaction includes `line_items`. In that case Asset uses them as the categorization. Transactions on a personal account are not categorized until they are marked as business.
**Good to Know**
* You can send up to 100 Transactions per request.
* A Transaction with a `transaction_id` that already exists is rejected as a duplicate, and a Transaction dated before the Business' start date is rejected. Other Transactions in the same request are still imported, and the response lists each one that failed and why.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Profitability Reporting (/insights/profitability)
### **Overview** [#overview]
A [Business's](/getstarted/CoreConcepts#businesses-your-smb-customers) overall [Profit and Loss](/bookkeeping/reports/profitandloss) tells its owner whether the Business made money. It doesn't tell them **where**. A remodeler wants to know which jobs are profitable. A restaurant group wants to know which location is carrying the others. An agency wants to know which customers are worth keeping.
Asset answers these questions by filtering the Profit and Loss to one slice of the Business: **one job, one location, one customer, one vendor**, or any other dimension you define. This guide uses **job costing** as the example, then shows how the same approach covers everything else.
You have two tools:
| Tool | Use it for |
| :-------------------------------- | :------------------------------------------------------------------------------------------------------------------------ |
| **[Tags](/bookkeeping/tagging)** | Any dimension you define: job, project, location, department, region, sales rep. You decide the dimension and its values. |
| **`customer_id` and `vendor_id`** | Customers and vendors, which Asset already knows about. No tagging is needed. |
Both are filters on the same report, [Retrieve the Profit and Loss Report](/api-reference/reports/retrieve-the-profit-&-loss-report).
### **Job costing with tags** [#job-costing-with-tags]
Job costing means tracking the revenue and the costs of each job separately, so the Business knows what each one earned. With tags, a **job** is a value of a tag field called `Job`.
#### 1. Create a Job tag field [#1-create-a-job-tag-field]
Create the field once. Make it a **global** tag field if every Business under your tenant uses jobs, or a **Business** tag field if only one does. See [Tagging](/bookkeeping/tagging#step-1-create-tag-fields).
You can also create each job as a tag value, such as `Maple Street Remodel`, to keep a controlled list. Otherwise, a value is created the first time you tag something with it.
#### 2. Tag the money coming in and going out [#2-tag-the-money-coming-in-and-going-out]
Tag every [Invoice](/bookkeeping/ar), [Bill](/bookkeeping/ap) and Transaction that belongs to a job with the `tags` field. For example, an Invoice for the job:
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/invoice \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '[
{
"number": "INV-101",
"description": "Kitchen remodel, 14 Maple Street",
"sent_at": "2026-03-01T00:00:00Z",
"due_at": "2026-03-31T00:00:00Z",
"customer_external_id": "customer_8841",
"lines": [{ "description": "Remodel", "amount": 12000.00, "ledger_id": "ldg_ErisumsAc7qgmbTctM7zKK" }],
"tags": { "Job": "Maple Street Remodel" }
}
]'
```
Tag the costs the same way:
| What | How to tag it |
| :---------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Revenue** | The `tags` on the [Invoice](/api-reference/invoice/create-an-invoice). |
| **Materials and subcontractors** | The `tags` on the [Bill](/api-reference/bill/create-bills). |
| **Card and bank spending** | The `tags` on the [Transaction](/api-reference/transaction/create-transactions), when there is no Bill. |
| **One cost shared by several jobs** | A list of values with amounts. An $800 hardware store purchase can be `[{"value": "Maple Street Remodel", "amount": "500.00"}, {"value": "Downtown Office Rewire", "amount": "300.00"}]`. |
Asset can also tag Transactions on its own, using the Business' classification rules. See [Automatic tagging](/bookkeeping/tagging#automatic-tagging).
#### 3. Run the Profit and Loss for one job [#3-run-the-profit-and-loss-for-one-job]
Pass the job in the `tags` parameter, as `field:value`. Remember to encode the spaces in the URL.
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/reports/profit-and-loss?start_datetime=2026-01-01T00:00:00Z&end_datetime=2027-01-01T00:00:00Z&tags=Job:Maple%20Street%20Remodel" \
--header 'Authorization: Bearer '
```
The response has the same structure as the ordinary Profit and Loss, but it only includes the amounts tagged with that job. For the Invoice above, the $500 share of the hardware purchase and a $4,500 Bill for materials, once they are paid or when you pass `basis=accrual`, it looks like this:
| Line | Amount |
| :------------------------- | :-------- |
| **Total Income** | 12,000.00 |
| **Cost of Sales** | 5,000.00 |
| **Gross Profit** | 7,000.00 |
| **Total Operating Profit** | 7,000.00 |
That is the job's profit. Use the same call, with a different value, for each job. Use `period=month` to see how a long job's profit builds up month by month.
A tag that doesn't exist, whether the field or the value, returns an error instead of an empty report.
### **What the filtered report includes** [#what-the-filtered-report-includes]
- **Only tagged amounts.** Anything without the tag is left out, so the report is the profit of the tagged work, not of the Business. To see what hasn't been assigned to any job, compare the job reports with the Business' full Profit and Loss.
- **Revenue and expense Ledgers.** A tag spreads an amount across the Ledgers of the entry that make up profit. Balance sheet Ledgers aren't included. If a tagged amount should be attributed to a particular Ledger, such as a $500 purchase that is partly materials and partly fuel, [pin the value to a Ledger](/bookkeeping/tagging#step-3-tag-entities).
- **A tag follows the money.** A Bill or Invoice's tags are carried onto its Journal Entries, and onto the entries of each payment in proportion to what was paid. If a payment is tagged itself, the Transaction's tags win over the same tag on the document, so a job isn't counted twice.
- **Timing depends on the basis.** On the default `modified_cash` basis, a job's revenue and costs appear when the Invoice or Bill is **paid**, in proportion to the payment. To see them when they are issued, pass `basis=accrual`.
### **Beyond jobs** [#beyond-jobs]
The same report works for any way of cutting the Business.
| You want profit by | How |
| :-------------------------------------- | :----------------------------------------------------------------------------------------------------- |
| **Job or project** | A `Job` or `Project` tag field, as above. |
| **Location** | A `Location` tag field. Tag everything a branch earns and spends. |
| **Department or team** | A `Department` tag field. |
| **Region, class or sales rep** | A tag field with any name you choose. |
| **Customer** | `customer_id`. It covers the customer's Invoices, payments, Credit Memos and Refunds, with no tagging. |
| **Vendor** | `vendor_id`. It covers the vendor's Bills, payments and Vendor Credits. |
| **Customer and job, or any other pair** | Tag fields for both. Use a `Customer` tag field in place of `customer_id`. |
For example, to see what a customer is worth, add `customer_id=cus_WQMDNUHpBThYSNh4AprDBo` to the same request, and leave out `tags`.
#### Rules for combining filters [#rules-for-combining-filters]
- **`tags`, `customer_id` and `vendor_id` can't be used together.** Send only one in a request, or the call is rejected. To filter by a customer and something else, tag with a `Customer` field.
- **Several values in one field are OR.** `tags=Job:Maple Street Remodel,Job:Downtown Office Rewire` covers either job, and the amounts are added together. Use it to roll several jobs up into a program or a customer.
- **Different fields are AND.** `tags=Job:Maple Street Remodel,Location:NYC` covers entries tagged with **both** the job and the location.
- **List the field you want measured first.** When you filter by two fields, the amounts come from the **first** field's tags, and the second field only decides which entries count. If an entry splits its amount differently across the two fields, you get the first field's split.
### **Getting good results** [#getting-good-results]
- **Tag at the source.** Tag the Invoice or Bill, not each payment. The payment inherits the tags in proportion to what was paid.
- **Be consistent with names.** `Maple Street Remodel` and `Maple St Remodel` are two different values. Create the values first, or use classification rules, to avoid typos.
- **Tag costs as well as revenue.** A job with only revenue tagged will look more profitable than it is.
- **Split shared costs.** Overhead, equipment and vehicles are shared between jobs. Split them with amounts, so each job carries its share.
- **Reconcile to the whole.** The jobs' revenue and costs should add up to the Business' Profit and Loss, apart from what you haven't assigned. A gap points to untagged work.
- **One call for each value.** The report is filtered to one value at a time, or to a set of values added together. To compare jobs side by side, make a call for each one in your app.
---
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Trend Reporting (/insights/trends)
### **Overview** [#overview]
A single Profit and Loss tells a [Business's](/getstarted/CoreConcepts#businesses-your-smb-customers) owner what happened. A trend tells them **where things are heading**: whether sales are growing, whether margins are slipping, whether the cash balance is building or draining, and which months are strong or weak.
Asset doesn't have a separate trends endpoint. Trends come from the reports you already have, asked for in a way that returns a series instead of a single number:
| To see a trend in | Use |
| :-- | :-- |
| **Revenue, costs and profit** | The [Profit and Loss](/bookkeeping/reports/profitandloss) with `period`. |
| **Cash in, cash out and cash balance** | The [Cash Flow Report](/bookkeeping/reports/simplecashflow) with `period`. |
| **Assets, liabilities and equity** | The [Balance Sheet](/bookkeeping/reports/balancesheet), requested once for each date. |
Each of them can be narrowed to a job, a location, a customer or a vendor. See [Profitability Reporting](/insights/profitability).
---
### **Profit and loss by month, quarter or year** [#profit-and-loss-by-month-quarter-or-year]
Add the `period` parameter to the Profit and Loss request. It splits the range into one block for each month, quarter or year, so a single call returns the whole series.
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/reports/profit-and-loss?start_datetime=2026-01-01T00:00:00Z&end_datetime=2027-01-01T00:00:00Z&period=month" \
--header 'Authorization: Bearer '
```
| `period` | Returns |
| :-- | :-- |
| `month` | One block for each calendar month. |
| `quarter` | One block for each calendar quarter. |
| `year` | One block for each calendar year. |
| `all` | One block for the whole range. This is the default. |
The response is a list with one entry for each block, oldest first. Each has a `period` label and the usual `records`:
```json
{
"data": [
{ "period": "1/2026", "records": [ ... ] },
{ "period": "2/2026", "records": [ ... ] },
{ "period": "3/2026", "records": [ ... ] }
]
}
```
The labels are the month and the year for `month`, as in `3/2026`. For `quarter` they are the quarter and the year, so `1/2026` is January to March. For `year` they are just the year, `2026`.
Every block has the same lines, so you can read one line across the blocks to get its trend. To chart revenue, take **Total Income** from each block. For profit, take **Net Profit**.
#### Measures worth showing [#measures-worth-showing]
Compute these from the lines of each block:
| Measure | How |
| :-- | :-- |
| **Gross margin** | **Gross Profit** divided by **Total Income**. |
| **Net margin** | **Net Profit** divided by **Total Income**. |
| **Growth** | The change in **Total Income** from the previous block. |
| **A cost line as a share of revenue** | An **Operating Expenses** Ledger divided by **Total Income**. A rising share is an early warning. |
---
### **Cash flow by month** [#cash-flow-by-month]
The [Cash Flow Report](/bookkeeping/reports/simplecashflow) takes the same `period` parameter. Each block shows the cash at the start of the period, the cash that came in and went out, and the cash at the end:
- **Starting Balances** and **Ending Balances** give the cash balance over time.
- **Cash Flow From Operations** shows what the Business generates from running.
- **Net Change in Cash** shows whether cash grew or shrank in the period.
Plot **Ending Balances** to show the cash balance. When **Net Change in Cash** is negative for several months in a row, the balance is being drawn down, which is what an owner needs to know before it runs out.
---
### **Balance sheet over time** [#balance-sheet-over-time]
The [Balance Sheet](/bookkeeping/reports/balancesheet) is a snapshot as of one moment, and has no `period` parameter. To get a trend, request it for each date you want, with `end_datetime` set to the start of the next day or month. For month-end snapshots through a year:
| Snapshot | `end_datetime` |
| :-- | :-- |
| End of January | `2026-02-01T00:00:00Z` |
| End of February | `2026-03-01T00:00:00Z` |
| End of March | `2026-04-01T00:00:00Z` |
Read **Assets**, **Liabilities** and **Equity** from each response, or an item inside one, such as the receivables in **Current Assets**. A growing receivables balance with flat revenue means customers are paying more slowly.
Equity includes **Net Profit (Current Fiscal Year)**, which starts again when a new fiscal year begins. Expect equity to step at a year end.
---
### **Trends for one slice of the Business** [#trends-for-one-slice-of-the-business]
Add the same filters you use for a single report, and the trend is for that slice. The Profit and Loss accepts `tags`, `customer_id` and `vendor_id`. See [Profitability Reporting](/insights/profitability).
```bash
curl --request GET \
--url "https://api.sandbox.getasset.com/v0/business/biz_GA6EG2qFxA97NZHtxeLPUy/reports/profit-and-loss?start_datetime=2026-01-01T00:00:00Z&end_datetime=2027-01-01T00:00:00Z&period=month&customer_id=cus_WQMDNUHpBThYSNh4AprDBo" \
--header 'Authorization: Bearer '
```
That shows how much a customer is worth month by month. A `Location` tag shows how one branch is performing. The filters apply to the Profit and Loss only. The Cash Flow and Balance Sheet cover the whole Business.
---
### **Comparing periods** [#comparing-periods]
- **Month over month.** Take two consecutive blocks from one `period=month` call.
- **Year over year.** Request 24 months with `period=month`, then compare each month with the same month a year earlier. This shows seasonality, which a month-over-month comparison hides.
- **Year to date against last year.** Make two calls with the same `period=all` range, one for each year.
---
### **Things to watch for** [#things-to-watch-for]
- **Periods with no activity are missing.** A block is returned only for a period that has activity. If a month has none, it won't appear, so a chart needs to fill the gaps with zeros. In the Cash Flow Report, the next block starts from the closing balance of the last one shown.
- **Periods are calendar periods.** `year` means a calendar year, and `quarter` means January to March and so on, whatever the Business' fiscal year is. For a fiscal-year trend, request each fiscal year with `period=all`, one call for each year.
- **The first and last blocks can be partial.** A range that starts mid-month gives a short first month. Start on the first of the month, and end on the first of the next month, with an exclusive `end_datetime`.
- **Use the same `basis` throughout.** The default `modified_cash` shows revenue when it is paid. `accrual` shows it when it is issued. Switching between them changes the shape of the trend.
- **Time zones.** Dates are read as UTC unless they carry a time zone.
- **Export it.** Send an `Accept` header of `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` to receive the report as a spreadsheet.
---
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Email (/messaging/email)
### **Overview** [#overview]
Most of the documents a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) needs, such as receipts, statements, bills and invoices, already arrive by email. Asset has two ways to pick them up, so the owner doesn't have to download and upload them one by one:
| | **Forward to an inbox** | **Connect a mailbox** |
| :----------------------- | :-------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------ |
| **How it works** | The owner, or a rule in their mail app, forwards emails to a Business-specific address. | The owner connects their own Gmail or Outlook account, and Asset finds the documents in it. |
| **Who picks the emails** | The sender chooses what to forward. | Asset screens the mailbox and picks what looks like a document. |
| **Setup** | None on the mailbox. | One sign-in with the mail provider. |
| **Best for** | Occasional documents, or mail from several addresses. | An owner whose business mail all goes to one account. |
Either way, the documents become [Documents](/api-reference/schema/document) with the source `email`, and are processed like any other upload.
---
### **Forward to an inbox** [#forward-to-an-inbox]
Each Business has its own address. The owner forwards an email with documents attached to it, and Asset saves them against that Business.
Asset knows which Business an email is for by the Business ID in the address. It also finds it in the subject or the body of the email. An email that carries no Business ID, or a Business that doesn't exist, can't be filed.
**What Asset takes from the email**
- **Every attachment** becomes a Document.
- **The body of the email**, when it is HTML, can become a Document too. This catches receipts and order confirmations that are written into the email itself.
- **Images the email only links to** are excluded. Only what is in the email itself is used.
Asset reads unread emails, and attachments the Business already has are skipped as duplicates.
### **Connect a mailbox** [#connect-a-mailbox]
The owner connects their own Gmail or Microsoft (Outlook) account once. After that, Asset finds the accounting documents in their mail on its own.
#### Connecting [#connecting]
1. The owner starts the connection and is sent to a sign-in page for their mail provider.
2. They sign in and grant access.
3. Asset links the mailbox to the Business and starts its first sync.
The connection endpoints are internal to Asset and aren't part of the public API, so there is no call for you to make. A mailbox can be connected to more than one Business.
#### What Asset reads [#what-asset-reads]
The first sync reads mail back to the Business' **entries start date**, so older documents are picked up too. After that, Asset syncs shortly after new mail arrives.
For a connected mailbox, Asset uses the sender, subject, message preview and attachment list to identify accounting documents such as receipts, invoices, bills and statements. It downloads selected supported attachments and can capture an accounting document contained in the message body. Asset skips duplicates and excludes Drafts, Junk and Trash.
Attachments whose type isn't supported, or that are too large, are not imported.
#### Disconnecting [#disconnecting]
Disconnecting stops the sync. Documents already imported are kept. If no other Business uses the mailbox, Asset's access to it is revoked as well.
### **What happens to each document** [#what-happens-to-each-document]
Each document goes through the same processing as an upload. Asset works out what it is and handles it accordingly:
| Document | What Asset does |
| :------------------ | :---------------------------------------------------------------------------------------------------------------- |
| **Check image** | Reads it and records the check. See [Checks](/bookkeeping/checks). |
| **Receipt** | Reads it and tries to match it to a Transaction. |
| **Bank statement** | Reads it and checks the account's Transactions. |
| **Payroll reports** | Reads it and adds the necessary payroll adjustments. |
| **Invoices** | Reads it and creates the invoice and customer if needed. |
| **Bills** | Reads it and creates the bill and vendor if needed. |
Documents from a connected mailbox are processed sooner than documents
forwarded to the inbox. To have Asset process a document straight away, upload
it with [Upload Documents for a
Business](/api-reference/document/upload-documents-for-a-business), or connect
the mailbox. See [Bill Documents](/bookkeeping/billdocuments) and [Invoice
Documents](/bookkeeping/invoicedocuments).
The result is on the Document. Follow its `status`, and use the `DOCUMENT_PROCESSED` webhook to know when it finishes.
### **Which method should be use?d** [#which-method-should-be-used]
- **Connect a mailbox** when the owner's business mail goes to one account. Asset does the sorting, it covers bills and invoices, and the owner does nothing after the first sign-in.
- **Forward to an inbox** when the owner doesn't want to give access to a whole mailbox, or only a few emails matter. The owner decides exactly what is shared.
They work together. A file that arrives both ways is saved once, because identical files are skipped as duplicates.
---
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# SMS (/messaging/sms)
### **Overview** [#overview]
Asset uses text messages to reach a [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) owner where they already are, and to let them send things back without logging in. SMS is used for three things:
| Use | Direction | What happens |
| :---------------------------------------------- | :----------------- | :----------------------------------------------------- |
| **[Requests](#requests)** | Asset to the owner | Assets sends request for data it needs from the owner. |
| **[Document forwarding](#document-forwarding)** | The owner to Asset | The owner forwards the information to Asset . |
All run on the Business' phone number. A Business can have several phone numbers, and a number has to be **verified** before Asset will text it or accept documents from it.
### **Phone numbers** [#phone-numbers]
Add a number with `POST /v0/business/{business_id}/phone-numbers`. Asset texts a six-digit code to it, and the number counts as verified once the code is submitted with `POST /v0/business/{business_id}/phone-numbers/{phone_number_id}/verify`. A code expires after 10 minutes, and stops working after 5 wrong guesses. Ask for a new one with `.../verification-code`.
If your product has already confirmed the number, add it as verified and Asset sends no code.
Asset sends the texts from a US or a Canadian number, picked from the owner's area code.
### **Customer communication** [#customer-communication]
Asset sends the owner two kinds of message that aren't requests:
- **Verification codes**, when a phone number is added or a new code is requested.
- **An acknowledgement**, when the owner texts in a document: "We got your document and we're processing it. Thanks!" Asset sends it once. It is never resent, so a failed acknowledgement doesn't hold up the document.
#### Consent and opting out [#consent-and-opting-out]
Owners can opt out at any time by replying `STOP`, or one of the other standard stop words. From then on Asset sends nothing to that number. Replying `START` turns messages back on.
An opt-out belongs to the owner and overrides your settings. Turning notifications back on through the API does not undo it. Only the owner can, by replying `START`.
### **Receipt Requests** [#receipt-requests]
When a transaction needs a receipt, Asset creates a **Receipt Request** [Task](/bookkeeping/tasks) for the owner. Instead of waiting for the owner to open an app, Asset can text them about it.
Asset sends **one text a day**, and only on a day when new requests have arrived. A day with nothing new gets no text. It reports what came in since the last text, so an owner who ignores a request is not nagged about it again the next day.
> You have 3 new receipts to upload: $52.30 at Home Depot on Sep 5; $18.00 at Shell on Sep 6 and 1 more. Reply to this message with a photo of each receipt to upload them.
The text names up to two receipts, so the owner can tell which purchases it means, and counts the rest.
#### Turn it on [#turn-it-on]
Daily texts are opt-in. A Business gets them once it has an SMS notification profile:
`PATCH /v0/business/{business_id}/notifications/sms`
| Request Parameter | Description |
| :---------------- | :---------------------------------------------------------------------------------------------------------------- |
| phone_number_id | Required when you first set it up. One of the Business' own phone numbers. Texts go nowhere until it is verified. |
| is_enabled | Optional. Set to `false` to pause the texts without removing the profile. |
| send_at | Optional. The local time the text is sent. Defaults to 09:00. |
| timezone | Optional. The time zone `send_at` is in, as an IANA name such as `America/New_York`. |
The text goes out in the first hourly check at or after `send_at`, and Asset will still send a late one for up to three hours. `GET` on the same path returns the profile, and `DELETE` removes it, which turns the texts off.
### **Document forwarding** [#document-forwarding]
The owner can text a photo or file to Asset, and Asset treats it like an uploaded document. This is also how an owner answers a request: they reply to the daily text with a photo of the receipt.
1. **Asset recognizes the sender.** It matches the phone number the text came from to a Business with that number verified. If the number belongs to no Business, the message is ignored. If more than one Business has it, Asset uses the one verified most recently.
2. **Asset stores the attachments.** Each photo or file is saved, and the owner gets the acknowledgement.
3. **Asset ingests each one.** Every attachment becomes a [Document](/api-reference/schema/document) with the source `sms`, and goes through the same processing as one uploaded with [Upload Documents for a Business](/api-reference/document/upload-documents-for-a-business). Asset works out what kind of document it is, for example a receipt, a bank statement or a bill.
What to expect:
- **Several files in one text** are each ingested separately.
- **The same file sent twice** is ingested once. A file the Business has already uploaded by any route is skipped as a duplicate.
- **Files Asset can't use**, because the type isn't supported or the file is too large, are skipped. The other attachments in the same text are still processed.
- **The result is on the Document.** Follow its `status`, and use the `DOCUMENT_PROCESSED` webhook to know when it finishes.
Questions? Reach out via our [Contact
form](https://www.getasset.com/get-in-touch).
# Sign Users In (/whitelabel/magic-links)
You sign your customers in to the Asset app with **magic links**. Your backend asks Asset for a link, then sends the customer to it. This guide shows how to create the link, where it can take your customer, and what happens when a session ends.
Before you start, the customer's [Business](/getstarted/CoreConcepts#businesses-your-smb-customers) must exist and be active. See [Managing Businesses](/bookkeeping/businesses).
## **How signing in works** [#how-signing-in-works]
In the usual flow, your customer signs in to your platform first. When they click the button to open accounting, your platform asks Asset for a magic link and sends them to it.
```mermaid
sequenceDiagram
actor User
participant Tenant as Tenant Platform
participant API as Asset API
participant Asset as Asset (bookkeeping.tenant.com)
User->>Tenant: User navigates to Tenant's platform
Tenant-->>User: Ask for credentials
User->>Tenant: Enter credentials
Note over Tenant: Tenant authenticates user
Tenant-->>User: User is shown the tenant's home page
User->>Tenant: User clicks button to access bookkeeping app
Tenant->>API: Request magic link token
API-->>Tenant: Token is created and returned
Tenant->>Asset: User is redirected to Asset
Asset-->>User: Asset validates token and shows home page
```
## **Create a magic link** [#create-a-magic-link]
Call the [Generate a Magic Link](/api-reference/authentication/generate-a-magic-link) endpoint from your backend. The request needs an access token with the `auth:create` scope. See [Authentication](/apioverview/authentication).
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/auth/magic-link \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{
"business_id": "biz_123456",
"email": "jack@example.com",
"path": "/reports/statements"
}'
```
**Response:**
```bash
{
"data": {
"magic_link": "https://app.getasset.com/ten_123456/biz_123456/reports/statements?token=...",
"magic_link_id": "mlk_123456"
}
}
```
Send your customer to the `magic_link`, for example with a redirect from your backend.
| Attribute | Request Parameter | Description |
| :---- | :---- | :---- |
| Business | business_id or external_business_id | The Business to open. Use `external_business_id` if you identify Businesses by your own ID. The Business must be active. |
| Email | email | The customer's email address. It identifies them in the app. |
| Path | path | Optional. The page to open, such as `/reports/statements`. Defaults to the Business's home page. |
| Link Lifetime | ttl | How long the link stays valid, in minutes. Default 5, maximum 15. |
| Session Length | session_timeout | How long the customer stays signed in, in seconds. Default 86400 (one day). |
Each link works **once**. Create it when the customer clicks, not in advance, and never email or store it.
Create the link on your server, after you have checked that the person is signed in to your platform and is allowed to see this Business. The link gives whoever opens it access to the Business's books.
## **Open a specific page** [#open-a-specific-page]
Use `path` to send a customer straight to the page they need. For example:
| Path | Page |
| :---- | :---- |
| `/reports/statements` | Financial statements |
| `/transactions/bank-accounts` | Bank account transactions |
| `/accounts` | Connected accounts |
| `/documents` | Documents |
Which pages exist depends on the Business's plan and on the features enabled for your Tenant. Use the path only, without a query string, because anything after a `?` is dropped.
## **When a session ends** [#when-a-session-ends]
A session lasts as long as `session_timeout`, and doesn't extend while the customer is working. When it ends, the customer is sent to the **Magic Link** page you set in [Set Up Your Tenant](/whitelabel/setup#custom-domain).
Customers can also arrive at your Asset domain without a session, for example from a bookmark or after a session ends. Asset sends them to your login page, and your platform signs them in with a new magic link.
```mermaid
sequenceDiagram
actor User
participant Asset as Asset (bookkeeping.tenant.com)
participant Login as Tenant Login
participant API as Asset API
User->>Asset: User navigates to bookkeeping.tenant.com
Asset->>Login: No valid session. Redirect to tenant's login page
Login-->>User: Ask for credentials
User->>Login: Enter credentials
Note over Login: Tenant authenticates user
Login->>API: Request magic link token
API-->>Login: Token is created and returned
Login->>Asset: User is redirected to Asset
Asset-->>User: Asset validates token and shows home page
```
The simplest approach is to make that page the same route you use to open accounting:
1. The customer arrives at your route.
2. Your route checks they are signed in to your platform.
3. It creates a new magic link for their Business and redirects to it.
The customer lands back in the app, usually without noticing. If the link has expired or was already used, the app shows an error, so send the customer back to your route to get a new one.
## **Sign a customer out** [#sign-a-customer-out]
The app doesn't show a sign-out button to customers who came through a magic link. They leave through the link back to your platform, which uses the **Redirect URL** from your domain settings.
To end sessions yourself, for example when a user is removed from your platform, call [Logout a user](/api-reference/authentication/logout-a-user) with `auth:delete` scope:
```bash
curl --request POST \
--url https://api.sandbox.getasset.com/v0/auth/logout \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data '{ "email": "jack@example.com" }'
```
This ends every session for that email address. Pass `session_id` with the `magic_link_id` from the response above to end only one.
## **Sandbox** [#sandbox]
Use your sandbox credentials and the sandbox API URL to create links while you build. Sandbox links open in the Asset app, just like production ones. Switch to your production credentials and URL when you go live.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# White Label Overview (/whitelabel/overview)
## **What is White Label?** [#what-is-white-label]
In the White Label model, your customers use the Asset accounting app as if it were part of your platform. You send them into the app with a sign-in link, and they see your logo, your colors and, if you set one up, your own domain. You don't build any screens.
Choose White Label when you want accounting in your product quickly, with little engineering. If you want accounting screens inside your own pages, use [Embedded](/embedded/overview) instead.
## **What your customers get** [#what-your-customers-get]
Your customers get the Asset accounting app for their [Business](/getstarted/CoreConcepts#businesses-your-smb-customers):
* **Reports:** financial statements, trial balance and more
* **Accounts and transactions:** connect bank accounts, then review and categorize what comes in
* **Documents:** upload and manage receipts and statements
* **Tasks and requests:** the items that need their attention
What they see depends on the Business's bookkeeping plan. With **Done for you**, a bookkeeper manages the books and the customer answers requests. With **Do it yourself**, the customer manages their own books in the app.
The app opens as a full page, so it can't be placed inside an iframe. Link to it, redirect to it, or open it in a new tab.
## **How it works** [#how-it-works]
Your customers never create an Asset account or a password. They sign in to your platform as they do today, and your platform signs them in to Asset.
1. **Your customer opens accounting in your platform.** They click a link or button that points to your backend.
2. **Your backend asks Asset for a magic link.** It calls the Asset API for a link for that customer's Business and email address.
3. **Your backend sends the customer to the link.** Asset checks the link, starts a session and opens the app on the right page.
A magic link is valid for a few minutes and works only once. When a session ends, your customer goes back to your platform and gets a fresh link.
## **Environments** [#environments]
Every Tenant has a **sandbox** and a **production** environment, with separate credentials. Build against sandbox first.
| Environment | API URL |
| :---- | :---- |
| Sandbox | `https://api.sandbox.getasset.com` |
| Production | `https://api.getasset.com` |
## **Before you start** [#before-you-start]
You will need:
1. **OAuth credentials** (`client_id` and `client_secret`) for your environment. You can create them in the Tenant dashboard.
2. **A demo Business** in the sandbox. The [Quickstart](/getstarted/quickstart) shows how to create one.
3. **A backend server** that can call the Asset API. Your credentials must never reach the browser.
## **Next Steps** [#next-steps]
Follow the guides in order:
1. [Set Up Your Tenant](/whitelabel/setup): add your logo and colors, and optionally your own domain.
2. [Sign Users In](/whitelabel/magic-links): send your customers into the app with magic links.
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Set Up Your Tenant (/whitelabel/setup)
Everything about how the Asset app looks and where it lives is set in the **Tenant dashboard**. You need a Tenant Admin user to change these settings.
## **Appearance** [#appearance]
Appearance controls the look of the app, so it feels like part of your platform. We recommend customizing it before your customers see the app.
* **Logo:** upload your logo. It shows in the app's menu.
* **Colors and styles:** set your brand colors, the menu colors, the buttons and the border style.
The app also shows your Tenant name and your support email address in its menu, so customers know where to go for help.
## **Custom domain** [#custom-domain]
By default, magic links open the app at `app.getasset.com`. With a custom domain, your customers use a domain you own, such as `accounting.example.com`, so they stay on an address that belongs to you. A custom domain is optional, but it makes the app feel like your own.
Open **Domain** in the Tenant dashboard and fill in these fields:
| Field | Description |
| :---- | :---- |
| **Custom Domain** | The domain your customers will see, for example `accounting.example.com`. |
| **Magic Link** | The page in your platform that signs a customer in to Asset. When someone opens your domain without a session, or their session expires, they are sent here. See [Sign Users In](/whitelabel/magic-links#when-a-session-ends). |
| **Redirect URL** | Where the app's "back to your platform" link goes. The link appears in the app's menu. |
### **DNS** [#dns]
When you save a custom domain, Asset gives you two DNS records to add at your DNS provider. They prove you own the domain and let Asset issue a security certificate for it. Until the records are in place and the certificate is issued, the domain doesn't work, so add them first.
Changing the custom domain later creates new DNS records, so you must add them again.
## **API credentials** [#api-credentials]
You use your credentials to call the Asset API and request magic links. Create them in **Authentication** in the Tenant dashboard. You can create as many as you need, and rotate them when someone leaves.
Rotating credentials invalidates the old ones immediately. Deploy the new credentials before you rotate.
Keep your credentials on your server. See [Authentication](/apioverview/authentication) for how they are used.
## **Next Steps** [#next-steps]
Send your customers into the app with magic links
Create the Business each customer will use
Questions? Reach out via our [Contact form](https://www.getasset.com/get-in-touch).
# Compound anatomy (/components/overview/anatomy)
Every SDK primitive follows the same shape, a Root that owns state plus a bag of parts for rendering it. If you've used Radix, this will feel familiar.
## Shape of a primitive [#shape-of-a-primitive]
A primitive is a namespaced object, not a single component. Import it once and destructure the parts you need:
```tsx
import { RevenueCard } from "@get-asset/sdk";
Loading…Retry
```
## State parts [#state-parts]
`.Loading`, `.Error`, `.Success`, and (on some primitives) `.Empty` are lightweight conditional wrappers — they render their children only when the parent is in the matching state.
These parts don't accept props. Styling and markup is your job — wrap them with your own elements.
## Value parts [#value-parts]
Parts like `.Revenue`, `.Change`, `.StartingBalance` render a *raw number* inside a `
` by default. Use them to get the data into the DOM; format it by nesting your own element via `asChild`.
## Composing with asChild [#composing-with-aschild]
Any slottable part accepts `asChild`. When set, the part clones its single child and forwards the data, class names, and event handlers onto it instead of rendering its own wrapper.
```tsx
{/* replaced with the number */}
```
This is the primary extension point: you get all the data and state management for free, and the rendered DOM is entirely your own.
# Getting started (/components/overview/getting-started)
Install the packages, wire up AssetProvider with an access token, and render your first card.
## Install [#install]
Install the styled package — it re-exports everything from the SDK.
```bash
npm install @get-asset/react
```
If you only need headless components and intend to bring your own styles, install `@get-asset/sdk` directly.
```bash
npm install @get-asset/sdk
```
## Set up the provider [#set-up-the-provider]
`AssetProvider` takes the `businessId` you're displaying data for and an `accessToken` — either a string or an async function that returns one. Pass `baseUrl` only if you need to point at a non-default API (it defaults to `https://api.getasset.com`).
```tsx
import { AssetProvider } from "@get-asset/react";
import "@get-asset/react/theme.css";
import "@get-asset/react/styles.css";
export function Root({ children, businessId }) {
return (
fetchToken(businessId)}
>
{children}
);
}
```
## Token exchange [#token-exchange]
Never ship `client_id`/`client_secret` to the browser. Exchange them for a short-lived access token on your server and proxy that to the client.
The token must carry the OAuth scopes that every card on the page needs. Import the per-card constants from `@get-asset/sdk/scopes` — this subpath has no React imports, so it's safe to use from Route Handlers, Server Components, or edge runtimes. Union the sets and pass the result as the standard `scope` form field. Each card's page (e.g. [RevenueCard](/components/react/revenue-card#scopes)) lists its required scopes under *Required scopes*. Requesting a superset of what the dashboard needs is fine; missing a scope means the affected card will surface an error state at fetch time.
```tsx
// app/api/token/route.ts
//
// Import scope constants from "@get-asset/sdk/scopes" — this subpath has no
// React dependencies, so it's safe to use in Route Handlers, Server
// Components, or edge runtimes.
import {
revenueCardScopes,
expensesCardScopes,
snapshotCardScopes,
} from "@get-asset/sdk/scopes";
// Union the scopes required by every card you intend to render.
const SCOPES = [
...revenueCardScopes,
...expensesCardScopes,
...snapshotCardScopes,
];
export async function GET(req: Request) {
const { searchParams } = new URL(req.url);
const businessId = searchParams.get("business_id");
const res = await fetch(`${process.env.ASSET_API_URL}/v0/auth/token`, {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
client_id: process.env.ASSET_CLIENT_ID!,
client_secret: process.env.ASSET_CLIENT_SECRET!,
business_id: businessId ?? "",
scope: [...new Set(SCOPES)].join(" "),
}),
});
return Response.json(await res.json());
}
```
## Your first card [#your-first-card]
Every styled card is self-contained — drop it inside the provider and it'll fetch, show a skeleton while loading, surface an error state, and render the result.
```tsx
import { AssetRevenueCard } from "@get-asset/react";
export function Dashboard() {
return ;
}
```
## Shared reporting range [#shared-reporting-range]
`AssetProvider` also stores one inclusive `dateFrom`/`dateTo` pair, and every date-driven component reports on it. Pass `defaultDateFrom` and `defaultDateTo` to seed it (both or neither); omit them and it starts on the current calendar year. Mount `AssetDatePicker` to let people move it — every card re-fetches automatically.
A card takes its own `dateFrom`/`dateTo` props to detach from the shared range entirely. Cards that compare against a previous period mirror whatever range they resolved: a month against the month before, a quarter against the quarter before, a year against the year before, and any other range against the same number of days immediately before it.
```tsx
import { AssetProvider, AssetDatePicker, AssetRevenueCard, AssetSnapshotCard } from "@get-asset/react";
// Every card reports on April 2026, compared against March 2026.
fetchToken(businessId)}
defaultDateFrom="2026-04-01"
defaultDateTo="2026-04-30"
>
{/* moves the range for every card below */}
{/* detached: all of 2026, and the picker no longer moves it */}
```
To label or lay out around the range the cards are on, read it from `useAsset()`:
```tsx
import { useAsset } from "@get-asset/sdk";
function RangeCaption() {
const { dateFrom, dateTo } = useAsset();
return
Reporting on {dateFrom} to {dateTo}
;
}
```
# Introduction (/components/overview)
Asset UI is a React toolkit for embedding live financial data — revenue, cashflow, operating expenses, tasks, and document requests — into any product, with full control over presentation.
## What is Asset UI? [#what-is-asset-ui]
Asset UI is a three-layer system. The base layer is a set of **headless compound components** that handle data fetching, loading, error, and empty states internally — they render nothing on their own. On top of that, a styled package provides a default theme and all the building-block primitives you need. Finally, you can skip the styled layer entirely and drop Asset primitives into your own design system.
## Packages [#packages]
| Package | Purpose |
| --- | --- |
| `@get-asset/sdk` | Headless compound components, provider, generated API client. |
| `@get-asset/react` | Styled components and primitives. Re-exports everything from the SDK. |
## Design principles [#design-principles]
- **Headless first.** Every piece of logic — fetching, retrying, state machines — lives in the SDK. The styled layer only supplies markup and CSS.
- **Compound, not monolithic.** Each card is a set of parts (`.Root`, `.Revenue`, `.Change`, …) that you assemble. Radix-style `asChild` lets any part delegate rendering to your own component.
- **Themeable through CSS variables.** The styled layer exposes ~25 design tokens. Swap them at any DOM scope to re-skin — no JavaScript theming layer required.
# Accounts Connect (/components/react/accounts-connect)
Connect a new institution.
The default panel's Plaid card opens Plaid Link; after a successful connection it shows a confirmation step where each account is assigned as **business** or **personal** (personal accounts also pick a contribution and distribution ledger). Confirming links the accounts via the Asset API. Only Plaid is shown by default; add more methods (Gusto, QuickBooks, Manual) via the `methods` prop — non-Plaid ones fire `onSelectMethod` for you to wire up.
Built on the headless [`AccountsConnect`](/components/sdk/accounts-connect) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetAccountsConnect } from "@get-asset/react";
fetchToken(businessId)}>
refreshAccounts()} />
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `plaid:create`
- `plaid:read`
- `ledger:read`
- `transaction:create`
- `quickbooks:create`
- `quickbooks:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | |
| `onClose` | `() => void` | No | | Called when the panel's close (×) button is clicked. |
| `onConnected` | `PlaidConnectOnConnected` | No | | Called after the accounts are linked on the Asset API. Its second argument is the account that was reconnected, or `null` for a new connection. |
| `onQuickBooksConnected` | `(connection: QuickBooksConnectionInfo) => void` | No | | Called once QuickBooks is connected, with the new connection. |
| `onChanged` | `AccountsOnChanged` | No | | Called after each accepted change: a Plaid connection (`connected`), a QuickBooks connection (`connected`), a manual account (`created`). For a host that keeps account-derived data of its own to refresh. |
| `onError` | `(error: Error) => void` | No | | Called if creating the link token, linking, or starting QuickBooks fails. |
| `onExit` | `PlaidLinkOnExit` | No | | Forwarded to Plaid Link. |
| `onEvent` | `PlaidLinkOnEvent` | No | | Forwarded to Plaid Link. |
| `onSelectMethod` | `(id: string) => void` | No | | Called with the id of the one of `extraMethods` that was selected. Plaid, QuickBooks and Manual run inside the SDK and never call it. |
| `onCreated` | `() => void` | No | | Called after a manual account is successfully created. |
| `extraMethods` | `readonly ConnectionMethod[]` | No | | Methods of your own to offer next to the built-in Plaid, QuickBooks Online and Manual, shown in this order before Manual. Selecting one calls `onSelectMethod` with its id, which must not be `plaid`, `quickbooks` or `manual`. They are shown whatever the token can run, while each built-in is offered only when the token carries its scopes, so under a read-only token they can be all the panel shows. Gate the way into the panel with `AccountsConnect.useCanConnect`, as `AssetAccountsCard` does. |
| `currencies` | `readonly string[]` | No | | The currencies the manual form offers, for a host that holds money in only some of them. Defaults to `CURRENCIES`. |
| `quickbooksConnection` | `QuickBooksConnectionInfo \| null` | No | | Override the QuickBooks connection (skips that API call) — storybook/tests. `null` is "not connected". |
| `initialPending` | `PlaidInstitutionAccount \| null` | No | | Seed the pending confirmation state (testing/storybook). |
| `state` | `"loading" \| "error"` | No | | Force a specific state for testing/storybook. |
## States [#states]
- **Connect (default).**
- **Confirm.** Shown after Plaid succeeds — assign business/personal.
# Accounts List (/components/react/accounts-list)
Styled table of a business's connected accounts, grouped into collapsible institution rows.
Each account row shows its name and masked number, a status dot (synced time / Disconnected / Paused), how many statements are outstanding on it, and its net balance; institution rows roll up the group's status and balance. Opening a row leads into the statements being asked for and then a review of the transactions posted since the account last balanced. Each disconnected row's `Reconnect` action opens [Plaid Link](/components/sdk/plaid-link) via the Asset API and refetches the list on success. To let users add new accounts, pair this with [`AssetAccountsConnect`](/components/react/accounts-connect).
Built on the headless [`AccountsList`](/components/sdk/accounts-list) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetAccountsList } from "@get-asset/react";
fetchToken(businessId)}>
refreshDashboard()} />
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `external_account:read`
- `external_account:update`
- `transaction:delete`
- `ledger:read`
- `request:read`
- `transaction:read`
- `document:read`
- `document:create`
- `document:delete`
- `report:read`
- `ledger:update`
- `business:read`
- `reconciliation:read`
- `reconciliation:write`
- `document:create`
- `document:read`
- `check:read`
- `document:create`
- `plaid:create`
- `plaid:read`
- `plaid:update`
- `quickbooks:read`
- `quickbooks:delete`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | |
| `onConnected` | `PlaidConnectOnConnected` | No | | Called after a bank connection is updated through Plaid: reconnected, or accounts added to it. The list refetches automatically, so use this for side effects (toasts, analytics). |
| `onError` | `(error: Error) => void` | No | | Called if creating the link token or finalising the connection fails. |
| `onExit` | `PlaidLinkOnExit` | No | | Forwarded to Plaid Link — called when the user exits the flow. |
| `onEvent` | `PlaidLinkOnEvent` | No | | Forwarded to Plaid Link — called on each Link event. |
| `initialPlaidUpdate` | `{ pending: PlaidInstitutionAccount; target: PlaidUpdateTarget; }` | No | | Seed a Plaid update awaiting confirmation — the result Plaid returned and the bank connection it updates (storybook/tests). |
| `institutionName` | `(account: ExternalAccountPublic) => string \| null` | No | | Override how an account is mapped to its institution group. Defaults to the account's `institution_name`, falling back to `metadata_` and then "Other accounts". Return `null` to use the fallback. |
| `source` | `"manual" \| "plaid" \| "statements" \| "gusto" \| "stripe"` | No | | Filter by account source — `manual`, `plaid`, `statements`, `gusto` or `stripe`. Passed straight to the API. |
| `type` | `"business" \| "personal"` | No | | Filter by account type — `business` or `personal`. Passed straight to the API. |
| `status` | `"connected" \| "disconnected" \| "untracked"` | No | | Filter by account status — `connected`, `disconnected` or `untracked`. Passed straight to the API. |
| `onReconnect` | `AccountsListOnPlaidUpdate` | No | | Invoked when an account's `` part is clicked, with the account, every account sharing its Plaid connection, and that connection. Wire it to Plaid's update mode: `PlaidLink`'s `connect(target.account, target)`. `AssetAccountsList` does this for you. |
| `onAddAccount` | `AccountsListOnPlaidUpdate` | No | | Invoked when a group's `` part is clicked, with a connected account of the group's bank and every account sharing that connection. Wire it like `onReconnect`: Plaid's update mode lets the user pick more accounts at the same bank. |
| `onChanged` | `AccountsOnChanged` | No | | Called after each accepted change the list makes: an account deleted (`deleted`), paused, resumed or switched type (`updated`), QuickBooks disconnected (`disconnected`). For a host that keeps account-derived data of its own to refresh. |
| `accounts` | `ExternalAccountPublic[]` | No | | Override fetched data — pass the API list as-is (skips the API fetch). |
| `quickbooksConnection` | `QuickBooksConnectionInfo \| null` | No | | Override the QuickBooks connection (skips that API call) — storybook/tests. `null` is "not connected". |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. |
| `showCurrency` | `boolean` | No | | Force the ISO code beside each amount on or off, skipping the business fetch (storybook/tests). By default it shows only for a business that holds money in more than one currency. |
| `defaultScreen` | `"accounts" \| "statements" \| "review"` | No | `"accounts"` | Screen to open on: `accounts`, `statements` or `review`. Pass `defaultAccountId` alongside anything deeper than `accounts`. |
| `defaultAccountId` | `string` | No | | Account opened on mount — required when `defaultScreen` is past `accounts`. |
| `onScreenChange` | `(screen: ReconciliationScreen) => void` | No | | Notified on every screen change, so a host can mirror it in its own chrome (this is how the styled card hides Add Account inside the flow). |
| `onRequestedCountChange` | `(count: number \| null) => void` | No | | Notified when the number of statements outstanding across every account changes — null while the list loads, errors or is empty, when that number isn't known. The card header sits outside this Root, so it mirrors the count through here rather than reaching into the context. |
| `tasks` | `TaskRequestStatementPublic[]` | No | | Override the fetched statement requests (skips that API call) — storybook/tests. |
| `plaidConnections` | `PlaidConnectionPublic[]` | No | | Override the fetched Plaid connections (skips that API call) — storybook/tests. An `expired` one marks its accounts' bank as needing reconnecting. |
| `documents` | `DocumentPublic[]` | No | | Override the fetched statement documents (skips that API call) — storybook/tests. |
| `transactions` | `TransactionPublic[]` | No | | Override the review's fetched transactions (skips that API call) — storybook/tests. |
| `reviewState` | `"loading" \| "error" \| "empty"` | No | | Force the review's state for testing/storybook. Separate from `state`, which forces the accounts list's. |
| `maxFileSize` | `number` | No | `26214400` | Per-file size ceiling for statement uploads, in bytes (25 MB by default). |
| `onTransactionRemove` | `(id: string) => void` | No | | Called after a transaction is successfully deleted. |
| `reconciliationMethod` | `"auto" \| "statement_verified"` | No | | Force the business's reconciliation method, skipping the business fetch for it — storybook/tests. |
| `statementReconciliations` | `AccountReconciliation[]` | No | | Override the fetched statement-verified account states (skips that API call) — storybook/tests. |
| `statementPeriods` | `AccountPeriods[]` | No | | Override the months of the accounts opened under statement verification (skips that API call) — storybook/tests. |
## States [#states]
- **Loading**
- **Success**
- **Empty.** No accounts connected.
- **Error**
# Accounts Card (/components/react/accounts)
The accounts card, the standard card header with an Add Account action that reveals AssetAccountsConnect, with AssetAccountsList below.
The accounts card — the standard card header with an **Add Account** action that reveals [`AssetAccountsConnect`](/components/react/accounts-connect) (hidden by default, animated open), with [`AssetAccountsList`](/components/react/accounts-list) below. Completing a connection invalidates the accounts query so the table background-refetches and the panel collapses.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetAccountsCard } from "@get-asset/react";
fetchToken(businessId)}>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `external_account:read`
- `external_account:update`
- `transaction:delete`
- `ledger:read`
- `request:read`
- `transaction:read`
- `document:read`
- `document:create`
- `document:delete`
- `report:read`
- `ledger:update`
- `business:read`
- `reconciliation:read`
- `reconciliation:write`
- `document:create`
- `document:read`
- `check:read`
- `document:create`
- `plaid:create`
- `plaid:read`
- `plaid:update`
- `quickbooks:read`
- `quickbooks:delete`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | |
| `frameless` | `boolean` | No | | Lay the card out as a page section instead: no frame, and the header ruled off full width above the table. For a host giving the accounts a page of their own, whose title the card then leaves out on its main screen. |
| `extraMethods` | `readonly ConnectionMethod[]` | No | | Methods of your own to offer in the connect panel, before Manual, next to the built-in Plaid, QuickBooks Online and Manual. |
| `onSelectMethod` | `(id: string) => void` | No | | Called with the id of the one of `extraMethods` that was clicked. Plaid, QuickBooks and Manual run inside the card. |
| `onConnected` | `PlaidConnectOnConnected` | No | | Called after a successful Plaid connection: a new bank from the connect panel, or a bank reconnected or given more accounts from the list. |
| `onQuickBooksConnected` | `(connection: QuickBooksConnectionInfo) => void` | No | | Called once QuickBooks is connected. |
| `onError` | `(error: Error) => void` | No | | Called on a connection error. |
| `onExit` | `PlaidLinkOnExit` | No | | Forwarded to Plaid Link, for new connections and reconnects alike. |
| `onEvent` | `PlaidLinkOnEvent` | No | | Forwarded to Plaid Link, for new connections and reconnects alike. |
| `institutionName` | `(account: ExternalAccountPublic) => string \| null` | No | | Override how an account is mapped to its institution group. Defaults to the account's `institution_name`, falling back to `metadata_` and then "Other accounts". Return `null` to use the fallback. |
| `source` | `"manual" \| "plaid" \| "statements" \| "gusto" \| "stripe"` | No | | Filter by account source — `manual`, `plaid`, `statements`, `gusto` or `stripe`. Passed straight to the API. |
| `type` | `"business" \| "personal"` | No | | Filter by account type — `business` or `personal`. Passed straight to the API. |
| `status` | `"connected" \| "disconnected" \| "untracked"` | No | | Filter by account status — `connected`, `disconnected` or `untracked`. Passed straight to the API. |
| `onReconnect` | `AccountsListOnPlaidUpdate` | No | | Invoked when an account's `` part is clicked, with the account, every account sharing its Plaid connection, and that connection. Wire it to Plaid's update mode: `PlaidLink`'s `connect(target.account, target)`. `AssetAccountsList` does this for you. |
| `onAddAccount` | `AccountsListOnPlaidUpdate` | No | | Invoked when a group's `` part is clicked, with a connected account of the group's bank and every account sharing that connection. Wire it like `onReconnect`: Plaid's update mode lets the user pick more accounts at the same bank. |
| `onChanged` | `AccountsOnChanged` | No | | Called after each accepted change the list makes: an account deleted (`deleted`), paused, resumed or switched type (`updated`), QuickBooks disconnected (`disconnected`). For a host that keeps account-derived data of its own to refresh. |
| `onRequestedCountChange` | `(count: number \| null) => void` | No | | Notified when the number of statements outstanding across every account changes — null while the list loads, errors or is empty, when that number isn't known. The card header sits outside this Root, so it mirrors the count through here rather than reaching into the context. |
| `maxFileSize` | `number` | No | `26214400` | Per-file size ceiling for statement uploads, in bytes (25 MB by default). |
| `quickbooksConnection` | `QuickBooksConnectionInfo \| null` | No | | Override the QuickBooks connection (skips that API call) — storybook/tests. `null` is "not connected". |
| `accounts` | `ExternalAccountPublic[]` | No | | Override fetched data — pass the API list as-is (skips the API fetch). |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. |
| `showCurrency` | `boolean` | No | | Force the ISO code beside each amount on or off, skipping the business fetch (storybook/tests). By default it shows only for a business that holds money in more than one currency. |
| `defaultScreen` | `"accounts" \| "statements" \| "review"` | No | `"accounts"` | Screen to open on: `accounts`, `statements` or `review`. Pass `defaultAccountId` alongside anything deeper than `accounts`. |
| `defaultAccountId` | `string` | No | | Account opened on mount — required when `defaultScreen` is past `accounts`. |
| `onScreenChange` | `(screen: ReconciliationScreen) => void` | No | | Notified on every screen change, so a host can mirror it in its own chrome (this is how the styled card hides Add Account inside the flow). |
| `tasks` | `TaskRequestStatementPublic[]` | No | | Override the fetched statement requests (skips that API call) — storybook/tests. |
| `plaidConnections` | `PlaidConnectionPublic[]` | No | | Override the fetched Plaid connections (skips that API call) — storybook/tests. An `expired` one marks its accounts' bank as needing reconnecting. |
| `documents` | `DocumentPublic[]` | No | | Override the fetched statement documents (skips that API call) — storybook/tests. |
| `transactions` | `TransactionPublic[]` | No | | Override the review's fetched transactions (skips that API call) — storybook/tests. |
| `reviewState` | `"loading" \| "error" \| "empty"` | No | | Force the review's state for testing/storybook. Separate from `state`, which forces the accounts list's. |
| `onTransactionRemove` | `(id: string) => void` | No | | Called after a transaction is successfully deleted. |
| `reconciliationMethod` | `"auto" \| "statement_verified"` | No | | Force the business's reconciliation method, skipping the business fetch for it — storybook/tests. |
| `statementReconciliations` | `AccountReconciliation[]` | No | | Override the fetched statement-verified account states (skips that API call) — storybook/tests. |
| `statementPeriods` | `AccountPeriods[]` | No | | Override the months of the accounts opened under statement verification (skips that API call) — storybook/tests. |
| `currencies` | `readonly string[]` | No | | The currencies the manual form offers, for a host that holds money in only some of them. Defaults to `CURRENCIES`. |
| `onCreated` | `() => void` | No | | Called after a manual account is successfully created. |
| `initialPending` | `PlaidInstitutionAccount \| null` | No | | Seed the pending confirmation state (testing/storybook). |
## Reconciliation [#reconciliation]
A background job compares each account's balance against the books. When they disagree for long enough it asks for a statement, and this card is where that ask lands — not a separate Reconciliation tab, which would need explaining.
Each account row says how long it has been waiting — **Not reconciled since Jul 1, 2026** — rather than counting files, because the age is what tells the user whether it matters. Paused and disconnected accounts read **Not checked** and are inert: their balance isn't being compared to anything, so a statement is never asked for.
Opening a row lists one line per statement still wanted: the period it covers, when it was asked for, and an upload. After uploading, the row polls until the statement has been read, so the user can wait there rather than guess when to come back — and **Review transactions** stays inert until every request has settled.
Review then lists everything posted to the account since it last balanced, with each field editable in place and a delete on each row. Deleting a posted transaction can't be undone, so each row confirms first. Note that edits to amount, date and description are held locally and reported through `onTransactionUpdate` — the API has no write for those fields yet. See [the SDK page](/components/sdk/accounts-list#reconciliation) for the full flow and the extra scopes it needs.
# Aged Payables (/components/react/aged-payables)
Styled payables aging table grouped into 0–30, 31–60, 61–90 and 90+ day buckets, with vendor totals and calculated column totals.
It switches to a compact vendor-card layout on narrow containers. Its aging date is the last day of the range selected on `AssetProvider`.
Built on the headless [`AgedReport`](/components/sdk/aged-report) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetAgedPayables } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `report:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed reporting range. Detaches the report from the provider's shared range entirely and must be paired with `dateTo`; passing one without the other throws. Use `periodDateRange` to derive the pair from a month, quarter, or year. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of the fixed reporting range, and the day the report ages from. Must be paired with `dateFrom`. Omit both to follow the provider's date picker. |
| `lines` | `AgedReportLineOverride[]` | No | | Overrides fetched lines and disables API requests. Missing bucket values default to zero; a missing `total` is calculated from the buckets. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Forces a state and disables API requests. |
## States [#states]
- **Loading.** The report is being fetched.
- **Success.** Vendors with their amounts in each aging bucket, and column totals.
- **Empty.** No outstanding payables.
- **Error.** The report couldn't be loaded.
Force a state with the `state` prop.
# Aged Receivables (/components/react/aged-receivables)
Styled receivables aging table grouped into 0–30, 31–60, 61–90 and 90+ day buckets, with vendor totals and calculated column totals.
It switches to a compact customer-card layout on narrow containers. Its aging date is the last day of the range selected on `AssetProvider`.
Built on the headless [`AgedReport`](/components/sdk/aged-report) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetAgedReceivables } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `report:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed reporting range. Detaches the report from the provider's shared range entirely and must be paired with `dateTo`; passing one without the other throws. Use `periodDateRange` to derive the pair from a month, quarter, or year. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of the fixed reporting range, and the day the report ages from. Must be paired with `dateFrom`. Omit both to follow the provider's date picker. |
| `lines` | `AgedReportLineOverride[]` | No | | Overrides fetched lines and disables API requests. Missing bucket values default to zero; a missing `total` is calculated from the buckets. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Forces a state and disables API requests. |
## States [#states]
- **Loading.** The report is being fetched.
- **Success.** Customers with their amounts in each aging bucket, and column totals.
- **Empty.** No outstanding receivables.
- **Error.** The report couldn't be loaded.
Force a state with the `state` prop.
# Ask (/components/react/ask)
Drop-in styled free-text ask, an "Ask something else" chip (the same anatomy as the insights question chips) that expands, in place, into a full-width input with a submit.
The insights panel embeds it for you on the Profit & Loss and Cashflow Summary cards and the reports that embed the panel — reach for it directly only when attaching a free-text ask to something else. Renders nothing while the surrounding card is locked.
Built on the headless [`Ask`](/components/sdk/ask) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetAsk } from "@get-asset/react";
runQuestion(question)}
/>
```
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer element of both states (chip and input row). |
| `maxLength` | `number` | No | | Cap the question length (native input maxLength). Hosts pass their endpoint's limit — the insights panel passes 500, the insights endpoints' question cap. No limit is applied when omitted. |
| `onSubmit` | `(question: string) => void` | Yes | | Handles a submitted question (already trimmed, never empty). The host decides what asking means — the insights panel wires it to its `select()` so the typed question runs through the same fetch path as a starter question. |
| `prompt` | `string` | No | | Submit a question supplied by another input. Each non-empty prompt is submitted once; clear the prop before submitting the same prompt again. |
| `placeholder` | `string` | No | `"Ask about this report…"` | Placeholder (and accessible label) for the input. The host passes a report-specific prompt (e.g. "Ask about your profit and loss…"). |
| `disabled` | `boolean` | No | | Disable the input + submit (e.g. while an answer generates). Submitting is a no-op while set, including questions supplied through `prompt`. |
| `locked` | `boolean` | No | | Override the locked state. Defaults to the surrounding lockable card's state, or unlocked when used outside one. While locked the whole compound renders nothing. |
| `defaultOpen` | `boolean` | No | `false` | Start on the expanded input instead of the trigger — for storybook/docs previews of the expanded state (e.g. alongside `disabled`). |
## Behavior notes [#behavior]
- Enter or the arrow button submits; the submit stays disabled until non-whitespace text is entered. Submitting collapses back to the chip and clears the field.
- Escape or blurring while empty collapses back to the chip; blurring with a draft keeps the input open.
- The expansion unfurls left→right over 260ms; users with reduced motion get an instant swap.
- In a wrapping chip row the expanded input takes the full row width, so it always occupies its own line.
# Balance Sheet Report (/components/react/balance-sheet-report)
Styled hierarchical balance sheet table grouped into Assets, Liabilities and Equity, taken at a specific point in time.
Without an `asOf` it reports on the last day of the range selected on `AssetProvider`. Subtotal rows render bold; nested ledger rows are indented by depth. The download button in the card header exports the same point-in-time view as an XLSX file.
Built on the headless [`BalanceSheetReport`](/components/sdk/balance-sheet-report) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetBalanceSheetReport } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `report:read`
- `business:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card element. |
| `asOf` | `Date \| string` | No | | The "as of" date the balance sheet is taken at. Accepts a Date or any ISO-8601 string, and pins the report to that instant regardless of the provider's range. Omit it to take the report at the end of the range selected on the provider, which includes everything posted on its last day. |
| `records` | `ReportLine[]` | No | | Override fetched data. Pass the API tree as-is. Skips the API call. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. |
| `basis` | `"accrual" \| "modified_cash"` | No | | Report on a specific accounting basis: `"accrual"` or `"modified_cash"`. Omit to inherit the provider's basis, which itself falls back to the Business's country default: Canadian Businesses report on accrual, everyone else on cash. |
| `basisToggle` | `boolean` | No | | Let the end user flip between Cash and Accrual. Off by default — when off, `BasisSelect` renders nothing and the report renders on its resolved basis. Flipping moves every basis-aware component under the provider, so one screen never mixes bases. |
| `onLedgerSelect` | `(ledgerId: string) => void` | No | | Called with a row's ledger id when the viewer picks it (click or keyboard). When set, rows that carry a ledger id render as interactive links — e.g. to open a general-ledger view; rows without one stay inert. Each line exposes it pre-bound as `selectLedger` on the line hook, present only when the row names a ledger. Group headings and calculated rows stay inert. |
## States [#states]
- **Loading.**
- **Success.**
- **Empty.** No records returned.
- **Error.**
## Accounting basis [#accounting-basis]
`AssetBalanceSheetReport` reports on one of two accounting bases: **Accrual** (`accrual` on the wire), which counts invoices and bills when they are issued, or **Cash** (`modified_cash`), which counts them when the money moves. Cashflow components take no basis — cashflow is a cash concept.
The basis is resolved per component, first match winning:
- the report's own `basis` prop;
- the provider's basis — `defaultBasis` on `AssetProvider`, or whatever the toggle was last flipped to;
- the Business's country — Canadian Businesses report on Accrual, everyone else on Cash.
Only the last step costs a request — a Business read, which is why every basis-aware component's `scopes` includes `business:read` — and it is serial: the report holds its own fetch until the Business answers. One request is shared across every basis-aware component on the screen, but pass `defaultBasis` on [`AssetProvider`](/components/sdk/provider#basis) when you already know the basis and skip it entirely. If the lookup fails the report falls back to Cash and stays there — the Retry button re-runs the report, not the basis lookup.
`basisToggle` is off by default: no control renders in the header and the report reports on its resolved basis. Turn it on and flipping the control moves every basis-aware component under the provider with it, so the toggle can never leave a screen half cash and half accrual. A component pinned with its own `basis` prop is the exception — it keeps the basis you gave it and renders no toggle of its own, which is how you show both bases side by side on purpose.
The XLSX export sends the basis currently on screen, so a downloaded file always matches what the viewer was looking at.
# Bills (/components/react/bills)
Styled, drop-in accounts payable, with bill date, description, vendor, due date, a status tag, the balance and what settled it, one row per bill.
The header carries a status filter and a "Create new bill" button that reveals a form above the table; clicking a row expands a reconciliation of what it is worth, what has been matched and what that leaves, and the kebab offers the full view, a status change and delete. Covers loading, error, empty and success, and restacks onto a narrow layout via a container query.
Built on the headless [`Bills`](/components/sdk/bills) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetBills } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `bill:read`
- `bill:create`
- `bill:update`
- `bill:delete`
- `vendor:read`
- `vendor:create`
- `ledger:read`
- `transaction:read`
- `external_account:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer `Card` wrapper element. |
| `matchCandidates` | `MatchCandidateOverride[]` | No | | Override the transactions the match picker offers, for previews and tests. Live, the panel queries them itself once a row with a balance is expanded — pass this alongside `bills` to keep an offline story offline. An empty array is still an override, and shows the picker with nothing in it. |
| `intake` | `{ onCreated?: (id: string \| null) => void; }` | No | | Lets a bill be raised from a document. Supplying it puts an Upload bill control in the header (without it the header is create-only), hands the file to Asset, and refreshes the list once Asset has read it. `onCreated` fires with the new record's id. |
| `hideCreate` | `boolean` | No | `false` | Hides the "Create new bill" button. For tenants that raise bills in another system and push them in through the API — the list is then a record, not a place to author one. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed due-date window. Setting it detaches the list from the provider's shared range entirely; must be paired with `dateTo` (one without the other throws). Use `periodDateRange` to derive the pair from a month, quarter, or year. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of a fixed due-date window. Must be paired with `dateFrom`. Omit both to follow the provider's DatePicker-driven range. |
| `pageSize` | `number` | No | `25` | Rows per request. Further pages are fetched by `LoadMore`. |
| `defaultStatusFilter` | `BillStatus \| "all"` | No | `"all"` | Initial status filter. `"all"` clears it. Live, the filter is a query parameter — the endpoint returns the matching bills. |
| `defaultSelectedId` | `string` | No | | Expand this bill's detail on mount. Lets a host deep-link straight to a bill rather than making the user find it in the list. |
| `defaultViewingId` | `string` | No | | Open this bill's full document view on mount — the deep link for "show me this bill", where `defaultSelectedId` is "open its row in the list". |
| `defaultCreating` | `boolean` | No | `false` | Open the create draft on mount. |
| `bills` | `BillOverride[]` | No | | Override the fetched bills (skips the list request). The status filter and period are not re-applied, so supply the rows you want shown. Used by storybook/tests. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. Skips every request this compound makes, the vendor and ledger directories included. |
| `showCurrency` | `boolean` | No | | Force the ISO code beside each amount on or off, skipping the business fetch (storybook/tests). By default it shows only for a business that holds money in more than one currency. |
| `hasMore` | `boolean` | No | | Force the `LoadMore` affordance to render. Only consulted while the list isn't being fetched (a data override or forced `state`) — live, pagination comes from the API's next page token. |
| `vendors` | `VendorOption[]` | No | | Override the selectable vendors, which also resolves each row's vendor name offline. Live, the directory is read once for the whole table; an overridden list still reads it while a draft is open, because supplying rows says nothing about the picker. |
| `ledgers` | `LedgerOption[]` | No | | Override the categories selectable on a draft line. Live, this is only read once a draft is open — a line's category is optional. |
## States [#states]
- **Loading.**
- **Success.**
- **Empty.** No bills yet.
- **Error.**
- **Creating.** The new-bill form, revealed above the table.
- **Expanded.** A part-paid row, opened onto its reconciliation.
- **Details.** The document view, deep-linked onto the part-paid bill.
- **Read-only.** hideCreate, for tenants that raise bills elsewhere.
## Behaviour [#behaviour]
The bill number leads neither the table nor its header: it is an internal reference that reads as noise next to a description and a vendor. It remains on the full view. The date takes its place, because that is what the list is ordered by.
The header names the period beside the title, and the table holds the bills falling due inside it — the range comes from the `AssetProvider`, as it does on the report cards, so the list moves with the rest of the dashboard. `dateFrom` and `dateTo` pin a fixed window for this card alone, detaching it from the provider's range. See [Period and status filter](/components/sdk/bills#period-filter) for the window it sends.
Clicking a row expands it — the row itself is the toggle, not just the kebab. What opens is a reconciliation rather than a second copy of the row: the bill total, what has been matched to it, and what that leaves. The matched line only appears once something has been matched. When a bank transaction is larger than the balance, the API allocates what is due and records the excess as vendor credit, so the bill reads **Settled in full**. The line items live on the full view instead, which is the surface for reading the bill whole.
The **Transactions** column names what settled the row — the bank's own description, with `+N` once more than one transaction settles it, and a dash when nothing has. It is content, not a control: one click anywhere on the row (the kebab aside) opens it. Each cell's text carries a text cursor at its own width, and a drag that selects it never opens the row — the click handler stands down whenever a selection ends the click. See [Matching](#matching).
The kebab carries the full view, the status changes and delete. Editing lives on the full view, and reaches the lines alone — the number, vendor and dates are fixed at creation. Open, paid and voided are the complete status set, and every transition is a plain Bill PATCH. See [Statuses](/components/sdk/bills#statuses).
The new-bill form takes a number, a description, a vendor, two dates and any number of lines with an optional category each, and totals the lines as they are typed. A vendor who is not in the directory yet can be added from inside the form, without losing the bill being drafted. Opening the full view or the form hides the list rather than pushing it down.
Every value, control and gate is a slot on the headless compound. See the [Bills part inventory](/components/sdk/bills#api) to rearrange the layout, swap the primitives, or add the parts this layout leaves out — the per-payment list and a detached detail panel.
## The document view [#document-view]
The full view reads the bill as a document, on the layout every document source shares — an invoice, a receipt or a statement opens into the same anatomy, with only the source-specific copy changing. A back link returns to the list; the header carries the vendor's name, the document date, a **Bill** tag and the status as a plain tag beside it — the same badge the table's Status column wears; a summary band states what the document claims and settles it; and the record's own card holds the dates, the line items and the amount due. Delete and Edit share the action bar at the foot.
Editing swaps the line rows — and only them — for inputs, each with its own remove control, with the amount due following the keystrokes; Save sends what changed and Cancel discards it. The dates stay read-only: they are fixed at creation. **+ Add Item** under the lines is the same editor, opened with a fresh line ready to type into. See [Editing: lines only](/components/sdk/bills#editing).
The summary band leads with a sentence — who you owe, how much, due when — and carries the matching surface under it: one chip per matched payment, a **Select Transactions** picker, and a payment total that goes red when more is attached than the bill is worth. See [Matching](#matching).
The line items sit behind a toggle that names what it hides ("Show 14 Items"). They start open — the lines are what the document is made of — and stay put across an edit; the toggle is there for the reader who wants the totals without the itemisation.
A bill raised from an uploaded file opens as a split view: the details keep the left column, and the source document renders beside them — the file on a page card, a control to open the original in its own tab, and zoom for images (a PDF renders through the browser's viewer, which brings its own). The header also wears the document's processing status as a small dotted chip — the same vocabulary as the [`AssetDocuments`](/components/react/documents) list. The lookup behind all of this is the headless [`DocumentViewer`](/components/sdk/document-viewer).
A bill with no source document — one raised here, or pushed in through the API — keeps the single column at full width, with no status chip and no empty pane beside it.
## Ingestion [#ingestion]
Pass `intake` and the header gains an **Upload bill** control. Picking a document hands it to Asset, which reads it and raises the bill from it — party, lines and journal entry included. A banner under the header narrates it: uploading, then reading, then the record it added. When it finishes the list refreshes, the new record's row opens, and `onCreated` fires with its id.
Nothing is asked of the reader: the extraction is the platform's. A failure gets its own line and stays until it is dismissed — an upload that quietly gave up is worse than one that visibly did — and every failure line ends on *nothing was added*, which is what settles whether a half-made record is now in the books. **Try again** appears only where running the same file could end differently: a file that is too large, the wrong type, or already on record will be all of those next time too. Reading runs on the server, so a reload picks the progress back up rather than losing it.
## Matching [#matching]
Beside the reconciliation sits **Payments**: one chip per payment already matched to the bill, and a **Select Transactions** picker to add one. It is [`AssetTransactionMatch`](/components/react/transaction-match) wired to the open row; the document view carries the same one inside its summary band, on the inline layout.
The picker is a searchable multi-select that suggests bank transactions around the bill's due date and shows how their amounts compare with the outstanding balance. The user chooses which payment to apply. It lays out the date, the description and the amount on three fixed tracks, so a dozen rows can be scanned by eye. The supported date range is stated in [Guardrails](/components/sdk/transaction-match#guardrails). Ticking one records the payment and unticking it takes the payment off again — each is its own request, so there is no save. Already-matched transactions come back ticked, and every chip carries its own remove control, which is the way back if the wrong one was attached. Transactions moving money the wrong way are never offered; the same section explains why.
A settled bill keeps the panel and the picker, disabled — you can still read and undo what paid it, and hiding the control would make a settled row look like a different component. It also costs nothing: nothing is outstanding, so no suggestions are loaded. See [Settled records](/components/sdk/transaction-match#settled).
In the table, the row itself is the way in — one click opens it at the matching panel, whatever cell the click lands on. `matchCandidates` is the override that keeps a preview or a test off the network, and [`TransactionMatch`](/components/sdk/transaction-match) is the headless compound to compose against for a layout of your own.
# Book Health (/components/react/book-health)
Styled card answering "are my books healthy?" for one fiscal year, with a month grid and the open tasks behind each month.
The card shows a summary fraction over a twelve-segment meter, and a month grid. Each month carries a check (closed and verified), a count chip (open tasks waiting on the user) or a dash (not yet due). Below the grid are the open tasks.
The task list is the [Tasks](/components/react/tasks) component itself, with its rows, upload, note and reconnect flows, scoped to the year or the selected month. Clicking a month filters it. Hovering one (desktop only) shows a per-category breakdown.
A year dropdown offers previous years back to the business's entries start, and hides when there are none. The card follows one fiscal year of the business (calendar years when its fiscal year starts in January). It is deliberately decoupled from the `AssetProvider`'s shared date range.
See the [Bookkeeping Copilot](/bookkeeping/copilot) guide for how books status and Tasks fit together.
Built on the headless [`BookHealth`](/components/sdk/book-health) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetBookHealth } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `business:read`
- `request:read`
- `plaid:create`
- `plaid:update`
- `plaid:read`
- `ledger:read`
- `document:create`
- `journal_entry:read`
- `journal_entry:create`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card element. |
| `months` | `BookHealthMonthData[]` | No | | Override fetched months (skips every API fetch). Each entry is `{ month: 'YYYY-MM', status, tasks? }` — tasks ride on their month. |
| `entriesStart` | `string` | No | | Override the business's `entries_start` date (`YYYY-MM-DD` or `YYYY-MM`), which decides the fiscal years the picker offers. The picker hides when there are no previous years. |
| `fiscalYearStart` | `string` | No | | Override the business's fiscal-year start anchor (`MM/DD`), which decides where each twelve-month window begins. Defaults to the business's `fiscal_year`; January when unknown. With `entriesStart`, providing it skips the business fetch. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. |
| `locked` | `boolean` | No | | Gate the card for a viewer who isn't entitled to it. Activates the `Locked` state (mutually exclusive with loading / error / empty / success) and skips every API fetch — nothing is requested for a locked viewer. The card renders blurred and inert as a teaser behind a lock and the upgrade CTA. |
| `upsell` | `UpsellConfig` | No | | Locked-state copy + upgrade handler, `{ title?, description?, ctaLabel?, onUpgrade? }`; merged field-by-field over the card's default copy, then the generic fallback. `ctaLabel` and `onUpgrade` are the tenant's upgrade wording and handler. |
| `onReviewTask` | `(task: TasksTask) => void` | No | | Hand a month-level review task off to your transactions page for its month — reviewing is how those tasks complete. Exposed on the context and forwarded to the nested task list; the review (arrow) button is a no-op while unset. |
## States [#states]
- **Loading.** The summary skeletonizes, and the month grid shows plain labels with no marks.
- **Success.** The month grid and the open tasks.
- **Caught up.** Nothing is waiting on the user, so a banner replaces the task list.
- **Empty.** No books yet. Connect accounts first.
- **Error.** The data couldn't be loaded.
- **Locked.** The viewer isn't entitled to the card. It renders blurred behind an upgrade prompt, and nothing is fetched. Pass `upsell` to customize the copy and wire `onUpgrade`.
Force a state with the `state` prop.
# Cashflow Card (/components/react/cashflow-card)
Styled card showing starting and ending bank balances per period with the net change in cash for each.
Periods come from the range on screen — the AssetProvider's shared range (driven by the DatePicker) unless `dateFrom` / `dateTo` pin it. A range that is exactly one month, quarter or year shows two columns, that period and the one before it; any other range shows one column per calendar month it overlaps, with the figures clipped to the range.
Built on the headless [`CashflowCard`](/components/sdk/cashflow-card) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetCashflowCard } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `report:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card element. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed reporting range. Detaches the card from the provider's shared range entirely; must be paired with `dateTo` (passing one side alone throws). Use `periodDateRange` to derive the pair from a month, quarter or year. Omit both to follow the provider's date-picker-driven range. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of the fixed reporting range. Must be paired with `dateFrom`. |
| `periods` | `CashflowPeriodOverride[]` | No | | Override fetched data (skips API fetch) — one entry per period on screen. Each entry is `{ start, startingBalance, endingBalance, changeInCash? }`. |
| `state` | `"loading" \| "error"` | No | | Force a specific state for testing/storybook. |
| `locked` | `boolean` | No | | Gate the report for a viewer who isn't entitled to it. Activates the `Locked` state (mutually exclusive with loading / error / empty / success) and skips the API fetch — no report data is requested for a locked viewer. The period table renders blurred and inert as a teaser behind a lock and the upgrade CTA, using built-in placeholder data (a `periods` override still wins). |
| `upsell` | `UpsellConfig` | No | | Locked-state copy + upgrade handler, `{ title?, description?, ctaLabel?, onUpgrade? }`; merged field-by-field over the card's default copy, then the generic fallback. `ctaLabel` and `onUpgrade` are the tenant's upgrade wording and handler. |
## States [#states]
- **Loading.** The card is being fetched.
- **Success.** Starting and ending balances with the change in cash per period.
- **Empty.** No periods returned.
- **Error.** The report couldn't be loaded.
- **Locked.** Viewer isn't entitled to the report — a built-in placeholder teaser renders blurred behind the upgrade prompt. Pass `upsell` to customize the copy and wire `onUpgrade`.
Force a state with the `state` prop.
# Cashflow Report (/components/react/cashflow-report)
Styled multi-period cashflow table over the reporting range — the provider's DatePicker-driven range unless dateFrom / dateTo detach it.
The card header carries a period Select (Month / Quarter / Year) wired to the SDK's internal breakdown state — switching it re-fetches the report and the table re-renders with one column per period the range covers. Subtotal rows render bold; nested ledger rows are indented by depth. The download button next to the period selector exports the same view as an XLSX file, using whatever query parameters the table is currently displaying. Below the responsive breakpoint the table collapses to a single column with an arrow-picker period strip; above it, the period header sticks to the top of the page when scrolling.
Built on the headless [`CashflowReport`](/components/sdk/cashflow-report) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetCashflowReport } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `report:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card element. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed reporting range. Detaches the report from the provider's shared range entirely; must be paired with `dateTo` (passing one without the other throws). Use `periodDateRange` to derive the pair from a month/quarter/year. Omit both to follow the provider's date-picker-driven range. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of the fixed reporting range. Must be paired with `dateFrom`. |
| `defaultBreakdown` | `"month" \| "quarter" \| "year"` | No | `"year"` | Initial period breakdown (`"month"`, `"quarter"` or `"year"`). The report renders one column per year, quarter, or month the range covers. Ignored when the range is exactly one calendar month or quarter: the breakdown is then forced to match and `setBreakdown` is a no-op. Update at runtime via `setBreakdown` from the hook. |
| `records` | `ReportLine[]` | No | | Override fetched data with a single-period snapshot — primarily for testing / storybook. The report renders one column. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. |
| `basis` | `"accrual" \| "modified_cash"` | No | | Report on a specific accounting basis: `"accrual"` or `"modified_cash"`. Omit to inherit the provider's basis, which itself falls back to the Business's country default: Canadian Businesses report on accrual, everyone else on cash. |
| `basisToggle` | `boolean` | No | | Let the end user flip between Cash and Accrual. Off by default — when off, `BasisSelect` renders nothing and the report renders on its resolved basis. Flipping moves every basis-aware component under the provider, so one screen never mixes bases. |
| `onLedgerSelect` | `(ledgerId: string) => void` | No | | Called with a row's ledger id when the viewer picks it (click or keyboard). When set, rows that carry a ledger id render as interactive links — e.g. to open a general-ledger view; rows without one stay inert. Each line exposes it pre-bound as `selectLedger` on the line hook, present only when the row names a ledger. Group headings and calculated rows stay inert. |
## States [#states]
- **Loading.** The report is being fetched.
- **Success.** The statement with one column per period.
- **Empty.** No records returned.
- **Error.** The report couldn't be loaded.
Force a state with the `state` prop.
# Cashflow Summary Card (/components/react/cashflow-summary-card)
Styled card showing twelve months of cash in (green, upward) and cash out (purple, downward) for a fiscal year, diverging from a central $0 axis, with the monthly net cashflow drawn as a line on top (green where positive, purple where negative).
The header surfaces the year's **net cashflow**, **money in** and **money out** totals. Pass `insights` (shown in the preview) to render the AI insights panel to the left of the chart — it answers the listed questions from the cash-flow insights endpoint automatically, and an “Ask something else” input lets people type their own question for the same structured answer. The chart covers every calendar month the range on screen overlaps — a whole year gives the familiar twelve — and follows the AssetProvider's range unless `dateFrom` / `dateTo` pin it.
Built on the headless [`CashflowSummaryCard`](/components/sdk/cashflow-summary-card) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetCashflowSummaryCard } from "@get-asset/react";
fetchToken(businessId)}
>
{/* `insights` shows the AI panel to the left of the chart. It fetches
answers from the insights endpoint automatically — nothing to wire up. */}
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `report:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card element. |
| `insights` | `boolean \| CashflowInsightsProps` | No | | Show the AI insights panel to the left of the chart. Pass `true` and it fetches answers from the cash-flow insights endpoint automatically for the range on screen. Alongside the starter questions, an "Ask something else" input lets people type their own; it runs through the same endpoint and returns the same structured answer. Pass an object (`{ questions?, ask? }`) to override the starter `questions`, or to inject `ask` to mock answers in docs or tests. The panel is omitted while `locked`. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed reporting range. Detaches the card from the provider's shared range entirely; must be paired with `dateTo` (passing one side alone throws). Use `periodDateRange` to derive the pair from a month, quarter or year. Omit both to follow the provider's date-picker-driven range. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of the fixed reporting range. Must be paired with `dateFrom`. |
| `months` | `CashflowSummaryMonthOverride[]` | No | | Override fetched data (skips API fetch) — one entry per month on screen. Each entry is `{ month, moneyIn, moneyOut }`, with `moneyOut` as a positive number. |
| `scale` | `number` | No | | Override the +/- bound for the bar chart scale. Defaults to a "nice" value derived from the largest money in/out figure. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. |
| `locked` | `boolean` | No | | Gate the report for a viewer who isn't entitled to it. Activates the `Locked` state (mutually exclusive with loading / error / empty / success) and skips the API fetch — no report data is requested for a locked viewer. The metrics and chart render blurred and inert as a teaser behind a lock and the upgrade CTA, using built-in placeholder data (a `months` override still wins). |
| `upsell` | `UpsellConfig` | No | | Locked-state copy + upgrade handler, `{ title?, description?, ctaLabel?, onUpgrade? }`; merged field-by-field over the card's default copy, then the generic fallback. `ctaLabel` and `onUpgrade` are the tenant's upgrade wording and handler. |
## States [#states]
- **Loading.** The card is being fetched.
- **Success.** Monthly cash in, cash out and net cashflow.
- **Empty.** No cashflow data for the range.
- **Error.** The report couldn't be loaded.
- **Locked.** Viewer isn't entitled to the report — a built-in placeholder teaser renders blurred behind the upgrade prompt. Pass `upsell` to customize the copy and wire `onUpgrade`.
Force a state with the `state` prop.
# Chart of Accounts (/components/react/chart-of-accounts)
Styled, drop-in chart of accounts — sort code, name, a type tag and subtype, one row per ledger with children indented under their parent.
The header carries a type filter and an "Add ledger" button that reveals the new-ledger form above the table, like Add account. Clicking a row opens its details in place as plain text, in the edit form's grid, with Edit where the form has Save; Edit swaps the text for the form's inputs. Each row's menu edits the ledger, adds a child or deletes it, and the row opens in place for that too: the edit form, the new child's form or a one-line delete confirm. A system ledger (one the API sends with `is_deletable: false`) can only be renamed: its edit form locks every other field, and Delete stays in the menu, disabled, with the tooltip "System ledgers cannot be deleted". It manages the chart only: no report or ledger table renders inside it. Pass `onViewAccount` and each row also offers View report, which hands you the ledger to route wherever you show it. Hovering a name shows the ledger's description. Covers loading, error, empty and success, and keeps just the sort code and name on a narrow card.
Built on the headless [`ChartOfAccounts`](/components/sdk/chart-of-accounts) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetChartOfAccounts } from "@get-asset/react";
fetchToken(businessId)}
>
{/* onViewAccount is optional — without it, rows have no View. */}
router.push(`/reports/ledger-statement/${ledgerId}`)}
/>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `ledger:read`
- `ledger:create`
- `ledger:update`
- `ledger:delete`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | |
| `title` | `string` | No | `"Chart of accounts"` | The card's heading. A household business might call the same list "Categories" (and pass `noun="category"`). |
| `showTaxCategory` | `boolean` | No | `false` | Adds a Tax category column, and the tax category field to the ledger form, for businesses that file from these ledgers. |
| `hideCreate` | `boolean` | No | `false` | Hides "Add ledger", for a host that only lets a chart be read and tidied. "Add child" stays in the row menu while the token allows it. |
| `rowActions` | `readonly ChartOfAccountsRowAction[]` | No | | The host's own actions on a ledger, added to each row's menu before Delete — e.g. an app with private access moving a ledger's line entries. Each is `{ label, onSelect(ledger), hidden?(ledger) }`; `hidden` leaves the action off the rows it doesn't apply to. |
| `noun` | `string` | No | `"ledger"` | What a ledger is called in the chart's copy ("Add ledger", "Delete ledger"); a household's chart might say "category". |
| `defaultTypeFilter` | `LedgerType \| "all"` | No | `"all"` | Initial type filter. A child ledger is its parent's type, so it is shown with its parent. |
| `defaultCreating` | `boolean` | No | `false` | Open the create draft on mount. |
| `defaultEditingId` | `string` | No | | Open this ledger's edit draft once the chart has loaded — the deep link to editing one ledger. |
| `onViewAccount` | `(target: LedgerViewTarget) => void` | No | | Called with `{ ledgerId, type, subtype }` when a row's View report is chosen — the host decides where that goes (its ledger statement report, or the Transactions component filtered by type and subtype). `ViewAccountTrigger` renders nothing without it or `viewAccountHref`, so there's no dead View report. |
| `viewAccountHref` | `(target: LedgerViewTarget) => string` | No | | The URL of a ledger's report. `ViewAccountTrigger` then renders a link, so Cmd/Ctrl-click, middle-click and Copy link work. A plain click still goes to `onViewAccount` when there is one (a client-side route, say); without one the browser follows the link. |
| `onCreated` | `(ledger: LedgerPublic) => void` | No | | Called with the ledger a create wrote — for a host's own confirmation. |
| `onUpdated` | `(ledger: LedgerPublic) => void` | No | | Called with the ledger an edit wrote. |
| `onDeleted` | `(ledgerId: string) => void` | No | | Called with the id of the ledger a delete removed. |
| `ledgers` | `LedgerOverride[]` | No | | Override fetched ledgers for testing/storybook/prototypes. Skips the API entirely: adds, edits and deletes change a local copy of these, so a prototype works end to end. Ordered and nested as live data is. A delete is refused while the ledger has children or sets `deletable: false`, as the API refuses those; `deletable: false` makes it a system ledger, whose edit can change only its name. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. Skips every request. |
## States [#states]
- **Loading**
- **Success**
- **Empty.** No ledgers yet.
- **Error**
- **Creating.** The new-ledger form, revealed above the table.
- **Editing.** A ledger's edit form, open in its own row.
# Chat (/components/react/chat)
Styled, drop-in chat with the bookkeeping agent, a card holding a titled header over a scrolling transcript, above a composer pinned to the bottom.
Styled, drop-in chat with the bookkeeping agent — a card holding a titled header over a scrolling transcript, above a composer pinned to the bottom. Owner messages sit right as bubbles; replies read as prose on the left, with their source, follow-up prompts, and feedback controls stacked underneath. Replies stream in token by token and the thread keeps itself scrolled to the newest one. Enter sends, Shift+Enter adds a newline, and the send button becomes a stop button while a reply is generating. Covers loading, error, empty, and success.
Built on the headless [`Chat`](/components/sdk/chat) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetChat } from "@get-asset/react";
fetchToken(businessId)}>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `chat:create`
- `chat:read`
- `chat:update`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | |
| `logo` | `React.ReactNode` | No | | Mark shown above the greeting on the resting view — typically the business's logo. Omitted entirely when not supplied. |
| `onAttach` | `() => void` | No | | Provide to show an attach control in the composer. The chat API accepts text only, so nothing is wired up by default — supply a handler and own the upload yourself. |
| `chatId` | `string` | No | | An existing conversation to continue. Its transcript is fetched and rendered on mount, and swapping this for another id opens that one in place. Omit to start fresh — the chat is created lazily on the first message, so mounting the component doesn't leave empty chats behind. Chat ids look like `ach_…`. |
| `prompt` | `string` | No | | Send a message supplied by another input. Each non-empty prompt is sent once; clear the prop before sending the same prompt again. |
| `greeting` | `string` | No | `"Good morning/afternoon/evening, {business}"` | Greeting shown above an empty transcript. Defaults to a time-of-day greeting addressed to the business ("Good afternoon, Northwind Cabinetry"), whose name is fetched; pass a string to override it entirely. |
| `subtitle` | `string` | No | `"Ask anything about your business finances — I'll give you a clear answer, backed by your real numbers."` | Sentence under the greeting explaining what the agent can answer. |
| `thinking` | `string` | No | `"Reading your books…"` | Line shown beside the animated dots while a turn is running but no reply text has arrived yet. |
| `placeholder` | `string` | No | `"Ask anything about your business…"` | Composer placeholder. |
| `disclaimer` | `string` | No | `"Answers are generated from your books and may include inaccuracies."` | Small print under the composer, once a conversation has started. |
| `title` | `string` | No | | The conversation's title, shown in the header. Defaults to the opening question, falling back to the matching history entry's label; pass a string to own it yourself, in which case renaming is up to you. |
| `onBack` | `() => void` | No | | Called when the header's back control is used. Back already returns to the resting view on its own, so this is a notification — mirror it into a URL, or navigate elsewhere as well. |
| `onExport` | `(messages: ChatMessage[], title: string) => void` | No | | Called when the transcript is exported. Defaults to downloading it as a markdown file; supply a handler to export it your own way. Wired to the header's download control (`Chat.Export` in the headless parts). |
| `onGraphExport` | `(graph: ChatGraph) => void` | No | | Called when a graph card is exported. Defaults to downloading its numbers as CSV; supply a handler to export it your own way. Wired to the headless `Chat.GraphExport` slot — the styled `AssetChat`'s own download control exports the whole graph card as an SVG image instead, so it doesn't call this. |
| `onForecastExport` | `(forecast: ChatForecast) => void` | No | | Called when a forecast card is exported. Defaults to downloading its numbers as CSV; supply a handler to export it your own way. The styled `AssetChat`'s own download control exports the whole forecast card as an SVG image instead, so it doesn't call this. |
| `history` | `ChatHistoryEntry[]` | No | | Past conversations for the history panel. Fetched from the API by default; pass an array to supply them yourself (or `[]` to skip the request entirely). |
| `defaultHistoryOpen` | `boolean` | No | `false` | Whether the history panel starts open. |
| `onSelectChat` | `(chatId: string) => void` | No | | Called when a past conversation is picked. Picking one opens it in place, so this is a notification rather than a handler you have to implement — useful for mirroring the choice into a URL. |
| `resume` | `boolean` | No | `true` | Rejoin a turn that was still streaming when the page reloaded, or one still running in a conversation opened from the history panel. Resume is best-effort and covers the current turn only — older turns come from the transcript. |
| `onChatCreated` | `(chatId: string) => void` | No | | Called with the new chat's id the first time a chat is created — persist it to reopen the conversation later. |
| `onFinish` | `(message: ChatMessage) => void` | No | | Called with the finished assistant message at the end of each turn. |
| `state` | `"thinking" \| "loading" \| "error" \| "empty" \| "success" \| "streaming" \| "turn-error"` | No | | Force a specific view for testing/storybook. |
| `messages` | `ChatMessage[]` | No | | Override the transcript (skips the API call). Also supplies the transcript shown under a `state` override. |
## States [#states]
- **Loading.** Hydrating an existing conversation.
- **Error.** The conversation couldn't be loaded.
- **Empty.** The greeting and the composer, before the first message.
- **Success.** An answered question — the reply's source line, follow-ups, and copy control.
- **With graphs.** A question answered with graph cards as well as prose — a bar chart comparing categories and a line chart tracking a trend, each with its summary, legend, and provenance line.
- **With a forecast.** A forward-looking answer carrying a cash projection — booked history solid, the projection dashed, the likely range shaded, and the readiness and driver assumptions behind “See details”.
- **Thinking.** The turn is running but no reply text has arrived — the agent is typically calling a report tool. Send swaps to Stop.
- **Streaming.** Reply text arriving token by token.
- **Turn error.** The turn failed; Try again resends the same message.
## Anatomy of a reply [#anatomy-of-a-reply]
Replies are markdown — paragraphs, bold section leads, bullet lists, and inline code, which is how figures reach the page (`` `$63,880` `` renders as a value rather than prose). Anything outside that set falls through as plain text.
Everything else around the answer is optional. A `source` line under the answer comes from the reply’s metadata; the follow-up prompts beneath it come from its suggestions, and clicking one sends it as the next question.
## Graphs [#graphs]
For a comparison question the agent may answer with a graph as well as prose. It renders as a card under the answer: the title and summary, the chart with its legend, and the provenance line beneath. A `bar` graph compares categories (a label above each bar); a `line` graph tracks each series across an ordered axis. The card picks the shape from the graph’s type — you drop in one `AssetChat` either way.
Graphs are persisted on the reply, so a conversation reopened from history draws them again. The download beside the title saves the whole card as an SVG image — title, chart, legend, and footnote, composed from the live layout with the theme’s colours inlined so it stands alone. Colours come from the `--asset-chart-series-*` tokens — a fill and outline per series for bars, a saturated `line` stroke for lines, assigned by recency so the most recent series leads in purple (with the area gradient on lines) and earlier ones fall to the muted colours — so a chart takes the host’s palette like everything else.
## Forecasts [#forecasts]
A forward-looking answer may carry a forecast card. A **projection** charts one scenario over time: booked history draws as a solid line, the projection continues it dashed from “today”, and the P10–P90 likely range is shaded behind — for a cash forecast a $0 line marks the floor to watch. A **comparison** draws a line per scenario over the projected periods only, the base one emphasised — no history/projection split, since scenarios are identical over the past. The card picks its shape from the forecast’s type; you drop in one `AssetChat` either way.
Beneath the chart, “See details” reveals the forecast’s *readiness* — a confidence badge, a plain-English assessment, and, when the agent needs input, tappable question chips that send an answer back into the forecast — and its *drivers*, the assumptions the number was built from, formatted by kind (a ratio as a percentage, days as days, the rest as amounts). The download beside the title saves the whole card as an SVG, the same as a graph.
## Header [#header]
The header holds a back arrow, the conversation’s title, a download, and the history toggle. Every part bar the toggle renders only once there’s a conversation, so the resting view keeps the bare toggle. The back arrow returns to that resting view — a fresh conversation — with no wiring; pass `onBack` only if you also want to navigate or update a URL. The title is read-only.
## Sizing [#sizing]
The chat is a `Card` like every other component, so it takes the same border, radius, and background from the theme. Unlike the others it fills the height it is given and sits at that height throughout — the resting view is already full height, so opening a conversation fills the transcript in and scrolls rather than resizing the card. Give the parent a height (a fixed-height box, a flex child, or a grid cell); with no height to fill it falls back to a 420px minimum and grows with its content.
## Mobile [#mobile]
When the chat is wide the history panel sits beside the conversation. Once it narrows past 720px — a small screen, or the component dropped into a narrow column — opening history takes over the whole card as an overlay instead of a cramped side panel, with its own close button (the header’s history toggle is covered while it’s open). It’s a container query on the chat’s own width, not the viewport, so a narrow embed on a wide page behaves the same as a phone.
# Classification Rules (/components/react/classification-rules)
Styled drop-in component.
List active and archived business classification rules, read their conditions and actions, and archive, restore or undo an archive. Add and Edit hand off to your own editor.
Built on the headless [`ClassificationRules`](/components/sdk/classification-rules) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetClassificationRules } from "@get-asset/react";
import "@get-asset/react/styles.css";
openEditor()}
onEditRule={ruleId => openEditor(ruleId)}
/>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `classification_rule:read`
- `classification_rule:update`
- `external_account:read`
- `ledger:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `formatAmount` | `(value: number) => string` | No | US dollars ("$1,234.50") | Money inside a sentence. |
| `formatDate` | `(value: string) => string` | No | "Aug 10" (month and day, read in UTC) | Dates in the meta columns and inside a sentence. |
| `className` | `string` | No | | Additional class on the component shell. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. Skips the API reads. |
| `rules` | `TxnClassificationRulePublic[]` | No | | Override fetched rules for testing/storybook. Skips the API reads. Rules the editor can't hold whole are left out. |
| `missingLedgerIds` | `string[]` | No | | Additional ledger ids to treat as gone, so the missing-category chip can be exercised without the business's ledger list. Applies to overridden and fetched rules, on top of the fetched ledger list. |
| `view` | `"active" \| "archived"` | No | | Controlled tab. Pair with `onViewChange` to own it; without it the tabs still move locally. |
| `defaultView` | `"active" \| "archived"` | No | `"active"` | Tab shown before the first switch (uncontrolled). |
| `onViewChange` | `(view: ClassificationRulesView) => void` | No | | Called when the selected view changes. |
| `onAddRule` | `() => void` | No | | Open the host's own rule editor in create mode. |
| `onEditRule` | `(ruleId: string) => void` | No | | Open the host's own rule editor for this rule. |
| `pageSize` | `number` | No | `25` | Rules per API request. |
| `hasMore` | `boolean` | No | | Override whether a "load more" affordance shows. Only takes effect with `rules` or `state` (otherwise it follows the API's pagination). |
| `hasRules` | `boolean` | No | | Override whether the business has any rule at all (either view), which is what keeps the view tabs shown. Only takes effect with `rules`. |
## Behaviour [#behaviour]
The host owns navigation between the list and the editor. Archive and restore writes update the list; cursor pagination retains loaded rules on a page failure.
# Classifications Editor (/components/react/classifications-editor)
Styled drop-in component.
Create or edit one business classification rule. Test run validates the draft and previews up to 10 changes without saving. Apply saves the rule and, by default, applies it to past transactions; onDone fires when the selected operation completes.
Built on the headless [`ClassificationsEditor`](/components/sdk/classifications-editor) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetClassificationsEditor } from "@get-asset/react";
import "@get-asset/react/styles.css";
closeEditor(savedRule)}
onCancel={() => closeEditor()}
/>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `classification_rule:read`
- `classification_rule:create`
- `classification_rule:update`
- `merchant:read`
- `ledger:read`
- `tag:read`
- `external_account:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `formatAmount` | `(value: number) => string` | No | US dollars ("$1,234.50") | Money inside a section's summary and signed preview transaction amounts. |
| `formatDate` | `(value: string) => string` | No | "Jul 1" (month and day, read in UTC) | Dates inside a section's summary and preview rows. |
| `className` | `string` | No | | Additional class on the editor shell. |
| `onSave` | `(value: RuleDraft) => void \| Promise` | No | | Own the write. Called with the edited draft when `Save` is pressed, instead of the editor's own request — return a promise and the editor shows its saving state until it settles, and reports a rejection through `SaveError`. The draft's row keys are this mount's own; `toCreateRequest` / `toUpdateRequest` turn it into the API's body. No apply run is started: the host owns persistence and `onDone` fires after this callback resolves. |
| `onSaveSuccess` | `(value: RuleDraft) => void` | No | | Called after a save succeeds — whichever path wrote it — with the draft as submitted. The stored rule, when the editor wrote it, arrives on `onDone`. |
| `saveLabel` | `string` | No | `"Apply"` | Idle copy on the save button. While saving or applying it reads "Applying…" with history checked, or "Saving…" when unchecked. |
| `ruleId` | `string` | No | | The saved rule to edit. Absent, the editor creates one. |
| `onDone` | `(rule?: TxnClassificationRulePublic) => void` | No | | Called with the stored rule after its apply run completes, or immediately after saving when `applyToHistory` is false. When `onSave` owns the write, it is called without a rule once that callback resolves. |
| `onCancel` | `() => void` | No | | Host navigation callback for Cancel and the back button. |
| `explainer` | `boolean` | No | `true` | Whether the dismissible explainer banner is offered at all. |
| `state` | `"loading" \| "error"` | No | | Force the editor state and skip network activity. |
| `rule` | `TxnClassificationRulePublic` | No | | Override the fetched rule and enter edit mode. Skips its API call. |
| `merchants` | `MerchantPublic[]` | No | | Override the fetched merchants. Skips their API call. |
| `ledgers` | `LedgerPublic[]` | No | | Override the fetched ledgers. Skips their API call. |
| `tagFields` | `TagFieldWithTagValuesPublic[]` | No | | Override the fetched tag fields. Skips their API call. |
| `accounts` | `ExternalAccountPublic[]` | No | | Override the fetched external accounts. Skips their API call. |
| `preview` | `ClassificationsEditorPreview` | No | | Offline panel override: `{ state: "idle" \| "running" \| "results" \| "empty" \| "error", changes?: TxnClassificationRuleChangePublic[], stale?: boolean }`. Skips all reads and writes. |
| `build` | `ClassificationsEditorBuild` | No | | Offline fixture: `{ state: "typed" \| "building", text }`, `{ state: "built", text, rule }`, or `{ state: "stale", text, builtText, rule }`. Built and stale fixtures replace the steps and fill every step without saving. Skips all reads and writes. |
| `applyState` | `"applying" \| "error"` | No | | Offline apply override. `"applying"` locks the form; `"error"` exposes the footer retry action. Skips all reads and writes. |
| `onSaveError` | `(error: Error) => void` | No | | Called when a save fails, with the same error `SaveError` renders. The generated client rejects with the parsed error body rather than an `Error`, so this is normalised into one — the body rides along as `cause`. |
| `saving` | `boolean` | No | | Force the saving state — storybook/tests. Otherwise it follows the write in flight. While saving, `Save` is disabled. |
| `saveError` | `Error` | No | | Force the save-error state — storybook/tests. A real one only appears after a failed write, which needs an edit and a press to reach, so the state isn't otherwise renderable on its own. |
| `disabled` | `boolean` | No | | Make the whole card inert (e.g. the viewer can't change the setting). |
| `editable` | `boolean` | No | `true` | Whether the setting can be changed here. Pass false and the controls go inert and `Save` isn't rendered at all. Different from `disabled`, which keeps the button on screen but unpressable — that says "not now", where this says "not here". Use it for a viewer who can see the rule but has no business editing it. |
## Behaviour [#behaviour]
Describe the rule starts empty in create and edit mode. Build rule posts the trimmed description (up to 2,000 characters) and waits while the build is pending. Building locks the form and dims all three steps. A successful build replaces every step, including hand edits, and collapses every section. It never saves or calls onSave; Apply still saves to the same rule in edit mode.
After a successful build, changing the description dims the steps and offers Rebuild. Editing steps by hand does not dim them. Blank text, building, a locked form, or text identical to the last successful build disables Build. Failed requests, failed drafts, missing rules, and shapes the editor cannot hold leave the draft untouched with no message. Agent notes are never shown. Selecting another rule clears the description and build state; older build results are ignored.
The headless parts are Describe (wrapper), DescribeInput (bound textarea with asChild), Build (button), BuildLabel (current label), Building and BuildStale (gates), and Steps (wrapper with data-dimmed). The context exposes description, setDescription, build(), building, builtText, buildStale, canBuild, and buildLabel. The build prop supplies offline typed, building, built, or stale fixtures; built and stale fixtures include the unsaved create body. Building uses classification_rule:create and polling uses classification_rule:read, already included in the editor scopes.
“Apply to past transactions” appears directly below Action, checked on every mount. Uncheck it to save without applying: edits preserve the rule’s active or archived state, the button reads “Saving…”, the preview stays visible, and onDone fires after saving. An unchanged draft cannot be saved with the checkbox unchecked. The checkbox is disabled while the form is locked and hidden when onSave owns the write.
onSave overrides the write and does not start an apply run. Use onSaveSuccess for a save notification and onDone to leave the editor after applying completes. With the checkbox checked, Apply activates saved rules, including unchanged inactive rules. If checking the run's progress fails, pressing it again resumes the same run; a terminal failed run or refused run request starts a new run without resaving an unchanged active rule.
Editing after a test run keeps its results with a plain bordered notice above the results: “The rule changed since this run.” Selecting a different rule clears the preview and apply state.
# Customers (/components/react/customers)
Styled, drop-in Customers directory, with name, email, phone and an active/disabled status dot per row.
The header carries a name search, an Active/Disabled filter, and an "Add customer" button that reveals a panel above the table; each row's kebab offers Edit, which expands the same form from the row, and Disable. Name is the only required field. Covers loading, error, empty and success, and restacks onto a narrow layout via a container query.
Built on the headless [`Contacts`](/components/sdk/contacts) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetCustomers } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `customer:read`
- `customer:create`
- `customer:update`
- `vendor:read`
- `vendor:create`
- `vendor:update`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | |
| `pageSize` | `number` | No | `25` | Rows per request. Further pages are fetched by `LoadMore`. |
| `contacts` | `ContactOverride[]` | No | | Override the fetched contacts (skips the API call). The search and active/disabled filters are still applied, client-side, so an offline story behaves like the live component. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. Also skips the API call. |
| `hasMore` | `boolean` | No | | Force the `LoadMore` affordance to render. Only consulted alongside `contacts` — live, pagination comes from the API's next page token. |
| `defaultCreating` | `boolean` | No | `false` | Open the add-contact draft on mount. |
## States [#states]
- **Loading.**
- **Success.**
- **Empty.** No customers yet — the state offers the add action.
- **Error.**
- **Adding.** The add panel, revealed above the table.
- **Disabled listing.** Switching the filter to Disabled shows the other listing.
## Behaviour [#behaviour]
Typing in the search box filters on the customer's name and is debounced before the list is re-requested, so the table doesn't flash a loading state on every keystroke. The Active/Disabled dropdown switches between two listings rather than widening one, so every row in view carries the same status.
A disabled customer drops out of the default listing and out of pickers, but the invoices already raised against it are untouched, and the same menu item re-enables it. Adding and editing share one form: only **Name** is required, and a cleared email or phone is saved as empty rather than left behind.
The empty state adapts to why it's empty — a search that matched nothing offers to clear it, the disabled listing says everyone is active, and a genuinely empty directory offers the add action.
Every value, control and gate is a slot on the headless compound. See the [Contacts part inventory](/components/sdk/contacts#api) to rearrange the layout or swap the primitives, and [`AssetVendors`](/components/react/vendors) for the same surface over vendors.
# Date Picker (/components/react/date-picker)
One styled trigger for both jobs, a calendar period or a custom range.
The popover puts a segmented Period / Custom switch above the active panel — the period grid or the range calendar. Both edit the provider's single date range, so switching modes changes the view and never the selection. That range is what every date-driven component reports on, so a choice here moves the whole page. Pinned to `day`, the same trigger picks one day: the end of the provider range, which a pick collapses onto that day.
Built on the headless [`DatePicker`](/components/sdk/date-picker) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetDatePicker } from "@get-asset/react";
```
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `mode` | `"period" \| "range" \| "day"` | No | | Locks the picker to one panel and hides the mode switch. Omitted, the `period` and `range` panels are offered behind the switch; `day` is never behind the switch and only ever comes pinned. Mount `"period"` on a surface built around period-over-period comparisons, so the range always names a month, quarter or year. `"day"` is a single-day calendar bound to the provider as a one-day range, unless `value` and `onValueChange` are given. |
| `value` | `CalendarDateString` | No | | `day` mode only, together with `onValueChange`: the selected day as `YYYY-MM-DD`, or `""` for none. Makes the picker a controlled field that never touches the provider range. Not accepted without `mode="day"`. The selected day as `YYYY-MM-DD`, or `""` for none. Makes the picker a controlled field that never touches the provider range; give it with `onValueChange`. |
| `onValueChange` | `(value: CalendarDateString) => void` | No | | `day` mode only, together with `value`: receives the picked day as `YYYY-MM-DD`. Not accepted without `mode="day"`. Receives the picked day as `YYYY-MM-DD`. Its presence alone decides controlled vs provider-bound; give it with `value`. |
| `min` | `CalendarDateString` | No | | Earliest selectable date, inclusive. Applies to every mode. Must be on or before `max`, otherwise the picker throws. |
| `max` | `CalendarDateString` | No | | Latest selectable date, inclusive. Applies to every mode. Must be on or after `min`, otherwise the picker throws. |
| `disabled` | `boolean` | No | | Disables the trigger and every panel. |
| `className` | `string` | No | | Class on the trigger button. |
## Modes [#modes]
Every date-driven component under the provider follows the committed range, unless it was detached with its own `dateFrom`/`dateTo` props. Cards that compare against a previous period only do so period-over-period when the range names one, so mount `mode="period"` on a surface built around those comparisons; a custom range is compared against the same number of days immediately before it.
Opening lands on the mode that matches what is selected: an exact calendar year, quarter, or month opens on Period, anything else on Custom. In Custom the first click picks the start, the second writes both provider dates together, and the third starts a new range; closing mid-pick discards it. In Period a choice applies as it is made and the panel stays open. A fixed `mode` always opens on its own panel.
`mode="day"` is for a surface reported as of one day, such as a trial balance or an aged report. The trigger shows the end of the provider range (`Mar 15, 2026`), the day the page reports on, so seed the provider with a `dateTo` on or before `max`. The calendar opens on its month with that day selected, and a pick sets the provider range to that one day and closes the popover. Given `value` and `onValueChange` it is instead a controlled field for a form, which neither reads nor writes the provider range.
# Document Details (/components/react/document-details)
Statement details with reconciliation, buffered transaction edits, and PDF or image preview.
Other document types render the not-available state.
Built on the headless [`DocumentDetails`](/components/sdk/document-details) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetDocumentDetails } from "@get-asset/react";
import "@get-asset/react/styles.css";
import "@get-asset/react/theme.css";
// Render within AssetProvider.
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `document:read`
- `document:update`
- `external_account:read`
- `ledger:read`
- `journal_entry:read`
- `journal_entry:create`
- `journal_entry:update`
- `journal_entry:delete`
- `transaction:read`
- `transaction:update`
- `transaction:delete`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Added to the outer statement surface element. |
| `documentId` | `string` | Yes | | The document to load. Changing it discards the previous document's edit session. |
| `onBack` | `() => void` | No | | Called by Back to documents. The host owns navigation. |
| `formatAmount` | `(amount: number) => string` | No | USD with two decimals | Money formatter for balances, transactions, and banner amounts. |
| `formatDate` | `(date: string) => string` | No | "Apr 30, 2026" style (month abbreviation, day, year) | Formats displayed dates, including the styled edit-mode date field. Input values retain `YYYY-MM-DD` calendar dates. |
| `fallbackLedgerId` | `string` | No | | Host-provided offset ledger ID for new rows, for either amount direction. Takes precedence over the legacy `Uncategorized Inflow` / `Uncategorized Outflow` name lookup (`LedgerPublic` has no unique uncategorized-ledger marker). If neither resolves, Save is disabled with the standard save error until the offset is available or the new row is removed. |
| `onSave` | `(draft: DocumentDetailsDraft) => void \| Promise` | No | | Replaces statement server writes. Useful for offline demos. Reject to show the save error; the raw cause remains attached to the error. |
| `onSelectAccount` | `(id: string) => void \| Promise` | No | | Replaces the immediate account-association write. Account selection is separate from the edit buffer. |
| `document` | `DocumentPublic` | No | | Offline document override. Disables all network reads and server writes. Balances come from `metadata_.statement_starting_balance` and `metadata_.statement_closing_balance`. |
| `rows` | `JournalEntryEacPublic[]` | No | | Overrides journal entries, including their `line_entries`. Otherwise every page is fetched using `document_id`. Supply `accounts` and `ledgers` with offline rows to derive signed amounts. |
| `transactions` | `TransactionPublic[]` | No | | Overrides backing transaction reads. Their amounts establish the sign convention for transaction-backed row edits. Otherwise fetched by `transaction_id`; a `document` override keeps these reads offline too. |
| `accounts` | `ExternalAccountPublic[]` | No | | Overrides external accounts for the immediate-save picker and the statement account's `ledger_id`. |
| `ledgers` | `LedgerPublic[]` | No | | Overrides ledger lookup. Its `debit_credit` determines the signed statement amount. New rows prefer `fallbackLedgerId`, then look up `Uncategorized Inflow` or `Uncategorized Outflow` by name. |
| `previewUrl` | `string \| null` | No | | Overrides the signed URL request; `null` explicitly supplies no URL. The file extension is always read from `document.name`. |
| `state` | `"loading" \| "error"` | No | | Forces a display state and disables network reads. |
## Layout and mobile [#layout]
Desktop shows document details and the file side by side. Below 960px, View document opens a dedicated preview screen; Back to details returns to the detail body. Zoom and the open-original link are the only file tools. Previewing a file preserves unsaved edits.
## File preview [#file-preview]
PDF files load React-PDF dynamically and show every page, with range requests disabled. The renderer configures the installed PDF.js worker using a bundler-resolved URL in the same ESM module. Both package entry formats defer that import. Annotation and text layer styles are included in styles.css. JPG, JPEG, and PNG files render as images. Other extensions show Preview not available for this file type.
## Saving and permissions [#saving]
Statement changes stay local until Save. Every row allows date, description, and amount edits. Save applies your staged edits to the document. If a save fails partway, the writes that already completed stay saved and the remaining edits stay locked until you retry Save, which processes only what is left, or press Cancel, which discards the outstanding edits. Account selection saves immediately outside that buffer. Transaction amount changes rebuild journal entries asynchronously; the post-save refresh may briefly show the old amount or omit an entry while it is rebuilt. When rows are missing after an amount save, the component keeps refreshing until every updated transaction has a row, and stops when this document closes. Processing documents refresh until their status changes.
DocumentDetails.scopes lists all required permissions, including external_account:read, ledger:read, and transaction:read for account choices, ledger lookup, and backing transaction amounts. The SDK and styled component require the same scopes.
# Documents (/components/react/documents)
Styled, drop-in documents table with description, file name, date, source, a status dot, and a type chip per row.
Styled, drop-in documents table — description, file name, date, source, a status dot, and a type chip per row. A drag-and-drop upload zone (desktop) / header upload button (mobile) sits above the list; use the kebab for Preview / Download / Delete, with Delete opening an inline confirm and Preview opening the full-screen lightbox. Responsive via a container query; covers loading, error, empty, and success.
Built on the headless [`Documents`](/components/sdk/documents) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetDocuments } from "@get-asset/react";
fetchToken(businessId)}>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `document:read`
- `document:create`
- `document:delete`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer `Card` wrapper element. |
| `title` | `string` | No | `"Documents"` | Override the card heading. |
| `uploadHint` | `string` | No | `"PDF, JPG, PNG, XLS, CSV, TXT, or HEIC. Max 25 MB per file."` | Override the dropzone hint copy (file types + size limit). |
| `documentType` | `"receipt" \| "statement" \| "other" \| "payroll" \| "bill" \| "mileage" \| "invoice" \| "check"` | No | | Filter by type (`receipt`, `statement`, `payroll`, `bill`, `mileage` or `other`). Passed straight to the API. |
| `transactionId` | `string` | No | | Filter to documents linked to a transaction. Passed straight to the API. |
| `externalAccountId` | `string` | No | | Narrow the list to documents belonging to one external account. The list endpoint takes no such filter, so this is applied client-side over the fetched page — which also means it narrows a `documents` override. Matches either `external_account_id` or `external_account_ids`. |
| `taskId` | `string` | No | | Attach uploads to a task, so the document records which request it answers (`DocumentPublic.task_id`). The accounts reconciliation drill-down passes the open statement request here. |
| `onUpload` | `(type?: DocumentType) => void` | No | | Provide to handle uploads yourself — the built-in dropzone upload and queue is skipped. Also invoked by ``. |
| `onDelete` | `(documentId: string) => void` | No | | Provide to handle deletion yourself — the built-in delete mutation is skipped. Called when a document deletion is confirmed. |
| `onDownload` | `(documentId: string) => void` | No | | Provide to handle download yourself — the built-in signed-URL fetch and browser download is skipped. |
| `onViewDetails` | `(documentId: string) => void` | No | | Called when the user picks "View details" on a row — the host renders its detail view (e.g. `DocumentDetails`) for that document. Only statements with a detail view show the action. Without the callback the action is absent from the row menu (`ViewDetailsAction` renders nothing). |
| `onViewEntries` | `(documentId: string) => void` | No | | Called with the document's id when the user picks "View receipt" or "View payroll" on a receipt or payroll row. Without it the action is absent. |
| `onViewBill` | `(documentId: string) => void` | No | | Called with the document's id when the user picks "View bill" on a bill row. Without it the action is absent. |
| `onViewInvoice` | `(documentId: string) => void` | No | | Called with the document's id when the user picks "View invoice" on an invoice row. Without it the action is absent. |
| `pageSize` | `number` | No | `20` | Rows per page, 1–100 (the API's limit). |
| `documents` | `DocumentPublic[]` | No | | Override the fetched list (skips the API call) — storybook/tests. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. |
| `confirmingRowId` | `string \| null` | No | | Seed the delete-confirm panel for this row's document id (storybook/tests). |
| `previewRowId` | `string \| null` | No | | Seed the lightbox open for this row's document id (storybook/tests). |
| `signedUrlOverride` | `string` | No | | When provided, Lightbox uses this URL as the signed URL and skips the getDocumentSignedUrl query entirely — keeps storybook offline. |
| `uploadItems` | `UploadItem[]` | No | | Seed the upload queue (storybook/tests) — when provided no real uploads run on mount. |
| `maxFileSize` | `number` | No | 25 * 1024 * 1024 (25 MB, `DEFAULT_MAX_FILE_SIZE`) | Per-file size ceiling in bytes for the dropzone. |
## States [#states]
- **Loading.**
- **Error.**
- **Empty.** No documents found.
- **Uploading.** Seeded upload chips covering uploading, success, and error states.
- **Mobile.** Narrow container preview of the responsive stacked layout.
# Expenses Card (/components/react/expenses-card)
Drop-in styled card for the period's expenses and the change versus the prior period.
A decrease reads as a positive tone; an increase as negative. The reporting range defaults to the AssetProvider's shared range (driven by the DatePicker), and the comparison mirrors it — the previous month, quarter, or year for a period-shaped range, or the same number of days immediately before a custom one.
Built on the headless [`ExpensesCard`](/components/sdk/expenses-card) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetExpensesCard } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `report:read`
- `business:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card element. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed reporting range. Detaches the card from the provider's shared range entirely; must be paired with `dateTo` — passing one without the other throws. Use `periodDateRange` to derive the pair from a month, quarter, or year. Omit both and the card follows the provider's range, which the `DatePicker` drives. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of the fixed reporting range. Must be paired with `dateFrom`. The prior-period comparison mirrors whatever range resolves — the previous month, quarter, or year for a period-shaped range, or the same number of days immediately before a custom one. |
| `expenses` | `number` | No | | Override the fetched expenses, for testing/storybook. Skips the API call when provided (`previousExpenses` alone does not skip it). |
| `previousExpenses` | `number` | No | | Override the fetched prior-period expenses. Only takes effect together with `expenses`. |
| `state` | `"loading" \| "error"` | No | | Force a specific state for testing/storybook. Skips the API fetch. |
| `locked` | `boolean` | No | | Gate the report for a viewer who isn't entitled to it. Activates the `Locked` state (mutually exclusive with loading / error / success): the metric renders blurred and inert as a teaser behind a lock and the upgrade CTA. No report data is requested for a locked viewer — the teaser shows built-in placeholder data (a `expenses` override still wins). |
| `upsell` | `UpsellConfig` | No | | Customize the locked state's copy and action: `ctaLabel` and `onUpgrade` are the tenant's upgrade wording and handler; `title` / `description` default per report. Merged field-by-field over the card's default copy, then the generic fallback. |
| `onViewDetails` | `CardViewDetailsHandler` | No | | Callback fired when the viewer asks to see more details (e.g. to navigate to the full report). Makes `ViewDetails` render. Receives the card's resolved `{ range, period, basis }` — the range, the exact period it represents (`null` for a custom range) and the accounting basis — so the destination can open on the same window the card shows. |
| `basis` | `"accrual" \| "modified_cash"` | No | | Report on a specific accounting basis. Omit to inherit the provider's basis, which itself falls back to the Business's country default (Canadian Businesses report on accrual, everyone else on cash). Allowed values: `accrual` or `modified_cash` (shown as Cash). |
| `basisToggle` | `boolean` | No | | Let the end user flip between Cash and Accrual. Off by default — when off, `BasisSelect` renders nothing and the card reports on its resolved basis. Flipping moves every basis-aware component under the provider, so one screen never mixes bases. |
## States [#states]
- **Loading.**
- **Success.** Year-over-year decrease (positive tone).
- **Error.**
- **View details.** Pass `onViewDetails` to handle a request for more details (e.g. navigate to the full report). The callback receives the card's own range, period and basis — here it logs them to the console.
- **Locked.** Viewer isn't entitled to the report — a built-in placeholder teaser renders blurred behind the upgrade prompt. Pass `upsell` to customize the copy and wire `onUpgrade`.
## Accounting basis [#accounting-basis]
`AssetExpensesCard` reports on one of two accounting bases: **Accrual** (`accrual` on the wire), which counts invoices and bills when they are issued, or **Cash** (`modified_cash`), which counts them when the money moves. Cashflow components take no basis — cashflow is a cash concept.
The basis is resolved per component, first match winning:
- the card's own `basis` prop;
- the provider's basis — `defaultBasis` on `AssetProvider`, or whatever the toggle was last flipped to;
- the Business's country — Canadian Businesses report on Accrual, everyone else on Cash.
Only the last step costs a request — a Business read, which is why every basis-aware component's `scopes` includes `business:read` — and it is serial: the card holds its own fetch until the Business answers. One request is shared across every basis-aware component on the screen, but pass `defaultBasis` on [`AssetProvider`](/components/sdk/provider#basis) when you already know the basis and skip it entirely. If the lookup fails the card falls back to Cash and stays there — the Retry button re-runs the report, not the basis lookup.
`basisToggle` is off by default: no control renders in the header and the card reports on its resolved basis. Turn it on and flipping the control moves every basis-aware component under the provider with it, so the toggle can never leave a screen half cash and half accrual. A component pinned with its own `basis` prop is the exception — it keeps the basis you gave it and renders no toggle of its own, which is how you show both bases side by side on purpose.
# Global Receipts Config (/components/react/global-receipts-config)
Drop-in styled receipt-request setting with the rule's title and copy, one threshold row per country, and a Save that commits the lot.
Drop-in styled receipt-request setting: the rule's title and copy, one threshold row per country, and a Save that commits the lot. Each row is the same styled `AssetReceiptsThreshold` body, so a row looks and behaves identically whether it stands alone or sits in this list. The tenant's configs are read and written for you: `GET /v0/tenant/rules/receipts` fills the rows, and `Save` `PATCH`es the whole set back and reseeds the rows from the response, which puts the button to sleep again. `onSaveSuccess` / `onSaveError` tell you how it went — for a toast — and `onSave` takes the request over entirely.
Built on the headless [`GlobalReceiptsConfig`](/components/sdk/global-receipts-config) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetGlobalReceiptsConfig } from "@get-asset/react";
toast("Receipt settings saved")}
/>
```
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the card. |
| `emptyMessage` | `string` | No | `"No receipt thresholds set yet. Configured countries will appear here."` | Override the copy shown when no country has a threshold configured. |
| `title` | `string` | Yes | | The card's label, e.g. "Auto-request Receipts". |
| `subtitle` | `string` | Yes | | The line explaining what the rule does. |
| `note` | `string` | No | | A second line for who the setting applies to, e.g. "This is the default for your businesses." Optional: a card that speaks for one business has nothing to add here, and `Note` then renders nothing. |
| `thresholds` | `GlobalReceiptsConfigThreshold[]` | No | | Override the fetched configs, skipping the request entirely — for storybook, tests, or a host that already holds the setting. One entry per row: `{ id, title, subtitle, currency, amount, enabled }`. Seeds the draft and adopts every later change. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a state, skipping the request — storybook/tests. |
| `onSave` | `(value: GlobalReceiptsConfigThreshold[]) => void \| Promise` | No | | Own the write. Called with the edited draft when `Save` is pressed, instead of the card's own request — return a promise and the card shows its saving state until it settles, and reports a rejection through `SaveError`. Note the pairing: `onSave` *performs* the save, `onSaveSuccess` is *told* about one. A host that only wants to know it happened (a toast, say) wants the latter and should leave this one alone. Without it the card writes for itself and reseeds the draft from the response; with it, the draft stays dirty until the saved values come back in through the card's data prop (`setting` / `thresholds`). |
| `onSaveSuccess` | `(value: GlobalReceiptsConfigThreshold[]) => void` | No | | Called after a save succeeds — whichever path wrote it — with the draft as saved: the server-confirmed values when the card wrote, the submitted ones when `onSave` did. For a toast or a page-level "saved" marker; the card needs nothing back. |
| `onSaveError` | `(error: Error) => void` | No | | Called when a save fails, with the same error `SaveError` renders. The generated client rejects with the parsed error body rather than an `Error`, so this is normalised into one — the body rides along as `cause`. |
| `saving` | `boolean` | No | | Force the saving state — storybook/tests. Otherwise it follows the write in flight. While saving, `Save` is disabled. |
| `saveError` | `Error` | No | | Force the save-error state — storybook/tests. A real one only appears after a failed write, which needs an edit and a press to reach, so the state isn't otherwise renderable on its own. |
| `disabled` | `boolean` | No | | Make the whole card inert (e.g. the viewer can't change the setting). |
| `editable` | `boolean` | No | `true` | Whether the setting can be changed here. Pass false and the controls go inert and `Save` isn't rendered at all. Different from `disabled`, which keeps the button on screen but unpressable — that says "not now", where this says "not here". Use it for a viewer who can see the rule but has no business editing it. |
| `saveLabel` | `string` | No | `"Save"` | Override the copy on the save button. |
## States [#states]
- **Loading.** Reading the tenant's configs — a silhouette per row until they land.
- **Error.** The read failed: the copy stands, and Try Again refetches.
- **Empty.** The read succeeded, but no country has a threshold configured.
- **Default.** Save is inert until something differs — edit a threshold or flip a switch and it wakes up.
- **Rule off.** One row switched off: its threshold field dims and goes inert, and the card still saves the pair.
- **Saving.** `saving` — the rows go inert while the write is in flight.
- **Save failed.** The write was rejected: the rows and the edit survive, and a quiet line beside Save says so — a retry costs no retyping.
- **Disabled.** `disabled` — the whole card is frozen at its current setting.
## Behavior notes [#behavior-notes]
- One row per country in the payload. The response carries the setting only (`is_enabled`, `threshold_amount`), so each row's label, explanation and currency come from the SDK's country map — Canada in CAD, the United States in USD. A country the tenant hasn't configured gets no row.
- The rows edit a draft, not the server: a row commit (blur, Enter, a switch flip) moves the draft, and only Save writes — the whole set, in one PATCH. Save is inert while the configs load, while the read is failing, and until something actually differs.
- A failed write keeps the draft and says so in a quiet line beside Save — the same surface `AssetTransactionMatch` uses for a failed action — so a retry costs no retyping. A failed *read* replaces the rows instead: different problem, different surface.
- Save compares values rather than counting edits, so a threshold typed away from 30 and back to 30 leaves nothing to save and the button goes inert again.
- A row paints exactly like a standalone `AssetReceiptsThreshold` — same recessed `--asset-surface` row, same `--asset-card` field. This card adds layout around the rows, not colour of its own, so retheming a token moves both the same way.
- Below ~420px of row width each row changes shape: its switch comes up beside the title, with the subtitle and the threshold field full width underneath. The rows measure themselves, not the viewport, so the card reflows correctly in a narrow column on a wide page.
# Styled components (/components/react)
Drop-in cards built on top of @get-asset/sdk. Each one ships with a default look, full state coverage, and a CSS-variable theme system you can re-skin without touching component code.
## Components [#components]
- [Document Details](/components/react/document-details): Statement reconciliation, buffered edits, and file preview.
- [Classification Rules](/components/react/classification-rules): Active and archived rules with archive, restore and undo.
- [Classifications Editor](/components/react/classifications-editor): Create, edit, preview and apply a classification rule.
- [Accounts Card](/components/react/accounts): Connect panel + accounts table combined; refreshes on new connections.
- [Accounts List](/components/react/accounts-list): Connected accounts grouped by institution, with balances and reconnect.
- [Aged Payables](/components/react/aged-payables): Outstanding vendor balances grouped into aging buckets.
- [Aged Receivables](/components/react/aged-receivables): Outstanding customer balances grouped into aging buckets.
- [Ask](/components/react/ask): Free-text ask chip that expands into an input — embedded by the insights panel.
- [Balance Sheet Report](/components/react/balance-sheet-report): Hierarchical balance sheet table — assets, liabilities, equity.
- [Cashflow Card](/components/react/cashflow-card): Opening/closing balances across recent periods.
- [Cashflow Report](/components/react/cashflow-report): Hierarchical cashflow table — operating, investing, financing.
- [Chat](/components/react/chat): Streaming chat with the bookkeeping agent — transcript above a pinned composer.
- [Accounts Connect](/components/react/accounts-connect): Connect-method panel + business/personal confirmation step.
- [Customers](/components/react/customers): Customer directory — search, add, edit name / email / phone, and disable.
- [Date Picker](/components/react/date-picker): Period grid and range calendar behind one Period / Custom switch.
- [Documents](/components/react/documents): Uploaded documents in a table — description, file, date, source, status, type.
- [Bills](/components/react/bills): Payables table — status filter, row reconciliation, full view, and a create form.
- [Chart of Accounts](/components/react/chart-of-accounts): Ledgers table — type filter, add-ledger form, and edit, add child and delete in the row.
- [Book Health](/components/react/book-health): Months closed and verified across the year, with the open tasks blocking the rest.
- [Expenses Card](/components/react/expenses-card): Yearly expenses with year-over-year change. Decrease reads as positive.
- [Invoices](/components/react/invoices): Receivables table — status filter, row reconciliation, full view, and a create form.
- [Onboarding](/components/react/onboarding): Self-contained wizard that creates a business, then connects accounts.
- [Operating Expenses Card](/components/react/operating-expenses-card): Top expense categories with proportional bars.
- [Profit & Loss Card](/components/react/profit-loss-card): Month-by-month revenue and expense bars.
- [Profit & Loss Report](/components/react/profit-loss-report): Hierarchical P&L table with subtotals and account-level lines.
- [Global Receipts Config](/components/react/global-receipts-config): The whole receipt-request setting — a threshold row per currency and one Save.
- [Receipt Rules](/components/react/receipt-rules): A business's own rules for when a receipt is asked for on a ledger.
- [Receipt Rule Editor](/components/react/receipt-rule-editor): Create or edit one receipt rule: never, every time, or over an amount.
- [Revenue Card](/components/react/revenue-card): Yearly revenue with year-over-year change.
- [Snapshot Card](/components/react/snapshot-card): Revenue vs. expense snapshot with net profit.
- [Tasks](/components/react/tasks): Outstanding tasks grouped by type, with per-section counts and built-in row actions.
- [Transaction Match](/components/react/transaction-match): Payments panel for one invoice or bill — a searchable picker over the bank, matched one click at a time.
- [Transactions](/components/react/transactions): Reviewable journal-entry table with confirm and context actions.
- [Vendors](/components/react/vendors): Vendor directory — the same surface as Customers, over vendors.
- [Similar Transactions](/components/react/similar-transactions): Look-alike unconfirmed transactions ranked by group size, with confirm and correction actions.
## Guides [#guides]
- [Theming](/components/react/theming): Default and Slate themes, plus how to scope overrides.
- [CSS Variables](/components/react/variables): Every CSS custom property exposed by the styled layer.
# Invoices (/components/react/invoices)
Styled, drop-in accounts receivable — invoice date, description, customer, due date, the balance, a status tag and what settled it, one row per invoice.
The header carries a status filter and a "Create new invoice" button that reveals a form above the table; clicking a row expands a reconciliation of what it is worth, what has been matched and what that leaves, and the kebab offers the full view, a status change, a refund or a credit on a paid invoice, and delete. Covers loading, error, empty and success, and restacks onto a phone layout via a container query.
Built on the headless [`Invoices`](/components/sdk/invoices) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetInvoices } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `invoice:read`
- `invoice:create`
- `invoice:update`
- `invoice:delete`
- `customer:read`
- `customer:create`
- `ledger:read`
- `transaction:read`
- `external_account:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer `Card` wrapper element. |
| `matchCandidates` | `MatchCandidateOverride[]` | No | | Override the transactions the match picker offers, for previews and tests. Live, the panel queries them itself once a row with a balance is expanded — pass this alongside `invoices` to keep an offline story offline. An empty array is still an override, and shows the picker with nothing in it. |
| `intake` | `{ onCreated?: (id: string \| null) => void; }` | No | | Lets an invoice be raised from a document. Supplying it puts an Upload invoice control in the header (without it the header is create-only), hands the file to Asset, and refreshes the list once Asset has read it. `onCreated` fires with the new record's id. |
| `hideCreate` | `boolean` | No | `false` | Hides the "Create new invoice" button. For tenants that raise invoices in another system and push them in through the API — the list is then a record, not a place to author one. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed due-date window. Setting it detaches the list from the provider's shared range entirely; must be paired with `dateTo` (one without the other throws). Use `periodDateRange` to derive the pair from a month, quarter, or year. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of a fixed due-date window. Must be paired with `dateFrom`. Omit both to follow the provider's DatePicker-driven range. |
| `pageSize` | `number` | No | `25` | Rows per request. Further pages are fetched by `LoadMore`. |
| `defaultStatusFilter` | `InvoiceStatus \| "all"` | No | `"all"` | Initial status filter. `"all"` clears it. Live, the filter is a query parameter — the endpoint returns the matching invoices. |
| `defaultSelectedId` | `string` | No | | Expand this invoice's detail on mount. Lets a host deep-link straight to an invoice rather than making the user find it in the list. |
| `defaultViewingId` | `string` | No | | Open this invoice's full document view on mount — the deep link for "show me this invoice", where `defaultSelectedId` is "open its row in the list". |
| `defaultCreating` | `boolean` | No | `false` | Open the create draft on mount. |
| `invoices` | `InvoiceOverride[]` | No | | Override the fetched invoices (skips the list request). The status filter and period are not re-applied, so supply the rows you want shown. Used by storybook/tests. |
| `refunds` | `InvoiceRefundOverride[]` | No | | Override the refunds and credits on the invoices (skips their request). Each names its `invoiceId`, `kind` (`"refund"` or `"credit"`), `amount`, `datetime`, `matched` (a refund's bank match) and the `lines` it came off. Used by storybook/tests. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. Skips every request this compound makes, the customer and ledger directories included. |
| `showCurrency` | `boolean` | No | | Force the ISO code beside each amount on or off, skipping the business fetch (storybook/tests). By default it shows only for a business that holds money in more than one currency. |
| `hasMore` | `boolean` | No | | Force the `LoadMore` affordance to render. Only consulted while the list isn't being fetched (a data override or forced `state`) — live, pagination comes from the API's next page token. |
| `customers` | `CustomerOption[]` | No | | Override the selectable customers, which also resolves each row's customer name offline. Live, the directory is read once for the whole table; an overridden list still reads it while a draft is open, because supplying rows says nothing about the picker. |
| `ledgers` | `LedgerOption[]` | No | | Override the categories selectable on a draft line. Live, this is only read once a draft is open — a line's category is optional. |
## States [#states]
- **Loading**
- **Success**
- **Empty.** No invoices yet.
- **Error**
- **Creating.** The new-invoice form, revealed above the table.
- **Expanded.** A part-paid row, opened onto its reconciliation.
- **Details.** The document view, deep-linked onto the part-paid invoice.
- **Read-only.** `hideCreate`, for tenants that raise invoices elsewhere.
## Behaviour [#behaviour]
The invoice number leads neither the table nor its header: it is an internal reference that reads as noise next to a description and a customer. It remains on the full view. The date takes its place, because that is what the list is ordered by.
The header names the period beside the title, and the table holds the invoices falling due inside it — the range comes from the `AssetProvider`, as it does on the report cards, so the list moves with the rest of the dashboard. `dateFrom` and `dateTo` pin a fixed window for this card alone, detaching it from the provider's range. See [Period and status filter](/components/sdk/invoices#period-filter) for the window it sends.
Clicking a row expands it — the row itself is the toggle, not just the kebab. What opens is a reconciliation rather than a second copy of the row: the invoice total, what has been matched to it, and what that leaves. The matched line only appears once something has been matched. When a bank transaction is larger than the balance, the API allocates what is due and records the excess as customer credit, so the invoice reads **Settled in full**. The line items live on the full view instead, which is the surface for reading the invoice whole.
The **Transactions** column names what settled the row — the bank's own description, with `+N` once more than one transaction settles it, and a dash when nothing has. It is content, not a control: one click anywhere on the row (the kebab aside) opens it. Each cell's text carries a text cursor at its own width, and a drag that selects it never opens the row — the click handler stands down whenever a selection ends the click. See [Matching](#matching).
The kebab carries the full view, the status changes, **Refund** and **Issue credit** in a group of their own, and delete. Editing lives on the full view, and reaches the lines alone — the number, customer and dates are fixed at creation. Marking one **Uncollectible** writes off the outstanding balance rather than just relabelling it, and the two refunded statuses are reached by giving money back, never chosen. See [Statuses](/components/sdk/invoices#statuses) for why.
Refund and Issue credit only appear once something has been paid, and not on a voided, written-off or fully refunded invoice. Either opens the invoice's row with a form in the payments' place, the summary staying beside it: the invoice's lines, what each has **Left**, an amount to give back on each, and the total as it's typed. Refund and credit share the form; only the title, the column and the button change. Saving puts the payments back, with the new refund or credit as a card under them — "Ready to use" for a credit, "Not matched yet" for a refund until the money leaving the bank is matched to it — and its ✕ undoes it. The summary keeps reading **Settled in full**, with a **Refunded** line under it. See [Refunds and credits](/components/sdk/invoices#refunds) for what the form checks.
On a phone each row is a small card: what it is and its amount, who it's for and when it's due, then the status and the transaction side by side. The form folds what each line has left under its description, so the amount field keeps its width.
The new-invoice form takes a number, a description, a customer, two dates and any number of lines with an optional category each, and totals the lines as they are typed. A customer who is not in the directory yet can be added from inside the form, without losing the invoice being drafted. Opening the full view or the form hides the list rather than pushing it down.
Every value, control and gate is a slot on the headless compound. See the [Invoices part inventory](/components/sdk/invoices#api) to rearrange the layout, swap the primitives, or add the parts this layout leaves out — the per-payment list and a detached detail panel.
## The document view [#document-view]
The full view reads the invoice as a document, on the layout every document source shares — a bill, a receipt or a statement opens into the same anatomy, with only the source-specific copy changing. A back link returns to the list; the header carries the customer's name, the document date, an **Invoice** tag and the status as a plain tag beside it — the same badge the table's Status column wears; a summary band states what the document claims and settles it; and the record's own card holds the dates, the line items and the amount due. Delete, Issue credit, Refund and Edit share the action bar at the foot; giving money back opens the same form as the row's, in the summary band.
Editing swaps the line rows — and only them — for inputs, each with its own remove control, with the amount due following the keystrokes; Save sends what changed and Cancel discards it. The dates stay read-only: they are fixed at creation. **+ Add Item** under the lines is the same editor, opened with a fresh line ready to type into. See [Editing: lines only](/components/sdk/invoices#editing).
The summary band leads with a sentence — who was invoiced, for how much, due when — and carries the matching surface under it: one chip per matched deposit, a **Select Deposit** picker, and a payment total that reads red when more is taken in than the invoice is worth. See [Matching](#matching).
The line items sit behind a toggle that names what it hides ("Show 14 Items"). They start open — the lines are what the document is made of — and stay put across an edit; the toggle is there for the reader who wants the totals without the itemisation.
An invoice raised from an uploaded file opens as a split view: the details keep the left column, and the source document renders beside them — the file on a page card, a control to open the original in its own tab, and zoom for images (a PDF renders through the browser's viewer, which brings its own). The header also wears the document's processing status as a small dotted chip — the same vocabulary as the [`AssetDocuments`](/components/react/documents) list. The lookup behind all of this is the headless [`DocumentViewer`](/components/sdk/document-viewer).
An invoice with no source document — one raised here, or pushed in through the API — keeps the single column at full width, with no status chip and no empty pane beside it.
## Ingestion [#ingestion]
Pass `intake` and the header gains an **Upload invoice** control. Picking a document hands it to Asset, which reads it and raises the invoice from it — party, lines and journal entry included. A banner under the header narrates it: uploading, then reading, then the record it added. When it finishes the list refreshes, the new record's row opens, and `onCreated` fires with its id.
Nothing is asked of the reader: the extraction is the platform's. A failure gets its own line and stays until it is dismissed — an upload that quietly gave up is worse than one that visibly did — and every failure line ends on *nothing was added*, which is what settles whether a half-made record is now in the books. **Try again** appears only where running the same file could end differently: a file that is too large, the wrong type, or already on record will be all of those next time too. Reading runs on the server, so a reload picks the progress back up rather than losing it.
## Matching [#matching]
Beside the reconciliation sits **Payments**: one chip per payment already matched to the invoice, and a **Select Deposit** picker to add one. It is [`AssetTransactionMatch`](/components/react/transaction-match) wired to the open row; the document view carries the same one inside its summary band, on the inline layout.
The picker is a searchable multi-select that suggests bank transactions around the invoice's due date and shows how their amounts compare with the outstanding balance. The user chooses which payment to apply. It lays out the date, the description and the amount on three fixed tracks, so a dozen rows can be scanned by eye. The supported date range is stated in [Guardrails](/components/sdk/transaction-match#guardrails). Ticking one records the payment and unticking it takes the payment off again — each is its own request, so there is no save. Already-matched transactions come back ticked, and every chip carries its own remove control, which is the way back if the wrong one was attached. Transactions moving money the wrong way are never offered; the same section explains why.
A settled invoice keeps the panel and the picker, disabled — you can still read and undo what paid it, and hiding the control would make a settled row look like a different component. It also costs nothing: nothing is outstanding, so no suggestions are loaded. See [Settled records](/components/sdk/transaction-match#settled).
In the table, the row itself is the way in — one click opens it at the matching panel, whatever cell the click lands on. `matchCandidates` is the override that keeps a preview or a test off the network, and [`TransactionMatch`](/components/sdk/transaction-match) is the headless compound to compose against for a layout of your own.
# Onboarding (/components/react/onboarding)
A self-contained business-onboarding wizard.
It walks the operator through a bookkeeping plan, company details and a books start date, creates the business via the Asset API, then on the final step a single “Link With Plaid” card connects accounts (linked as business, no personal/business step) and shows them grouped by institution, read-only. Configure the available `plans` — pass a single plan and the bookkeeping step is skipped and that plan submitted automatically. Mount it under one `AssetProvider` with `businessId` omitted; once the business is created the wizard calls `setBusinessId`, and the provider re-provisions a business-scoped token for the connect step.
Built on the headless [`Onboarding`](/components/sdk/onboarding) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetOnboarding } from "@get-asset/react";
// Omit businessId — there's no business yet. The token function receives the
// current id (undefined here), so it mints a creation-scoped token. After the
// business is created the wizard calls setBusinessId, and the provider
// re-invokes this with the new id to mint a business-scoped token.
fetchToken(businessId)}>
router.push(`/businesses/${business?.id}`)}
/>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `business:create`
- `business:update`
- `plaid:create`
- `plaid:read`
- `ledger:read`
- `transaction:create`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | |
| `externalId` | `string` | Yes | | The external id stored against the created business — your own stable identifier for it. Required by the business-creation endpoint. |
| `plans` | `OnboardingPlan[]` | No | `["diy", "managed"]` | Which plans the integrator offers. When exactly one is supplied the bookkeeping step is skipped and that plan is submitted automatically. |
| `entityTypes` | `OnboardingEntityType[]` | No | every entity type | Override the filing types offered. |
| `industries` | `string[]` | No | | Override the industries offered. |
| `defaultValues` | `OnboardingDefaults` | No | | Pre-populate any form field (`plan`, `name`, `entityType`, `industry`, `homeCurrency`, `fiscalYearMode`, `fiscalYearDate`, `startDateMode`, `specificStartDate`). Each value seeds the field's initial state; the user can still change it before submitting. |
| `status` | `"active" \| "inactive"` | No | | Initial business status. Forwarded to the create request when set. |
| `onCreated` | `(business: BusinessPublic) => void` | No | | Called once the business is created, before the connect step shows. |
| `onConnected` | `PlaidConnectOnConnected` | No | | Called after the captured institutions are linked on the API (on finish). |
| `onComplete` | `(business: BusinessPublic \| null, reason: OnboardingCompletionReason) => void` | No | | Called when the user finishes the flow on the final step. `reason` is `"finished"` for Finish up or `"skipped"` for Skip for now (no accounts connected). `business` is the created business (or null if creation was skipped/overridden). |
| `onError` | `(error: Error) => void` | No | | Called if creating the business fails. |
| `state` | `"creating" \| "error"` | No | | Force a state for testing/storybook. |
| `initialStep` | `"plan" \| "details" \| "start-date" \| "connect"` | No | | Start on a specific step (testing/storybook). |
| `initialCreated` | `BusinessPublic \| null` | No | | Seed a created business so the connect step can be previewed offline. |
## States [#states]
- **Plan.** Step 1 — choose a bookkeeping plan (omitted when one plan).
- **Company details.**
- **Start date.**
- **Connect accounts.** Step 4 — connect against the created business.
# Operating Expenses Card (/components/react/operating-expenses-card)
Styled card showing the largest expense categories for a period with proportional bars and amounts.
The reporting range defaults to the AssetProvider's shared range, which the DatePicker drives. Pass `insights` (shown in the preview) to render the AI insights panel to the left of the categories — it answers the listed questions from the profit & loss insights endpoint automatically, for the range on screen.
Built on the headless [`OperatingExpensesCard`](/components/sdk/operating-expenses-card) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetOperatingExpensesCard } from "@get-asset/react";
fetchToken(businessId)}
>
{/* `insights` shows the AI panel to the left of the categories. It fetches
answers from the insights endpoint automatically — nothing to wire up. */}
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `report:read`
- `business:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card element. |
| `insights` | `boolean \| ProfitLossInsightsProps` | No | | Show the AI insights panel to the left of the categories (12-column grid: insights take 4, categories 8), wired to the profit & loss insights endpoint for the period on screen. Pass `true` for defaults and answers are fetched automatically; alongside the starter questions an "Ask something else" input lets people type their own, answered by the same endpoint. Pass an object to override the starter `questions`, or to inject `ask` to mock answers in docs / tests. The panel is omitted while the card is locked. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed reporting range. Detaches the card from the provider's shared range entirely; must be paired with `dateTo` — passing one without the other throws. Use `periodDateRange` to derive the pair from a month, quarter, or year. Omit both and the card follows the provider's range, which the `DatePicker` drives. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of the fixed reporting range. Must be paired with `dateFrom`. Categories — and the insights panel, where the styled card shows one — are scoped to whatever range resolves. |
| `limit` | `number` | No | `5` | Maximum categories to display. |
| `categories` | `OperatingExpenseCategoryOverride[]` | No | | Override the fetched data with your own categories; skips the API call. Each entry is `{ name, amount }`; entries with an `amount` of zero or less are dropped, and `limit` still applies. |
| `scale` | `number` | No | | Override the bar chart maximum scale value. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. Skips the API fetch. |
| `locked` | `boolean` | No | | Gate the report for a viewer who isn't entitled to it. Activates the `Locked` state (mutually exclusive with loading / error / empty / success): the categories render blurred and inert as a teaser behind a lock and the upgrade CTA. No report data is requested for a locked viewer — the teaser shows built-in placeholder data (a `categories` override still wins). |
| `upsell` | `UpsellConfig` | No | | Customize the locked state's copy and action: `ctaLabel` and `onUpgrade` are the tenant's upgrade wording and handler; `title` / `description` default per report. Merged field-by-field over the card's default copy, then the generic fallback. |
| `basis` | `"accrual" \| "modified_cash"` | No | | Report on a specific accounting basis. Omit to inherit the provider's basis, which itself falls back to the Business's country default (Canadian Businesses report on accrual, everyone else on cash). Allowed values: `accrual` or `modified_cash` (shown as Cash). |
| `basisToggle` | `boolean` | No | | Let the end user flip between Cash and Accrual. Off by default — when off, `BasisSelect` renders nothing and the card reports on its resolved basis. Flipping moves every basis-aware component under the provider, so one screen never mixes bases. |
## States [#states]
- **Loading.** The card is being fetched.
- **Success.** The largest categories with proportional bars.
- **Empty.** No categorized expenses for the range.
- **Error.** The report couldn't be loaded.
- **Locked.** Viewer isn't entitled to the report — a built-in placeholder teaser renders blurred behind the upgrade prompt. Pass `upsell` to customize the copy and wire `onUpgrade`.
Force a state with the `state` prop.
## Accounting basis [#accounting-basis]
`AssetOperatingExpensesCard` reports on one of two accounting bases: **Accrual** (`accrual` on the wire), which counts invoices and bills when they are issued, or **Cash** (`modified_cash`), which counts them when the money moves. Cashflow components take no basis — cashflow is a cash concept.
The basis is resolved per component, first match winning:
- the card's own `basis` prop;
- the provider's basis — `defaultBasis` on `AssetProvider`, or whatever the toggle was last flipped to;
- the Business's country — Canadian Businesses report on Accrual, everyone else on Cash.
Only the last step costs a request — a Business read, which is why every basis-aware component's `scopes` includes `business:read` — and it is serial: the card holds its own fetch until the Business answers. One request is shared across every basis-aware component on the screen, but pass `defaultBasis` on [`AssetProvider`](/components/sdk/provider#basis) when you already know the basis and skip it entirely. If the lookup fails the card falls back to Cash and stays there — the Retry button re-runs the report, not the basis lookup.
`basisToggle` is off by default: no control renders in the header and the card reports on its resolved basis. Turn it on and flipping the control moves every basis-aware component under the provider with it, so the toggle can never leave a screen half cash and half accrual. A component pinned with its own `basis` prop is the exception — it keeps the basis you gave it and renders no toggle of its own, which is how you show both bases side by side on purpose.
# Amount (/components/react/primitives/amount)
Numeric value rendered in the monospace font with tabular figures so columns of money align cleanly.
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-amount` | Always. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-foreground` | Text color. |
| `--asset-font-mono` | Numeric font family. |
# Badge (/components/react/primitives/badge)
Inline status pill used for tone-tagged values (positive / negative / neutral). Tone is selected via data-tone.
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-badge` | Always. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-radius` | Corner radius (halved from the base value). |
| `--asset-font-mono` | Numeric font family. |
| `--asset-surface` | Background of the neutral and default tones. |
| `--asset-muted-foreground` | Text color of the neutral and default tones. |
| `--asset-success` | Background when data-tone="positive". |
| `--asset-success-foreground` | Text when data-tone="positive". |
| `--asset-destructive` | Background when data-tone="negative". |
| `--asset-destructive-foreground` | Text when data-tone="negative". |
# Button (/components/react/primitives/button)
Subtle outline button used for retry/secondary actions inside cards. Hover swaps to the surface tone.
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-button` | Always. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-radius` | Corner radius (halved from the base value). |
| `--asset-border` | Border color. |
| `--asset-card` | Resting background. |
| `--asset-foreground` | Label color. |
| `--asset-font-sans` | Label font family. |
| `--asset-surface` | Hover background. |
# CardHeader (/components/react/primitives/card-header)
Top-of-card layout that places a title on the left and an actions group on the right. Compose CardTitle for the heading text and CardActions for buttons or inputs (period selectors, download, etc.).
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-card-header` | Container — flex row with space-between for left title / right actions. |
| `.asset-heading` | CardTitle — same uppercase tracked-out caps as the standalone Heading primitive. |
| `.asset-card-actions` | Right-aligned cluster — flex row with 8px gap. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-foreground` | Title text color (via .asset-heading). |
# Card (/components/react/primitives/card)
Outer surface for every styled compound.
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-card` | Always. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-radius` | Corner radius (×1.5). |
| `--asset-border` | Outer border color. |
| `--asset-card` | Background fill. |
| `--asset-font-sans` | Body font family. |
| `--asset-foreground` | Default text color. |
# Divider (/components/react/primitives/divider)
Horizontal rule used to separate stacked content.
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-divider` | Always. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-border` | Line color. |
# ErrorState (/components/react/primitives/error-state)
Centered, vertically-stacked block used inside the .Error slot of the SDK compounds. Wraps the compound's ErrorMessage and Retry so the whole block sits centered in the card with consistent spacing.
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-error-state` | Container — centered column with text alignment and padding. |
| `.asset-error-state-text` | Apply to the compound's .ErrorMessage to match the centered block layout. |
| `.asset-error-state-retry` | Apply to the compound's .Retry to render it as an underlined link-style action. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-foreground` | Error text and retry label color. |
# Heading (/components/react/primitives/heading)
Card-level heading rendered in uppercase, tracked-out caps. Use for the primary label of a card (e.g. "Revenue", "Cashflow").
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-heading` | Always. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-foreground` | Text color. |
# LoadingMessage (/components/react/primitives/loading-message)
Centered, padded text used by compounds while a fetch is in flight. Pair with Spinner if you want a visual indicator alongside the text.
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-loading-message` | Always. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-muted-foreground` | Text color. |
# Muted (/components/react/primitives/muted)
13px muted-tone text used for secondary metadata.
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-muted` | Always. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-muted-foreground` | Text color. |
# Select (/components/react/primitives/select)
Accessible single-choice select built on @radix-ui/react-select. The trigger borrows Button's outline + radius so it sits naturally inside CardActions; the dropdown content is a portaled popover with viewport-clamped max height. Compose Select.Root with SelectTrigger, SelectContent, and SelectItem.
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-select-trigger` | Trigger button — same outline style as .asset-button, with a built-in chevron icon on the right. |
| `.asset-select-icon` | Chevron wrapper inside the trigger. Tinted muted-foreground. |
| `.asset-select-content` | Portaled dropdown panel — bordered card with a soft drop shadow. Width matches the trigger via --radix-select-trigger-width. |
| `.asset-select-viewport` | Scroll viewport inside the content. 4px padding around items. |
| `.asset-select-item` | Each option. data-highlighted swaps to surface tone; data-state="checked" bolds the label and shows the indicator. |
| `.asset-select-item-indicator` | Check icon shown on the selected item. |
| `.asset-select-separator` | 1px separator between option groups. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-radius` | Corner radius of the trigger and dropdown content (matches Button); item rows use ÷4 for tighter inset corners. |
| `--asset-border` | Trigger outline, content border, and separator color. |
| `--asset-card` | Trigger and dropdown background. |
| `--asset-surface` | Trigger hover/open background and item highlight background. |
| `--asset-foreground` | Trigger label and option text. |
| `--asset-muted-foreground` | Chevron icon and placeholder text. |
| `--asset-font-sans` | Trigger and option font family. |
# Skeleton (/components/react/primitives/skeleton)
Pulsing placeholder used inside .Loading slots to reserve space for incoming content. Use the base Skeleton with custom dimensions, or one of the block-shaped variants (SkeletonValue, SkeletonBadge, SkeletonAmount) so the loading layout matches the success layout.
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-skeleton` | Base — pulsing fill. Sized via inline styles or a wrapper. |
| `.asset-skeleton-value` | SkeletonValue — block sized to match Value (180×32). |
| `.asset-skeleton-badge` | SkeletonBadge — sized to match Badge (64×24). |
| `.asset-skeleton-amount` | SkeletonAmount — 70%-wide cell-height block for a TableCell value. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-radius` | Corner radius (halved from the base value, matching Badge). |
| `--asset-border` | Placeholder fill. |
# Spinner (/components/react/primitives/spinner)
Rotating SVG indicator used alongside loading text.
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-spinner` | Always. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-foreground` | Stroke color. |
# Table (/components/react/primitives/table)
Lightweight grid-based table for figure tables (e.g. cashflow periods). Renders as a bordered card surface; the header row uses the surface tone and the body rows sit on the card tone. The first column is auto-sized for a label and is left-sticky so it stays visible while amount columns scroll horizontally. The header row is top-sticky so column labels stay visible while the body scrolls vertically — see data-narrow below.
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-table` | Container — bordered card surface. Defaults to overflow-x: auto so wide tables scroll horizontally. |
| `.asset-table[data-narrow]` | Variant for layouts that fit without horizontal scroll (e.g. the responsive narrow viewport on the cashflow / P&L reports). Switches the columns to two equal-width tracks (1fr 1fr) with a 12px column gap and sets overflow: visible so the sticky head can pin against the page rather than the table itself. Toggle via the Table primitive's narrow prop. |
| `.asset-table-row` | Row — even-width grid columns. |
| `.asset-table-head` | TableHead row — surface-tinted band that bleeds to the table edges, with a bottom border and smaller cell text. position: sticky; top: 0 keeps the column labels visible while body content scrolls past. |
| `.asset-table-footer` | TableFooter wrapper — adds a dashed top rule above its child rows. |
| `.asset-table-cell` | Default cell. colSpan=\{n} sets gridColumn: span n inline. |
| `.asset-table-cell-right` | align="right" — right-aligned text. |
| `.asset-table-cell-muted` | muted — muted-foreground color. |
| `.asset-table-cell-emphasis` | emphasis — bold + foreground color. |
| `.asset-table-cell-numeric` | numeric — monospace + tabular figures. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-card` | Body background of the table. |
| `--asset-surface` | Background tone of the header row. |
| `--asset-border` | Outer border, header row bottom rule, and footer dashed rule. |
| `--asset-radius` | Outer corner radius (table is always rounded). |
| `--asset-foreground` | Default cell text color. |
| `--asset-muted-foreground` | Cell text when muted, and within header rows. |
| `--asset-font-mono` | Cell font when numeric. |
# Value (/components/react/primitives/value)
Display-size monospace number used for the headline figure of a card (e.g. revenue total, net profit).
## Preview [#preview]
## Class [#class]
| Class | When applied |
| --- | --- |
| `.asset-value` | Always. |
## CSS variables [#css-variables]
Override these on any ancestor scope (or globally) to restyle this primitive. See the [CSS Variables](/components/react/variables) reference for the full token list and [Theming](/components/react/theming) for override patterns.
| Variable | Affects |
| --- | --- |
| `--asset-foreground` | Text color. |
| `--asset-font-mono` | Numeric font family. |
# Profit & Loss Card (/components/react/profit-loss-card)
Styled card showing month-by-month revenue and expense pairs for the range on screen.
Bars share a scale derived from the largest value in the set. The chart covers every calendar month the range overlaps — a whole year gives the familiar twelve — and follows the AssetProvider's range unless `dateFrom` / `dateTo` pin it. Pass `insights` (shown in the preview below) to render the AI insights panel inside the card; it answers the listed questions from the insights endpoint automatically for the range on screen. An “Ask something else” input lets people type their own question, which returns the same structured answer.
Built on the headless [`ProfitLossCard`](/components/sdk/profit-loss-card) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetProfitLossCard } from "@get-asset/react";
fetchToken(businessId)}
>
{/* `insights` adds the AI panel inside the card. It fetches answers
from the insights endpoint automatically — nothing to wire up. */}
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `report:read`
- `tag:read`
- `business:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card element. |
| `insights` | `boolean \| ProfitLossInsightsProps` | No | | Render the AI insights panel inside the card. Pass `true` and it fetches answers from the profit & loss insights endpoint automatically for the range on screen. Alongside the starter questions, an "Ask something else" input lets people type their own; it runs through the same endpoint and returns the same structured answer. Pass an object (`{ questions?, ask? }`) to override the starter `questions`, or to inject `ask` to mock answers in docs or tests. The panel is omitted while `locked`. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed reporting range. Detaches the card from the provider's shared range entirely; must be paired with `dateTo` (passing one side alone throws). Use `periodDateRange` to derive the pair from a month, quarter or year. Omit both to follow the provider's date-picker-driven range. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of the fixed reporting range. Must be paired with `dateFrom`. |
| `months` | `ProfitLossMonthOverride[]` | No | | Override fetched data (skips API fetch) — one entry per month on screen. Each entry is `{ month, revenue, expense }`. |
| `scale` | `number` | No | | Override the +/- bound for the bar chart scale. |
| `tagFields` | `TagFilterField[]` | No | | Override the fetched tag filter fields — primarily for testing / storybook. Pass `[]` to hide the tag filter. When the business has tag values, a searchable tag select renders in the card header; selecting tags refetches the chart (and scopes the insights panel in the styled card). |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. |
| `locked` | `boolean` | No | | Gate the report for a viewer who isn't entitled to it. Activates the `Locked` state (mutually exclusive with loading / error / empty / success) and skips the API fetch — no report data is requested for a locked viewer. The chart renders blurred and inert as a teaser behind a lock and the upgrade CTA, using built-in placeholder data (a `months` override still wins); the styled card omits its insights panel. |
| `upsell` | `UpsellConfig` | No | | Locked-state copy + upgrade handler, `{ title?, description?, ctaLabel?, onUpgrade? }`; merged field-by-field over the card's default copy, then the generic fallback. `ctaLabel` and `onUpgrade` are the tenant's upgrade wording and handler. |
| `onViewDetails` | `CardViewDetailsHandler` | No | | Callback fired when the viewer asks to see more details (e.g. to navigate to the full report). Makes `ViewDetails` render. Receives the card's resolved `{ range, period, basis }` (`period` is the exact period the range represents, or `null` for a custom range) so the destination can open on the same window the card shows. |
| `basis` | `"accrual" \| "modified_cash"` | No | | Report on a specific accounting basis: `"accrual"` or `"modified_cash"`. Omit to inherit the provider's basis, which itself falls back to the Business's country default: Canadian Businesses report on accrual, everyone else on cash. |
| `basisToggle` | `boolean` | No | | Let the end user flip between Cash and Accrual. Off by default — when off, `BasisSelect` renders nothing and the card reports on its resolved basis. Flipping moves every basis-aware component under the provider, so one screen never mixes bases. |
## States [#states]
- **Loading.** The card is being fetched.
- **Success.** Revenue and expense bars for each month.
- **Empty.** No P&L data for the range.
- **Error.** The report couldn't be loaded.
- **View details.** Pass `onViewDetails` to handle a request for more details (e.g. navigate to the full report). The callback receives the card's own range, period and basis — here it logs them to the console.
- **Locked.** Viewer isn't entitled to the report — a built-in placeholder teaser renders blurred behind the upgrade prompt. Pass `upsell` to customize the copy and wire `onUpgrade`.
Force a state with the `state` prop.
## Accounting basis [#accounting-basis]
`AssetProfitLossCard` reports on one of two accounting bases: **Accrual** (`accrual` on the wire), which counts invoices and bills when they are issued, or **Cash** (`modified_cash`), which counts them when the money moves. Cashflow components take no basis — cashflow is a cash concept.
The basis is resolved per component, first match winning:
- the card's own `basis` prop;
- the provider's basis — `defaultBasis` on `AssetProvider`, or whatever the toggle was last flipped to;
- the Business's country — Canadian Businesses report on Accrual, everyone else on Cash.
Only the last step costs a request — a Business read, which is why every basis-aware component's `scopes` includes `business:read` — and it is serial: the card holds its own fetch until the Business answers. One request is shared across every basis-aware component on the screen, but pass `defaultBasis` on [`AssetProvider`](/components/sdk/provider#basis) when you already know the basis and skip it entirely. If the lookup fails the card falls back to Cash and stays there — the Retry button re-runs the report, not the basis lookup.
`basisToggle` is off by default: no control renders in the header and the card reports on its resolved basis. Turn it on and flipping the control moves every basis-aware component under the provider with it, so the toggle can never leave a screen half cash and half accrual. A component pinned with its own `basis` prop is the exception — it keeps the basis you gave it and renders no toggle of its own, which is how you show both bases side by side on purpose.
# Profit & Loss Report (/components/react/profit-loss-report)
Styled multi-period profit and loss table over the reporting range — the provider's DatePicker-driven range unless dateFrom / dateTo detach it.
The card header carries a period Select (Month / Quarter / Year) wired to the SDK's internal breakdown state — switching it re-fetches the report and the table re-renders with one column per period the range covers. Subtotal rows render bold; nested ledger rows are indented by depth. When the business has tags, the same searchable, grouped multi-select the transactions Tag column uses appears before the period Select — it cannot create new tag values. Checking tag values filters the report to amounts allocated to those tags (multiple tags are OR'd) and it hides itself when the business has none. The download button next to the period selector exports the same view as an XLSX file, using whatever query parameters the table is currently displaying — including the tag filter. Below the responsive breakpoint the table collapses to a single column with an arrow-picker period strip; above it, the period header sticks to the top of the page when scrolling. Pass `insights` (shown in the preview below) to render the AI insights panel inside the card beneath the table — it answers the listed questions from the insights endpoint automatically, using the parameters on screen, including the selected tags.
Built on the headless [`ProfitLossReport`](/components/sdk/profit-loss-report) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetProfitLossReport } from "@get-asset/react";
fetchToken(businessId)}
>
{/* `insights` shows the AI panel inside the card. It fetches
answers from the insights endpoint automatically — nothing to wire up. */}
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `report:read`
- `tag:read`
- `business:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card element. |
| `insights` | `boolean \| ProfitLossInsightsProps` | No | | Render the AI insights panel inside the card, beneath the table. The panel is self-contained: pass `true` and it fetches answers from the profit & loss insights endpoint automatically, using the same parameters the report is showing. Alongside the starter questions, an "Ask something else" input lets people type their own; it runs through the same endpoint and returns the same structured answer. Pass an object (`{ questions?, ask? }`) to override the starter `questions`, or to inject `ask` (a fetcher returning a canned answer) to mock answers in docs or tests without hitting the API. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed reporting range. Detaches the report from the provider's shared range entirely; must be paired with `dateTo` (passing one without the other throws). Use `periodDateRange` to derive the pair from a month/quarter/year. Omit both to follow the provider's date-picker-driven range. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of the fixed reporting range. Must be paired with `dateFrom`. |
| `defaultBreakdown` | `"month" \| "quarter" \| "year"` | No | `"year"` | Initial period breakdown (`"month"`, `"quarter"` or `"year"`). The report renders one column per year, quarter, or month the range covers. Ignored when the range is exactly one calendar month or quarter: the breakdown is then forced to match and `setBreakdown` is a no-op (the styled report's select is locked to the matching option). Update at runtime via `setBreakdown` from the hook. |
| `records` | `ReportLine[]` | No | | Override fetched data with a single-period snapshot — primarily for testing / storybook. The report renders one column. |
| `tagOptions` | `ProfitLossTagOption[]` | No | | Override the fetched tag filter options, `{ label, value }[]` with `value` in `field:value` format — primarily for testing / storybook. Legacy: prefer `tagFields`. Pass `[]` to hide the tag filter. |
| `tagFields` | `TagFilterField[]` | No | | Override the fetched tag fields, `{ name, values }[]` — primarily for testing / storybook. Preferred over `tagOptions`. Pass `[]` to hide the tag filter. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. |
| `basis` | `"accrual" \| "modified_cash"` | No | | Report on a specific accounting basis: `"accrual"` or `"modified_cash"`. Omit to inherit the provider's basis, which itself falls back to the Business's country default: Canadian Businesses report on accrual, everyone else on cash. |
| `basisToggle` | `boolean` | No | | Let the end user flip between Cash and Accrual. Off by default — when off, `BasisSelect` renders nothing and the report renders on its resolved basis. Flipping moves every basis-aware component under the provider, so one screen never mixes bases. |
| `onLedgerSelect` | `(ledgerId: string) => void` | No | | Called with a row's ledger id when the viewer picks it (click or keyboard). When set, rows that carry a ledger id render as interactive links — e.g. to open a general-ledger view; rows without one stay inert. Each line exposes it pre-bound as `selectLedger` on the line hook, present only when the row names a ledger. Group headings and calculated rows stay inert. |
## States [#states]
- **Loading.** The report is being fetched.
- **Success.** The statement with one column per period.
- **Empty.** No records returned.
- **Error.** The report couldn't be loaded.
Force a state with the `state` prop.
## Accounting basis [#accounting-basis]
`AssetProfitLossReport` reports on one of two accounting bases: **Accrual** (`accrual` on the wire), which counts invoices and bills when they are issued, or **Cash** (`modified_cash`), which counts them when the money moves. Cashflow components take no basis — cashflow is a cash concept.
The basis is resolved per component, first match winning:
- the report's own `basis` prop;
- the provider's basis — `defaultBasis` on `AssetProvider`, or whatever the toggle was last flipped to;
- the Business's country — Canadian Businesses report on Accrual, everyone else on Cash.
Only the last step costs a request — a Business read, which is why every basis-aware component's `scopes` includes `business:read` — and it is serial: the report holds its own fetch until the Business answers. One request is shared across every basis-aware component on the screen, but pass `defaultBasis` on [`AssetProvider`](/components/sdk/provider#basis) when you already know the basis and skip it entirely. If the lookup fails the report falls back to Cash and stays there — the Retry button re-runs the report, not the basis lookup.
`basisToggle` is off by default: no control renders in the header and the report reports on its resolved basis. Turn it on and flipping the control moves every basis-aware component under the provider with it, so the toggle can never leave a screen half cash and half accrual. A component pinned with its own `basis` prop is the exception — it keeps the basis you gave it and renders no toggle of its own, which is how you show both bases side by side on purpose.
The XLSX export sends the basis currently on screen, so a downloaded file always matches what the viewer was looking at.
# Receipt Rule Editor (/components/react/receipt-rule-editor)
Styled drop-in form to make or change one of a business's receipt rules — never ask, ask every time, or ask over an amount.
Make or change one of a business's receipt rules: the ledger it names, whether to never ask, ask every time or ask over an amount, and the reason shown on the request.
Built on the headless [`ReceiptRuleEditor`](/components/sdk/receipt-rule-editor) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetReceiptRuleEditor } from "@get-asset/react";
import "@get-asset/react/styles.css";
backToList()}
onCancel={() => backToList()}
/>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `business:read`
- `business:update`
- `ledger:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | |
| `ruleId` | `string` | No | | The rule to edit. Omit to make a new one. `"default"` is the business's default rule, made on save if the business has none yet. |
| `rule` | `BusinessReceiptRulePublic` | No | | Override the fetched rule for testing/storybook. Skips the API call. |
| `ledgers` | `LedgerPublic[]` | No | | Override the ledgers to choose from for testing/storybook. Skips the API call. |
| `preview` | `ReceiptRuleEditorPreview` | No | | Override the preview and disable its request for testing/storybook. |
| `currency` | `string` | No | | ISO-4217 code amounts are in. Resolved from the business's country when omitted. |
| `formatAmount` | `(value: number) => string` | No | | Amount formatting in preview rows. Defaults to `currency`, in US English. |
| `formatDate` | `(value: string) => string` | No | | Date formatting in preview rows. Defaults to "Jan 31, 2026". |
| `state` | `"loading" \| "error"` | No | | Force a specific state for testing/storybook. |
| `saveError` | `Error` | No | | Force the save-error state for testing/storybook. |
| `onSaved` | `(rule: BusinessReceiptRulePublic \| null) => void` | No | | Called with the saved rule once the write goes through; with null when the default rule was set back to the system's defaults. |
| `onCancel` | `() => void` | No | | The host closes the form without saving. |
# Receipt Rules (/components/react/receipt-rules)
Styled drop-in list of a business's own receipt rules — when a receipt is asked for on a ledger — with delete, and Add and Edit handed to your editor.
List a business's own receipt rules — when a receipt is asked for on a ledger — and delete one. Add and Edit hand off to your own editor, or to the [Receipt Rule Editor](/components/react/receipt-rule-editor).
Built on the headless [`ReceiptRules`](/components/sdk/receipt-rules) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetReceiptRules } from "@get-asset/react";
import "@get-asset/react/styles.css";
openEditor()}
onEditRule={ruleId => openEditor(ruleId)}
/>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `business:read`
- `business:update`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. |
| `rules` | `BusinessReceiptRulePublic[]` | No | | Override fetched rules for testing/storybook. Skips the API call. |
| `onAddRule` | `() => void` | No | | The host opens its own rule editor. |
| `onEditRule` | `(ruleId: string) => void` | No | | The host opens its own rule editor, for this rule. The default rule goes by the id `"default"`, which `ReceiptRuleEditor` takes as its `ruleId`. |
| `currency` | `string` | No | | ISO-4217 code the amounts are denominated in. Resolved from the business's own country when omitted — a Canadian business's thresholds are in CAD — which costs a Business lookup the other receipt components already make. |
## Behaviour [#behaviour]
The host owns navigation between the list and the editor. A business's rule replaces the tenant's for the same ledger name. Deleting it returns that ledger to the business's default rule, or, when the business has no default of its own, to the tenant's rule for its name.
# Revenue Card (/components/react/revenue-card)
Drop-in styled card for the period's revenue and its period-over-period change, with built-in loading, empty, and error states.
The reporting range defaults to the AssetProvider's shared range (driven by the DatePicker), and the comparison mirrors it — the previous month, quarter, or year for a period-shaped range, or the same number of days immediately before a custom one.
Built on the headless [`RevenueCard`](/components/sdk/revenue-card) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetRevenueCard } from "@get-asset/react";
fetchToken(businessId)}
>
router.push(`/reports?year=${period?.year}&basis=${basis}`)
}
/>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `report:read`
- `business:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card element. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed reporting range. Detaches the card from the provider's shared range entirely; must be paired with `dateTo` — passing one without the other throws. Use `periodDateRange` to derive the pair from a month, quarter, or year. Omit both and the card follows the provider's range, which the `DatePicker` drives. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of the fixed reporting range. Must be paired with `dateFrom`. The prior-period comparison mirrors whatever range resolves — the previous month, quarter, or year for a period-shaped range, or the same number of days immediately before a custom one. |
| `revenue` | `number` | No | | Override the fetched revenue, for testing/storybook. Skips the API call when provided (`previousRevenue` alone does not skip it). |
| `previousRevenue` | `number` | No | | Override the fetched prior-period revenue. Only takes effect together with `revenue`. |
| `state` | `"loading" \| "error"` | No | | Force a specific state for testing/storybook. Skips the API fetch. |
| `locked` | `boolean` | No | | Gate the report for a viewer who isn't entitled to it. Activates the `Locked` state (mutually exclusive with loading / error / success): the metric renders blurred and inert as a teaser behind a lock and the upgrade CTA. No report data is requested for a locked viewer — the teaser shows built-in placeholder data (a `revenue` override still wins). |
| `upsell` | `UpsellConfig` | No | | Customize the locked state's copy and action: `ctaLabel` and `onUpgrade` are the tenant's upgrade wording and handler; `title` / `description` default per report. Merged field-by-field over the card's default copy, then the generic fallback. |
| `onViewDetails` | `CardViewDetailsHandler` | No | | Callback fired when the viewer asks to see more details (e.g. to navigate to the full report). Makes `ViewDetails` render. Receives the card's resolved `{ range, period, basis }` — the range, the exact period it represents (`null` for a custom range) and the accounting basis — so the destination can open on the same window the card shows. |
| `basis` | `"accrual" \| "modified_cash"` | No | | Report on a specific accounting basis. Omit to inherit the provider's basis, which itself falls back to the Business's country default (Canadian Businesses report on accrual, everyone else on cash). Allowed values: `accrual` or `modified_cash` (shown as Cash). |
| `basisToggle` | `boolean` | No | | Let the end user flip between Cash and Accrual. Off by default — when off, `BasisSelect` renders nothing and the card reports on its resolved basis. Flipping moves every basis-aware component under the provider, so one screen never mixes bases. |
## States [#states]
- **Loading.** Fetch in flight.
- **Success.** Year-over-year increase.
- **Error.** Fetch failed; retry button surfaces.
- **View details.** Pass `onViewDetails` to handle a request for more details (e.g. navigate to the full report). The callback receives the card's own range, period and basis — here it logs them to the console.
- **Locked.** Viewer isn't entitled to the report — a built-in placeholder teaser renders blurred behind the upgrade prompt. Pass `upsell` to customize the copy and wire `onUpgrade`.
## Accounting basis [#accounting-basis]
`AssetRevenueCard` reports on one of two accounting bases: **Accrual** (`accrual` on the wire), which counts invoices and bills when they are issued, or **Cash** (`modified_cash`), which counts them when the money moves. Cashflow components take no basis — cashflow is a cash concept.
The basis is resolved per component, first match winning:
- the card's own `basis` prop;
- the provider's basis — `defaultBasis` on `AssetProvider`, or whatever the toggle was last flipped to;
- the Business's country — Canadian Businesses report on Accrual, everyone else on Cash.
Only the last step costs a request — a Business read, which is why every basis-aware component's `scopes` includes `business:read` — and it is serial: the card holds its own fetch until the Business answers. One request is shared across every basis-aware component on the screen, but pass `defaultBasis` on [`AssetProvider`](/components/sdk/provider#basis) when you already know the basis and skip it entirely. If the lookup fails the card falls back to Cash and stays there — the Retry button re-runs the report, not the basis lookup.
`basisToggle` is off by default: no control renders in the header and the card reports on its resolved basis. Turn it on and flipping the control moves every basis-aware component under the provider with it, so the toggle can never leave a screen half cash and half accrual. A component pinned with its own `basis` prop is the exception — it keeps the basis you gave it and renders no toggle of its own, which is how you show both bases side by side on purpose.
# Similar Transactions (/components/react/similar-transactions)
Styled expandable table for similar unconfirmed transactions, with the largest groups first.
Each lead row shows its group size beside the merchant name and expands from anywhere on the row. The lead row's ✓ confirms the whole group, while a member's ✓ confirms only that transaction. The ✕ opens an inline reason form; affected rows read as reviewing while the correction is processed. When no groups remain, the table is replaced with the Done “All caught up” state.
Built on the headless [`SimilarTransactions`](/components/sdk/similar-transactions) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetSimilarTransactions } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `transaction:update`
- `transaction:read`
- `external_account:read`
- `journal_entry:read`
- `journal_entry:create`
- `chat:create`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `title` | `ReactNode` | No | `"Similar transactions"` | Card heading. |
| `hiddenColumns` | `SimilarTransactionsColumn[]` | No | | Columns to omit from the table. Options: `"expand"`, `"date"`, `"transaction"`, `"account"`, `"amount"` and `"category"`. `"expand"` controls the chevron gutter. All columns are shown by default. |
| `className` | `string` | No | | Forwarded to the outer Card element. |
| `limit` | `number` | No | `10` | Maximum number of count-ranked groups to show. The component considers up to 50 groups from the API, so values above 50 show no more than 50. |
| `accountIds` | `string[]` | No | | Only include transactions for these external account ids (passed to the API). |
| `groups` | `SimilarTransactionGroupOverride[]` | No | | Override the groups shown and skip fetching. Used by storybook/tests. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. Skips the API fetch. |
| `showCurrency` | `boolean` | No | | Force the ISO code beside each amount on or off, skipping the business fetch (storybook/tests). By default it shows only for a business that holds money in more than one currency. |
| `onConfirmed` | `(transactionIds: string[]) => void` | No | | Called after transactions are confirmed, with the confirmed ids. |
| `onContextSubmitted` | `(transactionId: string, message: string) => void` | No | | Called after a correction is submitted for a transaction. Receives the transaction id and the submitted message. |
## States [#states]
- **Loading.** Skeleton rows aligned column-for-column with the visible table header.
- **Success.** The expandable transaction table, ranked by group size.
- **Empty.** You’re all caught up — nothing needs categorizing.
- **Error.** ErrorState with the fetched message and a retry action.
- **Done.** The finished "All caught up" state after every group is confirmed.
# Snapshot Card (/components/react/snapshot-card)
Styled card showing the period's revenue and expense side by side with the resulting net profit and its change versus the prior period.
The reporting range follows the AssetProvider's DatePicker-driven range — a month, quarter, or year compares against the one before it, and a custom range against the same number of days immediately before it. Pass dateFrom / dateTo to pin a fixed range instead.
Built on the headless [`SnapshotCard`](/components/sdk/snapshot-card) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetSnapshotCard } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `report:read`
- `business:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card element. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed reporting range. Detaches the card from the provider's shared range entirely; must be paired with `dateTo` — passing one without the other throws. Use `periodDateRange` to derive the pair from a month, quarter, or year. Omit both and the card follows the provider's range, which the `DatePicker` drives. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of a fixed reporting range. Must be paired with `dateFrom`. The prior-period comparison mirrors whatever range resolves — the previous month, quarter, or year for a period-shaped range, or the same number of days immediately before a custom one. |
| `revenue` | `number` | No | | Override the fetched revenue, for testing/storybook. Skips the API call when `revenue` or `expense` is provided (the other then defaults to 0). |
| `expense` | `number` | No | | Override the fetched expense, for testing/storybook. Provide as a positive number. Skips the API call, like `revenue`. |
| `previousNetProfit` | `number` | No | | Override the fetched prior-period net profit; drives the percent-change badge and its tone. Without it (and with no fetch) the change shows as 0%. |
| `scale` | `number` | No | | Override the +/- bound for the bar chart scale. Defaults to a nice round value. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. Skips the API fetch. |
| `locked` | `boolean` | No | | Gate the report for a viewer who isn't entitled to it. Activates the `Locked` state (mutually exclusive with loading / error / empty / success): the summary renders blurred and inert as a teaser behind a lock and the upgrade CTA. No report data is requested for a locked viewer — the teaser shows built-in placeholder data (a `revenue` / `expense` override still wins). |
| `upsell` | `UpsellConfig` | No | | Customize the locked state's copy and action: `ctaLabel` and `onUpgrade` are the tenant's upgrade wording and handler; `title` / `description` default per report. Merged field-by-field over the card's default copy, then the generic fallback. |
| `onViewDetails` | `CardViewDetailsHandler` | No | | Callback fired when the viewer asks to see more details (e.g. to navigate to the full report). Makes `ViewDetails` render. Receives the card's resolved `{ range, period, basis }` — the range, the exact period it represents (`null` for a custom range) and the accounting basis — so the destination can open on the same window the card shows. |
| `basis` | `"accrual" \| "modified_cash"` | No | | Report on a specific accounting basis. Omit to inherit the provider's basis, which itself falls back to the Business's country default (Canadian Businesses report on accrual, everyone else on cash). Allowed values: `accrual` or `modified_cash` (shown as Cash). |
| `basisToggle` | `boolean` | No | | Let the end user flip between Cash and Accrual. Off by default — when off, `BasisSelect` renders nothing and the card reports on its resolved basis. Flipping moves every basis-aware component under the provider, so one screen never mixes bases. |
## States [#states]
- **Loading**
- **Success**
- **Empty.** No revenue or expenses recorded.
- **Error**
- **View details.** Pass `onViewDetails` to handle a request for more details (e.g. navigate to the full report). The callback receives the card's own range, period and basis — here it logs them to the console.
- **Locked.** Viewer isn't entitled to the report — a built-in placeholder teaser renders blurred behind the upgrade prompt. Pass `upsell` to customize the copy and wire `onUpgrade`.
## Accounting basis [#accounting-basis]
`AssetSnapshotCard` reports on one of two accounting bases: **Accrual** (`accrual` on the wire), which counts invoices and bills when they are issued, or **Cash** (`modified_cash`), which counts them when the money moves. Cashflow components take no basis — cashflow is a cash concept.
The basis is resolved per component, first match winning:
- the card's own `basis` prop;
- the provider's basis — `defaultBasis` on `AssetProvider`, or whatever the toggle was last flipped to;
- the Business's country — Canadian Businesses report on Accrual, everyone else on Cash.
Only the last step costs a request — a Business read, which is why every basis-aware component's `scopes` includes `business:read` — and it is serial: the card holds its own fetch until the Business answers. One request is shared across every basis-aware component on the screen, but pass `defaultBasis` on [`AssetProvider`](/components/sdk/provider#basis) when you already know the basis and skip it entirely. If the lookup fails the card falls back to Cash and stays there — the Retry button re-runs the report, not the basis lookup.
`basisToggle` is off by default: no control renders in the header and the card reports on its resolved basis. Turn it on and flipping the control moves every basis-aware component under the provider with it, so the toggle can never leave a screen half cash and half accrual. A component pinned with its own `basis` prop is the exception — it keeps the basis you gave it and renders no toggle of its own, which is how you show both bases side by side on purpose.
# Statement Reconciliation (/components/react/statement-reconciliation)
Statement verified reconciliation for one account, as a card.
Statement verified reconciliation for one account, as a card. The account screen says how the books stand against the bank, lists the completed months with the next step for each (Upload, Reconcile, or the record), and has a Checks tab ([`AccountChecks`](/components/sdk/account-checks)) for the checks written on the account. A month walks through the statement upload (or manual entry) beside the document, the check that it adds up, the review against the books with a suggested correction for every difference, and **Mark as reconciled**, followed by a brief confirmation. Corrections reach the books only when the month is approved, and leaving a review with corrections pending asks first. The accounts card shows this for each account of a business reconciled by statement verification.
Built on the headless [`StatementReconciliation`](/components/sdk/statement-reconciliation) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetStatementReconciliation } from "@get-asset/react";
fetchToken(businessId)}>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `reconciliation:read`
- `reconciliation:write`
- `document:create`
- `document:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | |
| `currency` | `string \| null` | No | | The account's currency, for every figure. Defaults to US dollars. |
| `accountId` | `string` | Yes | | The external account being reconciled. |
| `month` | `string \| null` | No | | The open month (`YYYY-MM`), or null for the month list. Controlled when given. |
| `defaultMonth` | `string \| null` | No | | The month to open on when uncontrolled. |
| `onMonthChange` | `(month: string \| null) => void` | No | | Notified when a month is opened or closed. |
| `onApproved` | `(confirmation: ApprovalConfirmation) => void` | No | | Notified after a month is approved. |
| `confirmationDuration` | `number` | No | | How long the approval confirmation shows before the months come back, in milliseconds. `0` keeps it until dismissed. Defaults to four seconds. |
| `maxFileSize` | `number` | No | | Per-file size ceiling for statement uploads. Defaults to 25 MB. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a state for testing/storybook. |
| `account` | `AccountPeriods` | No | | Override the fetched months (skips the API) — storybook/tests. |
| `period` | `PeriodDetail` | No | | Override the fetched month detail (skips the API) — storybook/tests. |
| `comparison` | `ComparisonPublic` | No | | Override the fetched comparison (skips the API) — storybook/tests. |
| `confirmation` | `ApprovalConfirmation` | No | | Open on an approval's confirmation, as just after approving — storybook/tests. |
| `corrections` | `StatementCorrection[]` | No | | Corrections already accepted in the review — storybook/tests. |
| `document` | `DocumentPublic` | No | | Override the uploaded statement's document (skips the API) — storybook/tests. |
| `previewUrl` | `string` | No | | Override the uploaded statement's preview URL (skips the API) — storybook/tests. |
| `now` | `number` | No | | Fix the current time, for relative days such as "uploaded today" — storybook/tests. |
| `checks` | `CheckPublic[]` | No | | Override the fetched checks (skips the API) — storybook/tests. |
| `checksToMatch` | `string[]` | No | | With `checks`: the ids of those with a bank payment to match. |
# Tasks (/components/react/tasks)
Styled card listing the outstanding tasks a business needs to act on, with one collapsible section per task type.
Shows how many tasks remain in the header, per-section counts, and an "all caught up" state once nothing is pending. There is one collapsible section per task type: reconnect, each document request and each question type.
The row actions work out of the box. Reconnect opens Plaid Link in update mode (through the shared `PlaidLink`, as the accounts components do). Upload opens a file picker and attaches the documents. The classify comment button opens an inline form that leaves a note on the transaction's journal entry and marks the task done. You can drop it in without wiring any callbacks.
Built on the headless [`Tasks`](/components/sdk/tasks) compound from `@get-asset/sdk`.
## Preview [#preview]
The card lists the pending tasks in one collapsible section per task type, with a reconnect, upload or comment action on each row.
## Usage [#usage]
```tsx
import { AssetProvider, AssetTasks } from "@get-asset/react";
fetchToken(businessId)}
>
{/* Reconnect, upload, and comment actions all work out of the box */}
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `request:read`
- `transaction:read`
- `plaid:create`
- `plaid:update`
- `plaid:read`
- `ledger:read`
- `document:create`
- `journal_entry:read`
- `journal_entry:create`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the outer card element. |
| `title` | `React.ReactNode` | No | | The card's heading. Defaults to "Requests" (with the live status beside it); pass your own node, or "" to render no header at all — for composing the list under another card's heading (Book Health does this). |
| `subtitle` | `React.ReactNode` | No | | The line under the header. Defaults to "Complete these tasks to help keep your business records up to date."; pass "" to render nothing. |
| `onConnected` | `PlaidConnectOnConnected` | No | | Called after a successful Plaid reconnect is finalised. |
| `onError` | `(error: Error) => void` | No | | Called if the reconnect fails. |
| `onExit` | `PlaidLinkOnExit` | No | | Forwarded to Plaid Link — called when the user exits the flow. |
| `onEvent` | `PlaidLinkOnEvent` | No | | Forwarded to Plaid Link — called on each Link event. |
| `tasks` | `TasksTask[]` | No | | Override the fetched tasks with a fixed list — primarily for testing / storybook. Skips the API call. Pending entries become the rows; completed entries are ignored. |
| `accounts` | `ExternalAccountPublic[]` | No | | Override the external accounts (resolved for statement / reconnect / categorization rows) — primarily for testing / storybook. When omitted, they're fetched live only if a displayed task references one. |
| `plaidConnections` | `PlaidConnectionPublic[]` | No | | Override the Plaid connections (which group a reconnect row's account with the rest of its bank) — primarily for testing / storybook. When omitted, they're fetched live only if a reconnect task is displayed. |
| `transactions` | `TransactionPublic[]` | No | | Override the transactions (resolved for categorization rows) — primarily for testing / storybook. When omitted, they're fetched live only if a displayed task references one. |
| `onReconnect` | `(task: TasksTask, target: PlaidUpdateTarget \| null) => void` | No | | Invoked when a reconnect row's button is clicked — wire it to your Plaid (update-mode) flow. `` wires this to the shared `PlaidLink` for you. Receives what the update acts on: the account the row reconnects, every account of its Plaid connection (the update disconnects any of them left out of the selection), and that connection. `null` until the accounts and the Plaid connections are both known. |
| `onReviewTask` | `(task: TasksTask) => void` | No | | Invoked when a review row's hand-off button is clicked — wire it to your transactions page for the task's month. Month-level review tasks have no transaction to note, so reviewing is how they complete. The button is a no-op while this is unset. |
| `onUpload` | `(task: TasksTask, files: File[]) => Promise` | No | | Override the upload flow. By default the chosen files are attached to the task as documents. Supply your own only to customise that, or to stub it in tests/storybook. |
| `onAddNote` | `(task: TasksTask, message: string) => Promise` | No | | Override how a comment is saved when classifying. Defaults to resolving the task's journal entry and leaving the note on it. Supply your own only to customise that, or to stub it in tests/storybook. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing / storybook. |
## States [#states]
- **Loading.** The tasks are being fetched.
- **Success.** The pending tasks, one collapsible section per task type.
- **Empty.** Nothing is pending, so the business is up to date.
- **Error.** The tasks couldn't be loaded.
Force a state with the `state` prop.
# Theming (/components/react/theming)
A batteries-included styled layer on top of @get-asset/sdk. Import a single component per card, drop it in, and it renders with the default theme.
## What's included [#what]
- An `Asset`-prefixed component for every primitive — the financial cards (`AssetRevenueCard`, `AssetExpensesCard`, `AssetSnapshotCard`, `AssetCashflowCard`, `AssetProfitLossCard`, `AssetOperatingExpensesCard`) plus the reports, tables, and flows (e.g. `AssetTransactions`, `AssetDocuments`, `AssetTasks`, `AssetAccountsList`).
- Building-block primitives: `Card`, `Badge`, `Button`, `Skeleton`, `Spinner`, `Divider`, `ErrorState`, `LoadingMessage`, and a `Typography` family (`Heading`, `Amount`, `Value`, `Muted`).
- Two stylesheets — `theme.css` (CSS custom properties) and `styles.css` (class-based rules) — that you import once.
## Theming [#theming]
Every value is expressed as a CSS custom property. Override them at any scope — `:root`, a `data-theme` attribute, or a single card — and every piece of the styled layer picks up the change. Two themes ship with the docs site: the **default** light theme and **Slate**, a dark teal-accented theme that demonstrates how far you can push things with just CSS variables. Toggle below to re-skin the whole styled layer — no components are replaced, only the values behind `--asset-background`, `--asset-primary`, `--asset-chart-*`, and friends.
## Default theme [#default]
A clean light theme with a purple primary (`#7c3aed`). Chart palette uses a green accent for revenue and a lavender gradient for expense breakdowns.
## Slate theme [#slate]
A dark theme built on a cool slate surface (`#0f172a`) with a teal primary (`#14b8a6`). Demonstrates the full range — surfaces, foregrounds, semantic states, and chart palette all swap.
```css
[data-asset-theme="slate"] {
--asset-background: #0f172a;
--asset-surface: #1e293b;
--asset-card: #1e293b;
--asset-foreground: #f1f5f9;
--asset-muted-foreground: #94a3b8;
--asset-primary: #14b8a6;
--asset-primary-foreground: #0f172a;
--asset-chart-revenue: #14b8a6;
--asset-chart-expense: #f472b6;
/* … */
}
```
## Applying a theme [#applying]
Scope the override however you like — the whole document, a route segment, or a single card.
```tsx
/* Site-wide */
:root {
--asset-primary: teal;
}
/* One subtree */
```
Because the styled components read from CSS variables — not props — you can host multiple themes on the same page (default for the navigation, Slate inside a demo iframe, etc).
See [CSS Variables](/components/react/variables) for the full catalog of tokens you can override.
# Transaction Match (/components/react/transaction-match)
Styled, drop-in matching panel: a Payments block with one chip per payment already matched to an invoice or bill, and a searchable Select Deposit picker over the bank transactions around its due date.
Styled, drop-in matching panel: a **Payments** block with one chip per payment already matched to an invoice or bill, and a searchable **Select Deposit** picker that suggests bank transactions around its due date (**Select Transactions** on a bill). Ticking a transaction records the payment and unticking it takes the payment off again — each is its own request, so there is no save — and every chip carries its own remove control. A `layout` prop swaps the standalone block for an inline stack with a payment total, for surfaces that introduce the panel themselves. [`AssetInvoices`](/components/react/invoices) embeds this panel already; mount it yourself to put matching on a surface of your own. See [Using it standalone](#using-it-standalone).
Built on the headless [`TransactionMatch`](/components/sdk/transaction-match) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetTransactionMatch } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `invoice:create`
- `invoice:delete`
- `bill:create`
- `bill:delete`
- `transaction:read`
- `external_account:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | Forwarded to the panel's outer element. |
| `layout` | `"panel" \| "inline"` | No | `"panel"` | How the surface presents itself. `"panel"` is the standalone block — a "Payments" head carrying the picker, the matched chips, and an empty-state box that keeps the block's shape before anything is matched; it's what the row expander mounts. `"inline"` drops the head and the empty box and adds a payment total under a dashed rule, for embedding inside a surface that already introduces it — the document view's summary band. |
| `closeAction` | `React.ReactNode` | No | | Rendered in the footer. The host owns Close because closing is the host's concern — this panel lives inside an expanded row and has no idea how that row collapses. It's the only thing left in the footer now that matching writes on the spot. Omit it and there is no footer. |
| `paidTotal` | `number` | No | | What the record itself says has been paid, in the record's own currency. The inline footer states this rather than the sum of the matched rows: a matched transaction carries its own account's currency, and a payment can also come from a credit, which never appears as a row here. Omit it and the footer falls back to the sum of the matched rows. |
| `currency` | `string \| null` | No | | ISO 4217 code `paidTotal` is in — the record's, not a transaction's. Shown beside the figure and used for its symbol. |
| `trailing` | `React.ReactNode` | No | | Cards that belong in the payments stack without being matches — an invoice's refunds and credits. In the panel they sit directly under the matched chips; inline, under the payment total. Render nothing to add nothing. |
| `kind` | `"invoice" \| "bill"` | Yes | | Which side of the ledger this is: `"invoice"` or `"bill"`. Picks the apply/detach endpoints and the sign a candidate must have — an invoice is settled by money in, a bill by money out. |
| `objectId` | `string` | Yes | | The Invoice or Bill being settled. Sent as the payment's parent. |
| `outstanding` | `number` | Yes | | What's still owed on the record. Suggested transactions are compared against it, and it caps a credit's suggested draw. Zero (to the cent) disables matching entirely. |
| `dueAt` | `string` | Yes | | The record's due date, ISO-8601. The picker suggests transactions around it; see Guardrails in the Transaction Match docs for the supported range. |
| `matched` | `MatchedPayment[]` | No | `[]` | The payments already recorded against the record, from whichever list owns it. They become the matched rows and are what a candidate's untick detaches; their descriptions are also what a settled record renders, since no suggestions are loaded to resolve one. |
| `pageSize` | `number` | No | `50` | Suggestions loaded per request. The API's ceiling is 100; values are clamped to 1–100. |
| `candidates` | `MatchCandidateOverride[]` | No | | Override the candidate transactions, skipping the request for suggestions. The direction filter still applies, so an offline story behaves like the live component. An empty array is still an override — it renders the empty state without a request. Used by storybook/tests. |
| `credits` | `CreditSource[]` | No | | Credits the party holds, as a second payment source. Host-supplied: no balance query is issued. Omit it and the credit group doesn't render. |
| `applyCredit` | `(credit: CreditSource, amount: number) => void` | No | | Applies `amount` of `credit` to this record. The host's write, not the SDK's — without it a credit can be shown and priced but not committed (`canApplyCredit` is false). The amount is clamped to the credit's remaining balance, and a draw that rounds to nothing is dropped. |
| `removeCredit` | `(row: MatchRow) => void` | No | | Removes an applied credit. Host-owned for the same reason as `applyCredit`. Absent, a credit row detaches through the ordinary payments endpoint. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. Skips the candidate requests. Ignored on a settled record, which has its own state. |
| `showCurrency` | `boolean` | No | | Force the ISO code beside each amount on or off, skipping the business fetch (storybook/tests). By default it shows only for a business that holds money in more than one currency. |
| `onChanged` | `() => void` | No | | Called after each committed change. Writes land one at a time and the panel stays open, so hosts use this to react to a change, not to close. |
## States [#states]
- **Loading.**
- **Success.** $2,100 outstanding, one payment matched, candidates in the picker.
- **Empty.** Nothing in the supported date range to offer — the picker opens on its empty message.
- **Error.**
- **Settled.** Nothing outstanding: the picker is disabled, the payments still read.
- **With credits.** A second group in the picker. This preview supplies no writer, so a pick commits nothing.
- **No payments.** The same block, saying what would go in it.
## Behaviour [#behaviour]
As a panel — the default — it is one block whatever state it is in: a head that names it and carries the picker, the chips for what is already matched, and an empty-state box before anything is — not a missing list but the same container saying what would go in it, so the block never changes shape as the first payment lands. The inline layout drops the head and the empty box and adds a payment total under a dashed rule, for a surface that already introduces the block in its own words. In both, the trigger names what it offers by where the money went — **Select Deposit** against an invoice, **Select Transactions** against a bill — and the amounts carry the same sign, `+` for money in, `−` for money out.
The picker suggests bank transactions around the due date and shows how their amounts compare with the outstanding balance. The user chooses which payment to apply. It is a dropdown rather than a list on the page, so the panel does not grow with the number of suggestions: you search and scroll inside it. Which dates it covers is explained in [Guardrails](/components/sdk/transaction-match#guardrails). Each option sits on three fixed tracks — date, description, amount — so the columns line up down the whole list, which is what scanning a dozen rows for the one that fits actually requires. The date leads because two payments from the same payer are told apart by when they landed; the amount is last because it is the figure being judged.
Ticking an option records the payment; unticking it detaches the payment again. Already-matched transactions come back ticked, so the control states the current position rather than only offering additions, and only the row being written goes quiet while its request is in flight. Transactions moving money the wrong way are never offered at all. [Guardrails](/components/sdk/transaction-match#guardrails) has the decisions behind that, including the supported date range and how a transaction worth more than the balance is still offered while the API accounts for its excess.
Each matched payment reads as a chip: the bank description, when it landed and through which account, the amount it applied, and a remove control. The control is always visible rather than revealed on hover — it is the only reversal on the chip, and there is no hover to find it with on touch. The amount is read-only for every source, because it is the allocation already recorded by the API or host; when a transaction settled the record for less than it moved, its own figure sits struck through beside the applied one.
The inline layout's total ("Payment total" on an invoice, "Transaction total" on a bill) is the running answer to "how much of this record is covered". A settled record reads it plain. An overpaid one reads it in red on both kinds — the direction differs, an invoice took too much in (+) where a bill sent too much out (−), but the alarm doesn't. The fuller reconciliation (what the record is worth, what that leaves) is in neither layout: only the host knows what the record is worth, so it owns those figures; `AssetInvoices` puts them in the column beside the expander's panel.
A settled record keeps the picker, disabled: you can still read and undo what paid it, and hiding the only control would make a settled record look like a different component. It also costs nothing — no suggestions are loaded. See [Settled records](/components/sdk/transaction-match#settled).
## Using it standalone [#using-it-standalone]
[`AssetInvoices`](/components/react/invoices) mounts this panel in the expanded row and in the document view's summary band, so a host rendering that table needs nothing here — `matchCandidates` on the table is how its previews and tests keep it offline.
Mounting it yourself means supplying the record's facts, because the panel settles one record and does not fetch it: `kind`, the `objectId`, its `outstanding` balance, its `dueAt` date (the picker suggests transactions around it; see [Guardrails](/components/sdk/transaction-match#guardrails) for the supported range), and the payments already against it as `matched`. Those payments are what make the panel a two-way surface rather than an add-only one, and they are the only descriptions a settled record has to show. A successful write invalidates the invoice and bill lists, so a table beside the panel moves on its own; `onChanged` is for anything else that needs to react.
For a layout of your own — a different picker, the difference column this one leaves out, a per-row exact-match badge — compose the headless [`TransactionMatch`](/components/sdk/transaction-match) parts directly. Every value and control in this panel is one of its slots.
## Credits [#credits]
A credit the party already holds can settle a record beside the bank transactions, and it is host-supplied end to end: `credits` is the list, `applyCredit` is the write, and `removeCredit` is what a drawn credit's bin calls. Nothing here queries a credit balance. Pass `credits` without `applyCredit` and the group is a preview: the rows are priced but a pick commits nothing.
The picker labels the two groups, because they behave differently once picked. A transaction lands at its own value — the bank moved exactly that much. A credit is a pool, so what lands is a figure someone chooses: the amount on the right of a credit option is what is left on the credit, and the tooltip is what applying it here would draw — the smaller of the two, so a $1,000 credit against a $100 invoice takes $100 and leaves $900. Unlabelled they would read as one list where half the rows silently ask a follow-up question.
# Transactions (/components/react/transactions)
Styled transactions table showing each transaction's date, description, account, amount and a Categorize or match field.
Styled transactions table showing each transaction's date, description, account, amount — printed with its own currency's symbol and followed by the ISO code, muted — and a **Categorize or match** field. The field opens a picker with a Categorize | Match switch: the business's categories with Split below, or the open bills for money out and open invoices for money in. Picking stages the row; the tick (✓) records it and confirms the row, which then shows a green check and stays editable. A split is built in an expanded state under the row. The header carries status and account filter dropdowns, and a "load more" banner at the bottom fetches the next page. Do it yourself shows "For Review" / "Confirmed" with no Status column; Done for you shows "In Review" / "Needs Attention" / "Confirmed" and keeps the bookkeeper note (💬) beside the tick. Notes post to the journal entry, then set `bookkeeper_pending`, even if previously confirmed.
Built on the headless [`Transactions`](/components/sdk/transactions) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetTransactions } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `transaction:read`
- `transaction:update`
- `ledger:read`
- `bill:read`
- `invoice:read`
- `vendor:read`
- `customer:read`
- `bill:create`
- `bill:delete`
- `invoice:create`
- `invoice:delete`
- `external_account:read`
- `business:read`
- `tag:read`
- `journal_entry:read`
- `journal_entry:create`
- `chat:create`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `hiddenColumns` | `TransactionsColumn[]` | No | | Columns to omit from the table. Options: `"date"`, `"transaction"`, `"tag"`, `"account"`, `"amount"`, `"status"` and `"category"`. All columns are shown by default. |
| `className` | `string` | No | | Forwarded to the outer container element. |
| `dateFrom` | `CalendarDateString` | No | | Inclusive start (`YYYY-MM-DD`) of a fixed reporting range. Detaches the table from the provider's shared range entirely; must be paired with `dateTo` — passing one without the other throws. Use `periodDateRange` to derive the pair from a month, quarter, or year. |
| `dateTo` | `CalendarDateString` | No | | Inclusive end (`YYYY-MM-DD`) of a fixed reporting range. Must be paired with `dateFrom`. Omit both to follow the provider's `DatePicker`-driven range. |
| `accountIds` | `string[]` | No | | Only include transactions for these external account ids (passed to the API). |
| `ledgerType` | `"asset" \| "liability" \| "equity" \| "revenue" \| "expense"` | No | | Only include transactions with a line in a ledger of this type, e.g. `"expense"` (always applied to the fetch). Ignored when `ledgerSubtype` is also set — the subtype is more granular and already implies its type. |
| `ledgerSubtype` | `LedgerSubType` | No | | Only include transactions with a line in a ledger of this subtype, e.g. `"operating_expense"` (always applied to the fetch). Takes precedence over `ledgerType` — when both are set only the subtype is sent. |
| `defaultStatusFilter` | `string` | No | `"all"` | Pre-select the status filter dropdown. An API status value or `"all"`. Managed offers `"business_pending"` (Needs Attention), `"bookkeeper_pending"` (In Review) and `"confirmed"` (Confirmed); DIY/core offer `"bookkeeper_pending"` (For Review) and `"confirmed"`. Uncontrolled — sets the initial selection; the user can still change it. |
| `defaultAccountFilter` | `string` | No | `"all"` | Pre-select the account filter dropdown. An external account id or `"all"`. A specific account overrides the `accountIds` prop, matching the behaviour when the user picks one. Uncontrolled — the user can still change it. |
| `pageSize` | `number` | No | | Page size passed to the API. |
| `entries` | `TransactionOverride[]` | No | | Override the rows shown, skipping the API fetch. Used by storybook/tests. |
| `tagFields` | `TransactionTagField[]` | No | | Override the fetched tag fields (name + values), skipping the fetch. Pass `[]` to hide all tag UI, including the Tag column; omit to fetch the business's fields with their values. |
| `allowCreateTag` | `boolean` | No | `true` | Allow consumers to offer creation of new tag values. |
| `plan` | `"diy" \| "managed" \| "core"` | No | | Override the business plan that drives the status labels/options (skips the business fetch — storybook/tests): `"managed"` (Done for you), or `"diy"` / `"core"` (Do it yourself, identical behaviour). Drives status labels, filter options, and actions. Defaults to the fetched plan, or `"managed"`. |
| `showCurrency` | `boolean` | No | | Force the ISO code beside each amount on or off, skipping the business fetch (storybook/tests). By default it shows only for a business that holds money in more than one currency. |
| `hasMore` | `boolean` | No | | Force the "load more" banner when using `entries` (storybook/tests). |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. |
| `categoryOptions` | `TransactionCategoryOptionOverride[]` | No | | Override the Categorize list, skipping the ledger fetch. Each entry is `{ id, name, parentId? }`. Used by storybook/tests. |
| `openBills` | `TransactionMatchRecordOverride[]` | No | | Override the open bills offered to money out in the Match tab, skipping their fetches. Each entry is `{ id, party?, number, dueAt, outstanding, currency? }`. Used by storybook/tests. |
| `openInvoices` | `TransactionMatchRecordOverride[]` | No | | Override the open invoices offered to money in in the Match tab, skipping their fetches. Same entry shape as `openBills`. Used by storybook/tests. |
| `feedback` | `boolean` | No | `false` | Offer the agent feedback form (the cross) on Do-it-yourself rows. Off by default: the picker and the tick replace it. Done-for-you rows keep their bookkeeper note either way. |
| `onAddRecord` | `(transaction: TransactionPublic, kind: TransactionMatchKind) => void` | No | | Called by Add bill / Add invoice with the transaction and the record kind, so the host can open its own Bills or Invoices component. The table writes nothing; once the host's lists refresh the new record is offered in the Match tab. Omit it to hide the action. |
| `onRecorded` | `(transaction: TransactionPublic, treatment: TransactionTreatment) => void` | No | | Called after a row's treatment (category, split or match) is recorded — by the tick, or by a pick on a confirmed row. |
| `onConfirmed` | `(transaction: TransactionPublic) => void` | No | | Called after the tick confirms a transaction (its treatment recorded and its status set to `confirmed`). |
| `onTagsChanged` | `(transaction: TransactionPublic, field: string, values: string[]) => void` | No | | Notification fired once per edited field after a successful tag write. |
| `onContextSubmitted` | `(transaction: TransactionPublic, message: string) => void` | No | | Called after either the journal-entry note and status write succeed or the agent chat finishes (including the self-serve status write). Receives the transaction and submitted message; the write is handled by the SDK. |
## States [#states]
- **Loading.**
- **Success.**
- **Empty.** No transactions recorded.
- **Error.**
- **With tags.**
## Categorize or match [#categorize-or-match]
The field reads what the row is, or is staged to become: a category name, the split icon with `N categories`, the link icon with the bill or invoice's party and number, or *Choose a category*. The link icon follows `--asset-primary`; set `--asset-match-icon` to give it its own colour. The picker opens on Match when the row is matched, and on Categorize otherwise; a zero-amount transaction has no Match tab.
On a row that needs review, a pick only stages it — the tick records it. When exactly one open bill or invoice has an outstanding balance equal to the row's amount, it is staged on load so one tick records the payment. On a confirmed row a pick writes at once; a matched row's payment is detached first, so the record's balance is restored.
Split opens *Split transaction* under the row: a category and an amount per line, with the amount *Left to split* (or *Over by*). Save is enabled only when every line has a category and an amount and the lines add up. Removing lines down to one saves that category alone. See the [SDK page's Categorize or match section](/components/sdk/transactions#categorize-or-match) for the write order.
## Tags [#tags]
Whenever the business defines at least one tag field, a Tag column appears between Transaction and Account (and is hidden entirely otherwise). It shares the Categorize or match field's height, radius, chevron and panel. The closed state shows a quiet `+ Tag` when a row is untagged, its first value once tagged, and `value +N` when it carries more — hover to see the full set. On mobile the field and the tag split the control line evenly, with the tick at the end.
Clicking the trigger opens a searchable picker grouped by field; typing a value that doesn't exist yet on a field reveals an `Add "…" to ` row that creates it (disable this with `allowCreateTag={false}`).
Edits write per field, and when a field ends up with more than one value the transaction's amount is split evenly across them in reports — see the [SDK page's Tags section](/components/sdk/transactions#tags) for the full write semantics.
## Plan behaviour [#plan-behaviour]
Some components behave differently depending on whether a bookkeeper keeps the business's books. On **Done for you** (the `managed` plan) a bookkeeper reviews and categorises the books for them. On **Do it yourself** (the `diy` and `core` plans) there is no bookkeeper, so the business keeps its own books — `core` behaves exactly like `diy` everywhere below. The plan is resolved from the business automatically — override it with the `plan` prop.
The picker and the tick behave the same on either plan, but the status labels a customer sees, the Status column, the status filter options, and the other actions all depend on whether a bookkeeper is in the loop:
| Behaviour | Done for you (`managed`) | Do it yourself (`diy`, `core`) |
| :-- | :-- | :-- |
| Status labels | **In Review** / **Needs Attention** / **Confirmed**. | **For Review** / **Confirmed**. DIY and core behave identically; a defensive `business_pending` override also reads **For Review**. |
| Status column | Shown. | Hidden — the tick and the green check carry the status. |
| Status filter | All statuses / Needs Attention / In Review / Confirmed. | All transactions / For Review / Confirmed. |
| Actions | ✓ the tick, and 💬 leave a note for the bookkeeper | ✓ the tick; ✕ agent feedback only with `feedback` |
| Row click | Opens the note form, with the category breakdown when the row is split. | Nothing; with `feedback`, opens the feedback form. |
| Submitting | Posts a journal-entry note and sets bookkeeper_pending (In Review), including previously confirmed rows. | Runs the agent chat, then sets bookkeeper_pending (For Review) for the business to re-confirm. |
# CSS variables (/components/react/variables)
Every themeable value exposed by @get-asset/react/theme.css. Override any of them at any scope to retheme.
## Surfaces [#surfaces]
| Variable | Default | Description |
| --- | --- | --- |
| `--asset-background` | `#f9fafb` | Outermost page background. |
| `--asset-surface` | `#FAFBFA` | Subtle surface used for grouped sections and toolbars. |
| `--asset-card` | `#ffffff` | Card surface. |
| `--asset-chip` | `#e5e7eb` | Inline highlight chip background (e.g. figures called out in AI insight answers). |
## Borders [#borders]
| Variable | Default | Description |
| --- | --- | --- |
| `--asset-border` | `#d2d5d4` | Default hairline border on cards, dividers, inputs. |
| `--asset-border-strong` | `#d1d5db` | Stronger border for hover/emphasis states. |
| `--asset-border-subtle` | `#e8e9e8` | Lighter divider used for table rows and column splits. |
## Text [#text]
| Variable | Default | Description |
| --- | --- | --- |
| `--asset-foreground` | `#111827` | Primary text color. |
| `--asset-muted-foreground` | `#6b7280` | Secondary text — labels, captions, low-emphasis metadata. |
## Brand [#brand]
| Variable | Default | Description |
| --- | --- | --- |
| `--asset-primary` | `#7c3aed` | Brand accent. Used on buttons, links, focus rings. |
| `--asset-primary-foreground` | `#ffffff` | Text color on --asset-primary surfaces. |
## Pickers [#pickers]
Date and period pickers use a neutral control palette independently of the primary brand accent. Override these variables together to keep triggers, calendars, and selected periods visually consistent.
| Variable | Default | Description |
| --- | --- | --- |
| `--asset-picker-background` | `#ffffff` | Date and period picker trigger, field, and popover surfaces. |
| `--asset-picker-foreground` | `#18181b` | Primary picker text and icons. |
| `--asset-picker-muted` | `#707070` | Secondary picker labels and out-of-month dates. |
| `--asset-picker-icon` | `#0a211d` | Calendar and navigation icons inside picker controls. |
| `--asset-picker-border` | `#d2d5d4` | Picker trigger, field, and popover borders. |
| `--asset-picker-hover` | `#f4f4f5` | Hover background for available dates and period options. |
| `--asset-picker-selected` | `#18181b` | Background for selected dates and period options. |
| `--asset-picker-selected-foreground` | `#ffffff` | Text and icon color on selected picker options. |
| `--asset-picker-focus` | `#18181b` | Focus outline for picker controls. |
## Chat [#chat]
Only the customer’s own messages render as a bubble; the agent’s replies are prose on the page and take their colour from `--asset-foreground`. Both bubble variables are unset by default and fall back to the base tokens, so set them only when the bubble should differ from the rest of the theme — and set the pair together to keep the text readable against the new background.
| Variable | Default | Description |
| --- | --- | --- |
| `--asset-chat-bubble` | `var(--asset-foreground)` | Background of the customer's own chat message bubble. Unset by default, so it follows --asset-foreground. |
| `--asset-chat-bubble-foreground` | `var(--asset-card)` | Text colour inside the customer's own chat message bubble. Unset by default, so it follows --asset-card. |
## Semantic states [#semantic-states]
Semantic tokens come as a background/foreground pair. Use the pair together — e.g. set `background: var(--asset-success)` and `color: var(--asset-success-foreground)`.
| Variable | Default | Description |
| --- | --- | --- |
| `--asset-success` | `#bbf7d0` | Success background (positive deltas). |
| `--asset-success-foreground` | `#166534` | Text color on --asset-success surfaces. |
| `--asset-success-strong` | `#16a34a` | Saturated success used directly on status indicators (e.g. account sync dots). |
| `--asset-warning` | `#d97706` | Saturated warning used directly on status indicators. |
| `--asset-destructive` | `#fecaca` | Destructive background (negative deltas, errors). |
| `--asset-destructive-foreground` | `#991b1b` | Text color on --asset-destructive surfaces. |
## Status indicators [#status-indicators]
Status-dot colors shared by the document and book-health cards: pending / processed / needs-attention / failed. A “processing” state renders as a hollow ring, so it has no fill token of its own.
| Variable | Default | Description |
| --- | --- | --- |
| `--asset-status-pending` | `#d2d5d4` | Pending status — nothing to act on yet. |
| `--asset-status-processed` | `#139562` | Processed/ready status — completed and verified. |
| `--asset-status-attention` | `#ffbe4d` | Needs-attention status — waiting on the user. |
| `--asset-status-error` | `#ff4d4d` | Failed status. |
## Chart palette [#chart-palette]
The snapshot, profit & loss, and operating-expense charts all pull colors from these variables. `--asset-chart-revenue` and `--asset-chart-expense` are the canonical revenue/expense colors; `--asset-chart-1` through `--asset-chart-5` drive categorical breakdowns.
| Variable | Default | Description |
| --- | --- | --- |
| `--asset-chart-revenue` | `#15803d` | Revenue bar/line color. |
| `--asset-chart-revenue-outline` | `#164b3e` | Outline stroke on revenue bars. |
| `--asset-chart-expense` | `#a78bfa` | Expense bar/line color. |
| `--asset-chart-1` | `#7c3aed` | Chart palette step 1. |
| `--asset-chart-2` | `#9061f9` | Chart palette step 2. |
| `--asset-chart-3` | `#a78bfa` | Chart palette step 3. |
| `--asset-chart-4` | `#b794f4` | Chart palette step 4. |
| `--asset-chart-5` | `#c4b5fd` | Chart palette step 5. |
The agent’s in-chat comparison graphs assign these series colors by recency (the most recent series leads with series 1, cycling after the fourth). Bars use the fill plus its `-outline` stroke; lines use the saturated `-line` stroke, which the legend swatch follows.
| Variable | Default | Description |
| --- | --- | --- |
| `--asset-chart-series-1` | `#dfd4fe` | Series 1 bar fill — the most recent series. |
| `--asset-chart-series-1-outline` | `#a16cf3` | Series 1 bar outline. |
| `--asset-chart-series-1-line` | `#6419c5` | Series 1 line stroke and legend swatch. |
| `--asset-chart-series-2` | `#107257` | Series 2 bar fill. |
| `--asset-chart-series-2-outline` | `#164b3e` | Series 2 bar outline. |
| `--asset-chart-series-2-line` | `#107257` | Series 2 line stroke and legend swatch. |
| `--asset-chart-series-3` | `#cfe3ff` | Series 3 bar fill. |
| `--asset-chart-series-3-outline` | `#3b82f6` | Series 3 bar outline. |
| `--asset-chart-series-3-line` | `#3b82f6` | Series 3 line stroke and legend swatch. |
| `--asset-chart-series-4` | `#ffe4b5` | Series 4 bar fill. |
| `--asset-chart-series-4-outline` | `#d97706` | Series 4 bar outline. |
| `--asset-chart-series-4-line` | `#d97706` | Series 4 line stroke and legend swatch. |
## Shape & typography [#shape--typography]
| Variable | Default | Description |
| --- | --- | --- |
| `--asset-radius` | `8px` | Base corner radius used on cards, badges, buttons. |
| `--asset-font-sans` | `system UI stack` | Sans-serif font family. |
| `--asset-font-mono` | `ui-monospace` | Monospace font family, used in code and numeric values. |
# Vendors (/components/react/vendors)
Styled, drop-in Vendors directory — name, email, phone and an active/disabled status dot per row.
The header carries a name search, an Active/Disabled filter, and an "Add vendor" button that reveals a panel above the table; each row's kebab offers Edit, which expands the same form from the row, and Disable. Name is the only required field. Covers loading, error, empty and success, and restacks onto a narrow layout via a container query.
Built on the headless [`Contacts`](/components/sdk/contacts) compound from `@get-asset/sdk`.
## Preview [#preview]
## Usage [#usage]
```tsx
import { AssetProvider, AssetVendors } from "@get-asset/react";
fetchToken(businessId)}
>
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this component to fetch data successfully:
- `customer:read`
- `customer:create`
- `customer:update`
- `vendor:read`
- `vendor:create`
- `vendor:update`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `className` | `string` | No | | |
| `pageSize` | `number` | No | `25` | Rows per request. Further pages are fetched by `LoadMore`. |
| `contacts` | `ContactOverride[]` | No | | Override the fetched contacts (skips the API call). The search and active/disabled filters are still applied, client-side, so an offline story behaves like the live component. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. Also skips the API call. |
| `hasMore` | `boolean` | No | | Force the `LoadMore` affordance to render. Only consulted alongside `contacts` — live, pagination comes from the API's next page token. |
| `defaultCreating` | `boolean` | No | `false` | Open the add-contact draft on mount. |
## States [#states]
- **Loading**
- **Success**
- **Empty.** No vendors yet — the state offers the add action.
- **Error**
- **Adding.** The add panel, revealed above the table.
- **Disabled listing.** Switching the filter to Disabled shows the other listing.
## Behaviour [#behaviour]
Typing in the search box filters on the vendor's name and is debounced before the list is re-requested, so the table doesn't flash a loading state on every keystroke. The Active/Disabled dropdown switches between two listings rather than widening one, so every row in view carries the same status.
A disabled vendor drops out of the default listing and out of pickers, but the bills already recorded against it are untouched, and the same menu item re-enables it. Adding and editing share one form: only **Name** is required, and a cleared email or phone is saved as empty rather than left behind.
The empty state adapts to why it's empty — a search that matched nothing offers to clear it, the disabled listing says everyone is active, and a genuinely empty directory offers the add action.
Every value, control and gate is a slot on the headless compound. See the [Contacts part inventory](/components/sdk/contacts#api) to rearrange the layout or swap the primitives, and [`AssetCustomers`](/components/react/customers) for the same surface over customers.
# Account Checks (/components/sdk/account-checks)
Headless compound for the checks written on one bank account.
Headless compound for the checks written on one bank account. Each check reads as not cleared, not cleared past 90 days (one the payee may never cash, worth chasing), cleared or voided, with the date it settled. The footer counts what was still open when last month closed, which is what the month's reconciliation allows for. The styled `AssetStatementReconciliation` shows it on the account's Checks tab; see [Statement Reconciliation](/components/sdk/statement-reconciliation).
## Anatomy [#anatomy]
Import the primitive and compose the parts you need.
```tsx
…Try again… not cleared on
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this primitive to fetch data successfully:
- `check:read`
- `document:create`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `accountId` | `string` | Yes | | The bank account the checks were drawn on. |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a state for testing/storybook. |
| `checks` | `CheckPublic[]` | No | | Override the fetched checks (skips the API) — storybook/tests. |
| `checksToMatch` | `string[]` | No | | With `checks`: the ids of those with a bank payment to match. |
| `reconciledThrough` | `string \| null` | No | | The account's last reconciled month (`YYYY-MM`): open checks are counted to its end, the figure the books were last tied on. Without one, to the end of last month. |
| `now` | `number` | No | | "Today", for ages and the footer — storybook/tests. Defaults to now. |
### Parts [#parts]
#### States [#states]
| Part | Props | Description |
| :-- | :-- | :-- |
| `AccountChecks.Loading / Error / Success / Empty` | | State gates for the checks. |
| `AccountChecks.ErrorMessage / Retry` | `asChild?, format?` | Error copy and retry. |
#### Checks [#checks]
Oldest first, as a register is kept.
| Part | Props | Description |
| :-- | :-- | :-- |
| `AccountChecks.Rows / Row` | `asChild?` | Iterates the checks. Row sets data-state (not_cleared \| stale \| cleared \| voided) and data-tone (action \| neutral \| done \| void). |
| `AccountChecks.CheckNumber / IssuedAt / Payee` | `asChild?, format?` | The check as written. |
| `AccountChecks.Status` | `asChild?, format?` | "Cleared Aug 7", "Not cleared, past 90 days", "Payment to match". format receives the row; checkStateLabel words it. Sets data-state and data-tone. |
| `AccountChecks.RowIs` | `state` | Renders its children when the row is in one of the states: not_cleared, stale, to_match, cleared, voided. |
| `AccountChecks.DaysOpen` | `asChild?, format?` | Days since it was written, while it is open. Nothing once settled, or once its payment is waiting to be matched. |
| `AccountChecks.Amount` | `asChild?, format?` | Signed like the account: a check written is money out. |
#### Footer [#footer]
| Part | Props | Description |
| :-- | :-- | :-- |
| `AccountChecks.NotClearedCount / NotClearedTotal / AsOf` | `asChild?, format?` | Checks still open at the end of the last reconciled month (else last month), their total, and that day. One cleared since still counts. |
| `AccountChecks.UploadInput / Uploading / NotUploading / UploadErrorMessage` | | Upload check images for the account; each is read into a check. |
#### Hooks [#hooks]
| Part | Props | Description |
| :-- | :-- | :-- |
| `useAccountChecks() / useAccountChecksRow()` | | The context, and the check being iterated. |
# Accounts Connect (/components/sdk/accounts-connect)
Headless compound for connecting a new institution, from choosing a connection method to confirming the connected accounts.
Headless compound for connecting a new institution. It models the two steps of the flow — a default state listing the connection methods (Plaid opens Plaid Link via the Asset API; any other methods you add fire `onSelectMethod`), and a confirm state exposing the connected accounts so you can assign each as business or personal before linking. Built on the [`PlaidLink`](/components/sdk/plaid-link) engine.
## Anatomy [#anatomy]
Import the primitive and compose the parts you need.
```tsx
Recommended
{/* read useAccountsConnect().pending and build the
business/personal form, then call linkInstitutions(accounts) */}
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this primitive to fetch data successfully:
- `plaid:create`
- `plaid:read`
- `ledger:read`
- `transaction:create`
- `quickbooks:create`
- `quickbooks:read`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `onConnected` | `PlaidConnectOnConnected` | No | | Called after the accounts are linked on the Asset API. Its second argument is the account that was reconnected, or `null` for a new connection. |
| `onQuickBooksConnected` | `(connection: QuickBooksConnectionInfo) => void` | No | | Called once QuickBooks is connected, with the new connection. |
| `onChanged` | `AccountsOnChanged` | No | | Called after each accepted change: a Plaid connection (`connected`), a QuickBooks connection (`connected`), a manual account (`created`). For a host that keeps account-derived data of its own to refresh. |
| `onError` | `(error: Error) => void` | No | | Called if creating the link token, linking, or starting QuickBooks fails. |
| `onExit` | `PlaidLinkOnExit` | No | | Forwarded to Plaid Link. |
| `onEvent` | `PlaidLinkOnEvent` | No | | Forwarded to Plaid Link. |
| `onSelectMethod` | `(id: string) => void` | No | | Called with the id of the one of `extraMethods` that was selected. Plaid, QuickBooks and Manual run inside the SDK and never call it. |
| `onCreated` | `() => void` | No | | Called after a manual account is successfully created. |
| `extraMethods` | `readonly ConnectionMethod[]` | No | | Methods of your own to offer next to the built-in Plaid, QuickBooks Online and Manual, shown in this order before Manual. Selecting one calls `onSelectMethod` with its id, which must not be `plaid`, `quickbooks` or `manual`. They are shown whatever the token can run, while each built-in is offered only when the token carries its scopes, so under a read-only token they can be all the panel shows. Gate the way into the panel with `AccountsConnect.useCanConnect`, as `AssetAccountsCard` does. |
| `currencies` | `readonly string[]` | No | | The currencies the manual form offers, for a host that holds money in only some of them. Defaults to `CURRENCIES`. |
| `quickbooksConnection` | `QuickBooksConnectionInfo \| null` | No | | Override the QuickBooks connection (skips that API call) — storybook/tests. `null` is "not connected". |
| `initialPending` | `PlaidInstitutionAccount \| null` | No | | Seed the pending confirmation state (testing/storybook). |
| `state` | `"loading" \| "error"` | No | | Force a specific state for testing/storybook. |
### Parts [#parts]
#### Default [#default]
Renders while choosing a connection method.
| Part | Props | Description |
| :-- | :-- | :-- |
| `AccountsConnect.Default` | | State wrapper. Compose the method list inside. |
| `AccountsConnect.Methods` | | Iterates each connection method, providing a method context. |
| `AccountsConnect.MethodTrigger` | `asChild?` | Button that selects the current method — Plaid opens Plaid Link, others fire onSelectMethod. Sets data-method and disables the Plaid card while loading. |
| `AccountsConnect.MethodTitle` | `asChild?` | Renders the method's title. |
| `AccountsConnect.MethodDescription` | `asChild?` | Renders the method's description. |
| `AccountsConnect.Recommended` | | Renders its children only for the recommended method. |
#### Confirm [#confirm]
Renders once a connection awaits confirmation.
| Part | Props | Description |
| :-- | :-- | :-- |
| `AccountsConnect.Confirm` | | State wrapper. Read useAccountsConnect().pending for the institution + accounts, build the business/personal form, then call linkInstitutions(accounts). |
#### Manual [#manual]
Renders the inline “add a manual account” form (selecting the built-in `manual` method, or calling openManual(), opens it).
| Part | Props | Description |
| :-- | :-- | :-- |
| `AccountsConnect.Manual` | | State wrapper. Compose the create-account form inside. Read createManual(`{ name, mask, type, contributionLedgerId?, distributionLedgerId? }`), cancelManual, manualPending, manualError, ledgers and ledgersLoading from useAccountsConnect(). On success the form closes, the accounts query is invalidated and onCreated fires. |
#### Error [#error]
| Part | Props | Description |
| :-- | :-- | :-- |
| `AccountsConnect.Error` | | State wrapper. Renders its children on connection error. |
#### Hooks [#hooks]
| Part | Props | Description |
| :-- | :-- | :-- |
| `useAccountsConnect()` | | Returns methods, select(method), pending, linkInstitutions(accounts), cancelPending, loading, error, plus the manual-creation surface: manualOpen, openManual, cancelManual, createManual(input), manualPending, manualError, ledgers, ledgersLoading. |
| `useAccountsConnectMethod()` | | Used inside ``; returns the current ConnectionMethod. |
# Accounts List (/components/sdk/accounts-list)
Headless compound that fetches a business's connected external accounts and groups them by institution.
Headless compound that fetches a business's connected external accounts and groups them by institution. Each group sorts its accounts by name; groups are sorted alphabetically. Each group is a collapsible summary row (`GroupToggle`, `GroupStatus`); per-account parts expose the name, masked number, type, sync status, and the balance with the currency it is held in, plus a `Disconnected` gate wrapping a `Reconnect` action. A group states no total: accounts under one institution can be held in different currencies, so the balances that mean something are the rows'.
It also carries reconciliation: each account gains a derived statement state (`Statements`) built from the statements the backend has asked for, and the list is a three-screen flow — the accounts table, one account's statements, and a review of everything posted since it last balanced. See [Reconciliation](#reconciliation).
## Anatomy [#anatomy]
Import the primitive and compose the parts you need.
```tsx
{/* Group summary row */}
▾Reconnect…No accounts connected.
```
## Required scopes [#scopes]
The access token used by `AssetProvider` must include these scopes for this primitive to fetch data successfully:
- `external_account:read`
- `external_account:update`
- `transaction:delete`
- `ledger:read`
- `request:read`
- `transaction:read`
- `document:read`
- `document:create`
- `document:delete`
- `report:read`
- `ledger:update`
- `business:read`
- `reconciliation:read`
- `reconciliation:write`
- `document:create`
- `document:read`
- `check:read`
- `document:create`
- `plaid:create`
- `plaid:read`
- `plaid:update`
- `quickbooks:read`
- `quickbooks:delete`
## API reference [#api]
### Root props [#root-props]
| Prop | Type | Required | Default | Description |
| :-- | :-- | :-- | :-- | :-- |
| `institutionName` | `(account: ExternalAccountPublic) => string \| null` | No | | Override how an account is mapped to its institution group. Defaults to the account's `institution_name`, falling back to `metadata_` and then "Other accounts". Return `null` to use the fallback. |
| `source` | `"manual" \| "plaid" \| "statements" \| "gusto" \| "stripe"` | No | | Filter by account source — `manual`, `plaid`, `statements`, `gusto` or `stripe`. Passed straight to the API. |
| `type` | `"business" \| "personal"` | No | | Filter by account type — `business` or `personal`. Passed straight to the API. |
| `status` | `"connected" \| "disconnected" \| "untracked"` | No | | Filter by account status — `connected`, `disconnected` or `untracked`. Passed straight to the API. |
| `onReconnect` | `AccountsListOnPlaidUpdate` | No | | Invoked when an account's `` part is clicked, with the account, every account sharing its Plaid connection, and that connection. Wire it to Plaid's update mode: `PlaidLink`'s `connect(target.account, target)`. `AssetAccountsList` does this for you. |
| `onAddAccount` | `AccountsListOnPlaidUpdate` | No | | Invoked when a group's `` part is clicked, with a connected account of the group's bank and every account sharing that connection. Wire it like `onReconnect`: Plaid's update mode lets the user pick more accounts at the same bank. |
| `onChanged` | `AccountsOnChanged` | No | | Called after each accepted change the list makes: an account deleted (`deleted`), paused, resumed or switched type (`updated`), QuickBooks disconnected (`disconnected`). For a host that keeps account-derived data of its own to refresh. |
| `accounts` | `ExternalAccountPublic[]` | No | | Override fetched data — pass the API list as-is (skips the API fetch). |
| `quickbooksConnection` | `QuickBooksConnectionInfo \| null` | No | | Override the QuickBooks connection (skips that API call) — storybook/tests. `null` is "not connected". |
| `state` | `"loading" \| "error" \| "empty"` | No | | Force a specific state for testing/storybook. |
| `showCurrency` | `boolean` | No | | Force the ISO code beside each amount on or off, skipping the business fetch (storybook/tests). By default it shows only for a business that holds money in more than one currency. |
| `defaultScreen` | `"statements" \| "accounts" \| "review"` | No | `"accounts"` | Screen to open on: `accounts`, `statements` or `review`. Pass `defaultAccountId` alongside anything deeper than `accounts`. |
| `defaultAccountId` | `string` | No | | Account opened on mount — required when `defaultScreen` is past `accounts`. |
| `onScreenChange` | `(screen: ReconciliationScreen) => void` | No | | Notified on every screen change, so a host can mirror it in its own chrome (this is how the styled card hides Add Account inside the flow). |
| `onRequestedCountChange` | `(count: number \| null) => void` | No | | Notified when the number of statements outstanding across every account changes — null while the list loads, errors or is empty, when that number isn't known. The card header sits outside this Root, so it mirrors the count through here rather than reaching into the context. |
| `tasks` | `TaskRequestStatementPublic[]` | No | | Override the fetched statement requests (skips that API call) — storybook/tests. |
| `plaidConnections` | `PlaidConnectionPublic[]` | No | | Override the fetched Plaid connections (skips that API call) — storybook/tests. An `expired` one marks its accounts' bank as needing reconnecting. |
| `documents` | `DocumentPublic[]` | No | | Override the fetched statement documents (skips that API call) — storybook/tests. |
| `transactions` | `TransactionPublic[]` | No | | Override the review's fetched transactions (skips that API call) — storybook/tests. |
| `reviewState` | `"loading" \| "error" \| "empty"` | No | | Force the review's state for testing/storybook. Separate from `state`, which forces the accounts list's. |
| `maxFileSize` | `number` | No | `26214400` | Per-file size ceiling for statement uploads, in bytes (25 MB by default). |
| `onTransactionRemove` | `(id: string) => void` | No | | Called after a transaction is successfully deleted. |
| `reconciliationMethod` | `"auto" \| "statement_verified"` | No | | Force the business's reconciliation method, skipping the business fetch for it — storybook/tests. |
| `statementReconciliations` | `AccountReconciliation[]` | No | | Override the fetched statement-verified account states (skips that API call) — storybook/tests. |
| `statementPeriods` | `AccountPeriods[]` | No | | Override the months of the accounts opened under statement verification (skips that API call) — storybook/tests. |
### Parts [#parts]
#### Container [#container]
Always rendered. Fetches accounts and provides context.
| Part | Props | Description |
| :-- | :-- | :-- |
| `AccountsList.Root` | | Fetches external accounts, groups them by institution and provides context. |
#### Success [#success]
Renders when at least one account is available.
| Part | Props | Description |
| :-- | :-- | :-- |
| `AccountsList.Success` | | State wrapper. Compose the grouped table inside. |
| `AccountsList.Groups` | | Iterates each institution group, providing a group context and tracking per-group collapse state. |
| `AccountsList.GroupName` | `asChild?` | Renders the current group's institution name. |
| `AccountsList.GroupToggle` | `asChild?` | Button that collapses/expands the group. Sets aria-expanded and data-collapsed (for styling a chevron). While collapsed, `` renders nothing. |
| `AccountsList.GroupStatus` | `asChild?, format?` | Renders the group's rolled-up status (connected if any account is, else disconnected, else paused) and sets data-status. Connected groups show the most recent sync time. |
| `AccountsList.Accounts` | | Iterates the current group's accounts (nothing while collapsed). Must be used inside `` (throws otherwise). Provides an account context to each iteration. |
| `AccountsList.Account` | `asChild?` | Per-account row wrapper. Sets data-type, data-status and data-disconnected attributes from the account. |
| `AccountsList.AccountName` | `asChild?` | Renders the account name (falls back to "Unnamed account"). |
| `AccountsList.AccountMask` | `asChild?, format?` | Renders the account mask (e.g. last four digits). Pass format(mask) to decorate it; mask may be null. |
| `AccountsList.AccountStatus` | `asChild?, format?` | Renders the account's status and sets data-status. Connected accounts show a relative sync time ("2h ago"); others show "Disconnected"/"Paused". Pass format(status, lastSyncedAt) to override. |
| `AccountsList.AccountType` | `asChild?, format?` | Renders the account type. Defaults to "Business"/"Personal" and sets data-type on the element. |
| `AccountsList.LastSynced` | `asChild?, format?` | Renders the last-synced timestamp as an absolute date ("Mon DD, YYYY", or "Never synced"). Pass format(date \| null) to override. |
| `AccountsList.Balance` | `asChild?, format?` | Renders the account's external balance. format receives (amount, currency) — the account's own ISO 4217 code, or null — so it can print the symbol that goes with this account's money. Renders nothing when the balance is unknown (null). |
| `AccountsList.Currency` | `asChild?` | The ISO 4217 code the account's balance is denominated in — meant to sit beside Balance. Renders nothing when the account reports no currency, or no balance for it to label. Adds data-currency. Renders nothing at all unless the business holds money in more than one currency. |
| `AccountsList.Disconnected` | | Per-account state gate. Renders its children only when the account is disconnected. |
| `AccountsList.Connected` | | Inverse of Disconnected — renders only for connected accounts. |
| `AccountsList.Reconnect` | `asChild?` | Button that calls Root's onReconnect with the current account. Renders nothing unless the account is disconnected and came from Plaid — the only source with a link to repair (Plaid update mode). |
| `AccountsList.Business` | | Per-account gate. Renders only for business accounts. |
| `AccountsList.Personal` | | Per-account gate. Renders only for personal accounts. |
| `AccountsList.Paused` | | Per-account gate. Renders only for a paused synced account (status untracked). Never renders for manual accounts, which have nothing to sync. |
| `AccountsList.Syncing` | | Per-account gate. Renders only for an actively-syncing account. Like Paused, it is sync-specific and never renders for manual accounts. |
| `AccountsList.Editing` | `editor` | Per-account gate. Renders only while this account's inline editor of the given kind is open — editor="switch-personal" for the ledger editor, editor="delete" for the delete confirmation. Open via edit(account, editor); compose the editor UI and the actions (cancelEdit / switchToPersonal / deleteAccount) inside. |
| `AccountsList.Synced` | | Per-account source gate. Renders only for externally-synced accounts (anything but manual) — compose sync-specific UI here (last-synced time, pause/resume). For a specific source use Source instead. |
| `AccountsList.Source` | `value` | Per-account source gate — renders only when the account's source matches value. Pass a single source (value="plaid" / value="manual") or an array to match any of several (`value={["plaid", "gusto"]}`). This is the per-source gate; new sources need no new component. |
#### Loading [#loading]
Renders while the fetch is in flight.
| Part | Props | Description |
| :-- | :-- | :-- |
| `AccountsList.Loading` | | State wrapper. Render any skeleton or placeholder UI inside. |
#### Empty [#empty]
Renders when no accounts are connected.
| Part | Props | Description |
| :-- | :-- | :-- |
| `AccountsList.Empty` | | State wrapper. Render an empty-state message inside. |
#### Error [#error]
Renders on fetch error.
| Part | Props | Description |
| :-- | :-- | :-- |
| `AccountsList.Error` | | State wrapper. Compose the error UI inside. |
| `AccountsList.ErrorMessage` | `asChild?` | Renders the error message string. |
| `AccountsList.Retry` | `asChild?` | Button that re-runs the fetch. |
#### Reconciliation — screens [#reconciliation--screens]
Screen gates are mutually exclusive — exactly one is open at a time. Wrap the accounts table in AccountsScreen so it gives way to the drill-down.
| Part | Props | Description |
| :-- | :-- | :-- |
| `AccountsList.AccountsScreen` | | Renders children while the accounts table is showing (the root screen). |
| `AccountsList.StatementsScreen` | | Renders children while one account's statements are showing. |
| `AccountsList.ReviewScreen` | | Renders children while the account's transactions are being reviewed. Entering it is what triggers the transactions fetch. |
| `AccountsList.Statements` | `asChild?, format?` | The reconciliation state of the account row being rendered — the Statements column. Defaults to the derived label ("2 statements needed", "Up to date", "Not checked") and sets data-status to the matching value. Must be used inside ``. format receives the whole AccountReconciliation (`{ accountId, status, count, requestedAt, lastBalancedAt, label }`). |
| `AccountsList.OpenAccount` | `asChild?` | Opens the account row being rendered into its statements. Accounts that aren't tracked (disconnected or paused) are inert and carry data-disabled. Adds tabIndex and Enter/Space handling so the row answers to the keyboard; role is left to you, since inside a table the row is a row. Must be used inside ``. |
| `AccountsList.Back` | `asChild?` | The one back affordance — steps to the parent screen. Renders nothing on the accounts screen. |
| `AccountsList.GoTo` | `asChild?, screen` | Navigates straight to a screen — the "Accounts" crumb, typically. |
| `AccountsList.RequestedCount` | `asChild?, format?` | How many statements have been asked for across every account. |
| `AccountsList.OpenAccountName` | `asChild?, format?` | Names the account you're inside. Renders nothing until one is open. format receives the raw account. |
| `AccountsList.OpenCount` | `asChild?, format?` | How many statements are still being asked for on the open account. |
| `AccountsList.StatementRequested / NoStatementRequested` | | Gates on whether the open account still owes a statement. The styled layer uses these for the screen's banner: the months wanted inside the first, and when the account last balanced inside the second. Note that nothing outstanding is not the same as the books agreeing — the banner states the date and draws no conclusion from it. |
| `AccountsList.Requests` | | Iterates the open statement requests for the account, oldest month first, providing a request context to each. The API keeps a request open until its upload has been read, so a row stays put through uploading and processing and only clears once the statement has landed — at which point StatementList carries it. |
| `AccountsList.RequestMonth` | `asChild?, format?` | The month a statement has been asked for, as YYYY-MM (null when the task carries none). Must be used inside ``. |
| `AccountsList.RequestedAt` | `asChild?, format?` | When the statement was asked for — how long the row has been waiting. |
| `AccountsList.RequestStatus` | `asChild?, format?` | How far along the request is: needed, uploading, processing, ready or failed. Sets data-status, and defaults to a plain label ("Reading statement…"). format receives the whole StatementRequest. |
| `AccountsList.RequestIs` | `status` | Renders children only while the request is in the given state; pass an array to match several (`status={["needed", "failed"]}`). |
| `AccountsList.RequestFileName` | `asChild?` | The name of the statement uploaded against the request. Renders nothing until there is one. |
| `AccountsList.RequestError` | `asChild?` | Why the upload or processing failed, from the upload error or the document's status_reason. Renders nothing unless the request failed. |
| `AccountsList.StatementDropzone` | `asChild?` | Drag-and-drop surface for statements — wires the drag events and hands files to addStatements. Sets data-dragging while a file is over it. Pair with a file input for the click path, as the Documents dropzone does. |
| `AccountsList.UploadItems / UploadItem / UploadItemName / UploadItemMeta / UploadItemErrorMessage / UploadItemUploading / UploadItemSuccess / UploadItemError / UploadItemDismiss` | | The upload queue, part for part the same as Documents' own — one chip per file with its own status. Files over maxFileSize (25 MB by default) and names the account already holds are rejected before any request is made, with the same wording. A success clears its chip after a moment; an error stays until dismissed. |
| `AccountsList.StatementsProcessing / StatementsFailed / NoStatementsFailed` | | Gates on the state of the statements the account holds: one still being read, one that couldn't be read, and neither. The styled layer uses them to say why the review is inert and to keep the banner honest. |
| `AccountsList.StatementsUploading / UploadError` | | Gate for an upload in flight, and the last upload failure. Uploads tag task_id only when exactly one request is open. Note the create endpoint reports per-file outcomes in a 201 body, so a rejected file is read from `unsuccessful` rather than from the HTTP status. |
| `AccountsList.UploadStatement` | `input props` | Renders a real `` that uploads a statement against the request it sits in, tagged with task_id. Pair it with a `