@metronome/sdk 3.5.0 → 3.7.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 (307) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/api-promise.d.mts +1 -0
  3. package/api-promise.d.mts.map +1 -1
  4. package/api-promise.d.ts +1 -0
  5. package/api-promise.d.ts.map +1 -1
  6. package/api-promise.mjs +1 -0
  7. package/api-promise.mjs.map +1 -1
  8. package/bin/cli +12 -5
  9. package/client.d.mts.map +1 -1
  10. package/client.d.ts.map +1 -1
  11. package/client.js +11 -0
  12. package/client.js.map +1 -1
  13. package/client.mjs +11 -0
  14. package/client.mjs.map +1 -1
  15. package/core/api-promise.d.mts.map +1 -1
  16. package/core/api-promise.d.ts.map +1 -1
  17. package/core/api-promise.mjs.map +1 -1
  18. package/core/error.mjs.map +1 -1
  19. package/core/pagination.d.mts.map +1 -1
  20. package/core/pagination.d.ts.map +1 -1
  21. package/core/pagination.mjs.map +1 -1
  22. package/core/resource.d.mts.map +1 -1
  23. package/core/resource.d.ts.map +1 -1
  24. package/core/uploads.d.mts.map +1 -1
  25. package/core/uploads.d.ts.map +1 -1
  26. package/core/uploads.mjs.map +1 -1
  27. package/error.d.mts +1 -0
  28. package/error.d.mts.map +1 -1
  29. package/error.d.ts +1 -0
  30. package/error.d.ts.map +1 -1
  31. package/error.mjs +1 -0
  32. package/error.mjs.map +1 -1
  33. package/index.d.mts.map +1 -1
  34. package/index.d.ts.map +1 -1
  35. package/index.mjs.map +1 -1
  36. package/internal/detect-platform.mjs.map +1 -1
  37. package/internal/headers.mjs.map +1 -1
  38. package/internal/parse.d.mts.map +1 -1
  39. package/internal/parse.d.ts.map +1 -1
  40. package/internal/parse.mjs.map +1 -1
  41. package/internal/qs/formats.d.mts.map +1 -1
  42. package/internal/qs/formats.d.ts.map +1 -1
  43. package/internal/qs/index.d.mts +2 -2
  44. package/internal/qs/index.d.mts.map +1 -1
  45. package/internal/qs/index.d.ts +2 -2
  46. package/internal/qs/index.d.ts.map +1 -1
  47. package/internal/qs/index.mjs.map +1 -1
  48. package/internal/qs/stringify.d.mts.map +1 -1
  49. package/internal/qs/stringify.d.ts.map +1 -1
  50. package/internal/qs/stringify.mjs.map +1 -1
  51. package/internal/qs/utils.d.mts.map +1 -1
  52. package/internal/qs/utils.d.ts.map +1 -1
  53. package/internal/qs/utils.mjs.map +1 -1
  54. package/internal/request-options.d.mts.map +1 -1
  55. package/internal/request-options.d.ts.map +1 -1
  56. package/internal/shims.d.mts +6 -0
  57. package/internal/shims.d.mts.map +1 -1
  58. package/internal/shims.d.ts +6 -0
  59. package/internal/shims.d.ts.map +1 -1
  60. package/internal/to-file.d.mts.map +1 -1
  61. package/internal/to-file.d.ts.map +1 -1
  62. package/internal/to-file.mjs.map +1 -1
  63. package/internal/types.d.mts +10 -10
  64. package/internal/types.d.mts.map +1 -1
  65. package/internal/types.d.ts +10 -10
  66. package/internal/types.d.ts.map +1 -1
  67. package/internal/uploads.d.mts.map +1 -1
  68. package/internal/uploads.d.ts.map +1 -1
  69. package/internal/uploads.mjs.map +1 -1
  70. package/internal/utils/base64.mjs.map +1 -1
  71. package/internal/utils/log.d.mts.map +1 -1
  72. package/internal/utils/log.d.ts.map +1 -1
  73. package/internal/utils/log.js +2 -0
  74. package/internal/utils/log.js.map +1 -1
  75. package/internal/utils/log.mjs +2 -0
  76. package/internal/utils/log.mjs.map +1 -1
  77. package/internal/utils/path.mjs.map +1 -1
  78. package/internal/utils/query.mjs.map +1 -1
  79. package/internal/utils/values.mjs.map +1 -1
  80. package/internal/utils.d.mts.map +1 -1
  81. package/internal/utils.d.ts.map +1 -1
  82. package/internal/utils.mjs.map +1 -1
  83. package/package.json +1 -1
  84. package/pagination.d.mts +1 -0
  85. package/pagination.d.mts.map +1 -1
  86. package/pagination.d.ts +1 -0
  87. package/pagination.d.ts.map +1 -1
  88. package/pagination.mjs +1 -0
  89. package/pagination.mjs.map +1 -1
  90. package/resource.d.mts +1 -0
  91. package/resource.d.mts.map +1 -1
  92. package/resource.d.ts +1 -0
  93. package/resource.d.ts.map +1 -1
  94. package/resource.mjs +1 -0
  95. package/resource.mjs.map +1 -1
  96. package/resources/index.d.mts.map +1 -1
  97. package/resources/index.d.ts.map +1 -1
  98. package/resources/index.mjs.map +1 -1
  99. package/resources/shared.d.mts +321 -1
  100. package/resources/shared.d.mts.map +1 -1
  101. package/resources/shared.d.ts +321 -1
  102. package/resources/shared.d.ts.map +1 -1
  103. package/resources/v1/alerts.d.mts +1 -1
  104. package/resources/v1/alerts.d.mts.map +1 -1
  105. package/resources/v1/alerts.d.ts +1 -1
  106. package/resources/v1/alerts.d.ts.map +1 -1
  107. package/resources/v1/alerts.mjs.map +1 -1
  108. package/resources/v1/audit-logs.d.mts.map +1 -1
  109. package/resources/v1/audit-logs.d.ts.map +1 -1
  110. package/resources/v1/audit-logs.mjs.map +1 -1
  111. package/resources/v1/billable-metrics.d.mts.map +1 -1
  112. package/resources/v1/billable-metrics.d.ts.map +1 -1
  113. package/resources/v1/billable-metrics.mjs.map +1 -1
  114. package/resources/v1/contracts/contracts.d.mts +629 -143
  115. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  116. package/resources/v1/contracts/contracts.d.ts +629 -143
  117. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  118. package/resources/v1/contracts/contracts.js +47 -2
  119. package/resources/v1/contracts/contracts.js.map +1 -1
  120. package/resources/v1/contracts/contracts.mjs +47 -2
  121. package/resources/v1/contracts/contracts.mjs.map +1 -1
  122. package/resources/v1/contracts/index.d.mts +1 -1
  123. package/resources/v1/contracts/index.d.mts.map +1 -1
  124. package/resources/v1/contracts/index.d.ts +1 -1
  125. package/resources/v1/contracts/index.d.ts.map +1 -1
  126. package/resources/v1/contracts/index.js.map +1 -1
  127. package/resources/v1/contracts/index.mjs.map +1 -1
  128. package/resources/v1/contracts/named-schedules.d.mts.map +1 -1
  129. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  130. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  131. package/resources/v1/contracts/products.d.mts +18 -0
  132. package/resources/v1/contracts/products.d.mts.map +1 -1
  133. package/resources/v1/contracts/products.d.ts +18 -0
  134. package/resources/v1/contracts/products.d.ts.map +1 -1
  135. package/resources/v1/contracts/products.mjs.map +1 -1
  136. package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -1
  137. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
  138. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
  139. package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -1
  140. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  141. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  142. package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -1
  143. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  144. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  145. package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -1
  146. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  147. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  148. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
  149. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  150. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  151. package/resources/v1/contracts/rate-cards.d.mts.map +1 -1
  152. package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
  153. package/resources/v1/contracts/rate-cards.mjs.map +1 -1
  154. package/resources/v1/contracts.d.mts.map +1 -1
  155. package/resources/v1/contracts.d.ts.map +1 -1
  156. package/resources/v1/contracts.mjs.map +1 -1
  157. package/resources/v1/credit-grants.d.mts.map +1 -1
  158. package/resources/v1/credit-grants.d.ts.map +1 -1
  159. package/resources/v1/credit-grants.mjs.map +1 -1
  160. package/resources/v1/custom-fields.d.mts.map +1 -1
  161. package/resources/v1/custom-fields.d.ts.map +1 -1
  162. package/resources/v1/custom-fields.mjs.map +1 -1
  163. package/resources/v1/customers/alerts.d.mts +1 -1
  164. package/resources/v1/customers/alerts.d.mts.map +1 -1
  165. package/resources/v1/customers/alerts.d.ts +1 -1
  166. package/resources/v1/customers/alerts.d.ts.map +1 -1
  167. package/resources/v1/customers/alerts.mjs.map +1 -1
  168. package/resources/v1/customers/billing-config.d.mts.map +1 -1
  169. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  170. package/resources/v1/customers/billing-config.mjs.map +1 -1
  171. package/resources/v1/customers/commits.d.mts.map +1 -1
  172. package/resources/v1/customers/commits.d.ts.map +1 -1
  173. package/resources/v1/customers/commits.mjs.map +1 -1
  174. package/resources/v1/customers/credits.d.mts.map +1 -1
  175. package/resources/v1/customers/credits.d.ts.map +1 -1
  176. package/resources/v1/customers/credits.mjs.map +1 -1
  177. package/resources/v1/customers/customers.d.mts.map +1 -1
  178. package/resources/v1/customers/customers.d.ts.map +1 -1
  179. package/resources/v1/customers/customers.mjs.map +1 -1
  180. package/resources/v1/customers/index.d.mts.map +1 -1
  181. package/resources/v1/customers/index.d.ts.map +1 -1
  182. package/resources/v1/customers/index.mjs.map +1 -1
  183. package/resources/v1/customers/invoices.d.mts +9 -0
  184. package/resources/v1/customers/invoices.d.mts.map +1 -1
  185. package/resources/v1/customers/invoices.d.ts +9 -0
  186. package/resources/v1/customers/invoices.d.ts.map +1 -1
  187. package/resources/v1/customers/invoices.mjs.map +1 -1
  188. package/resources/v1/customers/named-schedules.d.mts.map +1 -1
  189. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  190. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  191. package/resources/v1/customers/plans.d.mts.map +1 -1
  192. package/resources/v1/customers/plans.d.ts.map +1 -1
  193. package/resources/v1/customers/plans.mjs.map +1 -1
  194. package/resources/v1/customers.d.mts.map +1 -1
  195. package/resources/v1/customers.d.ts.map +1 -1
  196. package/resources/v1/customers.mjs.map +1 -1
  197. package/resources/v1/dashboards.d.mts.map +1 -1
  198. package/resources/v1/dashboards.d.ts.map +1 -1
  199. package/resources/v1/dashboards.mjs.map +1 -1
  200. package/resources/v1/index.d.mts +1 -2
  201. package/resources/v1/index.d.mts.map +1 -1
  202. package/resources/v1/index.d.ts +1 -2
  203. package/resources/v1/index.d.ts.map +1 -1
  204. package/resources/v1/index.js +1 -3
  205. package/resources/v1/index.js.map +1 -1
  206. package/resources/v1/index.mjs +0 -1
  207. package/resources/v1/index.mjs.map +1 -1
  208. package/resources/v1/invoices.d.mts.map +1 -1
  209. package/resources/v1/invoices.d.ts.map +1 -1
  210. package/resources/v1/invoices.mjs.map +1 -1
  211. package/resources/v1/packages.d.mts +57 -5
  212. package/resources/v1/packages.d.mts.map +1 -1
  213. package/resources/v1/packages.d.ts +57 -5
  214. package/resources/v1/packages.d.ts.map +1 -1
  215. package/resources/v1/packages.js +3 -4
  216. package/resources/v1/packages.js.map +1 -1
  217. package/resources/v1/packages.mjs +3 -4
  218. package/resources/v1/packages.mjs.map +1 -1
  219. package/resources/v1/plans.d.mts.map +1 -1
  220. package/resources/v1/plans.d.ts.map +1 -1
  221. package/resources/v1/plans.mjs.map +1 -1
  222. package/resources/v1/pricing-units.d.mts.map +1 -1
  223. package/resources/v1/pricing-units.d.ts.map +1 -1
  224. package/resources/v1/pricing-units.mjs.map +1 -1
  225. package/resources/v1/services.d.mts.map +1 -1
  226. package/resources/v1/services.d.ts.map +1 -1
  227. package/resources/v1/services.mjs.map +1 -1
  228. package/resources/v1/settings/billing-providers.d.mts.map +1 -1
  229. package/resources/v1/settings/billing-providers.d.ts.map +1 -1
  230. package/resources/v1/settings/billing-providers.mjs.map +1 -1
  231. package/resources/v1/settings/index.d.mts.map +1 -1
  232. package/resources/v1/settings/index.d.ts.map +1 -1
  233. package/resources/v1/settings/index.mjs.map +1 -1
  234. package/resources/v1/settings/settings.d.mts.map +1 -1
  235. package/resources/v1/settings/settings.d.ts.map +1 -1
  236. package/resources/v1/settings/settings.mjs.map +1 -1
  237. package/resources/v1/settings.d.mts.map +1 -1
  238. package/resources/v1/settings.d.ts.map +1 -1
  239. package/resources/v1/settings.mjs.map +1 -1
  240. package/resources/v1/usage.d.mts.map +1 -1
  241. package/resources/v1/usage.d.ts.map +1 -1
  242. package/resources/v1/usage.mjs.map +1 -1
  243. package/resources/v1/v1.d.mts +2 -6
  244. package/resources/v1/v1.d.mts.map +1 -1
  245. package/resources/v1/v1.d.ts +2 -6
  246. package/resources/v1/v1.d.ts.map +1 -1
  247. package/resources/v1/v1.js +0 -4
  248. package/resources/v1/v1.js.map +1 -1
  249. package/resources/v1/v1.mjs +0 -4
  250. package/resources/v1/v1.mjs.map +1 -1
  251. package/resources/v1.d.mts.map +1 -1
  252. package/resources/v1.d.ts.map +1 -1
  253. package/resources/v1.mjs.map +1 -1
  254. package/resources/v2/contracts.d.mts +1431 -2
  255. package/resources/v2/contracts.d.mts.map +1 -1
  256. package/resources/v2/contracts.d.ts +1431 -2
  257. package/resources/v2/contracts.d.ts.map +1 -1
  258. package/resources/v2/contracts.mjs.map +1 -1
  259. package/resources/v2/index.d.mts.map +1 -1
  260. package/resources/v2/index.d.ts.map +1 -1
  261. package/resources/v2/index.mjs.map +1 -1
  262. package/resources/v2/v2.d.mts.map +1 -1
  263. package/resources/v2/v2.d.ts.map +1 -1
  264. package/resources/v2/v2.mjs.map +1 -1
  265. package/resources/v2.d.mts.map +1 -1
  266. package/resources/v2.d.ts.map +1 -1
  267. package/resources/v2.mjs.map +1 -1
  268. package/resources/webhooks.d.mts.map +1 -1
  269. package/resources/webhooks.d.ts.map +1 -1
  270. package/resources/webhooks.mjs.map +1 -1
  271. package/resources.d.mts.map +1 -1
  272. package/resources.d.ts.map +1 -1
  273. package/resources.mjs.map +1 -1
  274. package/src/client.ts +12 -0
  275. package/src/internal/types.ts +6 -8
  276. package/src/internal/utils/log.ts +2 -0
  277. package/src/resources/shared.ts +417 -1
  278. package/src/resources/v1/alerts.ts +1 -1
  279. package/src/resources/v1/contracts/contracts.ts +813 -156
  280. package/src/resources/v1/contracts/index.ts +2 -0
  281. package/src/resources/v1/contracts/products.ts +20 -0
  282. package/src/resources/v1/customers/alerts.ts +1 -1
  283. package/src/resources/v1/customers/invoices.ts +12 -0
  284. package/src/resources/v1/index.ts +2 -11
  285. package/src/resources/v1/packages.ts +81 -6
  286. package/src/resources/v1/v1.ts +4 -26
  287. package/src/resources/v2/contracts.ts +1881 -2
  288. package/src/version.ts +1 -1
  289. package/uploads.d.mts +1 -0
  290. package/uploads.d.mts.map +1 -1
  291. package/uploads.d.ts +1 -0
  292. package/uploads.d.ts.map +1 -1
  293. package/uploads.mjs +1 -0
  294. package/uploads.mjs.map +1 -1
  295. package/version.d.mts +1 -1
  296. package/version.d.ts +1 -1
  297. package/version.js +1 -1
  298. package/version.mjs +1 -1
  299. package/resources/v1/payments.d.mts +0 -127
  300. package/resources/v1/payments.d.mts.map +0 -1
  301. package/resources/v1/payments.d.ts +0 -127
  302. package/resources/v1/payments.d.ts.map +0 -1
  303. package/resources/v1/payments.js +0 -71
  304. package/resources/v1/payments.js.map +0 -1
  305. package/resources/v1/payments.mjs +0 -67
  306. package/resources/v1/payments.mjs.map +0 -1
  307. package/src/resources/v1/payments.ts +0 -187
