@renterra/sdk 0.2.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.
package/dist/rest.d.ts ADDED
@@ -0,0 +1,1296 @@
1
+ export type ConnectRenterraOptions = {
2
+ mode?: "session" | "oauth";
3
+ apiOrigin?: string;
4
+ issuer?: string;
5
+ redirectUri?: string;
6
+ clientId?: string;
7
+ accessToken?: () => string | Promise<string>;
8
+ fetch?: typeof globalThis.fetch;
9
+ };
10
+ export declare function connectRenterra(options?: ConnectRenterraOptions): Promise<{
11
+ signOut: () => void | undefined;
12
+ customers: {
13
+ list: (query?: {
14
+ page?: number;
15
+ page_size?: number;
16
+ query?: string;
17
+ include_deleted?: "true" | "false";
18
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
19
+ data: {
20
+ id: string;
21
+ created_at: string;
22
+ updated_at: string;
23
+ is_archived: boolean;
24
+ archived_at: string | null;
25
+ deleted_at: string | null;
26
+ name: string;
27
+ type: "Individual" | "Company";
28
+ status: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
29
+ account_type: "Cash" | "Account";
30
+ billing_email: string | null;
31
+ website: string | null;
32
+ primary_contact_id: string | null;
33
+ credit_balance: number;
34
+ total_revenue: number;
35
+ ytd_revenue: number;
36
+ address: {
37
+ address_line_1: string;
38
+ address_line_2: string | null;
39
+ locality: string;
40
+ administrative_area: string;
41
+ postal_code: string | null;
42
+ country: string | null;
43
+ } | null;
44
+ }[];
45
+ pagination: {
46
+ page: number;
47
+ page_size: number;
48
+ has_more: boolean;
49
+ };
50
+ }>;
51
+ create: (input: {
52
+ name: string;
53
+ type: "Individual" | "Company";
54
+ account_type?: "Cash" | "Account";
55
+ status?: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
56
+ billing_email?: string | null;
57
+ website?: string | null;
58
+ notes?: string | null;
59
+ address?: {
60
+ address_line_1: string;
61
+ address_line_2?: string | null;
62
+ locality: string;
63
+ administrative_area: string;
64
+ postal_code?: string | null;
65
+ country: string;
66
+ } | null;
67
+ primary_contact: {
68
+ first_name?: string | null;
69
+ last_name?: string | null;
70
+ email?: string | null;
71
+ phone?: string | null;
72
+ title?: string | null;
73
+ };
74
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
75
+ id: string;
76
+ created_at: string;
77
+ updated_at: string;
78
+ is_archived: boolean;
79
+ archived_at: string | null;
80
+ deleted_at: string | null;
81
+ name: string;
82
+ type: "Individual" | "Company";
83
+ status: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
84
+ account_type: "Cash" | "Account";
85
+ billing_email: string | null;
86
+ website: string | null;
87
+ primary_contact_id: string | null;
88
+ credit_balance: number;
89
+ total_revenue: number;
90
+ ytd_revenue: number;
91
+ address: {
92
+ address_line_1: string;
93
+ address_line_2: string | null;
94
+ locality: string;
95
+ administrative_area: string;
96
+ postal_code: string | null;
97
+ country: string | null;
98
+ } | null;
99
+ }>;
100
+ get: (id: string, options?: import("./transport.js").RenterraCallOptions) => Promise<{
101
+ id: string;
102
+ created_at: string;
103
+ updated_at: string;
104
+ is_archived: boolean;
105
+ archived_at: string | null;
106
+ deleted_at: string | null;
107
+ name: string;
108
+ type: "Individual" | "Company";
109
+ status: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
110
+ account_type: "Cash" | "Account";
111
+ billing_email: string | null;
112
+ website: string | null;
113
+ primary_contact_id: string | null;
114
+ credit_balance: number;
115
+ total_revenue: number;
116
+ ytd_revenue: number;
117
+ address: {
118
+ address_line_1: string;
119
+ address_line_2: string | null;
120
+ locality: string;
121
+ administrative_area: string;
122
+ postal_code: string | null;
123
+ country: string | null;
124
+ } | null;
125
+ }>;
126
+ update: (id: string, input: {
127
+ name?: string;
128
+ type?: "Individual" | "Company";
129
+ account_type?: "Cash" | "Account";
130
+ status?: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
131
+ billing_email?: string | null;
132
+ website?: string | null;
133
+ notes?: string | null;
134
+ address?: {
135
+ address_line_1: string;
136
+ address_line_2?: string | null;
137
+ locality: string;
138
+ administrative_area: string;
139
+ postal_code?: string | null;
140
+ country: string;
141
+ } | null;
142
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
143
+ id: string;
144
+ created_at: string;
145
+ updated_at: string;
146
+ is_archived: boolean;
147
+ archived_at: string | null;
148
+ deleted_at: string | null;
149
+ name: string;
150
+ type: "Individual" | "Company";
151
+ status: "ACTIVE" | "PREVIOUS" | "UNDESIRABLE" | "PROSPECTIVE" | "CREDIT_HOLD";
152
+ account_type: "Cash" | "Account";
153
+ billing_email: string | null;
154
+ website: string | null;
155
+ primary_contact_id: string | null;
156
+ credit_balance: number;
157
+ total_revenue: number;
158
+ ytd_revenue: number;
159
+ address: {
160
+ address_line_1: string;
161
+ address_line_2: string | null;
162
+ locality: string;
163
+ administrative_area: string;
164
+ postal_code: string | null;
165
+ country: string | null;
166
+ } | null;
167
+ }>;
168
+ };
169
+ contacts: {
170
+ list: (query?: {
171
+ page?: number;
172
+ page_size?: number;
173
+ customer_id?: string;
174
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
175
+ data: {
176
+ id: string;
177
+ created_at: string;
178
+ updated_at: string;
179
+ customer_id: string;
180
+ first_name: string | null;
181
+ last_name: string | null;
182
+ email: string | null;
183
+ phone: string | null;
184
+ title: string | null;
185
+ }[];
186
+ pagination: {
187
+ page: number;
188
+ page_size: number;
189
+ has_more: boolean;
190
+ };
191
+ }>;
192
+ update: (id: string, input: {
193
+ first_name?: string | null;
194
+ last_name?: string | null;
195
+ email?: string | null;
196
+ phone?: string | null;
197
+ title?: string | null;
198
+ drivers_license_number?: string | null;
199
+ drivers_license_expiry?: string | null;
200
+ date_of_birth?: string | null;
201
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
202
+ id: string;
203
+ created_at: string;
204
+ updated_at: string;
205
+ customer_id: string;
206
+ first_name: string | null;
207
+ last_name: string | null;
208
+ email: string | null;
209
+ phone: string | null;
210
+ title: string | null;
211
+ }>;
212
+ };
213
+ tasks: {
214
+ list: (query?: {
215
+ query?: string;
216
+ status?: string;
217
+ priority?: string;
218
+ assignee_user_id?: string;
219
+ created_by_user_id?: string;
220
+ location_id?: string;
221
+ customer_id?: string;
222
+ order_id?: string;
223
+ item_id?: string;
224
+ work_order_id?: string;
225
+ purchase_order_id?: string;
226
+ due_after?: string;
227
+ due_before?: string;
228
+ include_deleted?: "true" | "false";
229
+ page?: number;
230
+ page_size?: number;
231
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
232
+ data: {
233
+ [x: string]: unknown;
234
+ id: string;
235
+ created_at: string;
236
+ updated_at: string;
237
+ deleted_at: string | null;
238
+ title: string;
239
+ description: string | null;
240
+ status: "Open" | "Completed" | "Canceled";
241
+ priority: "None" | "Low" | "Medium" | "High" | "Urgent";
242
+ source: "Web" | "Api";
243
+ due_at: string | null;
244
+ completed_at: string | null;
245
+ canceled_at: string | null;
246
+ created_by_user_id: string | null;
247
+ assignee_user_id: string | null;
248
+ location_id: string | null;
249
+ customer_id: string | null;
250
+ order_id: string | null;
251
+ item_id: string | null;
252
+ work_order_id: string | null;
253
+ purchase_order_id: string | null;
254
+ conversation_id: string | null;
255
+ reminders: {
256
+ id: string;
257
+ scheduled_at: string;
258
+ sent_at: string | null;
259
+ canceled_at: string | null;
260
+ }[];
261
+ }[];
262
+ pagination: {
263
+ page: number;
264
+ page_size: number;
265
+ has_more: boolean;
266
+ total: number;
267
+ };
268
+ }>;
269
+ create: (input: {
270
+ title: string;
271
+ description?: string | null;
272
+ status?: "Open" | "Completed" | "Canceled";
273
+ priority?: "None" | "Low" | "Medium" | "High" | "Urgent";
274
+ due_at?: string | null;
275
+ assignee_user_id?: string | null;
276
+ location_id?: string | null;
277
+ customer_id?: string | null;
278
+ order_id?: string | null;
279
+ item_id?: string | null;
280
+ work_order_id?: string | null;
281
+ purchase_order_id?: string | null;
282
+ conversation_id?: string | null;
283
+ reminders?: string[];
284
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
285
+ [x: string]: unknown;
286
+ id: string;
287
+ created_at: string;
288
+ updated_at: string;
289
+ deleted_at: string | null;
290
+ title: string;
291
+ description: string | null;
292
+ status: "Open" | "Completed" | "Canceled";
293
+ priority: "None" | "Low" | "Medium" | "High" | "Urgent";
294
+ source: "Web" | "Api";
295
+ due_at: string | null;
296
+ completed_at: string | null;
297
+ canceled_at: string | null;
298
+ created_by_user_id: string | null;
299
+ assignee_user_id: string | null;
300
+ location_id: string | null;
301
+ customer_id: string | null;
302
+ order_id: string | null;
303
+ item_id: string | null;
304
+ work_order_id: string | null;
305
+ purchase_order_id: string | null;
306
+ conversation_id: string | null;
307
+ reminders: {
308
+ id: string;
309
+ scheduled_at: string;
310
+ sent_at: string | null;
311
+ canceled_at: string | null;
312
+ }[];
313
+ }>;
314
+ get: (id: string, options?: import("./transport.js").RenterraCallOptions) => Promise<{
315
+ [x: string]: unknown;
316
+ id: string;
317
+ created_at: string;
318
+ updated_at: string;
319
+ deleted_at: string | null;
320
+ title: string;
321
+ description: string | null;
322
+ status: "Open" | "Completed" | "Canceled";
323
+ priority: "None" | "Low" | "Medium" | "High" | "Urgent";
324
+ source: "Web" | "Api";
325
+ due_at: string | null;
326
+ completed_at: string | null;
327
+ canceled_at: string | null;
328
+ created_by_user_id: string | null;
329
+ assignee_user_id: string | null;
330
+ location_id: string | null;
331
+ customer_id: string | null;
332
+ order_id: string | null;
333
+ item_id: string | null;
334
+ work_order_id: string | null;
335
+ purchase_order_id: string | null;
336
+ conversation_id: string | null;
337
+ reminders: {
338
+ id: string;
339
+ scheduled_at: string;
340
+ sent_at: string | null;
341
+ canceled_at: string | null;
342
+ }[];
343
+ }>;
344
+ update: (id: string, input: {
345
+ title?: string;
346
+ description?: string | null;
347
+ status?: "Open" | "Completed" | "Canceled";
348
+ priority?: "None" | "Low" | "Medium" | "High" | "Urgent";
349
+ due_at?: string | null;
350
+ assignee_user_id?: string | null;
351
+ location_id?: string | null;
352
+ customer_id?: string | null;
353
+ order_id?: string | null;
354
+ item_id?: string | null;
355
+ work_order_id?: string | null;
356
+ purchase_order_id?: string | null;
357
+ conversation_id?: string | null;
358
+ reminders?: string[];
359
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
360
+ [x: string]: unknown;
361
+ id: string;
362
+ created_at: string;
363
+ updated_at: string;
364
+ deleted_at: string | null;
365
+ title: string;
366
+ description: string | null;
367
+ status: "Open" | "Completed" | "Canceled";
368
+ priority: "None" | "Low" | "Medium" | "High" | "Urgent";
369
+ source: "Web" | "Api";
370
+ due_at: string | null;
371
+ completed_at: string | null;
372
+ canceled_at: string | null;
373
+ created_by_user_id: string | null;
374
+ assignee_user_id: string | null;
375
+ location_id: string | null;
376
+ customer_id: string | null;
377
+ order_id: string | null;
378
+ item_id: string | null;
379
+ work_order_id: string | null;
380
+ purchase_order_id: string | null;
381
+ conversation_id: string | null;
382
+ reminders: {
383
+ id: string;
384
+ scheduled_at: string;
385
+ sent_at: string | null;
386
+ canceled_at: string | null;
387
+ }[];
388
+ }>;
389
+ delete: (id: string, options?: import("./transport.js").RenterraCallOptions) => Promise<void>;
390
+ };
391
+ reports: {
392
+ list: (options?: import("./transport.js").RenterraCallOptions) => Promise<undefined>;
393
+ get: (id: string, options?: import("./transport.js").RenterraCallOptions) => Promise<undefined>;
394
+ };
395
+ inventory: {
396
+ items: {
397
+ list: (query?: {
398
+ page?: number;
399
+ page_size?: number;
400
+ query?: string;
401
+ kind?: "Actual" | "Slot";
402
+ include_archived?: "true" | "false";
403
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
404
+ data: {
405
+ id: string;
406
+ updated_at: string;
407
+ kind: "Actual" | "Slot";
408
+ type: "Serial" | "Sale" | "Bulk" | "Part";
409
+ make: string | null;
410
+ model: string | null;
411
+ model_year: number | null;
412
+ condition: ("Excellent" | "Good" | "Ok" | "Bad" | "Terrible") | null;
413
+ item_number: string | null;
414
+ part_number: string | null;
415
+ serial_number: string | null;
416
+ description: string;
417
+ category: string;
418
+ class: string;
419
+ group: string;
420
+ }[];
421
+ pagination: {
422
+ page: number;
423
+ page_size: number;
424
+ has_more: boolean;
425
+ };
426
+ }>;
427
+ get: (id: string, options?: import("./transport.js").RenterraCallOptions) => Promise<{
428
+ id: string;
429
+ updated_at: string;
430
+ kind: "Actual" | "Slot";
431
+ type: "Serial" | "Sale" | "Bulk" | "Part";
432
+ make: string | null;
433
+ model: string | null;
434
+ model_year: number | null;
435
+ condition: ("Excellent" | "Good" | "Ok" | "Bad" | "Terrible") | null;
436
+ item_number: string | null;
437
+ part_number: string | null;
438
+ serial_number: string | null;
439
+ description: string;
440
+ category: string;
441
+ class: string;
442
+ group: string;
443
+ }>;
444
+ analytics: (id: string, options?: import("./transport.js").RenterraCallOptions) => Promise<undefined>;
445
+ };
446
+ kits: {
447
+ list: (query?: {
448
+ page?: number;
449
+ page_size?: number;
450
+ status?: "active" | "archived" | "all";
451
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
452
+ data: {
453
+ id: string;
454
+ name: string;
455
+ status: "active" | "archived";
456
+ items: {
457
+ item_id: string;
458
+ quantity: number;
459
+ }[];
460
+ }[];
461
+ pagination: {
462
+ page: number;
463
+ page_size: number;
464
+ has_more: boolean;
465
+ };
466
+ }>;
467
+ };
468
+ orders: {
469
+ list: (query?: {
470
+ page?: number;
471
+ page_size?: number;
472
+ order_id?: string;
473
+ work_order_id?: string;
474
+ item_id?: string;
475
+ line_id?: string;
476
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
477
+ data: ({
478
+ id: string;
479
+ source: "order" | "work_order";
480
+ order_id: string | null;
481
+ work_order_id: string | null;
482
+ line_id: string;
483
+ item_id: string;
484
+ slot_id: string | null;
485
+ description: string;
486
+ quantity: number;
487
+ status: "Ready" | "OnRent" | "CalledOff" | "PickedUp" | "CheckedIn" | "Sold";
488
+ type: "rental";
489
+ billing_start_time: string;
490
+ billing_end_time: string | null;
491
+ } | {
492
+ id: string;
493
+ source: "order" | "work_order";
494
+ order_id: string | null;
495
+ work_order_id: string | null;
496
+ line_id: string;
497
+ item_id: string;
498
+ slot_id: string | null;
499
+ description: string;
500
+ quantity: number;
501
+ status: "Ready" | "OnRent" | "CalledOff" | "PickedUp" | "CheckedIn" | "Sold";
502
+ type: "sale";
503
+ sale_time: string | null;
504
+ })[];
505
+ pagination: {
506
+ page: number;
507
+ page_size: number;
508
+ has_more: boolean;
509
+ };
510
+ }>;
511
+ get: (id: string, options?: import("./transport.js").RenterraCallOptions) => Promise<{
512
+ id: string;
513
+ source: "order" | "work_order";
514
+ order_id: string | null;
515
+ work_order_id: string | null;
516
+ line_id: string;
517
+ item_id: string;
518
+ slot_id: string | null;
519
+ description: string;
520
+ quantity: number;
521
+ status: "Ready" | "OnRent" | "CalledOff" | "PickedUp" | "CheckedIn" | "Sold";
522
+ type: "rental";
523
+ billing_start_time: string;
524
+ billing_end_time: string | null;
525
+ } | {
526
+ id: string;
527
+ source: "order" | "work_order";
528
+ order_id: string | null;
529
+ work_order_id: string | null;
530
+ line_id: string;
531
+ item_id: string;
532
+ slot_id: string | null;
533
+ description: string;
534
+ quantity: number;
535
+ status: "Ready" | "OnRent" | "CalledOff" | "PickedUp" | "CheckedIn" | "Sold";
536
+ type: "sale";
537
+ sale_time: string | null;
538
+ }>;
539
+ };
540
+ };
541
+ branches: {
542
+ list: (query?: {
543
+ page?: number;
544
+ page_size?: number;
545
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
546
+ data: {
547
+ id: string;
548
+ updated_at: string;
549
+ name: string;
550
+ }[];
551
+ pagination: {
552
+ page: number;
553
+ page_size: number;
554
+ has_more: boolean;
555
+ };
556
+ }>;
557
+ };
558
+ vendors: {
559
+ list: (query?: {
560
+ page?: number;
561
+ page_size?: number;
562
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
563
+ data: {
564
+ id: string;
565
+ updated_at: string;
566
+ name: string;
567
+ phone_number: string | null;
568
+ email: string | null;
569
+ }[];
570
+ pagination: {
571
+ page: number;
572
+ page_size: number;
573
+ has_more: boolean;
574
+ };
575
+ }>;
576
+ };
577
+ orders: {
578
+ list: (query?: {
579
+ page?: number;
580
+ page_size?: number;
581
+ query?: string;
582
+ customer_id?: string;
583
+ status?: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
584
+ start_time_after?: string;
585
+ start_time_before?: string;
586
+ end_time_after?: string;
587
+ end_time_before?: string;
588
+ start_date?: string;
589
+ end_date?: string;
590
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
591
+ data: {
592
+ id: string;
593
+ number: number;
594
+ source: "Online" | "Manual";
595
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
596
+ customer_id: string;
597
+ branch_id: string;
598
+ start_time: string;
599
+ end_time: string | null;
600
+ job_number: string | null;
601
+ job_description: string | null;
602
+ po_number: string | null;
603
+ contract_signed_at: string | null;
604
+ is_historical: boolean;
605
+ items: {
606
+ description: string;
607
+ quantity: number;
608
+ item_id: string | null;
609
+ }[];
610
+ lines: {
611
+ description: string;
612
+ quantity: number;
613
+ item_id: string | null;
614
+ id: string;
615
+ inventory_on_order_ids: string[];
616
+ }[];
617
+ }[];
618
+ pagination: {
619
+ page: number;
620
+ page_size: number;
621
+ has_more: boolean;
622
+ };
623
+ }>;
624
+ get: (id: string, options?: import("./transport.js").RenterraCallOptions) => Promise<{
625
+ id: string;
626
+ number: number;
627
+ source: "Online" | "Manual";
628
+ status: "Quote" | "Expired" | "Reservation" | "Canceled" | "Rental" | "Completed" | "Closed";
629
+ customer_id: string;
630
+ branch_id: string;
631
+ start_time: string;
632
+ end_time: string | null;
633
+ job_number: string | null;
634
+ job_description: string | null;
635
+ po_number: string | null;
636
+ contract_signed_at: string | null;
637
+ is_historical: boolean;
638
+ items: {
639
+ description: string;
640
+ quantity: number;
641
+ item_id: string | null;
642
+ }[];
643
+ lines: {
644
+ description: string;
645
+ quantity: number;
646
+ item_id: string | null;
647
+ id: string;
648
+ inventory_on_order_ids: string[];
649
+ }[];
650
+ }>;
651
+ billingSummary: (id: string, options?: import("./transport.js").RenterraCallOptions) => Promise<{
652
+ items: {
653
+ description: string;
654
+ item_id: string | null;
655
+ qty: number;
656
+ total: number;
657
+ }[];
658
+ subtotal: number;
659
+ tax: number;
660
+ total: number | null;
661
+ }>;
662
+ contracts: {
663
+ list: (id: string, options?: import("./transport.js").RenterraCallOptions) => Promise<{
664
+ data: {
665
+ id: string;
666
+ created_at: string;
667
+ signed_by: string | null;
668
+ is_downloadable: boolean;
669
+ }[];
670
+ }>;
671
+ download: (id: string, contractId: string, options?: import("./transport.js").RenterraCallOptions) => Promise<Blob>;
672
+ };
673
+ };
674
+ accounting: {
675
+ chart: {
676
+ list: (query?: {
677
+ page?: number;
678
+ page_size?: number;
679
+ type?: "Asset" | "Liability" | "Equity" | "Income" | "Expense";
680
+ status?: "active" | "archived" | "all";
681
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
682
+ data: {
683
+ id: string;
684
+ name: string;
685
+ type: "Asset" | "Liability" | "Equity" | "Income" | "Expense";
686
+ status: "active" | "archived";
687
+ }[];
688
+ pagination: {
689
+ page: number;
690
+ page_size: number;
691
+ has_more: boolean;
692
+ };
693
+ }>;
694
+ };
695
+ ledger: {
696
+ list: (query?: {
697
+ page?: number;
698
+ page_size?: number;
699
+ basis?: "Accrual" | "Cash";
700
+ account_id?: string;
701
+ customer_id?: string;
702
+ invoice_id?: string;
703
+ order_id?: string;
704
+ start_date?: string;
705
+ end_date?: string;
706
+ after_id?: string;
707
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
708
+ data: {
709
+ id: string;
710
+ time: string;
711
+ account_id: string;
712
+ debit_cents: number;
713
+ credit_cents: number;
714
+ transaction_key: string;
715
+ basis: "Accrual" | "Cash";
716
+ location_id: string | null;
717
+ customer_id: string | null;
718
+ invoice_id: string | null;
719
+ order_id: string | null;
720
+ item_id: string | null;
721
+ vendor_id: string | null;
722
+ }[];
723
+ pagination: {
724
+ page: number;
725
+ page_size: number;
726
+ has_more: boolean;
727
+ };
728
+ }>;
729
+ };
730
+ };
731
+ invoices: {
732
+ list: (query?: {
733
+ page?: number;
734
+ page_size?: number;
735
+ customer_id?: string;
736
+ start_date?: string;
737
+ end_date?: string;
738
+ query?: string;
739
+ status?: "Unpaid" | "Paid" | "Void" | "BadDebt";
740
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
741
+ data: {
742
+ id: string;
743
+ number: string;
744
+ status: "Unpaid" | "Paid" | "Void" | "BadDebt";
745
+ customer_id: string | null;
746
+ order_id: string | null;
747
+ total_cents: number;
748
+ tax_total_cents: number;
749
+ paid_cents: number;
750
+ issue_date: string | null;
751
+ due_date: string;
752
+ paid_at: string | null;
753
+ items: {
754
+ description: string;
755
+ quantity: number;
756
+ total_cents: number;
757
+ item_id: string | null;
758
+ }[];
759
+ lines: {
760
+ description: string;
761
+ quantity: number;
762
+ total_cents: number;
763
+ item_id: string | null;
764
+ id: string;
765
+ group_id: string;
766
+ sales_tax_cents: number;
767
+ ledger_account_id: string;
768
+ revenue_allocations: {
769
+ item_id: string;
770
+ ledger_account_id: string;
771
+ percentage: number;
772
+ }[];
773
+ }[];
774
+ payments: {
775
+ allocation_id: string;
776
+ payment_id: string;
777
+ amount_cents: number;
778
+ allocated_at: string;
779
+ type: "Payment" | "Refund";
780
+ method: "Cash" | "Card" | "Bank" | "Check" | "Credit" | "Other";
781
+ created_at: string;
782
+ succeeded_at: string | null;
783
+ refunded_payment_id: string | null;
784
+ }[];
785
+ }[];
786
+ pagination: {
787
+ page: number;
788
+ page_size: number;
789
+ has_more: boolean;
790
+ };
791
+ }>;
792
+ get: (id: string, options?: import("./transport.js").RenterraCallOptions) => Promise<{
793
+ id: string;
794
+ number: string;
795
+ status: "Unpaid" | "Paid" | "Void" | "BadDebt";
796
+ customer_id: string | null;
797
+ order_id: string | null;
798
+ total_cents: number;
799
+ tax_total_cents: number;
800
+ paid_cents: number;
801
+ issue_date: string | null;
802
+ due_date: string;
803
+ paid_at: string | null;
804
+ items: {
805
+ description: string;
806
+ quantity: number;
807
+ total_cents: number;
808
+ item_id: string | null;
809
+ }[];
810
+ lines: {
811
+ description: string;
812
+ quantity: number;
813
+ total_cents: number;
814
+ item_id: string | null;
815
+ id: string;
816
+ group_id: string;
817
+ sales_tax_cents: number;
818
+ ledger_account_id: string;
819
+ revenue_allocations: {
820
+ item_id: string;
821
+ ledger_account_id: string;
822
+ percentage: number;
823
+ }[];
824
+ }[];
825
+ payments: {
826
+ allocation_id: string;
827
+ payment_id: string;
828
+ amount_cents: number;
829
+ allocated_at: string;
830
+ type: "Payment" | "Refund";
831
+ method: "Cash" | "Card" | "Bank" | "Check" | "Credit" | "Other";
832
+ created_at: string;
833
+ succeeded_at: string | null;
834
+ refunded_payment_id: string | null;
835
+ }[];
836
+ }>;
837
+ };
838
+ payments: {
839
+ list: (query?: {
840
+ page?: number;
841
+ page_size?: number;
842
+ customer_id?: string;
843
+ start_date?: string;
844
+ end_date?: string;
845
+ query?: string;
846
+ invoice_id?: string;
847
+ order_id?: string;
848
+ branch_id?: string;
849
+ type?: "Payment" | "Refund";
850
+ method?: "Cash" | "Card" | "Bank" | "Check" | "Credit" | "Other";
851
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
852
+ data: {
853
+ id: string;
854
+ type: "Payment" | "Refund";
855
+ method: "Cash" | "Card" | "Bank" | "Check" | "Credit" | "Other";
856
+ amount_cents: number;
857
+ customer_id: string | null;
858
+ branch_id: string;
859
+ order_id: string | null;
860
+ refunded_payment_id: string | null;
861
+ created_at: string;
862
+ succeeded_at: string | null;
863
+ allocations: {
864
+ id: string;
865
+ invoice_id: string;
866
+ amount_cents: number;
867
+ created_at: string;
868
+ }[];
869
+ }[];
870
+ pagination: {
871
+ page: number;
872
+ page_size: number;
873
+ has_more: boolean;
874
+ };
875
+ }>;
876
+ get: (id: string, options?: import("./transport.js").RenterraCallOptions) => Promise<{
877
+ id: string;
878
+ type: "Payment" | "Refund";
879
+ method: "Cash" | "Card" | "Bank" | "Check" | "Credit" | "Other";
880
+ amount_cents: number;
881
+ customer_id: string | null;
882
+ branch_id: string;
883
+ order_id: string | null;
884
+ refunded_payment_id: string | null;
885
+ created_at: string;
886
+ succeeded_at: string | null;
887
+ allocations: {
888
+ id: string;
889
+ invoice_id: string;
890
+ amount_cents: number;
891
+ created_at: string;
892
+ }[];
893
+ }>;
894
+ };
895
+ maintenance: {
896
+ workOrders: {
897
+ list: (query?: {
898
+ page?: number;
899
+ page_size?: number;
900
+ status?: "Open" | "Closed";
901
+ item_id?: string;
902
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
903
+ data: {
904
+ id: string;
905
+ number: number;
906
+ status: "Open" | "Closed";
907
+ type: ("Preventative" | "Repair") | null;
908
+ severity: ("Hard" | "Soft") | null;
909
+ item_id: string | null;
910
+ start_date: string;
911
+ end_date: string | null;
912
+ created_at: string;
913
+ inventory_on_order_ids: string[];
914
+ is_historical: boolean;
915
+ }[];
916
+ pagination: {
917
+ page: number;
918
+ page_size: number;
919
+ has_more: boolean;
920
+ };
921
+ }>;
922
+ };
923
+ serviceOrders: {
924
+ list: (query?: {
925
+ page?: number;
926
+ page_size?: number;
927
+ status?: "Open" | "Closed";
928
+ customer_id?: string;
929
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
930
+ data: {
931
+ id: string;
932
+ number: number;
933
+ status: "Open" | "Closed";
934
+ customer_id: string | null;
935
+ item_id: string | null;
936
+ start_date: string;
937
+ end_date: string | null;
938
+ created_at: string;
939
+ inventory_on_order_ids: string[];
940
+ is_historical: boolean;
941
+ }[];
942
+ pagination: {
943
+ page: number;
944
+ page_size: number;
945
+ has_more: boolean;
946
+ };
947
+ }>;
948
+ };
949
+ };
950
+ automation: {
951
+ rules: {
952
+ list: (query?: {
953
+ cursor?: string;
954
+ limit?: number;
955
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
956
+ rules: {
957
+ id: string;
958
+ name: string;
959
+ revision: number;
960
+ status: "draft";
961
+ definition: {
962
+ schema_version: 1;
963
+ subject: "invoice" | "order";
964
+ triggers: ({
965
+ id: string;
966
+ kind: "event";
967
+ type: "invoice.paid";
968
+ } | {
969
+ id: string;
970
+ kind: "event";
971
+ type: "order.created" | "order.completed";
972
+ } | {
973
+ id: string;
974
+ kind: "business_date";
975
+ type: "unpaid_invoice_due";
976
+ offset_hours: number;
977
+ } | {
978
+ id: string;
979
+ kind: "business_date";
980
+ type: "completed_order";
981
+ offset_hours: number;
982
+ })[];
983
+ conditions: {
984
+ all: ({
985
+ field: "invoice.outstanding_balance_cents";
986
+ operator: "greater_than" | "at_least" | "less_than" | "at_most" | "equals";
987
+ value: number;
988
+ } | {
989
+ field: "order.starting_location_id";
990
+ operator: "in";
991
+ value: string[];
992
+ })[];
993
+ };
994
+ actions: ({
995
+ id: string;
996
+ type: "order.close";
997
+ } | {
998
+ id: string;
999
+ type: "message.send_template";
1000
+ template_id: string;
1001
+ channel: "email" | "sms";
1002
+ enabled?: boolean | undefined;
1003
+ recipient: "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | {
1004
+ first_available: ("customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact")[];
1005
+ };
1006
+ attachments?: "invoice_pdf"[] | undefined;
1007
+ })[];
1008
+ };
1009
+ created_at: string;
1010
+ updated_at: string;
1011
+ archived_at: string | null;
1012
+ }[];
1013
+ next_cursor: string | null;
1014
+ }>;
1015
+ create: (input: {
1016
+ name: string;
1017
+ definition: {
1018
+ schema_version: 1;
1019
+ subject: "invoice" | "order";
1020
+ triggers: (({
1021
+ id: string;
1022
+ kind: "event";
1023
+ type: "invoice.paid";
1024
+ } | {
1025
+ id: string;
1026
+ kind: "event";
1027
+ type: "order.created" | "order.completed";
1028
+ }) | ({
1029
+ id: string;
1030
+ kind: "business_date";
1031
+ type: "unpaid_invoice_due";
1032
+ offset_hours: number;
1033
+ } | {
1034
+ id: string;
1035
+ kind: "business_date";
1036
+ type: "completed_order";
1037
+ offset_hours: number;
1038
+ }))[];
1039
+ conditions: {
1040
+ all: ({
1041
+ field: "invoice.outstanding_balance_cents";
1042
+ operator: "greater_than" | "at_least" | "less_than" | "at_most" | "equals";
1043
+ value: number;
1044
+ } | {
1045
+ field: "order.starting_location_id";
1046
+ operator: "in";
1047
+ value: string[];
1048
+ })[];
1049
+ };
1050
+ actions: ({
1051
+ id: string;
1052
+ type: "order.close";
1053
+ } | {
1054
+ id: string;
1055
+ type: "message.send_template";
1056
+ template_id: string;
1057
+ channel: "email" | "sms";
1058
+ enabled?: boolean;
1059
+ recipient: ("customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact") | {
1060
+ first_available: ("customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact")[];
1061
+ };
1062
+ attachments?: "invoice_pdf"[];
1063
+ })[];
1064
+ };
1065
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
1066
+ id: string;
1067
+ name: string;
1068
+ revision: number;
1069
+ status: "draft";
1070
+ definition: {
1071
+ schema_version: 1;
1072
+ subject: "invoice" | "order";
1073
+ triggers: ({
1074
+ id: string;
1075
+ kind: "event";
1076
+ type: "invoice.paid";
1077
+ } | {
1078
+ id: string;
1079
+ kind: "event";
1080
+ type: "order.created" | "order.completed";
1081
+ } | {
1082
+ id: string;
1083
+ kind: "business_date";
1084
+ type: "unpaid_invoice_due";
1085
+ offset_hours: number;
1086
+ } | {
1087
+ id: string;
1088
+ kind: "business_date";
1089
+ type: "completed_order";
1090
+ offset_hours: number;
1091
+ })[];
1092
+ conditions: {
1093
+ all: ({
1094
+ field: "invoice.outstanding_balance_cents";
1095
+ operator: "greater_than" | "at_least" | "less_than" | "at_most" | "equals";
1096
+ value: number;
1097
+ } | {
1098
+ field: "order.starting_location_id";
1099
+ operator: "in";
1100
+ value: string[];
1101
+ })[];
1102
+ };
1103
+ actions: ({
1104
+ id: string;
1105
+ type: "order.close";
1106
+ } | {
1107
+ id: string;
1108
+ type: "message.send_template";
1109
+ template_id: string;
1110
+ channel: "email" | "sms";
1111
+ enabled?: boolean | undefined;
1112
+ recipient: "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | {
1113
+ first_available: ("customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact")[];
1114
+ };
1115
+ attachments?: "invoice_pdf"[] | undefined;
1116
+ })[];
1117
+ };
1118
+ created_at: string;
1119
+ updated_at: string;
1120
+ archived_at: string | null;
1121
+ }>;
1122
+ get: (id: string, options?: import("./transport.js").RenterraCallOptions) => Promise<{
1123
+ id: string;
1124
+ name: string;
1125
+ revision: number;
1126
+ status: "draft";
1127
+ definition: {
1128
+ schema_version: 1;
1129
+ subject: "invoice" | "order";
1130
+ triggers: ({
1131
+ id: string;
1132
+ kind: "event";
1133
+ type: "invoice.paid";
1134
+ } | {
1135
+ id: string;
1136
+ kind: "event";
1137
+ type: "order.created" | "order.completed";
1138
+ } | {
1139
+ id: string;
1140
+ kind: "business_date";
1141
+ type: "unpaid_invoice_due";
1142
+ offset_hours: number;
1143
+ } | {
1144
+ id: string;
1145
+ kind: "business_date";
1146
+ type: "completed_order";
1147
+ offset_hours: number;
1148
+ })[];
1149
+ conditions: {
1150
+ all: ({
1151
+ field: "invoice.outstanding_balance_cents";
1152
+ operator: "greater_than" | "at_least" | "less_than" | "at_most" | "equals";
1153
+ value: number;
1154
+ } | {
1155
+ field: "order.starting_location_id";
1156
+ operator: "in";
1157
+ value: string[];
1158
+ })[];
1159
+ };
1160
+ actions: ({
1161
+ id: string;
1162
+ type: "order.close";
1163
+ } | {
1164
+ id: string;
1165
+ type: "message.send_template";
1166
+ template_id: string;
1167
+ channel: "email" | "sms";
1168
+ enabled?: boolean | undefined;
1169
+ recipient: "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | {
1170
+ first_available: ("customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact")[];
1171
+ };
1172
+ attachments?: "invoice_pdf"[] | undefined;
1173
+ })[];
1174
+ };
1175
+ created_at: string;
1176
+ updated_at: string;
1177
+ archived_at: string | null;
1178
+ }>;
1179
+ update: (id: string, input: {
1180
+ name: string;
1181
+ definition: {
1182
+ schema_version: 1;
1183
+ subject: "invoice" | "order";
1184
+ triggers: (({
1185
+ id: string;
1186
+ kind: "event";
1187
+ type: "invoice.paid";
1188
+ } | {
1189
+ id: string;
1190
+ kind: "event";
1191
+ type: "order.created" | "order.completed";
1192
+ }) | ({
1193
+ id: string;
1194
+ kind: "business_date";
1195
+ type: "unpaid_invoice_due";
1196
+ offset_hours: number;
1197
+ } | {
1198
+ id: string;
1199
+ kind: "business_date";
1200
+ type: "completed_order";
1201
+ offset_hours: number;
1202
+ }))[];
1203
+ conditions: {
1204
+ all: ({
1205
+ field: "invoice.outstanding_balance_cents";
1206
+ operator: "greater_than" | "at_least" | "less_than" | "at_most" | "equals";
1207
+ value: number;
1208
+ } | {
1209
+ field: "order.starting_location_id";
1210
+ operator: "in";
1211
+ value: string[];
1212
+ })[];
1213
+ };
1214
+ actions: ({
1215
+ id: string;
1216
+ type: "order.close";
1217
+ } | {
1218
+ id: string;
1219
+ type: "message.send_template";
1220
+ template_id: string;
1221
+ channel: "email" | "sms";
1222
+ enabled?: boolean;
1223
+ recipient: ("customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact") | {
1224
+ first_available: ("customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact")[];
1225
+ };
1226
+ attachments?: "invoice_pdf"[];
1227
+ })[];
1228
+ };
1229
+ revision: number;
1230
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
1231
+ id: string;
1232
+ name: string;
1233
+ revision: number;
1234
+ status: "draft";
1235
+ definition: {
1236
+ schema_version: 1;
1237
+ subject: "invoice" | "order";
1238
+ triggers: ({
1239
+ id: string;
1240
+ kind: "event";
1241
+ type: "invoice.paid";
1242
+ } | {
1243
+ id: string;
1244
+ kind: "event";
1245
+ type: "order.created" | "order.completed";
1246
+ } | {
1247
+ id: string;
1248
+ kind: "business_date";
1249
+ type: "unpaid_invoice_due";
1250
+ offset_hours: number;
1251
+ } | {
1252
+ id: string;
1253
+ kind: "business_date";
1254
+ type: "completed_order";
1255
+ offset_hours: number;
1256
+ })[];
1257
+ conditions: {
1258
+ all: ({
1259
+ field: "invoice.outstanding_balance_cents";
1260
+ operator: "greater_than" | "at_least" | "less_than" | "at_most" | "equals";
1261
+ value: number;
1262
+ } | {
1263
+ field: "order.starting_location_id";
1264
+ operator: "in";
1265
+ value: string[];
1266
+ })[];
1267
+ };
1268
+ actions: ({
1269
+ id: string;
1270
+ type: "order.close";
1271
+ } | {
1272
+ id: string;
1273
+ type: "message.send_template";
1274
+ template_id: string;
1275
+ channel: "email" | "sms";
1276
+ enabled?: boolean | undefined;
1277
+ recipient: "customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact" | {
1278
+ first_available: ("customer.primary_contact" | "customer.billing_contact" | "order.point_of_contact" | "invoice.order.point_of_contact")[];
1279
+ };
1280
+ attachments?: "invoice_pdf"[] | undefined;
1281
+ })[];
1282
+ };
1283
+ created_at: string;
1284
+ updated_at: string;
1285
+ archived_at: string | null;
1286
+ }>;
1287
+ delete: (id: string, query: {
1288
+ revision: number;
1289
+ }, options?: import("./transport.js").RenterraCallOptions) => Promise<{
1290
+ id: string;
1291
+ revision: number;
1292
+ }>;
1293
+ };
1294
+ };
1295
+ }>;
1296
+ export type RenterraSdk = Awaited<ReturnType<typeof connectRenterra>>;