-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathestimates.ts
2975 lines (2605 loc) · 98.8 KB
/
estimates.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../resource';
import * as Core from '../../core';
import { CursorPage, type CursorPageParams } from '../../pagination';
export class Estimates extends APIResource {
/**
* Creates a new estimate.
*/
create(params: EstimateCreateParams, options?: Core.RequestOptions): Core.APIPromise<Estimate> {
const { conductorEndUserId, ...body } = params;
return this._client.post('/quickbooks-desktop/estimates', {
body,
...options,
headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
});
}
/**
* Retrieves an estimate by ID.
*/
retrieve(
id: string,
params: EstimateRetrieveParams,
options?: Core.RequestOptions,
): Core.APIPromise<Estimate> {
const { conductorEndUserId } = params;
return this._client.get(`/quickbooks-desktop/estimates/${id}`, {
...options,
headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
});
}
/**
* Updates an existing estimate.
*/
update(id: string, params: EstimateUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Estimate> {
const { conductorEndUserId, ...body } = params;
return this._client.post(`/quickbooks-desktop/estimates/${id}`, {
body,
...options,
headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
});
}
/**
* Returns a list of estimates. Use the `cursor` parameter to paginate through the
* results.
*/
list(
params: EstimateListParams,
options?: Core.RequestOptions,
): Core.PagePromise<EstimatesCursorPage, Estimate> {
const { conductorEndUserId, ...query } = params;
return this._client.getAPIList('/quickbooks-desktop/estimates', EstimatesCursorPage, {
query,
...options,
headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
});
}
/**
* Permanently deletes a an estimate. The deletion will fail if the estimate is
* currently in use or has any linked transactions that are in use.
*/
delete(
id: string,
params: EstimateDeleteParams,
options?: Core.RequestOptions,
): Core.APIPromise<EstimateDeleteResponse> {
const { conductorEndUserId } = params;
return this._client.delete(`/quickbooks-desktop/estimates/${id}`, {
...options,
headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
});
}
}
export class EstimatesCursorPage extends CursorPage<Estimate> {}
export interface Estimate {
/**
* The unique identifier assigned by QuickBooks to this estimate. This ID is unique
* across all transaction types.
*/
id: string;
/**
* The estimate's billing address.
*/
billingAddress: Estimate.BillingAddress | null;
/**
* The estimate's class. Classes can be used to categorize objects into meaningful
* segments, such as department, location, or type of work. In QuickBooks, class
* tracking is off by default. A class defined here is automatically used in this
* estimate's line items unless overridden at the line item level.
*/
class: Estimate.Class | null;
/**
* The date and time when this estimate was created, in ISO 8601 format
* (YYYY-MM-DDThh:mm:ss±hh:mm). The time zone is the same as the user's time zone
* in QuickBooks.
*/
createdAt: string;
/**
* The estimate's currency. For built-in currencies, the name and code are standard
* international values. For user-defined currencies, all values are editable.
*/
currency: Estimate.Currency | null;
/**
* The customer or customer-job associated with this estimate.
*/
customer: Estimate.Customer;
/**
* The message to display to the customer on the estimate.
*/
customerMessage: Estimate.CustomerMessage | null;
/**
* The custom fields for the estimate object, added as user-defined data
* extensions, not included in the standard QuickBooks object.
*/
customFields: Array<Estimate.CustomField>;
/**
* The predefined template in QuickBooks that determines the layout and formatting
* for this estimate when printed or displayed.
*/
documentTemplate: Estimate.DocumentTemplate | null;
/**
* The date by which this estimate must be paid, in ISO 8601 format (YYYY-MM-DD).
*/
dueDate: string | null;
/**
* The market exchange rate between this estimate's currency and the home currency
* in QuickBooks at the time of this transaction. Represented as a decimal value
* (e.g., 1.2345 for 1 EUR = 1.2345 USD if USD is the home currency).
*/
exchangeRate: number | null;
/**
* A globally unique identifier (GUID) you, the developer, can provide for tracking
* this object in your external system. This field is immutable and can only be set
* during object creation.
*/
externalId: string | null;
/**
* Indicates whether this estimate is active. Inactive objects are typically hidden
* from views and reports in QuickBooks. Defaults to `true`.
*/
isActive: boolean;
/**
* Indicates whether this estimate is included in the queue of documents for
* QuickBooks to email to the customer.
*/
isQueuedForEmail: boolean | null;
/**
* The estimate's line item groups, each representing a predefined set of related
* items.
*/
lineGroups: Array<Estimate.LineGroup>;
/**
* The estimate's line items, each representing a single product or service quoted.
*/
lines: Array<Estimate.Line>;
/**
* The estimate's linked transactions, such as payments applied, credits used, or
* associated purchase orders.
*
* **IMPORTANT**: You must specify the parameter `includeLinkedTransactions` when
* fetching a list of estimates to receive this field because it is not returned by
* default.
*/
linkedTransactions: Array<Estimate.LinkedTransaction>;
/**
* A memo or note for this estimate that appears in reports, but not on the
* estimate. Use `customerMessage` to add a note to this estimate.
*/
memo: string | null;
/**
* The type of object. This value is always `"qbd_estimate"`.
*/
objectType: 'qbd_estimate';
/**
* A built-in custom field for additional information specific to this estimate.
* Unlike the user-defined fields in the `customFields` array, this is a standard
* QuickBooks field that exists for all estimates for convenience. Developers often
* use this field for tracking information that doesn't fit into other standard
* QuickBooks fields. Unlike `otherCustomField1` and `otherCustomField2`, which are
* line item fields, this exists at the transaction level. Hidden by default in the
* QuickBooks UI.
*/
otherCustomField: string | null;
/**
* The customer's Purchase Order (PO) number associated with this estimate. This
* field is often used to cross-reference the estimate with the customer's
* purchasing system.
*/
purchaseOrderNumber: string | null;
/**
* The case-sensitive user-defined reference number for this estimate, which can be
* used to identify the transaction in QuickBooks. This value is not required to be
* unique and can be arbitrarily changed by the QuickBooks user.
*/
refNumber: string | null;
/**
* The current QuickBooks-assigned revision number of this estimate object, which
* changes each time the object is modified. When updating this object, you must
* provide the most recent `revisionNumber` to ensure you're working with the
* latest data; otherwise, the update will return an error.
*/
revisionNumber: string;
/**
* The estimate's sales representative. Sales representatives can be employees,
* vendors, or other names in QuickBooks.
*/
salesRepresentative: Estimate.SalesRepresentative | null;
/**
* The sales-tax code for this estimate, determining whether it is taxable or
* non-taxable. This can be overridden at the transaction-line level.
*
* Default codes include "Non" (non-taxable) and "Tax" (taxable), but custom codes
* can also be created in QuickBooks. If QuickBooks is not set up to charge sales
* tax (via the "Do You Charge Sales Tax?" preference), it will assign the default
* non-taxable code to all sales.
*/
salesTaxCode: Estimate.SalesTaxCode | null;
/**
* The sales-tax item used to calculate the actual tax amount for this estimate's
* transactions by applying a specific tax rate collected for a single tax agency.
* Unlike `salesTaxCode`, which only indicates general taxability, this field
* drives the actual tax calculation and reporting.
*/
salesTaxItem: Estimate.SalesTaxItem | null;
/**
* The sales tax percentage applied to this estimate, represented as a decimal
* string.
*/
salesTaxPercentage: string | null;
/**
* The total amount of sales tax charged for this estimate, represented as a
* decimal string.
*/
salesTaxTotal: string;
/**
* The origin location from where the product associated with this estimate is
* shipped. This is the point at which ownership and liability for goods transfer
* from seller to buyer. Internally, QuickBooks uses the term "FOB" for this field,
* which stands for "freight on board". This field is informational and has no
* accounting implications.
*/
shipmentOrigin: string | null;
/**
* The estimate's shipping address.
*/
shippingAddress: Estimate.ShippingAddress | null;
/**
* The subtotal of this estimate, which is the sum of all estimate lines before
* taxes and payments are applied, represented as a decimal string.
*/
subtotal: string;
/**
* The estimate's payment terms, defining when payment is due and any applicable
* discounts.
*/
terms: Estimate.Terms | null;
/**
* The total monetary amount of this estimate, equivalent to the sum of the amounts
* in `lines` and `lineGroups`, represented as a decimal string.
*/
totalAmount: string;
/**
* The total monetary amount of this estimate converted to the home currency of the
* QuickBooks company file. Represented as a decimal string.
*/
totalAmountInHomeCurrency: string | null;
/**
* The date of this estimate, in ISO 8601 format (YYYY-MM-DD).
*/
transactionDate: string;
/**
* The date and time when this estimate was last updated, in ISO 8601 format
* (YYYY-MM-DDThh:mm:ss±hh:mm). The time zone is the same as the user's time zone
* in QuickBooks.
*/
updatedAt: string;
}
export namespace Estimate {
/**
* The estimate's billing address.
*/
export interface BillingAddress {
/**
* The city, district, suburb, town, or village name of the address.
*/
city: string | null;
/**
* The country name of the address.
*/
country: string | null;
/**
* The first line of the address (e.g., street, PO Box, or company name).
*/
line1: string | null;
/**
* The second line of the address, if needed (e.g., apartment, suite, unit, or
* building).
*/
line2: string | null;
/**
* The third line of the address, if needed.
*/
line3: string | null;
/**
* The fourth line of the address, if needed.
*/
line4: string | null;
/**
* The fifth line of the address, if needed.
*/
line5: string | null;
/**
* A note written at the bottom of the address in the form in which it appears,
* such as the invoice form.
*/
note: string | null;
/**
* The postal code or ZIP code of the address.
*/
postalCode: string | null;
/**
* The state, county, province, or region name of the address.
*/
state: string | null;
}
/**
* The estimate's class. Classes can be used to categorize objects into meaningful
* segments, such as department, location, or type of work. In QuickBooks, class
* tracking is off by default. A class defined here is automatically used in this
* estimate's line items unless overridden at the line item level.
*/
export interface Class {
/**
* The unique identifier assigned by QuickBooks to this object. This ID is unique
* across all objects of the same type, but not across different QuickBooks object
* types.
*/
id: string | null;
/**
* The fully-qualified unique name for this object, formed by combining the names
* of its parent objects with its own `name`, separated by colons. Not
* case-sensitive.
*/
fullName: string | null;
}
/**
* The estimate's currency. For built-in currencies, the name and code are standard
* international values. For user-defined currencies, all values are editable.
*/
export interface Currency {
/**
* The unique identifier assigned by QuickBooks to this object. This ID is unique
* across all objects of the same type, but not across different QuickBooks object
* types.
*/
id: string | null;
/**
* The fully-qualified unique name for this object, formed by combining the names
* of its parent objects with its own `name`, separated by colons. Not
* case-sensitive.
*/
fullName: string | null;
}
/**
* The customer or customer-job associated with this estimate.
*/
export interface Customer {
/**
* The unique identifier assigned by QuickBooks to this object. This ID is unique
* across all objects of the same type, but not across different QuickBooks object
* types.
*/
id: string | null;
/**
* The fully-qualified unique name for this object, formed by combining the names
* of its parent objects with its own `name`, separated by colons. Not
* case-sensitive.
*/
fullName: string | null;
}
/**
* The message to display to the customer on the estimate.
*/
export interface CustomerMessage {
/**
* The unique identifier assigned by QuickBooks to this object. This ID is unique
* across all objects of the same type, but not across different QuickBooks object
* types.
*/
id: string | null;
/**
* The fully-qualified unique name for this object, formed by combining the names
* of its parent objects with its own `name`, separated by colons. Not
* case-sensitive.
*/
fullName: string | null;
}
export interface CustomField {
/**
* The name of the custom field, unique for the specified `ownerId`. For public
* custom fields, this name is visible as a label in the QuickBooks UI.
*/
name: string;
/**
* The identifier of the owner of the custom field, which QuickBooks internally
* calls a "data extension". For public custom fields visible in the UI, such as
* those added by the QuickBooks user, this is always "0". For private custom
* fields that are only visible to the application that created them, this is a
* valid GUID identifying the owning application. Internally, Conductor always
* fetches all public custom fields (those with an `ownerId` of "0") for all
* objects.
*/
ownerId: string;
/**
* The data type of this custom field.
*/
type:
| 'amount_type'
| 'date_time_type'
| 'integer_type'
| 'percent_type'
| 'price_type'
| 'quantity_type'
| 'string_1024_type'
| 'string_255_type';
/**
* The value of this custom field. The maximum length depends on the field's data
* type.
*/
value: string;
}
/**
* The predefined template in QuickBooks that determines the layout and formatting
* for this estimate when printed or displayed.
*/
export interface DocumentTemplate {
/**
* The unique identifier assigned by QuickBooks to this object. This ID is unique
* across all objects of the same type, but not across different QuickBooks object
* types.
*/
id: string | null;
/**
* The fully-qualified unique name for this object, formed by combining the names
* of its parent objects with its own `name`, separated by colons. Not
* case-sensitive.
*/
fullName: string | null;
}
export interface LineGroup {
/**
* The unique identifier assigned by QuickBooks to this estimate line group. This
* ID is unique across all transaction line types.
*/
id: string;
/**
* The custom fields for the estimate line group object, added as user-defined data
* extensions, not included in the standard QuickBooks object.
*/
customFields: Array<LineGroup.CustomField>;
/**
* A description of this estimate line group.
*/
description: string | null;
/**
* The estimate line group's item group, representing a predefined set of items
* bundled because they are commonly purchased together or grouped for faster
* entry.
*/
itemGroup: LineGroup.ItemGroup;
/**
* The estimate line group's line items, each representing a single product or
* service quoted.
*/
lines: Array<LineGroup.Line>;
/**
* The type of object. This value is always `"qbd_estimate_line_group"`.
*/
objectType: 'qbd_estimate_line_group';
/**
* Specifies an alternative unit-of-measure set when updating this estimate line
* group's `unitOfMeasure` field (e.g., "pound" or "kilogram"). This allows you to
* select units from a different set than the item's default unit-of-measure set,
* which remains unchanged on the item itself. The override applies only to this
* specific line. For example, you can sell an item typically measured in volume
* units using weight units in a specific transaction by specifying a different
* unit-of-measure set with this field.
*/
overrideUnitOfMeasureSet: LineGroup.OverrideUnitOfMeasureSet | null;
/**
* The quantity of the item group associated with this estimate line group. This
* field cannot be cleared.
*
* **NOTE**: Do not use this field if the associated item group is a discount item
* group.
*/
quantity: number | null;
/**
* Indicates whether the individual items in this estimate line group and their
* separate amounts appear on printed forms.
*/
shouldPrintItemsInGroup: boolean;
/**
* The total monetary amount of this estimate line group, equivalent to the sum of
* the amounts in `lines`, represented as a decimal string.
*/
totalAmount: string;
/**
* The unit-of-measure used for the `quantity` in this estimate line group. Must be
* a valid unit within the item's available units of measure.
*/
unitOfMeasure: string | null;
}
export namespace LineGroup {
export interface CustomField {
/**
* The name of the custom field, unique for the specified `ownerId`. For public
* custom fields, this name is visible as a label in the QuickBooks UI.
*/
name: string;
/**
* The identifier of the owner of the custom field, which QuickBooks internally
* calls a "data extension". For public custom fields visible in the UI, such as
* those added by the QuickBooks user, this is always "0". For private custom
* fields that are only visible to the application that created them, this is a
* valid GUID identifying the owning application. Internally, Conductor always
* fetches all public custom fields (those with an `ownerId` of "0") for all
* objects.
*/
ownerId: string;
/**
* The data type of this custom field.
*/
type:
| 'amount_type'
| 'date_time_type'
| 'integer_type'
| 'percent_type'
| 'price_type'
| 'quantity_type'
| 'string_1024_type'
| 'string_255_type';
/**
* The value of this custom field. The maximum length depends on the field's data
* type.
*/
value: string;
}
/**
* The estimate line group's item group, representing a predefined set of items
* bundled because they are commonly purchased together or grouped for faster
* entry.
*/
export interface ItemGroup {
/**
* The unique identifier assigned by QuickBooks to this object. This ID is unique
* across all objects of the same type, but not across different QuickBooks object
* types.
*/
id: string | null;
/**
* The fully-qualified unique name for this object, formed by combining the names
* of its parent objects with its own `name`, separated by colons. Not
* case-sensitive.
*/
fullName: string | null;
}
export interface Line {
/**
* The unique identifier assigned by QuickBooks to this estimate line. This ID is
* unique across all transaction line types.
*/
id: string;
/**
* The monetary amount of this estimate line, represented as a decimal string. If
* both `quantity` and `rate` are specified but not `amount`, QuickBooks will use
* them to calculate `amount`. If `amount`, `rate`, and `quantity` are all
* unspecified, then QuickBooks will calculate `amount` based on a `quantity` of
* `1` and the suggested `rate`. This field cannot be cleared.
*/
amount: string | null;
/**
* The estimate line's class. Classes can be used to categorize objects into
* meaningful segments, such as department, location, or type of work. In
* QuickBooks, class tracking is off by default. If a class is specified for the
* entire parent transaction, it is automatically applied to all estimate lines
* unless overridden here, at the transaction line level.
*/
class: Line.Class | null;
/**
* The custom fields for the estimate line object, added as user-defined data
* extensions, not included in the standard QuickBooks object.
*/
customFields: Array<Line.CustomField>;
/**
* A description of this estimate line.
*/
description: string | null;
/**
* The site location where inventory for the item associated with this estimate
* line is stored.
*/
inventorySite: Line.InventorySite | null;
/**
* The specific location (e.g., bin or shelf) within the inventory site where the
* item associated with this estimate line is stored.
*/
inventorySiteLocation: Line.InventorySiteLocation | null;
/**
* The item associated with this estimate line. This can refer to any good or
* service that the business buys or sells, including item types such as a service
* item, inventory item, or special calculation item like a discount item or
* sales-tax item.
*/
item: Line.Item | null;
/**
* The markup that will be passed on to the customer for this item on this estimate
* line. `amount = (quantity * rate) * (1 + markupRate)`
*/
markupRate: string | null;
/**
* The markup, expressed as a percentage, that will be passed on to the customer
* for this item on this estimate line.
* `amount = (quantity * rate) * (1 + markupRatePercent/100)`
*/
markupRatePercent: string | null;
/**
* The type of object. This value is always `"qbd_estimate_line"`.
*/
objectType: 'qbd_estimate_line';
/**
* A built-in custom field for additional information specific to this estimate
* line. Unlike the user-defined fields in the `customFields` array, this is a
* standard QuickBooks field that exists for all estimate lines for convenience.
* Developers often use this field for tracking information that doesn't fit into
* other standard QuickBooks fields. Hidden by default in the QuickBooks UI.
*/
otherCustomField1: string | null;
/**
* A second built-in custom field for additional information specific to this
* estimate line. Unlike the user-defined fields in the `customFields` array, this
* is a standard QuickBooks field that exists for all estimate lines for
* convenience. Like `otherCustomField1`, developers often use this field for
* tracking information that doesn't fit into other standard QuickBooks fields.
* Hidden by default in the QuickBooks UI.
*/
otherCustomField2: string | null;
/**
* Specifies an alternative unit-of-measure set when updating this estimate line's
* `unitOfMeasure` field (e.g., "pound" or "kilogram"). This allows you to select
* units from a different set than the item's default unit-of-measure set, which
* remains unchanged on the item itself. The override applies only to this specific
* line. For example, you can sell an item typically measured in volume units using
* weight units in a specific transaction by specifying a different unit-of-measure
* set with this field.
*/
overrideUnitOfMeasureSet: Line.OverrideUnitOfMeasureSet | null;
/**
* The quantity of the item associated with this estimate line. This field cannot
* be cleared.
*
* **NOTE**: Do not use this field if the associated item is a discount item.
*/
quantity: number | null;
/**
* The price per unit for this estimate line. If both `rate` and `amount` are
* specified, `rate` will be ignored. If both `quantity` and `amount` are specified
* but not `rate`, QuickBooks will use them to calculate `rate`. Represented as a
* decimal string. This field cannot be cleared.
*/
rate: string | null;
/**
* The price of this estimate line expressed as a percentage. Typically used for
* discount or markup items.
*/
ratePercent: string | null;
/**
* The sales-tax code for this estimate line, determining whether it is taxable or
* non-taxable. If set, this overrides any sales-tax codes defined on the parent
* transaction or the associated item.
*
* Default codes include "Non" (non-taxable) and "Tax" (taxable), but custom codes
* can also be created in QuickBooks. If QuickBooks is not set up to charge sales
* tax (via the "Do You Charge Sales Tax?" preference), it will assign the default
* non-taxable code to all sales.
*/
salesTaxCode: Line.SalesTaxCode | null;
/**
* The unit-of-measure used for the `quantity` in this estimate line. Must be a
* valid unit within the item's available units of measure.
*/
unitOfMeasure: string | null;
}
export namespace Line {
/**
* The estimate line's class. Classes can be used to categorize objects into
* meaningful segments, such as department, location, or type of work. In
* QuickBooks, class tracking is off by default. If a class is specified for the
* entire parent transaction, it is automatically applied to all estimate lines
* unless overridden here, at the transaction line level.
*/
export interface Class {
/**
* The unique identifier assigned by QuickBooks to this object. This ID is unique
* across all objects of the same type, but not across different QuickBooks object
* types.
*/
id: string | null;
/**
* The fully-qualified unique name for this object, formed by combining the names
* of its parent objects with its own `name`, separated by colons. Not
* case-sensitive.
*/
fullName: string | null;
}
export interface CustomField {
/**
* The name of the custom field, unique for the specified `ownerId`. For public
* custom fields, this name is visible as a label in the QuickBooks UI.
*/
name: string;
/**
* The identifier of the owner of the custom field, which QuickBooks internally
* calls a "data extension". For public custom fields visible in the UI, such as
* those added by the QuickBooks user, this is always "0". For private custom
* fields that are only visible to the application that created them, this is a
* valid GUID identifying the owning application. Internally, Conductor always
* fetches all public custom fields (those with an `ownerId` of "0") for all
* objects.
*/
ownerId: string;
/**
* The data type of this custom field.
*/
type:
| 'amount_type'
| 'date_time_type'
| 'integer_type'
| 'percent_type'
| 'price_type'
| 'quantity_type'
| 'string_1024_type'
| 'string_255_type';
/**
* The value of this custom field. The maximum length depends on the field's data
* type.
*/
value: string;
}
/**
* The site location where inventory for the item associated with this estimate
* line is stored.
*/
export interface InventorySite {
/**
* The unique identifier assigned by QuickBooks to this object. This ID is unique
* across all objects of the same type, but not across different QuickBooks object
* types.
*/
id: string | null;
/**
* The fully-qualified unique name for this object, formed by combining the names
* of its parent objects with its own `name`, separated by colons. Not
* case-sensitive.
*/
fullName: string | null;
}
/**
* The specific location (e.g., bin or shelf) within the inventory site where the
* item associated with this estimate line is stored.
*/
export interface InventorySiteLocation {
/**
* The unique identifier assigned by QuickBooks to this object. This ID is unique
* across all objects of the same type, but not across different QuickBooks object
* types.
*/
id: string | null;
/**
* The fully-qualified unique name for this object, formed by combining the names
* of its parent objects with its own `name`, separated by colons. Not
* case-sensitive.
*/
fullName: string | null;
}
/**
* The item associated with this estimate line. This can refer to any good or
* service that the business buys or sells, including item types such as a service
* item, inventory item, or special calculation item like a discount item or
* sales-tax item.
*/
export interface Item {
/**
* The unique identifier assigned by QuickBooks to this object. This ID is unique
* across all objects of the same type, but not across different QuickBooks object
* types.
*/
id: string | null;
/**
* The fully-qualified unique name for this object, formed by combining the names
* of its parent objects with its own `name`, separated by colons. Not
* case-sensitive.
*/
fullName: string | null;
}
/**
* Specifies an alternative unit-of-measure set when updating this estimate line's
* `unitOfMeasure` field (e.g., "pound" or "kilogram"). This allows you to select
* units from a different set than the item's default unit-of-measure set, which
* remains unchanged on the item itself. The override applies only to this specific
* line. For example, you can sell an item typically measured in volume units using
* weight units in a specific transaction by specifying a different unit-of-measure
* set with this field.
*/
export interface OverrideUnitOfMeasureSet {
/**
* The unique identifier assigned by QuickBooks to this object. This ID is unique
* across all objects of the same type, but not across different QuickBooks object
* types.
*/
id: string | null;
/**
* The fully-qualified unique name for this object, formed by combining the names
* of its parent objects with its own `name`, separated by colons. Not
* case-sensitive.
*/
fullName: string | null;
}
/**
* The sales-tax code for this estimate line, determining whether it is taxable or
* non-taxable. If set, this overrides any sales-tax codes defined on the parent
* transaction or the associated item.
*
* Default codes include "Non" (non-taxable) and "Tax" (taxable), but custom codes
* can also be created in QuickBooks. If QuickBooks is not set up to charge sales
* tax (via the "Do You Charge Sales Tax?" preference), it will assign the default
* non-taxable code to all sales.
*/
export interface SalesTaxCode {
/**
* The unique identifier assigned by QuickBooks to this object. This ID is unique
* across all objects of the same type, but not across different QuickBooks object
* types.
*/
id: string | null;
/**
* The fully-qualified unique name for this object, formed by combining the names
* of its parent objects with its own `name`, separated by colons. Not
* case-sensitive.
*/
fullName: string | null;
}
}
/**
* Specifies an alternative unit-of-measure set when updating this estimate line
* group's `unitOfMeasure` field (e.g., "pound" or "kilogram"). This allows you to
* select units from a different set than the item's default unit-of-measure set,
* which remains unchanged on the item itself. The override applies only to this
* specific line. For example, you can sell an item typically measured in volume
* units using weight units in a specific transaction by specifying a different
* unit-of-measure set with this field.
*/
export interface OverrideUnitOfMeasureSet {
/**
* The unique identifier assigned by QuickBooks to this object. This ID is unique
* across all objects of the same type, but not across different QuickBooks object
* types.
*/
id: string | null;
/**
* The fully-qualified unique name for this object, formed by combining the names
* of its parent objects with its own `name`, separated by colons. Not
* case-sensitive.
*/
fullName: string | null;
}
}
export interface Line {
/**