@@ -213,7 +213,1193 @@ export interface ContractListResponse {
213
213
  data: Array<Shared.ContractV2>;
214
214
  }
215
215
  export interface ContractEditResponse {
216
- data: Shared.ID;
216
+ data: ContractEditResponse.Data;
217
+ }
218
+ export declare namespace ContractEditResponse {
219
+ interface Data {
220
+ id: string;
221
+ edit?: Data.Edit;
222
+ }
223
+ namespace Data {
224
+ interface Edit {
225
+ id: string;
226
+ add_commits?: Array<Edit.AddCommit>;
227
+ add_credits?: Array<Edit.AddCredit>;
228
+ add_discounts?: Array<Shared.Discount>;
229
+ add_overrides?: Array<Edit.AddOverride>;
230
+ add_prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfigurationV2;
231
+ add_pro_services?: Array<Shared.ProService>;
232
+ add_recurring_commits?: Array<Edit.AddRecurringCommit>;
233
+ add_recurring_credits?: Array<Edit.AddRecurringCredit>;
234
+ add_reseller_royalties?: Array<Edit.AddResellerRoyalty>;
235
+ add_scheduled_charges?: Array<Edit.AddScheduledCharge>;
236
+ add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
237
+ /**
238
+ * List of subscriptions on the contract.
239
+ */
240
+ add_subscriptions?: Array<Edit.AddSubscription>;
241
+ add_usage_filters?: Array<Edit.AddUsageFilter>;
242
+ archive_commits?: Array<Edit.ArchiveCommit>;
243
+ archive_credits?: Array<Edit.ArchiveCredit>;
244
+ archive_scheduled_charges?: Array<Edit.ArchiveScheduledCharge>;
245
+ remove_overrides?: Array<Edit.RemoveOverride>;
246
+ timestamp?: string;
247
+ /**
248
+ * Prevents the creation of duplicates. If a request to create a record is made
249
+ * with a previously used uniqueness key, a new record will not be created and the
250
+ * request will fail with a 409 error.
251
+ */
252
+ uniqueness_key?: string;
253
+ update_commits?: Array<Edit.UpdateCommit>;
254
+ update_contract_end_date?: string;
255
+ /**
256
+ * Value to update the contract name to. If not provided, the contract name will
257
+ * remain unchanged.
258
+ */
259
+ update_contract_name?: string | null;
260
+ update_credits?: Array<Edit.UpdateCredit>;
261
+ update_discounts?: Array<Edit.UpdateDiscount>;
262
+ update_prepaid_balance_threshold_configuration?: Edit.UpdatePrepaidBalanceThresholdConfiguration;
263
+ update_recurring_commits?: Array<Edit.UpdateRecurringCommit>;
264
+ update_recurring_credits?: Array<Edit.UpdateRecurringCredit>;
265
+ update_refund_invoices?: Array<Edit.UpdateRefundInvoice>;
266
+ update_scheduled_charges?: Array<Edit.UpdateScheduledCharge>;
267
+ update_spend_threshold_configuration?: Edit.UpdateSpendThresholdConfiguration;
268
+ /**
269
+ * Optional list of subscriptions to update.
270
+ */
271
+ update_subscriptions?: Array<Edit.UpdateSubscription>;
272
+ }
273
+ namespace Edit {
274
+ interface AddCommit {
275
+ id: string;
276
+ product: AddCommit.Product;
277
+ type: 'PREPAID' | 'POSTPAID';
278
+ /**
279
+ * The schedule that the customer will gain access to the credits purposed with
280
+ * this commit.
281
+ */
282
+ access_schedule?: Shared.ScheduleDuration;
283
+ applicable_product_ids?: Array<string>;
284
+ applicable_product_tags?: Array<string>;
285
+ description?: string;
286
+ /**
287
+ * Optional configuration for commit hierarchy access control
288
+ */
289
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
290
+ /**
291
+ * The schedule that the customer will be invoiced for this commit.
292
+ */
293
+ invoice_schedule?: AddCommit.InvoiceSchedule;
294
+ name?: string;
295
+ /**
296
+ * This field's availability is dependent on your client's configuration.
297
+ */
298
+ netsuite_sales_order_id?: string;
299
+ /**
300
+ * If multiple credits or commits are applicable, the one with the lower priority
301
+ * will apply first.
302
+ */
303
+ priority?: number;
304
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
305
+ rollover_fraction?: number;
306
+ /**
307
+ * This field's availability is dependent on your client's configuration.
308
+ */
309
+ salesforce_opportunity_id?: string;
310
+ /**
311
+ * List of filters that determine what kind of customer usage draws down a commit
312
+ * or credit. A customer's usage needs to meet the condition of at least one of the
313
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
314
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
315
+ * Instead, to target usage by product or product tag, pass those values in the
316
+ * body of `specifiers`.
317
+ */
318
+ specifiers?: Array<Shared.CommitSpecifierInput>;
319
+ }
320
+ namespace AddCommit {
321
+ interface Product {
322
+ id: string;
323
+ name: string;
324
+ }
325
+ /**
326
+ * The schedule that the customer will be invoiced for this commit.
327
+ */
328
+ interface InvoiceSchedule {
329
+ credit_type?: Shared.CreditTypeData;
330
+ /**
331
+ * If true, this schedule will not generate an invoice.
332
+ */
333
+ do_not_invoice?: boolean;
334
+ schedule_items?: Array<InvoiceSchedule.ScheduleItem>;
335
+ }
336
+ namespace InvoiceSchedule {
337
+ interface ScheduleItem {
338
+ id: string;
339
+ timestamp: string;
340
+ amount?: number;
341
+ invoice_id?: string | null;
342
+ quantity?: number;
343
+ unit_price?: number;
344
+ }
345
+ }
346
+ }
347
+ interface AddCredit {
348
+ id: string;
349
+ product: AddCredit.Product;
350
+ type: 'CREDIT';
351
+ /**
352
+ * The schedule that the customer will gain access to the credits.
353
+ */
354
+ access_schedule?: Shared.ScheduleDuration;
355
+ applicable_product_ids?: Array<string>;
356
+ applicable_product_tags?: Array<string>;
357
+ description?: string;
358
+ /**
359
+ * Optional configuration for recurring credit hierarchy access control
360
+ */
361
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
362
+ name?: string;
363
+ /**
364
+ * This field's availability is dependent on your client's configuration.
365
+ */
366
+ netsuite_sales_order_id?: string;
367
+ /**
368
+ * If multiple credits or commits are applicable, the one with the lower priority
369
+ * will apply first.
370
+ */
371
+ priority?: number;
372
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
373
+ rollover_fraction?: number;
374
+ /**
375
+ * This field's availability is dependent on your client's configuration.
376
+ */
377
+ salesforce_opportunity_id?: string;
378
+ /**
379
+ * List of filters that determine what kind of customer usage draws down a commit
380
+ * or credit. A customer's usage needs to meet the condition of at least one of the
381
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
382
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
383
+ * Instead, to target usage by product or product tag, pass those values in the
384
+ * body of `specifiers`.
385
+ */
386
+ specifiers?: Array<Shared.CommitSpecifierInput>;
387
+ }
388
+ namespace AddCredit {
389
+ interface Product {
390
+ id: string;
391
+ name: string;
392
+ }
393
+ }
394
+ interface AddOverride {
395
+ id: string;
396
+ created_at: string;
397
+ starting_at: string;
398
+ applicable_product_tags?: Array<string>;
399
+ ending_before?: string;
400
+ entitled?: boolean;
401
+ is_commit_specific?: boolean;
402
+ multiplier?: number;
403
+ override_specifiers?: Array<AddOverride.OverrideSpecifier>;
404
+ override_tiers?: Array<Shared.OverrideTier>;
405
+ overwrite_rate?: AddOverride.OverwriteRate;
406
+ priority?: number;
407
+ product?: AddOverride.Product;
408
+ target?: 'COMMIT_RATE' | 'LIST_RATE';
409
+ type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
410
+ }
411
+ namespace AddOverride {
412
+ interface OverrideSpecifier {
413
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
414
+ commit_ids?: Array<string>;
415
+ presentation_group_values?: {
416
+ [key: string]: string | null;
417
+ };
418
+ pricing_group_values?: {
419
+ [key: string]: string;
420
+ };
421
+ product_id?: string;
422
+ product_tags?: Array<string>;
423
+ recurring_commit_ids?: Array<string>;
424
+ }
425
+ interface OverwriteRate {
426
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
427
+ credit_type?: Shared.CreditTypeData;
428
+ /**
429
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
430
+ * processors.
431
+ */
432
+ custom_rate?: {
433
+ [key: string]: unknown;
434
+ };
435
+ /**
436
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
437
+ * set to true.
438
+ */
439
+ is_prorated?: boolean;
440
+ /**
441
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
442
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
443
+ */
444
+ price?: number;
445
+ /**
446
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
447
+ */
448
+ quantity?: number;
449
+ /**
450
+ * Only set for TIERED rate_type.
451
+ */
452
+ tiers?: Array<Shared.Tier>;
453
+ }
454
+ interface Product {
455
+ id: string;
456
+ name: string;
457
+ }
458
+ }
459
+ interface AddRecurringCommit {
460
+ id: string;
461
+ /**
462
+ * The amount of commit to grant.
463
+ */
464
+ access_amount: AddRecurringCommit.AccessAmount;
465
+ /**
466
+ * The amount of time the created commits will be valid for
467
+ */
468
+ commit_duration: AddRecurringCommit.CommitDuration;
469
+ /**
470
+ * Will be passed down to the individual commits
471
+ */
472
+ priority: number;
473
+ product: AddRecurringCommit.Product;
474
+ /**
475
+ * Whether the created commits will use the commit rate or list rate
476
+ */
477
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
478
+ /**
479
+ * Determines the start time for the first commit
480
+ */
481
+ starting_at: string;
482
+ /**
483
+ * Will be passed down to the individual commits
484
+ */
485
+ applicable_product_ids?: Array<string>;
486
+ /**
487
+ * Will be passed down to the individual commits
488
+ */
489
+ applicable_product_tags?: Array<string>;
490
+ contract?: AddRecurringCommit.Contract;
491
+ /**
492
+ * Will be passed down to the individual commits
493
+ */
494
+ description?: string;
495
+ /**
496
+ * Determines when the contract will stop creating recurring commits. Optional
497
+ */
498
+ ending_before?: string;
499
+ /**
500
+ * Optional configuration for recurring credit hierarchy access control
501
+ */
502
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
503
+ /**
504
+ * The amount the customer should be billed for the commit. Not required.
505
+ */
506
+ invoice_amount?: AddRecurringCommit.InvoiceAmount;
507
+ /**
508
+ * Displayed on invoices. Will be passed through to the individual commits
509
+ */
510
+ name?: string;
511
+ /**
512
+ * Will be passed down to the individual commits
513
+ */
514
+ netsuite_sales_order_id?: string;
515
+ /**
516
+ * Determines whether the first and last commit will be prorated. If not provided,
517
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
518
+ */
519
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
520
+ /**
521
+ * The frequency at which the recurring commits will be created. If not provided: -
522
+ * The commits will be created on the usage invoice frequency. If provided: - The
523
+ * period defined in the duration will correspond to this frequency. - Commits will
524
+ * be created aligned with the recurring commit's starting_at rather than the usage
525
+ * invoice dates.
526
+ */
527
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
528
+ /**
529
+ * Will be passed down to the individual commits. This controls how much of an
530
+ * individual unexpired commit will roll over upon contract transition. Must be
531
+ * between 0 and 1.
532
+ */
533
+ rollover_fraction?: number;
534
+ /**
535
+ * List of filters that determine what kind of customer usage draws down a commit
536
+ * or credit. A customer's usage needs to meet the condition of at least one of the
537
+ * specifiers to contribute to a commit's or credit's drawdown.
538
+ */
539
+ specifiers?: Array<Shared.CommitSpecifier>;
540
+ /**
541
+ * Attach a subscription to the recurring commit/credit.
542
+ */
543
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
544
+ }
545
+ namespace AddRecurringCommit {
546
+ /**
547
+ * The amount of commit to grant.
548
+ */
549
+ interface AccessAmount {
550
+ credit_type_id: string;
551
+ unit_price: number;
552
+ quantity?: number;
553
+ }
554
+ /**
555
+ * The amount of time the created commits will be valid for
556
+ */
557
+ interface CommitDuration {
558
+ value: number;
559
+ unit?: 'PERIODS';
560
+ }
561
+ interface Product {
562
+ id: string;
563
+ name: string;
564
+ }
565
+ interface Contract {
566
+ id: string;
567
+ }
568
+ /**
569
+ * The amount the customer should be billed for the commit. Not required.
570
+ */
571
+ interface InvoiceAmount {
572
+ credit_type_id: string;
573
+ quantity: number;
574
+ unit_price: number;
575
+ }
576
+ }
577
+ interface AddRecurringCredit {
578
+ id: string;
579
+ /**
580
+ * The amount of commit to grant.
581
+ */
582
+ access_amount: AddRecurringCredit.AccessAmount;
583
+ /**
584
+ * The amount of time the created commits will be valid for
585
+ */
586
+ commit_duration: AddRecurringCredit.CommitDuration;
587
+ /**
588
+ * Will be passed down to the individual commits
589
+ */
590
+ priority: number;
591
+ product: AddRecurringCredit.Product;
592
+ /**
593
+ * Whether the created commits will use the commit rate or list rate
594
+ */
595
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
596
+ /**
597
+ * Determines the start time for the first commit
598
+ */
599
+ starting_at: string;
600
+ /**
601
+ * Will be passed down to the individual commits
602
+ */
603
+ applicable_product_ids?: Array<string>;
604
+ /**
605
+ * Will be passed down to the individual commits
606
+ */
607
+ applicable_product_tags?: Array<string>;
608
+ contract?: AddRecurringCredit.Contract;
609
+ /**
610
+ * Will be passed down to the individual commits
611
+ */
612
+ description?: string;
613
+ /**
614
+ * Determines when the contract will stop creating recurring commits. Optional
615
+ */
616
+ ending_before?: string;
617
+ /**
618
+ * Optional configuration for recurring credit hierarchy access control
619
+ */
620
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
621
+ /**
622
+ * Displayed on invoices. Will be passed through to the individual commits
623
+ */
624
+ name?: string;
625
+ /**
626
+ * Will be passed down to the individual commits
627
+ */
628
+ netsuite_sales_order_id?: string;
629
+ /**
630
+ * Determines whether the first and last commit will be prorated. If not provided,
631
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
632
+ */
633
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
634
+ /**
635
+ * The frequency at which the recurring commits will be created. If not provided: -
636
+ * The commits will be created on the usage invoice frequency. If provided: - The
637
+ * period defined in the duration will correspond to this frequency. - Commits will
638
+ * be created aligned with the recurring commit's starting_at rather than the usage
639
+ * invoice dates.
640
+ */
641
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
642
+ /**
643
+ * Will be passed down to the individual commits. This controls how much of an
644
+ * individual unexpired commit will roll over upon contract transition. Must be
645
+ * between 0 and 1.
646
+ */
647
+ rollover_fraction?: number;
648
+ /**
649
+ * List of filters that determine what kind of customer usage draws down a commit
650
+ * or credit. A customer's usage needs to meet the condition of at least one of the
651
+ * specifiers to contribute to a commit's or credit's drawdown.
652
+ */
653
+ specifiers?: Array<Shared.CommitSpecifier>;
654
+ /**
655
+ * Attach a subscription to the recurring commit/credit.
656
+ */
657
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
658
+ }
659
+ namespace AddRecurringCredit {
660
+ /**
661
+ * The amount of commit to grant.
662
+ */
663
+ interface AccessAmount {
664
+ credit_type_id: string;
665
+ unit_price: number;
666
+ quantity?: number;
667
+ }
668
+ /**
669
+ * The amount of time the created commits will be valid for
670
+ */
671
+ interface CommitDuration {
672
+ value: number;
673
+ unit?: 'PERIODS';
674
+ }
675
+ interface Product {
676
+ id: string;
677
+ name: string;
678
+ }
679
+ interface Contract {
680
+ id: string;
681
+ }
682
+ }
683
+ interface AddResellerRoyalty {
684
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
685
+ applicable_product_ids?: Array<string>;
686
+ applicable_product_tags?: Array<string>;
687
+ aws_account_number?: string;
688
+ aws_offer_id?: string;
689
+ aws_payer_reference_id?: string;
690
+ ending_before?: string | null;
691
+ fraction?: number;
692
+ gcp_account_id?: string;
693
+ gcp_offer_id?: string;
694
+ netsuite_reseller_id?: string;
695
+ reseller_contract_value?: number;
696
+ starting_at?: string;
697
+ }
698
+ interface AddScheduledCharge {
699
+ id: string;
700
+ product: AddScheduledCharge.Product;
701
+ schedule: Shared.SchedulePointInTime;
702
+ /**
703
+ * displayed on invoices
704
+ */
705
+ name?: string;
706
+ /**
707
+ * This field's availability is dependent on your client's configuration.
708
+ */
709
+ netsuite_sales_order_id?: string;
710
+ }
711
+ namespace AddScheduledCharge {
712
+ interface Product {
713
+ id: string;
714
+ name: string;
715
+ }
716
+ }
717
+ interface AddSubscription {
718
+ /**
719
+ * Previous, current, and next billing periods for the subscription.
720
+ */
721
+ billing_periods: AddSubscription.BillingPeriods;
722
+ collection_schedule: 'ADVANCE' | 'ARREARS';
723
+ proration: AddSubscription.Proration;
724
+ /**
725
+ * Determines how the subscription's quantity is controlled. Defaults to
726
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
727
+ * directly on the subscription. `initial_quantity` must be provided with this
728
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
729
+ * **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
730
+ * user_123) to increment and decrement a subscription quantity, rather than
731
+ * directly providing the quantity. You must use a **SEAT_BASED** subscription to
732
+ * use a linked recurring credit with an allocation per seat. `seat_config` must be
733
+ * provided with this option.
734
+ */
735
+ quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY';
736
+ /**
737
+ * List of quantity schedule items for the subscription. Only includes the current
738
+ * quantity and future quantity changes.
739
+ */
740
+ quantity_schedule: Array<AddSubscription.QuantitySchedule>;
741
+ starting_at: string;
742
+ subscription_rate: AddSubscription.SubscriptionRate;
743
+ id?: string;
744
+ /**
745
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
746
+ */
747
+ custom_fields?: {
748
+ [key: string]: string;
749
+ };
750
+ description?: string;
751
+ ending_before?: string;
752
+ fiat_credit_type_id?: string;
753
+ name?: string;
754
+ seat_config?: AddSubscription.SeatConfig;
755
+ }
756
+ namespace AddSubscription {
757
+ /**
758
+ * Previous, current, and next billing periods for the subscription.
759
+ */
760
+ interface BillingPeriods {
761
+ current?: BillingPeriods.Current;
762
+ next?: BillingPeriods.Next;
763
+ previous?: BillingPeriods.Previous;
764
+ }
765
+ namespace BillingPeriods {
766
+ interface Current {
767
+ ending_before: string;
768
+ starting_at: string;
769
+ }
770
+ interface Next {
771
+ ending_before: string;
772
+ starting_at: string;
773
+ }
774
+ interface Previous {
775
+ ending_before: string;
776
+ starting_at: string;
777
+ }
778
+ }
779
+ interface Proration {
780
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
781
+ is_prorated: boolean;
782
+ }
783
+ interface QuantitySchedule {
784
+ quantity: number;
785
+ starting_at: string;
786
+ ending_before?: string;
787
+ }
788
+ interface SubscriptionRate {
789
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
790
+ product: SubscriptionRate.Product;
791
+ }
792
+ namespace SubscriptionRate {
793
+ interface Product {
794
+ id: string;
795
+ name: string;
796
+ }
797
+ }
798
+ interface SeatConfig {
799
+ /**
800
+ * The property name, sent on usage events, that identifies the seat ID associated
801
+ * with the usage event. For example, the property name might be seat_id or
802
+ * user_id. The property must be set as a group key on billable metrics and a
803
+ * presentation/pricing group key on contract products. This allows linked
804
+ * recurring credits with an allocation per seat to be consumed by only one seat's
805
+ * usage.
806
+ */
807
+ seat_group_key: string;
808
+ }
809
+ }
810
+ interface AddUsageFilter {
811
+ group_key: string;
812
+ group_values: Array<string>;
813
+ /**
814
+ * This will match contract starting_at value if usage filter is active from the
815
+ * beginning of the contract.
816
+ */
817
+ starting_at: string;
818
+ /**
819
+ * This will match contract ending_before value if usage filter is active until the
820
+ * end of the contract. It will be undefined if the contract is open-ended.
821
+ */
822
+ ending_before?: string;
823
+ }
824
+ interface ArchiveCommit {
825
+ id: string;
826
+ }
827
+ interface ArchiveCredit {
828
+ id: string;
829
+ }
830
+ interface ArchiveScheduledCharge {
831
+ id: string;
832
+ }
833
+ interface RemoveOverride {
834
+ id: string;
835
+ }
836
+ interface UpdateCommit {
837
+ id: string;
838
+ access_schedule?: UpdateCommit.AccessSchedule;
839
+ /**
840
+ * Which products the commit applies to. If applicable_product_ids,
841
+ * applicable_product_tags or specifiers are not provided, the commit applies to
842
+ * all products.
843
+ */
844
+ applicable_product_ids?: Array<string> | null;
845
+ /**
846
+ * Which tags the commit applies to. If applicable_product_ids,
847
+ * applicable_product_tags or specifiers are not provided, the commit applies to
848
+ * all products.
849
+ */
850
+ applicable_product_tags?: Array<string> | null;
851
+ description?: string;
852
+ /**
853
+ * Optional configuration for commit hierarchy access control
854
+ */
855
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
856
+ invoice_schedule?: UpdateCommit.InvoiceSchedule;
857
+ name?: string;
858
+ netsuite_sales_order_id?: string | null;
859
+ /**
860
+ * If multiple commits are applicable, the one with the lower priority will apply
861
+ * first.
862
+ */
863
+ priority?: number | null;
864
+ product_id?: string;
865
+ /**
866
+ * If set, the commit's rate type was updated to the specified value.
867
+ */
868
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
869
+ rollover_fraction?: number | null;
870
+ /**
871
+ * List of filters that determine what kind of customer usage draws down a commit
872
+ * or credit. A customer's usage needs to meet the condition of at least one of the
873
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
874
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
875
+ * Instead, to target usage by product or product tag, pass those values in the
876
+ * body of `specifiers`.
877
+ */
878
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
879
+ }
880
+ namespace UpdateCommit {
881
+ interface AccessSchedule {
882
+ add_schedule_items?: Array<AccessSchedule.AddScheduleItem>;
883
+ remove_schedule_items?: Array<AccessSchedule.RemoveScheduleItem>;
884
+ update_schedule_items?: Array<AccessSchedule.UpdateScheduleItem>;
885
+ }
886
+ namespace AccessSchedule {
887
+ interface AddScheduleItem {
888
+ amount: number;
889
+ /**
890
+ * RFC 3339 timestamp (exclusive)
891
+ */
892
+ ending_before: string;
893
+ /**
894
+ * RFC 3339 timestamp (inclusive)
895
+ */
896
+ starting_at: string;
897
+ }
898
+ interface RemoveScheduleItem {
899
+ id: string;
900
+ }
901
+ interface UpdateScheduleItem {
902
+ id: string;
903
+ amount?: number;
904
+ /**
905
+ * RFC 3339 timestamp (exclusive)
906
+ */
907
+ ending_before?: string;
908
+ /**
909
+ * RFC 3339 timestamp (inclusive)
910
+ */
911
+ starting_at?: string;
912
+ }
913
+ }
914
+ interface InvoiceSchedule {
915
+ add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
916
+ remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
917
+ update_schedule_items?: Array<InvoiceSchedule.UpdateScheduleItem>;
918
+ }
919
+ namespace InvoiceSchedule {
920
+ interface AddScheduleItem {
921
+ timestamp: string;
922
+ amount?: number;
923
+ quantity?: number;
924
+ unit_price?: number;
925
+ }
926
+ interface RemoveScheduleItem {
927
+ id: string;
928
+ }
929
+ interface UpdateScheduleItem {
930
+ id: string;
931
+ amount?: number;
932
+ quantity?: number;
933
+ timestamp?: string;
934
+ unit_price?: number;
935
+ }
936
+ }
937
+ }
938
+ interface UpdateCredit {
939
+ id: string;
940
+ access_schedule?: UpdateCredit.AccessSchedule;
941
+ /**
942
+ * Which products the credit applies to. If applicable_product_ids,
943
+ * applicable_product_tags or specifiers are not provided, the credit applies to
944
+ * all products.
945
+ */
946
+ applicable_product_ids?: Array<string> | null;
947
+ /**
948
+ * Which tags the credit applies to. If applicable_product_ids,
949
+ * applicable_product_tags or specifiers are not provided, the credit applies to
950
+ * all products.
951
+ */
952
+ applicable_product_tags?: Array<string> | null;
953
+ description?: string;
954
+ /**
955
+ * Optional configuration for credit hierarchy access control
956
+ */
957
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
958
+ name?: string;
959
+ netsuite_sales_order_id?: string | null;
960
+ /**
961
+ * If multiple credits are applicable, the one with the lower priority will apply
962
+ * first.
963
+ */
964
+ priority?: number | null;
965
+ product_id?: string;
966
+ /**
967
+ * If set, the credit's rate type was updated to the specified value.
968
+ */
969
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
970
+ rollover_fraction?: number | null;
971
+ /**
972
+ * List of filters that determine what kind of customer usage draws down a commit
973
+ * or credit. A customer's usage needs to meet the condition of at least one of the
974
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
975
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
976
+ * Instead, to target usage by product or product tag, pass those values in the
977
+ * body of `specifiers`.
978
+ */
979
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
980
+ }
981
+ namespace UpdateCredit {
982
+ interface AccessSchedule {
983
+ add_schedule_items?: Array<AccessSchedule.AddScheduleItem>;
984
+ remove_schedule_items?: Array<AccessSchedule.RemoveScheduleItem>;
985
+ update_schedule_items?: Array<AccessSchedule.UpdateScheduleItem>;
986
+ }
987
+ namespace AccessSchedule {
988
+ interface AddScheduleItem {
989
+ amount: number;
990
+ /**
991
+ * RFC 3339 timestamp (exclusive)
992
+ */
993
+ ending_before: string;
994
+ /**
995
+ * RFC 3339 timestamp (inclusive)
996
+ */
997
+ starting_at: string;
998
+ }
999
+ interface RemoveScheduleItem {
1000
+ id: string;
1001
+ }
1002
+ interface UpdateScheduleItem {
1003
+ id: string;
1004
+ amount?: number;
1005
+ /**
1006
+ * RFC 3339 timestamp (exclusive)
1007
+ */
1008
+ ending_before?: string;
1009
+ /**
1010
+ * RFC 3339 timestamp (inclusive)
1011
+ */
1012
+ starting_at?: string;
1013
+ }
1014
+ }
1015
+ }
1016
+ interface UpdateDiscount {
1017
+ id: string;
1018
+ /**
1019
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1020
+ */
1021
+ custom_fields?: {
1022
+ [key: string]: string;
1023
+ };
1024
+ name?: string;
1025
+ netsuite_sales_order_id?: string;
1026
+ /**
1027
+ * Must provide either schedule_items or recurring_schedule.
1028
+ */
1029
+ schedule?: UpdateDiscount.Schedule;
1030
+ }
1031
+ namespace UpdateDiscount {
1032
+ /**
1033
+ * Must provide either schedule_items or recurring_schedule.
1034
+ */
1035
+ interface Schedule {
1036
+ /**
1037
+ * Defaults to USD (cents) if not passed.
1038
+ */
1039
+ credit_type_id?: string;
1040
+ /**
1041
+ * This field is only applicable to commit invoice schedules. If true, this
1042
+ * schedule will not generate an invoice.
1043
+ */
1044
+ do_not_invoice?: boolean;
1045
+ /**
1046
+ * Enter the unit price and quantity for the charge or instead only send the
1047
+ * amount. If amount is sent, the unit price is assumed to be the amount and
1048
+ * quantity is inferred to be 1.
1049
+ */
1050
+ recurring_schedule?: Schedule.RecurringSchedule;
1051
+ /**
1052
+ * Either provide amount or provide both unit_price and quantity.
1053
+ */
1054
+ schedule_items?: Array<Schedule.ScheduleItem>;
1055
+ }
1056
+ namespace Schedule {
1057
+ /**
1058
+ * Enter the unit price and quantity for the charge or instead only send the
1059
+ * amount. If amount is sent, the unit price is assumed to be the amount and
1060
+ * quantity is inferred to be 1.
1061
+ */
1062
+ interface RecurringSchedule {
1063
+ amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
1064
+ /**
1065
+ * RFC 3339 timestamp (exclusive).
1066
+ */
1067
+ ending_before: string;
1068
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
1069
+ /**
1070
+ * RFC 3339 timestamp (inclusive).
1071
+ */
1072
+ starting_at: string;
1073
+ /**
1074
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
1075
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
1076
+ * inferred to be 1.
1077
+ */
1078
+ amount?: number;
1079
+ /**
1080
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
1081
+ * amount and must be specified with unit_price. If specified amount cannot be
1082
+ * provided.
1083
+ */
1084
+ quantity?: number;
1085
+ /**
1086
+ * Unit price for the charge. Will be multiplied by quantity to determine the
1087
+ * amount and must be specified with quantity. If specified amount cannot be
1088
+ * provided.
1089
+ */
1090
+ unit_price?: number;
1091
+ }
1092
+ interface ScheduleItem {
1093
+ /**
1094
+ * timestamp of the scheduled event
1095
+ */
1096
+ timestamp: string;
1097
+ /**
1098
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
1099
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
1100
+ * inferred to be 1.
1101
+ */
1102
+ amount?: number;
1103
+ /**
1104
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
1105
+ * amount and must be specified with unit_price. If specified amount cannot be
1106
+ * provided.
1107
+ */
1108
+ quantity?: number;
1109
+ /**
1110
+ * Unit price for the charge. Will be multiplied by quantity to determine the
1111
+ * amount and must be specified with quantity. If specified amount cannot be
1112
+ * provided.
1113
+ */
1114
+ unit_price?: number;
1115
+ }
1116
+ }
1117
+ }
1118
+ interface UpdatePrepaidBalanceThresholdConfiguration {
1119
+ commit?: UpdatePrepaidBalanceThresholdConfiguration.Commit;
1120
+ /**
1121
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
1122
+ * commit amount will be in terms of this credit type instead of the fiat currency.
1123
+ */
1124
+ custom_credit_type_id?: string | null;
1125
+ discount_configuration?: UpdatePrepaidBalanceThresholdConfiguration.DiscountConfiguration | null;
1126
+ /**
1127
+ * When set to false, the contract will not be evaluated against the
1128
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1129
+ * regardless of prior state.
1130
+ */
1131
+ is_enabled?: boolean;
1132
+ payment_gate_config?: Shared.PaymentGateConfigV2;
1133
+ /**
1134
+ * Specify the amount the balance should be recharged to.
1135
+ */
1136
+ recharge_to_amount?: number;
1137
+ /**
1138
+ * Specify the threshold amount for the contract. Each time the contract's balance
1139
+ * lowers to this amount, a threshold charge will be initiated.
1140
+ */
1141
+ threshold_amount?: number;
1142
+ threshold_balance_specifiers?: Array<UpdatePrepaidBalanceThresholdConfiguration.ThresholdBalanceSpecifier> | null;
1143
+ }
1144
+ namespace UpdatePrepaidBalanceThresholdConfiguration {
1145
+ interface Commit extends Shared.UpdateBaseThresholdCommit {
1146
+ /**
1147
+ * Which products the threshold commit applies to. If both applicable_product_ids
1148
+ * and applicable_product_tags are not provided, the commit applies to all
1149
+ * products.
1150
+ */
1151
+ applicable_product_ids?: Array<string> | null;
1152
+ /**
1153
+ * Which tags the threshold commit applies to. If both applicable_product_ids and
1154
+ * applicable_product_tags are not provided, the commit applies to all products.
1155
+ */
1156
+ applicable_product_tags?: Array<string> | null;
1157
+ /**
1158
+ * List of filters that determine what kind of customer usage draws down a commit
1159
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1160
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1161
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1162
+ * Instead, to target usage by product or product tag, pass those values in the
1163
+ * body of `specifiers`.
1164
+ */
1165
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
1166
+ }
1167
+ interface DiscountConfiguration {
1168
+ /**
1169
+ * Update the discount cap. Set to null to remove an existing cap.
1170
+ */
1171
+ cap?: DiscountConfiguration.Cap | null;
1172
+ /**
1173
+ * The fraction of the original amount that the customer pays after applying the
1174
+ * discount. Set to null to remove the discount fraction. For example, 0.85 means
1175
+ * the customer pays 85% of the original amount (a 15% discount).
1176
+ */
1177
+ payment_fraction?: number | null;
1178
+ }
1179
+ namespace DiscountConfiguration {
1180
+ /**
1181
+ * Update the discount cap. Set to null to remove an existing cap.
1182
+ */
1183
+ interface Cap {
1184
+ /**
1185
+ * Accumulated spend ceiling above which the discount stops applying.
1186
+ */
1187
+ amount: number;
1188
+ /**
1189
+ * Alias of the spend tracker this cap is measured against.
1190
+ */
1191
+ spend_tracker_alias: string;
1192
+ }
1193
+ }
1194
+ interface ThresholdBalanceSpecifier {
1195
+ exclude: Array<ThresholdBalanceSpecifier.Exclude>;
1196
+ }
1197
+ namespace ThresholdBalanceSpecifier {
1198
+ interface Exclude {
1199
+ custom_field_filters: Array<Exclude.CustomFieldFilter>;
1200
+ }
1201
+ namespace Exclude {
1202
+ interface CustomFieldFilter {
1203
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
1204
+ key: string;
1205
+ value: string;
1206
+ }
1207
+ }
1208
+ }
1209
+ }
1210
+ interface UpdateRecurringCommit {
1211
+ id: string;
1212
+ access_amount?: UpdateRecurringCommit.AccessAmount;
1213
+ ending_before?: string;
1214
+ invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
1215
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
1216
+ }
1217
+ namespace UpdateRecurringCommit {
1218
+ interface AccessAmount {
1219
+ quantity?: number;
1220
+ unit_price?: number;
1221
+ }
1222
+ interface InvoiceAmount {
1223
+ quantity?: number;
1224
+ unit_price?: number;
1225
+ }
1226
+ }
1227
+ interface UpdateRecurringCredit {
1228
+ id: string;
1229
+ access_amount?: UpdateRecurringCredit.AccessAmount;
1230
+ ending_before?: string;
1231
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
1232
+ }
1233
+ namespace UpdateRecurringCredit {
1234
+ interface AccessAmount {
1235
+ quantity?: number;
1236
+ unit_price?: number;
1237
+ }
1238
+ }
1239
+ interface UpdateRefundInvoice {
1240
+ date: string;
1241
+ invoice_id: string;
1242
+ }
1243
+ interface UpdateScheduledCharge {
1244
+ id: string;
1245
+ invoice_schedule?: UpdateScheduledCharge.InvoiceSchedule;
1246
+ name?: string;
1247
+ netsuite_sales_order_id?: string | null;
1248
+ }
1249
+ namespace UpdateScheduledCharge {
1250
+ interface InvoiceSchedule {
1251
+ add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
1252
+ remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
1253
+ update_schedule_items?: Array<InvoiceSchedule.UpdateScheduleItem>;
1254
+ }
1255
+ namespace InvoiceSchedule {
1256
+ interface AddScheduleItem {
1257
+ timestamp: string;
1258
+ amount?: number;
1259
+ quantity?: number;
1260
+ unit_price?: number;
1261
+ }
1262
+ interface RemoveScheduleItem {
1263
+ id: string;
1264
+ }
1265
+ interface UpdateScheduleItem {
1266
+ id: string;
1267
+ amount?: number;
1268
+ quantity?: number;
1269
+ timestamp?: string;
1270
+ unit_price?: number;
1271
+ }
1272
+ }
1273
+ }
1274
+ interface UpdateSpendThresholdConfiguration {
1275
+ commit?: Shared.UpdateBaseThresholdCommit;
1276
+ discount_configuration?: UpdateSpendThresholdConfiguration.DiscountConfiguration | null;
1277
+ /**
1278
+ * When set to false, the contract will not be evaluated against the
1279
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1280
+ * regardless of prior state.
1281
+ */
1282
+ is_enabled?: boolean;
1283
+ payment_gate_config?: Shared.PaymentGateConfigV2;
1284
+ /**
1285
+ * Specify the threshold amount for the contract. Each time the contract's usage
1286
+ * hits this amount, a threshold charge will be initiated.
1287
+ */
1288
+ threshold_amount?: number;
1289
+ }
1290
+ namespace UpdateSpendThresholdConfiguration {
1291
+ interface DiscountConfiguration {
1292
+ /**
1293
+ * Update the discount cap. Set to null to remove an existing cap.
1294
+ */
1295
+ cap?: DiscountConfiguration.Cap | null;
1296
+ /**
1297
+ * The fraction of the original amount that the customer pays after applying the
1298
+ * discount. Set to null to remove the discount fraction. For example, 0.85 means
1299
+ * the customer pays 85% of the original amount (a 15% discount).
1300
+ */
1301
+ payment_fraction?: number | null;
1302
+ }
1303
+ namespace DiscountConfiguration {
1304
+ /**
1305
+ * Update the discount cap. Set to null to remove an existing cap.
1306
+ */
1307
+ interface Cap {
1308
+ /**
1309
+ * Accumulated spend ceiling above which the discount stops applying.
1310
+ */
1311
+ amount: number;
1312
+ /**
1313
+ * Alias of the spend tracker this cap is measured against.
1314
+ */
1315
+ spend_tracker_alias: string;
1316
+ }
1317
+ }
1318
+ }
1319
+ interface UpdateSubscription {
1320
+ id: string;
1321
+ ending_before?: string;
1322
+ quantity_updates?: Array<UpdateSubscription.QuantityUpdate>;
1323
+ /**
1324
+ * Manage subscription seats for subscriptions in SEAT_BASED mode.
1325
+ */
1326
+ seat_updates?: UpdateSubscription.SeatUpdates;
1327
+ }
1328
+ namespace UpdateSubscription {
1329
+ interface QuantityUpdate {
1330
+ starting_at: string;
1331
+ quantity?: number;
1332
+ quantity_delta?: number;
1333
+ }
1334
+ /**
1335
+ * Manage subscription seats for subscriptions in SEAT_BASED mode.
1336
+ */
1337
+ interface SeatUpdates {
1338
+ /**
1339
+ * Adds seat IDs to the subscription. If there are unassigned seats, the new seat
1340
+ * IDs will fill these unassigned seats and not increase the total subscription
1341
+ * quantity. Otherwise, if there are more new seat IDs than unassigned seats, the
1342
+ * total subscription quantity will increase.
1343
+ */
1344
+ add_seat_ids?: Array<SeatUpdates.AddSeatID>;
1345
+ /**
1346
+ * Adds unassigned seats to the subscription. This will increase the total
1347
+ * subscription quantity.
1348
+ */
1349
+ add_unassigned_seats?: Array<SeatUpdates.AddUnassignedSeat>;
1350
+ /**
1351
+ * Removes seat IDs from the subscription, if possible. If a seat ID is removed,
1352
+ * the total subscription quantity will decrease. Otherwise, if the seat ID is not
1353
+ * found on the subscription, this is a no-op.
1354
+ */
1355
+ remove_seat_ids?: Array<SeatUpdates.RemoveSeatID>;
1356
+ /**
1357
+ * Removes unassigned seats from the subscription. This will decrease the total
1358
+ * subscription quantity if there are are unassigned seats.
1359
+ */
1360
+ remove_unassigned_seats?: Array<SeatUpdates.RemoveUnassignedSeat>;
1361
+ }
1362
+ namespace SeatUpdates {
1363
+ interface AddSeatID {
1364
+ seat_ids: Array<string>;
1365
+ /**
1366
+ * Assigned seats will be added/removed starting at this date.
1367
+ */
1368
+ starting_at: string;
1369
+ }
1370
+ interface AddUnassignedSeat {
1371
+ /**
1372
+ * The number of unassigned seats on the subscription will increase/decrease by
1373
+ * this delta. Must be greater than 0.
1374
+ */
1375
+ quantity: number;
1376
+ /**
1377
+ * Unassigned seats will be updated starting at this date.
1378
+ */
1379
+ starting_at: string;
1380
+ }
1381
+ interface RemoveSeatID {
1382
+ seat_ids: Array<string>;
1383
+ /**
1384
+ * Assigned seats will be added/removed starting at this date.
1385
+ */
1386
+ starting_at: string;
1387
+ }
1388
+ interface RemoveUnassignedSeat {
1389
+ /**
1390
+ * The number of unassigned seats on the subscription will increase/decrease by
1391
+ * this delta. Must be greater than 0.
1392
+ */
1393
+ quantity: number;
1394
+ /**
1395
+ * Unassigned seats will be updated starting at this date.
1396
+ */
1397
+ starting_at: string;
1398
+ }
1399
+ }
1400
+ }
1401
+ }
1402
+ }
217
1403
  }
