@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.
Files changed (182) hide show
  1. package/CHANGELOG.md +7 -3
  2. package/package.json +1 -1
  3. package/resources/finance/payment-terms.d.mts +5 -5
  4. package/resources/finance/payment-terms.d.mts.map +1 -1
  5. package/resources/finance/payment-terms.d.ts +5 -5
  6. package/resources/finance/payment-terms.d.ts.map +1 -1
  7. package/resources/finance/payment-terms.js.map +1 -1
  8. package/resources/finance/payment-terms.mjs.map +1 -1
  9. package/resources/operations/carriers/carriers.d.mts +5 -5
  10. package/resources/operations/carriers/carriers.d.mts.map +1 -1
  11. package/resources/operations/carriers/carriers.d.ts +5 -5
  12. package/resources/operations/carriers/carriers.d.ts.map +1 -1
  13. package/resources/operations/carriers/service-levels.d.mts +5 -5
  14. package/resources/operations/carriers/service-levels.d.mts.map +1 -1
  15. package/resources/operations/carriers/service-levels.d.ts +5 -5
  16. package/resources/operations/carriers/service-levels.d.ts.map +1 -1
  17. package/resources/operations/shipments/actions.d.mts +3 -3
  18. package/resources/operations/shipments/actions.d.mts.map +1 -1
  19. package/resources/operations/shipments/actions.d.ts +3 -3
  20. package/resources/operations/shipments/actions.d.ts.map +1 -1
  21. package/resources/operations/shipping-terms.d.mts +5 -5
  22. package/resources/operations/shipping-terms.d.mts.map +1 -1
  23. package/resources/operations/shipping-terms.d.ts +5 -5
  24. package/resources/operations/shipping-terms.d.ts.map +1 -1
  25. package/resources/operations/shipping-terms.js.map +1 -1
  26. package/resources/operations/shipping-terms.mjs.map +1 -1
  27. package/resources/sales/account-prices/account-prices.d.mts +999 -0
  28. package/resources/sales/account-prices/account-prices.d.mts.map +1 -0
  29. package/resources/sales/account-prices/account-prices.d.ts +999 -0
  30. package/resources/sales/account-prices/account-prices.d.ts.map +1 -0
  31. package/resources/sales/account-prices/account-prices.js +143 -0
  32. package/resources/sales/account-prices/account-prices.js.map +1 -0
  33. package/resources/sales/account-prices/account-prices.mjs +138 -0
  34. package/resources/sales/account-prices/account-prices.mjs.map +1 -0
  35. package/resources/sales/account-prices/actions.d.mts +58 -0
  36. package/resources/sales/account-prices/actions.d.mts.map +1 -0
  37. package/resources/sales/account-prices/actions.d.ts +58 -0
  38. package/resources/sales/account-prices/actions.d.ts.map +1 -0
  39. package/resources/sales/account-prices/actions.js +44 -0
  40. package/resources/sales/account-prices/actions.js.map +1 -0
  41. package/resources/sales/account-prices/actions.mjs +40 -0
  42. package/resources/sales/account-prices/actions.mjs.map +1 -0
  43. package/resources/sales/account-prices/index.d.mts +3 -0
  44. package/resources/sales/account-prices/index.d.mts.map +1 -0
  45. package/resources/sales/account-prices/index.d.ts +3 -0
  46. package/resources/sales/account-prices/index.d.ts.map +1 -0
  47. package/resources/sales/account-prices/index.js +9 -0
  48. package/resources/sales/account-prices/index.js.map +1 -0
  49. package/resources/sales/account-prices/index.mjs +4 -0
  50. package/resources/sales/account-prices/index.mjs.map +1 -0
  51. package/resources/sales/account-prices.d.mts +2 -0
  52. package/resources/sales/account-prices.d.mts.map +1 -0
  53. package/resources/sales/account-prices.d.ts +2 -0
  54. package/resources/sales/account-prices.d.ts.map +1 -0
  55. package/resources/sales/account-prices.js +6 -0
  56. package/resources/sales/account-prices.js.map +1 -0
  57. package/resources/sales/account-prices.mjs +3 -0
  58. package/resources/sales/account-prices.mjs.map +1 -0
  59. package/resources/sales/customers/actions.d.mts +2 -2
  60. package/resources/sales/customers/actions.d.mts.map +1 -1
  61. package/resources/sales/customers/actions.d.ts +2 -2
  62. package/resources/sales/customers/actions.d.ts.map +1 -1
  63. package/resources/sales/customers/actions.js.map +1 -1
  64. package/resources/sales/customers/actions.mjs.map +1 -1
  65. package/resources/sales/customers/customers.d.mts +6 -564
  66. package/resources/sales/customers/customers.d.mts.map +1 -1
  67. package/resources/sales/customers/customers.d.ts +6 -564
  68. package/resources/sales/customers/customers.d.ts.map +1 -1
  69. package/resources/sales/customers/customers.js.map +1 -1
  70. package/resources/sales/customers/customers.mjs.map +1 -1
  71. package/resources/sales/customers/index.d.mts +1 -1
  72. package/resources/sales/customers/index.d.mts.map +1 -1
  73. package/resources/sales/customers/index.d.ts +1 -1
  74. package/resources/sales/customers/index.d.ts.map +1 -1
  75. package/resources/sales/customers/index.js.map +1 -1
  76. package/resources/sales/customers/index.mjs.map +1 -1
  77. package/resources/sales/index.d.mts +6 -3
  78. package/resources/sales/index.d.mts.map +1 -1
  79. package/resources/sales/index.d.ts +6 -3
  80. package/resources/sales/index.d.ts.map +1 -1
  81. package/resources/sales/index.js +15 -9
  82. package/resources/sales/index.js.map +1 -1
  83. package/resources/sales/index.mjs +3 -0
  84. package/resources/sales/index.mjs.map +1 -1
  85. package/resources/sales/order-discounts/actions.d.mts +85 -0
  86. package/resources/sales/order-discounts/actions.d.mts.map +1 -0
  87. package/resources/sales/order-discounts/actions.d.ts +85 -0
  88. package/resources/sales/order-discounts/actions.d.ts.map +1 -0
  89. package/resources/sales/order-discounts/actions.js +35 -0
  90. package/resources/sales/order-discounts/actions.js.map +1 -0
  91. package/resources/sales/order-discounts/actions.mjs +31 -0
  92. package/resources/sales/order-discounts/actions.mjs.map +1 -0
  93. package/resources/sales/order-discounts/index.d.mts +3 -0
  94. package/resources/sales/order-discounts/index.d.mts.map +1 -0
  95. package/resources/sales/order-discounts/index.d.ts +3 -0
  96. package/resources/sales/order-discounts/index.d.ts.map +1 -0
  97. package/resources/sales/order-discounts/index.js +9 -0
  98. package/resources/sales/order-discounts/index.js.map +1 -0
  99. package/resources/sales/order-discounts/index.mjs +4 -0
  100. package/resources/sales/order-discounts/index.mjs.map +1 -0
  101. package/resources/sales/order-discounts/order-discounts.d.mts +365 -0
  102. package/resources/sales/order-discounts/order-discounts.d.mts.map +1 -0
  103. package/resources/sales/order-discounts/order-discounts.d.ts +365 -0
  104. package/resources/sales/order-discounts/order-discounts.d.ts.map +1 -0
  105. package/resources/sales/order-discounts/order-discounts.js +125 -0
  106. package/resources/sales/order-discounts/order-discounts.js.map +1 -0
  107. package/resources/sales/order-discounts/order-discounts.mjs +120 -0
  108. package/resources/sales/order-discounts/order-discounts.mjs.map +1 -0
  109. package/resources/sales/order-discounts.d.mts +2 -0
  110. package/resources/sales/order-discounts.d.mts.map +1 -0
  111. package/resources/sales/order-discounts.d.ts +2 -0
  112. package/resources/sales/order-discounts.d.ts.map +1 -0
  113. package/resources/sales/order-discounts.js +6 -0
  114. package/resources/sales/order-discounts.js.map +1 -0
  115. package/resources/sales/order-discounts.mjs +3 -0
  116. package/resources/sales/order-discounts.mjs.map +1 -0
  117. package/resources/sales/priorities.d.mts +4 -44
  118. package/resources/sales/priorities.d.mts.map +1 -1
  119. package/resources/sales/priorities.d.ts +4 -44
  120. package/resources/sales/priorities.d.ts.map +1 -1
  121. package/resources/sales/priorities.js.map +1 -1
  122. package/resources/sales/priorities.mjs.map +1 -1
  123. package/resources/sales/sales-orders/index.d.mts +1 -1
  124. package/resources/sales/sales-orders/index.d.mts.map +1 -1
  125. package/resources/sales/sales-orders/index.d.ts +1 -1
  126. package/resources/sales/sales-orders/index.d.ts.map +1 -1
  127. package/resources/sales/sales-orders/index.js.map +1 -1
  128. package/resources/sales/sales-orders/index.mjs.map +1 -1
  129. package/resources/sales/sales-orders/lines/lines.d.mts +2 -2
  130. package/resources/sales/sales-orders/lines/lines.d.mts.map +1 -1
  131. package/resources/sales/sales-orders/lines/lines.d.ts +2 -2
  132. package/resources/sales/sales-orders/lines/lines.d.ts.map +1 -1
  133. package/resources/sales/sales-orders/sales-orders.d.mts +10 -69
  134. package/resources/sales/sales-orders/sales-orders.d.mts.map +1 -1
  135. package/resources/sales/sales-orders/sales-orders.d.ts +10 -69
  136. package/resources/sales/sales-orders/sales-orders.d.ts.map +1 -1
  137. package/resources/sales/sales-orders/sales-orders.js.map +1 -1
  138. package/resources/sales/sales-orders/sales-orders.mjs.map +1 -1
  139. package/resources/sales/sales.d.mts +18 -6
  140. package/resources/sales/sales.d.mts.map +1 -1
  141. package/resources/sales/sales.d.ts +18 -6
  142. package/resources/sales/sales.d.ts.map +1 -1
  143. package/resources/sales/sales.js +12 -0
  144. package/resources/sales/sales.js.map +1 -1
  145. package/resources/sales/sales.mjs +12 -0
  146. package/resources/sales/sales.mjs.map +1 -1
  147. package/resources/sales/volume-discounts.d.mts +684 -0
  148. package/resources/sales/volume-discounts.d.mts.map +1 -0
  149. package/resources/sales/volume-discounts.d.ts +684 -0
  150. package/resources/sales/volume-discounts.d.ts.map +1 -0
  151. package/resources/sales/volume-discounts.js +152 -0
  152. package/resources/sales/volume-discounts.js.map +1 -0
  153. package/resources/sales/volume-discounts.mjs +148 -0
  154. package/resources/sales/volume-discounts.mjs.map +1 -0
  155. package/src/resources/finance/payment-terms.ts +8 -5
  156. package/src/resources/operations/carriers/carriers.ts +5 -5
  157. package/src/resources/operations/carriers/service-levels.ts +5 -5
  158. package/src/resources/operations/shipments/actions.ts +3 -3
  159. package/src/resources/operations/shipping-terms.ts +8 -5
  160. package/src/resources/sales/account-prices/account-prices.ts +1191 -0
  161. package/src/resources/sales/account-prices/actions.ts +74 -0
  162. package/src/resources/sales/account-prices/index.ts +27 -0
  163. package/src/resources/sales/account-prices.ts +3 -0
  164. package/src/resources/sales/customers/actions.ts +6 -2
  165. package/src/resources/sales/customers/customers.ts +5 -658
  166. package/src/resources/sales/customers/index.ts +0 -11
  167. package/src/resources/sales/index.ts +50 -13
  168. package/src/resources/sales/order-discounts/actions.ts +102 -0
  169. package/src/resources/sales/order-discounts/index.ts +13 -0
  170. package/src/resources/sales/order-discounts/order-discounts.ts +442 -0
  171. package/src/resources/sales/order-discounts.ts +3 -0
  172. package/src/resources/sales/priorities.ts +3 -51
  173. package/src/resources/sales/sales-orders/index.ts +0 -1
  174. package/src/resources/sales/sales-orders/lines/lines.ts +2 -2
  175. package/src/resources/sales/sales-orders/sales-orders.ts +9 -79
  176. package/src/resources/sales/sales.ts +113 -26
  177. package/src/resources/sales/volume-discounts.ts +813 -0
  178. package/src/version.ts +1 -1
  179. package/version.d.mts +1 -1
  180. package/version.d.ts +1 -1
  181. package/version.js +1 -1
  182. package/version.mjs +1 -1
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.VolumeDiscounts = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const path_1 = require("../../internal/utils/path.js");
7
+ /**
8
+ * List and manage volume discounts.
9
+ */
10
+ class VolumeDiscounts extends resource_1.APIResource {
11
+ /**
12
+ * Returns a paginated list of volume discounts, newest first.
13
+ *
14
+ * The search term matches the discount name, the name of a customer group it is
15
+ * scoped to, or the name of a product line it is scoped to. Customer portal users
16
+ * see only discounts with no customer-group restriction plus those scoped to a
17
+ * group their own account belongs to.
18
+ *
19
+ * This endpoint requires the permissions: `discounts:read`, `customers:read`,
20
+ * `suppliers:read`.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const listVolumeDiscount =
25
+ * await client.sales.volumeDiscounts.list();
26
+ * ```
27
+ */
28
+ list(query = {}, options) {
29
+ return this._client.get('/v1/sales/volume-discounts', { query, ...options });
30
+ }
31
+ /**
32
+ * Returns a volume discount by ID.
33
+ *
34
+ * This endpoint requires the permissions: `discounts:read`, `customers:read`,
35
+ * `suppliers:read`.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const volumeDiscount =
40
+ * await client.sales.volumeDiscounts.retrieve(
41
+ * 'quds_bn7hto9s10pp',
42
+ * );
43
+ * ```
44
+ */
45
+ retrieve(id, query = {}, options) {
46
+ return this._client.get((0, path_1.path) `/v1/sales/volume-discounts/${id}`, { query, ...options });
47
+ }
48
+ /**
49
+ * Creates a volume discount with its tiers and scoping associations.
50
+ *
51
+ * The discount name must be unique within the account; creating a discount with an
52
+ * existing name returns a conflict error.
53
+ *
54
+ * Each scoping list narrows the order lines the discount applies to, and an empty
55
+ * list places no restriction on that dimension. Because tier thresholds are
56
+ * compared against quantities converted into `unit_ids`, a discount created
57
+ * without any units never reaches a threshold above zero.
58
+ *
59
+ * This endpoint requires the permission: `discounts:create`.
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const volumeDiscount =
64
+ * await client.sales.volumeDiscounts.create({
65
+ * name: 'Bulk Order Discount',
66
+ * tiers: [
67
+ * {
68
+ * name: '100+ Units',
69
+ * discount_percentage:
70
+ * '5.000000000000000000000000000000',
71
+ * threshold: '100.000000000000000000000000000000',
72
+ * },
73
+ * ],
74
+ * });
75
+ * ```
76
+ */
77
+ create(params, options) {
78
+ const { include, ...body } = params;
79
+ return this._client.post('/v1/sales/volume-discounts', { query: { include }, body, ...options });
80
+ }
81
+ /**
82
+ * Partially updates a volume discount.
83
+ *
84
+ * The tier and association lists are only applied when their corresponding `has_*`
85
+ * flag is `true`, in which case they replace the existing set entirely. Tiers use
86
+ * upsert semantics: tiers with an `id` are updated, tiers without one are created,
87
+ * and existing tiers omitted from the list are deleted.
88
+ *
89
+ * The name must remain unique within the account; reusing another discount's name
90
+ * returns a conflict error. Order lines that have already been priced keep the
91
+ * unit price they were given; the revised discount applies to lines priced after
92
+ * the change.
93
+ *
94
+ * This endpoint requires the permission: `discounts:update`.
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * const volumeDiscount =
99
+ * await client.sales.volumeDiscounts.update(
100
+ * 'quds_bn7hto9s10pp',
101
+ * {
102
+ * has_attributes: true,
103
+ * has_categories: true,
104
+ * has_customer_groups: true,
105
+ * has_product_lines: true,
106
+ * has_tiers: true,
107
+ * has_units: true,
108
+ * name: 'Updated Bulk Discount',
109
+ * tiers: [
110
+ * {
111
+ * name: '50+ Units',
112
+ * discount_percentage:
113
+ * '10.000000000000000000000000000000',
114
+ * threshold: '50.000000000000000000000000000000',
115
+ * },
116
+ * ],
117
+ * },
118
+ * );
119
+ * ```
120
+ */
121
+ update(id, params, options) {
122
+ const { include, ...body } = params;
123
+ return this._client.patch((0, path_1.path) `/v1/sales/volume-discounts/${id}`, {
124
+ query: { include },
125
+ body,
126
+ ...options,
127
+ });
128
+ }
129
+ /**
130
+ * Deletes a volume discount along with its tiers and scoping associations.
131
+ *
132
+ * Deletion is permanent; further requests against the deleted ID return an error.
133
+ *
134
+ * Order lines that have already been priced keep the unit price they were given;
135
+ * only lines priced after the deletion lose the discount.
136
+ *
137
+ * This endpoint requires the permission: `discounts:delete`.
138
+ *
139
+ * @example
140
+ * ```ts
141
+ * const volumeDiscount =
142
+ * await client.sales.volumeDiscounts.delete(
143
+ * 'quds_bn7hto9s10pp',
144
+ * );
145
+ * ```
146
+ */
147
+ delete(id, options) {
148
+ return this._client.delete((0, path_1.path) `/v1/sales/volume-discounts/${id}`, options);
149
+ }
150
+ }
151
+ exports.VolumeDiscounts = VolumeDiscounts;
152
+ //# sourceMappingURL=volume-discounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"volume-discounts.js","sourceRoot":"","sources":["../../src/resources/sales/volume-discounts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AASlD,uDAAiD;AAEjD;;GAEG;AACH,MAAa,eAAgB,SAAQ,sBAAW;IAC9C;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,QAAqD,EAAE,EACvD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,QAAQ,CACN,EAAU,EACV,QAAyD,EAAE,EAC3D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,8BAA8B,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CAAC,MAAkC,EAAE,OAAwB;QACjE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnG,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,MAAM,CACJ,EAAU,EACV,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,8BAA8B,EAAE,EAAE,EAAE;YAChE,KAAK,EAAE,EAAE,OAAO,EAAE;YAClB,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,8BAA8B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;CACF;AA3JD,0CA2JC"}
@@ -0,0 +1,148 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { path } from "../../internal/utils/path.mjs";
4
+ /**
5
+ * List and manage volume discounts.
6
+ */
7
+ export class VolumeDiscounts extends APIResource {
8
+ /**
9
+ * Returns a paginated list of volume discounts, newest first.
10
+ *
11
+ * The search term matches the discount name, the name of a customer group it is
12
+ * scoped to, or the name of a product line it is scoped to. Customer portal users
13
+ * see only discounts with no customer-group restriction plus those scoped to a
14
+ * group their own account belongs to.
15
+ *
16
+ * This endpoint requires the permissions: `discounts:read`, `customers:read`,
17
+ * `suppliers:read`.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const listVolumeDiscount =
22
+ * await client.sales.volumeDiscounts.list();
23
+ * ```
24
+ */
25
+ list(query = {}, options) {
26
+ return this._client.get('/v1/sales/volume-discounts', { query, ...options });
27
+ }
28
+ /**
29
+ * Returns a volume discount by ID.
30
+ *
31
+ * This endpoint requires the permissions: `discounts:read`, `customers:read`,
32
+ * `suppliers:read`.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const volumeDiscount =
37
+ * await client.sales.volumeDiscounts.retrieve(
38
+ * 'quds_bn7hto9s10pp',
39
+ * );
40
+ * ```
41
+ */
42
+ retrieve(id, query = {}, options) {
43
+ return this._client.get(path `/v1/sales/volume-discounts/${id}`, { query, ...options });
44
+ }
45
+ /**
46
+ * Creates a volume discount with its tiers and scoping associations.
47
+ *
48
+ * The discount name must be unique within the account; creating a discount with an
49
+ * existing name returns a conflict error.
50
+ *
51
+ * Each scoping list narrows the order lines the discount applies to, and an empty
52
+ * list places no restriction on that dimension. Because tier thresholds are
53
+ * compared against quantities converted into `unit_ids`, a discount created
54
+ * without any units never reaches a threshold above zero.
55
+ *
56
+ * This endpoint requires the permission: `discounts:create`.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const volumeDiscount =
61
+ * await client.sales.volumeDiscounts.create({
62
+ * name: 'Bulk Order Discount',
63
+ * tiers: [
64
+ * {
65
+ * name: '100+ Units',
66
+ * discount_percentage:
67
+ * '5.000000000000000000000000000000',
68
+ * threshold: '100.000000000000000000000000000000',
69
+ * },
70
+ * ],
71
+ * });
72
+ * ```
73
+ */
74
+ create(params, options) {
75
+ const { include, ...body } = params;
76
+ return this._client.post('/v1/sales/volume-discounts', { query: { include }, body, ...options });
77
+ }
78
+ /**
79
+ * Partially updates a volume discount.
80
+ *
81
+ * The tier and association lists are only applied when their corresponding `has_*`
82
+ * flag is `true`, in which case they replace the existing set entirely. Tiers use
83
+ * upsert semantics: tiers with an `id` are updated, tiers without one are created,
84
+ * and existing tiers omitted from the list are deleted.
85
+ *
86
+ * The name must remain unique within the account; reusing another discount's name
87
+ * returns a conflict error. Order lines that have already been priced keep the
88
+ * unit price they were given; the revised discount applies to lines priced after
89
+ * the change.
90
+ *
91
+ * This endpoint requires the permission: `discounts:update`.
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * const volumeDiscount =
96
+ * await client.sales.volumeDiscounts.update(
97
+ * 'quds_bn7hto9s10pp',
98
+ * {
99
+ * has_attributes: true,
100
+ * has_categories: true,
101
+ * has_customer_groups: true,
102
+ * has_product_lines: true,
103
+ * has_tiers: true,
104
+ * has_units: true,
105
+ * name: 'Updated Bulk Discount',
106
+ * tiers: [
107
+ * {
108
+ * name: '50+ Units',
109
+ * discount_percentage:
110
+ * '10.000000000000000000000000000000',
111
+ * threshold: '50.000000000000000000000000000000',
112
+ * },
113
+ * ],
114
+ * },
115
+ * );
116
+ * ```
117
+ */
118
+ update(id, params, options) {
119
+ const { include, ...body } = params;
120
+ return this._client.patch(path `/v1/sales/volume-discounts/${id}`, {
121
+ query: { include },
122
+ body,
123
+ ...options,
124
+ });
125
+ }
126
+ /**
127
+ * Deletes a volume discount along with its tiers and scoping associations.
128
+ *
129
+ * Deletion is permanent; further requests against the deleted ID return an error.
130
+ *
131
+ * Order lines that have already been priced keep the unit price they were given;
132
+ * only lines priced after the deletion lose the discount.
133
+ *
134
+ * This endpoint requires the permission: `discounts:delete`.
135
+ *
136
+ * @example
137
+ * ```ts
138
+ * const volumeDiscount =
139
+ * await client.sales.volumeDiscounts.delete(
140
+ * 'quds_bn7hto9s10pp',
141
+ * );
142
+ * ```
143
+ */
144
+ delete(id, options) {
145
+ return this._client.delete(path `/v1/sales/volume-discounts/${id}`, options);
146
+ }
147
+ }
148
+ //# sourceMappingURL=volume-discounts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"volume-discounts.mjs","sourceRoot":"","sources":["../../src/resources/sales/volume-discounts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OASf,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAC9C;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,QAAqD,EAAE,EACvD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,QAAQ,CACN,EAAU,EACV,QAAyD,EAAE,EAC3D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,8BAA8B,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CAAC,MAAkC,EAAE,OAAwB;QACjE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnG,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,MAAM,CACJ,EAAU,EACV,MAAkC,EAClC,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,8BAA8B,EAAE,EAAE,EAAE;YAChE,KAAK,EAAE,EAAE,OAAO,EAAE;YAClB,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,8BAA8B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;CACF"}
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as APIKeysAPI from '../auth/api-keys/api-keys';
5
- import * as CustomersAPI from '../sales/customers/customers';
5
+ import * as AccountPricesAPI from '../sales/account-prices/account-prices';
6
6
  import { APIPromise } from '../../core/api-promise';
