@apideck/unify 0.40.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +4 -4
  3. package/lib/config.js +4 -4
  4. package/package.json +6 -2
  5. package/src/__tests__/activities.test.ts +1141 -0
  6. package/src/__tests__/agedcreditors.test.ts +280 -0
  7. package/src/__tests__/ageddebtors.test.ts +280 -0
  8. package/src/__tests__/apideckcompanies.test.ts +1082 -0
  9. package/src/__tests__/apideckcustomers.test.ts +364 -0
  10. package/src/__tests__/apideckdepartments.test.ts +497 -0
  11. package/src/__tests__/apiresources.test.ts +62 -0
  12. package/src/__tests__/apis.test.ts +216 -0
  13. package/src/__tests__/applicants.test.ts +1445 -0
  14. package/src/__tests__/applications.test.ts +515 -0
  15. package/src/__tests__/assertions.ts +13 -0
  16. package/src/__tests__/attachments.test.ts +371 -0
  17. package/src/__tests__/balancesheet.test.ts +453 -0
  18. package/src/__tests__/bankaccounts.test.ts +324 -0
  19. package/src/__tests__/bankfeedaccounts.test.ts +343 -0
  20. package/src/__tests__/bankfeedstatements.test.ts +408 -0
  21. package/src/__tests__/billpayments.test.ts +1031 -0
  22. package/src/__tests__/bills.test.ts +1630 -0
  23. package/src/__tests__/categories.test.ts +127 -0
  24. package/src/__tests__/collections.test.ts +120 -0
  25. package/src/__tests__/collectiontags.test.ts +68 -0
  26. package/src/__tests__/collectionticketcomments.test.ts +501 -0
  27. package/src/__tests__/collectiontickets.test.ts +627 -0
  28. package/src/__tests__/collectionusers.test.ts +126 -0
  29. package/src/__tests__/companies.test.ts +1642 -0
  30. package/src/__tests__/companyinfo.test.ts +219 -0
  31. package/src/__tests__/connectionconsent.test.ts +89 -0
  32. package/src/__tests__/connectionconsents.test.ts +31 -0
  33. package/src/__tests__/connectioncustommappings.test.ts +69 -0
  34. package/src/__tests__/connections.test.ts +2127 -0
  35. package/src/__tests__/connectionsettings.test.ts +687 -0
  36. package/src/__tests__/connectordocs.test.ts +29 -0
  37. package/src/__tests__/connectors.test.ts +753 -0
  38. package/src/__tests__/consumerrequestcounts.test.ts +42 -0
  39. package/src/__tests__/consumers.test.ts +523 -0
  40. package/src/__tests__/contacts.test.ts +1421 -0
  41. package/src/__tests__/createcallback.test.ts +36 -0
  42. package/src/__tests__/creditnotes.test.ts +2040 -0
  43. package/src/__tests__/customers.test.ts +1600 -0
  44. package/src/__tests__/customfields.test.ts +52 -0
  45. package/src/__tests__/custommappings.test.ts +65 -0
  46. package/src/__tests__/customobjects.test.ts +408 -0
  47. package/src/__tests__/customobjectschemas.test.ts +734 -0
  48. package/src/__tests__/departments.test.ts +529 -0
  49. package/src/__tests__/drivegroups.test.ts +496 -0
  50. package/src/__tests__/drives.test.ts +487 -0
  51. package/src/__tests__/employeepayrolls.test.ts +491 -0
  52. package/src/__tests__/employees.test.ts +2968 -0
  53. package/src/__tests__/employeeschedules.test.ts +457 -0
  54. package/src/__tests__/eventlogs.test.ts +158 -0
  55. package/src/__tests__/expensecategories.test.ts +324 -0
  56. package/src/__tests__/expensereports.test.ts +634 -0
  57. package/src/__tests__/expenses.test.ts +867 -0
  58. package/src/__tests__/files.test.ts +506 -0
  59. package/src/__tests__/files.ts +56 -0
  60. package/src/__tests__/folders.test.ts +390 -0
  61. package/src/__tests__/invoiceitems.test.ts +855 -0
  62. package/src/__tests__/invoices.test.ts +2173 -0
  63. package/src/__tests__/jobs.test.ts +1150 -0
  64. package/src/__tests__/journalentries.test.ts +1542 -0
  65. package/src/__tests__/leads.test.ts +1341 -0
  66. package/src/__tests__/ledgeraccounts.test.ts +829 -0
  67. package/src/__tests__/locations.test.ts +856 -0
  68. package/src/__tests__/logs.test.ts +137 -0
  69. package/src/__tests__/messages.test.ts +588 -0
  70. package/src/__tests__/notes.test.ts +523 -0
  71. package/src/__tests__/opportunities.test.ts +718 -0
  72. package/src/__tests__/orders.test.ts +854 -0
  73. package/src/__tests__/payments.test.ts +867 -0
  74. package/src/__tests__/payrolls.test.ts +485 -0
  75. package/src/__tests__/pipelines.test.ts +574 -0
  76. package/src/__tests__/products.test.ts +509 -0
  77. package/src/__tests__/profitandloss.test.ts +223 -0
  78. package/src/__tests__/projects.test.ts +480 -0
  79. package/src/__tests__/proxy.test.ts +41 -0
  80. package/src/__tests__/purchaseorders.test.ts +2139 -0
  81. package/src/__tests__/quotes.test.ts +678 -0
  82. package/src/__tests__/refunds.test.ts +812 -0
  83. package/src/__tests__/sessions.test.ts +72 -0
  84. package/src/__tests__/sharedlinks.test.ts +511 -0
  85. package/src/__tests__/stores.test.ts +41 -0
  86. package/src/__tests__/subsidiaries.test.ts +496 -0
  87. package/src/__tests__/suppliers.test.ts +1574 -0
  88. package/src/__tests__/taxrates.test.ts +701 -0
  89. package/src/__tests__/testclient.ts +48 -0
  90. package/src/__tests__/timeoffrequests.test.ts +588 -0
  91. package/src/__tests__/trackingcategories.test.ts +515 -0
  92. package/src/__tests__/uploadsessions.test.ts +221 -0
  93. package/src/__tests__/users.test.ts +1020 -0
  94. package/src/__tests__/validateconnection.test.ts +34 -0
  95. package/src/__tests__/webhooks.test.ts +254 -0
  96. package/src/lib/config.ts +4 -4
