-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstandard-terms.ts
289 lines (252 loc) · 8.79 KB
/
standard-terms.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
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../resource';
import * as Core from '../../core';
export class StandardTerms extends APIResource {
/**
* Creates a new standard term.
*/
create(params: StandardTermCreateParams, options?: Core.RequestOptions): Core.APIPromise<StandardTerm> {
const { conductorEndUserId, ...body } = params;
return this._client.post('/quickbooks-desktop/standard-terms', {
body,
...options,
headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
});
}
/**
* Retrieves a standard term by ID.
*/
retrieve(
id: string,
params: StandardTermRetrieveParams,
options?: Core.RequestOptions,
): Core.APIPromise<StandardTerm> {
const { conductorEndUserId } = params;
return this._client.get(`/quickbooks-desktop/standard-terms/${id}`, {
...options,
headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
});
}
/**
* Returns a list of standard terms. NOTE: QuickBooks Desktop does not support
* pagination for standard terms; hence, there is no `cursor` parameter. Users
* typically have few standard terms.
*/
list(
params: StandardTermListParams,
options?: Core.RequestOptions,
): Core.APIPromise<StandardTermListResponse> {
const { conductorEndUserId, ...query } = params;
return this._client.get('/quickbooks-desktop/standard-terms', {
query,
...options,
headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
});
}
}
export interface StandardTerm {
/**
* The unique identifier assigned by QuickBooks to this standard term. This ID is
* unique across all standard terms but not across different QuickBooks object
* types.
*/
id: string;
/**
* The date and time when this standard term 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 number of days within which payment must be received to qualify for the
* discount specified by `discountPercentage`.
*/
discountDays: number | null;
/**
* The discount percentage applied to the payment if received within the number of
* days specified by `discountDays`. The value is between 0 and 100.
*/
discountPercentage: string | null;
/**
* The number of days until payment is due.
*/
dueDays: number | null;
/**
* Indicates whether this standard term is active. Inactive objects are typically
* hidden from views and reports in QuickBooks. Defaults to `true`.
*/
isActive: boolean;
/**
* The case-insensitive unique name of this standard term, unique across all
* standard terms.
*
* **NOTE**: Standard terms do not have a `fullName` field because they are not
* hierarchical objects, which is why `name` is unique for them but not for objects
* that have parents.
*/
name: string;
/**
* The type of object. This value is always `"qbd_standard_term"`.
*/
objectType: 'qbd_standard_term';
/**
* The current QuickBooks-assigned revision number of this standard term 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 date and time when this standard term 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 interface StandardTermListResponse {
/**
* The array of standard terms.
*/
data: Array<StandardTerm>;
/**
* The type of object. This value is always `"list"`.
*/
objectType: 'list';
/**
* The endpoint URL where this list can be accessed.
*/
url: string;
}
export interface StandardTermCreateParams {
/**
* Body param: The case-insensitive unique name of this standard term, unique
* across all standard terms.
*
* **NOTE**: Standard terms do not have a `fullName` field because they are not
* hierarchical objects, which is why `name` is unique for them but not for objects
* that have parents.
*
* Maximum length: 31 characters.
*/
name: string;
/**
* Header param: The ID of the EndUser to receive this request (e.g.,
* `"Conductor-End-User-Id: {{END_USER_ID}}"`).
*/
conductorEndUserId: string;
/**
* Body param: The number of days within which payment must be received to qualify
* for the discount specified by `discountPercentage`.
*/
discountDays?: number;
/**
* Body param: The discount percentage applied to the payment if received within
* the number of days specified by `discountDays`. The value is between 0 and 100.
*/
discountPercentage?: string;
/**
* Body param: The number of days until payment is due.
*/
dueDays?: number;
/**
* Body param: Indicates whether this standard term is active. Inactive objects are
* typically hidden from views and reports in QuickBooks. Defaults to `true`.
*/
isActive?: boolean;
}
export interface StandardTermRetrieveParams {
/**
* The ID of the EndUser to receive this request (e.g.,
* `"Conductor-End-User-Id: {{END_USER_ID}}"`).
*/
conductorEndUserId: string;
}
export interface StandardTermListParams {
/**
* Header param: The ID of the EndUser to receive this request (e.g.,
* `"Conductor-End-User-Id: {{END_USER_ID}}"`).
*/
conductorEndUserId: string;
/**
* Query param: Filter for specific standard terms by their QuickBooks-assigned
* unique identifier(s).
*
* **IMPORTANT**: If you include this parameter, QuickBooks will ignore all other
* query parameters for this request.
*/
ids?: Array<string>;
/**
* Query param: The maximum number of objects to return.
*
* **IMPORTANT**: QuickBooks Desktop does not support cursor-based pagination for
* standard terms. This parameter will limit the response size, but you cannot
* fetch subsequent results using a cursor. For pagination, use the name-range
* parameters instead (e.g., `nameFrom=A&nameTo=B`).
*
* When this parameter is omitted, the endpoint returns all standard terms without
* limit, unlike paginated endpoints which default to 150 records. This is
* acceptable because standard terms typically have low record counts.
*/
limit?: number;
/**
* Query param: Filter for standard terms whose `name` contains this substring,
* case-insensitive. NOTE: If you use this parameter, you cannot also use
* `nameStartsWith` or `nameEndsWith`.
*/
nameContains?: string;
/**
* Query param: Filter for standard terms whose `name` ends with this substring,
* case-insensitive. NOTE: If you use this parameter, you cannot also use
* `nameContains` or `nameStartsWith`.
*/
nameEndsWith?: string;
/**
* Query param: Filter for standard terms whose `name` is alphabetically greater
* than or equal to this value.
*/
nameFrom?: string;
/**
* Query param: Filter for specific standard terms by their name(s),
* case-insensitive. Like `id`, `name` is a unique identifier for a standard term.
*
* **IMPORTANT**: If you include this parameter, QuickBooks will ignore all other
* query parameters for this request.
*/
names?: Array<string>;
/**
* Query param: Filter for standard terms whose `name` starts with this substring,
* case-insensitive. NOTE: If you use this parameter, you cannot also use
* `nameContains` or `nameEndsWith`.
*/
nameStartsWith?: string;
/**
* Query param: Filter for standard terms whose `name` is alphabetically less than
* or equal to this value.
*/
nameTo?: string;
/**
* Query param: Filter for standard terms that are active, inactive, or both.
*/
status?: 'active' | 'all' | 'inactive';
/**
* Query param: Filter for standard terms updated on or after this date and time,
* in ISO 8601 format (YYYY-MM-DDTHH:mm:ss). If you only provide a date
* (YYYY-MM-DD), the time is assumed to be 00:00:00 of that day.
*/
updatedAfter?: string;
/**
* Query param: Filter for standard terms updated on or before this date and time,
* in ISO 8601 format (YYYY-MM-DDTHH:mm:ss). If you only provide a date
* (YYYY-MM-DD), the time is assumed to be 23:59:59 of that day.
*/
updatedBefore?: string;
}
export declare namespace StandardTerms {
export {
type StandardTerm as StandardTerm,
type StandardTermListResponse as StandardTermListResponse,
type StandardTermCreateParams as StandardTermCreateParams,
type StandardTermRetrieveParams as StandardTermRetrieveParams,
type StandardTermListParams as StandardTermListParams,
};
}