{
  "TxnID": "1234-5678901234",
  "TxnNumber": 1000,
  "TxnDate": "2024-05-01",
  "RefNumber": "11",
  "CustomerRef": {
    "ListID": "1234567890",
    "FullName": "John Doe"
  },
  "Subtotal": "1000.00",
  "SalesTaxTotal": "80.00",
  "TotalAmount": "1080.00",
  "DepositToAccountRef": {
    "ListID": "9876543210",
    "FullName": "Checking Account"
  },
  "ClassRef": {
    "ListID": "1122334455",
    "FullName": "Online Sales"
  },
  "TemplateRef": {
    "ListID": "5544332211",
    "FullName": "Standard Sales Receipt"
  },
  "BillAddress": {
    "Addr1": "123 Main St"
  },
  "BillAddressBlock": {
    "Addr1": "123 Main St"
  },
  "ShipDate": "2024-05-02",
  "DueDate": "2024-05-15",
  "SalesTaxPercentage": 8.0,
  "IsPending": false,
  "IsToBeEmailed": true,
  "IsToBePrinted": false,
  "EditSequence": "1683057600",
  "TimeCreated": "2024-05-01T09:30:00-04:00",
  "TimeModified": "2024-05-01T09:45:00-04:00",
  "SalesReceiptLineRet": {
    "TxnLineID": "4E3-1703630162",
    "ItemRef": {
      "ListID": "80000035-1703630156",
      "FullName": "Construction Work"
    },
    "Quantity": 5,
    "Rate": 100,
    "Amount": 500,
    "SalesTaxCodeRef": {
      "ListID": "80000002-1692738438",
      "FullName": "Non"
    }
  }
}

A sales receipt in QuickBooks Desktop is a record of a sale to a customer, such as a payment by cash, check, or credit card. Each sales receipt has several line items, which are the products or services sold.

To see all of the request parameters and response fields for , check out our client library’s amazing autocomplete.

Fetching sales receipts

The following example fetches all sales receipts for the specified EndUser, including the line items:

Fetching all sales receipts with line items
const salesReceipts = await conductor.qbd.salesReceipt.query(
  "{{END_USER_ID}}",
  { IncludeLineItems: true },
);

Creating sales receipts

To create a sales receipt in QuickBooks Desktop from scratch, you either need the identifiers (e.g., ListID) of the required associated objects, or you must create the associated objects first.

The following example uses mock data to create a sales receipt in QuickBooks Desktop, which also requires creating a mock customer, account, and service-item using the add() method of each object. The add() method returns the created object, which contains the ListID identifier to associate the objects with each other.

Creating a sales receipt
const END_USER_ID = "{{END_USER_ID}}";
// Use unique names for mock objects because QBD requires each to be unique.
const UNIQUE_SUFFIX = Math.random().toFixed(6);

const customer = await conductor.qbd.customer.add(END_USER_ID, {
  Name: `Test Customer ${UNIQUE_SUFFIX}`,
});

// A sales receipt cannot be empty, so we must create an item to add to the
// sales receipt, and every item requires an account, which we create first.
const account = await conductor.qbd.account.add(END_USER_ID, {
  Name: `Test Income Account ${UNIQUE_SUFFIX}`,
  AccountType: "Income",
});

// Create a service-item for the sales receipt with the account we just created.
const serviceItem = await conductor.qbd.itemService.add(END_USER_ID, {
  Name: `Construction Work ${UNIQUE_SUFFIX}`,
  SalesOrPurchase: {
    Price: "100.00",
    AccountRef: {
      ListID: account.ListID,
    },
  },
});

const salesReceipt = await conductor.qbd.salesReceipt.add(END_USER_ID, {
  CustomerRef: {
    ListID: customer.ListID,
  },
  SalesReceiptLineAdd: [
    {
      Quantity: 5,
      ItemRef: {
        ListID: serviceItem.ListID,
      },
    },
  ],
});