# Sales & AR

Source: https://docs.autessa.com/docs/tools/quickbooks/sales-ar

> QuickBooks tool types for customers, invoices, payments, and estimates.

# Sales & AR

Tool types for the accounts-receivable side of QuickBooks: creating and managing customers, invoices, accounting-side payment records, and estimates.

Every type on this page requires a [QuickBooks connector](/docs/guide/connectors.md); `connectorId` is the ID of that connector. Note that `QUICKBOOKS_CREATE_PAYMENT` records money movement in the ledger without processing anything — to actually charge a card or bank account, see the [Payments](/docs/tools/quickbooks/payments.md) family. See the [QuickBooks overview](/docs/tools/quickbooks.md) for connector setup and sandbox behavior.

## Create customer **TOOL** `QUICKBOOKS_CREATE_CUSTOMER`

Creates a customer record. Only `displayName` is required — it must be unique across customers, vendors, and employees in the QuickBooks company, so creation fails on a duplicate name. If the customer may already exist, prefer `QUICKBOOKS_GET_OR_CREATE_CUSTOMER` on the [Workflows](/docs/tools/quickbooks/workflows.md) page.

### Example

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

> 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) — Required - Display name
- `givenName` (string) — First name
- `familyName` (string) — Last name
- `companyName` (string) — Company name
- `email` (string) — Primary email
- `phone` (string) — Primary phone
- `mobile` (string) — Mobile phone
- `billingAddress` (object) — Billing address
- `shippingAddress` (object) — Shipping address
- `notes` (string) — Customer notes
- `taxable` (boolean) — Is customer taxable
- `balance` (number) — Opening balance

## Update customer **TOOL** `QUICKBOOKS_UPDATE_CUSTOMER`

Updates an existing customer identified by `customerId`. Set `sparseUpdate` to true so only the fields you supply change — without it, QuickBooks treats the update as a full replacement and clears omitted fields. Setting `active` to false soft-deletes the customer.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_UPDATE_CUSTOMER",
  "connectorId": "V1StGXR8Z5",
  "customerId": "@@{customerId}",
  "email": "@@{newEmail}",
  "sparseUpdate": 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.
- `customerId` (string) — Required - QuickBooks customer ID
- `displayName` (string) — Required string value.
- `givenName` (string) — Required string value.
- `familyName` (string) — Required string value.
- `companyName` (string) — Required string value.
- `email` (string) — Required string value.
- `phone` (string) — Required string value.
- `mobile` (string) — Required string value.
- `billingAddress` (object) — Billing address
- `shippingAddress` (object) — Shipping address
- `notes` (string) — Required string value.
- `active` (boolean) — Required boolean value.
- `sparseUpdate` (boolean) — If true, only update provided fields

## Get customers **TOOL** `QUICKBOOKS_GET_CUSTOMERS`

Lists customers with pagination (`maxResults`, `startPosition`) and an optional SQL-like `whereClause` filter such as `Balance > '0'`. This is how an agent discovers the `customerId` the other Sales & AR tools need; for targeted lookups, the name and email search composites on the [Workflows](/docs/tools/quickbooks/workflows.md) page are simpler.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_CUSTOMERS",
  "connectorId": "V1StGXR8Z5",
  "maxResults": 50,
  "startPosition": 1,
  "activeOnly": 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.
- `maxResults` (integer) — Required integer value.
- `startPosition` (integer) — Required integer value.
- `whereClause` (string · optional) — Optional SQL-like where clause
- `orderBy` (string · optional) — Optional order by clause
- `activeOnly` (boolean) — Filter to only active customers

## Get customer by ID **TOOL** `QUICKBOOKS_GET_CUSTOMER_BY_ID`