7
7
  import { RequestOptions } from '../../internal/request-options';
8
8
  import { path } from '../../internal/utils/path';
@@ -52,7 +52,7 @@ export class PaymentTerms extends APIResource {
52
52
  id: string,
53
53
  query: PaymentTermRetrieveParams | null | undefined = {},
54
54
  options?: RequestOptions,
55
- ): APIPromise<CustomersAPI.PaymentTerm> {
55
+ ): APIPromise<AccountPricesAPI.PaymentTerm> {
56
56
  return this._client.get(path`/v1/finance/payment-terms/${id}`, { query, ...options });
57
57
  }
58
58
 
@@ -71,7 +71,10 @@ export class PaymentTerms extends APIResource {
71
71
  * });
72
72
  * ```
73
73
  */
74
- create(params: PaymentTermCreateParams, options?: RequestOptions): APIPromise<CustomersAPI.PaymentTerm> {
74
+ create(
75
+ params: PaymentTermCreateParams,
76
+ options?: RequestOptions,
77
+ ): APIPromise<AccountPricesAPI.PaymentTerm> {
75
78
  const { include, ...body } = params;
76
79
  return this._client.post('/v1/finance/payment-terms', { query: { include }, body, ...options });
77
80
  }
@@ -97,7 +100,7 @@ export class PaymentTerms extends APIResource {
97
100
  id: string,
98
101
  params: PaymentTermUpdateParams | null | undefined = {},
99
102
  options?: RequestOptions,
100
- ): APIPromise<CustomersAPI.PaymentTerm> {
103
+ ): APIPromise<AccountPricesAPI.PaymentTerm> {
101
104
  const { include, ...body } = params ?? {};
102
105
  return this._client.patch(path`/v1/finance/payment-terms/${id}`, {
103
106
  query: { include },
@@ -148,7 +151,7 @@ export interface ListPaymentTerm {
148
151
  /**
149
152
  * Resources in this page.
150
153
  */
151
- data: Array<CustomersAPI.PaymentTerm>;
154
+ data: Array<AccountPricesAPI.PaymentTerm>;
152
155
 
153
156
  /**
154
157
  * Resource type identifier.
@@ -14,7 +14,7 @@ import {
14
14
  ServiceLevels,
15
15
  UpdateServiceLevelRequest,
16
16
  } from './service-levels';
17
- import * as CustomersAPI from '../../sales/customers/customers';
17
+ import * as AccountPricesAPI from '../../sales/account-prices/account-prices';
18
18
  import { APIPromise } from '../../../core/api-promise';
19
19
  import { RequestOptions } from '../../../internal/request-options';
20
20
  import { path } from '../../../internal/utils/path';
@@ -60,7 +60,7 @@ export class Carriers extends APIResource {
60
60
  id: string,
61
61
  query: CarrierRetrieveParams | null | undefined = {},
62
62
  options?: RequestOptions,
63
- ): APIPromise<CustomersAPI.Carrier> {
63
+ ): APIPromise<AccountPricesAPI.Carrier> {
64
64
  return this._client.get(path`/v1/operations/carriers/${id}`, { query, ...options });
65
65
  }
66
66
 
@@ -86,7 +86,7 @@ export class Carriers extends APIResource {
86
86
  * });
87
87
  * ```