218
1404
  export interface ContractEditCommitResponse {
219
1405
  data: Shared.ID;
@@ -241,7 +1427,7 @@ export declare namespace ContractGetEditHistoryResponse {
241
1427
  /**
242
1428
  * List of subscriptions on the contract.
243
1429
  */
244
- add_subscriptions?: Array<Shared.Subscription>;
1430
+ add_subscriptions?: Array<Data.AddSubscription>;
245
1431
  add_usage_filters?: Array<Data.AddUsageFilter>;
246
1432
  archive_commits?: Array<Data.ArchiveCommit>;
247
1433
  archive_credits?: Array<Data.ArchiveCredit>;
@@ -718,6 +1904,99 @@ export declare namespace ContractGetEditHistoryResponse {
718
1904
  name: string;
719
1905
  }
720
1906
  }
1907
+ interface AddSubscription {
1908
+ /**
1909
+ * Previous, current, and next billing periods for the subscription.
1910
+ */
1911
+ billing_periods: AddSubscription.BillingPeriods;
1912
+ collection_schedule: 'ADVANCE' | 'ARREARS';
1913
+ proration: AddSubscription.Proration;
1914
+ /**
1915
+ * Determines how the subscription's quantity is controlled. Defaults to
1916
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
1917
+ * directly on the subscription. `initial_quantity` must be provided with this
1918
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
1919
+ * **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
1920
+ * user_123) to increment and decrement a subscription quantity, rather than
1921
+ * directly providing the quantity. You must use a **SEAT_BASED** subscription to
1922
+ * use a linked recurring credit with an allocation per seat. `seat_config` must be
1923
+ * provided with this option.
1924
+ */
1925
+ quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY';
1926
+ /**
1927
+ * List of quantity schedule items for the subscription. Only includes the current
1928
+ * quantity and future quantity changes.
1929
+ */
1930
+ quantity_schedule: Array<AddSubscription.QuantitySchedule>;
1931
+ starting_at: string;
1932
+ subscription_rate: AddSubscription.SubscriptionRate;
1933
+ id?: string;
1934
+ /**
1935
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1936
+ */
1937
+ custom_fields?: {
1938
+ [key: string]: string;
1939
+ };
1940
+ description?: string;
1941
+ ending_before?: string;
1942
+ fiat_credit_type_id?: string;
1943
+ name?: string;
1944
+ seat_config?: AddSubscription.SeatConfig;
1945
+ }
1946
+ namespace AddSubscription {
1947
+ /**
1948
+ * Previous, current, and next billing periods for the subscription.
1949
+ */
1950
+ interface BillingPeriods {
1951
+ current?: BillingPeriods.Current;
1952
+ next?: BillingPeriods.Next;
1953
+ previous?: BillingPeriods.Previous;
1954
+ }
1955
+ namespace BillingPeriods {
1956
+ interface Current {
1957
+ ending_before: string;
1958
+ starting_at: string;
1959
+ }
1960
+ interface Next {
1961
+ ending_before: string;
1962
+ starting_at: string;
1963
+ }
1964
+ interface Previous {
1965
+ ending_before: string;
1966
+ starting_at: string;
1967
+ }
1968
+ }
1969
+ interface Proration {
1970
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
1971
+ is_prorated: boolean;
1972
+ }
1973
+ interface QuantitySchedule {
1974
+ quantity: number;
1975
+ starting_at: string;
1976
+ ending_before?: string;
1977
+ }
1978
+ interface SubscriptionRate {
1979
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1980
+ product: SubscriptionRate.Product;
1981
+ }
1982
+ namespace SubscriptionRate {
1983
+ interface Product {
1984
+ id: string;
1985
+ name: string;
1986
+ }
1987
+ }
1988
+ interface SeatConfig {
1989
+ /**
1990
+ * The property name, sent on usage events, that identifies the seat ID associated
1991
+ * with the usage event. For example, the property name might be seat_id or
1992
+ * user_id. The property must be set as a group key on billable metrics and a
1993
+ * presentation/pricing group key on contract products. This allows linked
1994
+ * recurring credits with an allocation per seat to be consumed by only one seat's
1995
+ * usage.
1996
+ */
1997
+ seat_group_key: string;
1998
+ }
1999
+ }
721
2000
  interface AddUsageFilter {
722
2001
  group_key: string;
723
2002
  group_values: Array<string>;
@@ -1050,6 +2329,7 @@ export declare namespace ContractGetEditHistoryResponse {
1050
2329
  * lowers to this amount, a threshold charge will be initiated.
1051
2330
  */
1052
2331
  threshold_amount?: number;
2332
+ threshold_balance_specifiers?: Array<UpdatePrepaidBalanceThresholdConfiguration.ThresholdBalanceSpecifier> | null;
1053
2333
  }
1054
2334
  namespace UpdatePrepaidBalanceThresholdConfiguration {
1055
2335
  interface Commit extends Shared.UpdateBaseThresholdCommit {
@@ -1075,6 +2355,10 @@ export declare namespace ContractGetEditHistoryResponse {
1075
2355
  specifiers?: Array<Shared.CommitSpecifierInput> | null;
1076
2356
  }
1077
2357
  interface DiscountConfiguration {
2358
+ /**
2359
+ * Update the discount cap. Set to null to remove an existing cap.
2360
+ */
2361
+ cap?: DiscountConfiguration.Cap | null;
1078
2362
  /**
1079
2363
  * The fraction of the original amount that the customer pays after applying the
1080
2364
  * discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -1082,6 +2366,36 @@ export declare namespace ContractGetEditHistoryResponse {
1082
2366
  */
1083
2367
  payment_fraction?: number | null;
1084
2368
  }
2369
+ namespace DiscountConfiguration {
2370
+ /**
2371
+ * Update the discount cap. Set to null to remove an existing cap.
2372
+ */
2373
+ interface Cap {
2374
+ /**
2375
+ * Accumulated spend ceiling above which the discount stops applying.
2376
+ */
2377
+ amount: number;
2378
+ /**
2379
+ * Alias of the spend tracker this cap is measured against.
2380
+ */
2381
+ spend_tracker_alias: string;
2382
+ }
2383
+ }
2384
+ interface ThresholdBalanceSpecifier {
2385
+ exclude: Array<ThresholdBalanceSpecifier.Exclude>;
2386
+ }
2387
+ namespace ThresholdBalanceSpecifier {
2388
+ interface Exclude {
2389
+ custom_field_filters: Array<Exclude.CustomFieldFilter>;
2390
+ }
2391
+ namespace Exclude {
2392
+ interface CustomFieldFilter {
2393
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
2394
+ key: string;
2395
+ value: string;
2396
+ }
2397
+ }
2398
+ }
1085
2399
  }
1086
2400
  interface UpdateRecurringCommit {
1087
2401
  id: string;
@@ -1165,6 +2479,10 @@ export declare namespace ContractGetEditHistoryResponse {
1165
2479
  }
1166
2480
  namespace UpdateSpendThresholdConfiguration {
1167
2481
  interface DiscountConfiguration {
2482
+ /**
2483
+ * Update the discount cap. Set to null to remove an existing cap.
2484
+ */
2485
+ cap?: DiscountConfiguration.Cap | null;
1168
2486
  /**
1169
2487
  * The fraction of the original amount that the customer pays after applying the
1170
2488
  * discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -1172,6 +2490,21 @@ export declare namespace ContractGetEditHistoryResponse {
1172
2490
  */
1173
2491
  payment_fraction?: number | null;
1174
2492
  }
2493
+ namespace DiscountConfiguration {
2494
+ /**
2495
+ * Update the discount cap. Set to null to remove an existing cap.
2496
+ */
2497
+ interface Cap {
2498
+ /**
2499
+ * Accumulated spend ceiling above which the discount stops applying.
2500
+ */
2501
+ amount: number;
2502
+ /**
2503
+ * Alias of the spend tracker this cap is measured against.
2504
+ */
2505
+ spend_tracker_alias: string;
2506
+ }
2507
+ }
1175
2508
  }
1176
2509
  interface UpdateSubscription {
1177
2510
  id: string;
@@ -1338,6 +2671,11 @@ export interface ContractEditParams {
1338
2671
  add_revenue_system_configuration_update?: ContractEditParams.AddRevenueSystemConfigurationUpdate;
1339
2672
  add_scheduled_charges?: Array<ContractEditParams.AddScheduledCharge>;
1340
2673
  add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
2674
+ /**
2675
+ * Spend trackers to add to this contract. Aliases must be unique within a
2676
+ * contract.
2677
+ */
2678
+ add_spend_trackers?: Array<ContractEditParams.AddSpendTracker>;
1341
2679
  /**
1342
2680
  * Optional list of
1343
2681
  * [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
@@ -1363,6 +2701,10 @@ export interface ContractEditParams {
1363
2701
  * IDs of scheduled charges to archive
1364
2702
  */
1365
2703
  archive_scheduled_charges?: Array<ContractEditParams.ArchiveScheduledCharge>;
2704
+ /**
2705
+ * Aliases of spend trackers to archive.
2706
+ */
2707
+ archive_spend_trackers?: Array<string>;
1366
2708
  /**
1367
2709
  * IDs of overrides to remove
1368
2710
  */
@@ -1515,6 +2857,10 @@ export declare namespace ContractEditParams {
1515
2857
  * body of `specifiers`.
1516
2858
  */
1517
2859
  specifiers?: Array<Shared.CommitSpecifierInput>;
2860
+ /**
2861
+ * Optional attributes for spend tracker integration. Immutable after creation.
2862
+ */
2863
+ spend_tracker_attributes?: AddCommit.SpendTrackerAttributes;
1518
2864
  /**
1519
2865
  * A temporary ID for the commit that can be used to reference the commit for
1520
2866
  * commit specific overrides.
@@ -1702,6 +3048,16 @@ export declare namespace ContractEditParams {
1702
3048
  on_session_payment?: boolean;
1703
3049
  }
1704
3050
  }
3051
+ /**
3052
+ * Optional attributes for spend tracker integration. Immutable after creation.
3053
+ */
3054
+ interface SpendTrackerAttributes {
3055
+ /**
3056
+ * If true, this commit will be included in spend trackers with discounted set to
3057
+ * DISCOUNTED_ONLY
3058
+ */
3059
+ counts_as_discounted: boolean;
3060
+ }
1705
3061
  }
1706
3062
  interface AddCredit {
1707
3063
  /**
@@ -2505,6 +3861,25 @@ export declare namespace ContractEditParams {
2505
3861
  }
2506
3862
  }
2507
3863
  }
3864
+ interface AddSpendTracker {
3865
+ /**
3866
+ * Human-readable identifier, unique per contract.
3867
+ */
3868
+ alias: string;
3869
+ applicable_spend_specifiers: Array<AddSpendTracker.ApplicableSpendSpecifier>;
3870
+ credit_type_id: string;
3871
+ reset_frequency: 'BILLING_PERIOD';
3872
+ }
3873
+ namespace AddSpendTracker {
3874
+ interface ApplicableSpendSpecifier {
3875
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
3876
+ spend_type: 'COMMIT_PURCHASE';
3877
+ /**
3878
+ * Filter by whether the spend was discounted. Defaults to ANY if omitted.
3879
+ */
3880
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
3881
+ }
3882
+ }
2508
3883
  interface AddSubscription {
2509
3884
  collection_schedule: 'ADVANCE' | 'ARREARS';
2510
3885
  proration: AddSubscription.Proration;
@@ -2767,6 +4142,7 @@ export declare namespace ContractEditParams {
2767
4142
  * lowers to this amount, a threshold charge will be initiated.
2768
4143
  */
2769
4144
  threshold_amount?: number;
4145
+ threshold_balance_specifiers?: Array<UpdatePrepaidBalanceThresholdConfiguration.ThresholdBalanceSpecifier> | null;
2770
4146
  }
2771
4147
  namespace UpdatePrepaidBalanceThresholdConfiguration {
2772
4148
  interface Commit extends Shared.UpdateBaseThresholdCommit {
@@ -2792,6 +4168,10 @@ export declare namespace ContractEditParams {
2792
4168
  specifiers?: Array<Shared.CommitSpecifierInput> | null;
2793
4169
  }
2794
4170
  interface DiscountConfiguration {
4171
+ /**
4172
+ * Update the discount cap. Set to null to remove an existing cap.
4173
+ */
4174
+ cap?: DiscountConfiguration.Cap | null;
2795
4175
  /**
2796
4176
  * The fraction of the original amount that the customer pays after applying the
2797
4177
  * discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -2799,6 +4179,36 @@ export declare namespace ContractEditParams {
2799
4179
  */
2800
4180
  payment_fraction?: number | null;
2801
4181
  }
4182
+ namespace DiscountConfiguration {
4183
+ /**
4184
+ * Update the discount cap. Set to null to remove an existing cap.
4185
+ */
4186
+ interface Cap {
4187
+ /**
4188
+ * Accumulated spend ceiling above which the discount stops applying.
4189
+ */
4190
+ amount: number;
4191
+ /**
4192
+ * Alias of the spend tracker this cap is measured against.
4193
+ */
4194
+ spend_tracker_alias: string;
4195
+ }
4196
+ }
4197
+ interface ThresholdBalanceSpecifier {
4198
+ exclude: Array<ThresholdBalanceSpecifier.Exclude>;
4199
+ }
4200
+ namespace ThresholdBalanceSpecifier {
4201
+ interface Exclude {
4202
+ custom_field_filters: Array<Exclude.CustomFieldFilter>;
4203
+ }
4204
+ namespace Exclude {
4205
+ interface CustomFieldFilter {
4206
+ entity: 'Commit' | 'ContractCredit' | 'ContractCreditOrCommit';
4207
+ key: string;
4208
+ value: string;
4209
+ }
4210
+ }
4211
+ }
2802
4212
  }
2803
4213
  interface UpdateRecurringCommit {
2804
4214
  recurring_commit_id: string;
@@ -2885,6 +4295,10 @@ export declare namespace ContractEditParams {
2885
4295
  }
2886
4296
  namespace UpdateSpendThresholdConfiguration {
2887
4297
  interface DiscountConfiguration {
4298
+ /**
4299
+ * Update the discount cap. Set to null to remove an existing cap.
4300
+ */
4301
+ cap?: DiscountConfiguration.Cap | null;
2888
4302
  /**
2889
4303
  * The fraction of the original amount that the customer pays after applying the
2890
4304
  * discount. Set to null to remove the discount fraction. For example, 0.85 means
@@ -2892,6 +4306,21 @@ export declare namespace ContractEditParams {
2892
4306
  */
2893
4307
  payment_fraction?: number | null;
2894
4308
  }
4309
+ namespace DiscountConfiguration {
4310
+ /**
4311
+ * Update the discount cap. Set to null to remove an existing cap.
4312
+ */
4313
+ interface Cap {
4314
+ /**
4315
+ * Accumulated spend ceiling above which the discount stops applying.
4316
+ */
4317
+ amount: number;
4318
+ /**
4319
+ * Alias of the spend tracker this cap is measured against.
4320
+ */
4321
+ spend_tracker_alias: string;
4322
+ }
4323
+ }
2895
4324
  }
2896
4325
  interface UpdateSubscription {
2897
4326
  subscription_id: string;