Fetches a single customer's full record — contact details, addresses, balance, and the `SyncToken` that update and delete operations require. Use it to confirm details before writing invoices against the customer.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_CUSTOMER_BY_ID",
  "connectorId": "V1StGXR8Z5",
  "customerId": "@@{customerId}"
}
```

> 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

## Create invoice **TOOL** `QUICKBOOKS_CREATE_INVOICE`

Creates an invoice for a customer. `lines` is an array of QuickBooks sales lines — each needs a `DetailType` of `SalesItemLineDetail`, an `Amount`, and a `SalesItemLineDetail` object referencing an item by ID. Creating an invoice does not email it; pair with `QUICKBOOKS_SEND_INVOICE`, or use `QUICKBOOKS_CREATE_AND_SEND_INVOICE` to do both in one call.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_CREATE_INVOICE",
  "connectorId": "V1StGXR8Z5",
  "customerId": "@@{customerId}",
  "lines": [
    {
      "DetailType": "SalesItemLineDetail",
      "Amount": 450.00,
      "Description": "Consulting services",
      "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) — 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

## Update invoice **TOOL** `QUICKBOOKS_UPDATE_INVOICE`

Updates an existing invoice — due date, memo, line items, or customer reference. As with customers, pass `sparseUpdate: true` to change only the supplied fields; supplying `lines` replaces the entire line array, not individual lines.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_UPDATE_INVOICE",
  "connectorId": "V1StGXR8Z5",
  "invoiceId": "@@{invoiceId}",
  "dueDate": "@@{newDueDate}",
  "sparseUpdate": 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.
- `invoiceId` (string) — Required
- `customerId` (string) — Required string value.
- `lines` (array<object>) — Required array<object> value.
- `txnDate` (string) — Required string value.
- `dueDate` (string) — Required string value.
- `docNumber` (string) — Required string value.
- `customerMemo` (string) — Required string value.
- `privateNote` (string) — Required string value.
- `billingEmail` (string) — Required string value.
- `sparseUpdate` (boolean) — Required boolean value.

## Send invoice **TOOL** `QUICKBOOKS_SEND_INVOICE`

Emails an existing invoice through QuickBooks' own delivery system, using the QuickBooks company's branding and payment links. `emailTo` overrides the recipient; when omitted, the invoice goes to the customer's billing email on file.

### Example

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

> 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
- `emailTo` (string · optional) — Email address to send to (optional, uses customer email if not provided)

## Get invoices **TOOL** `QUICKBOOKS_GET_INVOICES`

Lists invoices with pagination and filters by customer, transaction-date range, or a raw `whereClause` (e.g. `Balance > '0'` for open invoices). Combine with an `orderBy` such as `TxnDate DESC` to surface the most recent activity first.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_INVOICES",
  "connectorId": "V1StGXR8Z5",
  "maxResults": 50,
  "startPosition": 1,
  "customerId": "@@{customerId}",
  "whereClause": "Balance > '0'"
}
```

> 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.
- `maxResults` (integer) — Required integer value.
- `startPosition` (integer) — Required integer value.
- `whereClause` (string) — Required string value.
- `orderBy` (string) — Required string value.
- `customerId` (string) — Filter by customer ID
- `startDate` (string) — Filter by transaction date (YYYY-MM-DD)
- `endDate` (string) — Filter by transaction date (YYYY-MM-DD)

## Get invoice by ID **TOOL** `QUICKBOOKS_GET_INVOICE_BY_ID`

Fetches one invoice in full: line items, balance, linked payments, and the `SyncToken` needed for void and delete. For the invoice plus its customer's contact details in one call, use `QUICKBOOKS_GET_INVOICE_WITH_CUSTOMER` on the [Workflows](/docs/tools/quickbooks/workflows.md) page.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_INVOICE_BY_ID",
  "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.

## Void invoice **TOOL** `QUICKBOOKS_VOID_INVOICE`

Voids an invoice — it stays visible in QuickBooks with a zeroed amount and a Voided status, preserving the audit trail. Requires the invoice's current `syncToken` (fetch it with a get-by-ID call first); a stale token is rejected by QuickBooks' optimistic locking.

### Example

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

> 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
- `syncToken` (string) — Required for optimistic locking

## Delete invoice **TOOL** `QUICKBOOKS_DELETE_INVOICE`

Permanently deletes an invoice from the QuickBooks company. Like void, it requires the current `syncToken`, but unlike void the record is removed entirely — prefer voiding when the paper trail matters.

### Example

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

> 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
- `syncToken` (string) — Required for optimistic locking

## Create payment **TOOL** `QUICKBOOKS_CREATE_PAYMENT`

Records a customer payment in the ledger — it reduces invoice balances and books the deposit but moves no money. `invoiceLines` links the payment to specific invoices via `LinkedTxn` entries. To actually charge a card and record the payment together, use `QUICKBOOKS_CHARGE_AND_RECORD_PAYMENT` on the [Workflows](/docs/tools/quickbooks/workflows.md) page.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_CREATE_PAYMENT",
  "connectorId": "V1StGXR8Z5",
  "customerId": "@@{customerId}",
  "totalAmount": 450.00,
  "depositToAccountId": "35",
  "invoiceLines": [
    {
      "Amount": 450.00,
      "LinkedTxn": [{ "TxnId": "@@{invoiceId}", "TxnType": "Invoice" }]
    }
  ],
  "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.
- `customerId` (string) — Required - Customer reference
- `totalAmount` (number) — Required - Total payment amount
- `txnDate` (string) — Transaction date (YYYY-MM-DD)
- `paymentMethodId` (string) — Payment method reference
- `depositToAccountId` (string) — Deposit to account reference
- `invoiceLines` (array<object>) — Invoice references to apply payment
- `paymentRefNum` (string) — Payment reference number (check number, etc.)
- `privateNote` (string) — Required string value.

## Get payments **TOOL** `QUICKBOOKS_GET_PAYMENTS`