@@ -0,0 +1,2139 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { expect, test } from "vitest";
6
+ import { Apideck } from "../index.js";
7
+ import { createTestHTTPClient } from "./testclient.js";
8
+
9
+ test("Purchaseorders Accounting Purchase Orders All", async () => {
10
+ const testHttpClient = createTestHTTPClient("accounting.purchaseOrdersAll");
11
+
12
+ const apideck = new Apideck({
13
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
14
+ httpClient: testHttpClient,
15
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
16
+ });
17
+
18
+ const result = await apideck.accounting.purchaseOrders.list({
19
+ consumerId: "test-consumer",
20
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
21
+ serviceId: "salesforce",
22
+ passThrough: {
23
+ "search": "San Francisco",
24
+ },
25
+ filter: {
26
+ updatedSince: new Date("2020-09-30T07:43:32.000Z"),
27
+ supplierId: "1234",
28
+ },
29
+ sort: {
30
+ by: "updated_at",
31
+ direction: "desc",
32
+ },
33
+ });
34
+ expect(result.httpMeta.response.status).toBe(200);
35
+ expect(result.getPurchaseOrdersResponse).toBeDefined();
36
+ expect(result.getPurchaseOrdersResponse).toEqual({
37
+ statusCode: 200,
38
+ status: "OK",
39
+ service: "quickbooks",
40
+ resource: "PurchaseOrders",
41
+ operation: "all",
42
+ data: [
43
+ {
44
+ id: "12345",
45
+ downstreamId: "12345",
46
+ poNumber: "90000117",
47
+ reference: "123456",
48
+ supplier: {
49
+ id: "12345",
50
+ displayId: "SUPP00101",
51
+ displayName: "Windsurf Shop",
52
+ companyName: "The boring company",
53
+ address: {
54
+ id: "123",
55
+ type: "primary",
56
+ string: "25 Spring Street, Blackburn, VIC 3130",
57
+ name: "HQ US",
58
+ line1: "Main street",
59
+ line2: "apt #",
60
+ line3: "Suite #",
61
+ line4: "delivery instructions",
62
+ streetNumber: "25",
63
+ city: "San Francisco",
64
+ state: "CA",
65
+ postalCode: "94104",
66
+ country: "US",
67
+ latitude: "40.759211",
68
+ longitude: "-73.984638",
69
+ county: "Santa Clara",
70
+ contactName: "Elon Musk",
71
+ salutation: "Mr",
72
+ phoneNumber: "111-111-1111",
73
+ fax: "122-111-1111",
74
+ email: "elon@musk.com",
75
+ website: "https://elonmusk.com",
76
+ notes: "Address notes or delivery instructions.",
77
+ rowVersion: "1-12345",
78
+ },
79
+ },
80
+ companyId: "12345",
81
+ status: "open",
82
+ issuedDate: new Date("2020-09-30"),
83
+ deliveryDate: new Date("2020-09-30"),
84
+ expectedArrivalDate: new Date("2020-09-30"),
85
+ currency: "USD",
86
+ currencyRate: 0.69,
87
+ subTotal: 27500,
88
+ totalTax: 2500,
89
+ total: 27500,
90
+ taxInclusive: true,
91
+ lineItems: [
92
+ {
93
+ id: "12345",
94
+ rowId: "12345",
95
+ code: "120-C",
96
+ lineNumber: 1,
97
+ description:
98
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
99
+ type: "sales_item",
100
+ taxAmount: 27500,
101
+ totalAmount: 27500,
102
+ quantity: 1,
103
+ unitPrice: 27500.5,
104
+ unitOfMeasure: "pc.",
105
+ discountPercentage: 0.01,
106
+ discountAmount: 19.99,
107
+ locationId: "12345",
108
+ departmentId: "12345",
109
+ item: {
110
+ id: "12344",
111
+ code: "120-C",
112
+ name: "Model Y",
113
+ },
114
+ taxRate: {
115
+ id: "123456",
116
+ code: "N-T",
117
+ name: "GST on Purchases",
118
+ rate: 10,
119
+ },
120
+ trackingCategories: [
121
+ {
122
+ id: "123456",
123
+ name: "New York",
124
+ },
125
+ {
126
+ id: "123456",
127
+ name: "New York",
128
+ },
129
+ {
130
+ id: "123456",
131
+ name: "New York",
132
+ },
133
+ ],
134
+ ledgerAccount: {
135
+ id: "123456",
136
+ name: "Bank account",
137
+ nominalCode: "N091",
138
+ code: "453",
139
+ },
140
+ customFields: [
141
+ {
142
+ id: "2389328923893298",
143
+ name: "employee_level",
144
+ description: "Employee Level",
145
+ value: 10,
146
+ },
147
+ ],
148
+ rowVersion: "1-12345",
149
+ updatedBy: "12345",
150
+ createdBy: "12345",
151
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
152
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
153
+ },
154
+ {
155
+ id: "12345",
156
+ rowId: "12345",
157
+ code: "120-C",
158
+ lineNumber: 1,
159
+ description:
160
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
161
+ type: "sales_item",
162
+ taxAmount: 27500,
163
+ totalAmount: 27500,
164
+ quantity: 1,
165
+ unitPrice: 27500.5,
166
+ unitOfMeasure: "pc.",
167
+ discountPercentage: 0.01,
168
+ discountAmount: 19.99,
169
+ locationId: "12345",
170
+ departmentId: "12345",
171
+ item: {
172
+ id: "12344",
173
+ code: "120-C",
174
+ name: "Model Y",
175
+ },
176
+ taxRate: {
177
+ id: "123456",
178
+ code: "N-T",
179
+ name: "GST on Purchases",
180
+ rate: 10,
181
+ },
182
+ trackingCategories: [
183
+ {
184
+ id: "123456",
185
+ name: "New York",
186
+ },
187
+ ],
188
+ ledgerAccount: {
189
+ id: "123456",
190
+ name: "Bank account",
191
+ nominalCode: "N091",
192
+ code: "453",
193
+ },
194
+ customFields: [
195
+ {
196
+ id: "2389328923893298",
197
+ name: "employee_level",
198
+ description: "Employee Level",
199
+ value: {},
200
+ },
201
+ {
202
+ id: "2389328923893298",
203
+ name: "employee_level",
204
+ description: "Employee Level",
205
+ value: "Uses Salesforce and Marketo",
206
+ },
207
+ ],
208
+ rowVersion: "1-12345",
209
+ updatedBy: "12345",
210
+ createdBy: "12345",
211
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
212
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
213
+ },
214
+ ],
215
+ shippingAddress: {
216
+ id: "123",
217
+ type: "primary",
218
+ string: "25 Spring Street, Blackburn, VIC 3130",
219
+ name: "HQ US",
220
+ line1: "Main street",
221
+ line2: "apt #",
222
+ line3: "Suite #",
223
+ line4: "delivery instructions",
224
+ streetNumber: "25",
225
+ city: "San Francisco",
226
+ state: "CA",
227
+ postalCode: "94104",
228
+ country: "US",
229
+ latitude: "40.759211",
230
+ longitude: "-73.984638",
231
+ county: "Santa Clara",
232
+ contactName: "Elon Musk",
233
+ salutation: "Mr",
234
+ phoneNumber: "111-111-1111",
235
+ fax: "122-111-1111",
236
+ email: "elon@musk.com",
237
+ website: "https://elonmusk.com",
238
+ notes: "Address notes or delivery instructions.",
239
+ rowVersion: "1-12345",
240
+ },
241
+ ledgerAccount: {
242
+ id: "123456",
243
+ name: "Bank account",
244
+ nominalCode: "N091",
245
+ code: "453",
246
+ },
247
+ templateId: "123456",
248
+ discountPercentage: 5.5,
249
+ bankAccount: {
250
+ bankName: "Monzo",
251
+ accountNumber: "123465",
252
+ accountName: "SPACEX LLC",
253
+ accountType: "credit_card",
254
+ iban: "CH2989144532982975332",
255
+ bic: "AUDSCHGGXXX",
256
+ routingNumber: "012345678",
257
+ bsbNumber: "062-001",
258
+ branchIdentifier: "001",
259
+ bankCode: "BNH",
260
+ currency: "USD",
261
+ },
262
+ accountingByRow: false,
263
+ dueDate: new Date("2020-10-30"),
264
+ paymentMethod: "cash",
265
+ taxCode: "1234",
266
+ channel: "email",
267
+ memo: "Thank you for the partnership and have a great day!",
268
+ trackingCategories: [
269
+ {
270
+ id: "123456",
271
+ name: "New York",
272
+ },
273
+ {
274
+ id: "123456",
275
+ name: "New York",
276
+ },
277
+ {
278
+ id: "123456",
279
+ name: "New York",
280
+ },
281
+ ],
282
+ customFields: [
283
+ {
284
+ id: "2389328923893298",
285
+ name: "employee_level",
286
+ description: "Employee Level",
287
+ value: "Uses Salesforce and Marketo",
288
+ },
289
+ ],
290
+ rowVersion: "1-12345",
291
+ updatedBy: "12345",
292
+ createdBy: "12345",
293
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
294
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
295
+ passThrough: [
296
+ {
297
+ serviceId: "<id>",
298
+ extendPaths: [
299
+ {
300
+ path: "$.nested.property",
301
+ value: {
302
+ "TaxClassificationRef": {
303
+ "value": "EUC-99990201-V1-00020000",
304
+ },
305
+ },
306
+ },
307
+ {
308
+ path: "$.nested.property",
309
+ value: {
310
+ "TaxClassificationRef": {
311
+ "value": "EUC-99990201-V1-00020000",
312
+ },
313
+ },
314
+ },
315
+ ],
316
+ },
317
+ {
318
+ serviceId: "<id>",
319
+ extendPaths: [
320
+ {
321
+ path: "$.nested.property",
322
+ value: {
323
+ "TaxClassificationRef": {
324
+ "value": "EUC-99990201-V1-00020000",
325
+ },
326
+ },
327
+ },
328
+ {
329
+ path: "$.nested.property",
330
+ value: {
331
+ "TaxClassificationRef": {
332
+ "value": "EUC-99990201-V1-00020000",
333
+ },
334
+ },
335
+ },
336
+ ],
337
+ },
338
+ {
339
+ serviceId: "<id>",
340
+ extendPaths: [
341
+ {
342
+ path: "$.nested.property",
343
+ value: {
344
+ "TaxClassificationRef": {
345
+ "value": "EUC-99990201-V1-00020000",
346
+ },
347
+ },
348
+ },
349
+ ],
350
+ },
351
+ ],
352
+ },
353
+ {
354
+ id: "12345",
355
+ downstreamId: "12345",
356
+ poNumber: "90000117",
357
+ reference: "123456",
358
+ supplier: {
359
+ id: "12345",
360
+ displayId: "SUPP00101",
361
+ displayName: "Windsurf Shop",
362
+ companyName: "The boring company",
363
+ address: {
364
+ id: "123",
365
+ type: "primary",
366
+ string: "25 Spring Street, Blackburn, VIC 3130",
367
+ name: "HQ US",
368
+ line1: "Main street",
369
+ line2: "apt #",
370
+ line3: "Suite #",
371
+ line4: "delivery instructions",
372
+ streetNumber: "25",
373
+ city: "San Francisco",
374
+ state: "CA",
375
+ postalCode: "94104",
376
+ country: "US",
377
+ latitude: "40.759211",
378
+ longitude: "-73.984638",
379
+ county: "Santa Clara",
380
+ contactName: "Elon Musk",
381
+ salutation: "Mr",
382
+ phoneNumber: "111-111-1111",
383
+ fax: "122-111-1111",
384
+ email: "elon@musk.com",
385
+ website: "https://elonmusk.com",
386
+ notes: "Address notes or delivery instructions.",
387
+ rowVersion: "1-12345",
388
+ },
389
+ },
390
+ companyId: "12345",
391
+ status: "open",
392
+ issuedDate: new Date("2020-09-30"),
393
+ deliveryDate: new Date("2020-09-30"),
394
+ expectedArrivalDate: new Date("2020-09-30"),
395
+ currency: "USD",
396
+ currencyRate: 0.69,
397
+ subTotal: 27500,
398
+ totalTax: 2500,
399
+ total: 27500,
400
+ taxInclusive: true,
401
+ lineItems: [
402
+ {
403
+ id: "12345",
404
+ rowId: "12345",
405
+ code: "120-C",
406
+ lineNumber: 1,
407
+ description:
408
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
409
+ type: "sales_item",
410
+ taxAmount: 27500,
411
+ totalAmount: 27500,
412
+ quantity: 1,
413
+ unitPrice: 27500.5,
414
+ unitOfMeasure: "pc.",
415
+ discountPercentage: 0.01,
416
+ discountAmount: 19.99,
417
+ locationId: "12345",
418
+ departmentId: "12345",
419
+ item: {
420
+ id: "12344",
421
+ code: "120-C",
422
+ name: "Model Y",
423
+ },
424
+ taxRate: {
425
+ id: "123456",
426
+ code: "N-T",
427
+ name: "GST on Purchases",
428
+ rate: 10,
429
+ },
430
+ trackingCategories: [
431
+ {
432
+ id: "123456",
433
+ name: "New York",
434
+ },
435
+ {
436
+ id: "123456",
437
+ name: "New York",
438
+ },
439
+ ],
440
+ ledgerAccount: {
441
+ id: "123456",
442
+ name: "Bank account",
443
+ nominalCode: "N091",
444
+ code: "453",
445
+ },
446
+ customFields: [
447
+ {
448
+ id: "2389328923893298",
449
+ name: "employee_level",
450
+ description: "Employee Level",
451
+ value: "Uses Salesforce and Marketo",
452
+ },
453
+ {
454
+ id: "2389328923893298",
455
+ name: "employee_level",
456
+ description: "Employee Level",
457
+ value: {
458
+ "0": {},
459
+ "1": {},
460
+ },
461
+ },
462
+ ],
463
+ rowVersion: "1-12345",
464
+ updatedBy: "12345",
465
+ createdBy: "12345",
466
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
467
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
468
+ },
469
+ ],
470
+ shippingAddress: {
471
+ id: "123",
472
+ type: "primary",
473
+ string: "25 Spring Street, Blackburn, VIC 3130",
474
+ name: "HQ US",
475
+ line1: "Main street",
476
+ line2: "apt #",
477
+ line3: "Suite #",
478
+ line4: "delivery instructions",
479
+ streetNumber: "25",
480
+ city: "San Francisco",
481
+ state: "CA",
482
+ postalCode: "94104",
483
+ country: "US",
484
+ latitude: "40.759211",
485
+ longitude: "-73.984638",
486
+ county: "Santa Clara",
487
+ contactName: "Elon Musk",
488
+ salutation: "Mr",
489
+ phoneNumber: "111-111-1111",
490
+ fax: "122-111-1111",
491
+ email: "elon@musk.com",
492
+ website: "https://elonmusk.com",
493
+ notes: "Address notes or delivery instructions.",
494
+ rowVersion: "1-12345",
495
+ },
496
+ ledgerAccount: {
497
+ id: "123456",
498
+ name: "Bank account",
499
+ nominalCode: "N091",
500
+ code: "453",
501
+ },
502
+ templateId: "123456",
503
+ discountPercentage: 5.5,
504
+ bankAccount: {
505
+ bankName: "Monzo",
506
+ accountNumber: "123465",
507
+ accountName: "SPACEX LLC",
508
+ accountType: "credit_card",
509
+ iban: "CH2989144532982975332",
510
+ bic: "AUDSCHGGXXX",
511
+ routingNumber: "012345678",
512
+ bsbNumber: "062-001",
513
+ branchIdentifier: "001",
514
+ bankCode: "BNH",
515
+ currency: "USD",
516
+ },
517
+ accountingByRow: false,
518
+ dueDate: new Date("2020-10-30"),
519
+ paymentMethod: "cash",
520
+ taxCode: "1234",
521
+ channel: "email",
522
+ memo: "Thank you for the partnership and have a great day!",
523
+ trackingCategories: [
524
+ {
525
+ id: "123456",
526
+ name: "New York",
527
+ },
528
+ {
529
+ id: "123456",
530
+ name: "New York",
531
+ },
532
+ {
533
+ id: "123456",
534
+ name: "New York",
535
+ },
536
+ ],
537
+ customFields: [
538
+ {
539
+ id: "2389328923893298",
540
+ name: "employee_level",
541
+ description: "Employee Level",
542
+ value: "Uses Salesforce and Marketo",
543
+ },
544
+ {
545
+ id: "2389328923893298",
546
+ name: "employee_level",
547
+ description: "Employee Level",
548
+ value: 10,
549
+ },
550
+ ],
551
+ rowVersion: "1-12345",
552
+ updatedBy: "12345",
553
+ createdBy: "12345",
554
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
555
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
556
+ passThrough: [
557
+ {
558
+ serviceId: "<id>",
559
+ extendPaths: [
560
+ {
561
+ path: "$.nested.property",
562
+ value: {
563
+ "TaxClassificationRef": {
564
+ "value": "EUC-99990201-V1-00020000",
565
+ },
566
+ },
567
+ },
568
+ ],
569
+ },
570
+ {
571
+ serviceId: "<id>",
572
+ extendPaths: [
573
+ {
574
+ path: "$.nested.property",
575
+ value: {
576
+ "TaxClassificationRef": {
577
+ "value": "EUC-99990201-V1-00020000",
578
+ },
579
+ },
580
+ },
581
+ {
582
+ path: "$.nested.property",
583
+ value: {
584
+ "TaxClassificationRef": {
585
+ "value": "EUC-99990201-V1-00020000",
586
+ },
587
+ },
588
+ },
589
+ {
590
+ path: "$.nested.property",
591
+ value: {
592
+ "TaxClassificationRef": {
593
+ "value": "EUC-99990201-V1-00020000",
594
+ },
595
+ },
596
+ },
597
+ ],
598
+ },
599
+ {
600
+ serviceId: "<id>",
601
+ extendPaths: [
602
+ {
603
+ path: "$.nested.property",
604
+ value: {
605
+ "TaxClassificationRef": {
606
+ "value": "EUC-99990201-V1-00020000",
607
+ },
608
+ },
609
+ },
610
+ {
611
+ path: "$.nested.property",
612
+ value: {
613
+ "TaxClassificationRef": {
614
+ "value": "EUC-99990201-V1-00020000",
615
+ },
616
+ },
617
+ },
618
+ ],
619
+ },
620
+ ],
621
+ },
622
+ {
623
+ id: "12345",
624
+ downstreamId: "12345",
625
+ poNumber: "90000117",
626
+ reference: "123456",
627
+ supplier: {
628
+ id: "12345",
629
+ displayId: "SUPP00101",
630
+ displayName: "Windsurf Shop",
631
+ companyName: "The boring company",
632
+ address: {
633
+ id: "123",
634
+ type: "primary",
635
+ string: "25 Spring Street, Blackburn, VIC 3130",
636
+ name: "HQ US",
637
+ line1: "Main street",
638
+ line2: "apt #",
639
+ line3: "Suite #",
640
+ line4: "delivery instructions",
641
+ streetNumber: "25",
642
+ city: "San Francisco",
643
+ state: "CA",
644
+ postalCode: "94104",
645
+ country: "US",
646
+ latitude: "40.759211",
647
+ longitude: "-73.984638",
648
+ county: "Santa Clara",
649
+ contactName: "Elon Musk",
650
+ salutation: "Mr",
651
+ phoneNumber: "111-111-1111",
652
+ fax: "122-111-1111",
653
+ email: "elon@musk.com",
654
+ website: "https://elonmusk.com",
655
+ notes: "Address notes or delivery instructions.",
656
+ rowVersion: "1-12345",
657
+ },
658
+ },
659
+ companyId: "12345",
660
+ status: "open",
661
+ issuedDate: new Date("2020-09-30"),
662
+ deliveryDate: new Date("2020-09-30"),
663
+ expectedArrivalDate: new Date("2020-09-30"),
664
+ currency: "USD",
665
+ currencyRate: 0.69,
666
+ subTotal: 27500,
667
+ totalTax: 2500,
668
+ total: 27500,
669
+ taxInclusive: true,
670
+ lineItems: [
671
+ {
672
+ id: "12345",
673
+ rowId: "12345",
674
+ code: "120-C",
675
+ lineNumber: 1,
676
+ description:
677
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
678
+ type: "sales_item",
679
+ taxAmount: 27500,
680
+ totalAmount: 27500,
681
+ quantity: 1,
682
+ unitPrice: 27500.5,
683
+ unitOfMeasure: "pc.",
684
+ discountPercentage: 0.01,
685
+ discountAmount: 19.99,
686
+ locationId: "12345",
687
+ departmentId: "12345",
688
+ item: {
689
+ id: "12344",
690
+ code: "120-C",
691
+ name: "Model Y",
692
+ },
693
+ taxRate: {
694
+ id: "123456",
695
+ code: "N-T",
696
+ name: "GST on Purchases",
697
+ rate: 10,
698
+ },
699
+ trackingCategories: [
700
+ {
701
+ id: "123456",
702
+ name: "New York",
703
+ },
704
+ ],
705
+ ledgerAccount: {
706
+ id: "123456",
707
+ name: "Bank account",
708
+ nominalCode: "N091",
709
+ code: "453",
710
+ },
711
+ customFields: [
712
+ {
713
+ id: "2389328923893298",
714
+ name: "employee_level",
715
+ description: "Employee Level",
716
+ value: {},
717
+ },
718
+ ],
719
+ rowVersion: "1-12345",
720
+ updatedBy: "12345",
721
+ createdBy: "12345",
722
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
723
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
724
+ },
725
+ {
726
+ id: "12345",
727
+ rowId: "12345",
728
+ code: "120-C",
729
+ lineNumber: 1,
730
+ description:
731
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
732
+ type: "sales_item",
733
+ taxAmount: 27500,
734
+ totalAmount: 27500,
735
+ quantity: 1,
736
+ unitPrice: 27500.5,
737
+ unitOfMeasure: "pc.",
738
+ discountPercentage: 0.01,
739
+ discountAmount: 19.99,
740
+ locationId: "12345",
741
+ departmentId: "12345",
742
+ item: {
743
+ id: "12344",
744
+ code: "120-C",
745
+ name: "Model Y",
746
+ },
747
+ taxRate: {
748
+ id: "123456",
749
+ code: "N-T",
750
+ name: "GST on Purchases",
751
+ rate: 10,
752
+ },
753
+ trackingCategories: [
754
+ {
755
+ id: "123456",
756
+ name: "New York",
757
+ },
758
+ {
759
+ id: "123456",
760
+ name: "New York",
761
+ },
762
+ ],
763
+ ledgerAccount: {
764
+ id: "123456",
765
+ name: "Bank account",
766
+ nominalCode: "N091",
767
+ code: "453",
768
+ },
769
+ customFields: [
770
+ {
771
+ id: "2389328923893298",
772
+ name: "employee_level",
773
+ description: "Employee Level",
774
+ value: true,
775
+ },
776
+ {
777
+ id: "2389328923893298",
778
+ name: "employee_level",
779
+ description: "Employee Level",
780
+ value: true,
781
+ },
782
+ ],
783
+ rowVersion: "1-12345",
784
+ updatedBy: "12345",
785
+ createdBy: "12345",
786
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
787
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
788
+ },
789
+ {
790
+ id: "12345",
791
+ rowId: "12345",
792
+ code: "120-C",
793
+ lineNumber: 1,
794
+ description:
795
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
796
+ type: "sales_item",
797
+ taxAmount: 27500,
798
+ totalAmount: 27500,
799
+ quantity: 1,
800
+ unitPrice: 27500.5,
801
+ unitOfMeasure: "pc.",
802
+ discountPercentage: 0.01,
803
+ discountAmount: 19.99,
804
+ locationId: "12345",
805
+ departmentId: "12345",
806
+ item: {
807
+ id: "12344",
808
+ code: "120-C",
809
+ name: "Model Y",
810
+ },
811
+ taxRate: {
812
+ id: "123456",
813
+ code: "N-T",
814
+ name: "GST on Purchases",
815
+ rate: 10,
816
+ },
817
+ trackingCategories: [
818
+ {
819
+ id: "123456",
820
+ name: "New York",
821
+ },
822
+ ],
823
+ ledgerAccount: {
824
+ id: "123456",
825
+ name: "Bank account",
826
+ nominalCode: "N091",
827
+ code: "453",
828
+ },
829
+ customFields: [
830
+ {
831
+ id: "2389328923893298",
832
+ name: "employee_level",
833
+ description: "Employee Level",
834
+ value: {
835
+ "0": {},
836
+ },
837
+ },
838
+ {
839
+ id: "2389328923893298",
840
+ name: "employee_level",
841
+ description: "Employee Level",
842
+ value: {
843
+ "0": {},
844
+ },
845
+ },
846
+ ],
847
+ rowVersion: "1-12345",
848
+ updatedBy: "12345",
849
+ createdBy: "12345",
850
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
851
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
852
+ },
853
+ ],
854
+ shippingAddress: {
855
+ id: "123",
856
+ type: "primary",
857
+ string: "25 Spring Street, Blackburn, VIC 3130",
858
+ name: "HQ US",
859
+ line1: "Main street",
860
+ line2: "apt #",
861
+ line3: "Suite #",
862
+ line4: "delivery instructions",
863
+ streetNumber: "25",
864
+ city: "San Francisco",
865
+ state: "CA",
866
+ postalCode: "94104",
867
+ country: "US",
868
+ latitude: "40.759211",
869
+ longitude: "-73.984638",
870
+ county: "Santa Clara",
871
+ contactName: "Elon Musk",
872
+ salutation: "Mr",
873
+ phoneNumber: "111-111-1111",
874
+ fax: "122-111-1111",
875
+ email: "elon@musk.com",
876
+ website: "https://elonmusk.com",
877
+ notes: "Address notes or delivery instructions.",
878
+ rowVersion: "1-12345",
879
+ },
880
+ ledgerAccount: {
881
+ id: "123456",
882
+ name: "Bank account",
883
+ nominalCode: "N091",
884
+ code: "453",
885
+ },
886
+ templateId: "123456",
887
+ discountPercentage: 5.5,
888
+ bankAccount: {
889
+ bankName: "Monzo",
890
+ accountNumber: "123465",
891
+ accountName: "SPACEX LLC",
892
+ accountType: "credit_card",
893
+ iban: "CH2989144532982975332",
894
+ bic: "AUDSCHGGXXX",
895
+ routingNumber: "012345678",
896
+ bsbNumber: "062-001",
897
+ branchIdentifier: "001",
898
+ bankCode: "BNH",
899
+ currency: "USD",
900
+ },
901
+ accountingByRow: false,
902
+ dueDate: new Date("2020-10-30"),
903
+ paymentMethod: "cash",
904
+ taxCode: "1234",
905
+ channel: "email",
906
+ memo: "Thank you for the partnership and have a great day!",
907
+ trackingCategories: [
908
+ {
909
+ id: "123456",
910
+ name: "New York",
911
+ },
912
+ {
913
+ id: "123456",
914
+ name: "New York",
915
+ },
916
+ ],
917
+ customFields: [
918
+ {
919
+ id: "2389328923893298",
920
+ name: "employee_level",
921
+ description: "Employee Level",
922
+ value: 10,
923
+ },
924
+ ],
925
+ rowVersion: "1-12345",
926
+ updatedBy: "12345",
927
+ createdBy: "12345",
928
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
929
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
930
+ passThrough: [
931
+ {
932
+ serviceId: "<id>",
933
+ extendPaths: [
934
+ {
935
+ path: "$.nested.property",
936
+ value: {
937
+ "TaxClassificationRef": {
938
+ "value": "EUC-99990201-V1-00020000",
939
+ },
940
+ },
941
+ },
942
+ ],
943
+ },
944
+ {
945
+ serviceId: "<id>",
946
+ extendPaths: [
947
+ {
948
+ path: "$.nested.property",
949
+ value: {
950
+ "TaxClassificationRef": {
951
+ "value": "EUC-99990201-V1-00020000",
952
+ },
953
+ },
954
+ },
955
+ {
956
+ path: "$.nested.property",
957
+ value: {
958
+ "TaxClassificationRef": {
959
+ "value": "EUC-99990201-V1-00020000",
960
+ },
961
+ },
962
+ },
963
+ ],
964
+ },
965
+ {
966
+ serviceId: "<id>",
967
+ extendPaths: [
968
+ {
969
+ path: "$.nested.property",
970
+ value: {
971
+ "TaxClassificationRef": {
972
+ "value": "EUC-99990201-V1-00020000",
973
+ },
974
+ },
975
+ },
976
+ {
977
+ path: "$.nested.property",
978
+ value: {
979
+ "TaxClassificationRef": {
980
+ "value": "EUC-99990201-V1-00020000",
981
+ },
982
+ },
983
+ },
984
+ {
985
+ path: "$.nested.property",
986
+ value: {
987
+ "TaxClassificationRef": {
988
+ "value": "EUC-99990201-V1-00020000",
989
+ },
990
+ },
991
+ },
992
+ ],
993
+ },
994
+ ],
995
+ },
996
+ ],
997
+ meta: {
998
+ itemsOnPage: 50,
999
+ cursors: {
1000
+ previous: "em9oby1jcm06OnBhZ2U6OjE=",
1001
+ current: "em9oby1jcm06OnBhZ2U6OjI=",
1002
+ next: "em9oby1jcm06OnBhZ2U6OjM=",
1003
+ },
1004
+ },
1005
+ links: {
1006
+ previous:
1007
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
1008
+ current: "https://unify.apideck.com/crm/companies",
1009
+ next:
1010
+ "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
1011
+ },
1012
+ });
1013
+ });
1014
+
1015
+ test("Purchaseorders Accounting Purchase Orders Add", async () => {
1016
+ const testHttpClient = createTestHTTPClient("accounting.purchaseOrdersAdd");
1017
+
1018
+ const apideck = new Apideck({
1019
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1020
+ httpClient: testHttpClient,
1021
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1022
+ });
1023
+
1024
+ const result = await apideck.accounting.purchaseOrders.create({
1025
+ consumerId: "test-consumer",
1026
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
1027
+ serviceId: "salesforce",
1028
+ purchaseOrder: {
1029
+ poNumber: "90000117",
1030
+ reference: "123456",
1031
+ supplier: {
1032
+ id: "12345",
1033
+ displayName: "Windsurf Shop",
1034
+ address: {
1035
+ id: "123",
1036
+ type: "primary",
1037
+ string: "25 Spring Street, Blackburn, VIC 3130",
1038
+ name: "HQ US",
1039
+ line1: "Main street",
1040
+ line2: "apt #",
1041
+ line3: "Suite #",
1042
+ line4: "delivery instructions",
1043
+ streetNumber: "25",
1044
+ city: "San Francisco",
1045
+ state: "CA",
1046
+ postalCode: "94104",
1047
+ country: "US",
1048
+ latitude: "40.759211",
1049
+ longitude: "-73.984638",
1050
+ county: "Santa Clara",
1051
+ contactName: "Elon Musk",
1052
+ salutation: "Mr",
1053
+ phoneNumber: "111-111-1111",
1054
+ fax: "122-111-1111",
1055
+ email: "elon@musk.com",
1056
+ website: "https://elonmusk.com",
1057
+ notes: "Address notes or delivery instructions.",
1058
+ rowVersion: "1-12345",
1059
+ },
1060
+ },
1061
+ companyId: "12345",
1062
+ status: "open",
1063
+ issuedDate: new Date("2020-09-30"),
1064
+ deliveryDate: new Date("2020-09-30"),
1065
+ expectedArrivalDate: new Date("2020-09-30"),
1066
+ currency: "USD",
1067
+ currencyRate: 0.69,
1068
+ subTotal: 27500,
1069
+ totalTax: 2500,
1070
+ total: 27500,
1071
+ taxInclusive: true,
1072
+ lineItems: [
1073
+ {
1074
+ id: "12345",
1075
+ rowId: "12345",
1076
+ code: "120-C",
1077
+ lineNumber: 1,
1078
+ description:
1079
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
1080
+ type: "sales_item",
1081
+ taxAmount: 27500,
1082
+ totalAmount: 27500,
1083
+ quantity: 1,
1084
+ unitPrice: 27500.5,
1085
+ unitOfMeasure: "pc.",
1086
+ discountPercentage: 0.01,
1087
+ discountAmount: 19.99,
1088
+ locationId: "12345",
1089
+ departmentId: "12345",
1090
+ item: {
1091
+ id: "12344",
1092
+ code: "120-C",
1093
+ name: "Model Y",
1094
+ },
1095
+ taxRate: {
1096
+ id: "123456",
1097
+ rate: 10,
1098
+ },
1099
+ trackingCategories: [
1100
+ {
1101
+ id: "123456",
1102
+ name: "New York",
1103
+ },
1104
+ {
1105
+ id: "123456",
1106
+ name: "New York",
1107
+ },
1108
+ ],
1109
+ ledgerAccount: {
1110
+ id: "123456",
1111
+ nominalCode: "N091",
1112
+ code: "453",
1113
+ },
1114
+ customFields: [
1115
+ {
1116
+ id: "2389328923893298",
1117
+ name: "employee_level",
1118
+ description: "Employee Level",
1119
+ value: "Uses Salesforce and Marketo",
1120
+ },
1121
+ {
1122
+ id: "2389328923893298",
1123
+ name: "employee_level",
1124
+ description: "Employee Level",
1125
+ value: "Uses Salesforce and Marketo",
1126
+ },
1127
+ ],
1128
+ rowVersion: "1-12345",
1129
+ },
1130
+ {
1131
+ id: "12345",
1132
+ rowId: "12345",
1133
+ code: "120-C",
1134
+ lineNumber: 1,
1135
+ description:
1136
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
1137
+ type: "sales_item",
1138
+ taxAmount: 27500,
1139
+ totalAmount: 27500,
1140
+ quantity: 1,
1141
+ unitPrice: 27500.5,
1142
+ unitOfMeasure: "pc.",
1143
+ discountPercentage: 0.01,
1144
+ discountAmount: 19.99,
1145
+ locationId: "12345",
1146
+ departmentId: "12345",
1147
+ item: {
1148
+ id: "12344",
1149
+ code: "120-C",
1150
+ name: "Model Y",
1151
+ },
1152
+ taxRate: {
1153
+ id: "123456",
1154
+ rate: 10,
1155
+ },
1156
+ trackingCategories: [
1157
+ {
1158
+ id: "123456",
1159
+ name: "New York",
1160
+ },
1161
+ {
1162
+ id: "123456",
1163
+ name: "New York",
1164
+ },
1165
+ {
1166
+ id: "123456",
1167
+ name: "New York",
1168
+ },
1169
+ ],
1170
+ ledgerAccount: {
1171
+ id: "123456",
1172
+ nominalCode: "N091",
1173
+ code: "453",
1174
+ },
1175
+ customFields: [
1176
+ {
1177
+ id: "2389328923893298",
1178
+ name: "employee_level",
1179
+ description: "Employee Level",
1180
+ value: "Uses Salesforce and Marketo",
1181
+ },
1182
+ {
1183
+ id: "2389328923893298",
1184
+ name: "employee_level",
1185
+ description: "Employee Level",
1186
+ value: 10,
1187
+ },
1188
+ {
1189
+ id: "2389328923893298",
1190
+ name: "employee_level",
1191
+ description: "Employee Level",
1192
+ value: "Uses Salesforce and Marketo",
1193
+ },
1194
+ ],
1195
+ rowVersion: "1-12345",
1196
+ },
1197
+ ],
1198
+ shippingAddress: {
1199
+ id: "123",
1200
+ type: "primary",
1201
+ string: "25 Spring Street, Blackburn, VIC 3130",
1202
+ name: "HQ US",
1203
+ line1: "Main street",
1204
+ line2: "apt #",
1205
+ line3: "Suite #",
1206
+ line4: "delivery instructions",
1207
+ streetNumber: "25",
1208
+ city: "San Francisco",
1209
+ state: "CA",
1210
+ postalCode: "94104",
1211
+ country: "US",
1212
+ latitude: "40.759211",
1213
+ longitude: "-73.984638",
1214
+ county: "Santa Clara",
1215
+ contactName: "Elon Musk",
1216
+ salutation: "Mr",
1217
+ phoneNumber: "111-111-1111",
1218
+ fax: "122-111-1111",
1219
+ email: "elon@musk.com",
1220
+ website: "https://elonmusk.com",
1221
+ notes: "Address notes or delivery instructions.",
1222
+ rowVersion: "1-12345",
1223
+ },
1224
+ ledgerAccount: {
1225
+ id: "123456",
1226
+ nominalCode: "N091",
1227
+ code: "453",
1228
+ },
1229
+ templateId: "123456",
1230
+ discountPercentage: 5.5,
1231
+ bankAccount: {
1232
+ bankName: "Monzo",
1233
+ accountNumber: "123465",
1234
+ accountName: "SPACEX LLC",
1235
+ accountType: "credit_card",
1236
+ iban: "CH2989144532982975332",
1237
+ bic: "AUDSCHGGXXX",
1238
+ routingNumber: "012345678",
1239
+ bsbNumber: "062-001",
1240
+ branchIdentifier: "001",
1241
+ bankCode: "BNH",
1242
+ currency: "USD",
1243
+ },
1244
+ accountingByRow: false,
1245
+ dueDate: new Date("2020-10-30"),
1246
+ paymentMethod: "cash",
1247
+ taxCode: "1234",
1248
+ channel: "email",
1249
+ memo: "Thank you for the partnership and have a great day!",
1250
+ trackingCategories: [
1251
+ {
1252
+ id: "123456",
1253
+ name: "New York",
1254
+ },
1255
+ {
1256
+ id: "123456",
1257
+ name: "New York",
1258
+ },
1259
+ {
1260
+ id: "123456",
1261
+ name: "New York",
1262
+ },
1263
+ ],
1264
+ customFields: [
1265
+ {
1266
+ id: "2389328923893298",
1267
+ name: "employee_level",
1268
+ description: "Employee Level",
1269
+ value: {},
1270
+ },
1271
+ {
1272
+ id: "2389328923893298",
1273
+ name: "employee_level",
1274
+ description: "Employee Level",
1275
+ value: {
1276
+ "0": "<value>",
1277
+ "1": "<value>",
1278
+ "2": "<value>",
1279
+ },
1280
+ },
1281
+ {
1282
+ id: "2389328923893298",
1283
+ name: "employee_level",
1284
+ description: "Employee Level",
1285
+ value: true,
1286
+ },
1287
+ ],
1288
+ rowVersion: "1-12345",
1289
+ passThrough: [
1290
+ {
1291
+ serviceId: "<id>",
1292
+ extendPaths: [
1293
+ {
1294
+ path: "$.nested.property",
1295
+ value: {
1296
+ "TaxClassificationRef": {
1297
+ "value": "EUC-99990201-V1-00020000",
1298
+ },
1299
+ },
1300
+ },
1301
+ ],
1302
+ },
1303
+ ],
1304
+ },
1305
+ });
1306
+ expect(result.httpMeta.response.status).toBe(201);
1307
+ expect(result.createPurchaseOrderResponse).toBeDefined();
1308
+ expect(result.createPurchaseOrderResponse).toEqual({
1309
+ statusCode: 200,
1310
+ status: "OK",
1311
+ service: "quickbooks",
1312
+ resource: "PurchaseOrders",
1313
+ operation: "add",
1314
+ data: {
1315
+ id: "12345",
1316
+ },
1317
+ });
1318
+ });
1319
+
1320
+ test("Purchaseorders Accounting Purchase Orders One", async () => {
1321
+ const testHttpClient = createTestHTTPClient("accounting.purchaseOrdersOne");
1322
+
1323
+ const apideck = new Apideck({
1324
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1325
+ httpClient: testHttpClient,
1326
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1327
+ });
1328
+
1329
+ const result = await apideck.accounting.purchaseOrders.get({
1330
+ id: "<id>",
1331
+ consumerId: "test-consumer",
1332
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
1333
+ serviceId: "salesforce",
1334
+ });
1335
+ expect(result.httpMeta.response.status).toBe(200);
1336
+ expect(result.getPurchaseOrderResponse).toBeDefined();
1337
+ expect(result.getPurchaseOrderResponse).toEqual({
1338
+ statusCode: 200,
1339
+ status: "OK",
1340
+ service: "quickbooks",
1341
+ resource: "PurchaseOrders",
1342
+ operation: "one",
1343
+ data: {
1344
+ id: "12345",
1345
+ downstreamId: "12345",
1346
+ poNumber: "90000117",
1347
+ reference: "123456",
1348
+ supplier: {
1349
+ id: "12345",
1350
+ displayId: "SUPP00101",
1351
+ displayName: "Windsurf Shop",
1352
+ companyName: "The boring company",
1353
+ address: {
1354
+ id: "123",
1355
+ type: "primary",
1356
+ string: "25 Spring Street, Blackburn, VIC 3130",
1357
+ name: "HQ US",
1358
+ line1: "Main street",
1359
+ line2: "apt #",
1360
+ line3: "Suite #",
1361
+ line4: "delivery instructions",
1362
+ streetNumber: "25",
1363
+ city: "San Francisco",
1364
+ state: "CA",
1365
+ postalCode: "94104",
1366
+ country: "US",
1367
+ latitude: "40.759211",
1368
+ longitude: "-73.984638",
1369
+ county: "Santa Clara",
1370
+ contactName: "Elon Musk",
1371
+ salutation: "Mr",
1372
+ phoneNumber: "111-111-1111",
1373
+ fax: "122-111-1111",
1374
+ email: "elon@musk.com",
1375
+ website: "https://elonmusk.com",
1376
+ notes: "Address notes or delivery instructions.",
1377
+ rowVersion: "1-12345",
1378
+ },
1379
+ },
1380
+ companyId: "12345",
1381
+ status: "open",
1382
+ issuedDate: new Date("2020-09-30"),
1383
+ deliveryDate: new Date("2020-09-30"),
1384
+ expectedArrivalDate: new Date("2020-09-30"),
1385
+ currency: "USD",
1386
+ currencyRate: 0.69,
1387
+ subTotal: 27500,
1388
+ totalTax: 2500,
1389
+ total: 27500,
1390
+ taxInclusive: true,
1391
+ lineItems: [
1392
+ {
1393
+ id: "12345",
1394
+ rowId: "12345",
1395
+ code: "120-C",
1396
+ lineNumber: 1,
1397
+ description:
1398
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
1399
+ type: "sales_item",
1400
+ taxAmount: 27500,
1401
+ totalAmount: 27500,
1402
+ quantity: 1,
1403
+ unitPrice: 27500.5,
1404
+ unitOfMeasure: "pc.",
1405
+ discountPercentage: 0.01,
1406
+ discountAmount: 19.99,
1407
+ locationId: "12345",
1408
+ departmentId: "12345",
1409
+ item: {
1410
+ id: "12344",
1411
+ code: "120-C",
1412
+ name: "Model Y",
1413
+ },
1414
+ taxRate: {
1415
+ id: "123456",
1416
+ code: "N-T",
1417
+ name: "GST on Purchases",
1418
+ rate: 10,
1419
+ },
1420
+ trackingCategories: [
1421
+ {
1422
+ id: "123456",
1423
+ name: "New York",
1424
+ },
1425
+ {
1426
+ id: "123456",
1427
+ name: "New York",
1428
+ },
1429
+ ],
1430
+ ledgerAccount: {
1431
+ id: "123456",
1432
+ name: "Bank account",
1433
+ nominalCode: "N091",
1434
+ code: "453",
1435
+ },
1436
+ customFields: [
1437
+ {
1438
+ id: "2389328923893298",
1439
+ name: "employee_level",
1440
+ description: "Employee Level",
1441
+ value: {},
1442
+ },
1443
+ {
1444
+ id: "2389328923893298",
1445
+ name: "employee_level",
1446
+ description: "Employee Level",
1447
+ value: {
1448
+ "0": {},
1449
+ },
1450
+ },
1451
+ ],
1452
+ rowVersion: "1-12345",
1453
+ updatedBy: "12345",
1454
+ createdBy: "12345",
1455
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
1456
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
1457
+ },
1458
+ {
1459
+ id: "12345",
1460
+ rowId: "12345",
1461
+ code: "120-C",
1462
+ lineNumber: 1,
1463
+ description:
1464
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
1465
+ type: "sales_item",
1466
+ taxAmount: 27500,
1467
+ totalAmount: 27500,
1468
+ quantity: 1,
1469
+ unitPrice: 27500.5,
1470
+ unitOfMeasure: "pc.",
1471
+ discountPercentage: 0.01,
1472
+ discountAmount: 19.99,
1473
+ locationId: "12345",
1474
+ departmentId: "12345",
1475
+ item: {
1476
+ id: "12344",
1477
+ code: "120-C",
1478
+ name: "Model Y",
1479
+ },
1480
+ taxRate: {
1481
+ id: "123456",
1482
+ code: "N-T",
1483
+ name: "GST on Purchases",
1484
+ rate: 10,
1485
+ },
1486
+ trackingCategories: [
1487
+ {
1488
+ id: "123456",
1489
+ name: "New York",
1490
+ },
1491
+ {
1492
+ id: "123456",
1493
+ name: "New York",
1494
+ },
1495
+ ],
1496
+ ledgerAccount: {
1497
+ id: "123456",
1498
+ name: "Bank account",
1499
+ nominalCode: "N091",
1500
+ code: "453",
1501
+ },
1502
+ customFields: [
1503
+ {
1504
+ id: "2389328923893298",
1505
+ name: "employee_level",
1506
+ description: "Employee Level",
1507
+ value: 10,
1508
+ },
1509
+ ],
1510
+ rowVersion: "1-12345",
1511
+ updatedBy: "12345",
1512
+ createdBy: "12345",
1513
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
1514
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
1515
+ },
1516
+ {
1517
+ id: "12345",
1518
+ rowId: "12345",
1519
+ code: "120-C",
1520
+ lineNumber: 1,
1521
+ description:
1522
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
1523
+ type: "sales_item",
1524
+ taxAmount: 27500,
1525
+ totalAmount: 27500,
1526
+ quantity: 1,
1527
+ unitPrice: 27500.5,
1528
+ unitOfMeasure: "pc.",
1529
+ discountPercentage: 0.01,
1530
+ discountAmount: 19.99,
1531
+ locationId: "12345",
1532
+ departmentId: "12345",
1533
+ item: {
1534
+ id: "12344",
1535
+ code: "120-C",
1536
+ name: "Model Y",
1537
+ },
1538
+ taxRate: {
1539
+ id: "123456",
1540
+ code: "N-T",
1541
+ name: "GST on Purchases",
1542
+ rate: 10,
1543
+ },
1544
+ trackingCategories: [
1545
+ {
1546
+ id: "123456",
1547
+ name: "New York",
1548
+ },
1549
+ {
1550
+ id: "123456",
1551
+ name: "New York",
1552
+ },
1553
+ {
1554
+ id: "123456",
1555
+ name: "New York",
1556
+ },
1557
+ ],
1558
+ ledgerAccount: {
1559
+ id: "123456",
1560
+ name: "Bank account",
1561
+ nominalCode: "N091",
1562
+ code: "453",
1563
+ },
1564
+ customFields: [
1565
+ {
1566
+ id: "2389328923893298",
1567
+ name: "employee_level",
1568
+ description: "Employee Level",
1569
+ value: {},
1570
+ },
1571
+ {
1572
+ id: "2389328923893298",
1573
+ name: "employee_level",
1574
+ description: "Employee Level",
1575
+ value: 10,
1576
+ },
1577
+ ],
1578
+ rowVersion: "1-12345",
1579
+ updatedBy: "12345",
1580
+ createdBy: "12345",
1581
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
1582
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
1583
+ },
1584
+ ],
1585
+ shippingAddress: {
1586
+ id: "123",
1587
+ type: "primary",
1588
+ string: "25 Spring Street, Blackburn, VIC 3130",
1589
+ name: "HQ US",
1590
+ line1: "Main street",
1591
+ line2: "apt #",
1592
+ line3: "Suite #",
1593
+ line4: "delivery instructions",
1594
+ streetNumber: "25",
1595
+ city: "San Francisco",
1596
+ state: "CA",
1597
+ postalCode: "94104",
1598
+ country: "US",
1599
+ latitude: "40.759211",
1600
+ longitude: "-73.984638",
1601
+ county: "Santa Clara",
1602
+ contactName: "Elon Musk",
1603
+ salutation: "Mr",
1604
+ phoneNumber: "111-111-1111",
1605
+ fax: "122-111-1111",
1606
+ email: "elon@musk.com",
1607
+ website: "https://elonmusk.com",
1608
+ notes: "Address notes or delivery instructions.",
1609
+ rowVersion: "1-12345",
1610
+ },
1611
+ ledgerAccount: {
1612
+ id: "123456",
1613
+ name: "Bank account",
1614
+ nominalCode: "N091",
1615
+ code: "453",
1616
+ },
1617
+ templateId: "123456",
1618
+ discountPercentage: 5.5,
1619
+ bankAccount: {
1620
+ bankName: "Monzo",
1621
+ accountNumber: "123465",
1622
+ accountName: "SPACEX LLC",
1623
+ accountType: "credit_card",
1624
+ iban: "CH2989144532982975332",
1625
+ bic: "AUDSCHGGXXX",
1626
+ routingNumber: "012345678",
1627
+ bsbNumber: "062-001",
1628
+ branchIdentifier: "001",
1629
+ bankCode: "BNH",
1630
+ currency: "USD",
1631
+ },
1632
+ accountingByRow: false,
1633
+ dueDate: new Date("2020-10-30"),
1634
+ paymentMethod: "cash",
1635
+ taxCode: "1234",
1636
+ channel: "email",
1637
+ memo: "Thank you for the partnership and have a great day!",
1638
+ trackingCategories: [
1639
+ {
1640
+ id: "123456",
1641
+ name: "New York",
1642
+ },
1643
+ ],
1644
+ customFields: [
1645
+ {
1646
+ id: "2389328923893298",
1647
+ name: "employee_level",
1648
+ description: "Employee Level",
1649
+ value: {},
1650
+ },
1651
+ ],
1652
+ rowVersion: "1-12345",
1653
+ updatedBy: "12345",
1654
+ createdBy: "12345",
1655
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
1656
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
1657
+ passThrough: [
1658
+ {
1659
+ serviceId: "<id>",
1660
+ extendPaths: [
1661
+ {
1662
+ path: "$.nested.property",
1663
+ value: {
1664
+ "TaxClassificationRef": {
1665
+ "value": "EUC-99990201-V1-00020000",
1666
+ },
1667
+ },
1668
+ },
1669
+ {
1670
+ path: "$.nested.property",
1671
+ value: {
1672
+ "TaxClassificationRef": {
1673
+ "value": "EUC-99990201-V1-00020000",
1674
+ },
1675
+ },
1676
+ },
1677
+ ],
1678
+ },
1679
+ {
1680
+ serviceId: "<id>",
1681
+ extendPaths: [
1682
+ {
1683
+ path: "$.nested.property",
1684
+ value: {
1685
+ "TaxClassificationRef": {
1686
+ "value": "EUC-99990201-V1-00020000",
1687
+ },
1688
+ },
1689
+ },
1690
+ {
1691
+ path: "$.nested.property",
1692
+ value: {
1693
+ "TaxClassificationRef": {
1694
+ "value": "EUC-99990201-V1-00020000",
1695
+ },
1696
+ },
1697
+ },
1698
+ {
1699
+ path: "$.nested.property",
1700
+ value: {
1701
+ "TaxClassificationRef": {
1702
+ "value": "EUC-99990201-V1-00020000",
1703
+ },
1704
+ },
1705
+ },
1706
+ ],
1707
+ },
1708
+ {
1709
+ serviceId: "<id>",
1710
+ extendPaths: [
1711
+ {
1712
+ path: "$.nested.property",
1713
+ value: {
1714
+ "TaxClassificationRef": {
1715
+ "value": "EUC-99990201-V1-00020000",
1716
+ },
1717
+ },
1718
+ },
1719
+ {
1720
+ path: "$.nested.property",
1721
+ value: {
1722
+ "TaxClassificationRef": {
1723
+ "value": "EUC-99990201-V1-00020000",
1724
+ },
1725
+ },
1726
+ },
1727
+ ],
1728
+ },
1729
+ ],
1730
+ },
1731
+ });
1732
+ });
1733
+
1734
+ test("Purchaseorders Accounting Purchase Orders Update", async () => {
1735
+ const testHttpClient = createTestHTTPClient(
1736
+ "accounting.purchaseOrdersUpdate",
1737
+ );
1738
+
1739
+ const apideck = new Apideck({
1740
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1741
+ httpClient: testHttpClient,
1742
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
1743
+ });
1744
+
1745
+ const result = await apideck.accounting.purchaseOrders.update({
1746
+ id: "<id>",
1747
+ consumerId: "test-consumer",
1748
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
1749
+ serviceId: "salesforce",
1750
+ purchaseOrder: {
1751
+ poNumber: "90000117",
1752
+ reference: "123456",
1753
+ supplier: {
1754
+ id: "12345",
1755
+ displayName: "Windsurf Shop",
1756
+ address: {
1757
+ id: "123",
1758
+ type: "primary",
1759
+ string: "25 Spring Street, Blackburn, VIC 3130",
1760
+ name: "HQ US",
1761
+ line1: "Main street",
1762
+ line2: "apt #",
1763
+ line3: "Suite #",
1764
+ line4: "delivery instructions",
1765
+ streetNumber: "25",
1766
+ city: "San Francisco",
1767
+ state: "CA",
1768
+ postalCode: "94104",
1769
+ country: "US",
1770
+ latitude: "40.759211",
1771
+ longitude: "-73.984638",
1772
+ county: "Santa Clara",
1773
+ contactName: "Elon Musk",
1774
+ salutation: "Mr",
1775
+ phoneNumber: "111-111-1111",
1776
+ fax: "122-111-1111",
1777
+ email: "elon@musk.com",
1778
+ website: "https://elonmusk.com",
1779
+ notes: "Address notes or delivery instructions.",
1780
+ rowVersion: "1-12345",
1781
+ },
1782
+ },
1783
+ companyId: "12345",
1784
+ status: "open",
1785
+ issuedDate: new Date("2020-09-30"),
1786
+ deliveryDate: new Date("2020-09-30"),
1787
+ expectedArrivalDate: new Date("2020-09-30"),
1788
+ currency: "USD",
1789
+ currencyRate: 0.69,
1790
+ subTotal: 27500,
1791
+ totalTax: 2500,
1792
+ total: 27500,
1793
+ taxInclusive: true,
1794
+ lineItems: [
1795
+ {
1796
+ id: "12345",
1797
+ rowId: "12345",
1798
+ code: "120-C",
1799
+ lineNumber: 1,
1800
+ description:
1801
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
1802
+ type: "sales_item",
1803
+ taxAmount: 27500,
1804
+ totalAmount: 27500,
1805
+ quantity: 1,
1806
+ unitPrice: 27500.5,
1807
+ unitOfMeasure: "pc.",
1808
+ discountPercentage: 0.01,
1809
+ discountAmount: 19.99,
1810
+ locationId: "12345",
1811
+ departmentId: "12345",
1812
+ item: {
1813
+ id: "12344",
1814
+ code: "120-C",
1815
+ name: "Model Y",
1816
+ },
1817
+ taxRate: {
1818
+ id: "123456",
1819
+ rate: 10,
1820
+ },
1821
+ trackingCategories: [
1822
+ {
1823
+ id: "123456",
1824
+ name: "New York",
1825
+ },
1826
+ {
1827
+ id: "123456",
1828
+ name: "New York",
1829
+ },
1830
+ ],
1831
+ ledgerAccount: {
1832
+ id: "123456",
1833
+ nominalCode: "N091",
1834
+ code: "453",
1835
+ },
1836
+ customFields: [
1837
+ {
1838
+ id: "2389328923893298",
1839
+ name: "employee_level",
1840
+ description: "Employee Level",
1841
+ value: {
1842
+ "0": {},
1843
+ "1": {},
1844
+ },
1845
+ },
1846
+ {
1847
+ id: "2389328923893298",
1848
+ name: "employee_level",
1849
+ description: "Employee Level",
1850
+ value: true,
1851
+ },
1852
+ ],
1853
+ rowVersion: "1-12345",
1854
+ },
1855
+ {
1856
+ id: "12345",
1857
+ rowId: "12345",
1858
+ code: "120-C",
1859
+ lineNumber: 1,
1860
+ description:
1861
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
1862
+ type: "sales_item",
1863
+ taxAmount: 27500,
1864
+ totalAmount: 27500,
1865
+ quantity: 1,
1866
+ unitPrice: 27500.5,
1867
+ unitOfMeasure: "pc.",
1868
+ discountPercentage: 0.01,
1869
+ discountAmount: 19.99,
1870
+ locationId: "12345",
1871
+ departmentId: "12345",
1872
+ item: {
1873
+ id: "12344",
1874
+ code: "120-C",
1875
+ name: "Model Y",
1876
+ },
1877
+ taxRate: {
1878
+ id: "123456",
1879
+ rate: 10,
1880
+ },
1881
+ trackingCategories: [
1882
+ {
1883
+ id: "123456",
1884
+ name: "New York",
1885
+ },
1886
+ {
1887
+ id: "123456",
1888
+ name: "New York",
1889
+ },
1890
+ {
1891
+ id: "123456",
1892
+ name: "New York",
1893
+ },
1894
+ ],
1895
+ ledgerAccount: {
1896
+ id: "123456",
1897
+ nominalCode: "N091",
1898
+ code: "453",
1899
+ },
1900
+ customFields: [
1901
+ {
1902
+ id: "2389328923893298",
1903
+ name: "employee_level",
1904
+ description: "Employee Level",
1905
+ value: {
1906
+ "0": {},
1907
+ },
1908
+ },
1909
+ ],
1910
+ rowVersion: "1-12345",
1911
+ },
1912
+ {
1913
+ id: "12345",
1914
+ rowId: "12345",
1915
+ code: "120-C",
1916
+ lineNumber: 1,
1917
+ description:
1918
+ "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
1919
+ type: "sales_item",
1920
+ taxAmount: 27500,
1921
+ totalAmount: 27500,
1922
+ quantity: 1,
1923
+ unitPrice: 27500.5,
1924
+ unitOfMeasure: "pc.",
1925
+ discountPercentage: 0.01,
1926
+ discountAmount: 19.99,
1927
+ locationId: "12345",
1928
+ departmentId: "12345",
1929
+ item: {
1930
+ id: "12344",
1931
+ code: "120-C",
1932
+ name: "Model Y",
1933
+ },
1934
+ taxRate: {
1935
+ id: "123456",
1936
+ rate: 10,
1937
+ },
1938
+ trackingCategories: [
1939
+ {
1940
+ id: "123456",
1941
+ name: "New York",
1942
+ },
1943
+ ],
1944
+ ledgerAccount: {
1945
+ id: "123456",
1946
+ nominalCode: "N091",
1947
+ code: "453",
1948
+ },
1949
+ customFields: [
1950
+ {
1951
+ id: "2389328923893298",
1952
+ name: "employee_level",
1953
+ description: "Employee Level",
1954
+ value: "Uses Salesforce and Marketo",
1955
+ },
1956
+ ],
1957
+ rowVersion: "1-12345",
1958
+ },
1959
+ ],
1960
+ shippingAddress: {
1961
+ id: "123",
1962
+ type: "primary",
1963
+ string: "25 Spring Street, Blackburn, VIC 3130",
1964
+ name: "HQ US",
1965
+ line1: "Main street",
1966
+ line2: "apt #",
1967
+ line3: "Suite #",
1968
+ line4: "delivery instructions",
1969
+ streetNumber: "25",
1970
+ city: "San Francisco",
1971
+ state: "CA",
1972
+ postalCode: "94104",
1973
+ country: "US",
1974
+ latitude: "40.759211",
1975
+ longitude: "-73.984638",
1976
+ county: "Santa Clara",
1977
+ contactName: "Elon Musk",
1978
+ salutation: "Mr",
1979
+ phoneNumber: "111-111-1111",
1980
+ fax: "122-111-1111",
1981
+ email: "elon@musk.com",
1982
+ website: "https://elonmusk.com",
1983
+ notes: "Address notes or delivery instructions.",
1984
+ rowVersion: "1-12345",
1985
+ },
1986
+ ledgerAccount: {
1987
+ id: "123456",
1988
+ nominalCode: "N091",
1989
+ code: "453",
1990
+ },
1991
+ templateId: "123456",
1992
+ discountPercentage: 5.5,
1993
+ bankAccount: {
1994
+ bankName: "Monzo",
1995
+ accountNumber: "123465",
1996
+ accountName: "SPACEX LLC",
1997
+ accountType: "credit_card",
1998
+ iban: "CH2989144532982975332",
1999
+ bic: "AUDSCHGGXXX",
2000
+ routingNumber: "012345678",
2001
+ bsbNumber: "062-001",
2002
+ branchIdentifier: "001",
2003
+ bankCode: "BNH",
2004
+ currency: "USD",
2005
+ },
2006
+ accountingByRow: false,
2007
+ dueDate: new Date("2020-10-30"),
2008
+ paymentMethod: "cash",
2009
+ taxCode: "1234",
2010
+ channel: "email",
2011
+ memo: "Thank you for the partnership and have a great day!",
2012
+ trackingCategories: [
2013
+ {
2014
+ id: "123456",
2015
+ name: "New York",
2016
+ },
2017
+ {
2018
+ id: "123456",
2019
+ name: "New York",
2020
+ },
2021
+ {
2022
+ id: "123456",
2023
+ name: "New York",
2024
+ },
2025
+ ],
2026
+ customFields: [
2027
+ {
2028
+ id: "2389328923893298",
2029
+ name: "employee_level",
2030
+ description: "Employee Level",
2031
+ value: 10,
2032
+ },
2033
+ {
2034
+ id: "2389328923893298",
2035
+ name: "employee_level",
2036
+ description: "Employee Level",
2037
+ value: true,
2038
+ },
2039
+ {
2040
+ id: "2389328923893298",
2041
+ name: "employee_level",
2042
+ description: "Employee Level",
2043
+ value: {
2044
+ "0": "<value>",
2045
+ "1": "<value>",
2046
+ },
2047
+ },
2048
+ ],
2049
+ rowVersion: "1-12345",
2050
+ passThrough: [
2051
+ {
2052
+ serviceId: "<id>",
2053
+ extendPaths: [
2054
+ {
2055
+ path: "$.nested.property",
2056
+ value: {
2057
+ "TaxClassificationRef": {
2058
+ "value": "EUC-99990201-V1-00020000",
2059
+ },
2060
+ },
2061
+ },
2062
+ ],
2063
+ },
2064
+ {
2065
+ serviceId: "<id>",
2066
+ extendPaths: [
2067
+ {
2068
+ path: "$.nested.property",
2069
+ value: {
2070
+ "TaxClassificationRef": {
2071
+ "value": "EUC-99990201-V1-00020000",
2072
+ },
2073
+ },
2074
+ },
2075
+ {
2076
+ path: "$.nested.property",
2077
+ value: {
2078
+ "TaxClassificationRef": {
2079
+ "value": "EUC-99990201-V1-00020000",
2080
+ },
2081
+ },
2082
+ },
2083
+ {
2084
+ path: "$.nested.property",
2085
+ value: {
2086
+ "TaxClassificationRef": {
2087
+ "value": "EUC-99990201-V1-00020000",
2088
+ },
2089
+ },
2090
+ },
2091
+ ],
2092
+ },
2093
+ ],
2094
+ },
2095
+ });
2096
+ expect(result.httpMeta.response.status).toBe(200);
2097
+ expect(result.updatePurchaseOrderResponse).toBeDefined();
2098
+ expect(result.updatePurchaseOrderResponse).toEqual({
2099
+ statusCode: 200,
2100
+ status: "OK",
2101
+ service: "quickbooks",
2102
+ resource: "PurchaseOrders",
2103
+ operation: "update",
2104
+ data: {
2105
+ id: "12345",
2106
+ },
2107
+ });
2108
+ });
2109
+
2110
+ test("Purchaseorders Accounting Purchase Orders Delete", async () => {
2111
+ const testHttpClient = createTestHTTPClient(
2112
+ "accounting.purchaseOrdersDelete",
2113
+ );
2114
+
2115
+ const apideck = new Apideck({
2116
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
2117
+ httpClient: testHttpClient,
2118
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
2119
+ });
2120
+
2121
+ const result = await apideck.accounting.purchaseOrders.delete({
2122
+ id: "<id>",
2123
+ consumerId: "test-consumer",
2124
+ appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
2125
+ serviceId: "salesforce",
2126
+ });
2127
+ expect(result.httpMeta.response.status).toBe(200);
2128
+ expect(result.deletePurchaseOrderResponse).toBeDefined();
2129
+ expect(result.deletePurchaseOrderResponse).toEqual({
2130
+ statusCode: 200,
2131
+ status: "OK",
2132
+ service: "quickbooks",
2133
+ resource: "PurchaseOrders",
2134
+ operation: "delete",
2135
+ data: {
2136
+ id: "12345",
2137
+ },
2138
+ });
2139
+ });