@apideck/unify 0.23.0 → 0.23.1
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.
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/note.d.ts +5 -0
- package/models/components/note.d.ts.map +1 -1
- package/models/components/note.js +4 -0
- package/models/components/note.js.map +1 -1
- package/models/components/noteinput.d.ts +5 -0
- package/models/components/noteinput.d.ts.map +1 -1
- package/models/components/noteinput.js +4 -0
- package/models/components/noteinput.js.map +1 -1
- package/package.json +5 -1
- package/src/__tests__/activities.test.ts +783 -0
- package/src/__tests__/agedcreditors.test.ts +279 -0
- package/src/__tests__/ageddebtors.test.ts +279 -0
- package/src/__tests__/apideckcompanies.test.ts +712 -0
- package/src/__tests__/apideckcustomers.test.ts +360 -0
- package/src/__tests__/apideckdepartments.test.ts +319 -0
- package/src/__tests__/apiresources.test.ts +61 -0
- package/src/__tests__/apis.test.ts +214 -0
- package/src/__tests__/applicants.test.ts +976 -0
- package/src/__tests__/applications.test.ts +329 -0
- package/src/__tests__/assertions.ts +13 -0
- package/src/__tests__/attachments.test.ts +363 -0
- package/src/__tests__/balancesheet.test.ts +451 -0
- package/src/__tests__/billpayments.test.ts +666 -0
- package/src/__tests__/bills.test.ts +1133 -0
- package/src/__tests__/collections.test.ts +115 -0
- package/src/__tests__/collectiontags.test.ts +66 -0
- package/src/__tests__/collectionticketcomments.test.ts +318 -0
- package/src/__tests__/collectiontickets.test.ts +436 -0
- package/src/__tests__/collectionusers.test.ts +122 -0
- package/src/__tests__/companies.test.ts +1059 -0
- package/src/__tests__/companyinfo.test.ts +218 -0
- package/src/__tests__/connectioncustommappings.test.ts +67 -0
- package/src/__tests__/connections.test.ts +1713 -0
- package/src/__tests__/connectionsettings.test.ts +280 -0
- package/src/__tests__/connectordocs.test.ts +28 -0
- package/src/__tests__/connectors.test.ts +751 -0
- package/src/__tests__/consumerrequestcounts.test.ts +41 -0
- package/src/__tests__/consumers.test.ts +517 -0
- package/src/__tests__/contacts.test.ts +957 -0
- package/src/__tests__/createcallback.test.ts +34 -0
- package/src/__tests__/creditnotes.test.ts +1362 -0
- package/src/__tests__/customers.test.ts +1089 -0
- package/src/__tests__/customfields.test.ts +50 -0
- package/src/__tests__/custommappings.test.ts +63 -0
- package/src/__tests__/departments.test.ts +359 -0
- package/src/__tests__/drivegroups.test.ts +318 -0
- package/src/__tests__/drives.test.ts +311 -0
- package/src/__tests__/employeepayrolls.test.ts +487 -0
- package/src/__tests__/employees.test.ts +1682 -0
- package/src/__tests__/employeeschedules.test.ts +456 -0
- package/src/__tests__/eventlogs.test.ts +157 -0
- package/src/__tests__/expenses.test.ts +566 -0
- package/src/__tests__/files.test.ts +392 -0
- package/src/__tests__/files.ts +56 -0
- package/src/__tests__/folders.test.ts +103 -0
- package/src/__tests__/invoiceitems.test.ts +586 -0
- package/src/__tests__/invoices.test.ts +1561 -0
- package/src/__tests__/jobs.test.ts +837 -0
- package/src/__tests__/journalentries.test.ts +1053 -0
- package/src/__tests__/leads.test.ts +897 -0
- package/src/__tests__/ledgeraccounts.test.ts +594 -0
- package/src/__tests__/locations.test.ts +561 -0
- package/src/__tests__/logs.test.ts +135 -0
- package/src/__tests__/messages.test.ts +396 -0
- package/src/__tests__/mockserver/README.md +52 -0
- package/src/__tests__/notes.test.ts +335 -0
- package/src/__tests__/opportunities.test.ts +503 -0
- package/src/__tests__/orders.test.ts +849 -0
- package/src/__tests__/payments.test.ts +557 -0
- package/src/__tests__/payrolls.test.ts +481 -0
- package/src/__tests__/pipelines.test.ts +383 -0
- package/src/__tests__/products.test.ts +505 -0
- package/src/__tests__/profitandloss.test.ts +221 -0
- package/src/__tests__/purchaseorders.test.ts +1464 -0
- package/src/__tests__/sessions.test.ts +70 -0
- package/src/__tests__/sharedlinks.test.ts +331 -0
- package/src/__tests__/stores.test.ts +39 -0
- package/src/__tests__/subsidiaries.test.ts +316 -0
- package/src/__tests__/suppliers.test.ts +1071 -0
- package/src/__tests__/taxrates.test.ts +472 -0
- package/src/__tests__/testclient.ts +48 -0
- package/src/__tests__/timeoffrequests.test.ts +381 -0
- package/src/__tests__/trackingcategories.test.ts +329 -0
- package/src/__tests__/uploadsessions.test.ts +142 -0
- package/src/__tests__/users.test.ts +667 -0
- package/src/__tests__/validateconnection.test.ts +32 -0
- package/src/__tests__/webhooks.test.ts +248 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/note.ts +9 -0
- package/src/models/components/noteinput.ts +9 -0
|
@@ -0,0 +1,1561 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { assert, expect, it, test } from "vitest";
|
|
6
|
+
import { Apideck } from "../index.js";
|
|
7
|
+
import { RFCDate } from "../types/index.js";
|
|
8
|
+
import { createTestHTTPClient } from "./testclient.js";
|
|
9
|
+
|
|
10
|
+
test("Invoices Accounting Invoices All", async () => {
|
|
11
|
+
const testHttpClient = createTestHTTPClient("accounting.invoicesAll");
|
|
12
|
+
|
|
13
|
+
const apideck = new Apideck({
|
|
14
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
15
|
+
httpClient: testHttpClient,
|
|
16
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const result = await apideck.accounting.invoices.list({
|
|
20
|
+
serviceId: "salesforce",
|
|
21
|
+
filter: {
|
|
22
|
+
updatedSince: new Date("2020-09-30T07:43:32.000Z"),
|
|
23
|
+
createdSince: new Date("2020-09-30T07:43:32.000Z"),
|
|
24
|
+
number: "OIT00546",
|
|
25
|
+
},
|
|
26
|
+
sort: {
|
|
27
|
+
by: "updated_at",
|
|
28
|
+
},
|
|
29
|
+
passThrough: {
|
|
30
|
+
"search": "San Francisco",
|
|
31
|
+
},
|
|
32
|
+
fields: "id,updated_at",
|
|
33
|
+
});
|
|
34
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
35
|
+
expect(result.getInvoicesResponse).toBeDefined();
|
|
36
|
+
expect(result.getInvoicesResponse).toEqual({
|
|
37
|
+
statusCode: 200,
|
|
38
|
+
status: "OK",
|
|
39
|
+
service: "xero",
|
|
40
|
+
resource: "invoices",
|
|
41
|
+
operation: "all",
|
|
42
|
+
data: [
|
|
43
|
+
{
|
|
44
|
+
id: "12345",
|
|
45
|
+
downstreamId: "12345",
|
|
46
|
+
type: "service",
|
|
47
|
+
number: "OIT00546",
|
|
48
|
+
customer: {
|
|
49
|
+
id: "12345",
|
|
50
|
+
displayId: "CUST00101",
|
|
51
|
+
displayName: "Windsurf Shop",
|
|
52
|
+
companyName: "The boring company",
|
|
53
|
+
email: "boring@boring.com",
|
|
54
|
+
},
|
|
55
|
+
companyId: "12345",
|
|
56
|
+
invoiceDate: new RFCDate("2020-09-30"),
|
|
57
|
+
dueDate: new RFCDate("2020-09-30"),
|
|
58
|
+
terms: "Net 30 days",
|
|
59
|
+
poNumber: "90000117",
|
|
60
|
+
reference: "123456",
|
|
61
|
+
status: "draft",
|
|
62
|
+
invoiceSent: true,
|
|
63
|
+
currency: "USD",
|
|
64
|
+
currencyRate: 0.69,
|
|
65
|
+
taxInclusive: true,
|
|
66
|
+
subTotal: 27500,
|
|
67
|
+
totalTax: 2500,
|
|
68
|
+
taxCode: "1234",
|
|
69
|
+
discountPercentage: 5.5,
|
|
70
|
+
discountAmount: 25,
|
|
71
|
+
total: 27500,
|
|
72
|
+
balance: 27500,
|
|
73
|
+
deposit: 0,
|
|
74
|
+
customerMemo: "Thank you for your business and have a great day!",
|
|
75
|
+
trackingCategories: [
|
|
76
|
+
{
|
|
77
|
+
id: "123456",
|
|
78
|
+
name: "New York",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "123456",
|
|
82
|
+
name: "New York",
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
lineItems: [
|
|
86
|
+
{
|
|
87
|
+
id: "12345",
|
|
88
|
+
rowId: "12345",
|
|
89
|
+
code: "120-C",
|
|
90
|
+
lineNumber: 1,
|
|
91
|
+
description:
|
|
92
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
93
|
+
type: "sales_item",
|
|
94
|
+
taxAmount: 27500,
|
|
95
|
+
totalAmount: 27500,
|
|
96
|
+
quantity: 1,
|
|
97
|
+
unitPrice: 27500.5,
|
|
98
|
+
unitOfMeasure: "pc.",
|
|
99
|
+
discountPercentage: 0.01,
|
|
100
|
+
discountAmount: 19.99,
|
|
101
|
+
locationId: "12345",
|
|
102
|
+
departmentId: "12345",
|
|
103
|
+
item: {
|
|
104
|
+
id: "12344",
|
|
105
|
+
code: "120-C",
|
|
106
|
+
name: "Model Y",
|
|
107
|
+
},
|
|
108
|
+
taxRate: {
|
|
109
|
+
id: "123456",
|
|
110
|
+
code: "N-T",
|
|
111
|
+
name: "GST on Purchases",
|
|
112
|
+
rate: 10,
|
|
113
|
+
},
|
|
114
|
+
trackingCategories: [
|
|
115
|
+
{
|
|
116
|
+
id: "123456",
|
|
117
|
+
name: "New York",
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
ledgerAccount: {
|
|
121
|
+
id: "123456",
|
|
122
|
+
name: "Bank account",
|
|
123
|
+
nominalCode: "N091",
|
|
124
|
+
code: "453",
|
|
125
|
+
},
|
|
126
|
+
customFields: [
|
|
127
|
+
{
|
|
128
|
+
id: "2389328923893298",
|
|
129
|
+
name: "employee_level",
|
|
130
|
+
description: "Employee Level",
|
|
131
|
+
value: "Uses Salesforce and Marketo",
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
rowVersion: "1-12345",
|
|
135
|
+
updatedBy: "12345",
|
|
136
|
+
createdBy: "12345",
|
|
137
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
138
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "12345",
|
|
142
|
+
rowId: "12345",
|
|
143
|
+
code: "120-C",
|
|
144
|
+
lineNumber: 1,
|
|
145
|
+
description:
|
|
146
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
147
|
+
type: "sales_item",
|
|
148
|
+
taxAmount: 27500,
|
|
149
|
+
totalAmount: 27500,
|
|
150
|
+
quantity: 1,
|
|
151
|
+
unitPrice: 27500.5,
|
|
152
|
+
unitOfMeasure: "pc.",
|
|
153
|
+
discountPercentage: 0.01,
|
|
154
|
+
discountAmount: 19.99,
|
|
155
|
+
locationId: "12345",
|
|
156
|
+
departmentId: "12345",
|
|
157
|
+
item: {
|
|
158
|
+
id: "12344",
|
|
159
|
+
code: "120-C",
|
|
160
|
+
name: "Model Y",
|
|
161
|
+
},
|
|
162
|
+
taxRate: {
|
|
163
|
+
id: "123456",
|
|
164
|
+
code: "N-T",
|
|
165
|
+
name: "GST on Purchases",
|
|
166
|
+
rate: 10,
|
|
167
|
+
},
|
|
168
|
+
trackingCategories: [
|
|
169
|
+
{
|
|
170
|
+
id: "123456",
|
|
171
|
+
name: "New York",
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: "123456",
|
|
175
|
+
name: "New York",
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
ledgerAccount: {
|
|
179
|
+
id: "123456",
|
|
180
|
+
name: "Bank account",
|
|
181
|
+
nominalCode: "N091",
|
|
182
|
+
code: "453",
|
|
183
|
+
},
|
|
184
|
+
customFields: [
|
|
185
|
+
{
|
|
186
|
+
id: "2389328923893298",
|
|
187
|
+
name: "employee_level",
|
|
188
|
+
description: "Employee Level",
|
|
189
|
+
value: "Uses Salesforce and Marketo",
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: "2389328923893298",
|
|
193
|
+
name: "employee_level",
|
|
194
|
+
description: "Employee Level",
|
|
195
|
+
value: {},
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
rowVersion: "1-12345",
|
|
199
|
+
updatedBy: "12345",
|
|
200
|
+
createdBy: "12345",
|
|
201
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
202
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: "12345",
|
|
206
|
+
rowId: "12345",
|
|
207
|
+
code: "120-C",
|
|
208
|
+
lineNumber: 1,
|
|
209
|
+
description:
|
|
210
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
211
|
+
type: "sales_item",
|
|
212
|
+
taxAmount: 27500,
|
|
213
|
+
totalAmount: 27500,
|
|
214
|
+
quantity: 1,
|
|
215
|
+
unitPrice: 27500.5,
|
|
216
|
+
unitOfMeasure: "pc.",
|
|
217
|
+
discountPercentage: 0.01,
|
|
218
|
+
discountAmount: 19.99,
|
|
219
|
+
locationId: "12345",
|
|
220
|
+
departmentId: "12345",
|
|
221
|
+
item: {
|
|
222
|
+
id: "12344",
|
|
223
|
+
code: "120-C",
|
|
224
|
+
name: "Model Y",
|
|
225
|
+
},
|
|
226
|
+
taxRate: {
|
|
227
|
+
id: "123456",
|
|
228
|
+
code: "N-T",
|
|
229
|
+
name: "GST on Purchases",
|
|
230
|
+
rate: 10,
|
|
231
|
+
},
|
|
232
|
+
trackingCategories: [
|
|
233
|
+
{
|
|
234
|
+
id: "123456",
|
|
235
|
+
name: "New York",
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
ledgerAccount: {
|
|
239
|
+
id: "123456",
|
|
240
|
+
name: "Bank account",
|
|
241
|
+
nominalCode: "N091",
|
|
242
|
+
code: "453",
|
|
243
|
+
},
|
|
244
|
+
customFields: [
|
|
245
|
+
{
|
|
246
|
+
id: "2389328923893298",
|
|
247
|
+
name: "employee_level",
|
|
248
|
+
description: "Employee Level",
|
|
249
|
+
value: {},
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
id: "2389328923893298",
|
|
253
|
+
name: "employee_level",
|
|
254
|
+
description: "Employee Level",
|
|
255
|
+
value: {},
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
id: "2389328923893298",
|
|
259
|
+
name: "employee_level",
|
|
260
|
+
description: "Employee Level",
|
|
261
|
+
value: "Uses Salesforce and Marketo",
|
|
262
|
+
},
|
|
263
|
+
],
|
|
264
|
+
rowVersion: "1-12345",
|
|
265
|
+
updatedBy: "12345",
|
|
266
|
+
createdBy: "12345",
|
|
267
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
268
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
billingAddress: {
|
|
272
|
+
id: "123",
|
|
273
|
+
type: "primary",
|
|
274
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
275
|
+
name: "HQ US",
|
|
276
|
+
line1: "Main street",
|
|
277
|
+
line2: "apt #",
|
|
278
|
+
line3: "Suite #",
|
|
279
|
+
line4: "delivery instructions",
|
|
280
|
+
streetNumber: "25",
|
|
281
|
+
city: "San Francisco",
|
|
282
|
+
state: "CA",
|
|
283
|
+
postalCode: "94104",
|
|
284
|
+
country: "US",
|
|
285
|
+
latitude: "40.759211",
|
|
286
|
+
longitude: "-73.984638",
|
|
287
|
+
county: "Santa Clara",
|
|
288
|
+
contactName: "Elon Musk",
|
|
289
|
+
salutation: "Mr",
|
|
290
|
+
phoneNumber: "111-111-1111",
|
|
291
|
+
fax: "122-111-1111",
|
|
292
|
+
email: "elon@musk.com",
|
|
293
|
+
website: "https://elonmusk.com",
|
|
294
|
+
notes: "Address notes or delivery instructions.",
|
|
295
|
+
rowVersion: "1-12345",
|
|
296
|
+
},
|
|
297
|
+
shippingAddress: {
|
|
298
|
+
id: "123",
|
|
299
|
+
type: "primary",
|
|
300
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
301
|
+
name: "HQ US",
|
|
302
|
+
line1: "Main street",
|
|
303
|
+
line2: "apt #",
|
|
304
|
+
line3: "Suite #",
|
|
305
|
+
line4: "delivery instructions",
|
|
306
|
+
streetNumber: "25",
|
|
307
|
+
city: "San Francisco",
|
|
308
|
+
state: "CA",
|
|
309
|
+
postalCode: "94104",
|
|
310
|
+
country: "US",
|
|
311
|
+
latitude: "40.759211",
|
|
312
|
+
longitude: "-73.984638",
|
|
313
|
+
county: "Santa Clara",
|
|
314
|
+
contactName: "Elon Musk",
|
|
315
|
+
salutation: "Mr",
|
|
316
|
+
phoneNumber: "111-111-1111",
|
|
317
|
+
fax: "122-111-1111",
|
|
318
|
+
email: "elon@musk.com",
|
|
319
|
+
website: "https://elonmusk.com",
|
|
320
|
+
notes: "Address notes or delivery instructions.",
|
|
321
|
+
rowVersion: "1-12345",
|
|
322
|
+
},
|
|
323
|
+
templateId: "123456",
|
|
324
|
+
sourceDocumentUrl: "https://www.invoicesolution.com/invoice/123456",
|
|
325
|
+
paymentMethod: "cash",
|
|
326
|
+
channel: "email",
|
|
327
|
+
language: "EN",
|
|
328
|
+
accountingByRow: false,
|
|
329
|
+
bankAccount: {
|
|
330
|
+
bankName: "Monzo",
|
|
331
|
+
accountNumber: "123465",
|
|
332
|
+
accountName: "SPACEX LLC",
|
|
333
|
+
accountType: "credit_card",
|
|
334
|
+
iban: "CH2989144532982975332",
|
|
335
|
+
bic: "AUDSCHGGXXX",
|
|
336
|
+
routingNumber: "012345678",
|
|
337
|
+
bsbNumber: "062-001",
|
|
338
|
+
branchIdentifier: "001",
|
|
339
|
+
bankCode: "BNH",
|
|
340
|
+
currency: "USD",
|
|
341
|
+
},
|
|
342
|
+
ledgerAccount: {
|
|
343
|
+
id: "123456",
|
|
344
|
+
name: "Bank account",
|
|
345
|
+
nominalCode: "N091",
|
|
346
|
+
code: "453",
|
|
347
|
+
},
|
|
348
|
+
customFields: [
|
|
349
|
+
{
|
|
350
|
+
id: "2389328923893298",
|
|
351
|
+
name: "employee_level",
|
|
352
|
+
description: "Employee Level",
|
|
353
|
+
value: true,
|
|
354
|
+
},
|
|
355
|
+
],
|
|
356
|
+
rowVersion: "1-12345",
|
|
357
|
+
updatedBy: "12345",
|
|
358
|
+
createdBy: "12345",
|
|
359
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
360
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
361
|
+
passThrough: [
|
|
362
|
+
{
|
|
363
|
+
serviceId: "<id>",
|
|
364
|
+
extendPaths: [
|
|
365
|
+
{
|
|
366
|
+
path: "$.nested.property",
|
|
367
|
+
value: {
|
|
368
|
+
"TaxClassificationRef": {
|
|
369
|
+
"value": "EUC-99990201-V1-00020000",
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
],
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
serviceId: "<id>",
|
|
377
|
+
extendPaths: [
|
|
378
|
+
{
|
|
379
|
+
path: "$.nested.property",
|
|
380
|
+
value: {
|
|
381
|
+
"TaxClassificationRef": {
|
|
382
|
+
"value": "EUC-99990201-V1-00020000",
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
path: "$.nested.property",
|
|
388
|
+
value: {
|
|
389
|
+
"TaxClassificationRef": {
|
|
390
|
+
"value": "EUC-99990201-V1-00020000",
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
path: "$.nested.property",
|
|
396
|
+
value: {
|
|
397
|
+
"TaxClassificationRef": {
|
|
398
|
+
"value": "EUC-99990201-V1-00020000",
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
],
|
|
403
|
+
},
|
|
404
|
+
],
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
id: "12345",
|
|
408
|
+
downstreamId: "12345",
|
|
409
|
+
type: "service",
|
|
410
|
+
number: "OIT00546",
|
|
411
|
+
customer: {
|
|
412
|
+
id: "12345",
|
|
413
|
+
displayId: "CUST00101",
|
|
414
|
+
displayName: "Windsurf Shop",
|
|
415
|
+
companyName: "The boring company",
|
|
416
|
+
email: "boring@boring.com",
|
|
417
|
+
},
|
|
418
|
+
companyId: "12345",
|
|
419
|
+
invoiceDate: new RFCDate("2020-09-30"),
|
|
420
|
+
dueDate: new RFCDate("2020-09-30"),
|
|
421
|
+
terms: "Net 30 days",
|
|
422
|
+
poNumber: "90000117",
|
|
423
|
+
reference: "123456",
|
|
424
|
+
status: "draft",
|
|
425
|
+
invoiceSent: true,
|
|
426
|
+
currency: "USD",
|
|
427
|
+
currencyRate: 0.69,
|
|
428
|
+
taxInclusive: true,
|
|
429
|
+
subTotal: 27500,
|
|
430
|
+
totalTax: 2500,
|
|
431
|
+
taxCode: "1234",
|
|
432
|
+
discountPercentage: 5.5,
|
|
433
|
+
discountAmount: 25,
|
|
434
|
+
total: 27500,
|
|
435
|
+
balance: 27500,
|
|
436
|
+
deposit: 0,
|
|
437
|
+
customerMemo: "Thank you for your business and have a great day!",
|
|
438
|
+
trackingCategories: [
|
|
439
|
+
{
|
|
440
|
+
id: "123456",
|
|
441
|
+
name: "New York",
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
id: "123456",
|
|
445
|
+
name: "New York",
|
|
446
|
+
},
|
|
447
|
+
],
|
|
448
|
+
lineItems: [
|
|
449
|
+
{
|
|
450
|
+
id: "12345",
|
|
451
|
+
rowId: "12345",
|
|
452
|
+
code: "120-C",
|
|
453
|
+
lineNumber: 1,
|
|
454
|
+
description:
|
|
455
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
456
|
+
type: "sales_item",
|
|
457
|
+
taxAmount: 27500,
|
|
458
|
+
totalAmount: 27500,
|
|
459
|
+
quantity: 1,
|
|
460
|
+
unitPrice: 27500.5,
|
|
461
|
+
unitOfMeasure: "pc.",
|
|
462
|
+
discountPercentage: 0.01,
|
|
463
|
+
discountAmount: 19.99,
|
|
464
|
+
locationId: "12345",
|
|
465
|
+
departmentId: "12345",
|
|
466
|
+
item: {
|
|
467
|
+
id: "12344",
|
|
468
|
+
code: "120-C",
|
|
469
|
+
name: "Model Y",
|
|
470
|
+
},
|
|
471
|
+
taxRate: {
|
|
472
|
+
id: "123456",
|
|
473
|
+
code: "N-T",
|
|
474
|
+
name: "GST on Purchases",
|
|
475
|
+
rate: 10,
|
|
476
|
+
},
|
|
477
|
+
trackingCategories: [
|
|
478
|
+
{
|
|
479
|
+
id: "123456",
|
|
480
|
+
name: "New York",
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
id: "123456",
|
|
484
|
+
name: "New York",
|
|
485
|
+
},
|
|
486
|
+
],
|
|
487
|
+
ledgerAccount: {
|
|
488
|
+
id: "123456",
|
|
489
|
+
name: "Bank account",
|
|
490
|
+
nominalCode: "N091",
|
|
491
|
+
code: "453",
|
|
492
|
+
},
|
|
493
|
+
customFields: [
|
|
494
|
+
{
|
|
495
|
+
id: "2389328923893298",
|
|
496
|
+
name: "employee_level",
|
|
497
|
+
description: "Employee Level",
|
|
498
|
+
value: 10,
|
|
499
|
+
},
|
|
500
|
+
],
|
|
501
|
+
rowVersion: "1-12345",
|
|
502
|
+
updatedBy: "12345",
|
|
503
|
+
createdBy: "12345",
|
|
504
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
505
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
id: "12345",
|
|
509
|
+
rowId: "12345",
|
|
510
|
+
code: "120-C",
|
|
511
|
+
lineNumber: 1,
|
|
512
|
+
description:
|
|
513
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
514
|
+
type: "sales_item",
|
|
515
|
+
taxAmount: 27500,
|
|
516
|
+
totalAmount: 27500,
|
|
517
|
+
quantity: 1,
|
|
518
|
+
unitPrice: 27500.5,
|
|
519
|
+
unitOfMeasure: "pc.",
|
|
520
|
+
discountPercentage: 0.01,
|
|
521
|
+
discountAmount: 19.99,
|
|
522
|
+
locationId: "12345",
|
|
523
|
+
departmentId: "12345",
|
|
524
|
+
item: {
|
|
525
|
+
id: "12344",
|
|
526
|
+
code: "120-C",
|
|
527
|
+
name: "Model Y",
|
|
528
|
+
},
|
|
529
|
+
taxRate: {
|
|
530
|
+
id: "123456",
|
|
531
|
+
code: "N-T",
|
|
532
|
+
name: "GST on Purchases",
|
|
533
|
+
rate: 10,
|
|
534
|
+
},
|
|
535
|
+
trackingCategories: [
|
|
536
|
+
{
|
|
537
|
+
id: "123456",
|
|
538
|
+
name: "New York",
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
id: "123456",
|
|
542
|
+
name: "New York",
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
id: "123456",
|
|
546
|
+
name: "New York",
|
|
547
|
+
},
|
|
548
|
+
],
|
|
549
|
+
ledgerAccount: {
|
|
550
|
+
id: "123456",
|
|
551
|
+
name: "Bank account",
|
|
552
|
+
nominalCode: "N091",
|
|
553
|
+
code: "453",
|
|
554
|
+
},
|
|
555
|
+
customFields: [
|
|
556
|
+
{
|
|
557
|
+
id: "2389328923893298",
|
|
558
|
+
name: "employee_level",
|
|
559
|
+
description: "Employee Level",
|
|
560
|
+
value: [
|
|
561
|
+
{},
|
|
562
|
+
],
|
|
563
|
+
},
|
|
564
|
+
],
|
|
565
|
+
rowVersion: "1-12345",
|
|
566
|
+
updatedBy: "12345",
|
|
567
|
+
createdBy: "12345",
|
|
568
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
569
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
id: "12345",
|
|
573
|
+
rowId: "12345",
|
|
574
|
+
code: "120-C",
|
|
575
|
+
lineNumber: 1,
|
|
576
|
+
description:
|
|
577
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
578
|
+
type: "sales_item",
|
|
579
|
+
taxAmount: 27500,
|
|
580
|
+
totalAmount: 27500,
|
|
581
|
+
quantity: 1,
|
|
582
|
+
unitPrice: 27500.5,
|
|
583
|
+
unitOfMeasure: "pc.",
|
|
584
|
+
discountPercentage: 0.01,
|
|
585
|
+
discountAmount: 19.99,
|
|
586
|
+
locationId: "12345",
|
|
587
|
+
departmentId: "12345",
|
|
588
|
+
item: {
|
|
589
|
+
id: "12344",
|
|
590
|
+
code: "120-C",
|
|
591
|
+
name: "Model Y",
|
|
592
|
+
},
|
|
593
|
+
taxRate: {
|
|
594
|
+
id: "123456",
|
|
595
|
+
code: "N-T",
|
|
596
|
+
name: "GST on Purchases",
|
|
597
|
+
rate: 10,
|
|
598
|
+
},
|
|
599
|
+
trackingCategories: [
|
|
600
|
+
{
|
|
601
|
+
id: "123456",
|
|
602
|
+
name: "New York",
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
id: "123456",
|
|
606
|
+
name: "New York",
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
id: "123456",
|
|
610
|
+
name: "New York",
|
|
611
|
+
},
|
|
612
|
+
],
|
|
613
|
+
ledgerAccount: {
|
|
614
|
+
id: "123456",
|
|
615
|
+
name: "Bank account",
|
|
616
|
+
nominalCode: "N091",
|
|
617
|
+
code: "453",
|
|
618
|
+
},
|
|
619
|
+
customFields: [
|
|
620
|
+
{
|
|
621
|
+
id: "2389328923893298",
|
|
622
|
+
name: "employee_level",
|
|
623
|
+
description: "Employee Level",
|
|
624
|
+
value: "Uses Salesforce and Marketo",
|
|
625
|
+
},
|
|
626
|
+
],
|
|
627
|
+
rowVersion: "1-12345",
|
|
628
|
+
updatedBy: "12345",
|
|
629
|
+
createdBy: "12345",
|
|
630
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
631
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
632
|
+
},
|
|
633
|
+
],
|
|
634
|
+
billingAddress: {
|
|
635
|
+
id: "123",
|
|
636
|
+
type: "primary",
|
|
637
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
638
|
+
name: "HQ US",
|
|
639
|
+
line1: "Main street",
|
|
640
|
+
line2: "apt #",
|
|
641
|
+
line3: "Suite #",
|
|
642
|
+
line4: "delivery instructions",
|
|
643
|
+
streetNumber: "25",
|
|
644
|
+
city: "San Francisco",
|
|
645
|
+
state: "CA",
|
|
646
|
+
postalCode: "94104",
|
|
647
|
+
country: "US",
|
|
648
|
+
latitude: "40.759211",
|
|
649
|
+
longitude: "-73.984638",
|
|
650
|
+
county: "Santa Clara",
|
|
651
|
+
contactName: "Elon Musk",
|
|
652
|
+
salutation: "Mr",
|
|
653
|
+
phoneNumber: "111-111-1111",
|
|
654
|
+
fax: "122-111-1111",
|
|
655
|
+
email: "elon@musk.com",
|
|
656
|
+
website: "https://elonmusk.com",
|
|
657
|
+
notes: "Address notes or delivery instructions.",
|
|
658
|
+
rowVersion: "1-12345",
|
|
659
|
+
},
|
|
660
|
+
shippingAddress: {
|
|
661
|
+
id: "123",
|
|
662
|
+
type: "primary",
|
|
663
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
664
|
+
name: "HQ US",
|
|
665
|
+
line1: "Main street",
|
|
666
|
+
line2: "apt #",
|
|
667
|
+
line3: "Suite #",
|
|
668
|
+
line4: "delivery instructions",
|
|
669
|
+
streetNumber: "25",
|
|
670
|
+
city: "San Francisco",
|
|
671
|
+
state: "CA",
|
|
672
|
+
postalCode: "94104",
|
|
673
|
+
country: "US",
|
|
674
|
+
latitude: "40.759211",
|
|
675
|
+
longitude: "-73.984638",
|
|
676
|
+
county: "Santa Clara",
|
|
677
|
+
contactName: "Elon Musk",
|
|
678
|
+
salutation: "Mr",
|
|
679
|
+
phoneNumber: "111-111-1111",
|
|
680
|
+
fax: "122-111-1111",
|
|
681
|
+
email: "elon@musk.com",
|
|
682
|
+
website: "https://elonmusk.com",
|
|
683
|
+
notes: "Address notes or delivery instructions.",
|
|
684
|
+
rowVersion: "1-12345",
|
|
685
|
+
},
|
|
686
|
+
templateId: "123456",
|
|
687
|
+
sourceDocumentUrl: "https://www.invoicesolution.com/invoice/123456",
|
|
688
|
+
paymentMethod: "cash",
|
|
689
|
+
channel: "email",
|
|
690
|
+
language: "EN",
|
|
691
|
+
accountingByRow: false,
|
|
692
|
+
bankAccount: {
|
|
693
|
+
bankName: "Monzo",
|
|
694
|
+
accountNumber: "123465",
|
|
695
|
+
accountName: "SPACEX LLC",
|
|
696
|
+
accountType: "credit_card",
|
|
697
|
+
iban: "CH2989144532982975332",
|
|
698
|
+
bic: "AUDSCHGGXXX",
|
|
699
|
+
routingNumber: "012345678",
|
|
700
|
+
bsbNumber: "062-001",
|
|
701
|
+
branchIdentifier: "001",
|
|
702
|
+
bankCode: "BNH",
|
|
703
|
+
currency: "USD",
|
|
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: "Uses Salesforce and Marketo",
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
id: "2389328923893298",
|
|
720
|
+
name: "employee_level",
|
|
721
|
+
description: "Employee Level",
|
|
722
|
+
value: true,
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
id: "2389328923893298",
|
|
726
|
+
name: "employee_level",
|
|
727
|
+
description: "Employee Level",
|
|
728
|
+
value: true,
|
|
729
|
+
},
|
|
730
|
+
],
|
|
731
|
+
rowVersion: "1-12345",
|
|
732
|
+
updatedBy: "12345",
|
|
733
|
+
createdBy: "12345",
|
|
734
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
735
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
736
|
+
passThrough: [
|
|
737
|
+
{
|
|
738
|
+
serviceId: "<id>",
|
|
739
|
+
extendPaths: [
|
|
740
|
+
{
|
|
741
|
+
path: "$.nested.property",
|
|
742
|
+
value: {
|
|
743
|
+
"TaxClassificationRef": {
|
|
744
|
+
"value": "EUC-99990201-V1-00020000",
|
|
745
|
+
},
|
|
746
|
+
},
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
path: "$.nested.property",
|
|
750
|
+
value: {
|
|
751
|
+
"TaxClassificationRef": {
|
|
752
|
+
"value": "EUC-99990201-V1-00020000",
|
|
753
|
+
},
|
|
754
|
+
},
|
|
755
|
+
},
|
|
756
|
+
],
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
serviceId: "<id>",
|
|
760
|
+
extendPaths: [
|
|
761
|
+
{
|
|
762
|
+
path: "$.nested.property",
|
|
763
|
+
value: {
|
|
764
|
+
"TaxClassificationRef": {
|
|
765
|
+
"value": "EUC-99990201-V1-00020000",
|
|
766
|
+
},
|
|
767
|
+
},
|
|
768
|
+
},
|
|
769
|
+
],
|
|
770
|
+
},
|
|
771
|
+
],
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
id: "12345",
|
|
775
|
+
downstreamId: "12345",
|
|
776
|
+
type: "service",
|
|
777
|
+
number: "OIT00546",
|
|
778
|
+
customer: {
|
|
779
|
+
id: "12345",
|
|
780
|
+
displayId: "CUST00101",
|
|
781
|
+
displayName: "Windsurf Shop",
|
|
782
|
+
companyName: "The boring company",
|
|
783
|
+
email: "boring@boring.com",
|
|
784
|
+
},
|
|
785
|
+
companyId: "12345",
|
|
786
|
+
invoiceDate: new RFCDate("2020-09-30"),
|
|
787
|
+
dueDate: new RFCDate("2020-09-30"),
|
|
788
|
+
terms: "Net 30 days",
|
|
789
|
+
poNumber: "90000117",
|
|
790
|
+
reference: "123456",
|
|
791
|
+
status: "draft",
|
|
792
|
+
invoiceSent: true,
|
|
793
|
+
currency: "USD",
|
|
794
|
+
currencyRate: 0.69,
|
|
795
|
+
taxInclusive: true,
|
|
796
|
+
subTotal: 27500,
|
|
797
|
+
totalTax: 2500,
|
|
798
|
+
taxCode: "1234",
|
|
799
|
+
discountPercentage: 5.5,
|
|
800
|
+
discountAmount: 25,
|
|
801
|
+
total: 27500,
|
|
802
|
+
balance: 27500,
|
|
803
|
+
deposit: 0,
|
|
804
|
+
customerMemo: "Thank you for your business and have a great day!",
|
|
805
|
+
trackingCategories: [
|
|
806
|
+
{
|
|
807
|
+
id: "123456",
|
|
808
|
+
name: "New York",
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
id: "123456",
|
|
812
|
+
name: "New York",
|
|
813
|
+
},
|
|
814
|
+
],
|
|
815
|
+
lineItems: [
|
|
816
|
+
{
|
|
817
|
+
id: "12345",
|
|
818
|
+
rowId: "12345",
|
|
819
|
+
code: "120-C",
|
|
820
|
+
lineNumber: 1,
|
|
821
|
+
description:
|
|
822
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
823
|
+
type: "sales_item",
|
|
824
|
+
taxAmount: 27500,
|
|
825
|
+
totalAmount: 27500,
|
|
826
|
+
quantity: 1,
|
|
827
|
+
unitPrice: 27500.5,
|
|
828
|
+
unitOfMeasure: "pc.",
|
|
829
|
+
discountPercentage: 0.01,
|
|
830
|
+
discountAmount: 19.99,
|
|
831
|
+
locationId: "12345",
|
|
832
|
+
departmentId: "12345",
|
|
833
|
+
item: {
|
|
834
|
+
id: "12344",
|
|
835
|
+
code: "120-C",
|
|
836
|
+
name: "Model Y",
|
|
837
|
+
},
|
|
838
|
+
taxRate: {
|
|
839
|
+
id: "123456",
|
|
840
|
+
code: "N-T",
|
|
841
|
+
name: "GST on Purchases",
|
|
842
|
+
rate: 10,
|
|
843
|
+
},
|
|
844
|
+
trackingCategories: [
|
|
845
|
+
{
|
|
846
|
+
id: "123456",
|
|
847
|
+
name: "New York",
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
id: "123456",
|
|
851
|
+
name: "New York",
|
|
852
|
+
},
|
|
853
|
+
],
|
|
854
|
+
ledgerAccount: {
|
|
855
|
+
id: "123456",
|
|
856
|
+
name: "Bank account",
|
|
857
|
+
nominalCode: "N091",
|
|
858
|
+
code: "453",
|
|
859
|
+
},
|
|
860
|
+
customFields: [
|
|
861
|
+
{
|
|
862
|
+
id: "2389328923893298",
|
|
863
|
+
name: "employee_level",
|
|
864
|
+
description: "Employee Level",
|
|
865
|
+
value: 10,
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
id: "2389328923893298",
|
|
869
|
+
name: "employee_level",
|
|
870
|
+
description: "Employee Level",
|
|
871
|
+
value: true,
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
id: "2389328923893298",
|
|
875
|
+
name: "employee_level",
|
|
876
|
+
description: "Employee Level",
|
|
877
|
+
value: "Uses Salesforce and Marketo",
|
|
878
|
+
},
|
|
879
|
+
],
|
|
880
|
+
rowVersion: "1-12345",
|
|
881
|
+
updatedBy: "12345",
|
|
882
|
+
createdBy: "12345",
|
|
883
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
884
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
id: "12345",
|
|
888
|
+
rowId: "12345",
|
|
889
|
+
code: "120-C",
|
|
890
|
+
lineNumber: 1,
|
|
891
|
+
description:
|
|
892
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
893
|
+
type: "sales_item",
|
|
894
|
+
taxAmount: 27500,
|
|
895
|
+
totalAmount: 27500,
|
|
896
|
+
quantity: 1,
|
|
897
|
+
unitPrice: 27500.5,
|
|
898
|
+
unitOfMeasure: "pc.",
|
|
899
|
+
discountPercentage: 0.01,
|
|
900
|
+
discountAmount: 19.99,
|
|
901
|
+
locationId: "12345",
|
|
902
|
+
departmentId: "12345",
|
|
903
|
+
item: {
|
|
904
|
+
id: "12344",
|
|
905
|
+
code: "120-C",
|
|
906
|
+
name: "Model Y",
|
|
907
|
+
},
|
|
908
|
+
taxRate: {
|
|
909
|
+
id: "123456",
|
|
910
|
+
code: "N-T",
|
|
911
|
+
name: "GST on Purchases",
|
|
912
|
+
rate: 10,
|
|
913
|
+
},
|
|
914
|
+
trackingCategories: [
|
|
915
|
+
{
|
|
916
|
+
id: "123456",
|
|
917
|
+
name: "New York",
|
|
918
|
+
},
|
|
919
|
+
],
|
|
920
|
+
ledgerAccount: {
|
|
921
|
+
id: "123456",
|
|
922
|
+
name: "Bank account",
|
|
923
|
+
nominalCode: "N091",
|
|
924
|
+
code: "453",
|
|
925
|
+
},
|
|
926
|
+
customFields: [
|
|
927
|
+
{
|
|
928
|
+
id: "2389328923893298",
|
|
929
|
+
name: "employee_level",
|
|
930
|
+
description: "Employee Level",
|
|
931
|
+
value: "Uses Salesforce and Marketo",
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
id: "2389328923893298",
|
|
935
|
+
name: "employee_level",
|
|
936
|
+
description: "Employee Level",
|
|
937
|
+
value: {},
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
id: "2389328923893298",
|
|
941
|
+
name: "employee_level",
|
|
942
|
+
description: "Employee Level",
|
|
943
|
+
value: [
|
|
944
|
+
{},
|
|
945
|
+
{},
|
|
946
|
+
{},
|
|
947
|
+
],
|
|
948
|
+
},
|
|
949
|
+
],
|
|
950
|
+
rowVersion: "1-12345",
|
|
951
|
+
updatedBy: "12345",
|
|
952
|
+
createdBy: "12345",
|
|
953
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
954
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
id: "12345",
|
|
958
|
+
rowId: "12345",
|
|
959
|
+
code: "120-C",
|
|
960
|
+
lineNumber: 1,
|
|
961
|
+
description:
|
|
962
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
963
|
+
type: "sales_item",
|
|
964
|
+
taxAmount: 27500,
|
|
965
|
+
totalAmount: 27500,
|
|
966
|
+
quantity: 1,
|
|
967
|
+
unitPrice: 27500.5,
|
|
968
|
+
unitOfMeasure: "pc.",
|
|
969
|
+
discountPercentage: 0.01,
|
|
970
|
+
discountAmount: 19.99,
|
|
971
|
+
locationId: "12345",
|
|
972
|
+
departmentId: "12345",
|
|
973
|
+
item: {
|
|
974
|
+
id: "12344",
|
|
975
|
+
code: "120-C",
|
|
976
|
+
name: "Model Y",
|
|
977
|
+
},
|
|
978
|
+
taxRate: {
|
|
979
|
+
id: "123456",
|
|
980
|
+
code: "N-T",
|
|
981
|
+
name: "GST on Purchases",
|
|
982
|
+
rate: 10,
|
|
983
|
+
},
|
|
984
|
+
trackingCategories: [
|
|
985
|
+
{
|
|
986
|
+
id: "123456",
|
|
987
|
+
name: "New York",
|
|
988
|
+
},
|
|
989
|
+
],
|
|
990
|
+
ledgerAccount: {
|
|
991
|
+
id: "123456",
|
|
992
|
+
name: "Bank account",
|
|
993
|
+
nominalCode: "N091",
|
|
994
|
+
code: "453",
|
|
995
|
+
},
|
|
996
|
+
customFields: [
|
|
997
|
+
{
|
|
998
|
+
id: "2389328923893298",
|
|
999
|
+
name: "employee_level",
|
|
1000
|
+
description: "Employee Level",
|
|
1001
|
+
value: {},
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
id: "2389328923893298",
|
|
1005
|
+
name: "employee_level",
|
|
1006
|
+
description: "Employee Level",
|
|
1007
|
+
value: [
|
|
1008
|
+
{},
|
|
1009
|
+
{},
|
|
1010
|
+
{},
|
|
1011
|
+
],
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
id: "2389328923893298",
|
|
1015
|
+
name: "employee_level",
|
|
1016
|
+
description: "Employee Level",
|
|
1017
|
+
value: {},
|
|
1018
|
+
},
|
|
1019
|
+
],
|
|
1020
|
+
rowVersion: "1-12345",
|
|
1021
|
+
updatedBy: "12345",
|
|
1022
|
+
createdBy: "12345",
|
|
1023
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1024
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1025
|
+
},
|
|
1026
|
+
],
|
|
1027
|
+
billingAddress: {
|
|
1028
|
+
id: "123",
|
|
1029
|
+
type: "primary",
|
|
1030
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
1031
|
+
name: "HQ US",
|
|
1032
|
+
line1: "Main street",
|
|
1033
|
+
line2: "apt #",
|
|
1034
|
+
line3: "Suite #",
|
|
1035
|
+
line4: "delivery instructions",
|
|
1036
|
+
streetNumber: "25",
|
|
1037
|
+
city: "San Francisco",
|
|
1038
|
+
state: "CA",
|
|
1039
|
+
postalCode: "94104",
|
|
1040
|
+
country: "US",
|
|
1041
|
+
latitude: "40.759211",
|
|
1042
|
+
longitude: "-73.984638",
|
|
1043
|
+
county: "Santa Clara",
|
|
1044
|
+
contactName: "Elon Musk",
|
|
1045
|
+
salutation: "Mr",
|
|
1046
|
+
phoneNumber: "111-111-1111",
|
|
1047
|
+
fax: "122-111-1111",
|
|
1048
|
+
email: "elon@musk.com",
|
|
1049
|
+
website: "https://elonmusk.com",
|
|
1050
|
+
notes: "Address notes or delivery instructions.",
|
|
1051
|
+
rowVersion: "1-12345",
|
|
1052
|
+
},
|
|
1053
|
+
shippingAddress: {
|
|
1054
|
+
id: "123",
|
|
1055
|
+
type: "primary",
|
|
1056
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
1057
|
+
name: "HQ US",
|
|
1058
|
+
line1: "Main street",
|
|
1059
|
+
line2: "apt #",
|
|
1060
|
+
line3: "Suite #",
|
|
1061
|
+
line4: "delivery instructions",
|
|
1062
|
+
streetNumber: "25",
|
|
1063
|
+
city: "San Francisco",
|
|
1064
|
+
state: "CA",
|
|
1065
|
+
postalCode: "94104",
|
|
1066
|
+
country: "US",
|
|
1067
|
+
latitude: "40.759211",
|
|
1068
|
+
longitude: "-73.984638",
|
|
1069
|
+
county: "Santa Clara",
|
|
1070
|
+
contactName: "Elon Musk",
|
|
1071
|
+
salutation: "Mr",
|
|
1072
|
+
phoneNumber: "111-111-1111",
|
|
1073
|
+
fax: "122-111-1111",
|
|
1074
|
+
email: "elon@musk.com",
|
|
1075
|
+
website: "https://elonmusk.com",
|
|
1076
|
+
notes: "Address notes or delivery instructions.",
|
|
1077
|
+
rowVersion: "1-12345",
|
|
1078
|
+
},
|
|
1079
|
+
templateId: "123456",
|
|
1080
|
+
sourceDocumentUrl: "https://www.invoicesolution.com/invoice/123456",
|
|
1081
|
+
paymentMethod: "cash",
|
|
1082
|
+
channel: "email",
|
|
1083
|
+
language: "EN",
|
|
1084
|
+
accountingByRow: false,
|
|
1085
|
+
bankAccount: {
|
|
1086
|
+
bankName: "Monzo",
|
|
1087
|
+
accountNumber: "123465",
|
|
1088
|
+
accountName: "SPACEX LLC",
|
|
1089
|
+
accountType: "credit_card",
|
|
1090
|
+
iban: "CH2989144532982975332",
|
|
1091
|
+
bic: "AUDSCHGGXXX",
|
|
1092
|
+
routingNumber: "012345678",
|
|
1093
|
+
bsbNumber: "062-001",
|
|
1094
|
+
branchIdentifier: "001",
|
|
1095
|
+
bankCode: "BNH",
|
|
1096
|
+
currency: "USD",
|
|
1097
|
+
},
|
|
1098
|
+
ledgerAccount: {
|
|
1099
|
+
id: "123456",
|
|
1100
|
+
name: "Bank account",
|
|
1101
|
+
nominalCode: "N091",
|
|
1102
|
+
code: "453",
|
|
1103
|
+
},
|
|
1104
|
+
customFields: [
|
|
1105
|
+
{
|
|
1106
|
+
id: "2389328923893298",
|
|
1107
|
+
name: "employee_level",
|
|
1108
|
+
description: "Employee Level",
|
|
1109
|
+
value: "Uses Salesforce and Marketo",
|
|
1110
|
+
},
|
|
1111
|
+
],
|
|
1112
|
+
rowVersion: "1-12345",
|
|
1113
|
+
updatedBy: "12345",
|
|
1114
|
+
createdBy: "12345",
|
|
1115
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1116
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1117
|
+
passThrough: [
|
|
1118
|
+
{
|
|
1119
|
+
serviceId: "<id>",
|
|
1120
|
+
extendPaths: [
|
|
1121
|
+
{
|
|
1122
|
+
path: "$.nested.property",
|
|
1123
|
+
value: {
|
|
1124
|
+
"TaxClassificationRef": {
|
|
1125
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1126
|
+
},
|
|
1127
|
+
},
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
path: "$.nested.property",
|
|
1131
|
+
value: {
|
|
1132
|
+
"TaxClassificationRef": {
|
|
1133
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1134
|
+
},
|
|
1135
|
+
},
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
path: "$.nested.property",
|
|
1139
|
+
value: {
|
|
1140
|
+
"TaxClassificationRef": {
|
|
1141
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1142
|
+
},
|
|
1143
|
+
},
|
|
1144
|
+
},
|
|
1145
|
+
],
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
serviceId: "<id>",
|
|
1149
|
+
extendPaths: [
|
|
1150
|
+
{
|
|
1151
|
+
path: "$.nested.property",
|
|
1152
|
+
value: {
|
|
1153
|
+
"TaxClassificationRef": {
|
|
1154
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1155
|
+
},
|
|
1156
|
+
},
|
|
1157
|
+
},
|
|
1158
|
+
],
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
serviceId: "<id>",
|
|
1162
|
+
extendPaths: [
|
|
1163
|
+
{
|
|
1164
|
+
path: "$.nested.property",
|
|
1165
|
+
value: {
|
|
1166
|
+
"TaxClassificationRef": {
|
|
1167
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1168
|
+
},
|
|
1169
|
+
},
|
|
1170
|
+
},
|
|
1171
|
+
{
|
|
1172
|
+
path: "$.nested.property",
|
|
1173
|
+
value: {
|
|
1174
|
+
"TaxClassificationRef": {
|
|
1175
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1176
|
+
},
|
|
1177
|
+
},
|
|
1178
|
+
},
|
|
1179
|
+
],
|
|
1180
|
+
},
|
|
1181
|
+
],
|
|
1182
|
+
},
|
|
1183
|
+
],
|
|
1184
|
+
meta: {
|
|
1185
|
+
itemsOnPage: 50,
|
|
1186
|
+
cursors: {
|
|
1187
|
+
previous: "em9oby1jcm06OnBhZ2U6OjE=",
|
|
1188
|
+
current: "em9oby1jcm06OnBhZ2U6OjI=",
|
|
1189
|
+
next: "em9oby1jcm06OnBhZ2U6OjM=",
|
|
1190
|
+
},
|
|
1191
|
+
},
|
|
1192
|
+
links: {
|
|
1193
|
+
previous:
|
|
1194
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
|
|
1195
|
+
current: "https://unify.apideck.com/crm/companies",
|
|
1196
|
+
next:
|
|
1197
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
|
|
1198
|
+
},
|
|
1199
|
+
});
|
|
1200
|
+
});
|
|
1201
|
+
|
|
1202
|
+
it.skip("Invoices Accounting Invoices Add", async () => {
|
|
1203
|
+
assert.fail(
|
|
1204
|
+
"incomplete test found please make sure to address the following errors: [`workflow step accounting.invoicesAdd.test referencing operation accounting.invoicesAdd with expression in requestBody with type not currently supported`]",
|
|
1205
|
+
);
|
|
1206
|
+
});
|
|
1207
|
+
|
|
1208
|
+
test("Invoices Accounting Invoices One", async () => {
|
|
1209
|
+
const testHttpClient = createTestHTTPClient("accounting.invoicesOne");
|
|
1210
|
+
|
|
1211
|
+
const apideck = new Apideck({
|
|
1212
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
1213
|
+
httpClient: testHttpClient,
|
|
1214
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
1215
|
+
});
|
|
1216
|
+
|
|
1217
|
+
const result = await apideck.accounting.invoices.get({
|
|
1218
|
+
id: "<id>",
|
|
1219
|
+
serviceId: "salesforce",
|
|
1220
|
+
fields: "id,updated_at",
|
|
1221
|
+
});
|
|
1222
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
1223
|
+
expect(result.getInvoiceResponse).toBeDefined();
|
|
1224
|
+
expect(result.getInvoiceResponse).toEqual({
|
|
1225
|
+
statusCode: 200,
|
|
1226
|
+
status: "OK",
|
|
1227
|
+
service: "xero",
|
|
1228
|
+
resource: "invoices",
|
|
1229
|
+
operation: "one",
|
|
1230
|
+
data: {
|
|
1231
|
+
id: "12345",
|
|
1232
|
+
downstreamId: "12345",
|
|
1233
|
+
type: "service",
|
|
1234
|
+
number: "OIT00546",
|
|
1235
|
+
customer: {
|
|
1236
|
+
id: "12345",
|
|
1237
|
+
displayId: "CUST00101",
|
|
1238
|
+
displayName: "Windsurf Shop",
|
|
1239
|
+
companyName: "The boring company",
|
|
1240
|
+
email: "boring@boring.com",
|
|
1241
|
+
},
|
|
1242
|
+
companyId: "12345",
|
|
1243
|
+
invoiceDate: new RFCDate("2020-09-30"),
|
|
1244
|
+
dueDate: new RFCDate("2020-09-30"),
|
|
1245
|
+
terms: "Net 30 days",
|
|
1246
|
+
poNumber: "90000117",
|
|
1247
|
+
reference: "123456",
|
|
1248
|
+
status: "draft",
|
|
1249
|
+
invoiceSent: true,
|
|
1250
|
+
currency: "USD",
|
|
1251
|
+
currencyRate: 0.69,
|
|
1252
|
+
taxInclusive: true,
|
|
1253
|
+
subTotal: 27500,
|
|
1254
|
+
totalTax: 2500,
|
|
1255
|
+
taxCode: "1234",
|
|
1256
|
+
discountPercentage: 5.5,
|
|
1257
|
+
discountAmount: 25,
|
|
1258
|
+
total: 27500,
|
|
1259
|
+
balance: 27500,
|
|
1260
|
+
deposit: 0,
|
|
1261
|
+
customerMemo: "Thank you for your business and have a great day!",
|
|
1262
|
+
trackingCategories: [
|
|
1263
|
+
{
|
|
1264
|
+
id: "123456",
|
|
1265
|
+
name: "New York",
|
|
1266
|
+
},
|
|
1267
|
+
{
|
|
1268
|
+
id: "123456",
|
|
1269
|
+
name: "New York",
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
id: "123456",
|
|
1273
|
+
name: "New York",
|
|
1274
|
+
},
|
|
1275
|
+
],
|
|
1276
|
+
lineItems: [
|
|
1277
|
+
{
|
|
1278
|
+
id: "12345",
|
|
1279
|
+
rowId: "12345",
|
|
1280
|
+
code: "120-C",
|
|
1281
|
+
lineNumber: 1,
|
|
1282
|
+
description:
|
|
1283
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
1284
|
+
type: "sales_item",
|
|
1285
|
+
taxAmount: 27500,
|
|
1286
|
+
totalAmount: 27500,
|
|
1287
|
+
quantity: 1,
|
|
1288
|
+
unitPrice: 27500.5,
|
|
1289
|
+
unitOfMeasure: "pc.",
|
|
1290
|
+
discountPercentage: 0.01,
|
|
1291
|
+
discountAmount: 19.99,
|
|
1292
|
+
locationId: "12345",
|
|
1293
|
+
departmentId: "12345",
|
|
1294
|
+
item: {
|
|
1295
|
+
id: "12344",
|
|
1296
|
+
code: "120-C",
|
|
1297
|
+
name: "Model Y",
|
|
1298
|
+
},
|
|
1299
|
+
taxRate: {
|
|
1300
|
+
id: "123456",
|
|
1301
|
+
code: "N-T",
|
|
1302
|
+
name: "GST on Purchases",
|
|
1303
|
+
rate: 10,
|
|
1304
|
+
},
|
|
1305
|
+
trackingCategories: [
|
|
1306
|
+
{
|
|
1307
|
+
id: "123456",
|
|
1308
|
+
name: "New York",
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
id: "123456",
|
|
1312
|
+
name: "New York",
|
|
1313
|
+
},
|
|
1314
|
+
],
|
|
1315
|
+
ledgerAccount: {
|
|
1316
|
+
id: "123456",
|
|
1317
|
+
name: "Bank account",
|
|
1318
|
+
nominalCode: "N091",
|
|
1319
|
+
code: "453",
|
|
1320
|
+
},
|
|
1321
|
+
customFields: [
|
|
1322
|
+
{
|
|
1323
|
+
id: "2389328923893298",
|
|
1324
|
+
name: "employee_level",
|
|
1325
|
+
description: "Employee Level",
|
|
1326
|
+
value: [
|
|
1327
|
+
{},
|
|
1328
|
+
],
|
|
1329
|
+
},
|
|
1330
|
+
{
|
|
1331
|
+
id: "2389328923893298",
|
|
1332
|
+
name: "employee_level",
|
|
1333
|
+
description: "Employee Level",
|
|
1334
|
+
value: true,
|
|
1335
|
+
},
|
|
1336
|
+
],
|
|
1337
|
+
rowVersion: "1-12345",
|
|
1338
|
+
updatedBy: "12345",
|
|
1339
|
+
createdBy: "12345",
|
|
1340
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1341
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1342
|
+
},
|
|
1343
|
+
{
|
|
1344
|
+
id: "12345",
|
|
1345
|
+
rowId: "12345",
|
|
1346
|
+
code: "120-C",
|
|
1347
|
+
lineNumber: 1,
|
|
1348
|
+
description:
|
|
1349
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
1350
|
+
type: "sales_item",
|
|
1351
|
+
taxAmount: 27500,
|
|
1352
|
+
totalAmount: 27500,
|
|
1353
|
+
quantity: 1,
|
|
1354
|
+
unitPrice: 27500.5,
|
|
1355
|
+
unitOfMeasure: "pc.",
|
|
1356
|
+
discountPercentage: 0.01,
|
|
1357
|
+
discountAmount: 19.99,
|
|
1358
|
+
locationId: "12345",
|
|
1359
|
+
departmentId: "12345",
|
|
1360
|
+
item: {
|
|
1361
|
+
id: "12344",
|
|
1362
|
+
code: "120-C",
|
|
1363
|
+
name: "Model Y",
|
|
1364
|
+
},
|
|
1365
|
+
taxRate: {
|
|
1366
|
+
id: "123456",
|
|
1367
|
+
code: "N-T",
|
|
1368
|
+
name: "GST on Purchases",
|
|
1369
|
+
rate: 10,
|
|
1370
|
+
},
|
|
1371
|
+
trackingCategories: [
|
|
1372
|
+
{
|
|
1373
|
+
id: "123456",
|
|
1374
|
+
name: "New York",
|
|
1375
|
+
},
|
|
1376
|
+
],
|
|
1377
|
+
ledgerAccount: {
|
|
1378
|
+
id: "123456",
|
|
1379
|
+
name: "Bank account",
|
|
1380
|
+
nominalCode: "N091",
|
|
1381
|
+
code: "453",
|
|
1382
|
+
},
|
|
1383
|
+
customFields: [
|
|
1384
|
+
{
|
|
1385
|
+
id: "2389328923893298",
|
|
1386
|
+
name: "employee_level",
|
|
1387
|
+
description: "Employee Level",
|
|
1388
|
+
value: [
|
|
1389
|
+
{},
|
|
1390
|
+
],
|
|
1391
|
+
},
|
|
1392
|
+
],
|
|
1393
|
+
rowVersion: "1-12345",
|
|
1394
|
+
updatedBy: "12345",
|
|
1395
|
+
createdBy: "12345",
|
|
1396
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1397
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1398
|
+
},
|
|
1399
|
+
],
|
|
1400
|
+
billingAddress: {
|
|
1401
|
+
id: "123",
|
|
1402
|
+
type: "primary",
|
|
1403
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
1404
|
+
name: "HQ US",
|
|
1405
|
+
line1: "Main street",
|
|
1406
|
+
line2: "apt #",
|
|
1407
|
+
line3: "Suite #",
|
|
1408
|
+
line4: "delivery instructions",
|
|
1409
|
+
streetNumber: "25",
|
|
1410
|
+
city: "San Francisco",
|
|
1411
|
+
state: "CA",
|
|
1412
|
+
postalCode: "94104",
|
|
1413
|
+
country: "US",
|
|
1414
|
+
latitude: "40.759211",
|
|
1415
|
+
longitude: "-73.984638",
|
|
1416
|
+
county: "Santa Clara",
|
|
1417
|
+
contactName: "Elon Musk",
|
|
1418
|
+
salutation: "Mr",
|
|
1419
|
+
phoneNumber: "111-111-1111",
|
|
1420
|
+
fax: "122-111-1111",
|
|
1421
|
+
email: "elon@musk.com",
|
|
1422
|
+
website: "https://elonmusk.com",
|
|
1423
|
+
notes: "Address notes or delivery instructions.",
|
|
1424
|
+
rowVersion: "1-12345",
|
|
1425
|
+
},
|
|
1426
|
+
shippingAddress: {
|
|
1427
|
+
id: "123",
|
|
1428
|
+
type: "primary",
|
|
1429
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
1430
|
+
name: "HQ US",
|
|
1431
|
+
line1: "Main street",
|
|
1432
|
+
line2: "apt #",
|
|
1433
|
+
line3: "Suite #",
|
|
1434
|
+
line4: "delivery instructions",
|
|
1435
|
+
streetNumber: "25",
|
|
1436
|
+
city: "San Francisco",
|
|
1437
|
+
state: "CA",
|
|
1438
|
+
postalCode: "94104",
|
|
1439
|
+
country: "US",
|
|
1440
|
+
latitude: "40.759211",
|
|
1441
|
+
longitude: "-73.984638",
|
|
1442
|
+
county: "Santa Clara",
|
|
1443
|
+
contactName: "Elon Musk",
|
|
1444
|
+
salutation: "Mr",
|
|
1445
|
+
phoneNumber: "111-111-1111",
|
|
1446
|
+
fax: "122-111-1111",
|
|
1447
|
+
email: "elon@musk.com",
|
|
1448
|
+
website: "https://elonmusk.com",
|
|
1449
|
+
notes: "Address notes or delivery instructions.",
|
|
1450
|
+
rowVersion: "1-12345",
|
|
1451
|
+
},
|
|
1452
|
+
templateId: "123456",
|
|
1453
|
+
sourceDocumentUrl: "https://www.invoicesolution.com/invoice/123456",
|
|
1454
|
+
paymentMethod: "cash",
|
|
1455
|
+
channel: "email",
|
|
1456
|
+
language: "EN",
|
|
1457
|
+
accountingByRow: false,
|
|
1458
|
+
bankAccount: {
|
|
1459
|
+
bankName: "Monzo",
|
|
1460
|
+
accountNumber: "123465",
|
|
1461
|
+
accountName: "SPACEX LLC",
|
|
1462
|
+
accountType: "credit_card",
|
|
1463
|
+
iban: "CH2989144532982975332",
|
|
1464
|
+
bic: "AUDSCHGGXXX",
|
|
1465
|
+
routingNumber: "012345678",
|
|
1466
|
+
bsbNumber: "062-001",
|
|
1467
|
+
branchIdentifier: "001",
|
|
1468
|
+
bankCode: "BNH",
|
|
1469
|
+
currency: "USD",
|
|
1470
|
+
},
|
|
1471
|
+
ledgerAccount: {
|
|
1472
|
+
id: "123456",
|
|
1473
|
+
name: "Bank account",
|
|
1474
|
+
nominalCode: "N091",
|
|
1475
|
+
code: "453",
|
|
1476
|
+
},
|
|
1477
|
+
customFields: [
|
|
1478
|
+
{
|
|
1479
|
+
id: "2389328923893298",
|
|
1480
|
+
name: "employee_level",
|
|
1481
|
+
description: "Employee Level",
|
|
1482
|
+
value: "Uses Salesforce and Marketo",
|
|
1483
|
+
},
|
|
1484
|
+
{
|
|
1485
|
+
id: "2389328923893298",
|
|
1486
|
+
name: "employee_level",
|
|
1487
|
+
description: "Employee Level",
|
|
1488
|
+
value: 10,
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
id: "2389328923893298",
|
|
1492
|
+
name: "employee_level",
|
|
1493
|
+
description: "Employee Level",
|
|
1494
|
+
value: 10,
|
|
1495
|
+
},
|
|
1496
|
+
],
|
|
1497
|
+
rowVersion: "1-12345",
|
|
1498
|
+
updatedBy: "12345",
|
|
1499
|
+
createdBy: "12345",
|
|
1500
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1501
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1502
|
+
passThrough: [
|
|
1503
|
+
{
|
|
1504
|
+
serviceId: "<id>",
|
|
1505
|
+
extendPaths: [
|
|
1506
|
+
{
|
|
1507
|
+
path: "$.nested.property",
|
|
1508
|
+
value: {
|
|
1509
|
+
"TaxClassificationRef": {
|
|
1510
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1511
|
+
},
|
|
1512
|
+
},
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
path: "$.nested.property",
|
|
1516
|
+
value: {
|
|
1517
|
+
"TaxClassificationRef": {
|
|
1518
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1519
|
+
},
|
|
1520
|
+
},
|
|
1521
|
+
},
|
|
1522
|
+
],
|
|
1523
|
+
},
|
|
1524
|
+
],
|
|
1525
|
+
},
|
|
1526
|
+
});
|
|
1527
|
+
});
|
|
1528
|
+
|
|
1529
|
+
it.skip("Invoices Accounting Invoices Update", async () => {
|
|
1530
|
+
assert.fail(
|
|
1531
|
+
"incomplete test found please make sure to address the following errors: [`workflow step accounting.invoicesUpdate.test referencing operation accounting.invoicesUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.invoicesUpdate.test referencing operation accounting.invoicesUpdate with expression in requestBody with type not currently supported`]",
|
|
1532
|
+
);
|
|
1533
|
+
});
|
|
1534
|
+
|
|
1535
|
+
test("Invoices Accounting Invoices Delete", async () => {
|
|
1536
|
+
const testHttpClient = createTestHTTPClient("accounting.invoicesDelete");
|
|
1537
|
+
|
|
1538
|
+
const apideck = new Apideck({
|
|
1539
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
1540
|
+
httpClient: testHttpClient,
|
|
1541
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
1542
|
+
});
|
|
1543
|
+
|
|
1544
|
+
const result = await apideck.accounting.invoices.delete({
|
|
1545
|
+
id: "<id>",
|
|
1546
|
+
serviceId: "salesforce",
|
|
1547
|
+
});
|
|
1548
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
1549
|
+
expect(result.deleteInvoiceResponse).toBeDefined();
|
|
1550
|
+
expect(result.deleteInvoiceResponse).toEqual({
|
|
1551
|
+
statusCode: 200,
|
|
1552
|
+
status: "OK",
|
|
1553
|
+
service: "xero",
|
|
1554
|
+
resource: "invoices",
|
|
1555
|
+
operation: "delete",
|
|
1556
|
+
data: {
|
|
1557
|
+
id: "12345",
|
|
1558
|
+
downstreamId: "12345",
|
|
1559
|
+
},
|
|
1560
|
+
});
|
|
1561
|
+
});
|