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

# Accounts payable

> Triage vendor bills, flag exceptions and duplicates, and prep payment runs that land in Needs Review.

Put Erstan to work on the vendor side of your ledger. Ask it to surface the bills that matter, catch likely duplicates before they get paid twice, and assemble a payment-run shortlist that a human signs off on — all grounded in your own NetSuite data, with every write paused for approval.

Each recipe below works the same three ways: ask in [Chat](/chat/overview), run an [installed agent](/marketplace/add-agents) from the Marketplace, or build your own [agent](/agents/overview). Start in chat to explore, then move repeatable work onto an agent so it shows up as trackable [tasks](/tasks/overview).

<Info>
  These recipes assume your workspace has NetSuite connected and your NetSuite user authorized. Reads (finding and analyzing bills) run on demand; any write back to NetSuite pauses for your approval first.
</Info>

## Recipe: bills above a threshold

Find the vendor bills that need attention by amount, due date, or status, then review them inline.

<Steps>
  <Step title="Ask in chat">
    Open Chat and try a prompt like:

    > Show me open vendor bills over \$10,000, sorted by due date.

    Erstan runs a read-only query against NetSuite and streams back a table you can open in the [Canvas](/chat/canvas) panel.
  </Step>

  <Step title="Narrow it down">
    Follow up in the same thread to refine — no need to restate the whole question:

    > Just the ones due in the next 7 days, and group them by vendor.
  </Step>

  <Step title="Turn it into a document">
    Ask Erstan to save the result as a document or export it so you can share the shortlist with an approver. See [Reporting with SuiteQL](/playbooks/reporting-suiteql) for the read-only query path and export options.
  </Step>
</Steps>

<Tip>
  Be specific about the period and the threshold. "Over \$10,000, due before month-end" gives a tighter, more useful list than "big bills coming up."
</Tip>

## Recipe: possible duplicate detection

Duplicate vendor bills are an expensive, easy-to-miss error. Ask Erstan to scan for likely matches before a payment run goes out.

A good prompt names the signals that make a duplicate:

> Find vendor bills that look like possible duplicates — same vendor and amount, with the same or similar invoice number, within the last 90 days.

Erstan returns candidate pairs with the fields that matched so you can judge each one. Treat the output as a review queue, not a verdict — confirm against the source document before voiding or holding anything in NetSuite.

<Warning>
  Voiding, deleting, or putting a bill on hold are **writes** to NetSuite. Erstan will pause with an approval card showing the before/after change before any of these run. Review the action and the affected record, then choose **Run action** or **Don't run**. See [Approving and rejecting AI actions](/chat/approvals).
</Warning>

## Recipe: payment-run recommendations for review

Have Erstan assemble a proposed payment run — which bills to pay now, which to hold — and route the result into **Needs Review** so a person signs off before anything moves.

<Steps>
  <Step title="Describe the run">
    Ask for a recommendation with clear constraints:

    > Recommend a payment run for this Friday: open bills due within 14 days, prioritize early-payment discounts, and flag anything missing an approval in NetSuite. Don't pay anything yet.
  </Step>

  <Step title="Review the shortlist">
    Erstan produces a recommended list with reasons. Nothing is paid — this is a draft for a human to check.
  </Step>

  <Step title="Send it for sign-off">
    Run this as an [agent](/agents/run-and-tasks) rather than a one-off chat and the result becomes a task that moves **Queued → In Progress → Needs Review → Complete**. The reviewer checks it in [Reviewing and approving agent work](/tasks/review-approve) before any payment is recorded.
  </Step>
</Steps>

<Warning>
  Recording bill payments writes to NetSuite. Keep payment tools on **Require approval** so each payment pauses for a person — do not enable **Auto-approve writes** for payment runs. You control which NetSuite tools can write and which need approval on the connector's [Tools tab](/connectors/netsuite-manage).
</Warning>

## From chat to a repeatable agent

When a recipe earns its keep, stop retyping it. Install a ready-made AP agent or build your own so the work runs on a schedule and lands as tasks for your team.

<CardGroup cols={2}>
  <Card title="Install from the Marketplace" icon="store" href="/marketplace/add-agents">
    Add a ready-made agent from the **AP desk** and connect the services it needs with a guided setup.
  </Card>

  <Card title="Build your own" icon="wand-sparkles" href="/agents/create-first-agent">
    Start from an Assistant for chat-style AP triage, or an Automation that runs from a schedule.
  </Card>
</CardGroup>

Erstan ships with demo agents that illustrate the procurement and payables side of finance — for example a **Procurement** agent and a **Bad Debt Write-Off** agent. Use them to see how an AP agent is wired together, then adapt the pattern to your own vendors, thresholds, and approval rules rather than relying on their exact defaults.

<AccordionGroup>
  <Accordion title="Why does the agent pause instead of just paying the bills?">
    Writes to NetSuite are human-in-the-loop by default. The agent does the analysis and drafts the action, then waits for a person to approve. This keeps the agent acting with your NetSuite permissions while you stay in control of every change. Read more in [Security & write safety](/security/overview).
  </Accordion>

  <Accordion title="What if NetSuite is busy?">
    You may briefly see a "Queued — NetSuite" card. That is the busy queue holding work; it resumes automatically and is not an approval. Only an approval card with **Run action** / **Don't run** needs your decision.
  </Accordion>

  <Accordion title="Can I schedule the duplicate scan?">
    Yes. Build the scan as an agent and add a [schedule](/agents/schedules) — daily or weekly — so candidate duplicates show up in your review queue without anyone asking.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Approving AI actions" icon="circle-check" href="/chat/approvals">
    How write approvals work in chat and runs.
  </Card>

  <Card title="Reviewing agent work" icon="clipboard-check" href="/tasks/review-approve">
    Use Needs Review to sign off on what agents produce.
  </Card>

  <Card title="AR & collections" icon="hand-coins" href="/playbooks/ar-collections">
    The receivables companion to this playbook.
  </Card>

  <Card title="Manage NetSuite write policy" icon="shield-check" href="/connectors/netsuite-manage">
    Set which tools can write and which need approval.
  </Card>
</CardGroup>
