# Workflows

Source: https://docs.autessa.com/docs/tools/quickbooks/workflows

> QuickBooks composite workflow tool types.

# Workflows

Composite tool types that chain several QuickBooks operations behind one call: create-and-send, get-or-create, search helpers, payment-status checks, financial summaries, and PDF/attachment flows.

Every type on this page requires a [QuickBooks connector](/docs/guide/connectors.md); `connectorId` is the ID of that connector. Each composite exists so an agent doesn't have to plan a multi-step sequence itself — prefer these when one matches the task, and fall back to the granular types on the [Sales & AR](/docs/tools/quickbooks/sales-ar.md) and [Purchasing & AP](/docs/tools/quickbooks/purchasing-ap.md) pages when the agent needs control between steps.

## Create and send invoice **TOOL** `QUICKBOOKS_CREATE_AND_SEND_INVOICE`

Creates an invoice and emails it through QuickBooks in one call — the single most common billing flow. `lineItems` uses the same sales-line shape as `QUICKBOOKS_CREATE_INVOICE`, and `sendToEmail` overrides the recipient (the customer's email on file is used when omitted).

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_CREATE_AND_SEND_INVOICE",
  "connectorId": "V1StGXR8Z5",
  "customerId": "@@{customerId}",
  "lineItems": [
    {
      "DetailType": "SalesItemLineDetail",
      "Amount": 450.00,
      "Description": "@@{lineDescription}",
      "SalesItemLineDetail": {
        "ItemRef": { "value": "12" },
        "Qty": 3,
        "UnitPrice": 150.00
      }
    }
  ],
  "dueDate": "@@{dueDate}",
  "customerMemo": "Thank you for your business."
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `customerId` (string) — QuickBooks customer ID
- `lineItems` (array<object>) — Invoice line items
- `dueDate` (string) — Invoice due date (YYYY-MM-DD)
- `customerMemo` (string) — Memo visible to customer
- `privateNote` (string) — Internal note
- `sendToEmail` (string) — Email to send invoice to (uses customer email if not provided)

## Record payment for invoice **TOOL** `QUICKBOOKS_RECORD_PAYMENT_FOR_INVOICE`

Records a ledger payment against a specific invoice without the agent having to look up the customer or balance first — the tool fetches the invoice, resolves its customer, and defaults `amount` to the open balance when omitted. Moves no money; it's the composite version of `QUICKBOOKS_CREATE_PAYMENT`.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_RECORD_PAYMENT_FOR_INVOICE",
  "connectorId": "V1StGXR8Z5",
  "invoiceId": "@@{invoiceId}",
  "depositToAccountId": "35",
  "paymentRefNum": "@@{referenceNumber}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `invoiceId` (string) — Invoice to apply payment to
- `amount` (number · optional) — Payment amount (optional - uses invoice balance if not provided)
- `paymentMethodId` (string) — Payment method reference
- `depositToAccountId` (string) — Account to deposit to
- `paymentRefNum` (string) — Reference number
- `privateNote` (string) — Internal note

## Charge and record payment **TOOL** `QUICKBOOKS_CHARGE_AND_RECORD_PAYMENT`

Charges a card through the Payments API and books the matching payment record — optionally applied to an invoice via `invoiceId` — in one call. Pass either a one-time `cardToken` or a stored `cardId`; this is the bridge between the [Payments](/docs/tools/quickbooks/payments.md) family and the ledger.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_CHARGE_AND_RECORD_PAYMENT",
  "connectorId": "V1StGXR8Z5",
  "customerId": "@@{customerId}",
  "invoiceId": "@@{invoiceId}",
  "amount": 450.00,
  "cardId": "@@{cardId}",
  "depositToAccountId": "35",
  "description": "@@{paymentDescription}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `customerId` (string) — QuickBooks customer ID
- `invoiceId` (string · optional) — Invoice to apply payment to (optional)
- `amount` (number) — Charge amount
- `cardToken` (string) — Card token for one-time payment
- `cardId` (string) — Stored card ID (alternative to cardToken)
- `depositToAccountId` (string) — Account to deposit to
- `description` (string) — Payment description

## Process eCheck and record payment **TOOL** `QUICKBOOKS_PROCESS_ECHECK_AND_RECORD_PAYMENT`

The ACH counterpart of charge-and-record: initiates an eCheck debit (one-time `bankAccountToken` or stored `bankAccountId`) and books the payment record, optionally against an invoice. Remember ACH settles over days — the ledger entry is written when the debit is accepted, not when it clears.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_PROCESS_ECHECK_AND_RECORD_PAYMENT",
  "connectorId": "V1StGXR8Z5",
  "customerId": "@@{customerId}",
  "invoiceId": "@@{invoiceId}",
  "amount": 450.00,
  "bankAccountId": "@@{bankAccountId}",
  "depositToAccountId": "35",
  "description": "@@{paymentDescription}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `customerId` (string) — QuickBooks customer ID
- `invoiceId` (string · optional) — Invoice to apply payment to (optional)
- `amount` (number) — Payment amount
- `bankAccountToken` (string) — Bank account token for one-time payment
- `bankAccountId` (string) — Stored bank account ID (alternative to token)
- `depositToAccountId` (string) — Account to deposit to
- `description` (string) — Payment description

## Check invoice payment status **TOOL** `QUICKBOOKS_CHECK_INVOICE_PAYMENT_STATUS`

Answers "has this invoice been paid?" in one call: returns a `status` of `PAID`, `PARTIALLY_PAID`, or `UNPAID`, plus the open balance and the linked payment transactions. The natural polling tool for collections and follow-up agents.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_CHECK_INVOICE_PAYMENT_STATUS",
  "connectorId": "V1StGXR8Z5",
  "invoiceId": "@@{invoiceId}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `invoiceId` (string) — Required string value.

## Convert estimate to invoice **TOOL** `QUICKBOOKS_CONVERT_ESTIMATE_TO_INVOICE`

Fetches an accepted estimate, creates an invoice from its customer and line items, and — when `sendToCustomer` is true — emails it, all in one call. `sendToEmail` overrides the recipient; the original estimate is left in place.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_CONVERT_ESTIMATE_TO_INVOICE",
  "connectorId": "V1StGXR8Z5",
  "estimateId": "@@{estimateId}",
  "dueDate": "@@{dueDate}",
  "sendToCustomer": true
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `estimateId` (string) — Estimate ID to convert
- `dueDate` (string) — Invoice due date (YYYY-MM-DD)
- `sendToCustomer` (boolean) — Whether to email the invoice
- `sendToEmail` (string) — Email to send to (uses customer email if not provided)

## Get invoice with customer **TOOL** `QUICKBOOKS_GET_INVOICE_WITH_CUSTOMER`

Fetches an invoice and its customer's full record in one call — the join an agent otherwise needs two lookups for. Useful when drafting a payment reminder that needs both the balance and the contact details.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_INVOICE_WITH_CUSTOMER",
  "connectorId": "V1StGXR8Z5",
  "invoiceId": "@@{invoiceId}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `invoiceId` (string) — QuickBooks invoice ID

## Get or create customer **TOOL** `QUICKBOOKS_GET_OR_CREATE_CUSTOMER`

Idempotent customer resolution: searches by exact `email` first, falls back to exact `displayName`, and only creates a new customer on a miss (`displayName` is required for the create). The response's `wasCreated` flag says which path ran — this is the safe default for agents ingesting orders or signups.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_OR_CREATE_CUSTOMER",
  "connectorId": "V1StGXR8Z5",
  "email": "@@{customerEmail}",
  "displayName": "@@{customerName}",
  "phone": "@@{customerPhone}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `email` (string) — Primary search key - customer email
- `displayName` (string) — Display name (required for create, used as fallback search)
- `givenName` (string) — First name
- `familyName` (string) — Last name
- `companyName` (string) — Company name
- `phone` (string) — Phone number
- `addressLine1` (string) — Billing address line 1
- `addressCity` (string) — Billing address city
- `addressState` (string) — Billing address state
- `addressPostalCode` (string) — Billing address postal code
- `addressCountry` (string) — Billing address country

## Search customer by email **TOOL** `QUICKBOOKS_SEARCH_CUSTOMER_BY_EMAIL`

Looks up customers by exact primary email address — the most reliable way to resolve an inbound email sender to a `customerId` without paging through `QUICKBOOKS_GET_CUSTOMERS`.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_SEARCH_CUSTOMER_BY_EMAIL",
  "connectorId": "V1StGXR8Z5",
  "email": "@@{customerEmail}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `email` (string) — Email address to search for

## Search customer by name **TOOL** `QUICKBOOKS_SEARCH_CUSTOMER_BY_NAME`

Searches customers by display name with partial (contains) matching, returning up to 25 candidates. Use it when the agent only has a rough name; expect multiple hits and disambiguate before writing transactions.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_SEARCH_CUSTOMER_BY_NAME",
  "connectorId": "V1StGXR8Z5",
  "displayName": "@@{customerName}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `displayName` (string) — Display name to search for (supports partial match)

## Get or create vendor **TOOL** `QUICKBOOKS_GET_OR_CREATE_VENDOR`

Idempotent vendor resolution keyed on `displayName`: finds an existing vendor by name or creates one with the supplied contact and address details. The go-to for AP agents ingesting bills from vendors that may or may not be on file yet.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_OR_CREATE_VENDOR",
  "connectorId": "V1StGXR8Z5",
  "displayName": "@@{vendorName}",
  "email": "@@{vendorEmail}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `displayName` (string) — Primary search key - vendor display name (required)
- `email` (string) — Vendor email
- `companyName` (string) — Company name
- `phone` (string) — Phone number
- `addressLine1` (string) — Billing address line 1
- `addressCity` (string) — Billing address city
- `addressState` (string) — Billing address state
- `addressPostalCode` (string) — Billing address postal code
- `addressCountry` (string) — Billing address country

## Search vendor by name **TOOL** `QUICKBOOKS_SEARCH_VENDOR_BY_NAME`

Searches vendors by display name with partial (contains) matching, returning up to 25 candidates. The vendor mirror of the customer name search — use it to resolve a bill's sender to a `vendorId`.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_SEARCH_VENDOR_BY_NAME",
  "connectorId": "V1StGXR8Z5",
  "displayName": "@@{vendorName}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `displayName` (string) — Display name to search for (supports partial match)

## Create and pay bill **TOOL** `QUICKBOOKS_CREATE_AND_PAY_BILL`

Enters a bill and immediately records its payment in one call — `lineItems` uses the bill expense-line shape, `paymentType` is `Check` or `CreditCard`, and the payment is linked back to the created bill automatically. Both steps are ledger records; no funds move.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_CREATE_AND_PAY_BILL",
  "connectorId": "V1StGXR8Z5",
  "vendorId": "@@{vendorId}",
  "lineItems": [
    {
      "DetailType": "AccountBasedExpenseLineDetail",
      "Amount": 1200.00,
      "Description": "@@{expenseDescription}",
      "AccountBasedExpenseLineDetail": {
        "AccountRef": { "value": "7" }
      }
    }
  ],
  "paymentType": "Check",
  "bankAccountId": "35"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `vendorId` (string) — QuickBooks vendor ID
- `lineItems` (array<object>) — Bill line items
- `dueDate` (string) — Bill due date (YYYY-MM-DD)
- `paymentType` (string) — Check or CreditCard
- `bankAccountId` (string) — Bank account for payment
- `checkNumber` (string) — Check number (if paying by check)
- `privateNote` (string) — Internal note

## Schedule bill payment **TOOL** `QUICKBOOKS_SCHEDULE_BILL_PAYMENT`

Creates a bill payment dated in the future — `txnDate` must be a future date or the call is rejected. The payment record is written into QuickBooks immediately with the future transaction date; it is not held back and released later, so treat it as pre-booking a planned payment run.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_SCHEDULE_BILL_PAYMENT",
  "connectorId": "V1StGXR8Z5",
  "vendorId": "@@{vendorId}",
  "totalAmt": 1200.00,
  "payType": "Check",
  "bankAccountId": "35",
  "txnDate": "@@{scheduledDate}",
  "linkedBills": [
    { "TxnId": "@@{billId}", "Amount": 1200.00 }
  ]
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `vendorId` (string) — Required - VendorRef
- `totalAmt` (number) — Required - Total amount
- `payType` (string) — Required - "Check" or "CreditCard"
- `bankAccountId` (string) — Required for Check payments
- `checkNum` (string · optional) — Check number (optional)
- `creditCardAccountId` (string) — Required for CreditCard payments
- `txnDate` (string) — Required - Future date for scheduling (YYYY-MM-DD)
- `privateNote` (string) — Internal memo
- `linkedBills` (array<object>) — Bills to pay with amounts

## Check bill payment status **TOOL** `QUICKBOOKS_CHECK_BILL_PAYMENT_STATUS`

The AP mirror of the invoice status check: returns whether a bill is `PAID`, `PARTIALLY_PAID`, or `UNPAID`, plus its open balance and linked payment transactions.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_CHECK_BILL_PAYMENT_STATUS",
  "connectorId": "V1StGXR8Z5",
  "billId": "@@{billId}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `billId` (string) — Required string value.

## Get bill with vendor **TOOL** `QUICKBOOKS_GET_BILL_WITH_VENDOR`

Fetches a bill and its vendor's full record in one call, saving the second lookup when an agent needs both the amount owed and the vendor's contact details.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_BILL_WITH_VENDOR",
  "connectorId": "V1StGXR8Z5",
  "billId": "@@{billId}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `billId` (string) — QuickBooks bill ID

## Get items for invoice **TOOL** `QUICKBOOKS_GET_ITEMS_FOR_INVOICE`

Searches active items by partial name match and returns them pre-formatted for building invoice lines (ID, name, price), alongside the raw records. Give it to invoicing agents so "add a line for consulting" resolves to the right `ItemRef` without a full catalog dump.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_ITEMS_FOR_INVOICE",
  "connectorId": "V1StGXR8Z5",
  "searchTerm": "@@{itemSearch}",
  "maxResults": 25
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `searchTerm` (string) — Search term for item name
- `itemType` (string) — Filter by item type (Service, Inventory, NonInventory)
- `maxResults` (integer) — Maximum results (default 50)

## Get accounts for expense **TOOL** `QUICKBOOKS_GET_ACCOUNTS_FOR_EXPENSE`

Searches expense accounts by partial name match, returning candidates formatted for building bill lines. The account-side companion to the item search — use it to resolve "book this under advertising" to the right `AccountRef`.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_ACCOUNTS_FOR_EXPENSE",
  "connectorId": "V1StGXR8Z5",
  "searchTerm": "@@{accountSearch}",
  "maxResults": 25
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `searchTerm` (string) — Search term for account name
- `maxResults` (integer) — Maximum results (default 50)

## Get AR summary **TOOL** `QUICKBOOKS_GET_AR_SUMMARY`

Runs the aged-receivables and customer-balance reports together and returns both as one accounts-receivable summary as of `reportDate` (defaults to today). One call for "what are we owed and how overdue is it?"

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_AR_SUMMARY",
  "connectorId": "V1StGXR8Z5",
  "reportDate": "@@{asOfDate}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `reportDate` (string) — As of date (YYYY-MM-DD), defaults to today

## Get AP summary **TOOL** `QUICKBOOKS_GET_AP_SUMMARY`

The payables mirror: runs aged payables and vendor balances together for one accounts-payable summary as of `reportDate`. The starting point for a payment-run planning agent.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_AP_SUMMARY",
  "connectorId": "V1StGXR8Z5",
  "reportDate": "@@{asOfDate}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `reportDate` (string) — As of date (YYYY-MM-DD), defaults to today

## Get account balance overview **TOOL** `QUICKBOOKS_GET_ACCOUNT_BALANCE_OVERVIEW`

A cash-position snapshot in one call: active bank accounts with balances, open invoices (largest first) as accounts receivable, and open bills as accounts payable. Ideal for a daily "how are we doing?" briefing without running formal reports.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_ACCOUNT_BALANCE_OVERVIEW",
  "connectorId": "V1StGXR8Z5"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `reportDate` (string · optional) — Optional, defaults to today (YYYY-MM-DD)

## Get financial snapshot **TOOL** `QUICKBOOKS_GET_FINANCIAL_SNAPSHOT`

Runs the three core statements — profit and loss over the date range, balance sheet as of `endDate`, and cash flow — and returns them together. The one-call input for an agent writing a monthly financial summary.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_FINANCIAL_SNAPSHOT",
  "connectorId": "V1StGXR8Z5",
  "startDate": "@@{startDate}",
  "endDate": "@@{endDate}",
  "accountingMethod": "Accrual"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `startDate` (string) — Start date for P&L (YYYY-MM-DD)
- `endDate` (string) — End date for reports (YYYY-MM-DD)
- `accountingMethod` (string) — Cash or Accrual

## Get recent activity **TOOL** `QUICKBOOKS_GET_RECENT_ACTIVITY`

Returns all transactions from the last `days` days (default 7) via the transaction-list report, optionally limited to comma-separated `transactionTypes`. The easy feed for "what happened in the books this week?" digests.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_RECENT_ACTIVITY",
  "connectorId": "V1StGXR8Z5",
  "days": 7,
  "transactionTypes": "Invoice,Payment,Bill"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `days` (integer) — Number of days to look back (default 7)
- `transactionTypes` (string) — Comma-separated transaction types to include

## Query multiple entities **TOOL** `QUICKBOOKS_QUERY_MULTIPLE_ENTITIES`

Runs the same SQL-like `whereClause` across several entity types (e.g. `Customer,Invoice,Payment`) in one call, returning results grouped per type with `maxResultsPerEntity` each. A power tool for cross-entity questions like "everything touching this date range" — each type must actually support the fields in the clause.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_QUERY_MULTIPLE_ENTITIES",
  "connectorId": "V1StGXR8Z5",
  "entityTypes": "Invoice,Payment",
  "whereClause": "TxnDate >= '@@{startDate}'",
  "maxResultsPerEntity": 100
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `entityTypes` (string) — Comma-separated entity types (Customer,Invoice,Payment)
- `whereClause` (string) — Common where clause to apply
- `maxResultsPerEntity` (integer) — Max results per entity type (default 100)

## Get entity PDF **TOOL** `QUICKBOOKS_GET_ENTITY_PDF`

Downloads QuickBooks' rendered PDF for an entity (`Invoice`, `Estimate`, and other printable types), stores it, and returns a short-lived download URL — valid for about 10 minutes, so pass it along promptly. This is how an agent gets a customer-ready document out of QuickBooks.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_ENTITY_PDF",
  "connectorId": "V1StGXR8Z5",
  "entityType": "Invoice",
  "entityId": "@@{invoiceId}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `entityType` (string) — "Invoice", "Bill", "PurchaseOrder", "Estimate", etc.
- `entityId` (string) — Required string value.

## Upload attachment **TOOL** `QUICKBOOKS_UPLOAD_ATTACHMENT`

Downloads a file from `fileUrl` (a public or presigned URL) and attaches it to a QuickBooks entity — receipts on bills, signed POs on invoices, and so on. `contentType` must match the file, e.g. `application/pdf`.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_UPLOAD_ATTACHMENT",
  "connectorId": "V1StGXR8Z5",
  "entityType": "Bill",
  "entityId": "@@{billId}",
  "fileUrl": "@@{receiptUrl}",
  "fileName": "receipt.pdf",
  "contentType": "application/pdf"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `entityType` (string) — "Invoice", "Bill", "PurchaseOrder", etc.
- `entityId` (string) — Required string value.
- `fileUrl` (string) — URL to download the file from (S3 presigned, public URL, etc.)
- `fileName` (string) — e.g., "purchase-order-123.pdf"
- `contentType` (string) — e.g., "application/pdf"

## Create invoice and attach PDF **TOOL** `QUICKBOOKS_CREATE_INVOICE_AND_ATTACH_PDF`

Creates an invoice (same fields as `QUICKBOOKS_CREATE_INVOICE`) and attaches a PDF fetched from `pdfUrl` — for example the purchase order that triggered the invoice. If the PDF download fails, the invoice is still created and the response says the attachment step failed.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_CREATE_INVOICE_AND_ATTACH_PDF",
  "connectorId": "V1StGXR8Z5",
  "customerId": "@@{customerId}",
  "lines": [
    {
      "DetailType": "SalesItemLineDetail",
      "Amount": 450.00,
      "SalesItemLineDetail": {
        "ItemRef": { "value": "12" }
      }
    }
  ],
  "pdfUrl": "@@{sourcePdfUrl}",
  "pdfFileName": "PO-1234.pdf"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `customerId` (string) — Required - Customer reference
- `lines` (array<object>) — Required - Line items array
- `txnDate` (string) — Transaction date (YYYY-MM-DD)
- `dueDate` (string) — Due date (YYYY-MM-DD)
- `docNumber` (string) — Invoice number
- `customerMemo` (string) — Memo visible to customer
- `privateNote` (string) — Internal note
- `billingEmail` (string) — Email for billing
- `billingAddress` (object) — Required object value.
- `shippingAddress` (object) — Required object value.
- `applyTaxAfterDiscount` (boolean) — Required boolean value.
- `salesTermId` (string) — Payment terms reference
- `pdfUrl` (string) — Required - URL of the PDF to attach (e.g., PO PDF URL)
- `pdfFileName` (string) — Required - Filename for the attachment (e.g., "PO-1234.pdf")

## Create bill and get PDF **TOOL** `QUICKBOOKS_CREATE_BILL_AND_GET_PDF`

Creates a bill (same fields as `QUICKBOOKS_CREATE_BILL`) and immediately returns a short-lived download URL for its rendered PDF. Useful when the entered bill needs to go straight into an approval email or archive.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_CREATE_BILL_AND_GET_PDF",
  "connectorId": "V1StGXR8Z5",
  "vendorId": "@@{vendorId}",
  "lines": [
    {
      "DetailType": "AccountBasedExpenseLineDetail",
      "Amount": 1200.00,
      "AccountBasedExpenseLineDetail": {
        "AccountRef": { "value": "7" }
      }
    }
  ],
  "dueDate": "@@{dueDate}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `vendorId` (string) — Required - VendorRef
- `lines` (array<object>) — Required - Line items
- `txnDate` (string) — Transaction date
- `dueDate` (string) — Due date
- `docNumber` (string) — Bill number/reference
- `privateNote` (string) — Internal memo
- `apAccountId` (string) — Accounts Payable account

## Create purchase order and get PDF **TOOL** `QUICKBOOKS_CREATE_PURCHASE_ORDER_AND_GET_PDF`

Creates a purchase order (same fields as `QUICKBOOKS_CREATE_PURCHASE_ORDER`) and returns a short-lived download URL for its PDF — ready to email to the vendor in the next tool call.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_CREATE_PURCHASE_ORDER_AND_GET_PDF",
  "connectorId": "V1StGXR8Z5",
  "vendorId": "@@{vendorId}",
  "lines": [
    {
      "DetailType": "ItemBasedExpenseLineDetail",
      "Amount": 500.00,
      "ItemBasedExpenseLineDetail": {
        "ItemRef": { "value": "19" },
        "Qty": 10,
        "UnitPrice": 50.00
      }
    }
  ],
  "expectedDate": "@@{expectedDate}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `vendorId` (string) — Required - VendorRef
- `lines` (array<object>) — Required - Line items
- `txnDate` (string) — Transaction date
- `expectedDate` (string) — Expected delivery date
- `docNumber` (string) — PO number
- `vendorMemo` (string) — Memo for vendor
- `privateNote` (string) — Internal memo
- `shipAddr` (object) — Ship to address
- `apAccountId` (string) — Accounts Payable account

## Related

- [Tools overview](/docs/tools.md)
- [QuickBooks overview](/docs/tools/quickbooks.md)
- [Sales & AR](/docs/tools/quickbooks/sales-ar.md)
- [Purchasing & AP](/docs/tools/quickbooks/purchasing-ap.md)
- [Items, Accounts & Company](/docs/tools/quickbooks/items-accounts-company.md)
- [Reports](/docs/tools/quickbooks/reports.md)
- [Payments](/docs/tools/quickbooks/payments.md)
- [Connectors](/docs/guide/connectors.md)
- [Autessa Payments](/docs/tools/autessa-payments.md)