88
88
  */
89
- create(params: CarrierCreateParams, options?: RequestOptions): APIPromise<CustomersAPI.Carrier> {
89
+ create(params: CarrierCreateParams, options?: RequestOptions): APIPromise<AccountPricesAPI.Carrier> {
90
90
  const { include, ...body } = params;
91
91
  return this._client.post('/v1/operations/carriers', { query: { include }, body, ...options });
92
92
  }
@@ -114,7 +114,7 @@ export class Carriers extends APIResource {
114
114
  id: string,
115
115
  params: CarrierUpdateParams | null | undefined = {},
116
116
  options?: RequestOptions,
117
- ): APIPromise<CustomersAPI.Carrier> {
117
+ ): APIPromise<AccountPricesAPI.Carrier> {
118
118
  const { include, ...body } = params ?? {};
119
119
  return this._client.patch(path`/v1/operations/carriers/${id}`, { query: { include }, body, ...options });
120
120
  }
@@ -186,7 +186,7 @@ export interface ListCarrier {
186
186
  /**
187
187
  * Resources in this page.
188
188
  */
189
- data: Array<CustomersAPI.Carrier>;
189
+ data: Array<AccountPricesAPI.Carrier>;
190
190
 
191
191
  /**
192
192
  * Resource type identifier.
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../../core/resource';
4
- import * as CustomersAPI from '../../sales/customers/customers';
4
+ import * as AccountPricesAPI from '../../sales/account-prices/account-prices';
5
5
  import { APIPromise } from '../../../core/api-promise';
6
6
  import { RequestOptions } from '../../../internal/request-options';
7
7
  import { path } from '../../../internal/utils/path';
@@ -31,7 +31,7 @@ export class ServiceLevels extends APIResource {
31
31
  carrierID: string,
32
32
  query: ServiceLevelListParams | null | undefined = {},
33
33
  options?: RequestOptions,
34
- ): APIPromise<CustomersAPI.ListServiceLevel> {
34
+ ): APIPromise<AccountPricesAPI.ListServiceLevel> {
35
35
  return this._client.get(path`/v1/operations/carriers/${carrierID}/service-levels`, { query, ...options });
36
36
  }
37
37
 
@@ -54,7 +54,7 @@ export class ServiceLevels extends APIResource {
54
54
  id: string,
55
55
  params: ServiceLevelRetrieveParams,
56
56
  options?: RequestOptions,
57
- ): APIPromise<CustomersAPI.ServiceLevel> {
57
+ ): APIPromise<AccountPricesAPI.ServiceLevel> {
58
58
  const { carrier_id, ...query } = params;
59
59
  return this._client.get(path`/v1/operations/carriers/${carrier_id}/service-levels/${id}`, {
60
60
  query,
@@ -90,7 +90,7 @@ export class ServiceLevels extends APIResource {
90
90
  carrierID: string,
91
91
  params: ServiceLevelCreateParams,
92
92
  options?: RequestOptions,
93
- ): APIPromise<CustomersAPI.ServiceLevel> {
93
+ ): APIPromise<AccountPricesAPI.ServiceLevel> {
94
94
  const { include, ...body } = params;
95
95
  return this._client.post(path`/v1/operations/carriers/${carrierID}/service-levels`, {
96
96
  query: { include },
@@ -126,7 +126,7 @@ export class ServiceLevels extends APIResource {
126
126
  id: string,
127
127
  params: ServiceLevelUpdateParams,
128
128
  options?: RequestOptions,
129
- ): APIPromise<CustomersAPI.ServiceLevel> {
129
+ ): APIPromise<AccountPricesAPI.ServiceLevel> {
130
130
  const { carrier_id, include, ...body } = params;
131
131
  return this._client.patch(path`/v1/operations/carriers/${carrier_id}/service-levels/${id}`, {
132
132
  query: { include },
@@ -3,7 +3,7 @@
3
3
  import { APIResource } from '../../../core/resource';
4
4
  import * as AddressesAPI from '../../sales/addresses';
5
5
  import * as APIKeysAPI from '../../auth/api-keys/api-keys';
6
- import * as CustomersAPI from '../../sales/customers/customers';
6
+ import * as AccountPricesAPI from '../../sales/account-prices/account-prices';
7
7
  import { APIPromise } from '../../../core/api-promise';
8
8
  import { RequestOptions } from '../../../internal/request-options';
9
9
 
@@ -129,7 +129,7 @@ export interface RateShopOption {
129
129
  * through Shippo for live rating and label purchase; other carriers represent
130
130
  * self-managed shipping methods such as will call or local delivery.
131
131
  */
132
- carrier: CustomersAPI.Carrier | null;
132
+ carrier: AccountPricesAPI.Carrier | null;
133
133
 
134
134
  /**
135
135
  * Estimated number of days until delivery, when the carrier provides an estimate.
@@ -157,7 +157,7 @@ export interface RateShopOption {
157
157
  * Carriers connected through Shippo have their service levels synced from the
158
158
  * carrier itself; any carrier can also have service levels you create by hand.
159
159
  */
160
- service_level: CustomersAPI.ServiceLevel | null;
160
+ service_level: AccountPricesAPI.ServiceLevel | null;
161
161
  }
162
162
 
163
163
  /**
@@ -3,7 +3,7 @@
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as APIKeysAPI from '../auth/api-keys/api-keys';
5
5
  import * as ProductLinesAPI from '../catalog/product-lines/product-lines';
6
- import * as CustomersAPI from '../sales/customers/customers';
6
+ import * as AccountPricesAPI from '../sales/account-prices/account-prices';
7
7
  import { APIPromise } from '../../core/api-promise';
8
8
  import { RequestOptions } from '../../internal/request-options';
9
9
  import { path } from '../../internal/utils/path';
@@ -50,7 +50,7 @@ export class ShippingTerms extends APIResource {
50
50
  id: string,
51
51
  query: ShippingTermRetrieveParams | null | undefined = {},
52
52
  options?: RequestOptions,
53
- ): APIPromise<CustomersAPI.ShippingTerm> {
53
+ ): APIPromise<AccountPricesAPI.ShippingTerm> {
54
54
  return this._client.get(path`/v1/operations/shipping-terms/${id}`, { query, ...options });
55
55
  }
56
56
 
@@ -80,7 +80,10 @@ export class ShippingTerms extends APIResource {
80
80
  * });
81
81
  * ```
82
82
  */
83
- create(params: ShippingTermCreateParams, options?: RequestOptions): APIPromise<CustomersAPI.ShippingTerm> {
83
+ create(
84
+ params: ShippingTermCreateParams,
85
+ options?: RequestOptions,
86
+ ): APIPromise<AccountPricesAPI.ShippingTerm> {
84
87
  const { include, ...body } = params;
85
88
  return this._client.post('/v1/operations/shipping-terms', { query: { include }, body, ...options });
86
89
  }
@@ -121,7 +124,7 @@ export class ShippingTerms extends APIResource {
121
124
  id: string,
122
125
  params: ShippingTermUpdateParams | null | undefined = {},
123
126
  options?: RequestOptions,
124
- ): APIPromise<CustomersAPI.ShippingTerm> {
127
+ ): APIPromise<AccountPricesAPI.ShippingTerm> {
125
128
  const { include, ...body } = params ?? {};
126
129
  return this._client.patch(path`/v1/operations/shipping-terms/${id}`, {
127
130
  query: { include },
@@ -208,7 +211,7 @@ export interface ListShippingTerm {
208
211
  /**
209
212
  * Resources in this page.
210
213
  */
211
- data: Array<CustomersAPI.ShippingTerm>;
214
+ data: Array<AccountPricesAPI.ShippingTerm>;
212
215
 
213
216
  /**
214
217
  * Resource type identifier.