Lists received-payment records with pagination, filtered by customer, date range, or a raw `whereClause`. These are the accounting-side records — Payments API charges only appear here if something recorded them (for example the `*_AND_RECORD_PAYMENT` composites).

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_PAYMENTS",
  "connectorId": "V1StGXR8Z5",
  "maxResults": 50,
  "startPosition": 1,
  "customerId": "@@{customerId}",
  "startDate": "@@{startDate}"
}
```

> 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.
- `maxResults` (integer) — Required integer value.
- `startPosition` (integer) — Required integer value.
- `whereClause` (string) — Required string value.
- `customerId` (string) — Required string value.
- `startDate` (string) — Required string value.
- `endDate` (string) — Required string value.

## Get payment by ID **TOOL** `QUICKBOOKS_GET_PAYMENT_BY_ID`

Fetches a single payment record, including the invoices it was applied to and the `SyncToken` a void requires. Useful when reconciling which invoices a specific payment covered.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_PAYMENT_BY_ID",
  "connectorId": "V1StGXR8Z5",
  "paymentId": "@@{paymentId}"
}
```

> 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.
- `paymentId` (string) — Required string value.

## Void payment **TOOL** `QUICKBOOKS_VOID_PAYMENT`

Voids a payment record, restoring the balances of any invoices it was applied to. Requires the payment's current `syncToken`. This only reverses the ledger entry — refunding money actually charged through the Payments API is `QUICKBOOKS_REFUND_CHARGE` on the [Payments](/docs/tools/quickbooks/payments.md) page.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_VOID_PAYMENT",
  "connectorId": "V1StGXR8Z5",
  "paymentId": "@@{paymentId}",
  "syncToken": "@@{syncToken}"
}
```

> 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.
- `paymentId` (string) — Required string value.
- `syncToken` (string) — Required string value.

## Create estimate **TOOL** `QUICKBOOKS_CREATE_ESTIMATE`

Creates an estimate (quote) for a customer using the same sales-line shape as invoices. Estimates don't post to the ledger; when the customer accepts, `QUICKBOOKS_CONVERT_ESTIMATE_TO_INVOICE` on the [Workflows](/docs/tools/quickbooks/workflows.md) page turns it into a billable invoice.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_CREATE_ESTIMATE",
  "connectorId": "V1StGXR8Z5",
  "customerId": "@@{customerId}",
  "lines": [
    {
      "DetailType": "SalesItemLineDetail",
      "Amount": 1200.00,
      "Description": "@@{lineDescription}",
      "SalesItemLineDetail": {
        "ItemRef": { "value": "12" },
        "Qty": 8,
        "UnitPrice": 150.00
      }
    }
  ],
  "expirationDate": "@@{expirationDate}"
}
```

> 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
- `lines` (array<object>) — Required - Line items
- `txnDate` (string) — Transaction date
- `expirationDate` (string) — Expiration date
- `docNumber` (string) — Estimate number
- `customerMemo` (string) — Required string value.
- `privateNote` (string) — Required string value.
- `billingEmail` (string) — Required string value.
- `billingAddress` (object) — Required object value.
- `shippingAddress` (object) — Required object value.

## Send estimate **TOOL** `QUICKBOOKS_SEND_ESTIMATE`

Emails an estimate through QuickBooks' delivery system. `emailTo` overrides the recipient; when omitted, the estimate goes to the customer's email on file.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_SEND_ESTIMATE",
  "connectorId": "V1StGXR8Z5",
  "estimateId": "@@{estimateId}",
  "emailTo": "@@{recipientEmail}"
}
```

> 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) — Required
- `emailTo` (string · optional) — Optional - uses customer email if not provided

## Get estimates **TOOL** `QUICKBOOKS_GET_ESTIMATES`

Lists estimates with pagination, filtered by customer, transaction-date range, or a raw `whereClause`. Handy for finding outstanding quotes that haven't converted to invoices yet.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_ESTIMATES",
  "connectorId": "V1StGXR8Z5",
  "maxResults": 50,
  "startPosition": 1,
  "customerId": "@@{customerId}"
}
```

> 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.
- `maxResults` (integer) — Required integer value.
- `startPosition` (integer) — Required integer value.
- `whereClause` (string) — Required string value.
- `customerId` (string) — Required string value.
- `startDate` (string) — Required string value.
- `endDate` (string) — Required string value.

## Get estimate by ID **TOOL** `QUICKBOOKS_GET_ESTIMATE_BY_ID`

Fetches a single estimate in full — line items, status, expiration, and linked transactions. Use it to review a quote's contents before converting or re-sending it.

### Example

```json title="Tool config"
{
  "toolType": "QUICKBOOKS_GET_ESTIMATE_BY_ID",
  "connectorId": "V1StGXR8Z5",
  "estimateId": "@@{estimateId}"
}
```

> 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) — Required string value.

## Related

- [Tools overview](/docs/tools.md)
- [QuickBooks overview](/docs/tools/quickbooks.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)
- [Workflows](/docs/tools/quickbooks/workflows.md)
- [Connectors](/docs/guide/connectors.md)
- [Autessa Payments](/docs/tools/autessa-payments.md)

