@augno/sdk 0.17.0 → 0.18.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/CHANGELOG.md +7 -3
- package/package.json +1 -1
- package/resources/finance/payment-terms.d.mts +5 -5
- package/resources/finance/payment-terms.d.mts.map +1 -1
- package/resources/finance/payment-terms.d.ts +5 -5
- package/resources/finance/payment-terms.d.ts.map +1 -1
- package/resources/finance/payment-terms.js.map +1 -1
- package/resources/finance/payment-terms.mjs.map +1 -1
- package/resources/operations/carriers/carriers.d.mts +5 -5
- package/resources/operations/carriers/carriers.d.mts.map +1 -1
- package/resources/operations/carriers/carriers.d.ts +5 -5
- package/resources/operations/carriers/carriers.d.ts.map +1 -1
- package/resources/operations/carriers/service-levels.d.mts +5 -5
- package/resources/operations/carriers/service-levels.d.mts.map +1 -1
- package/resources/operations/carriers/service-levels.d.ts +5 -5
- package/resources/operations/carriers/service-levels.d.ts.map +1 -1
- package/resources/operations/shipments/actions.d.mts +3 -3
- package/resources/operations/shipments/actions.d.mts.map +1 -1
- package/resources/operations/shipments/actions.d.ts +3 -3
- package/resources/operations/shipments/actions.d.ts.map +1 -1
- package/resources/operations/shipping-terms.d.mts +5 -5
- package/resources/operations/shipping-terms.d.mts.map +1 -1
- package/resources/operations/shipping-terms.d.ts +5 -5
- package/resources/operations/shipping-terms.d.ts.map +1 -1
- package/resources/operations/shipping-terms.js.map +1 -1
- package/resources/operations/shipping-terms.mjs.map +1 -1
- package/resources/sales/account-prices/account-prices.d.mts +999 -0
- package/resources/sales/account-prices/account-prices.d.mts.map +1 -0
- package/resources/sales/account-prices/account-prices.d.ts +999 -0
- package/resources/sales/account-prices/account-prices.d.ts.map +1 -0
- package/resources/sales/account-prices/account-prices.js +143 -0
- package/resources/sales/account-prices/account-prices.js.map +1 -0
- package/resources/sales/account-prices/account-prices.mjs +138 -0
- package/resources/sales/account-prices/account-prices.mjs.map +1 -0
- package/resources/sales/account-prices/actions.d.mts +58 -0
- package/resources/sales/account-prices/actions.d.mts.map +1 -0
- package/resources/sales/account-prices/actions.d.ts +58 -0
- package/resources/sales/account-prices/actions.d.ts.map +1 -0
- package/resources/sales/account-prices/actions.js +44 -0
- package/resources/sales/account-prices/actions.js.map +1 -0
- package/resources/sales/account-prices/actions.mjs +40 -0
- package/resources/sales/account-prices/actions.mjs.map +1 -0
- package/resources/sales/account-prices/index.d.mts +3 -0
- package/resources/sales/account-prices/index.d.mts.map +1 -0
- package/resources/sales/account-prices/index.d.ts +3 -0
- package/resources/sales/account-prices/index.d.ts.map +1 -0
- package/resources/sales/account-prices/index.js +9 -0
- package/resources/sales/account-prices/index.js.map +1 -0
- package/resources/sales/account-prices/index.mjs +4 -0
- package/resources/sales/account-prices/index.mjs.map +1 -0
- package/resources/sales/account-prices.d.mts +2 -0
- package/resources/sales/account-prices.d.mts.map +1 -0
- package/resources/sales/account-prices.d.ts +2 -0
- package/resources/sales/account-prices.d.ts.map +1 -0
- package/resources/sales/account-prices.js +6 -0
- package/resources/sales/account-prices.js.map +1 -0
- package/resources/sales/account-prices.mjs +3 -0
- package/resources/sales/account-prices.mjs.map +1 -0
- package/resources/sales/customers/actions.d.mts +2 -2
- package/resources/sales/customers/actions.d.mts.map +1 -1
- package/resources/sales/customers/actions.d.ts +2 -2
- package/resources/sales/customers/actions.d.ts.map +1 -1
- package/resources/sales/customers/actions.js.map +1 -1
- package/resources/sales/customers/actions.mjs.map +1 -1
- package/resources/sales/customers/customers.d.mts +6 -564
- package/resources/sales/customers/customers.d.mts.map +1 -1
- package/resources/sales/customers/customers.d.ts +6 -564
- package/resources/sales/customers/customers.d.ts.map +1 -1
- package/resources/sales/customers/customers.js.map +1 -1
- package/resources/sales/customers/customers.mjs.map +1 -1
- package/resources/sales/customers/index.d.mts +1 -1
- package/resources/sales/customers/index.d.mts.map +1 -1
- package/resources/sales/customers/index.d.ts +1 -1
- package/resources/sales/customers/index.d.ts.map +1 -1
- package/resources/sales/customers/index.js.map +1 -1
- package/resources/sales/customers/index.mjs.map +1 -1
- package/resources/sales/index.d.mts +6 -3
- package/resources/sales/index.d.mts.map +1 -1
- package/resources/sales/index.d.ts +6 -3
- package/resources/sales/index.d.ts.map +1 -1
- package/resources/sales/index.js +15 -9
- package/resources/sales/index.js.map +1 -1
- package/resources/sales/index.mjs +3 -0
- package/resources/sales/index.mjs.map +1 -1
- package/resources/sales/order-discounts/actions.d.mts +85 -0
- package/resources/sales/order-discounts/actions.d.mts.map +1 -0
- package/resources/sales/order-discounts/actions.d.ts +85 -0
- package/resources/sales/order-discounts/actions.d.ts.map +1 -0
- package/resources/sales/order-discounts/actions.js +35 -0
- package/resources/sales/order-discounts/actions.js.map +1 -0
- package/resources/sales/order-discounts/actions.mjs +31 -0
- package/resources/sales/order-discounts/actions.mjs.map +1 -0
- package/resources/sales/order-discounts/index.d.mts +3 -0
- package/resources/sales/order-discounts/index.d.mts.map +1 -0
- package/resources/sales/order-discounts/index.d.ts +3 -0
- package/resources/sales/order-discounts/index.d.ts.map +1 -0
- package/resources/sales/order-discounts/index.js +9 -0
- package/resources/sales/order-discounts/index.js.map +1 -0
- package/resources/sales/order-discounts/index.mjs +4 -0
- package/resources/sales/order-discounts/index.mjs.map +1 -0
- package/resources/sales/order-discounts/order-discounts.d.mts +365 -0
- package/resources/sales/order-discounts/order-discounts.d.mts.map +1 -0
- package/resources/sales/order-discounts/order-discounts.d.ts +365 -0
- package/resources/sales/order-discounts/order-discounts.d.ts.map +1 -0
- package/resources/sales/order-discounts/order-discounts.js +125 -0
- package/resources/sales/order-discounts/order-discounts.js.map +1 -0
- package/resources/sales/order-discounts/order-discounts.mjs +120 -0
- package/resources/sales/order-discounts/order-discounts.mjs.map +1 -0
- package/resources/sales/order-discounts.d.mts +2 -0
- package/resources/sales/order-discounts.d.mts.map +1 -0
- package/resources/sales/order-discounts.d.ts +2 -0
- package/resources/sales/order-discounts.d.ts.map +1 -0
- package/resources/sales/order-discounts.js +6 -0
- package/resources/sales/order-discounts.js.map +1 -0
- package/resources/sales/order-discounts.mjs +3 -0
- package/resources/sales/order-discounts.mjs.map +1 -0
- package/resources/sales/priorities.d.mts +4 -44
- package/resources/sales/priorities.d.mts.map +1 -1
- package/resources/sales/priorities.d.ts +4 -44
- package/resources/sales/priorities.d.ts.map +1 -1
- package/resources/sales/priorities.js.map +1 -1
- package/resources/sales/priorities.mjs.map +1 -1
- package/resources/sales/sales-orders/index.d.mts +1 -1
- package/resources/sales/sales-orders/index.d.mts.map +1 -1
- package/resources/sales/sales-orders/index.d.ts +1 -1
- package/resources/sales/sales-orders/index.d.ts.map +1 -1
- package/resources/sales/sales-orders/index.js.map +1 -1
- package/resources/sales/sales-orders/index.mjs.map +1 -1
- package/resources/sales/sales-orders/lines/lines.d.mts +2 -2
- package/resources/sales/sales-orders/lines/lines.d.mts.map +1 -1
- package/resources/sales/sales-orders/lines/lines.d.ts +2 -2
- package/resources/sales/sales-orders/lines/lines.d.ts.map +1 -1
- package/resources/sales/sales-orders/sales-orders.d.mts +10 -69
- package/resources/sales/sales-orders/sales-orders.d.mts.map +1 -1
- package/resources/sales/sales-orders/sales-orders.d.ts +10 -69
- package/resources/sales/sales-orders/sales-orders.d.ts.map +1 -1
- package/resources/sales/sales-orders/sales-orders.js.map +1 -1
- package/resources/sales/sales-orders/sales-orders.mjs.map +1 -1
- package/resources/sales/sales.d.mts +18 -6
- package/resources/sales/sales.d.mts.map +1 -1
- package/resources/sales/sales.d.ts +18 -6
- package/resources/sales/sales.d.ts.map +1 -1
- package/resources/sales/sales.js +12 -0
- package/resources/sales/sales.js.map +1 -1
- package/resources/sales/sales.mjs +12 -0
- package/resources/sales/sales.mjs.map +1 -1
- package/resources/sales/volume-discounts.d.mts +684 -0
- package/resources/sales/volume-discounts.d.mts.map +1 -0
- package/resources/sales/volume-discounts.d.ts +684 -0
- package/resources/sales/volume-discounts.d.ts.map +1 -0
- package/resources/sales/volume-discounts.js +152 -0
- package/resources/sales/volume-discounts.js.map +1 -0
- package/resources/sales/volume-discounts.mjs +148 -0
- package/resources/sales/volume-discounts.mjs.map +1 -0
- package/src/resources/finance/payment-terms.ts +8 -5
- package/src/resources/operations/carriers/carriers.ts +5 -5
- package/src/resources/operations/carriers/service-levels.ts +5 -5
- package/src/resources/operations/shipments/actions.ts +3 -3
- package/src/resources/operations/shipping-terms.ts +8 -5
- package/src/resources/sales/account-prices/account-prices.ts +1191 -0
- package/src/resources/sales/account-prices/actions.ts +74 -0
- package/src/resources/sales/account-prices/index.ts +27 -0
- package/src/resources/sales/account-prices.ts +3 -0
- package/src/resources/sales/customers/actions.ts +6 -2
- package/src/resources/sales/customers/customers.ts +5 -658
- package/src/resources/sales/customers/index.ts +0 -11
- package/src/resources/sales/index.ts +50 -13
- package/src/resources/sales/order-discounts/actions.ts +102 -0
- package/src/resources/sales/order-discounts/index.ts +13 -0
- package/src/resources/sales/order-discounts/order-discounts.ts +442 -0
- package/src/resources/sales/order-discounts.ts +3 -0
- package/src/resources/sales/priorities.ts +3 -51
- package/src/resources/sales/sales-orders/index.ts +0 -1
- package/src/resources/sales/sales-orders/lines/lines.ts +2 -2
- package/src/resources/sales/sales-orders/sales-orders.ts +9 -79
- package/src/resources/sales/sales.ts +113 -26
- package/src/resources/sales/volume-discounts.ts +813 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,813 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as AccountGroupsAPI from './account-groups';
|
|
5
|
+
import * as APIKeysAPI from '../auth/api-keys/api-keys';
|
|
6
|
+
import * as ItemCategoriesAPI from '../catalog/item-categories/item-categories';
|
|
7
|
+
import * as ProductLinesAPI from '../catalog/product-lines/product-lines';
|
|
8
|
+
import * as PropertiesAPI from '../catalog/properties/properties';
|
|
9
|
+
import * as UnitsAPI from '../catalog/units/units';
|
|
10
|
+
import { APIPromise } from '../../core/api-promise';
|
|
11
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
12
|
+
import { path } from '../../internal/utils/path';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* List and manage volume discounts.
|
|
16
|
+
*/
|
|
17
|
+
export class VolumeDiscounts extends APIResource {
|
|
18
|
+
/**
|
|
19
|
+
* Returns a paginated list of volume discounts, newest first.
|
|
20
|
+
*
|
|
21
|
+
* The search term matches the discount name, the name of a customer group it is
|
|
22
|
+
* scoped to, or the name of a product line it is scoped to. Customer portal users
|
|
23
|
+
* see only discounts with no customer-group restriction plus those scoped to a
|
|
24
|
+
* group their own account belongs to.
|
|
25
|
+
*
|
|
26
|
+
* This endpoint requires the permissions: `discounts:read`, `customers:read`,
|
|
27
|
+
* `suppliers:read`.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const listVolumeDiscount =
|
|
32
|
+
* await client.sales.volumeDiscounts.list();
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
list(
|
|
36
|
+
query: VolumeDiscountListParams | null | undefined = {},
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<ListVolumeDiscount> {
|
|
39
|
+
return this._client.get('/v1/sales/volume-discounts', { query, ...options });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Returns a volume discount by ID.
|
|
44
|
+
*
|
|
45
|
+
* This endpoint requires the permissions: `discounts:read`, `customers:read`,
|
|
46
|
+
* `suppliers:read`.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const volumeDiscount =
|
|
51
|
+
* await client.sales.volumeDiscounts.retrieve(
|
|
52
|
+
* 'quds_bn7hto9s10pp',
|
|
53
|
+
* );
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
retrieve(
|
|
57
|
+
id: string,
|
|
58
|
+
query: VolumeDiscountRetrieveParams | null | undefined = {},
|
|
59
|
+
options?: RequestOptions,
|
|
60
|
+
): APIPromise<VolumeDiscount> {
|
|
61
|
+
return this._client.get(path`/v1/sales/volume-discounts/${id}`, { query, ...options });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Creates a volume discount with its tiers and scoping associations.
|
|
66
|
+
*
|
|
67
|
+
* The discount name must be unique within the account; creating a discount with an
|
|
68
|
+
* existing name returns a conflict error.
|
|
69
|
+
*
|
|
70
|
+
* Each scoping list narrows the order lines the discount applies to, and an empty
|
|
71
|
+
* list places no restriction on that dimension. Because tier thresholds are
|
|
72
|
+
* compared against quantities converted into `unit_ids`, a discount created
|
|
73
|
+
* without any units never reaches a threshold above zero.
|
|
74
|
+
*
|
|
75
|
+
* This endpoint requires the permission: `discounts:create`.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const volumeDiscount =
|
|
80
|
+
* await client.sales.volumeDiscounts.create({
|
|
81
|
+
* name: 'Bulk Order Discount',
|
|
82
|
+
* tiers: [
|
|
83
|
+
* {
|
|
84
|
+
* name: '100+ Units',
|
|
85
|
+
* discount_percentage:
|
|
86
|
+
* '5.000000000000000000000000000000',
|
|
87
|
+
* threshold: '100.000000000000000000000000000000',
|
|
88
|
+
* },
|
|
89
|
+
* ],
|
|
90
|
+
* });
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
create(params: VolumeDiscountCreateParams, options?: RequestOptions): APIPromise<VolumeDiscount> {
|
|
94
|
+
const { include, ...body } = params;
|
|
95
|
+
return this._client.post('/v1/sales/volume-discounts', { query: { include }, body, ...options });
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Partially updates a volume discount.
|
|
100
|
+
*
|
|
101
|
+
* The tier and association lists are only applied when their corresponding `has_*`
|
|
102
|
+
* flag is `true`, in which case they replace the existing set entirely. Tiers use
|
|
103
|
+
* upsert semantics: tiers with an `id` are updated, tiers without one are created,
|
|
104
|
+
* and existing tiers omitted from the list are deleted.
|
|
105
|
+
*
|
|
106
|
+
* The name must remain unique within the account; reusing another discount's name
|
|
107
|
+
* returns a conflict error. Order lines that have already been priced keep the
|
|
108
|
+
* unit price they were given; the revised discount applies to lines priced after
|
|
109
|
+
* the change.
|
|
110
|
+
*
|
|
111
|
+
* This endpoint requires the permission: `discounts:update`.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* const volumeDiscount =
|
|
116
|
+
* await client.sales.volumeDiscounts.update(
|
|
117
|
+
* 'quds_bn7hto9s10pp',
|
|
118
|
+
* {
|
|
119
|
+
* has_attributes: true,
|
|
120
|
+
* has_categories: true,
|
|
121
|
+
* has_customer_groups: true,
|
|
122
|
+
* has_product_lines: true,
|
|
123
|
+
* has_tiers: true,
|
|
124
|
+
* has_units: true,
|
|
125
|
+
* name: 'Updated Bulk Discount',
|
|
126
|
+
* tiers: [
|
|
127
|
+
* {
|
|
128
|
+
* name: '50+ Units',
|
|
129
|
+
* discount_percentage:
|
|
130
|
+
* '10.000000000000000000000000000000',
|
|
131
|
+
* threshold: '50.000000000000000000000000000000',
|
|
132
|
+
* },
|
|
133
|
+
* ],
|
|
134
|
+
* },
|
|
135
|
+
* );
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
update(
|
|
139
|
+
id: string,
|
|
140
|
+
params: VolumeDiscountUpdateParams,
|
|
141
|
+
options?: RequestOptions,
|
|
142
|
+
): APIPromise<VolumeDiscount> {
|
|
143
|
+
const { include, ...body } = params;
|
|
144
|
+
return this._client.patch(path`/v1/sales/volume-discounts/${id}`, {
|
|
145
|
+
query: { include },
|
|
146
|
+
body,
|
|
147
|
+
...options,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Deletes a volume discount along with its tiers and scoping associations.
|
|
153
|
+
*
|
|
154
|
+
* Deletion is permanent; further requests against the deleted ID return an error.
|
|
155
|
+
*
|
|
156
|
+
* Order lines that have already been priced keep the unit price they were given;
|
|
157
|
+
* only lines priced after the deletion lose the discount.
|
|
158
|
+
*
|
|
159
|
+
* This endpoint requires the permission: `discounts:delete`.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```ts
|
|
163
|
+
* const volumeDiscount =
|
|
164
|
+
* await client.sales.volumeDiscounts.delete(
|
|
165
|
+
* 'quds_bn7hto9s10pp',
|
|
166
|
+
* );
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
delete(id: string, options?: RequestOptions): APIPromise<VolumeDiscountDeleteResponse> {
|
|
170
|
+
return this._client.delete(path`/v1/sales/volume-discounts/${id}`, options);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Request to create a volume discount.
|
|
176
|
+
*/
|
|
177
|
+
export interface CreateVolumeDiscountRequest {
|
|
178
|
+
/**
|
|
179
|
+
* Display name of the volume discount.
|
|
180
|
+
*
|
|
181
|
+
* Must be unique within the account.
|
|
182
|
+
*/
|
|
183
|
+
name: string;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Tiers for this volume discount.
|
|
187
|
+
*/
|
|
188
|
+
tiers: Array<CreateVolumeDiscountTierInput>;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Attribute IDs to scope the discount to.
|
|
192
|
+
*
|
|
193
|
+
* When set, an item qualifies only if it has every listed attribute.
|
|
194
|
+
*/
|
|
195
|
+
attribute_ids?: Array<string>;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Item category IDs to scope the discount to.
|
|
199
|
+
*
|
|
200
|
+
* When empty, all categories qualify.
|
|
201
|
+
*/
|
|
202
|
+
category_ids?: Array<string>;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Account group IDs to scope the discount to specific customer groups.
|
|
206
|
+
*
|
|
207
|
+
* When empty, all customers qualify. A discount scoped to a group the buyer
|
|
208
|
+
* belongs to is preferred over an unscoped one when both could apply to the same
|
|
209
|
+
* order line.
|
|
210
|
+
*/
|
|
211
|
+
customer_group_ids?: Array<string>;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Product line IDs to scope the discount to.
|
|
215
|
+
*
|
|
216
|
+
* When empty, all product lines qualify.
|
|
217
|
+
*/
|
|
218
|
+
product_line_ids?: Array<string>;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* IDs of the units that ordered quantities are measured in when evaluating tier
|
|
222
|
+
* thresholds.
|
|
223
|
+
*
|
|
224
|
+
* Quantities ordered in other units are converted into one of these before being
|
|
225
|
+
* compared against a threshold. Leaving this empty makes the discount inert: the
|
|
226
|
+
* quantity always evaluates to zero, so no threshold above zero is ever reached.
|
|
227
|
+
*/
|
|
228
|
+
unit_ids?: Array<string>;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Volume discount tier to create.
|
|
233
|
+
*/
|
|
234
|
+
export interface CreateVolumeDiscountTierInput {
|
|
235
|
+
/**
|
|
236
|
+
* Fraction of the price taken off once the threshold is met, as a decimal string.
|
|
237
|
+
*
|
|
238
|
+
* This is a multiplier, not a whole percent: `0.05` takes 5% off. When an order
|
|
239
|
+
* meets several tiers of the same discount, their reductions compound.
|
|
240
|
+
*/
|
|
241
|
+
discount_percentage: string;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Display name of the tier.
|
|
245
|
+
*/
|
|
246
|
+
name: string;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Minimum ordered quantity at which this tier's discount begins to apply, as a
|
|
250
|
+
* decimal string.
|
|
251
|
+
*
|
|
252
|
+
* The quantity compared against the threshold is the total across every line on
|
|
253
|
+
* the order that falls within the discount's scope, converted into one of the
|
|
254
|
+
* discount's units.
|
|
255
|
+
*/
|
|
256
|
+
threshold: string;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* ID of another tier that this tier follows.
|
|
260
|
+
*
|
|
261
|
+
* Tier IDs are assigned when the discount is created, so a tier created in this
|
|
262
|
+
* same request cannot be referenced here. The link is stored with the tier but
|
|
263
|
+
* does not affect pricing: every tier whose threshold is met applies, regardless
|
|
264
|
+
* of any parent.
|
|
265
|
+
*/
|
|
266
|
+
parent_tier_id?: string;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* A single page of resources, together with the metadata needed to page through
|
|
271
|
+
* the rest of the result set.
|
|
272
|
+
*/
|
|
273
|
+
export interface ListVolumeDiscount {
|
|
274
|
+
/**
|
|
275
|
+
* Resources in this page.
|
|
276
|
+
*/
|
|
277
|
+
data: Array<VolumeDiscount>;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Resource type identifier.
|
|
281
|
+
*/
|
|
282
|
+
object: 'list';
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* PageInfo describes where the current page sits within a paginated result set and
|
|
286
|
+
* how to move to the adjacent pages.
|
|
287
|
+
*
|
|
288
|
+
* Page a list by following the URLs below rather than assembling cursors yourself.
|
|
289
|
+
* For a top-level list endpoint the URL repeats the original request's query
|
|
290
|
+
* string with only the cursor swapped, so following it preserves the same filters,
|
|
291
|
+
* search term, and page size.
|
|
292
|
+
*/
|
|
293
|
+
page_info: APIKeysAPI.PageInfo;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* A single page of resources, together with the metadata needed to page through
|
|
298
|
+
* the rest of the result set.
|
|
299
|
+
*/
|
|
300
|
+
export interface ListVolumeDiscountTier {
|
|
301
|
+
/**
|
|
302
|
+
* Resources in this page.
|
|
303
|
+
*/
|
|
304
|
+
data: Array<VolumeDiscountTier>;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Resource type identifier.
|
|
308
|
+
*/
|
|
309
|
+
object: 'list';
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* PageInfo describes where the current page sits within a paginated result set and
|
|
313
|
+
* how to move to the adjacent pages.
|
|
314
|
+
*
|
|
315
|
+
* Page a list by following the URLs below rather than assembling cursors yourself.
|
|
316
|
+
* For a top-level list endpoint the URL repeats the original request's query
|
|
317
|
+
* string with only the cursor swapped, so following it preserves the same filters,
|
|
318
|
+
* search term, and page size.
|
|
319
|
+
*/
|
|
320
|
+
page_info: APIKeysAPI.PageInfo;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Request to partially update a volume discount.
|
|
325
|
+
*/
|
|
326
|
+
export interface UpdateVolumeDiscountRequest {
|
|
327
|
+
/**
|
|
328
|
+
* Whether to apply the `attribute_ids` field; when `false`, it is ignored.
|
|
329
|
+
*/
|
|
330
|
+
has_attributes: boolean;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Whether to apply the `category_ids` field; when `false`, it is ignored.
|
|
334
|
+
*/
|
|
335
|
+
has_categories: boolean;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Whether to apply the `customer_group_ids` field; when `false`, it is ignored.
|
|
339
|
+
*/
|
|
340
|
+
has_customer_groups: boolean;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Whether to apply the `product_line_ids` field; when `false`, it is ignored.
|
|
344
|
+
*/
|
|
345
|
+
has_product_lines: boolean;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Whether to apply the `tiers` field.
|
|
349
|
+
*
|
|
350
|
+
* When `true`, the discount's tiers are replaced with the contents of `tiers` (an
|
|
351
|
+
* empty list deletes all tiers). When `false`, `tiers` is ignored.
|
|
352
|
+
*/
|
|
353
|
+
has_tiers: boolean;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Whether to apply the `unit_ids` field; when `false`, it is ignored.
|
|
357
|
+
*/
|
|
358
|
+
has_units: boolean;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Attribute IDs to set.
|
|
362
|
+
*
|
|
363
|
+
* Only applied when `has_attributes` is `true`, in which case they replace the
|
|
364
|
+
* existing set entirely.
|
|
365
|
+
*/
|
|
366
|
+
attribute_ids?: Array<string>;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Item category IDs to set.
|
|
370
|
+
*
|
|
371
|
+
* Only applied when `has_categories` is `true`, in which case they replace the
|
|
372
|
+
* existing set entirely.
|
|
373
|
+
*/
|
|
374
|
+
category_ids?: Array<string>;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Account group IDs to set as customer groups.
|
|
378
|
+
*
|
|
379
|
+
* Only applied when `has_customer_groups` is `true`, in which case they replace
|
|
380
|
+
* the existing set entirely.
|
|
381
|
+
*/
|
|
382
|
+
customer_group_ids?: Array<string>;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Display name of the volume discount.
|
|
386
|
+
*
|
|
387
|
+
* Must be unique within the account.
|
|
388
|
+
*/
|
|
389
|
+
name?: string;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Product line IDs to set.
|
|
393
|
+
*
|
|
394
|
+
* Only applied when `has_product_lines` is `true`, in which case they replace the
|
|
395
|
+
* existing set entirely.
|
|
396
|
+
*/
|
|
397
|
+
product_line_ids?: Array<string>;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* The full set of tiers for this discount.
|
|
401
|
+
*
|
|
402
|
+
* Only applied when `has_tiers` is `true`. Tiers with an `id` are updated, tiers
|
|
403
|
+
* without an `id` are created, and existing tiers not present in the list are
|
|
404
|
+
* deleted.
|
|
405
|
+
*/
|
|
406
|
+
tiers?: Array<UpdateVolumeDiscountTierInput>;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* IDs of the units to set as acceptable units.
|
|
410
|
+
*
|
|
411
|
+
* Only applied when `has_units` is `true`, in which case they replace the existing
|
|
412
|
+
* set entirely. Clearing every unit makes the discount inert, since ordered
|
|
413
|
+
* quantity then always evaluates to zero.
|
|
414
|
+
*/
|
|
415
|
+
unit_ids?: Array<string>;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Volume discount tier to upsert.
|
|
420
|
+
*
|
|
421
|
+
* Each entry is written as a whole: send every value you want the tier to keep,
|
|
422
|
+
* since values left out are not carried over from the existing tier.
|
|
423
|
+
*/
|
|
424
|
+
export interface UpdateVolumeDiscountTierInput {
|
|
425
|
+
/**
|
|
426
|
+
* ID of an existing tier to update.
|
|
427
|
+
*
|
|
428
|
+
* Omit to create a new tier.
|
|
429
|
+
*/
|
|
430
|
+
id?: string;
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Fraction of the price taken off once the threshold is met, as a decimal string.
|
|
434
|
+
*
|
|
435
|
+
* This is a multiplier, not a whole percent: `0.05` takes 5% off. When an order
|
|
436
|
+
* meets several tiers of the same discount, their reductions compound.
|
|
437
|
+
*/
|
|
438
|
+
discount_percentage?: string;
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Display name of the tier.
|
|
442
|
+
*/
|
|
443
|
+
name?: string;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* ID of another tier in this discount that this tier follows.
|
|
447
|
+
*
|
|
448
|
+
* The link is stored with the tier but does not affect pricing. Omitting it when
|
|
449
|
+
* updating an existing tier clears the link.
|
|
450
|
+
*/
|
|
451
|
+
parent_tier_id?: string;
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Minimum ordered quantity at which this tier's discount begins to apply, as a
|
|
455
|
+
* decimal string.
|
|
456
|
+
*
|
|
457
|
+
* The quantity compared against the threshold is the total across every line on
|
|
458
|
+
* the order that falls within the discount's scope, converted into one of the
|
|
459
|
+
* discount's units.
|
|
460
|
+
*/
|
|
461
|
+
threshold?: string;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* A quantity-based discount with tiered percentage rates.
|
|
466
|
+
*
|
|
467
|
+
* A volume discount reduces the price once the ordered quantity reaches a tier's
|
|
468
|
+
* threshold. The customer group associations scope which customers qualify, and
|
|
469
|
+
* the product line, category, and attribute associations scope which order lines
|
|
470
|
+
* qualify; an empty list on any of them means no restriction on that dimension.
|
|
471
|
+
* Acceptable units are not a scope: they are the units the ordered quantity is
|
|
472
|
+
* measured in, and a discount with none of them never reaches a threshold above
|
|
473
|
+
* zero.
|
|
474
|
+
*
|
|
475
|
+
* At most one volume discount is applied to a given order line: among the
|
|
476
|
+
* discounts whose scope the line matches and whose thresholds are met, those
|
|
477
|
+
* scoped to a customer group the buyer belongs to take precedence. An account
|
|
478
|
+
* price for the same line overrides the discounted price entirely.
|
|
479
|
+
*/
|
|
480
|
+
export interface VolumeDiscount {
|
|
481
|
+
/**
|
|
482
|
+
* Volume discount ID.
|
|
483
|
+
*/
|
|
484
|
+
id: string;
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* A single page of resources, together with the metadata needed to page through
|
|
488
|
+
* the rest of the result set.
|
|
489
|
+
*/
|
|
490
|
+
acceptable_units: UnitsAPI.ListUnit | null;
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* A single page of resources, together with the metadata needed to page through
|
|
494
|
+
* the rest of the result set.
|
|
495
|
+
*/
|
|
496
|
+
attributes: PropertiesAPI.ListAttribute | null;
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* A single page of resources, together with the metadata needed to page through
|
|
500
|
+
* the rest of the result set.
|
|
501
|
+
*/
|
|
502
|
+
categories: ItemCategoriesAPI.ListItemCategory | null;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Creation timestamp.
|
|
506
|
+
*/
|
|
507
|
+
created_at: string;
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* A single page of resources, together with the metadata needed to page through
|
|
511
|
+
* the rest of the result set.
|
|
512
|
+
*/
|
|
513
|
+
customer_groups: AccountGroupsAPI.ListAccountGroup | null;
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Display name of the volume discount.
|
|
517
|
+
*
|
|
518
|
+
* Must be unique within the account.
|
|
519
|
+
*/
|
|
520
|
+
name: string;
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Resource type identifier.
|
|
524
|
+
*/
|
|
525
|
+
object: 'volume_discount';
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* A single page of resources, together with the metadata needed to page through
|
|
529
|
+
* the rest of the result set.
|
|
530
|
+
*/
|
|
531
|
+
product_lines: ProductLinesAPI.ListProductLine | null;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* A single page of resources, together with the metadata needed to page through
|
|
535
|
+
* the rest of the result set.
|
|
536
|
+
*/
|
|
537
|
+
tiers: ListVolumeDiscountTier | null;
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Last updated timestamp.
|
|
541
|
+
*/
|
|
542
|
+
updated_at: string;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* A quantity threshold within a volume discount, and the reduction that applies at
|
|
547
|
+
* or above it.
|
|
548
|
+
*/
|
|
549
|
+
export interface VolumeDiscountTier {
|
|
550
|
+
/**
|
|
551
|
+
* Volume discount tier ID.
|
|
552
|
+
*/
|
|
553
|
+
id: string;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Creation timestamp.
|
|
557
|
+
*/
|
|
558
|
+
created_at: string;
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Fraction of the price taken off once the threshold is met, as a decimal string.
|
|
562
|
+
*
|
|
563
|
+
* This is a multiplier, not a whole percent: `0.05` takes 5% off. When an order
|
|
564
|
+
* meets several tiers of the same discount, their reductions compound: meeting a
|
|
565
|
+
* `0.1` tier and a `0.2` tier multiplies the price by `0.9 × 0.8`, a 28% reduction
|
|
566
|
+
* overall.
|
|
567
|
+
*/
|
|
568
|
+
discount_percentage: string;
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Display name of the tier.
|
|
572
|
+
*/
|
|
573
|
+
name: string;
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Resource type identifier.
|
|
577
|
+
*/
|
|
578
|
+
object: 'volume_discount_tier';
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Minimum ordered quantity at which this tier's discount begins to apply, as a
|
|
582
|
+
* decimal string.
|
|
583
|
+
*
|
|
584
|
+
* The quantity compared against the threshold is the total across every line on
|
|
585
|
+
* the order that falls within the discount's scope, converted into one of the
|
|
586
|
+
* discount's acceptable units — not the quantity of a single line.
|
|
587
|
+
*/
|
|
588
|
+
threshold: string;
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Last updated timestamp.
|
|
592
|
+
*/
|
|
593
|
+
updated_at: string;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
export interface VolumeDiscountDeleteResponse {}
|
|
597
|
+
|
|
598
|
+
export interface VolumeDiscountListParams {
|
|
599
|
+
/**
|
|
600
|
+
* Opaque cursor token identifying where the page of results starts.
|
|
601
|
+
*
|
|
602
|
+
* Use the `cursor` value embedded in a previous response's `next_page_url` or
|
|
603
|
+
* `previous_page_url` to fetch the adjacent page. Omit to start from the first
|
|
604
|
+
* page.
|
|
605
|
+
*/
|
|
606
|
+
cursor?: string;
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Sub-objects to expand in the response. When omitted, sub-objects are returned as
|
|
610
|
+
* `null`.
|
|
611
|
+
*/
|
|
612
|
+
include?: Array<'customer_groups' | 'product_lines' | 'categories' | 'attributes' | 'acceptable_units'>;
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* Maximum number of results to return in a single page.
|
|
616
|
+
*/
|
|
617
|
+
limit?: number;
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Free-text search term used to filter results.
|
|
621
|
+
*
|
|
622
|
+
* Which fields are matched against the term varies by endpoint.
|
|
623
|
+
*/
|
|
624
|
+
q?: string;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
export interface VolumeDiscountRetrieveParams {
|
|
628
|
+
/**
|
|
629
|
+
* Sub-objects to expand in the response. When omitted, sub-objects are returned as
|
|
630
|
+
* `null`.
|
|
631
|
+
*/
|
|
632
|
+
include?: Array<'customer_groups' | 'product_lines' | 'categories' | 'attributes' | 'acceptable_units'>;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
export interface VolumeDiscountCreateParams {
|
|
636
|
+
/**
|
|
637
|
+
* Body param: Display name of the volume discount.
|
|
638
|
+
*
|
|
639
|
+
* Must be unique within the account.
|
|
640
|
+
*/
|
|
641
|
+
name: string;
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Body param: Tiers for this volume discount.
|
|
645
|
+
*/
|
|
646
|
+
tiers: Array<CreateVolumeDiscountTierInput>;
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Query param: Sub-objects to expand in the response. When omitted, sub-objects
|
|
650
|
+
* are returned as `null`.
|
|
651
|
+
*/
|
|
652
|
+
include?: Array<'customer_groups' | 'product_lines' | 'categories' | 'attributes' | 'acceptable_units'>;
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Body param: Attribute IDs to scope the discount to.
|
|
656
|
+
*
|
|
657
|
+
* When set, an item qualifies only if it has every listed attribute.
|
|
658
|
+
*/
|
|
659
|
+
attribute_ids?: Array<string>;
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Body param: Item category IDs to scope the discount to.
|
|
663
|
+
*
|
|
664
|
+
* When empty, all categories qualify.
|
|
665
|
+
*/
|
|
666
|
+
category_ids?: Array<string>;
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* Body param: Account group IDs to scope the discount to specific customer groups.
|
|
670
|
+
*
|
|
671
|
+
* When empty, all customers qualify. A discount scoped to a group the buyer
|
|
672
|
+
* belongs to is preferred over an unscoped one when both could apply to the same
|
|
673
|
+
* order line.
|
|
674
|
+
*/
|
|
675
|
+
customer_group_ids?: Array<string>;
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Body param: Product line IDs to scope the discount to.
|
|
679
|
+
*
|
|
680
|
+
* When empty, all product lines qualify.
|
|
681
|
+
*/
|
|
682
|
+
product_line_ids?: Array<string>;
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Body param: IDs of the units that ordered quantities are measured in when
|
|
686
|
+
* evaluating tier thresholds.
|
|
687
|
+
*
|
|
688
|
+
* Quantities ordered in other units are converted into one of these before being
|
|
689
|
+
* compared against a threshold. Leaving this empty makes the discount inert: the
|
|
690
|
+
* quantity always evaluates to zero, so no threshold above zero is ever reached.
|
|
691
|
+
*/
|
|
692
|
+
unit_ids?: Array<string>;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
export interface VolumeDiscountUpdateParams {
|
|
696
|
+
/**
|
|
697
|
+
* Body param: Whether to apply the `attribute_ids` field; when `false`, it is
|
|
698
|
+
* ignored.
|
|
699
|
+
*/
|
|
700
|
+
has_attributes: boolean;
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Body param: Whether to apply the `category_ids` field; when `false`, it is
|
|
704
|
+
* ignored.
|
|
705
|
+
*/
|
|
706
|
+
has_categories: boolean;
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* Body param: Whether to apply the `customer_group_ids` field; when `false`, it is
|
|
710
|
+
* ignored.
|
|
711
|
+
*/
|
|
712
|
+
has_customer_groups: boolean;
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* Body param: Whether to apply the `product_line_ids` field; when `false`, it is
|
|
716
|
+
* ignored.
|
|
717
|
+
*/
|
|
718
|
+
has_product_lines: boolean;
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Body param: Whether to apply the `tiers` field.
|
|
722
|
+
*
|
|
723
|
+
* When `true`, the discount's tiers are replaced with the contents of `tiers` (an
|
|
724
|
+
* empty list deletes all tiers). When `false`, `tiers` is ignored.
|
|
725
|
+
*/
|
|
726
|
+
has_tiers: boolean;
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Body param: Whether to apply the `unit_ids` field; when `false`, it is ignored.
|
|
730
|
+
*/
|
|
731
|
+
has_units: boolean;
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Query param: Sub-objects to expand in the response. When omitted, sub-objects
|
|
735
|
+
* are returned as `null`.
|
|
736
|
+
*/
|
|
737
|
+
include?: Array<'customer_groups' | 'product_lines' | 'categories' | 'attributes' | 'acceptable_units'>;
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Body param: Attribute IDs to set.
|
|
741
|
+
*
|
|
742
|
+
* Only applied when `has_attributes` is `true`, in which case they replace the
|
|
743
|
+
* existing set entirely.
|
|
744
|
+
*/
|
|
745
|
+
attribute_ids?: Array<string>;
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Body param: Item category IDs to set.
|
|
749
|
+
*
|
|
750
|
+
* Only applied when `has_categories` is `true`, in which case they replace the
|
|
751
|
+
* existing set entirely.
|
|
752
|
+
*/
|
|
753
|
+
category_ids?: Array<string>;
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Body param: Account group IDs to set as customer groups.
|
|
757
|
+
*
|
|
758
|
+
* Only applied when `has_customer_groups` is `true`, in which case they replace
|
|
759
|
+
* the existing set entirely.
|
|
760
|
+
*/
|
|
761
|
+
customer_group_ids?: Array<string>;
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Body param: Display name of the volume discount.
|
|
765
|
+
*
|
|
766
|
+
* Must be unique within the account.
|
|
767
|
+
*/
|
|
768
|
+
name?: string;
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* Body param: Product line IDs to set.
|
|
772
|
+
*
|
|
773
|
+
* Only applied when `has_product_lines` is `true`, in which case they replace the
|
|
774
|
+
* existing set entirely.
|
|
775
|
+
*/
|
|
776
|
+
product_line_ids?: Array<string>;
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Body param: The full set of tiers for this discount.
|
|
780
|
+
*
|
|
781
|
+
* Only applied when `has_tiers` is `true`. Tiers with an `id` are updated, tiers
|
|
782
|
+
* without an `id` are created, and existing tiers not present in the list are
|
|
783
|
+
* deleted.
|
|
784
|
+
*/
|
|
785
|
+
tiers?: Array<UpdateVolumeDiscountTierInput>;
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* Body param: IDs of the units to set as acceptable units.
|
|
789
|
+
*
|
|
790
|
+
* Only applied when `has_units` is `true`, in which case they replace the existing
|
|
791
|
+
* set entirely. Clearing every unit makes the discount inert, since ordered
|
|
792
|
+
* quantity then always evaluates to zero.
|
|
793
|
+
*/
|
|
794
|
+
unit_ids?: Array<string>;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
export declare namespace VolumeDiscounts {
|
|
798
|
+
export {
|
|
799
|
+
type CreateVolumeDiscountRequest as CreateVolumeDiscountRequest,
|
|
800
|
+
type CreateVolumeDiscountTierInput as CreateVolumeDiscountTierInput,
|
|
801
|
+
type ListVolumeDiscount as ListVolumeDiscount,
|
|
802
|
+
type ListVolumeDiscountTier as ListVolumeDiscountTier,
|
|
803
|
+
type UpdateVolumeDiscountRequest as UpdateVolumeDiscountRequest,
|
|
804
|
+
type UpdateVolumeDiscountTierInput as UpdateVolumeDiscountTierInput,
|
|
805
|
+
type VolumeDiscount as VolumeDiscount,
|
|
806
|
+
type VolumeDiscountTier as VolumeDiscountTier,
|
|
807
|
+
type VolumeDiscountDeleteResponse as VolumeDiscountDeleteResponse,
|
|
808
|
+
type VolumeDiscountListParams as VolumeDiscountListParams,
|
|
809
|
+
type VolumeDiscountRetrieveParams as VolumeDiscountRetrieveParams,
|
|
810
|
+
type VolumeDiscountCreateParams as VolumeDiscountCreateParams,
|
|
811
|
+
type VolumeDiscountUpdateParams as VolumeDiscountUpdateParams,
|
|
812
|
+
};
|
|
813
|
+
}
|