> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drpn.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Audits

> Write down what must be true about your orders, returns, and refunds, check it on a schedule, and keep every finding open until a check sees it fixed.

Month close rarely breaks in one big place. It breaks in many small ones: an order shipped but never invoiced, a return refunded in one system and not the other. An audit lets you write those expectations down once, in plain English, and checks them on a schedule. Each problem it finds stays open until a later check sees it fixed, so nothing drops off the list because someone forgot about it.

An audit is a run type. It holds statements, such as "every fulfilled order is invoiced in NetSuite", grouped into categories. Each statement is tested by one or more checks, and each check reads an existing Sync or one-system run. A record that breaks a statement becomes a finding. A finding is **Open** or **Fixed**, and it keeps when it was first found, when it was fixed, and its history. When the run's conclusions explain it, the finding names its cause, and the check's fix text says what to do.

## Before you start

Confirm:

* To create an audit or change its settings, you are a Tenant admin or Company editor in the active tenant. To run it, retry a check, resolve a finding, or re-check all findings, a Tenant user can too. Anyone with access to the tenant can read it, acknowledge a finding, and send Darpan feedback on one.
* The runs your checks will read exist, or the connections they need do. See [Set up a reconciliation run](https://docs.drpn.ai/guides/setup-reconciliation-run.md).

## Create an audit

**1. Start an audit**

On Home, choose **Create Run**, then answer **What kind of run?** with **Audit**.

**2. Name it**

Answer **What is the audit called?**. The name must be unique in the tenant.

**3. Pick the period**

Answer **What does one report cover?** with **A day**, **A month**, or **A quarter**, then choose **Create audit**. The audit's settings open, with the box for its first statement ready.

## Add statements

Under **Statements**, choose **New statement**. Under **What must be true?**, type the statement and pick:

| Field | Options |
| - | - |
| Category | **Orders**, **Refunds and credits**, **Returns**, or **Exchanges and warranty**. |
| Weight | **Firm** (the business stated it) or **Derived** (awaiting the business's confirmation). |

Choose **Save**, or press Enter. The statement is saved at once and gets the next code. It raises nothing until a check is added to it.

## Add a check

Open a statement and choose **Add check**:

| Field | Sets |
| - | - |
| **Run** | The run the check reads. **New run** and **New one-system run** open Create Run to build one. |
| **Name**, **Check ID** | The check's name. The ID follows the name until you edit it. |
| **Statements** | The statements this check tests and, for each, which of the run's rows break it: **Missing in** *system*, **Field mismatch**, **Finding**, or **Duplicate in** *system* (a one-system run offers **Finding** and **Duplicate in** only). With **Field mismatch**, you can narrow to the run's rules. **Add statement** links one more. |
| **Expected causes** | The run's causes that are expected. No statement counts a row with an expected cause. Shown when the run has conclusions. |
| *System* **record** | The kind of record on each side, filled from the run. |
| **Matched by** | How the run pairs records, filled from the run's keys. |
| **Fix owner**, **Fix where** | Who fixes a finding, and in which system. |
| **Money** | Optional. The **Currency**, and where the expected and actual amounts come from (**Expected from**, **Actual from**), so a finding shows the gap. |
| **Headline**, **Fix action**, **Passes when** | The words a finding reads with. `{name}` puts in the finding's field of that name; in **Fix action** and **Passes when**, a name the check does not supply is filled from the finding's own records, so `Re-route order {orderName}` names the order. A blank headline reads as the record and what is wrong; for a field mismatch, it names each system's value, such as `ACME-1120: Shipped in HotWax, Pending Billing in NetSuite`. When a check compares two systems, name both before any long value (`Shopify and NetSuite engravings differ: {file1Value} / {file2Value}`): the board shows two lines of a headline. A line that names a value a finding does not have is not used for that finding: its headline reads as the record and what is wrong, its fix gives way to the check's own **Fix action** and then to the standard instruction, and its **Passes when** line is left out. A finding never shows `{braces}`. |

Choose **Save check**. The check is saved on its own; the settings page's **Save** is not needed for it. A check moved to another statement takes its open findings with it, history kept.

What a check can find is set by its run. A NetSuite side can read a SuiteQL query you write and **Preview** for one day before saving it; see [Write a SuiteQL query](https://docs.drpn.ai/guides/connect-netsuite.md#write-a-suiteql-query). The causes a finding names come from the run's conclusions; see [Edit a run's conclusions](https://docs.drpn.ai/guides/review-results.md#edit-a-runs-conclusions). Open a statement and choose **Rules** beside a check to open its run's rules.

## Run it

Choose the play icon (**Run audit**) beside the audit's name, answer **Which days should this run look at?** with **Previous Day**, **Previous Week**, **Month to Date**, or **Custom Dates**, then choose **Run**. **Previous Week** reads the seven days ending yesterday. **Month to Date** reads from the 1st of the month through yesterday; on the 1st, the whole previous month. Days before the earliest day the audit can record, and days after today, are not offered.

Every check runs in the background. While they run, **Run health** shows **Running now**, each system's read with its record count against about how many it read last time, when it last moved and its rate per minute, and **Findings arrive as each check finishes.** During a peak period it also says how lightly each system is read.

## Audit settings

Choose the gear (**Audit settings**) beside the audit's name. The page shows the audit's name with a **Daily schedule** switch, and a strip of **Schedule**, **After each run**, **Posts to**, and **Statements**. Choose one to change it, then choose **Save** in its popup; each change is saved on its own.

| Group | Sets |
| - | - |
| **Name** | The audit's name, at the top of the page. |
| **Schedule** | **Daily schedule** on or off beside the name, and **Daily at** a time and **Timezone** in the **Schedule** popup. One schedule covers every check. |
| **After each run** | The update sent when a run ends, on or off. The line under the switch says how many people with access to the tenant get it. **Also send to** adds email addresses. |
| **Posts to** | The **Chat space** that gets a summary card, or **None**. |
| **Statements** | Each statement's wording, its priority (**P0 today** to **Known owned**; choose it to change how soon a broken statement must be fixed), and a switch that turns it off. Open a statement to change it or choose **Add check**; its causes are listed there, each with its own priority or **Same as** the statement. **New statement** is here too. |

A statement lists only the causes its checks can reach. A check that looks for missing records reaches the run's causes for missing records, and a check of field mismatches reaches its rule causes. So when several statements' checks share one run, each statement shows its own causes, and a priority set on a cause takes effect. Two checks of field mismatches on one run still list the same rule causes.

> [!NOTE]
>
> A new audit's schedule is off, set to 06:00 in the tenant's time zone. The audit does not run on its own until you turn **Daily schedule** on.

The audit owns its schedule. The automations behind its checks show **Set by audit** *name* under **Schedule**, linking back to these settings, and are not scheduled or paused on their own. When the checks' times differ, the page says **Checks run at different times; a change here sets them all.** Turning the **Daily schedule** off stops every check; their findings stay.

A statement turned off is left out of the next run, and its findings so far stay on record.

The update after each run is an email with a CSV per rule, plus a short message in the chosen chat space. It goes out once a morning, after every due check has run (a check that is due but has not started holds it up to 12 hours), not again as late checks finish, and its chat message never carries a warning. A check that a peak period's sync lag allowance holds past the day the run reads belongs to the next run and does not hold this one (3.6.2). Both say how many times the run read your systems and over how many connections, and how many of those reads could cost less. The Darpan team reviews those. In the email, findings no cause names yet are listed under **No cause named yet**, with **Know why? Explain them to the agent**: it opens the statement on the audit page with the **Agent** tab, for people who have the agent (see [The audit agent](#the-audit-agent)). When a check did not run, or ran only in part, the update's email names it and says Darpan has been alerted and is working on a fix; the chat message does not. Its links to the report name the tenant, so opening one switches the app into that tenant first. Only a Tenant Admin can change **After each run** and **Posts to**; for everyone else they read as plain text and do not open. For chat spaces, see [Run completion alerts](https://docs.drpn.ai/guides/run-completion-alerts.md).

When the chosen chat space can no longer take the message, the page says so under the audit's name:

* **This chat space no longer exists, so no card is sent.**
* **This chat space is turned off, so no card is sent.**
* **This chat space has no webhook or Slack channel, so no card is sent.**

Pick another space, or fix the space in **Tenant Settings** under **Notifications**. The email still goes out.

## Read the audit page

Home lists each audit under **Audit**, first. The page opens on the last morning that was due: yesterday's until the audit's scheduled time, then today's. A check that already ran today, or an audit with **Daily schedule** off, opens on today. Beside the audit's name, the circular-arrow icon (**Re-check all findings**) re-checks every open finding of the report's period now; see [Re-check all findings](#re-check-all-findings). Under the audit's name, one line gives the run type, the dates the report covers and read, and today's movement: new, fixed today, and the oldest open finding. On a monthly audit, a period picker beside the name offers the report's month and the two before it.

| Toolbar | Does |
| - | - |
| **open**, **acknowledged**, **all**, **not checked** | Counts that filter the board. **open** counts findings no one has acknowledged, **acknowledged** only those someone has, and **all** both; **not checked** counts statements no check has run for. |
| **Order or record id** | Searches findings. |
| **Any cause** | Keeps findings with one cause. |
| **Any age** | Keeps findings at least **1 day+**, **7 days+**, or **30 days+** old. |

Below the toolbar, the board drills down from left to right, with the path above it (audit › category › statement › finding). On a phone it shows one column at a time.

The first column's head switches the board between **Record type** and **Priority**. The app remembers your pick; a link that says which it shows opens that way without changing what you picked.

| Column | Shows |
| - | - |
| Categories | **Run health** first. By **Record type**, each category with its count and how many sit at its most urgent level (**2 at P1**). By **Priority**, the levels instead: **P0 today**, **P1 this week**, **P2 later**, **Known owned**, each with its open findings; choosing one lists only the statements and findings at that level. |
| **Statements** | Each statement in the category, with its count, whether or not its check ran today. |
| **Findings** | The statement's findings, each with its state and age, grouped under their cause. A cause's heading folds its group. An order sits under the cause holding it up, with its other causes named beneath it. An acknowledged finding reads **Acknowledged**, with who acknowledged it, when, and the first line of the note. |
| Detail | The open finding. With none open, the statement: each check's status (**Ran**, **Partial**, **Not run**), how many records each system read, **Matched by**, and **Read**, then its counts. |

**Run health** says how many checks ran, which statements are **Not covered** by any check, and what each system read. On today's report, a check that did not run offers **Retry from last read**: it runs again from what that morning already read, and no system is read again. **Retry** *N* **not run** retries them all.

An order with findings under several statements counts once, under its earliest statement. Its later findings are listed with it under **Also on this order**, each named by its item, and the statement's counts say how many sit **under an earlier step**.

A finding opens on its basics: the systems its check compares and nothing else, each with its status and its payment status beside it, such as Completed · Settled, then the amount and the day. A HotWax-to-NetSuite finding shows HotWax and NetSuite; a check about one system shows that one. A system that has no record of it reads **Missing**. HotWax's status shows even when it comes from another system's record, such as a NetSuite line that carries its HotWax item's status. The amount is the return's total, else the order's, else the line's (**Line total**). A payment status shows when that system's read gave one. Then it reads verdict first. Its state (**Open** or **Fixed**) and statement come first, then a line saying where its priority came from (**P0 from R11**, or **Known set on** a cause), then what is wrong, **Stuck on** (what holds it up), and **Do this** (the fix, with its owner). Under the owner, **Fixed when** gives the check's **Passes when** line, filled in for this finding, when the check has one. Under that, every finding of a kind lists the same rows: an order **Customer**, **Sales channel** and **Ship method**; a return **Customer**, **Sales channel** and **Channel**; an exchange **Customer**, **Sales channel** and **Warranty ID**, with a dash where that morning's reads gave none, then any deposits. An order lists its **Lines**. The order name and its HotWax order id name the order; a line is named by its SKU or its HotWax item. An order opens on the line that holds it up, or else on its first open line, so an order listed as **Open** opens as **Open** even when another of its lines was fixed that day. **Evidence** shows only when no conclusion explains the finding. **History** lists when it was found, still open, fixed, or reopened.

On an order finding whose check reads the order's lines, **Lines** under **Order** lists each line. A row shows the line's SKU, or its name when it has no SKU, then the word for it in each system the check compares, such as Shopify Unfulfilled · HotWax Completed, then its quantity, such as × 2. Shopify's word is Unfulfilled, Fulfilled, Removed, or how many are still unfulfilled, such as 1 of 3 unfulfilled. A Shopify line and the HotWax item made from it are one row. Two read options on the check's run turn lines on: **Order lines** on a Shopify **Orders** side and **Order items** on a HotWax orders side. Switch them on in **Read options** on the run's **Ruleset Manager**, under **Filters**, or tick them in the last card, **Which options should … use?**, when you create the run. Then **Sync** the check's automation so it reads them too. Both are off by default. A check whose run reads no lines shows none.

| Export | Where | Saves |
| - | - | - |
| **Export report** | Beside the audit's name | The morning's report, as JSON. |
| **Export findings** | Findings column | Every finding of the statement under the picked filter, each with its order. |
| **Export finding** | Open finding | The finding, as JSON. |
| **Export** *system* **extract** | A check, in the statement detail | What that system's read wrote that morning. Extracts are kept 7 days after the run. |

## Resolve a finding

You fixed the record and would rather not wait for the next run. **Resolve finding** re-checks one open finding's record now, read from each system by key. The finding then closes (**Resolved. The finding is closed.**) or stays open with today's cause (**Still open. The cause above is from this check.**). Resolve does not count as a check run, so **Run health** does not change.

If Darpan says the check has no automation yet, run the audit once first.

## Re-check all findings

A system caught up after the morning check, and many findings are fixed at once: a batch of store fulfillments reached NetSuite an hour late, say. Resolving them one by one would read your systems once per finding. **Re-check all findings** reads them all in one go instead.

Choose the circular-arrow icon (**Re-check all findings**):

* **Beside the audit's name**, it re-checks every open finding of the report's period.
* **At the head of the Findings column**, it re-checks the open findings of the statement you have open.

Darpan reads each check's open findings again by key, once per check, from each system. Every finding fixed since the morning check closes, and the rest stay open with today's cause. The page waits for the result, up to 5 minutes, then says what happened and reloads:

| Darpan says | Meaning |
| - | - |
| **Re-checked 26. 20 closed, 6 still open.** | Every finding was read again. 20 are fixed and closed; 6 still have a problem. |
| **Re-checked 26. All 26 closed.** | Every finding was fixed. |
| **Nothing open to re-check.** | The audit, or the statement, has no open finding in this period. |
| **Nothing to re-check until the audit has run once.** | The checks behind these findings have never run. Choose **Run audit** once, then try again. |
| ***N* closed so far. The rest are still being checked.** | The reads took longer than 5 minutes. The rest close on their own when their reads finish; reload the page later. |

Like **Resolve finding**, a re-check does not count as a check run: **Run health** does not change, and the next morning's check reads as it would have. Findings whose check has never run are skipped. One finding at a time stays available from the CLI as `darpan findings recheck`; re-checking all findings is in the app only.

## Acknowledge a finding

Some findings you handle outside Darpan: you called the store, you raised it with the warehouse, it is waiting on a refund that goes out Friday. Acknowledging the finding takes it off your **open** list, with a note that says why if you write one, so the next person does not chase it again. It does not close the finding. Only a check that sees the record fixed does that.

**1. Open the finding**

On the audit page, open a finding that is **Open**.

**2. Acknowledge it**

Choose the eye icon (**Acknowledge**) in the finding's head. Type why it is known if you like, up to 4,000 characters; a note is optional. **Remind me in 5 days if still open** is on by default; turn it off to keep the finding acknowledged until a check sees it fixed. Choose **Acknowledge**.

The finding now reads **Acknowledged** and moves from **open** to **acknowledged**. A card at the top of the finding shows who acknowledged it, when, and the note when there is one. **History** lists each acknowledgement, change and reopen.

One acknowledgement covers the whole row: every open line of the order under that statement, and the later-step findings listed with it under **Also on this order**. A line of the same order that breaks later brings the row back to **open**, because it is a new problem.

| To | Do this |
| - | - |
| Change the note or the reminder | Choose the pencil (**Edit acknowledgement**) on the card, change them, and choose **Save**. |
| Put the finding back on **open** | Choose **Reopen** on the card. |

When the reminder is on and the finding is still open after the reminder day, it is back under **open**, and the card says, for example, **Acknowledged 5 days ago by Sam R., still open**. Acknowledge it again to start a fresh reminder. When a check sees the finding fixed, it closes as any finding does, and the acknowledgement stays in **History**. A finding that is fixed and later found again is plainly open; the old acknowledgement does not carry over.

The update after each run and the digest count acknowledged findings on their own line, not as open. The split shows on the latest morning's report; an earlier morning's report shows its findings without it.

If Darpan refuses an acknowledgement, see [An acknowledgement is refused](https://docs.drpn.ai/troubleshooting/audits.md#an-acknowledgement-is-refused).

## Send Darpan feedback on a finding

A finding looks wrong, its cause does not fit, or you know why it happened and Darpan does not. Tell Darpan from the finding itself, so your words arrive with the record they are about.

Choose the speech-bubble icon (**Feedback**) in the finding's head. A small count on it says how many notes your team sent on the same statement and cause in the last 2 weeks. The popup lists them under **Previous notes**, newest first, each with who sent it, the record, and the day, so you can see whether someone already asked. Type your note in the box and choose **Send**.

Your note joins the list, and the Darpan team gets it with the finding attached. You get an email saying it arrived. A person at Darpan replies by email, as the line under the box says (**Darpan replies by email**); replies are never shown in the app. A finding no cause names yet groups its notes by statement alone.

## How findings close

A fix counts when a check sees it, not when someone says so. Each morning run re-checks open findings by key and reads the month so far, so a finding fixed in its own system closes on the next run. To close fixed findings before then, see [Re-check all findings](#re-check-all-findings). There is no control that marks a finding fixed by hand, and acknowledging one does not close it.

A check that reads HotWax orders by order date also reads, each morning, the orders whose items were approved, completed or cancelled since its last read, when they were placed in the period. So an order completed days after it was placed is seen completed, and its other systems are read for it by key. An order placed before the period stays out.

A daily NetSuite check that reads only NetSuite, and whose query Darpan can read by change, reads what could have moved since its last complete read instead of the month to date: the records changed or dated since then, plus its open findings by key (3.5.3). The checks of one morning that read the same thing share one read. A check whose query also asks HotWax stays on the whole month until it is set up for reading by change.

## Orders on their way to NetSuite

On a check that looks for HotWax orders missing from NetSuite, an order that was less than 24 hours old when read is named **On its way to NetSuite**. It is expected, so no statement counts it, and the next run looks at it again. HotWax sends most orders within hours and the rest in a daily catch-up.

The same day of grace covers a check that looks for Shopify orders missing from NetSuite. A Shopify order HotWax already holds, less than 24 hours old when read, is **On its way to NetSuite** too, not **Approved and paid, held in HotWax**.

Past that day, an exchange whose return already has its RMA and credit memo in NetSuite is named **Exchange not sent, return credited**. Nothing on the return holds the exchange back; it was never sent.

## A check on no statement

A check that tests no statement does not run. It reports nowhere, so running it would only read your systems for nothing. A check ends up like this when an import or a restored config version takes it off its last statement and leaves it on its automation. Its automation still runs any other check it carries. One with no check left runs as a plain run that reports to no audit.

The audit page lists checks under their statements, so a check on none is not shown there. To run it again, link it to a statement in a config import, or restore a config version from before it was taken off. See [Config history](https://docs.drpn.ai/guides/manage-tenant-settings.md#config-history).

## The audit agent

When the agent is on for your tenant, you are a Tenant admin or Company editor there, and a Darpan admin has given you AI access, the audit page's deepest column gets an **Agent** tab beside the detail. Type in **Ask the agent** to ask about the open finding, or to have it draft a change: a schedule, a new statement, a statement's wording, turning one on or off, or a new check. Describe several statements or checks in one message and it drafts each of them.

Each draft shows **Before the change** and **After the change**. Choose **Approve** or **Reject**, and **Revert** after a change is applied. Drafts waiting for approval are marked on the board, and the board reloads when a change is applied. New statements take their codes in the order you approve them. A check the agent adds gets a check ID no other audit uses, and its findings read like a configured check's: a field mismatch names each system's value, and its record cards are named by the side's key field, such as **Order name**. Without the agent on, the role, and AI access, the tab does not appear.

## Digests

Separate from the update after each run, an audit can send a daily or weekly digest to a chat space, by email, or both, at a set time in the tenant's time zone. A daily digest gives what is open, new today, and fixed today; a weekly digest compares where things stand with a week before. Acknowledged findings are counted on their own line; a weekly digest counts them with the open ones on both sides of its comparison, so a week of acknowledging does not read as fixing. When a check did not run, or ran only in part, the digest's email names its statement and says Darpan has been alerted and is working on a fix, as the update's email does; its chat message does not. It does not give the reason.

Digests are set up by a Darpan admin; there is no screen for them in the app.

## Read audits from code or the CLI

The `darpan` CLI shows an audit as fully as the audit page: its report, findings, progress, and settings. See [Set up the Darpan CLI](https://docs.drpn.ai/getting-started/set-up-darpan-cli.md).

The same report and findings are also available read-only over GraphQL:

* [GraphQL API overview](https://developers.drpn.ai/graphql/overview): endpoint, API keys, and what you can read.
* [`auditReport`](https://developers.drpn.ai/graphql/queries/audit-report): an audit's report for one morning.
* [`auditFinding`](https://developers.drpn.ai/graphql/queries/audit-finding): one finding with its records, evidence, fix, and history.
* [`findings`](https://developers.drpn.ai/graphql/queries/findings) and [Search syntax](https://developers.drpn.ai/graphql/search-syntax): every finding, filtered.

Each statement and finding there carries a priority (`P0`, `P1`, `P2` or `KNOWN`), and the report counts open findings at each level, as the board does by **Priority**.

## Next step

To build a run a check can read, see [Set up a reconciliation run](https://docs.drpn.ai/guides/setup-reconciliation-run.md). To follow NetSuite records through their stages instead, see [Lifecycle runs](https://docs.drpn.ai/guides/lifecycle-runs.md).

If a check did not run, a finding will not close, or the update did not arrive, see [Troubleshooting audits](https://docs.drpn.ai/troubleshooting/audits.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.