0

Get Purchase

by
Published Jun 6, 2022

Returns info about a purchase. [See docs here](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/purchase#read-a-purchase)

Script quickbooks Verified

The script

Submitted by hugo697 Bun
Verified 323 days ago
1
import QuickBooks from "node-quickbooks";
2

3
type Quickbooks = {
4
  realmId: string;
5
  token: string;
6
  isSandBox: boolean;
7
};
8

9
export async function main(resource: Quickbooks, purchaseId: string) {
10
  const qbo = new QuickBooks("", "", resource.token, false, resource.realmId, resource.isSandBox, true, null, "2.0");
11

12
  return new Promise((resolve, reject) => {
13
    qbo.getPurchase(purchaseId, function (err: any, result: any) {
14
      if (err) {
15
        reject(err);
16
      } else {
17
        resolve(result);
18
      }
19
    });
20
  });
21
}
22