@metronome/sdk 0.1.0-beta.9 → 0.1.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 (286) hide show
  1. package/CHANGELOG.md +179 -0
  2. package/README.md +30 -46
  3. package/_shims/index.d.ts +2 -0
  4. package/_shims/index.js +5 -1
  5. package/_shims/index.mjs +5 -1
  6. package/core.d.ts +19 -5
  7. package/core.d.ts.map +1 -1
  8. package/core.js +23 -14
  9. package/core.js.map +1 -1
  10. package/core.mjs +24 -15
  11. package/core.mjs.map +1 -1
  12. package/index.d.mts +3 -2
  13. package/index.d.ts +3 -2
  14. package/index.d.ts.map +1 -1
  15. package/index.js +6 -3
  16. package/index.js.map +1 -1
  17. package/index.mjs +6 -3
  18. package/index.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/pagination.d.ts +1 -0
  21. package/pagination.d.ts.map +1 -1
  22. package/pagination.js +3 -0
  23. package/pagination.js.map +1 -1
  24. package/pagination.mjs +3 -0
  25. package/pagination.mjs.map +1 -1
  26. package/resource.d.ts +1 -1
  27. package/resource.d.ts.map +1 -1
  28. package/resource.js.map +1 -1
  29. package/resource.mjs.map +1 -1
  30. package/resources/shared.d.ts +473 -37
  31. package/resources/shared.d.ts.map +1 -1
  32. package/resources/v1/alerts.d.ts +26 -2
  33. package/resources/v1/alerts.d.ts.map +1 -1
  34. package/resources/v1/alerts.js +19 -0
  35. package/resources/v1/alerts.js.map +1 -1
  36. package/resources/v1/alerts.mjs +19 -0
  37. package/resources/v1/alerts.mjs.map +1 -1
  38. package/resources/v1/audit-logs.d.ts +8 -0
  39. package/resources/v1/audit-logs.d.ts.map +1 -1
  40. package/resources/v1/audit-logs.js.map +1 -1
  41. package/resources/v1/audit-logs.mjs.map +1 -1
  42. package/resources/v1/billable-metrics.d.ts +58 -3
  43. package/resources/v1/billable-metrics.d.ts.map +1 -1
  44. package/resources/v1/billable-metrics.js +41 -0
  45. package/resources/v1/billable-metrics.js.map +1 -1
  46. package/resources/v1/billable-metrics.mjs +41 -0
  47. package/resources/v1/billable-metrics.mjs.map +1 -1
  48. package/resources/v1/contracts/contracts.d.ts +1478 -102
  49. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  50. package/resources/v1/contracts/contracts.js +180 -3
  51. package/resources/v1/contracts/contracts.js.map +1 -1
  52. package/resources/v1/contracts/contracts.mjs +180 -3
  53. package/resources/v1/contracts/contracts.mjs.map +1 -1
  54. package/resources/v1/contracts/index.d.ts +2 -2
  55. package/resources/v1/contracts/index.d.ts.map +1 -1
  56. package/resources/v1/contracts/index.js.map +1 -1
  57. package/resources/v1/contracts/index.mjs.map +1 -1
  58. package/resources/v1/contracts/named-schedules.d.ts +21 -0
  59. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  60. package/resources/v1/contracts/named-schedules.js +21 -0
  61. package/resources/v1/contracts/named-schedules.js.map +1 -1
  62. package/resources/v1/contracts/named-schedules.mjs +21 -0
  63. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  64. package/resources/v1/contracts/products.d.ts +51 -3
  65. package/resources/v1/contracts/products.d.ts.map +1 -1
  66. package/resources/v1/contracts/products.js +33 -0
  67. package/resources/v1/contracts/products.js.map +1 -1
  68. package/resources/v1/contracts/products.mjs +33 -0
  69. package/resources/v1/contracts/products.mjs.map +1 -1
  70. package/resources/v1/contracts/rate-cards/index.d.ts +1 -1
  71. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
  72. package/resources/v1/contracts/rate-cards/index.js.map +1 -1
  73. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
  74. package/resources/v1/contracts/rate-cards/named-schedules.d.ts +25 -0
  75. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  76. package/resources/v1/contracts/rate-cards/named-schedules.js +25 -0
  77. package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
  78. package/resources/v1/contracts/rate-cards/named-schedules.mjs +25 -0
  79. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  80. package/resources/v1/contracts/rate-cards/product-orders.d.ts +30 -0
  81. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  82. package/resources/v1/contracts/rate-cards/product-orders.js +30 -0
  83. package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
  84. package/resources/v1/contracts/rate-cards/product-orders.mjs +30 -0
  85. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  86. package/resources/v1/contracts/rate-cards/rate-cards.d.ts +107 -10
  87. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  88. package/resources/v1/contracts/rate-cards/rate-cards.js +71 -0
  89. package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
  90. package/resources/v1/contracts/rate-cards/rate-cards.mjs +71 -0
  91. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  92. package/resources/v1/contracts/rate-cards/rates.d.ts +102 -14
  93. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  94. package/resources/v1/contracts/rate-cards/rates.js +68 -0
  95. package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
  96. package/resources/v1/contracts/rate-cards/rates.mjs +68 -0
  97. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  98. package/resources/v1/credit-grants.d.ts +77 -2
  99. package/resources/v1/credit-grants.d.ts.map +1 -1
  100. package/resources/v1/credit-grants.js +39 -2
  101. package/resources/v1/credit-grants.js.map +1 -1
  102. package/resources/v1/credit-grants.mjs +39 -2
  103. package/resources/v1/credit-grants.mjs.map +1 -1
  104. package/resources/v1/custom-fields.d.ts +51 -7
  105. package/resources/v1/custom-fields.d.ts.map +1 -1
  106. package/resources/v1/custom-fields.js +35 -0
  107. package/resources/v1/custom-fields.js.map +1 -1
  108. package/resources/v1/custom-fields.mjs +35 -0
  109. package/resources/v1/custom-fields.mjs.map +1 -1
  110. package/resources/v1/customers/alerts.d.ts +28 -0
  111. package/resources/v1/customers/alerts.d.ts.map +1 -1
  112. package/resources/v1/customers/alerts.js +23 -0
  113. package/resources/v1/customers/alerts.js.map +1 -1
  114. package/resources/v1/customers/alerts.mjs +23 -0
  115. package/resources/v1/customers/alerts.mjs.map +1 -1
  116. package/resources/v1/customers/billing-config.d.ts +31 -0
  117. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  118. package/resources/v1/customers/billing-config.js +27 -0
  119. package/resources/v1/customers/billing-config.js.map +1 -1
  120. package/resources/v1/customers/billing-config.mjs +27 -0
  121. package/resources/v1/customers/billing-config.mjs.map +1 -1
  122. package/resources/v1/customers/commits.d.ts +94 -7
  123. package/resources/v1/customers/commits.d.ts.map +1 -1
  124. package/resources/v1/customers/commits.js +56 -1
  125. package/resources/v1/customers/commits.js.map +1 -1
  126. package/resources/v1/customers/commits.mjs +56 -1
  127. package/resources/v1/customers/commits.mjs.map +1 -1
  128. package/resources/v1/customers/credits.d.ts +73 -3
  129. package/resources/v1/customers/credits.d.ts.map +1 -1
  130. package/resources/v1/customers/credits.js +41 -1
  131. package/resources/v1/customers/credits.js.map +1 -1
  132. package/resources/v1/customers/credits.mjs +41 -1
  133. package/resources/v1/customers/credits.mjs.map +1 -1
  134. package/resources/v1/customers/customers.d.ts +186 -9
  135. package/resources/v1/customers/customers.d.ts.map +1 -1
  136. package/resources/v1/customers/customers.js +106 -1
  137. package/resources/v1/customers/customers.js.map +1 -1
  138. package/resources/v1/customers/customers.mjs +106 -1
  139. package/resources/v1/customers/customers.mjs.map +1 -1
  140. package/resources/v1/customers/index.d.ts +1 -1
  141. package/resources/v1/customers/index.d.ts.map +1 -1
  142. package/resources/v1/customers/index.js.map +1 -1
  143. package/resources/v1/customers/index.mjs.map +1 -1
  144. package/resources/v1/customers/invoices.d.ts +144 -52
  145. package/resources/v1/customers/invoices.d.ts.map +1 -1
  146. package/resources/v1/customers/invoices.js +49 -0
  147. package/resources/v1/customers/invoices.js.map +1 -1
  148. package/resources/v1/customers/invoices.mjs +49 -0
  149. package/resources/v1/customers/invoices.mjs.map +1 -1
  150. package/resources/v1/customers/named-schedules.d.ts +21 -0
  151. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  152. package/resources/v1/customers/named-schedules.js +21 -0
  153. package/resources/v1/customers/named-schedules.js.map +1 -1
  154. package/resources/v1/customers/named-schedules.mjs +21 -0
  155. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  156. package/resources/v1/customers/plans.d.ts +46 -1
  157. package/resources/v1/customers/plans.d.ts.map +1 -1
  158. package/resources/v1/customers/plans.js +43 -0
  159. package/resources/v1/customers/plans.js.map +1 -1
  160. package/resources/v1/customers/plans.mjs +43 -0
  161. package/resources/v1/customers/plans.mjs.map +1 -1
  162. package/resources/v1/dashboards.d.ts +30 -2
  163. package/resources/v1/dashboards.d.ts.map +1 -1
  164. package/resources/v1/dashboards.js +26 -0
  165. package/resources/v1/dashboards.js.map +1 -1
  166. package/resources/v1/dashboards.mjs +26 -0
  167. package/resources/v1/dashboards.mjs.map +1 -1
  168. package/resources/v1/index.d.ts +3 -3
  169. package/resources/v1/index.d.ts.map +1 -1
  170. package/resources/v1/index.js.map +1 -1
  171. package/resources/v1/index.mjs.map +1 -1
  172. package/resources/v1/invoices.d.ts +14 -0
  173. package/resources/v1/invoices.d.ts.map +1 -1
  174. package/resources/v1/invoices.js +14 -0
  175. package/resources/v1/invoices.js.map +1 -1
  176. package/resources/v1/invoices.mjs +14 -0
  177. package/resources/v1/invoices.mjs.map +1 -1
  178. package/resources/v1/plans.d.ts +47 -4
  179. package/resources/v1/plans.d.ts.map +1 -1
  180. package/resources/v1/plans.js +27 -0
  181. package/resources/v1/plans.js.map +1 -1
  182. package/resources/v1/plans.mjs +27 -0
  183. package/resources/v1/plans.mjs.map +1 -1
  184. package/resources/v1/pricing-units.d.ts +8 -0
  185. package/resources/v1/pricing-units.d.ts.map +1 -1
  186. package/resources/v1/pricing-units.js.map +1 -1
  187. package/resources/v1/pricing-units.mjs.map +1 -1
  188. package/resources/v1/services.d.ts +5 -0
  189. package/resources/v1/services.d.ts.map +1 -1
  190. package/resources/v1/services.js +5 -0
  191. package/resources/v1/services.js.map +1 -1
  192. package/resources/v1/services.mjs +5 -0
  193. package/resources/v1/services.mjs.map +1 -1
  194. package/resources/v1/usage.d.ts +161 -3
  195. package/resources/v1/usage.d.ts.map +1 -1
  196. package/resources/v1/usage.js +46 -0
  197. package/resources/v1/usage.js.map +1 -1
  198. package/resources/v1/usage.mjs +46 -0
  199. package/resources/v1/usage.mjs.map +1 -1
  200. package/resources/v1/v1.d.ts +6 -6
  201. package/resources/v1/v1.d.ts.map +1 -1
  202. package/resources/v1/v1.js.map +1 -1
  203. package/resources/v1/v1.mjs.map +1 -1
  204. package/resources/v2/contracts.d.ts +2923 -207
  205. package/resources/v2/contracts.d.ts.map +1 -1
  206. package/resources/v2/contracts.js +90 -2
  207. package/resources/v2/contracts.js.map +1 -1
  208. package/resources/v2/contracts.mjs +90 -2
  209. package/resources/v2/contracts.mjs.map +1 -1
  210. package/resources/webhooks.js +5 -5
  211. package/resources/webhooks.js.map +1 -1
  212. package/resources/webhooks.mjs +5 -5
  213. package/resources/webhooks.mjs.map +1 -1
  214. package/src/_shims/auto/runtime-bun.ts +1 -1
  215. package/src/_shims/auto/runtime-node.ts +1 -1
  216. package/src/_shims/auto/runtime.ts +1 -1
  217. package/src/_shims/auto/types-node.ts +1 -1
  218. package/src/_shims/bun-runtime.ts +2 -2
  219. package/src/_shims/index.d.ts +5 -3
  220. package/src/_shims/index.js +5 -1
  221. package/src/_shims/index.mjs +6 -2
  222. package/src/_shims/node-runtime.ts +3 -3
  223. package/src/_shims/registry.ts +1 -1
  224. package/src/_shims/web-runtime.ts +3 -3
  225. package/src/core.ts +46 -18
  226. package/src/error.ts +1 -1
  227. package/src/index.ts +22 -16
  228. package/src/internal/qs/formats.ts +1 -1
  229. package/src/internal/qs/index.ts +3 -3
  230. package/src/internal/qs/stringify.ts +3 -3
  231. package/src/internal/qs/utils.ts +2 -2
  232. package/src/pagination.ts +5 -1
  233. package/src/resource.ts +2 -2
  234. package/src/resources/index.ts +4 -4
  235. package/src/resources/shared.ts +539 -40
  236. package/src/resources/v1/alerts.ts +29 -5
  237. package/src/resources/v1/audit-logs.ts +12 -4
  238. package/src/resources/v1/billable-metrics.ts +57 -8
  239. package/src/resources/v1/contracts/contracts.ts +1643 -124
  240. package/src/resources/v1/contracts/index.ts +8 -4
  241. package/src/resources/v1/contracts/named-schedules.ts +23 -2
  242. package/src/resources/v1/contracts/products.ts +53 -9
  243. package/src/resources/v1/contracts/rate-cards/index.ts +6 -4
  244. package/src/resources/v1/contracts/rate-cards/named-schedules.ts +27 -2
  245. package/src/resources/v1/contracts/rate-cards/product-orders.ts +33 -3
  246. package/src/resources/v1/contracts/rate-cards/rate-cards.ts +113 -20
  247. package/src/resources/v1/contracts/rate-cards/rates.ts +86 -18
  248. package/src/resources/v1/contracts/rate-cards.ts +1 -1
  249. package/src/resources/v1/contracts.ts +1 -1
  250. package/src/resources/v1/credit-grants.ts +82 -10
  251. package/src/resources/v1/custom-fields.ts +57 -9
  252. package/src/resources/v1/customers/alerts.ts +32 -3
  253. package/src/resources/v1/customers/billing-config.ts +34 -2
  254. package/src/resources/v1/customers/commits.ts +97 -10
  255. package/src/resources/v1/customers/credits.ts +76 -6
  256. package/src/resources/v1/customers/customers.ts +208 -27
  257. package/src/resources/v1/customers/index.ts +10 -8
  258. package/src/resources/v1/customers/invoices.ts +123 -57
  259. package/src/resources/v1/customers/named-schedules.ts +23 -2
  260. package/src/resources/v1/customers/plans.ts +48 -5
  261. package/src/resources/v1/customers.ts +1 -1
  262. package/src/resources/v1/dashboards.ts +30 -4
  263. package/src/resources/v1/index.ts +20 -14
  264. package/src/resources/v1/invoices.ts +16 -2
  265. package/src/resources/v1/plans.ts +45 -10
  266. package/src/resources/v1/pricing-units.ts +12 -4
  267. package/src/resources/v1/services.ts +7 -2
  268. package/src/resources/v1/usage.ts +187 -6
  269. package/src/resources/v1/v1.ts +39 -27
  270. package/src/resources/v1.ts +1 -1
  271. package/src/resources/v2/contracts.ts +3397 -235
  272. package/src/resources/v2/index.ts +2 -2
  273. package/src/resources/v2/v2.ts +3 -3
  274. package/src/resources/v2.ts +1 -1
  275. package/src/resources/webhooks.ts +7 -7
  276. package/src/resources.ts +1 -1
  277. package/src/shims/node.ts +3 -3
  278. package/src/shims/web.ts +3 -3
  279. package/src/uploads.ts +4 -4
  280. package/src/version.ts +1 -1
  281. package/version.d.ts +1 -1
  282. package/version.d.ts.map +1 -1
  283. package/version.js +1 -1
  284. package/version.js.map +1 -1
  285. package/version.mjs +1 -1
  286. package/version.mjs.map +1 -1
@@ -1,13 +1,21 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../resource';
4
- import * as Core from '../../core';
5
- import * as Shared from '../shared';
3
+ import { APIResource } from "../../resource.js";
4
+ import * as Core from "../../core.js";
5
+ import * as Shared from "../shared.js";
6
6
 
7
7
  export class Contracts extends APIResource {
8
8
  /**
9
9
  * Get a specific contract. New clients should use this endpoint rather than the v1
10
10
  * endpoint.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const contract = await client.v2.contracts.retrieve({
15
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
16
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
17
+ * });
18
+ * ```
11
19
  */
12
20
  retrieve(
13
21
  body: ContractRetrieveParams,
@@ -17,7 +25,15 @@ export class Contracts extends APIResource {
17
25
  }
18
26
 
19
27
  /**
20
- * List all contracts for a customer
28
+ * List all contracts for a customer in chronological order. New clients should use
29
+ * this endpoint rather than the v1 endpoint.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const contracts = await client.v2.contracts.list({
34
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
35
+ * });
36
+ * ```
21
37
  */
22
38
  list(body: ContractListParams, options?: Core.RequestOptions): Core.APIPromise<ContractListResponse> {
23
39
  return this._client.post('/v2/contracts/list', { body, ...options });
@@ -25,6 +41,37 @@ export class Contracts extends APIResource {
25
41
 
26
42
  /**
27
43
  * Edit a contract. Contract editing must be enabled to use this endpoint.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const response = await client.v2.contracts.edit({
48
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
49
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
50
+ * add_overrides: [
51
+ * {
52
+ * type: 'MULTIPLIER',
53
+ * starting_at: '2024-11-02T00:00:00Z',
54
+ * product_id: 'd4fc086c-d8e5-4091-a235-fbba5da4ec14',
55
+ * multiplier: 2,
56
+ * priority: 100,
57
+ * },
58
+ * ],
59
+ * add_scheduled_charges: [
60
+ * {
61
+ * product_id: '2e30f074-d04c-412e-a134-851ebfa5ceb2',
62
+ * schedule: {
63
+ * schedule_items: [
64
+ * {
65
+ * timestamp: '2020-02-15T00:00:00.000Z',
66
+ * unit_price: 1000000,
67
+ * quantity: 1,
68
+ * },
69
+ * ],
70
+ * },
71
+ * },
72
+ * ],
73
+ * });
74
+ * ```
28
75
  */
29
76
  edit(body: ContractEditParams, options?: Core.RequestOptions): Core.APIPromise<ContractEditResponse> {
30
77
  return this._client.post('/v2/contracts/edit', { body, ...options });
@@ -33,6 +80,22 @@ export class Contracts extends APIResource {
33
80
  /**
34
81
  * Edit a customer or contract commit. Contract commits can only be edited using
35
82
  * this endpoint if contract editing is enabled.
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * const response = await client.v2.contracts.editCommit({
87
+ * commit_id: '5e7e82cf-ccb7-428c-a96f-a8e4f67af822',
88
+ * customer_id: '4c91c473-fc12-445a-9c38-40421d47023f',
89
+ * access_schedule: {
90
+ * update_schedule_items: [
91
+ * {
92
+ * id: 'd5edbd32-c744-48cb-9475-a9bca0e6fa39',
93
+ * ending_before: '2025-03-12T00:00:00Z',
94
+ * },
95
+ * ],
96
+ * },
97
+ * });
98
+ * ```
36
99
  */
37
100
  editCommit(
38
101
  body: ContractEditCommitParams,
@@ -44,6 +107,22 @@ export class Contracts extends APIResource {
44
107
  /**
45
108
  * Edit a customer or contract credit. Contract credits can only be edited using
46
109
  * this endpoint if contract editing is enabled.
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * const response = await client.v2.contracts.editCredit({
114
+ * credit_id: '5e7e82cf-ccb7-428c-a96f-a8e4f67af822',
115
+ * customer_id: '4c91c473-fc12-445a-9c38-40421d47023f',
116
+ * access_schedule: {
117
+ * update_schedule_items: [
118
+ * {
119
+ * id: 'd5edbd32-c744-48cb-9475-a9bca0e6fa39',
120
+ * ending_before: '2025-03-12T00:00:00Z',
121
+ * },
122
+ * ],
123
+ * },
124
+ * });
125
+ * ```
47
126
  */
48
127
  editCredit(
49
128
  body: ContractEditCreditParams,
@@ -53,7 +132,16 @@ export class Contracts extends APIResource {
53
132
  }
54
133
 
55
134
  /**
56
- * Get the edit history of a specific contract
135
+ * Get the edit history of a specific contract. Contract editing must be enabled to
136
+ * use this endpoint.
137
+ *
138
+ * @example
139
+ * ```ts
140
+ * const response = await client.v2.contracts.getEditHistory({
141
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
142
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
143
+ * });
144
+ * ```
57
145
  */
58
146
  getEditHistory(
59
147
  body: ContractGetEditHistoryParams,
@@ -95,7 +183,7 @@ export namespace ContractRetrieveResponse {
95
183
 
96
184
  credits?: Array<Data.Credit>;
97
185
 
98
- custom_fields?: Record<string, string>;
186
+ custom_fields?: { [key: string]: string };
99
187
 
100
188
  /**
101
189
  * This field's availability is dependent on your client's configuration.
@@ -109,6 +197,18 @@ export namespace ContractRetrieveResponse {
109
197
 
110
198
  ending_before?: string;
111
199
 
200
+ /**
201
+ * Indicates whether there are more items than the limit for this endpoint. Use the
202
+ * respective list endpoints to get the full lists.
203
+ */
204
+ has_more?: Data.HasMore;
205
+
206
+ /**
207
+ * Either a **parent** configuration with a list of children or a **child**
208
+ * configuration with a single parent.
209
+ */
210
+ hierarchy_configuration?: Data.ParentHierarchyConfiguration | Data.ChildHierarchyConfiguration;
211
+
112
212
  /**
113
213
  * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
114
214
  * prices automatically. EXPLICIT prioritization requires specifying priorities for
@@ -126,6 +226,13 @@ export namespace ContractRetrieveResponse {
126
226
  */
127
227
  netsuite_sales_order_id?: string;
128
228
 
229
+ prepaid_balance_threshold_configuration?: Data.PrepaidBalanceThresholdConfiguration;
230
+
231
+ /**
232
+ * Priority of the contract.
233
+ */
234
+ priority?: number;
235
+
129
236
  /**
130
237
  * This field's availability is dependent on your client's configuration.
131
238
  */
@@ -156,9 +263,12 @@ export namespace ContractRetrieveResponse {
156
263
  */
157
264
  scheduled_charges_on_usage_invoices?: 'ALL';
158
265
 
159
- subscriptions?: Array<Data.Subscription>;
266
+ spend_threshold_configuration?: Data.SpendThresholdConfiguration;
160
267
 
161
- threshold_billing_configuration?: Data.ThresholdBillingConfiguration;
268
+ /**
269
+ * List of subscriptions on the contract.
270
+ */
271
+ subscriptions?: Array<Data.Subscription>;
162
272
 
163
273
  total_contract_value?: number;
164
274
 
@@ -190,6 +300,8 @@ export namespace ContractRetrieveResponse {
190
300
 
191
301
  applicable_product_tags?: Array<string>;
192
302
 
303
+ archived_at?: string;
304
+
193
305
  /**
194
306
  * The current balance of the credit or commit. This balance reflects the amount of
195
307
  * credit or commit that the customer has access to use at this moment - thus,
@@ -204,10 +316,15 @@ export namespace ContractRetrieveResponse {
204
316
 
205
317
  contract?: Commit.Contract;
206
318
 
207
- custom_fields?: Record<string, string>;
319
+ custom_fields?: { [key: string]: string };
208
320
 
209
321
  description?: string;
210
322
 
323
+ /**
324
+ * Optional configuration for commit hierarchy access control
325
+ */
326
+ hierarchy_configuration?: Commit.HierarchyConfiguration;
327
+
211
328
  /**
212
329
  * The contract that this commit will be billed on.
213
330
  */
@@ -229,6 +346,7 @@ export namespace ContractRetrieveResponse {
229
346
  | Commit.PrepaidCommitExpirationLedgerEntry
230
347
  | Commit.PrepaidCommitCanceledLedgerEntry
231
348
  | Commit.PrepaidCommitCreditedLedgerEntry
349
+ | Commit.PrepaidCommitSeatBasedAdjustmentLedgerEntry
232
350
  | Commit.PostpaidCommitInitialBalanceLedgerEntry
233
351
  | Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry
234
352
  | Commit.PostpaidCommitRolloverLedgerEntry
@@ -261,6 +379,13 @@ export namespace ContractRetrieveResponse {
261
379
  * This field's availability is dependent on your client's configuration.
262
380
  */
263
381
  salesforce_opportunity_id?: string;
382
+
383
+ /**
384
+ * List of filters that determine what kind of customer usage draws down a commit
385
+ * or credit. A customer's usage needs to meet the condition of at least one of the
386
+ * specifiers to contribute to a commit's or credit's drawdown.
387
+ */
388
+ specifiers?: Array<Commit.Specifier>;
264
389
  }
265
390
 
266
391
  export namespace Commit {
@@ -274,6 +399,32 @@ export namespace ContractRetrieveResponse {
274
399
  id: string;
275
400
  }
276
401
 
402
+ /**
403
+ * Optional configuration for commit hierarchy access control
404
+ */
405
+ export interface HierarchyConfiguration {
406
+ child_access:
407
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
408
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
409
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
410
+ }
411
+
412
+ export namespace HierarchyConfiguration {
413
+ export interface CommitHierarchyChildAccessAll {
414
+ type: 'ALL';
415
+ }
416
+
417
+ export interface CommitHierarchyChildAccessNone {
418
+ type: 'NONE';
419
+ }
420
+
421
+ export interface CommitHierarchyChildAccessContractIDs {
422
+ contract_ids: Array<string>;
423
+
424
+ type: 'CONTRACT_IDS';
425
+ }
426
+ }
427
+
277
428
  /**
278
429
  * The contract that this commit will be billed on.
279
430
  */
@@ -349,6 +500,16 @@ export namespace ContractRetrieveResponse {
349
500
  type: 'PREPAID_COMMIT_CREDITED';
350
501
  }
351
502
 
503
+ export interface PrepaidCommitSeatBasedAdjustmentLedgerEntry {
504
+ amount: number;
505
+
506
+ segment_id: string;
507
+
508
+ timestamp: string;
509
+
510
+ type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
511
+ }
512
+
352
513
  export interface PostpaidCommitInitialBalanceLedgerEntry {
353
514
  amount: number;
354
515
 
@@ -424,6 +585,23 @@ export namespace ContractRetrieveResponse {
424
585
 
425
586
  contract_id: string;
426
587
  }
588
+
589
+ export interface Specifier {
590
+ presentation_group_values?: { [key: string]: string };
591
+
592
+ pricing_group_values?: { [key: string]: string };
593
+
594
+ /**
595
+ * If provided, the specifier will only apply to the product with the specified ID.
596
+ */
597
+ product_id?: string;
598
+
599
+ /**
600
+ * If provided, the specifier will only apply to products with all the specified
601
+ * tags.
602
+ */
603
+ product_tags?: Array<string>;
604
+ }
427
605
  }
428
606
 
429
607
  export interface Override {
@@ -458,13 +636,13 @@ export namespace ContractRetrieveResponse {
458
636
 
459
637
  export namespace Override {
460
638
  export interface OverrideSpecifier {
461
- billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
639
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
462
640
 
463
641
  commit_ids?: Array<string>;
464
642
 
465
- presentation_group_values?: Record<string, string | null>;
643
+ presentation_group_values?: { [key: string]: string | null };
466
644
 
467
- pricing_group_values?: Record<string, string>;
645
+ pricing_group_values?: { [key: string]: string };
468
646
 
469
647
  product_id?: string;
470
648
 
@@ -490,7 +668,7 @@ export namespace ContractRetrieveResponse {
490
668
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
491
669
  * processors.
492
670
  */
493
- custom_rate?: Record<string, unknown>;
671
+ custom_rate?: { [key: string]: unknown };
494
672
 
495
673
  /**
496
674
  * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
@@ -554,7 +732,7 @@ export namespace ContractRetrieveResponse {
554
732
  */
555
733
  billing_anchor_date: string;
556
734
 
557
- frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
735
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
558
736
  }
559
737
 
560
738
  export interface Credit {
@@ -589,10 +767,15 @@ export namespace ContractRetrieveResponse {
589
767
 
590
768
  contract?: Credit.Contract;
591
769
 
592
- custom_fields?: Record<string, string>;
770
+ custom_fields?: { [key: string]: string };
593
771
 
594
772
  description?: string;
595
773
 
774
+ /**
775
+ * Optional configuration for credit hierarchy access control
776
+ */
777
+ hierarchy_configuration?: Credit.HierarchyConfiguration;
778
+
596
779
  /**
597
780
  * A list of ordered events that impact the balance of a credit. For example, an
598
781
  * invoice deduction or an expiration.
@@ -604,6 +787,7 @@ export namespace ContractRetrieveResponse {
604
787
  | Credit.CreditCanceledLedgerEntry
605
788
  | Credit.CreditCreditedLedgerEntry
606
789
  | Credit.CreditManualLedgerEntry
790
+ | Credit.CreditSeatBasedAdjustmentLedgerEntry
607
791
  >;
608
792
 
609
793
  name?: string;
@@ -623,6 +807,13 @@ export namespace ContractRetrieveResponse {
623
807
  * This field's availability is dependent on your client's configuration.
624
808
  */
625
809
  salesforce_opportunity_id?: string;
810
+
811
+ /**
812
+ * List of filters that determine what kind of customer usage draws down a commit
813
+ * or credit. A customer's usage needs to meet the condition of at least one of the
814
+ * specifiers to contribute to a commit's or credit's drawdown.
815
+ */
816
+ specifiers?: Array<Credit.Specifier>;
626
817
  }
627
818
 
628
819
  export namespace Credit {
@@ -636,6 +827,32 @@ export namespace ContractRetrieveResponse {
636
827
  id: string;
637
828
  }
638
829
 
830
+ /**
831
+ * Optional configuration for credit hierarchy access control
832
+ */
833
+ export interface HierarchyConfiguration {
834
+ child_access:
835
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
836
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
837
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
838
+ }
839
+
840
+ export namespace HierarchyConfiguration {
841
+ export interface CommitHierarchyChildAccessAll {
842
+ type: 'ALL';
843
+ }
844
+
845
+ export interface CommitHierarchyChildAccessNone {
846
+ type: 'NONE';
847
+ }
848
+
849
+ export interface CommitHierarchyChildAccessContractIDs {
850
+ contract_ids: Array<string>;
851
+
852
+ type: 'CONTRACT_IDS';
853
+ }
854
+ }
855
+
639
856
  export interface CreditSegmentStartLedgerEntry {
640
857
  amount: number;
641
858
 
@@ -701,6 +918,33 @@ export namespace ContractRetrieveResponse {
701
918
 
702
919
  type: 'CREDIT_MANUAL';
703
920
  }
921
+
922
+ export interface CreditSeatBasedAdjustmentLedgerEntry {
923
+ amount: number;
924
+
925
+ segment_id: string;
926
+
927
+ timestamp: string;
928
+
929
+ type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
930
+ }
931
+
932
+ export interface Specifier {
933
+ presentation_group_values?: { [key: string]: string };
934
+
935
+ pricing_group_values?: { [key: string]: string };
936
+
937
+ /**
938
+ * If provided, the specifier will only apply to the product with the specified ID.
939
+ */
940
+ product_id?: string;
941
+
942
+ /**
943
+ * If provided, the specifier will only apply to products with all the specified
944
+ * tags.
945
+ */
946
+ product_tags?: Array<string>;
947
+ }
704
948
  }
705
949
 
706
950
  /**
@@ -720,6 +964,210 @@ export namespace ContractRetrieveResponse {
720
964
  delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
721
965
  }
722
966
 
967
+ /**
968
+ * Indicates whether there are more items than the limit for this endpoint. Use the
969
+ * respective list endpoints to get the full lists.
970
+ */
971
+ export interface HasMore {
972
+ /**
973
+ * Whether there are more commits on this contract than the limit for this
974
+ * endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
975
+ * of commits.
976
+ */
977
+ commits: boolean;
978
+
979
+ /**
980
+ * Whether there are more credits on this contract than the limit for this
981
+ * endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
982
+ * of credits.
983
+ */
984
+ credits: boolean;
985
+ }
986
+
987
+ export interface ParentHierarchyConfiguration {
988
+ /**
989
+ * List of contracts that belong to this parent.
990
+ */
991
+ children: Array<ParentHierarchyConfiguration.Child>;
992
+ }
993
+
994
+ export namespace ParentHierarchyConfiguration {
995
+ export interface Child {
996
+ contract_id: string;
997
+
998
+ customer_id: string;
999
+ }
1000
+ }
1001
+
1002
+ export interface ChildHierarchyConfiguration {
1003
+ /**
1004
+ * The single parent contract/customer for this child.
1005
+ */
1006
+ parent: ChildHierarchyConfiguration.Parent;
1007
+ }
1008
+
1009
+ export namespace ChildHierarchyConfiguration {
1010
+ /**
1011
+ * The single parent contract/customer for this child.
1012
+ */
1013
+ export interface Parent {
1014
+ contract_id: string;
1015
+
1016
+ customer_id: string;
1017
+ }
1018
+ }
1019
+
1020
+ export interface PrepaidBalanceThresholdConfiguration {
1021
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
1022
+
1023
+ /**
1024
+ * When set to false, the contract will not be evaluated against the
1025
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1026
+ * regardless of prior state.
1027
+ */
1028
+ is_enabled: boolean;
1029
+
1030
+ payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
1031
+
1032
+ /**
1033
+ * Specify the amount the balance should be recharged to.
1034
+ */
1035
+ recharge_to_amount: number;
1036
+
1037
+ /**
1038
+ * Specify the threshold amount for the contract. Each time the contract's balance
1039
+ * lowers to this amount, a threshold charge will be initiated.
1040
+ */
1041
+ threshold_amount: number;
1042
+
1043
+ /**
1044
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
1045
+ * commit amount will be in terms of this credit type instead of the fiat currency.
1046
+ */
1047
+ custom_credit_type_id?: string;
1048
+ }
1049
+
1050
+ export namespace PrepaidBalanceThresholdConfiguration {
1051
+ export interface Commit {
1052
+ /**
1053
+ * The commit product that will be used to generate the line item for commit
1054
+ * payment.
1055
+ */
1056
+ product_id: string;
1057
+
1058
+ /**
1059
+ * Which products the threshold commit applies to. If applicable_product_ids,
1060
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1061
+ * all products.
1062
+ */
1063
+ applicable_product_ids?: Array<string>;
1064
+
1065
+ /**
1066
+ * Which tags the threshold commit applies to. If applicable_product_ids,
1067
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1068
+ * all products.
1069
+ */
1070
+ applicable_product_tags?: Array<string>;
1071
+
1072
+ description?: string;
1073
+
1074
+ /**
1075
+ * Specify the name of the line item for the threshold charge. If left blank, it
1076
+ * will default to the commit product name.
1077
+ */
1078
+ name?: string;
1079
+
1080
+ /**
1081
+ * List of filters that determine what kind of customer usage draws down a commit
1082
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1083
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1084
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1085
+ */
1086
+ specifiers?: Array<Commit.Specifier>;
1087
+ }
1088
+
1089
+ export namespace Commit {
1090
+ export interface Specifier {
1091
+ presentation_group_values?: { [key: string]: string };
1092
+
1093
+ pricing_group_values?: { [key: string]: string };
1094
+
1095
+ /**
1096
+ * If provided, the specifier will only apply to the product with the specified ID.
1097
+ */
1098
+ product_id?: string;
1099
+
1100
+ /**
1101
+ * If provided, the specifier will only apply to products with all the specified
1102
+ * tags.
1103
+ */
1104
+ product_tags?: Array<string>;
1105
+ }
1106
+ }
1107
+
1108
+ export interface PaymentGateConfig {
1109
+ /**
1110
+ * Gate access to the commit balance based on successful collection of payment.
1111
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1112
+ * facilitate payment using your own payment integration. Select NONE if you do not
1113
+ * wish to payment gate the commit balance.
1114
+ */
1115
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1116
+
1117
+ /**
1118
+ * Only applicable if using PRECALCULATED as your tax type.
1119
+ */
1120
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1121
+
1122
+ /**
1123
+ * Only applicable if using STRIPE as your payment gateway type.
1124
+ */
1125
+ stripe_config?: PaymentGateConfig.StripeConfig;
1126
+
1127
+ /**
1128
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1129
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1130
+ * will default to NONE.
1131
+ */
1132
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1133
+ }
1134
+
1135
+ export namespace PaymentGateConfig {
1136
+ /**
1137
+ * Only applicable if using PRECALCULATED as your tax type.
1138
+ */
1139
+ export interface PrecalculatedTaxConfig {
1140
+ /**
1141
+ * Amount of tax to be applied. This should be in the same currency and
1142
+ * denomination as the commit's invoice schedule
1143
+ */
1144
+ tax_amount: number;
1145
+
1146
+ /**
1147
+ * Name of the tax to be applied. This may be used in an invoice line item
1148
+ * description.
1149
+ */
1150
+ tax_name?: string;
1151
+ }
1152
+
1153
+ /**
1154
+ * Only applicable if using STRIPE as your payment gateway type.
1155
+ */
1156
+ export interface StripeConfig {
1157
+ /**
1158
+ * If left blank, will default to INVOICE
1159
+ */
1160
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1161
+
1162
+ /**
1163
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1164
+ * your payment type.
1165
+ */
1166
+ invoice_metadata?: { [key: string]: string };
1167
+ }
1168
+ }
1169
+ }
1170
+
723
1171
  export interface RecurringCommit {
724
1172
  id: string;
725
1173
 
@@ -772,6 +1220,11 @@ export namespace ContractRetrieveResponse {
772
1220
  */
773
1221
  ending_before?: string;
774
1222
 
1223
+ /**
1224
+ * Optional configuration for recurring commit/credit hierarchy access control
1225
+ */
1226
+ hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
1227
+
775
1228
  /**
776
1229
  * The amount the customer should be billed for the commit. Not required.
777
1230
  */
@@ -797,10 +1250,10 @@ export namespace ContractRetrieveResponse {
797
1250
  * The frequency at which the recurring commits will be created. If not provided: -
798
1251
  * The commits will be created on the usage invoice frequency. If provided: - The
799
1252
  * period defined in the duration will correspond to this frequency. - Commits will
800
- * be created aligned with the recurring commit's start_date rather than the usage
1253
+ * be created aligned with the recurring commit's starting_at rather than the usage
801
1254
  * invoice dates.
802
1255
  */
803
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
1256
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
804
1257
 
805
1258
  /**
806
1259
  * Will be passed down to the individual commits. This controls how much of an
@@ -808,6 +1261,13 @@ export namespace ContractRetrieveResponse {
808
1261
  * between 0 and 1.
809
1262
  */
810
1263
  rollover_fraction?: number;
1264
+
1265
+ /**
1266
+ * List of filters that determine what kind of customer usage draws down a commit
1267
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1268
+ * specifiers to contribute to a commit's or credit's drawdown.
1269
+ */
1270
+ specifiers?: Array<RecurringCommit.Specifier>;
811
1271
  }
812
1272
 
813
1273
  export namespace RecurringCommit {
@@ -817,9 +1277,9 @@ export namespace ContractRetrieveResponse {
817
1277
  export interface AccessAmount {
818
1278
  credit_type_id: string;
819
1279
 
820
- quantity: number;
821
-
822
1280
  unit_price: number;
1281
+
1282
+ quantity?: number;
823
1283
  }
824
1284
 
825
1285
  /**
@@ -841,6 +1301,32 @@ export namespace ContractRetrieveResponse {
841
1301
  id: string;
842
1302
  }
843
1303
 
1304
+ /**
1305
+ * Optional configuration for recurring commit/credit hierarchy access control
1306
+ */
1307
+ export interface HierarchyConfiguration {
1308
+ child_access:
1309
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
1310
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
1311
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1312
+ }
1313
+
1314
+ export namespace HierarchyConfiguration {
1315
+ export interface CommitHierarchyChildAccessAll {
1316
+ type: 'ALL';
1317
+ }
1318
+
1319
+ export interface CommitHierarchyChildAccessNone {
1320
+ type: 'NONE';
1321
+ }
1322
+
1323
+ export interface CommitHierarchyChildAccessContractIDs {
1324
+ contract_ids: Array<string>;
1325
+
1326
+ type: 'CONTRACT_IDS';
1327
+ }
1328
+ }
1329
+
844
1330
  /**
845
1331
  * The amount the customer should be billed for the commit. Not required.
846
1332
  */
@@ -851,6 +1337,23 @@ export namespace ContractRetrieveResponse {
851
1337
 
852
1338
  unit_price: number;
853
1339
  }
1340
+
1341
+ export interface Specifier {
1342
+ presentation_group_values?: { [key: string]: string };
1343
+
1344
+ pricing_group_values?: { [key: string]: string };
1345
+
1346
+ /**
1347
+ * If provided, the specifier will only apply to the product with the specified ID.
1348
+ */
1349
+ product_id?: string;
1350
+
1351
+ /**
1352
+ * If provided, the specifier will only apply to products with all the specified
1353
+ * tags.
1354
+ */
1355
+ product_tags?: Array<string>;
1356
+ }
854
1357
  }
855
1358
 
856
1359
  export interface RecurringCredit {
@@ -905,6 +1408,11 @@ export namespace ContractRetrieveResponse {
905
1408
  */
906
1409
  ending_before?: string;
907
1410
 
1411
+ /**
1412
+ * Optional configuration for recurring commit/credit hierarchy access control
1413
+ */
1414
+ hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
1415
+
908
1416
  /**
909
1417
  * Displayed on invoices. Will be passed through to the individual commits
910
1418
  */
@@ -925,10 +1433,10 @@ export namespace ContractRetrieveResponse {
925
1433
  * The frequency at which the recurring commits will be created. If not provided: -
926
1434
  * The commits will be created on the usage invoice frequency. If provided: - The
927
1435
  * period defined in the duration will correspond to this frequency. - Commits will
928
- * be created aligned with the recurring commit's start_date rather than the usage
1436
+ * be created aligned with the recurring commit's starting_at rather than the usage
929
1437
  * invoice dates.
930
1438
  */
931
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
1439
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
932
1440
 
933
1441
  /**
934
1442
  * Will be passed down to the individual commits. This controls how much of an
@@ -936,6 +1444,13 @@ export namespace ContractRetrieveResponse {
936
1444
  * between 0 and 1.
937
1445
  */
938
1446
  rollover_fraction?: number;
1447
+
1448
+ /**
1449
+ * List of filters that determine what kind of customer usage draws down a commit
1450
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1451
+ * specifiers to contribute to a commit's or credit's drawdown.
1452
+ */
1453
+ specifiers?: Array<RecurringCredit.Specifier>;
939
1454
  }
940
1455
 
941
1456
  export namespace RecurringCredit {
@@ -945,9 +1460,9 @@ export namespace ContractRetrieveResponse {
945
1460
  export interface AccessAmount {
946
1461
  credit_type_id: string;
947
1462
 
948
- quantity: number;
949
-
950
1463
  unit_price: number;
1464
+
1465
+ quantity?: number;
951
1466
  }
952
1467
 
953
1468
  /**
@@ -968,12 +1483,55 @@ export namespace ContractRetrieveResponse {
968
1483
  export interface Contract {
969
1484
  id: string;
970
1485
  }
971
- }
972
1486
 
973
- export interface ResellerRoyalty {
974
- reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1487
+ /**
1488
+ * Optional configuration for recurring commit/credit hierarchy access control
1489
+ */
1490
+ export interface HierarchyConfiguration {
1491
+ child_access:
1492
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
1493
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
1494
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1495
+ }
975
1496
 
976
- segments: Array<ResellerRoyalty.Segment>;
1497
+ export namespace HierarchyConfiguration {
1498
+ export interface CommitHierarchyChildAccessAll {
1499
+ type: 'ALL';
1500
+ }
1501
+
1502
+ export interface CommitHierarchyChildAccessNone {
1503
+ type: 'NONE';
1504
+ }
1505
+
1506
+ export interface CommitHierarchyChildAccessContractIDs {
1507
+ contract_ids: Array<string>;
1508
+
1509
+ type: 'CONTRACT_IDS';
1510
+ }
1511
+ }
1512
+
1513
+ export interface Specifier {
1514
+ presentation_group_values?: { [key: string]: string };
1515
+
1516
+ pricing_group_values?: { [key: string]: string };
1517
+
1518
+ /**
1519
+ * If provided, the specifier will only apply to the product with the specified ID.
1520
+ */
1521
+ product_id?: string;
1522
+
1523
+ /**
1524
+ * If provided, the specifier will only apply to products with all the specified
1525
+ * tags.
1526
+ */
1527
+ product_tags?: Array<string>;
1528
+ }
1529
+ }
1530
+
1531
+ export interface ResellerRoyalty {
1532
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1533
+
1534
+ segments: Array<ResellerRoyalty.Segment>;
977
1535
  }
978
1536
 
979
1537
  export namespace ResellerRoyalty {
@@ -1006,21 +1564,130 @@ export namespace ContractRetrieveResponse {
1006
1564
  }
1007
1565
  }
1008
1566
 
1567
+ export interface SpendThresholdConfiguration {
1568
+ commit: SpendThresholdConfiguration.Commit;
1569
+
1570
+ /**
1571
+ * When set to false, the contract will not be evaluated against the
1572
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1573
+ * regardless of prior state.
1574
+ */
1575
+ is_enabled: boolean;
1576
+
1577
+ payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
1578
+
1579
+ /**
1580
+ * Specify the threshold amount for the contract. Each time the contract's usage
1581
+ * hits this amount, a threshold charge will be initiated.
1582
+ */
1583
+ threshold_amount: number;
1584
+ }
1585
+
1586
+ export namespace SpendThresholdConfiguration {
1587
+ export interface Commit {
1588
+ /**
1589
+ * The commit product that will be used to generate the line item for commit
1590
+ * payment.
1591
+ */
1592
+ product_id: string;
1593
+
1594
+ description?: string;
1595
+
1596
+ /**
1597
+ * Specify the name of the line item for the threshold charge. If left blank, it
1598
+ * will default to the commit product name.
1599
+ */
1600
+ name?: string;
1601
+ }
1602
+
1603
+ export interface PaymentGateConfig {
1604
+ /**
1605
+ * Gate access to the commit balance based on successful collection of payment.
1606
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1607
+ * facilitate payment using your own payment integration. Select NONE if you do not
1608
+ * wish to payment gate the commit balance.
1609
+ */
1610
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1611
+
1612
+ /**
1613
+ * Only applicable if using PRECALCULATED as your tax type.
1614
+ */
1615
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1616
+
1617
+ /**
1618
+ * Only applicable if using STRIPE as your payment gateway type.
1619
+ */
1620
+ stripe_config?: PaymentGateConfig.StripeConfig;
1621
+
1622
+ /**
1623
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1624
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1625
+ * will default to NONE.
1626
+ */
1627
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1628
+ }
1629
+
1630
+ export namespace PaymentGateConfig {
1631
+ /**
1632
+ * Only applicable if using PRECALCULATED as your tax type.
1633
+ */
1634
+ export interface PrecalculatedTaxConfig {
1635
+ /**
1636
+ * Amount of tax to be applied. This should be in the same currency and
1637
+ * denomination as the commit's invoice schedule
1638
+ */
1639
+ tax_amount: number;
1640
+
1641
+ /**
1642
+ * Name of the tax to be applied. This may be used in an invoice line item
1643
+ * description.
1644
+ */
1645
+ tax_name?: string;
1646
+ }
1647
+
1648
+ /**
1649
+ * Only applicable if using STRIPE as your payment gateway type.
1650
+ */
1651
+ export interface StripeConfig {
1652
+ /**
1653
+ * If left blank, will default to INVOICE
1654
+ */
1655
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1656
+
1657
+ /**
1658
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1659
+ * your payment type.
1660
+ */
1661
+ invoice_metadata?: { [key: string]: string };
1662
+ }
1663
+ }
1664
+ }
1665
+
1009
1666
  export interface Subscription {
1010
1667
  collection_schedule: 'ADVANCE' | 'ARREARS';
1011
1668
 
1012
1669
  proration: Subscription.Proration;
1013
1670
 
1671
+ /**
1672
+ * List of quantity schedule items for the subscription. Only includes the current
1673
+ * quantity and future quantity changes.
1674
+ */
1014
1675
  quantity_schedule: Array<Subscription.QuantitySchedule>;
1015
1676
 
1016
1677
  starting_at: string;
1017
1678
 
1018
1679
  subscription_rate: Subscription.SubscriptionRate;
1019
1680
 
1681
+ id?: string;
1682
+
1683
+ custom_fields?: { [key: string]: string };
1684
+
1020
1685
  description?: string;
1021
1686
 
1022
1687
  ending_before?: string;
1023
1688
 
1689
+ fiat_credit_type_id?: string;
1690
+
1024
1691
  name?: string;
1025
1692
  }
1026
1693
 
@@ -1040,7 +1707,7 @@ export namespace ContractRetrieveResponse {
1040
1707
  }
1041
1708
 
1042
1709
  export interface SubscriptionRate {
1043
- billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
1710
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1044
1711
 
1045
1712
  product: SubscriptionRate.Product;
1046
1713
  }
@@ -1053,50 +1720,6 @@ export namespace ContractRetrieveResponse {
1053
1720
  }
1054
1721
  }
1055
1722
  }
1056
-
1057
- export interface ThresholdBillingConfiguration {
1058
- commit: ThresholdBillingConfiguration.Commit;
1059
-
1060
- /**
1061
- * When set to false, the contract will not be evaluated against the
1062
- * threshold_amount. Toggling to true will result an immediate evaluation,
1063
- * regardless of prior state
1064
- */
1065
- is_enabled: boolean;
1066
-
1067
- /**
1068
- * Specify the threshold amount for the contract. Each time the contract's usage
1069
- * hits this amount, a threshold charge will be initiated.
1070
- */
1071
- threshold_amount: number;
1072
- }
1073
-
1074
- export namespace ThresholdBillingConfiguration {
1075
- export interface Commit {
1076
- product_id: string;
1077
-
1078
- /**
1079
- * Which products the threshold commit applies to. If both applicable_product_ids
1080
- * and applicable_product_tags are not provided, the commit applies to all
1081
- * products.
1082
- */
1083
- applicable_product_ids?: Array<string>;
1084
-
1085
- /**
1086
- * Which tags the threshold commit applies to. If both applicable_product_ids and
1087
- * applicable_product_tags are not provided, the commit applies to all products.
1088
- */
1089
- applicable_product_tags?: Array<string>;
1090
-
1091
- description?: string;
1092
-
1093
- /**
1094
- * Specify the name of the line item for the threshold charge. If left blank, it
1095
- * will default to the commit product name.
1096
- */
1097
- name?: string;
1098
- }
1099
- }
1100
1723
  }
1101
1724
  }
1102
1725
 
@@ -1132,7 +1755,7 @@ export namespace ContractListResponse {
1132
1755
 
1133
1756
  credits?: Array<Data.Credit>;
1134
1757
 
1135
- custom_fields?: Record<string, string>;
1758
+ custom_fields?: { [key: string]: string };
1136
1759
 
1137
1760
  /**
1138
1761
  * This field's availability is dependent on your client's configuration.
@@ -1146,6 +1769,18 @@ export namespace ContractListResponse {
1146
1769
 
1147
1770
  ending_before?: string;
1148
1771
 
1772
+ /**
1773
+ * Indicates whether there are more items than the limit for this endpoint. Use the
1774
+ * respective list endpoints to get the full lists.
1775
+ */
1776
+ has_more?: Data.HasMore;
1777
+
1778
+ /**
1779
+ * Either a **parent** configuration with a list of children or a **child**
1780
+ * configuration with a single parent.
1781
+ */
1782
+ hierarchy_configuration?: Data.ParentHierarchyConfiguration | Data.ChildHierarchyConfiguration;
1783
+
1149
1784
  /**
1150
1785
  * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
1151
1786
  * prices automatically. EXPLICIT prioritization requires specifying priorities for
@@ -1163,6 +1798,13 @@ export namespace ContractListResponse {
1163
1798
  */
1164
1799
  netsuite_sales_order_id?: string;
1165
1800
 
1801
+ prepaid_balance_threshold_configuration?: Data.PrepaidBalanceThresholdConfiguration;
1802
+
1803
+ /**
1804
+ * Priority of the contract.
1805
+ */
1806
+ priority?: number;
1807
+
1166
1808
  /**
1167
1809
  * This field's availability is dependent on your client's configuration.
1168
1810
  */
@@ -1193,9 +1835,12 @@ export namespace ContractListResponse {
1193
1835
  */
1194
1836
  scheduled_charges_on_usage_invoices?: 'ALL';
1195
1837
 
1196
- subscriptions?: Array<Data.Subscription>;
1838
+ spend_threshold_configuration?: Data.SpendThresholdConfiguration;
1197
1839
 
1198
- threshold_billing_configuration?: Data.ThresholdBillingConfiguration;
1840
+ /**
1841
+ * List of subscriptions on the contract.
1842
+ */
1843
+ subscriptions?: Array<Data.Subscription>;
1199
1844
 
1200
1845
  total_contract_value?: number;
1201
1846
 
@@ -1227,6 +1872,8 @@ export namespace ContractListResponse {
1227
1872
 
1228
1873
  applicable_product_tags?: Array<string>;
1229
1874
 
1875
+ archived_at?: string;
1876
+
1230
1877
  /**
1231
1878
  * The current balance of the credit or commit. This balance reflects the amount of
1232
1879
  * credit or commit that the customer has access to use at this moment - thus,
@@ -1241,10 +1888,15 @@ export namespace ContractListResponse {
1241
1888
 
1242
1889
  contract?: Commit.Contract;
1243
1890
 
1244
- custom_fields?: Record<string, string>;
1891
+ custom_fields?: { [key: string]: string };
1245
1892
 
1246
1893
  description?: string;
1247
1894
 
1895
+ /**
1896
+ * Optional configuration for commit hierarchy access control
1897
+ */
1898
+ hierarchy_configuration?: Commit.HierarchyConfiguration;
1899
+
1248
1900
  /**
1249
1901
  * The contract that this commit will be billed on.
1250
1902
  */
@@ -1266,6 +1918,7 @@ export namespace ContractListResponse {
1266
1918
  | Commit.PrepaidCommitExpirationLedgerEntry
1267
1919
  | Commit.PrepaidCommitCanceledLedgerEntry
1268
1920
  | Commit.PrepaidCommitCreditedLedgerEntry
1921
+ | Commit.PrepaidCommitSeatBasedAdjustmentLedgerEntry
1269
1922
  | Commit.PostpaidCommitInitialBalanceLedgerEntry
1270
1923
  | Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry
1271
1924
  | Commit.PostpaidCommitRolloverLedgerEntry
@@ -1298,6 +1951,13 @@ export namespace ContractListResponse {
1298
1951
  * This field's availability is dependent on your client's configuration.
1299
1952
  */
1300
1953
  salesforce_opportunity_id?: string;
1954
+
1955
+ /**
1956
+ * List of filters that determine what kind of customer usage draws down a commit
1957
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1958
+ * specifiers to contribute to a commit's or credit's drawdown.
1959
+ */
1960
+ specifiers?: Array<Commit.Specifier>;
1301
1961
  }
1302
1962
 
1303
1963
  export namespace Commit {
@@ -1311,6 +1971,32 @@ export namespace ContractListResponse {
1311
1971
  id: string;
1312
1972
  }
1313
1973
 
1974
+ /**
1975
+ * Optional configuration for commit hierarchy access control
1976
+ */
1977
+ export interface HierarchyConfiguration {
1978
+ child_access:
1979
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
1980
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
1981
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1982
+ }
1983
+
1984
+ export namespace HierarchyConfiguration {
1985
+ export interface CommitHierarchyChildAccessAll {
1986
+ type: 'ALL';
1987
+ }
1988
+
1989
+ export interface CommitHierarchyChildAccessNone {
1990
+ type: 'NONE';
1991
+ }
1992
+
1993
+ export interface CommitHierarchyChildAccessContractIDs {
1994
+ contract_ids: Array<string>;
1995
+
1996
+ type: 'CONTRACT_IDS';
1997
+ }
1998
+ }
1999
+
1314
2000
  /**
1315
2001
  * The contract that this commit will be billed on.
1316
2002
  */
@@ -1386,6 +2072,16 @@ export namespace ContractListResponse {
1386
2072
  type: 'PREPAID_COMMIT_CREDITED';
1387
2073
  }
1388
2074
 
2075
+ export interface PrepaidCommitSeatBasedAdjustmentLedgerEntry {
2076
+ amount: number;
2077
+
2078
+ segment_id: string;
2079
+
2080
+ timestamp: string;
2081
+
2082
+ type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
2083
+ }
2084
+
1389
2085
  export interface PostpaidCommitInitialBalanceLedgerEntry {
1390
2086
  amount: number;
1391
2087
 
@@ -1461,6 +2157,23 @@ export namespace ContractListResponse {
1461
2157
 
1462
2158
  contract_id: string;
1463
2159
  }
2160
+
2161
+ export interface Specifier {
2162
+ presentation_group_values?: { [key: string]: string };
2163
+
2164
+ pricing_group_values?: { [key: string]: string };
2165
+
2166
+ /**
2167
+ * If provided, the specifier will only apply to the product with the specified ID.
2168
+ */
2169
+ product_id?: string;
2170
+
2171
+ /**
2172
+ * If provided, the specifier will only apply to products with all the specified
2173
+ * tags.
2174
+ */
2175
+ product_tags?: Array<string>;
2176
+ }
1464
2177
  }
1465
2178
 
1466
2179
  export interface Override {
@@ -1495,13 +2208,13 @@ export namespace ContractListResponse {
1495
2208
 
1496
2209
  export namespace Override {
1497
2210
  export interface OverrideSpecifier {
1498
- billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
2211
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1499
2212
 
1500
2213
  commit_ids?: Array<string>;
1501
2214
 
1502
- presentation_group_values?: Record<string, string | null>;
2215
+ presentation_group_values?: { [key: string]: string | null };
1503
2216
 
1504
- pricing_group_values?: Record<string, string>;
2217
+ pricing_group_values?: { [key: string]: string };
1505
2218
 
1506
2219
  product_id?: string;
1507
2220
 
@@ -1527,7 +2240,7 @@ export namespace ContractListResponse {
1527
2240
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1528
2241
  * processors.
1529
2242
  */
1530
- custom_rate?: Record<string, unknown>;
2243
+ custom_rate?: { [key: string]: unknown };
1531
2244
 
1532
2245
  /**
1533
2246
  * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
@@ -1591,7 +2304,7 @@ export namespace ContractListResponse {
1591
2304
  */
1592
2305
  billing_anchor_date: string;
1593
2306
 
1594
- frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
2307
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1595
2308
  }
1596
2309
 
1597
2310
  export interface Credit {
@@ -1626,10 +2339,15 @@ export namespace ContractListResponse {
1626
2339
 
1627
2340
  contract?: Credit.Contract;
1628
2341
 
1629
- custom_fields?: Record<string, string>;
2342
+ custom_fields?: { [key: string]: string };
1630
2343
 
1631
2344
  description?: string;
1632
2345
 
2346
+ /**
2347
+ * Optional configuration for credit hierarchy access control
2348
+ */
2349
+ hierarchy_configuration?: Credit.HierarchyConfiguration;
2350
+
1633
2351
  /**
1634
2352
  * A list of ordered events that impact the balance of a credit. For example, an
1635
2353
  * invoice deduction or an expiration.
@@ -1641,6 +2359,7 @@ export namespace ContractListResponse {
1641
2359
  | Credit.CreditCanceledLedgerEntry
1642
2360
  | Credit.CreditCreditedLedgerEntry
1643
2361
  | Credit.CreditManualLedgerEntry
2362
+ | Credit.CreditSeatBasedAdjustmentLedgerEntry
1644
2363
  >;
1645
2364
 
1646
2365
  name?: string;
@@ -1660,6 +2379,13 @@ export namespace ContractListResponse {
1660
2379
  * This field's availability is dependent on your client's configuration.
1661
2380
  */
1662
2381
  salesforce_opportunity_id?: string;
2382
+
2383
+ /**
2384
+ * List of filters that determine what kind of customer usage draws down a commit
2385
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2386
+ * specifiers to contribute to a commit's or credit's drawdown.
2387
+ */
2388
+ specifiers?: Array<Credit.Specifier>;
1663
2389
  }
1664
2390
 
1665
2391
  export namespace Credit {
@@ -1673,6 +2399,32 @@ export namespace ContractListResponse {
1673
2399
  id: string;
1674
2400
  }
1675
2401
 
2402
+ /**
2403
+ * Optional configuration for credit hierarchy access control
2404
+ */
2405
+ export interface HierarchyConfiguration {
2406
+ child_access:
2407
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
2408
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
2409
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2410
+ }
2411
+
2412
+ export namespace HierarchyConfiguration {
2413
+ export interface CommitHierarchyChildAccessAll {
2414
+ type: 'ALL';
2415
+ }
2416
+
2417
+ export interface CommitHierarchyChildAccessNone {
2418
+ type: 'NONE';
2419
+ }
2420
+
2421
+ export interface CommitHierarchyChildAccessContractIDs {
2422
+ contract_ids: Array<string>;
2423
+
2424
+ type: 'CONTRACT_IDS';
2425
+ }
2426
+ }
2427
+
1676
2428
  export interface CreditSegmentStartLedgerEntry {
1677
2429
  amount: number;
1678
2430
 
@@ -1738,6 +2490,33 @@ export namespace ContractListResponse {
1738
2490
 
1739
2491
  type: 'CREDIT_MANUAL';
1740
2492
  }
2493
+
2494
+ export interface CreditSeatBasedAdjustmentLedgerEntry {
2495
+ amount: number;
2496
+
2497
+ segment_id: string;
2498
+
2499
+ timestamp: string;
2500
+
2501
+ type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
2502
+ }
2503
+
2504
+ export interface Specifier {
2505
+ presentation_group_values?: { [key: string]: string };
2506
+
2507
+ pricing_group_values?: { [key: string]: string };
2508
+
2509
+ /**
2510
+ * If provided, the specifier will only apply to the product with the specified ID.
2511
+ */
2512
+ product_id?: string;
2513
+
2514
+ /**
2515
+ * If provided, the specifier will only apply to products with all the specified
2516
+ * tags.
2517
+ */
2518
+ product_tags?: Array<string>;
2519
+ }
1741
2520
  }
1742
2521
 
1743
2522
  /**
@@ -1757,43 +2536,247 @@ export namespace ContractListResponse {
1757
2536
  delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
1758
2537
  }
1759
2538
 
1760
- export interface RecurringCommit {
1761
- id: string;
1762
-
2539
+ /**
2540
+ * Indicates whether there are more items than the limit for this endpoint. Use the
2541
+ * respective list endpoints to get the full lists.
2542
+ */
2543
+ export interface HasMore {
1763
2544
  /**
1764
- * The amount of commit to grant.
2545
+ * Whether there are more commits on this contract than the limit for this
2546
+ * endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
2547
+ * of commits.
1765
2548
  */
1766
- access_amount: RecurringCommit.AccessAmount;
2549
+ commits: boolean;
1767
2550
 
1768
2551
  /**
1769
- * The amount of time the created commits will be valid for
2552
+ * Whether there are more credits on this contract than the limit for this
2553
+ * endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
2554
+ * of credits.
1770
2555
  */
1771
- commit_duration: RecurringCommit.CommitDuration;
2556
+ credits: boolean;
2557
+ }
1772
2558
 
2559
+ export interface ParentHierarchyConfiguration {
1773
2560
  /**
1774
- * Will be passed down to the individual commits
2561
+ * List of contracts that belong to this parent.
1775
2562
  */
1776
- priority: number;
2563
+ children: Array<ParentHierarchyConfiguration.Child>;
2564
+ }
1777
2565
 
1778
- product: RecurringCommit.Product;
2566
+ export namespace ParentHierarchyConfiguration {
2567
+ export interface Child {
2568
+ contract_id: string;
1779
2569
 
2570
+ customer_id: string;
2571
+ }
2572
+ }
2573
+
2574
+ export interface ChildHierarchyConfiguration {
1780
2575
  /**
1781
- * Whether the created commits will use the commit rate or list rate
2576
+ * The single parent contract/customer for this child.
1782
2577
  */
1783
- rate_type: 'COMMIT_RATE' | 'LIST_RATE';
2578
+ parent: ChildHierarchyConfiguration.Parent;
2579
+ }
1784
2580
 
2581
+ export namespace ChildHierarchyConfiguration {
1785
2582
  /**
1786
- * Determines the start time for the first commit
2583
+ * The single parent contract/customer for this child.
1787
2584
  */
1788
- starting_at: string;
2585
+ export interface Parent {
2586
+ contract_id: string;
2587
+
2588
+ customer_id: string;
2589
+ }
2590
+ }
2591
+
2592
+ export interface PrepaidBalanceThresholdConfiguration {
2593
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
1789
2594
 
1790
2595
  /**
1791
- * Will be passed down to the individual commits
2596
+ * When set to false, the contract will not be evaluated against the
2597
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2598
+ * regardless of prior state.
1792
2599
  */
1793
- applicable_product_ids?: Array<string>;
2600
+ is_enabled: boolean;
2601
+
2602
+ payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
1794
2603
 
1795
2604
  /**
1796
- * Will be passed down to the individual commits
2605
+ * Specify the amount the balance should be recharged to.
2606
+ */
2607
+ recharge_to_amount: number;
2608
+
2609
+ /**
2610
+ * Specify the threshold amount for the contract. Each time the contract's balance
2611
+ * lowers to this amount, a threshold charge will be initiated.
2612
+ */
2613
+ threshold_amount: number;
2614
+
2615
+ /**
2616
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
2617
+ * commit amount will be in terms of this credit type instead of the fiat currency.
2618
+ */
2619
+ custom_credit_type_id?: string;
2620
+ }
2621
+
2622
+ export namespace PrepaidBalanceThresholdConfiguration {
2623
+ export interface Commit {
2624
+ /**
2625
+ * The commit product that will be used to generate the line item for commit
2626
+ * payment.
2627
+ */
2628
+ product_id: string;
2629
+
2630
+ /**
2631
+ * Which products the threshold commit applies to. If applicable_product_ids,
2632
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2633
+ * all products.
2634
+ */
2635
+ applicable_product_ids?: Array<string>;
2636
+
2637
+ /**
2638
+ * Which tags the threshold commit applies to. If applicable_product_ids,
2639
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2640
+ * all products.
2641
+ */
2642
+ applicable_product_tags?: Array<string>;
2643
+
2644
+ description?: string;
2645
+
2646
+ /**
2647
+ * Specify the name of the line item for the threshold charge. If left blank, it
2648
+ * will default to the commit product name.
2649
+ */
2650
+ name?: string;
2651
+
2652
+ /**
2653
+ * List of filters that determine what kind of customer usage draws down a commit
2654
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2655
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2656
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2657
+ */
2658
+ specifiers?: Array<Commit.Specifier>;
2659
+ }
2660
+
2661
+ export namespace Commit {
2662
+ export interface Specifier {
2663
+ presentation_group_values?: { [key: string]: string };
2664
+
2665
+ pricing_group_values?: { [key: string]: string };
2666
+
2667
+ /**
2668
+ * If provided, the specifier will only apply to the product with the specified ID.
2669
+ */
2670
+ product_id?: string;
2671
+
2672
+ /**
2673
+ * If provided, the specifier will only apply to products with all the specified
2674
+ * tags.
2675
+ */
2676
+ product_tags?: Array<string>;
2677
+ }
2678
+ }
2679
+
2680
+ export interface PaymentGateConfig {
2681
+ /**
2682
+ * Gate access to the commit balance based on successful collection of payment.
2683
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2684
+ * facilitate payment using your own payment integration. Select NONE if you do not
2685
+ * wish to payment gate the commit balance.
2686
+ */
2687
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2688
+
2689
+ /**
2690
+ * Only applicable if using PRECALCULATED as your tax type.
2691
+ */
2692
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
2693
+
2694
+ /**
2695
+ * Only applicable if using STRIPE as your payment gateway type.
2696
+ */
2697
+ stripe_config?: PaymentGateConfig.StripeConfig;
2698
+
2699
+ /**
2700
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2701
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2702
+ * will default to NONE.
2703
+ */
2704
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
2705
+ }
2706
+
2707
+ export namespace PaymentGateConfig {
2708
+ /**
2709
+ * Only applicable if using PRECALCULATED as your tax type.
2710
+ */
2711
+ export interface PrecalculatedTaxConfig {
2712
+ /**
2713
+ * Amount of tax to be applied. This should be in the same currency and
2714
+ * denomination as the commit's invoice schedule
2715
+ */
2716
+ tax_amount: number;
2717
+
2718
+ /**
2719
+ * Name of the tax to be applied. This may be used in an invoice line item
2720
+ * description.
2721
+ */
2722
+ tax_name?: string;
2723
+ }
2724
+
2725
+ /**
2726
+ * Only applicable if using STRIPE as your payment gateway type.
2727
+ */
2728
+ export interface StripeConfig {
2729
+ /**
2730
+ * If left blank, will default to INVOICE
2731
+ */
2732
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
2733
+
2734
+ /**
2735
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2736
+ * your payment type.
2737
+ */
2738
+ invoice_metadata?: { [key: string]: string };
2739
+ }
2740
+ }
2741
+ }
2742
+
2743
+ export interface RecurringCommit {
2744
+ id: string;
2745
+
2746
+ /**
2747
+ * The amount of commit to grant.
2748
+ */
2749
+ access_amount: RecurringCommit.AccessAmount;
2750
+
2751
+ /**
2752
+ * The amount of time the created commits will be valid for
2753
+ */
2754
+ commit_duration: RecurringCommit.CommitDuration;
2755
+
2756
+ /**
2757
+ * Will be passed down to the individual commits
2758
+ */
2759
+ priority: number;
2760
+
2761
+ product: RecurringCommit.Product;
2762
+
2763
+ /**
2764
+ * Whether the created commits will use the commit rate or list rate
2765
+ */
2766
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
2767
+
2768
+ /**
2769
+ * Determines the start time for the first commit
2770
+ */
2771
+ starting_at: string;
2772
+
2773
+ /**
2774
+ * Will be passed down to the individual commits
2775
+ */
2776
+ applicable_product_ids?: Array<string>;
2777
+
2778
+ /**
2779
+ * Will be passed down to the individual commits
1797
2780
  */
1798
2781
  applicable_product_tags?: Array<string>;
1799
2782
 
@@ -1809,6 +2792,11 @@ export namespace ContractListResponse {
1809
2792
  */
1810
2793
  ending_before?: string;
1811
2794
 
2795
+ /**
2796
+ * Optional configuration for recurring commit/credit hierarchy access control
2797
+ */
2798
+ hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
2799
+
1812
2800
  /**
1813
2801
  * The amount the customer should be billed for the commit. Not required.
1814
2802
  */
@@ -1834,10 +2822,10 @@ export namespace ContractListResponse {
1834
2822
  * The frequency at which the recurring commits will be created. If not provided: -
1835
2823
  * The commits will be created on the usage invoice frequency. If provided: - The
1836
2824
  * period defined in the duration will correspond to this frequency. - Commits will
1837
- * be created aligned with the recurring commit's start_date rather than the usage
2825
+ * be created aligned with the recurring commit's starting_at rather than the usage
1838
2826
  * invoice dates.
1839
2827
  */
1840
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
2828
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1841
2829
 
1842
2830
  /**
1843
2831
  * Will be passed down to the individual commits. This controls how much of an
@@ -1845,6 +2833,13 @@ export namespace ContractListResponse {
1845
2833
  * between 0 and 1.
1846
2834
  */
1847
2835
  rollover_fraction?: number;
2836
+
2837
+ /**
2838
+ * List of filters that determine what kind of customer usage draws down a commit
2839
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2840
+ * specifiers to contribute to a commit's or credit's drawdown.
2841
+ */
2842
+ specifiers?: Array<RecurringCommit.Specifier>;
1848
2843
  }
1849
2844
 
1850
2845
  export namespace RecurringCommit {
@@ -1854,9 +2849,9 @@ export namespace ContractListResponse {
1854
2849
  export interface AccessAmount {
1855
2850
  credit_type_id: string;
1856
2851
 
1857
- quantity: number;
1858
-
1859
2852
  unit_price: number;
2853
+
2854
+ quantity?: number;
1860
2855
  }
1861
2856
 
1862
2857
  /**
@@ -1878,6 +2873,32 @@ export namespace ContractListResponse {
1878
2873
  id: string;
1879
2874
  }
1880
2875
 
2876
+ /**
2877
+ * Optional configuration for recurring commit/credit hierarchy access control
2878
+ */
2879
+ export interface HierarchyConfiguration {
2880
+ child_access:
2881
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
2882
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
2883
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2884
+ }
2885
+
2886
+ export namespace HierarchyConfiguration {
2887
+ export interface CommitHierarchyChildAccessAll {
2888
+ type: 'ALL';
2889
+ }
2890
+
2891
+ export interface CommitHierarchyChildAccessNone {
2892
+ type: 'NONE';
2893
+ }
2894
+
2895
+ export interface CommitHierarchyChildAccessContractIDs {
2896
+ contract_ids: Array<string>;
2897
+
2898
+ type: 'CONTRACT_IDS';
2899
+ }
2900
+ }
2901
+
1881
2902
  /**
1882
2903
  * The amount the customer should be billed for the commit. Not required.
1883
2904
  */
@@ -1888,6 +2909,23 @@ export namespace ContractListResponse {
1888
2909
 
1889
2910
  unit_price: number;
1890
2911
  }
2912
+
2913
+ export interface Specifier {
2914
+ presentation_group_values?: { [key: string]: string };
2915
+
2916
+ pricing_group_values?: { [key: string]: string };
2917
+
2918
+ /**
2919
+ * If provided, the specifier will only apply to the product with the specified ID.
2920
+ */
2921
+ product_id?: string;
2922
+
2923
+ /**
2924
+ * If provided, the specifier will only apply to products with all the specified
2925
+ * tags.
2926
+ */
2927
+ product_tags?: Array<string>;
2928
+ }
1891
2929
  }
1892
2930
 
1893
2931
  export interface RecurringCredit {
@@ -1942,6 +2980,11 @@ export namespace ContractListResponse {
1942
2980
  */
1943
2981
  ending_before?: string;
1944
2982
 
2983
+ /**
2984
+ * Optional configuration for recurring commit/credit hierarchy access control
2985
+ */
2986
+ hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
2987
+
1945
2988
  /**
1946
2989
  * Displayed on invoices. Will be passed through to the individual commits
1947
2990
  */
@@ -1962,10 +3005,10 @@ export namespace ContractListResponse {
1962
3005
  * The frequency at which the recurring commits will be created. If not provided: -
1963
3006
  * The commits will be created on the usage invoice frequency. If provided: - The
1964
3007
  * period defined in the duration will correspond to this frequency. - Commits will
1965
- * be created aligned with the recurring commit's start_date rather than the usage
3008
+ * be created aligned with the recurring commit's starting_at rather than the usage
1966
3009
  * invoice dates.
1967
3010
  */
1968
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
3011
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1969
3012
 
1970
3013
  /**
1971
3014
  * Will be passed down to the individual commits. This controls how much of an
@@ -1973,6 +3016,13 @@ export namespace ContractListResponse {
1973
3016
  * between 0 and 1.
1974
3017
  */
1975
3018
  rollover_fraction?: number;
3019
+
3020
+ /**
3021
+ * List of filters that determine what kind of customer usage draws down a commit
3022
+ * or credit. A customer's usage needs to meet the condition of at least one of the
3023
+ * specifiers to contribute to a commit's or credit's drawdown.
3024
+ */
3025
+ specifiers?: Array<RecurringCredit.Specifier>;
1976
3026
  }
1977
3027
 
1978
3028
  export namespace RecurringCredit {
@@ -1982,9 +3032,9 @@ export namespace ContractListResponse {
1982
3032
  export interface AccessAmount {
1983
3033
  credit_type_id: string;
1984
3034
 
1985
- quantity: number;
1986
-
1987
3035
  unit_price: number;
3036
+
3037
+ quantity?: number;
1988
3038
  }
1989
3039
 
1990
3040
  /**
@@ -2005,6 +3055,49 @@ export namespace ContractListResponse {
2005
3055
  export interface Contract {
2006
3056
  id: string;
2007
3057
  }
3058
+
3059
+ /**
3060
+ * Optional configuration for recurring commit/credit hierarchy access control
3061
+ */
3062
+ export interface HierarchyConfiguration {
3063
+ child_access:
3064
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
3065
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
3066
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
3067
+ }
3068
+
3069
+ export namespace HierarchyConfiguration {
3070
+ export interface CommitHierarchyChildAccessAll {
3071
+ type: 'ALL';
3072
+ }
3073
+
3074
+ export interface CommitHierarchyChildAccessNone {
3075
+ type: 'NONE';
3076
+ }
3077
+
3078
+ export interface CommitHierarchyChildAccessContractIDs {
3079
+ contract_ids: Array<string>;
3080
+
3081
+ type: 'CONTRACT_IDS';
3082
+ }
3083
+ }
3084
+
3085
+ export interface Specifier {
3086
+ presentation_group_values?: { [key: string]: string };
3087
+
3088
+ pricing_group_values?: { [key: string]: string };
3089
+
3090
+ /**
3091
+ * If provided, the specifier will only apply to the product with the specified ID.
3092
+ */
3093
+ product_id?: string;
3094
+
3095
+ /**
3096
+ * If provided, the specifier will only apply to products with all the specified
3097
+ * tags.
3098
+ */
3099
+ product_tags?: Array<string>;
3100
+ }
2008
3101
  }
2009
3102
 
2010
3103
  export interface ResellerRoyalty {
@@ -2043,21 +3136,130 @@ export namespace ContractListResponse {
2043
3136
  }
2044
3137
  }
2045
3138
 
3139
+ export interface SpendThresholdConfiguration {
3140
+ commit: SpendThresholdConfiguration.Commit;
3141
+
3142
+ /**
3143
+ * When set to false, the contract will not be evaluated against the
3144
+ * threshold_amount. Toggling to true will result an immediate evaluation,
3145
+ * regardless of prior state.
3146
+ */
3147
+ is_enabled: boolean;
3148
+
3149
+ payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
3150
+
3151
+ /**
3152
+ * Specify the threshold amount for the contract. Each time the contract's usage
3153
+ * hits this amount, a threshold charge will be initiated.
3154
+ */
3155
+ threshold_amount: number;
3156
+ }
3157
+
3158
+ export namespace SpendThresholdConfiguration {
3159
+ export interface Commit {
3160
+ /**
3161
+ * The commit product that will be used to generate the line item for commit
3162
+ * payment.
3163
+ */
3164
+ product_id: string;
3165
+
3166
+ description?: string;
3167
+
3168
+ /**
3169
+ * Specify the name of the line item for the threshold charge. If left blank, it
3170
+ * will default to the commit product name.
3171
+ */
3172
+ name?: string;
3173
+ }
3174
+
3175
+ export interface PaymentGateConfig {
3176
+ /**
3177
+ * Gate access to the commit balance based on successful collection of payment.
3178
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
3179
+ * facilitate payment using your own payment integration. Select NONE if you do not
3180
+ * wish to payment gate the commit balance.
3181
+ */
3182
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
3183
+
3184
+ /**
3185
+ * Only applicable if using PRECALCULATED as your tax type.
3186
+ */
3187
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
3188
+
3189
+ /**
3190
+ * Only applicable if using STRIPE as your payment gateway type.
3191
+ */
3192
+ stripe_config?: PaymentGateConfig.StripeConfig;
3193
+
3194
+ /**
3195
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
3196
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
3197
+ * will default to NONE.
3198
+ */
3199
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
3200
+ }
3201
+
3202
+ export namespace PaymentGateConfig {
3203
+ /**
3204
+ * Only applicable if using PRECALCULATED as your tax type.
3205
+ */
3206
+ export interface PrecalculatedTaxConfig {
3207
+ /**
3208
+ * Amount of tax to be applied. This should be in the same currency and
3209
+ * denomination as the commit's invoice schedule
3210
+ */
3211
+ tax_amount: number;
3212
+
3213
+ /**
3214
+ * Name of the tax to be applied. This may be used in an invoice line item
3215
+ * description.
3216
+ */
3217
+ tax_name?: string;
3218
+ }
3219
+
3220
+ /**
3221
+ * Only applicable if using STRIPE as your payment gateway type.
3222
+ */
3223
+ export interface StripeConfig {
3224
+ /**
3225
+ * If left blank, will default to INVOICE
3226
+ */
3227
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
3228
+
3229
+ /**
3230
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
3231
+ * your payment type.
3232
+ */
3233
+ invoice_metadata?: { [key: string]: string };
3234
+ }
3235
+ }
3236
+ }
3237
+
2046
3238
  export interface Subscription {
2047
3239
  collection_schedule: 'ADVANCE' | 'ARREARS';
2048
3240
 
2049
3241
  proration: Subscription.Proration;
2050
3242
 
3243
+ /**
3244
+ * List of quantity schedule items for the subscription. Only includes the current
3245
+ * quantity and future quantity changes.
3246
+ */
2051
3247
  quantity_schedule: Array<Subscription.QuantitySchedule>;
2052
3248
 
2053
3249
  starting_at: string;
2054
3250
 
2055
3251
  subscription_rate: Subscription.SubscriptionRate;
2056
3252
 
3253
+ id?: string;
3254
+
3255
+ custom_fields?: { [key: string]: string };
3256
+
2057
3257
  description?: string;
2058
3258
 
2059
3259
  ending_before?: string;
2060
3260
 
3261
+ fiat_credit_type_id?: string;
3262
+
2061
3263
  name?: string;
2062
3264
  }
2063
3265
 
@@ -2077,7 +3279,7 @@ export namespace ContractListResponse {
2077
3279
  }
2078
3280
 
2079
3281
  export interface SubscriptionRate {
2080
- billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
3282
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2081
3283
 
2082
3284
  product: SubscriptionRate.Product;
2083
3285
  }
@@ -2090,50 +3292,6 @@ export namespace ContractListResponse {
2090
3292
  }
2091
3293
  }
2092
3294
  }
2093
-
2094
- export interface ThresholdBillingConfiguration {
2095
- commit: ThresholdBillingConfiguration.Commit;
2096
-
2097
- /**
2098
- * When set to false, the contract will not be evaluated against the
2099
- * threshold_amount. Toggling to true will result an immediate evaluation,
2100
- * regardless of prior state
2101
- */
2102
- is_enabled: boolean;
2103
-
2104
- /**
2105
- * Specify the threshold amount for the contract. Each time the contract's usage
2106
- * hits this amount, a threshold charge will be initiated.
2107
- */
2108
- threshold_amount: number;
2109
- }
2110
-
2111
- export namespace ThresholdBillingConfiguration {
2112
- export interface Commit {
2113
- product_id: string;
2114
-
2115
- /**
2116
- * Which products the threshold commit applies to. If both applicable_product_ids
2117
- * and applicable_product_tags are not provided, the commit applies to all
2118
- * products.
2119
- */
2120
- applicable_product_ids?: Array<string>;
2121
-
2122
- /**
2123
- * Which tags the threshold commit applies to. If both applicable_product_ids and
2124
- * applicable_product_tags are not provided, the commit applies to all products.
2125
- */
2126
- applicable_product_tags?: Array<string>;
2127
-
2128
- description?: string;
2129
-
2130
- /**
2131
- * Specify the name of the line item for the threshold charge. If left blank, it
2132
- * will default to the commit product name.
2133
- */
2134
- name?: string;
2135
- }
2136
- }
2137
3295
  }
2138
3296
  }
2139
3297
 
@@ -2165,6 +3323,8 @@ export namespace ContractGetEditHistoryResponse {
2165
3323
 
2166
3324
  add_overrides?: Array<Data.AddOverride>;
2167
3325
 
3326
+ add_prepaid_balance_threshold_configuration?: Data.AddPrepaidBalanceThresholdConfiguration;
3327
+
2168
3328
  add_pro_services?: Array<Shared.ProService>;
2169
3329
 
2170
3330
  add_recurring_commits?: Array<Data.AddRecurringCommit>;
@@ -2175,21 +3335,55 @@ export namespace ContractGetEditHistoryResponse {
2175
3335
 
2176
3336
  add_scheduled_charges?: Array<Data.AddScheduledCharge>;
2177
3337
 
3338
+ add_spend_threshold_configuration?: Data.AddSpendThresholdConfiguration;
3339
+
3340
+ /**
3341
+ * List of subscriptions on the contract.
3342
+ */
3343
+ add_subscriptions?: Array<Data.AddSubscription>;
3344
+
2178
3345
  add_usage_filters?: Array<Data.AddUsageFilter>;
2179
3346
 
3347
+ archive_commits?: Array<Data.ArchiveCommit>;
3348
+
3349
+ archive_credits?: Array<Data.ArchiveCredit>;
3350
+
3351
+ archive_scheduled_charges?: Array<Data.ArchiveScheduledCharge>;
3352
+
3353
+ remove_overrides?: Array<Data.RemoveOverride>;
3354
+
2180
3355
  timestamp?: string;
2181
3356
 
2182
3357
  update_commits?: Array<Data.UpdateCommit>;
2183
3358
 
2184
3359
  update_contract_end_date?: string;
2185
3360
 
3361
+ /**
3362
+ * Value to update the contract name to. If not provided, the contract name will
3363
+ * remain unchanged.
3364
+ */
3365
+ update_contract_name?: string | null;
3366
+
2186
3367
  update_credits?: Array<Data.UpdateCredit>;
2187
3368
 
2188
3369
  update_discounts?: Array<Data.UpdateDiscount>;
2189
3370
 
3371
+ update_prepaid_balance_threshold_configuration?: Data.UpdatePrepaidBalanceThresholdConfiguration;
3372
+
3373
+ update_recurring_commits?: Array<Data.UpdateRecurringCommit>;
3374
+
3375
+ update_recurring_credits?: Array<Data.UpdateRecurringCredit>;
3376
+
2190
3377
  update_refund_invoices?: Array<Data.UpdateRefundInvoice>;
2191
3378
 
2192
3379
  update_scheduled_charges?: Array<Data.UpdateScheduledCharge>;
3380
+
3381
+ update_spend_threshold_configuration?: Data.UpdateSpendThresholdConfiguration;
3382
+
3383
+ /**
3384
+ * Optional list of subscriptions to update.
3385
+ */
3386
+ update_subscriptions?: Array<Data.UpdateSubscription>;
2193
3387
  }
2194
3388
 
2195
3389
  export namespace Data {
@@ -2238,6 +3432,14 @@ export namespace ContractGetEditHistoryResponse {
2238
3432
  * This field's availability is dependent on your client's configuration.
2239
3433
  */
2240
3434
  salesforce_opportunity_id?: string;
3435
+
3436
+ /**
3437
+ * List of filters that determine what kind of customer usage draws down a commit
3438
+ * or credit. A customer's usage needs to meet the condition of at least one of the
3439
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
3440
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
3441
+ */
3442
+ specifiers?: Array<AddCommit.Specifier>;
2241
3443
  }
2242
3444
 
2243
3445
  export namespace AddCommit {
@@ -2246,6 +3448,23 @@ export namespace ContractGetEditHistoryResponse {
2246
3448
 
2247
3449
  name: string;
2248
3450
  }
3451
+
3452
+ export interface Specifier {
3453
+ presentation_group_values?: { [key: string]: string };
3454
+
3455
+ pricing_group_values?: { [key: string]: string };
3456
+
3457
+ /**
3458
+ * If provided, the specifier will only apply to the product with the specified ID.
3459
+ */
3460
+ product_id?: string;
3461
+
3462
+ /**
3463
+ * If provided, the specifier will only apply to products with all the specified
3464
+ * tags.
3465
+ */
3466
+ product_tags?: Array<string>;
3467
+ }
2249
3468
  }
2250
3469
 
2251
3470
  export interface AddCredit {
@@ -2283,6 +3502,14 @@ export namespace ContractGetEditHistoryResponse {
2283
3502
  * This field's availability is dependent on your client's configuration.
2284
3503
  */
2285
3504
  salesforce_opportunity_id?: string;
3505
+
3506
+ /**
3507
+ * List of filters that determine what kind of customer usage draws down a commit
3508
+ * or credit. A customer's usage needs to meet the condition of at least one of the
3509
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
3510
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
3511
+ */
3512
+ specifiers?: Array<AddCredit.Specifier>;
2286
3513
  }
2287
3514
 
2288
3515
  export namespace AddCredit {
@@ -2291,6 +3518,23 @@ export namespace ContractGetEditHistoryResponse {
2291
3518
 
2292
3519
  name: string;
2293
3520
  }
3521
+
3522
+ export interface Specifier {
3523
+ presentation_group_values?: { [key: string]: string };
3524
+
3525
+ pricing_group_values?: { [key: string]: string };
3526
+
3527
+ /**
3528
+ * If provided, the specifier will only apply to the product with the specified ID.
3529
+ */
3530
+ product_id?: string;
3531
+
3532
+ /**
3533
+ * If provided, the specifier will only apply to products with all the specified
3534
+ * tags.
3535
+ */
3536
+ product_tags?: Array<string>;
3537
+ }
2294
3538
  }
2295
3539
 
2296
3540
  export interface AddOverride {
@@ -2325,13 +3569,13 @@ export namespace ContractGetEditHistoryResponse {
2325
3569
 
2326
3570
  export namespace AddOverride {
2327
3571
  export interface OverrideSpecifier {
2328
- billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
3572
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2329
3573
 
2330
3574
  commit_ids?: Array<string>;
2331
3575
 
2332
- presentation_group_values?: Record<string, string | null>;
3576
+ presentation_group_values?: { [key: string]: string | null };
2333
3577
 
2334
- pricing_group_values?: Record<string, string>;
3578
+ pricing_group_values?: { [key: string]: string };
2335
3579
 
2336
3580
  product_id?: string;
2337
3581
 
@@ -2357,7 +3601,7 @@ export namespace ContractGetEditHistoryResponse {
2357
3601
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
2358
3602
  * processors.
2359
3603
  */
2360
- custom_rate?: Record<string, unknown>;
3604
+ custom_rate?: { [key: string]: unknown };
2361
3605
 
2362
3606
  /**
2363
3607
  * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
@@ -2389,6 +3633,157 @@ export namespace ContractGetEditHistoryResponse {
2389
3633
  }
2390
3634
  }
2391
3635
 
3636
+ export interface AddPrepaidBalanceThresholdConfiguration {
3637
+ commit: AddPrepaidBalanceThresholdConfiguration.Commit;
3638
+
3639
+ /**
3640
+ * When set to false, the contract will not be evaluated against the
3641
+ * threshold_amount. Toggling to true will result an immediate evaluation,
3642
+ * regardless of prior state.
3643
+ */
3644
+ is_enabled: boolean;
3645
+
3646
+ payment_gate_config: AddPrepaidBalanceThresholdConfiguration.PaymentGateConfig;
3647
+
3648
+ /**
3649
+ * Specify the amount the balance should be recharged to.
3650
+ */
3651
+ recharge_to_amount: number;
3652
+
3653
+ /**
3654
+ * Specify the threshold amount for the contract. Each time the contract's balance
3655
+ * lowers to this amount, a threshold charge will be initiated.
3656
+ */
3657
+ threshold_amount: number;
3658
+
3659
+ /**
3660
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
3661
+ * commit amount will be in terms of this credit type instead of the fiat currency.
3662
+ */
3663
+ custom_credit_type_id?: string;
3664
+ }
3665
+
3666
+ export namespace AddPrepaidBalanceThresholdConfiguration {
3667
+ export interface Commit {
3668
+ /**
3669
+ * The commit product that will be used to generate the line item for commit
3670
+ * payment.
3671
+ */
3672
+ product_id: string;
3673
+
3674
+ /**
3675
+ * Which products the threshold commit applies to. If applicable_product_ids,
3676
+ * applicable_product_tags or specifiers are not provided, the commit applies to
3677
+ * all products.
3678
+ */
3679
+ applicable_product_ids?: Array<string>;
3680
+
3681
+ /**
3682
+ * Which tags the threshold commit applies to. If applicable_product_ids,
3683
+ * applicable_product_tags or specifiers are not provided, the commit applies to
3684
+ * all products.
3685
+ */
3686
+ applicable_product_tags?: Array<string>;
3687
+
3688
+ description?: string;
3689
+
3690
+ /**
3691
+ * Specify the name of the line item for the threshold charge. If left blank, it
3692
+ * will default to the commit product name.
3693
+ */
3694
+ name?: string;
3695
+
3696
+ /**
3697
+ * List of filters that determine what kind of customer usage draws down a commit
3698
+ * or credit. A customer's usage needs to meet the condition of at least one of the
3699
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
3700
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
3701
+ */
3702
+ specifiers?: Array<Commit.Specifier>;
3703
+ }
3704
+
3705
+ export namespace Commit {
3706
+ export interface Specifier {
3707
+ presentation_group_values?: { [key: string]: string };
3708
+
3709
+ pricing_group_values?: { [key: string]: string };
3710
+
3711
+ /**
3712
+ * If provided, the specifier will only apply to the product with the specified ID.
3713
+ */
3714
+ product_id?: string;
3715
+
3716
+ /**
3717
+ * If provided, the specifier will only apply to products with all the specified
3718
+ * tags.
3719
+ */
3720
+ product_tags?: Array<string>;
3721
+ }
3722
+ }
3723
+
3724
+ export interface PaymentGateConfig {
3725
+ /**
3726
+ * Gate access to the commit balance based on successful collection of payment.
3727
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
3728
+ * facilitate payment using your own payment integration. Select NONE if you do not
3729
+ * wish to payment gate the commit balance.
3730
+ */
3731
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
3732
+
3733
+ /**
3734
+ * Only applicable if using PRECALCULATED as your tax type.
3735
+ */
3736
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
3737
+
3738
+ /**
3739
+ * Only applicable if using STRIPE as your payment gateway type.
3740
+ */
3741
+ stripe_config?: PaymentGateConfig.StripeConfig;
3742
+
3743
+ /**
3744
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
3745
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
3746
+ * will default to NONE.
3747
+ */
3748
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
3749
+ }
3750
+
3751
+ export namespace PaymentGateConfig {
3752
+ /**
3753
+ * Only applicable if using PRECALCULATED as your tax type.
3754
+ */
3755
+ export interface PrecalculatedTaxConfig {
3756
+ /**
3757
+ * Amount of tax to be applied. This should be in the same currency and
3758
+ * denomination as the commit's invoice schedule
3759
+ */
3760
+ tax_amount: number;
3761
+
3762
+ /**
3763
+ * Name of the tax to be applied. This may be used in an invoice line item
3764
+ * description.
3765
+ */
3766
+ tax_name?: string;
3767
+ }
3768
+
3769
+ /**
3770
+ * Only applicable if using STRIPE as your payment gateway type.
3771
+ */
3772
+ export interface StripeConfig {
3773
+ /**
3774
+ * If left blank, will default to INVOICE
3775
+ */
3776
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
3777
+
3778
+ /**
3779
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
3780
+ * your payment type.
3781
+ */
3782
+ invoice_metadata?: { [key: string]: string };
3783
+ }
3784
+ }
3785
+ }
3786
+
2392
3787
  export interface AddRecurringCommit {
2393
3788
  id: string;
2394
3789
 
@@ -2441,6 +3836,11 @@ export namespace ContractGetEditHistoryResponse {
2441
3836
  */
2442
3837
  ending_before?: string;
2443
3838
 
3839
+ /**
3840
+ * Optional configuration for recurring commit/credit hierarchy access control
3841
+ */
3842
+ hierarchy_configuration?: AddRecurringCommit.HierarchyConfiguration;
3843
+
2444
3844
  /**
2445
3845
  * The amount the customer should be billed for the commit. Not required.
2446
3846
  */
@@ -2466,10 +3866,10 @@ export namespace ContractGetEditHistoryResponse {
2466
3866
  * The frequency at which the recurring commits will be created. If not provided: -
2467
3867
  * The commits will be created on the usage invoice frequency. If provided: - The
2468
3868
  * period defined in the duration will correspond to this frequency. - Commits will
2469
- * be created aligned with the recurring commit's start_date rather than the usage
3869
+ * be created aligned with the recurring commit's starting_at rather than the usage
2470
3870
  * invoice dates.
2471
3871
  */
2472
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
3872
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2473
3873
 
2474
3874
  /**
2475
3875
  * Will be passed down to the individual commits. This controls how much of an
@@ -2477,6 +3877,13 @@ export namespace ContractGetEditHistoryResponse {
2477
3877
  * between 0 and 1.
2478
3878
  */
2479
3879
  rollover_fraction?: number;
3880
+
3881
+ /**
3882
+ * List of filters that determine what kind of customer usage draws down a commit
3883
+ * or credit. A customer's usage needs to meet the condition of at least one of the
3884
+ * specifiers to contribute to a commit's or credit's drawdown.
3885
+ */
3886
+ specifiers?: Array<AddRecurringCommit.Specifier>;
2480
3887
  }
2481
3888
 
2482
3889
  export namespace AddRecurringCommit {
@@ -2486,9 +3893,9 @@ export namespace ContractGetEditHistoryResponse {
2486
3893
  export interface AccessAmount {
2487
3894
  credit_type_id: string;
2488
3895
 
2489
- quantity: number;
2490
-
2491
3896
  unit_price: number;
3897
+
3898
+ quantity?: number;
2492
3899
  }
2493
3900
 
2494
3901
  /**
@@ -2510,6 +3917,32 @@ export namespace ContractGetEditHistoryResponse {
2510
3917
  id: string;
2511
3918
  }
2512
3919
 
3920
+ /**
3921
+ * Optional configuration for recurring commit/credit hierarchy access control
3922
+ */
3923
+ export interface HierarchyConfiguration {
3924
+ child_access:
3925
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
3926
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
3927
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
3928
+ }
3929
+
3930
+ export namespace HierarchyConfiguration {
3931
+ export interface CommitHierarchyChildAccessAll {
3932
+ type: 'ALL';
3933
+ }
3934
+
3935
+ export interface CommitHierarchyChildAccessNone {
3936
+ type: 'NONE';
3937
+ }
3938
+
3939
+ export interface CommitHierarchyChildAccessContractIDs {
3940
+ contract_ids: Array<string>;
3941
+
3942
+ type: 'CONTRACT_IDS';
3943
+ }
3944
+ }
3945
+
2513
3946
  /**
2514
3947
  * The amount the customer should be billed for the commit. Not required.
2515
3948
  */
@@ -2520,6 +3953,23 @@ export namespace ContractGetEditHistoryResponse {
2520
3953
 
2521
3954
  unit_price: number;
2522
3955
  }
3956
+
3957
+ export interface Specifier {
3958
+ presentation_group_values?: { [key: string]: string };
3959
+
3960
+ pricing_group_values?: { [key: string]: string };
3961
+
3962
+ /**
3963
+ * If provided, the specifier will only apply to the product with the specified ID.
3964
+ */
3965
+ product_id?: string;
3966
+
3967
+ /**
3968
+ * If provided, the specifier will only apply to products with all the specified
3969
+ * tags.
3970
+ */
3971
+ product_tags?: Array<string>;
3972
+ }
2523
3973
  }
2524
3974
 
2525
3975
  export interface AddRecurringCredit {
@@ -2574,6 +4024,11 @@ export namespace ContractGetEditHistoryResponse {
2574
4024
  */
2575
4025
  ending_before?: string;
2576
4026
 
4027
+ /**
4028
+ * Optional configuration for recurring commit/credit hierarchy access control
4029
+ */
4030
+ hierarchy_configuration?: AddRecurringCredit.HierarchyConfiguration;
4031
+
2577
4032
  /**
2578
4033
  * Displayed on invoices. Will be passed through to the individual commits
2579
4034
  */
@@ -2594,10 +4049,10 @@ export namespace ContractGetEditHistoryResponse {
2594
4049
  * The frequency at which the recurring commits will be created. If not provided: -
2595
4050
  * The commits will be created on the usage invoice frequency. If provided: - The
2596
4051
  * period defined in the duration will correspond to this frequency. - Commits will
2597
- * be created aligned with the recurring commit's start_date rather than the usage
4052
+ * be created aligned with the recurring commit's starting_at rather than the usage
2598
4053
  * invoice dates.
2599
4054
  */
2600
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
4055
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2601
4056
 
2602
4057
  /**
2603
4058
  * Will be passed down to the individual commits. This controls how much of an
@@ -2605,6 +4060,13 @@ export namespace ContractGetEditHistoryResponse {
2605
4060
  * between 0 and 1.
2606
4061
  */
2607
4062
  rollover_fraction?: number;
4063
+
4064
+ /**
4065
+ * List of filters that determine what kind of customer usage draws down a commit
4066
+ * or credit. A customer's usage needs to meet the condition of at least one of the
4067
+ * specifiers to contribute to a commit's or credit's drawdown.
4068
+ */
4069
+ specifiers?: Array<AddRecurringCredit.Specifier>;
2608
4070
  }
2609
4071
 
2610
4072
  export namespace AddRecurringCredit {
@@ -2614,9 +4076,9 @@ export namespace ContractGetEditHistoryResponse {
2614
4076
  export interface AccessAmount {
2615
4077
  credit_type_id: string;
2616
4078
 
2617
- quantity: number;
2618
-
2619
4079
  unit_price: number;
4080
+
4081
+ quantity?: number;
2620
4082
  }
2621
4083
 
2622
4084
  /**
@@ -2625,17 +4087,60 @@ export namespace ContractGetEditHistoryResponse {
2625
4087
  export interface CommitDuration {
2626
4088
  value: number;
2627
4089
 
2628
- unit?: 'PERIODS';
4090
+ unit?: 'PERIODS';
4091
+ }
4092
+
4093
+ export interface Product {
4094
+ id: string;
4095
+
4096
+ name: string;
4097
+ }
4098
+
4099
+ export interface Contract {
4100
+ id: string;
4101
+ }
4102
+
4103
+ /**
4104
+ * Optional configuration for recurring commit/credit hierarchy access control
4105
+ */
4106
+ export interface HierarchyConfiguration {
4107
+ child_access:
4108
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
4109
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
4110
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2629
4111
  }
2630
4112
 
2631
- export interface Product {
2632
- id: string;
4113
+ export namespace HierarchyConfiguration {
4114
+ export interface CommitHierarchyChildAccessAll {
4115
+ type: 'ALL';
4116
+ }
2633
4117
 
2634
- name: string;
4118
+ export interface CommitHierarchyChildAccessNone {
4119
+ type: 'NONE';
4120
+ }
4121
+
4122
+ export interface CommitHierarchyChildAccessContractIDs {
4123
+ contract_ids: Array<string>;
4124
+
4125
+ type: 'CONTRACT_IDS';
4126
+ }
2635
4127
  }
2636
4128
 
2637
- export interface Contract {
2638
- id: string;
4129
+ export interface Specifier {
4130
+ presentation_group_values?: { [key: string]: string };
4131
+
4132
+ pricing_group_values?: { [key: string]: string };
4133
+
4134
+ /**
4135
+ * If provided, the specifier will only apply to the product with the specified ID.
4136
+ */
4137
+ product_id?: string;
4138
+
4139
+ /**
4140
+ * If provided, the specifier will only apply to products with all the specified
4141
+ * tags.
4142
+ */
4143
+ product_tags?: Array<string>;
2639
4144
  }
2640
4145
  }
2641
4146
 
@@ -2693,6 +4198,163 @@ export namespace ContractGetEditHistoryResponse {
2693
4198
  }
2694
4199
  }
2695
4200
 
4201
+ export interface AddSpendThresholdConfiguration {
4202
+ commit: AddSpendThresholdConfiguration.Commit;
4203
+
4204
+ /**
4205
+ * When set to false, the contract will not be evaluated against the
4206
+ * threshold_amount. Toggling to true will result an immediate evaluation,
4207
+ * regardless of prior state.
4208
+ */
4209
+ is_enabled: boolean;
4210
+
4211
+ payment_gate_config: AddSpendThresholdConfiguration.PaymentGateConfig;
4212
+
4213
+ /**
4214
+ * Specify the threshold amount for the contract. Each time the contract's usage
4215
+ * hits this amount, a threshold charge will be initiated.
4216
+ */
4217
+ threshold_amount: number;
4218
+ }
4219
+
4220
+ export namespace AddSpendThresholdConfiguration {
4221
+ export interface Commit {
4222
+ /**
4223
+ * The commit product that will be used to generate the line item for commit
4224
+ * payment.
4225
+ */
4226
+ product_id: string;
4227
+
4228
+ description?: string;
4229
+
4230
+ /**
4231
+ * Specify the name of the line item for the threshold charge. If left blank, it
4232
+ * will default to the commit product name.
4233
+ */
4234
+ name?: string;
4235
+ }
4236
+
4237
+ export interface PaymentGateConfig {
4238
+ /**
4239
+ * Gate access to the commit balance based on successful collection of payment.
4240
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
4241
+ * facilitate payment using your own payment integration. Select NONE if you do not
4242
+ * wish to payment gate the commit balance.
4243
+ */
4244
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
4245
+
4246
+ /**
4247
+ * Only applicable if using PRECALCULATED as your tax type.
4248
+ */
4249
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
4250
+
4251
+ /**
4252
+ * Only applicable if using STRIPE as your payment gateway type.
4253
+ */
4254
+ stripe_config?: PaymentGateConfig.StripeConfig;
4255
+
4256
+ /**
4257
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
4258
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
4259
+ * will default to NONE.
4260
+ */
4261
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
4262
+ }
4263
+
4264
+ export namespace PaymentGateConfig {
4265
+ /**
4266
+ * Only applicable if using PRECALCULATED as your tax type.
4267
+ */
4268
+ export interface PrecalculatedTaxConfig {
4269
+ /**
4270
+ * Amount of tax to be applied. This should be in the same currency and
4271
+ * denomination as the commit's invoice schedule
4272
+ */
4273
+ tax_amount: number;
4274
+
4275
+ /**
4276
+ * Name of the tax to be applied. This may be used in an invoice line item
4277
+ * description.
4278
+ */
4279
+ tax_name?: string;
4280
+ }
4281
+
4282
+ /**
4283
+ * Only applicable if using STRIPE as your payment gateway type.
4284
+ */
4285
+ export interface StripeConfig {
4286
+ /**
4287
+ * If left blank, will default to INVOICE
4288
+ */
4289
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
4290
+
4291
+ /**
4292
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
4293
+ * your payment type.
4294
+ */
4295
+ invoice_metadata?: { [key: string]: string };
4296
+ }
4297
+ }
4298
+ }
4299
+
4300
+ export interface AddSubscription {
4301
+ collection_schedule: 'ADVANCE' | 'ARREARS';
4302
+
4303
+ proration: AddSubscription.Proration;
4304
+
4305
+ /**
4306
+ * List of quantity schedule items for the subscription. Only includes the current
4307
+ * quantity and future quantity changes.
4308
+ */
4309
+ quantity_schedule: Array<AddSubscription.QuantitySchedule>;
4310
+
4311
+ starting_at: string;
4312
+
4313
+ subscription_rate: AddSubscription.SubscriptionRate;
4314
+
4315
+ id?: string;
4316
+
4317
+ custom_fields?: { [key: string]: string };
4318
+
4319
+ description?: string;
4320
+
4321
+ ending_before?: string;
4322
+
4323
+ fiat_credit_type_id?: string;
4324
+
4325
+ name?: string;
4326
+ }
4327
+
4328
+ export namespace AddSubscription {
4329
+ export interface Proration {
4330
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
4331
+
4332
+ is_prorated: boolean;
4333
+ }
4334
+
4335
+ export interface QuantitySchedule {
4336
+ quantity: number;
4337
+
4338
+ starting_at: string;
4339
+
4340
+ ending_before?: string;
4341
+ }
4342
+
4343
+ export interface SubscriptionRate {
4344
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
4345
+
4346
+ product: SubscriptionRate.Product;
4347
+ }
4348
+
4349
+ export namespace SubscriptionRate {
4350
+ export interface Product {
4351
+ id: string;
4352
+
4353
+ name: string;
4354
+ }
4355
+ }
4356
+ }
4357
+
2696
4358
  export interface AddUsageFilter {
2697
4359
  group_key: string;
2698
4360
 
@@ -2711,20 +4373,38 @@ export namespace ContractGetEditHistoryResponse {
2711
4373
  ending_before?: string;
2712
4374
  }
2713
4375
 
4376
+ export interface ArchiveCommit {
4377
+ id: string;
4378
+ }
4379
+
4380
+ export interface ArchiveCredit {
4381
+ id: string;
4382
+ }
4383
+
4384
+ export interface ArchiveScheduledCharge {
4385
+ id: string;
4386
+ }
4387
+
4388
+ export interface RemoveOverride {
4389
+ id: string;
4390
+ }
4391
+
2714
4392
  export interface UpdateCommit {
2715
4393
  id: string;
2716
4394
 
2717
4395
  access_schedule?: UpdateCommit.AccessSchedule;
2718
4396
 
2719
4397
  /**
2720
- * Which products the commit applies to. If both applicable_product_ids and
2721
- * applicable_product_tags are not provided, the commit applies to all products.
4398
+ * Which products the commit applies to. If applicable_product_ids,
4399
+ * applicable_product_tags or specifiers are not provided, the commit applies to
4400
+ * all products.
2722
4401
  */
2723
4402
  applicable_product_ids?: Array<string> | null;
2724
4403
 
2725
4404
  /**
2726
- * Which tags the commit applies to. If both applicable_product_ids and
2727
- * applicable_product_tags are not provided, the commit applies to all products.
4405
+ * Which tags the commit applies to. If applicable_product_ids,
4406
+ * applicable_product_tags or specifiers are not provided, the commit applies to
4407
+ * all products.
2728
4408
  */
2729
4409
  applicable_product_tags?: Array<string> | null;
2730
4410
 
@@ -2737,6 +4417,14 @@ export namespace ContractGetEditHistoryResponse {
2737
4417
  product_id?: string;
2738
4418
 
2739
4419
  rollover_fraction?: number | null;
4420
+
4421
+ /**
4422
+ * List of filters that determine what kind of customer usage draws down a commit
4423
+ * or credit. A customer's usage needs to meet the condition of at least one of the
4424
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
4425
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
4426
+ */
4427
+ specifiers?: Array<UpdateCommit.Specifier> | null;
2740
4428
  }
2741
4429
 
2742
4430
  export namespace UpdateCommit {
@@ -2819,6 +4507,23 @@ export namespace ContractGetEditHistoryResponse {
2819
4507
  unit_price?: number;
2820
4508
  }
2821
4509
  }
4510
+
4511
+ export interface Specifier {
4512
+ presentation_group_values?: { [key: string]: string };
4513
+
4514
+ pricing_group_values?: { [key: string]: string };
4515
+
4516
+ /**
4517
+ * If provided, the specifier will only apply to the product with the specified ID.
4518
+ */
4519
+ product_id?: string;
4520
+
4521
+ /**
4522
+ * If provided, the specifier will only apply to products with all the specified
4523
+ * tags.
4524
+ */
4525
+ product_tags?: Array<string>;
4526
+ }
2822
4527
  }
2823
4528
 
2824
4529
  export interface UpdateCredit {
@@ -2882,7 +4587,7 @@ export namespace ContractGetEditHistoryResponse {
2882
4587
  export interface UpdateDiscount {
2883
4588
  id: string;
2884
4589
 
2885
- custom_fields?: Record<string, string>;
4590
+ custom_fields?: { [key: string]: string };
2886
4591
 
2887
4592
  name?: string;
2888
4593
 
@@ -2931,7 +4636,7 @@ export namespace ContractGetEditHistoryResponse {
2931
4636
  */
2932
4637
  ending_before: string;
2933
4638
 
2934
- frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL';
4639
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
2935
4640
 
2936
4641
  /**
2937
4642
  * RFC 3339 timestamp (inclusive).
@@ -2967,29 +4672,219 @@ export namespace ContractGetEditHistoryResponse {
2967
4672
  timestamp: string;
2968
4673
 
2969
4674
  /**
2970
- * Amount for the charge. Can be provided instead of unit_price and quantity. If
2971
- * amount is sent, the unit_price is assumed to be the amount and quantity is
2972
- * inferred to be 1.
4675
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
4676
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
4677
+ * inferred to be 1.
4678
+ */
4679
+ amount?: number;
4680
+
4681
+ /**
4682
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
4683
+ * amount and must be specified with unit_price. If specified amount cannot be
4684
+ * provided.
4685
+ */
4686
+ quantity?: number;
4687
+
4688
+ /**
4689
+ * Unit price for the charge. Will be multiplied by quantity to determine the
4690
+ * amount and must be specified with quantity. If specified amount cannot be
4691
+ * provided.
4692
+ */
4693
+ unit_price?: number;
4694
+ }
4695
+ }
4696
+ }
4697
+
4698
+ export interface UpdatePrepaidBalanceThresholdConfiguration {
4699
+ commit?: UpdatePrepaidBalanceThresholdConfiguration.Commit;
4700
+
4701
+ /**
4702
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
4703
+ * commit amount will be in terms of this credit type instead of the fiat currency.
4704
+ */
4705
+ custom_credit_type_id?: string | null;
4706
+
4707
+ /**
4708
+ * When set to false, the contract will not be evaluated against the
4709
+ * threshold_amount. Toggling to true will result an immediate evaluation,
4710
+ * regardless of prior state.
4711
+ */
4712
+ is_enabled?: boolean;
4713
+
4714
+ payment_gate_config?: UpdatePrepaidBalanceThresholdConfiguration.PaymentGateConfig;
4715
+
4716
+ /**
4717
+ * Specify the amount the balance should be recharged to.
4718
+ */
4719
+ recharge_to_amount?: number;
4720
+
4721
+ /**
4722
+ * Specify the threshold amount for the contract. Each time the contract's balance
4723
+ * lowers to this amount, a threshold charge will be initiated.
4724
+ */
4725
+ threshold_amount?: number;
4726
+ }
4727
+
4728
+ export namespace UpdatePrepaidBalanceThresholdConfiguration {
4729
+ export interface Commit {
4730
+ /**
4731
+ * Which products the threshold commit applies to. If both applicable_product_ids
4732
+ * and applicable_product_tags are not provided, the commit applies to all
4733
+ * products.
4734
+ */
4735
+ applicable_product_ids?: Array<string> | null;
4736
+
4737
+ /**
4738
+ * Which tags the threshold commit applies to. If both applicable_product_ids and
4739
+ * applicable_product_tags are not provided, the commit applies to all products.
4740
+ */
4741
+ applicable_product_tags?: Array<string> | null;
4742
+
4743
+ description?: string;
4744
+
4745
+ /**
4746
+ * Specify the name of the line item for the threshold charge. If left blank, it
4747
+ * will default to the commit product name.
4748
+ */
4749
+ name?: string;
4750
+
4751
+ /**
4752
+ * The commit product that will be used to generate the line item for commit
4753
+ * payment.
4754
+ */
4755
+ product_id?: string;
4756
+
4757
+ /**
4758
+ * List of filters that determine what kind of customer usage draws down a commit
4759
+ * or credit. A customer's usage needs to meet the condition of at least one of the
4760
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
4761
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
4762
+ */
4763
+ specifiers?: Array<Commit.Specifier> | null;
4764
+ }
4765
+
4766
+ export namespace Commit {
4767
+ export interface Specifier {
4768
+ presentation_group_values?: { [key: string]: string };
4769
+
4770
+ pricing_group_values?: { [key: string]: string };
4771
+
4772
+ /**
4773
+ * If provided, the specifier will only apply to the product with the specified ID.
4774
+ */
4775
+ product_id?: string;
4776
+
4777
+ /**
4778
+ * If provided, the specifier will only apply to products with all the specified
4779
+ * tags.
4780
+ */
4781
+ product_tags?: Array<string>;
4782
+ }
4783
+ }
4784
+
4785
+ export interface PaymentGateConfig {
4786
+ /**
4787
+ * Gate access to the commit balance based on successful collection of payment.
4788
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
4789
+ * facilitate payment using your own payment integration. Select NONE if you do not
4790
+ * wish to payment gate the commit balance.
4791
+ */
4792
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
4793
+
4794
+ /**
4795
+ * Only applicable if using PRECALCULATED as your tax type.
4796
+ */
4797
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
4798
+
4799
+ /**
4800
+ * Only applicable if using STRIPE as your payment gateway type.
4801
+ */
4802
+ stripe_config?: PaymentGateConfig.StripeConfig;
4803
+
4804
+ /**
4805
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
4806
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
4807
+ * will default to NONE.
4808
+ */
4809
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
4810
+ }
4811
+
4812
+ export namespace PaymentGateConfig {
4813
+ /**
4814
+ * Only applicable if using PRECALCULATED as your tax type.
4815
+ */
4816
+ export interface PrecalculatedTaxConfig {
4817
+ /**
4818
+ * Amount of tax to be applied. This should be in the same currency and
4819
+ * denomination as the commit's invoice schedule
4820
+ */
4821
+ tax_amount: number;
4822
+
4823
+ /**
4824
+ * Name of the tax to be applied. This may be used in an invoice line item
4825
+ * description.
2973
4826
  */
2974
- amount?: number;
4827
+ tax_name?: string;
4828
+ }
2975
4829
 
4830
+ /**
4831
+ * Only applicable if using STRIPE as your payment gateway type.
4832
+ */
4833
+ export interface StripeConfig {
2976
4834
  /**
2977
- * Quantity for the charge. Will be multiplied by unit_price to determine the
2978
- * amount and must be specified with unit_price. If specified amount cannot be
2979
- * provided.
4835
+ * If left blank, will default to INVOICE
2980
4836
  */
2981
- quantity?: number;
4837
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
2982
4838
 
2983
4839
  /**
2984
- * Unit price for the charge. Will be multiplied by quantity to determine the
2985
- * amount and must be specified with quantity. If specified amount cannot be
2986
- * provided.
4840
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
4841
+ * your payment type.
2987
4842
  */
2988
- unit_price?: number;
4843
+ invoice_metadata?: { [key: string]: string };
2989
4844
  }
2990
4845
  }
2991
4846
  }
2992
4847
 
4848
+ export interface UpdateRecurringCommit {
4849
+ id: string;
4850
+
4851
+ access_amount?: UpdateRecurringCommit.AccessAmount;
4852
+
4853
+ ending_before?: string;
4854
+
4855
+ invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
4856
+ }
4857
+
4858
+ export namespace UpdateRecurringCommit {
4859
+ export interface AccessAmount {
4860
+ quantity?: number;
4861
+
4862
+ unit_price?: number;
4863
+ }
4864
+
4865
+ export interface InvoiceAmount {
4866
+ quantity?: number;
4867
+
4868
+ unit_price?: number;
4869
+ }
4870
+ }
4871
+
4872
+ export interface UpdateRecurringCredit {
4873
+ id: string;
4874
+
4875
+ access_amount?: UpdateRecurringCredit.AccessAmount;
4876
+
4877
+ ending_before?: string;
4878
+ }
4879
+
4880
+ export namespace UpdateRecurringCredit {
4881
+ export interface AccessAmount {
4882
+ quantity?: number;
4883
+
4884
+ unit_price?: number;
4885
+ }
4886
+ }
4887
+
2993
4888
  export interface UpdateRefundInvoice {
2994
4889
  date: string;
2995
4890
 
@@ -3043,6 +4938,123 @@ export namespace ContractGetEditHistoryResponse {
3043
4938
  }
3044
4939
  }
3045
4940
  }
4941
+
4942
+ export interface UpdateSpendThresholdConfiguration {
4943
+ commit?: UpdateSpendThresholdConfiguration.Commit;
4944
+
4945
+ /**
4946
+ * When set to false, the contract will not be evaluated against the
4947
+ * threshold_amount. Toggling to true will result an immediate evaluation,
4948
+ * regardless of prior state.
4949
+ */
4950
+ is_enabled?: boolean;
4951
+
4952
+ payment_gate_config?: UpdateSpendThresholdConfiguration.PaymentGateConfig;
4953
+
4954
+ /**
4955
+ * Specify the threshold amount for the contract. Each time the contract's usage
4956
+ * hits this amount, a threshold charge will be initiated.
4957
+ */
4958
+ threshold_amount?: number;
4959
+ }
4960
+
4961
+ export namespace UpdateSpendThresholdConfiguration {
4962
+ export interface Commit {
4963
+ description?: string;
4964
+
4965
+ /**
4966
+ * Specify the name of the line item for the threshold charge. If left blank, it
4967
+ * will default to the commit product name.
4968
+ */
4969
+ name?: string;
4970
+
4971
+ /**
4972
+ * The commit product that will be used to generate the line item for commit
4973
+ * payment.
4974
+ */
4975
+ product_id?: string;
4976
+ }
4977
+
4978
+ export interface PaymentGateConfig {
4979
+ /**
4980
+ * Gate access to the commit balance based on successful collection of payment.
4981
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
4982
+ * facilitate payment using your own payment integration. Select NONE if you do not
4983
+ * wish to payment gate the commit balance.
4984
+ */
4985
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
4986
+
4987
+ /**
4988
+ * Only applicable if using PRECALCULATED as your tax type.
4989
+ */
4990
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
4991
+
4992
+ /**
4993
+ * Only applicable if using STRIPE as your payment gateway type.
4994
+ */
4995
+ stripe_config?: PaymentGateConfig.StripeConfig;
4996
+
4997
+ /**
4998
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
4999
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
5000
+ * will default to NONE.
5001
+ */
5002
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
5003
+ }
5004
+
5005
+ export namespace PaymentGateConfig {
5006
+ /**
5007
+ * Only applicable if using PRECALCULATED as your tax type.
5008
+ */
5009
+ export interface PrecalculatedTaxConfig {
5010
+ /**
5011
+ * Amount of tax to be applied. This should be in the same currency and
5012
+ * denomination as the commit's invoice schedule
5013
+ */
5014
+ tax_amount: number;
5015
+
5016
+ /**
5017
+ * Name of the tax to be applied. This may be used in an invoice line item
5018
+ * description.
5019
+ */
5020
+ tax_name?: string;
5021
+ }
5022
+
5023
+ /**
5024
+ * Only applicable if using STRIPE as your payment gateway type.
5025
+ */
5026
+ export interface StripeConfig {
5027
+ /**
5028
+ * If left blank, will default to INVOICE
5029
+ */
5030
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
5031
+
5032
+ /**
5033
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
5034
+ * your payment type.
5035
+ */
5036
+ invoice_metadata?: { [key: string]: string };
5037
+ }
5038
+ }
5039
+ }
5040
+
5041
+ export interface UpdateSubscription {
5042
+ id: string;
5043
+
5044
+ ending_before?: string;
5045
+
5046
+ quantity_updates?: Array<UpdateSubscription.QuantityUpdate>;
5047
+ }
5048
+
5049
+ export namespace UpdateSubscription {
5050
+ export interface QuantityUpdate {
5051
+ starting_at: string;
5052
+
5053
+ quantity?: number;
5054
+
5055
+ quantity_delta?: number;
5056
+ }
5057
+ }
3046
5058
  }
3047
5059
  }
3048
5060
 
@@ -3122,6 +5134,8 @@ export interface ContractEditParams {
3122
5134
 
3123
5135
  add_overrides?: Array<ContractEditParams.AddOverride>;
3124
5136
 
5137
+ add_prepaid_balance_threshold_configuration?: ContractEditParams.AddPrepaidBalanceThresholdConfiguration;
5138
+
3125
5139
  /**
3126
5140
  * This field's availability is dependent on your client's configuration.
3127
5141
  */
@@ -3135,11 +5149,82 @@ export interface ContractEditParams {
3135
5149
 
3136
5150
  add_scheduled_charges?: Array<ContractEditParams.AddScheduledCharge>;
3137
5151
 
5152
+ add_spend_threshold_configuration?: ContractEditParams.AddSpendThresholdConfiguration;
5153
+
5154
+ /**
5155
+ * Optional list of
5156
+ * [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
5157
+ * to add to the contract.
5158
+ */
5159
+ add_subscriptions?: Array<ContractEditParams.AddSubscription>;
5160
+
5161
+ /**
5162
+ * If true, allows setting the contract end date earlier than the end_timestamp of
5163
+ * existing finalized invoices. Finalized invoices will be unchanged; if you want
5164
+ * to incorporate the new end date, you can void and regenerate finalized usage
5165
+ * invoices. Defaults to true.
5166
+ */
5167
+ allow_contract_ending_before_finalized_invoice?: boolean;
5168
+
5169
+ /**
5170
+ * IDs of commits to archive
5171
+ */
5172
+ archive_commits?: Array<ContractEditParams.ArchiveCommit>;
5173
+
5174
+ /**
5175
+ * IDs of credits to archive
5176
+ */
5177
+ archive_credits?: Array<ContractEditParams.ArchiveCredit>;
5178
+
5179
+ /**
5180
+ * IDs of scheduled charges to archive
5181
+ */
5182
+ archive_scheduled_charges?: Array<ContractEditParams.ArchiveScheduledCharge>;
5183
+
5184
+ /**
5185
+ * IDs of overrides to remove
5186
+ */
5187
+ remove_overrides?: Array<ContractEditParams.RemoveOverride>;
5188
+
3138
5189
  update_commits?: Array<ContractEditParams.UpdateCommit>;
3139
5190
 
5191
+ /**
5192
+ * RFC 3339 timestamp indicating when the contract will end (exclusive).
5193
+ */
5194
+ update_contract_end_date?: string | null;
5195
+
5196
+ /**
5197
+ * Value to update the contract name to. If not provided, the contract name will
5198
+ * remain unchanged.
5199
+ */
5200
+ update_contract_name?: string | null;
5201
+
3140
5202
  update_credits?: Array<ContractEditParams.UpdateCredit>;
3141
5203
 
5204
+ update_prepaid_balance_threshold_configuration?: ContractEditParams.UpdatePrepaidBalanceThresholdConfiguration;
5205
+
5206
+ /**
5207
+ * Edits to these recurring commits will only affect commits whose access schedules
5208
+ * has not started. Expired commits, and commits with an active access schedule
5209
+ * will remain unchanged.
5210
+ */
5211
+ update_recurring_commits?: Array<ContractEditParams.UpdateRecurringCommit>;
5212
+
5213
+ /**
5214
+ * Edits to these recurring credits will only affect credits whose access schedules
5215
+ * has not started. Expired credits, and credits with an active access schedule
5216
+ * will remain unchanged.
5217
+ */
5218
+ update_recurring_credits?: Array<ContractEditParams.UpdateRecurringCredit>;
5219
+
3142
5220
  update_scheduled_charges?: Array<ContractEditParams.UpdateScheduledCharge>;
5221
+
5222
+ update_spend_threshold_configuration?: ContractEditParams.UpdateSpendThresholdConfiguration;
5223
+
5224
+ /**
5225
+ * Optional list of subscriptions to update.
5226
+ */
5227
+ update_subscriptions?: Array<ContractEditParams.UpdateSubscription>;
3143
5228
  }
3144
5229
 
3145
5230
  export namespace ContractEditParams {
@@ -3161,24 +5246,31 @@ export namespace ContractEditParams {
3161
5246
  amount?: number;
3162
5247
 
3163
5248
  /**
3164
- * Which products the commit applies to. If both applicable_product_ids and
3165
- * applicable_product_tags are not provided, the commit applies to all products.
5249
+ * Which products the commit applies to. If applicable_product_ids,
5250
+ * applicable_product_tags or specifiers are not provided, the commit applies to
5251
+ * all products.
3166
5252
  */
3167
5253
  applicable_product_ids?: Array<string>;
3168
5254
 
3169
5255
  /**
3170
- * Which tags the commit applies to. If both applicable_product_ids and
3171
- * applicable_product_tags are not provided, the commit applies to all products.
5256
+ * Which tags the commit applies to. If applicable_product_ids,
5257
+ * applicable_product_tags or specifiers are not provided, the commit applies to
5258
+ * all products.
3172
5259
  */
3173
5260
  applicable_product_tags?: Array<string>;
3174
5261
 
3175
- custom_fields?: Record<string, string>;
5262
+ custom_fields?: { [key: string]: string };
3176
5263
 
3177
5264
  /**
3178
5265
  * Used only in UI/API. It is not exposed to end customers.
3179
5266
  */
3180
5267
  description?: string;
3181
5268
 
5269
+ /**
5270
+ * Optional configuration for commit hierarchy access control
5271
+ */
5272
+ hierarchy_configuration?: AddCommit.HierarchyConfiguration;
5273
+
3182
5274
  /**
3183
5275
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
3184
5276
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -3197,6 +5289,11 @@ export namespace ContractEditParams {
3197
5289
  */
3198
5290
  netsuite_sales_order_id?: string;
3199
5291
 
5292
+ /**
5293
+ * optionally payment gate this commit
5294
+ */
5295
+ payment_gate_config?: AddCommit.PaymentGateConfig;
5296
+
3200
5297
  /**
3201
5298
  * If multiple commits are applicable, the one with the lower priority will apply
3202
5299
  * first.
@@ -3210,6 +5307,14 @@ export namespace ContractEditParams {
3210
5307
  */
3211
5308
  rollover_fraction?: number;
3212
5309
 
5310
+ /**
5311
+ * List of filters that determine what kind of customer usage draws down a commit
5312
+ * or credit. A customer's usage needs to meet the condition of at least one of the
5313
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
5314
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
5315
+ */
5316
+ specifiers?: Array<AddCommit.Specifier>;
5317
+
3213
5318
  /**
3214
5319
  * A temporary ID for the commit that can be used to reference the commit for
3215
5320
  * commit specific overrides.
@@ -3245,6 +5350,32 @@ export namespace ContractEditParams {
3245
5350
  }
3246
5351
  }
3247
5352
 
5353
+ /**
5354
+ * Optional configuration for commit hierarchy access control
5355
+ */
5356
+ export interface HierarchyConfiguration {
5357
+ child_access:
5358
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
5359
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
5360
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
5361
+ }
5362
+
5363
+ export namespace HierarchyConfiguration {
5364
+ export interface CommitHierarchyChildAccessAll {
5365
+ type: 'ALL';
5366
+ }
5367
+
5368
+ export interface CommitHierarchyChildAccessNone {
5369
+ type: 'NONE';
5370
+ }
5371
+
5372
+ export interface CommitHierarchyChildAccessContractIDs {
5373
+ contract_ids: Array<string>;
5374
+
5375
+ type: 'CONTRACT_IDS';
5376
+ }
5377
+ }
5378
+
3248
5379
  /**
3249
5380
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
3250
5381
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -3284,7 +5415,7 @@ export namespace ContractEditParams {
3284
5415
  */
3285
5416
  ending_before: string;
3286
5417
 
3287
- frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL';
5418
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
3288
5419
 
3289
5420
  /**
3290
5421
  * RFC 3339 timestamp (inclusive).
@@ -3341,6 +5472,88 @@ export namespace ContractEditParams {
3341
5472
  unit_price?: number;
3342
5473
  }
3343
5474
  }
5475
+
5476
+ /**
5477
+ * optionally payment gate this commit
5478
+ */
5479
+ export interface PaymentGateConfig {
5480
+ /**
5481
+ * Gate access to the commit balance based on successful collection of payment.
5482
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
5483
+ * facilitate payment using your own payment integration. Select NONE if you do not
5484
+ * wish to payment gate the commit balance.
5485
+ */
5486
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
5487
+
5488
+ /**
5489
+ * Only applicable if using PRECALCULATED as your tax type.
5490
+ */
5491
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
5492
+
5493
+ /**
5494
+ * Only applicable if using STRIPE as your payment gateway type.
5495
+ */
5496
+ stripe_config?: PaymentGateConfig.StripeConfig;
5497
+
5498
+ /**
5499
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
5500
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
5501
+ * will default to NONE.
5502
+ */
5503
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
5504
+ }
5505
+
5506
+ export namespace PaymentGateConfig {
5507
+ /**
5508
+ * Only applicable if using PRECALCULATED as your tax type.
5509
+ */
5510
+ export interface PrecalculatedTaxConfig {
5511
+ /**
5512
+ * Amount of tax to be applied. This should be in the same currency and
5513
+ * denomination as the commit's invoice schedule
5514
+ */
5515
+ tax_amount: number;
5516
+
5517
+ /**
5518
+ * Name of the tax to be applied. This may be used in an invoice line item
5519
+ * description.
5520
+ */
5521
+ tax_name?: string;
5522
+ }
5523
+
5524
+ /**
5525
+ * Only applicable if using STRIPE as your payment gateway type.
5526
+ */
5527
+ export interface StripeConfig {
5528
+ /**
5529
+ * If left blank, will default to INVOICE
5530
+ */
5531
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
5532
+
5533
+ /**
5534
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
5535
+ * your payment type.
5536
+ */
5537
+ invoice_metadata?: { [key: string]: string };
5538
+ }
5539
+ }
5540
+
5541
+ export interface Specifier {
5542
+ presentation_group_values?: { [key: string]: string };
5543
+
5544
+ pricing_group_values?: { [key: string]: string };
5545
+
5546
+ /**
5547
+ * If provided, the specifier will only apply to the product with the specified ID.
5548
+ */
5549
+ product_id?: string;
5550
+
5551
+ /**
5552
+ * If provided, the specifier will only apply to products with all the specified
5553
+ * tags.
5554
+ */
5555
+ product_tags?: Array<string>;
5556
+ }
3344
5557
  }
3345
5558
 
3346
5559
  export interface AddCredit {
@@ -3363,13 +5576,18 @@ export namespace ContractEditParams {
3363
5576
  */
3364
5577
  applicable_product_tags?: Array<string>;
3365
5578
 
3366
- custom_fields?: Record<string, string>;
5579
+ custom_fields?: { [key: string]: string };
3367
5580
 
3368
5581
  /**
3369
5582
  * Used only in UI/API. It is not exposed to end customers.
3370
5583
  */
3371
5584
  description?: string;
3372
5585
 
5586
+ /**
5587
+ * Optional configuration for credit hierarchy access control
5588
+ */
5589
+ hierarchy_configuration?: AddCredit.HierarchyConfiguration;
5590
+
3373
5591
  /**
3374
5592
  * displayed on invoices
3375
5593
  */
@@ -3387,6 +5605,14 @@ export namespace ContractEditParams {
3387
5605
  priority?: number;
3388
5606
 
3389
5607
  rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
5608
+
5609
+ /**
5610
+ * List of filters that determine what kind of customer usage draws down a commit
5611
+ * or credit. A customer's usage needs to meet the condition of at least one of the
5612
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
5613
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
5614
+ */
5615
+ specifiers?: Array<AddCredit.Specifier>;
3390
5616
  }
3391
5617
 
3392
5618
  export namespace AddCredit {
@@ -3408,11 +5634,54 @@ export namespace ContractEditParams {
3408
5634
  */
3409
5635
  ending_before: string;
3410
5636
 
3411
- /**
3412
- * RFC 3339 timestamp (inclusive)
3413
- */
3414
- starting_at: string;
3415
- }
5637
+ /**
5638
+ * RFC 3339 timestamp (inclusive)
5639
+ */
5640
+ starting_at: string;
5641
+ }
5642
+ }
5643
+
5644
+ /**
5645
+ * Optional configuration for credit hierarchy access control
5646
+ */
5647
+ export interface HierarchyConfiguration {
5648
+ child_access:
5649
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
5650
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
5651
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
5652
+ }
5653
+
5654
+ export namespace HierarchyConfiguration {
5655
+ export interface CommitHierarchyChildAccessAll {
5656
+ type: 'ALL';
5657
+ }
5658
+
5659
+ export interface CommitHierarchyChildAccessNone {
5660
+ type: 'NONE';
5661
+ }
5662
+
5663
+ export interface CommitHierarchyChildAccessContractIDs {
5664
+ contract_ids: Array<string>;
5665
+
5666
+ type: 'CONTRACT_IDS';
5667
+ }
5668
+ }
5669
+
5670
+ export interface Specifier {
5671
+ presentation_group_values?: { [key: string]: string };
5672
+
5673
+ pricing_group_values?: { [key: string]: string };
5674
+
5675
+ /**
5676
+ * If provided, the specifier will only apply to the product with the specified ID.
5677
+ */
5678
+ product_id?: string;
5679
+
5680
+ /**
5681
+ * If provided, the specifier will only apply to products with all the specified
5682
+ * tags.
5683
+ */
5684
+ product_tags?: Array<string>;
3416
5685
  }
3417
5686
  }
3418
5687
 
@@ -3424,7 +5693,7 @@ export namespace ContractEditParams {
3424
5693
  */
3425
5694
  schedule: AddDiscount.Schedule;
3426
5695
 
3427
- custom_fields?: Record<string, string>;
5696
+ custom_fields?: { [key: string]: string };
3428
5697
 
3429
5698
  /**
3430
5699
  * displayed on invoices
@@ -3474,7 +5743,7 @@ export namespace ContractEditParams {
3474
5743
  */
3475
5744
  ending_before: string;
3476
5745
 
3477
- frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL';
5746
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
3478
5747
 
3479
5748
  /**
3480
5749
  * RFC 3339 timestamp (inclusive).
@@ -3607,6 +5876,8 @@ export namespace ContractEditParams {
3607
5876
 
3608
5877
  export namespace AddOverride {
3609
5878
  export interface OverrideSpecifier {
5879
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
5880
+
3610
5881
  /**
3611
5882
  * If provided, the override will only apply to the specified commits. Can only be
3612
5883
  * used for commit specific overrides. If not provided, the override will apply to
@@ -3619,13 +5890,13 @@ export namespace ContractEditParams {
3619
5890
  * the specified presentation group values. Can only be used for multiplier
3620
5891
  * overrides.
3621
5892
  */
3622
- presentation_group_values?: Record<string, string>;
5893
+ presentation_group_values?: { [key: string]: string };
3623
5894
 
3624
5895
  /**
3625
5896
  * A map of pricing group names to values. The override will only apply to products
3626
5897
  * with the specified pricing group values.
3627
5898
  */
3628
- pricing_group_values?: Record<string, string>;
5899
+ pricing_group_values?: { [key: string]: string };
3629
5900
 
3630
5901
  /**
3631
5902
  * If provided, the override will only apply to the product with the specified ID.
@@ -3667,7 +5938,7 @@ export namespace ContractEditParams {
3667
5938
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
3668
5939
  * processors.
3669
5940
  */
3670
- custom_rate?: Record<string, unknown>;
5941
+ custom_rate?: { [key: string]: unknown };
3671
5942
 
3672
5943
  /**
3673
5944
  * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
@@ -3699,6 +5970,157 @@ export namespace ContractEditParams {
3699
5970
  }
3700
5971
  }
3701
5972
 
5973
+ export interface AddPrepaidBalanceThresholdConfiguration {
5974
+ commit: AddPrepaidBalanceThresholdConfiguration.Commit;
5975
+
5976
+ /**
5977
+ * When set to false, the contract will not be evaluated against the
5978
+ * threshold_amount. Toggling to true will result an immediate evaluation,
5979
+ * regardless of prior state.
5980
+ */
5981
+ is_enabled: boolean;
5982
+
5983
+ payment_gate_config: AddPrepaidBalanceThresholdConfiguration.PaymentGateConfig;
5984
+
5985
+ /**
5986
+ * Specify the amount the balance should be recharged to.
5987
+ */
5988
+ recharge_to_amount: number;
5989
+
5990
+ /**
5991
+ * Specify the threshold amount for the contract. Each time the contract's balance
5992
+ * lowers to this amount, a threshold charge will be initiated.
5993
+ */
5994
+ threshold_amount: number;
5995
+
5996
+ /**
5997
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
5998
+ * commit amount will be in terms of this credit type instead of the fiat currency.
5999
+ */
6000
+ custom_credit_type_id?: string;
6001
+ }
6002
+
6003
+ export namespace AddPrepaidBalanceThresholdConfiguration {
6004
+ export interface Commit {
6005
+ /**
6006
+ * The commit product that will be used to generate the line item for commit
6007
+ * payment.
6008
+ */
6009
+ product_id: string;
6010
+
6011
+ /**
6012
+ * Which products the threshold commit applies to. If applicable_product_ids,
6013
+ * applicable_product_tags or specifiers are not provided, the commit applies to
6014
+ * all products.
6015
+ */
6016
+ applicable_product_ids?: Array<string>;
6017
+
6018
+ /**
6019
+ * Which tags the threshold commit applies to. If applicable_product_ids,
6020
+ * applicable_product_tags or specifiers are not provided, the commit applies to
6021
+ * all products.
6022
+ */
6023
+ applicable_product_tags?: Array<string>;
6024
+
6025
+ description?: string;
6026
+
6027
+ /**
6028
+ * Specify the name of the line item for the threshold charge. If left blank, it
6029
+ * will default to the commit product name.
6030
+ */
6031
+ name?: string;
6032
+
6033
+ /**
6034
+ * List of filters that determine what kind of customer usage draws down a commit
6035
+ * or credit. A customer's usage needs to meet the condition of at least one of the
6036
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
6037
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
6038
+ */
6039
+ specifiers?: Array<Commit.Specifier>;
6040
+ }
6041
+
6042
+ export namespace Commit {
6043
+ export interface Specifier {
6044
+ presentation_group_values?: { [key: string]: string };
6045
+
6046
+ pricing_group_values?: { [key: string]: string };
6047
+
6048
+ /**
6049
+ * If provided, the specifier will only apply to the product with the specified ID.
6050
+ */
6051
+ product_id?: string;
6052
+
6053
+ /**
6054
+ * If provided, the specifier will only apply to products with all the specified
6055
+ * tags.
6056
+ */
6057
+ product_tags?: Array<string>;
6058
+ }
6059
+ }
6060
+
6061
+ export interface PaymentGateConfig {
6062
+ /**
6063
+ * Gate access to the commit balance based on successful collection of payment.
6064
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
6065
+ * facilitate payment using your own payment integration. Select NONE if you do not
6066
+ * wish to payment gate the commit balance.
6067
+ */
6068
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
6069
+
6070
+ /**
6071
+ * Only applicable if using PRECALCULATED as your tax type.
6072
+ */
6073
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
6074
+
6075
+ /**
6076
+ * Only applicable if using STRIPE as your payment gateway type.
6077
+ */
6078
+ stripe_config?: PaymentGateConfig.StripeConfig;
6079
+
6080
+ /**
6081
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
6082
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
6083
+ * will default to NONE.
6084
+ */
6085
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
6086
+ }
6087
+
6088
+ export namespace PaymentGateConfig {
6089
+ /**
6090
+ * Only applicable if using PRECALCULATED as your tax type.
6091
+ */
6092
+ export interface PrecalculatedTaxConfig {
6093
+ /**
6094
+ * Amount of tax to be applied. This should be in the same currency and
6095
+ * denomination as the commit's invoice schedule
6096
+ */
6097
+ tax_amount: number;
6098
+
6099
+ /**
6100
+ * Name of the tax to be applied. This may be used in an invoice line item
6101
+ * description.
6102
+ */
6103
+ tax_name?: string;
6104
+ }
6105
+
6106
+ /**
6107
+ * Only applicable if using STRIPE as your payment gateway type.
6108
+ */
6109
+ export interface StripeConfig {
6110
+ /**
6111
+ * If left blank, will default to INVOICE
6112
+ */
6113
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
6114
+
6115
+ /**
6116
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
6117
+ * your payment type.
6118
+ */
6119
+ invoice_metadata?: { [key: string]: string };
6120
+ }
6121
+ }
6122
+ }
6123
+
3702
6124
  export interface AddProfessionalService {
3703
6125
  /**
3704
6126
  * Maximum amount for the term.
@@ -3719,7 +6141,7 @@ export namespace ContractEditParams {
3719
6141
  */
3720
6142
  unit_price: number;
3721
6143
 
3722
- custom_fields?: Record<string, string>;
6144
+ custom_fields?: { [key: string]: string };
3723
6145
 
3724
6146
  description?: string;
3725
6147
 
@@ -3736,7 +6158,9 @@ export namespace ContractEditParams {
3736
6158
  access_amount: AddRecurringCommit.AccessAmount;
3737
6159
 
3738
6160
  /**
3739
- * The amount of time the created commits will be valid for.
6161
+ * Defines the length of the access schedule for each created commit/credit. The
6162
+ * value represents the number of units. Unit defaults to "PERIODS", where the
6163
+ * length of a period is determined by the recurrence_frequency.
3740
6164
  */
3741
6165
  commit_duration: AddRecurringCommit.CommitDuration;
3742
6166
 
@@ -3772,6 +6196,11 @@ export namespace ContractEditParams {
3772
6196
  */
3773
6197
  ending_before?: string;
3774
6198
 
6199
+ /**
6200
+ * Optional configuration for recurring commit/credit hierarchy access control
6201
+ */
6202
+ hierarchy_configuration?: AddRecurringCommit.HierarchyConfiguration;
6203
+
3775
6204
  /**
3776
6205
  * The amount the customer should be billed for the commit. Not required.
3777
6206
  */
@@ -3802,10 +6231,10 @@ export namespace ContractEditParams {
3802
6231
  * The frequency at which the recurring commits will be created. If not provided: -
3803
6232
  * The commits will be created on the usage invoice frequency. If provided: - The
3804
6233
  * period defined in the duration will correspond to this frequency. - Commits will
3805
- * be created aligned with the recurring commit's start_date rather than the usage
6234
+ * be created aligned with the recurring commit's starting_at rather than the usage
3806
6235
  * invoice dates.
3807
6236
  */
3808
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
6237
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
3809
6238
 
3810
6239
  /**
3811
6240
  * Will be passed down to the individual commits. This controls how much of an
@@ -3814,6 +6243,14 @@ export namespace ContractEditParams {
3814
6243
  */
3815
6244
  rollover_fraction?: number;
3816
6245
 
6246
+ /**
6247
+ * List of filters that determine what kind of customer usage draws down a commit
6248
+ * or credit. A customer's usage needs to meet the condition of at least one of the
6249
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
6250
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
6251
+ */
6252
+ specifiers?: Array<AddRecurringCommit.Specifier>;
6253
+
3817
6254
  /**
3818
6255
  * A temporary ID that can be used to reference the recurring commit for commit
3819
6256
  * specific overrides.
@@ -3828,18 +6265,50 @@ export namespace ContractEditParams {
3828
6265
  export interface AccessAmount {
3829
6266
  credit_type_id: string;
3830
6267
 
3831
- quantity: number;
3832
-
3833
6268
  unit_price: number;
6269
+
6270
+ /**
6271
+ * This field is currently required. Upcoming recurring commit/credit configuration
6272
+ * options will allow it to be optional.
6273
+ */
6274
+ quantity?: number;
3834
6275
  }
3835
6276
 
3836
6277
  /**
3837
- * The amount of time the created commits will be valid for.
6278
+ * Defines the length of the access schedule for each created commit/credit. The
6279
+ * value represents the number of units. Unit defaults to "PERIODS", where the
6280
+ * length of a period is determined by the recurrence_frequency.
3838
6281
  */
3839
6282
  export interface CommitDuration {
3840
- unit: 'PERIODS';
3841
-
3842
6283
  value: number;
6284
+
6285
+ unit?: 'PERIODS';
6286
+ }
6287
+
6288
+ /**
6289
+ * Optional configuration for recurring commit/credit hierarchy access control
6290
+ */
6291
+ export interface HierarchyConfiguration {
6292
+ child_access:
6293
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
6294
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
6295
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
6296
+ }
6297
+
6298
+ export namespace HierarchyConfiguration {
6299
+ export interface CommitHierarchyChildAccessAll {
6300
+ type: 'ALL';
6301
+ }
6302
+
6303
+ export interface CommitHierarchyChildAccessNone {
6304
+ type: 'NONE';
6305
+ }
6306
+
6307
+ export interface CommitHierarchyChildAccessContractIDs {
6308
+ contract_ids: Array<string>;
6309
+
6310
+ type: 'CONTRACT_IDS';
6311
+ }
3843
6312
  }
3844
6313
 
3845
6314
  /**
@@ -3852,6 +6321,23 @@ export namespace ContractEditParams {
3852
6321
 
3853
6322
  unit_price: number;
3854
6323
  }
6324
+
6325
+ export interface Specifier {
6326
+ presentation_group_values?: { [key: string]: string };
6327
+
6328
+ pricing_group_values?: { [key: string]: string };
6329
+
6330
+ /**
6331
+ * If provided, the specifier will only apply to the product with the specified ID.
6332
+ */
6333
+ product_id?: string;
6334
+
6335
+ /**
6336
+ * If provided, the specifier will only apply to products with all the specified
6337
+ * tags.
6338
+ */
6339
+ product_tags?: Array<string>;
6340
+ }
3855
6341
  }
3856
6342
 
3857
6343
  export interface AddRecurringCredit {
@@ -3861,7 +6347,9 @@ export namespace ContractEditParams {
3861
6347
  access_amount: AddRecurringCredit.AccessAmount;
3862
6348
 
3863
6349
  /**
3864
- * The amount of time the created commits will be valid for.
6350
+ * Defines the length of the access schedule for each created commit/credit. The
6351
+ * value represents the number of units. Unit defaults to "PERIODS", where the
6352
+ * length of a period is determined by the recurrence_frequency.
3865
6353
  */
3866
6354
  commit_duration: AddRecurringCredit.CommitDuration;
3867
6355
 
@@ -3897,6 +6385,11 @@ export namespace ContractEditParams {
3897
6385
  */
3898
6386
  ending_before?: string;
3899
6387
 
6388
+ /**
6389
+ * Optional configuration for recurring commit/credit hierarchy access control
6390
+ */
6391
+ hierarchy_configuration?: AddRecurringCredit.HierarchyConfiguration;
6392
+
3900
6393
  /**
3901
6394
  * displayed on invoices. will be passed through to the individual commits
3902
6395
  */
@@ -3922,10 +6415,10 @@ export namespace ContractEditParams {
3922
6415
  * The frequency at which the recurring commits will be created. If not provided: -
3923
6416
  * The commits will be created on the usage invoice frequency. If provided: - The
3924
6417
  * period defined in the duration will correspond to this frequency. - Commits will
3925
- * be created aligned with the recurring commit's start_date rather than the usage
6418
+ * be created aligned with the recurring commit's starting_at rather than the usage
3926
6419
  * invoice dates.
3927
6420
  */
3928
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
6421
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
3929
6422
 
3930
6423
  /**
3931
6424
  * Will be passed down to the individual commits. This controls how much of an
@@ -3934,6 +6427,14 @@ export namespace ContractEditParams {
3934
6427
  */
3935
6428
  rollover_fraction?: number;
3936
6429
 
6430
+ /**
6431
+ * List of filters that determine what kind of customer usage draws down a commit
6432
+ * or credit. A customer's usage needs to meet the condition of at least one of the
6433
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
6434
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
6435
+ */
6436
+ specifiers?: Array<AddRecurringCredit.Specifier>;
6437
+
3937
6438
  /**
3938
6439
  * A temporary ID that can be used to reference the recurring commit for commit
3939
6440
  * specific overrides.
@@ -3948,18 +6449,67 @@ export namespace ContractEditParams {
3948
6449
  export interface AccessAmount {
3949
6450
  credit_type_id: string;
3950
6451
 
3951
- quantity: number;
3952
-
3953
6452
  unit_price: number;
6453
+
6454
+ /**
6455
+ * This field is currently required. Upcoming recurring commit/credit configuration
6456
+ * options will allow it to be optional.
6457
+ */
6458
+ quantity?: number;
3954
6459
  }
3955
6460
 
3956
6461
  /**
3957
- * The amount of time the created commits will be valid for.
6462
+ * Defines the length of the access schedule for each created commit/credit. The
6463
+ * value represents the number of units. Unit defaults to "PERIODS", where the
6464
+ * length of a period is determined by the recurrence_frequency.
3958
6465
  */
3959
6466
  export interface CommitDuration {
3960
- unit: 'PERIODS';
3961
-
3962
6467
  value: number;
6468
+
6469
+ unit?: 'PERIODS';
6470
+ }
6471
+
6472
+ /**
6473
+ * Optional configuration for recurring commit/credit hierarchy access control
6474
+ */
6475
+ export interface HierarchyConfiguration {
6476
+ child_access:
6477
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
6478
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
6479
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
6480
+ }
6481
+
6482
+ export namespace HierarchyConfiguration {
6483
+ export interface CommitHierarchyChildAccessAll {
6484
+ type: 'ALL';
6485
+ }
6486
+
6487
+ export interface CommitHierarchyChildAccessNone {
6488
+ type: 'NONE';
6489
+ }
6490
+
6491
+ export interface CommitHierarchyChildAccessContractIDs {
6492
+ contract_ids: Array<string>;
6493
+
6494
+ type: 'CONTRACT_IDS';
6495
+ }
6496
+ }
6497
+
6498
+ export interface Specifier {
6499
+ presentation_group_values?: { [key: string]: string };
6500
+
6501
+ pricing_group_values?: { [key: string]: string };
6502
+
6503
+ /**
6504
+ * If provided, the specifier will only apply to the product with the specified ID.
6505
+ */
6506
+ product_id?: string;
6507
+
6508
+ /**
6509
+ * If provided, the specifier will only apply to products with all the specified
6510
+ * tags.
6511
+ */
6512
+ product_tags?: Array<string>;
3963
6513
  }
3964
6514
  }
3965
6515
 
@@ -4066,7 +6616,7 @@ export namespace ContractEditParams {
4066
6616
  */
4067
6617
  ending_before: string;
4068
6618
 
4069
- frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL';
6619
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
4070
6620
 
4071
6621
  /**
4072
6622
  * RFC 3339 timestamp (inclusive).
@@ -4125,23 +6675,203 @@ export namespace ContractEditParams {
4125
6675
  }
4126
6676
  }
4127
6677
 
6678
+ export interface AddSpendThresholdConfiguration {
6679
+ commit: AddSpendThresholdConfiguration.Commit;
6680
+
6681
+ /**
6682
+ * When set to false, the contract will not be evaluated against the
6683
+ * threshold_amount. Toggling to true will result an immediate evaluation,
6684
+ * regardless of prior state.
6685
+ */
6686
+ is_enabled: boolean;
6687
+
6688
+ payment_gate_config: AddSpendThresholdConfiguration.PaymentGateConfig;
6689
+
6690
+ /**
6691
+ * Specify the threshold amount for the contract. Each time the contract's usage
6692
+ * hits this amount, a threshold charge will be initiated.
6693
+ */
6694
+ threshold_amount: number;
6695
+ }
6696
+
6697
+ export namespace AddSpendThresholdConfiguration {
6698
+ export interface Commit {
6699
+ /**
6700
+ * The commit product that will be used to generate the line item for commit
6701
+ * payment.
6702
+ */
6703
+ product_id: string;
6704
+
6705
+ description?: string;
6706
+
6707
+ /**
6708
+ * Specify the name of the line item for the threshold charge. If left blank, it
6709
+ * will default to the commit product name.
6710
+ */
6711
+ name?: string;
6712
+ }
6713
+
6714
+ export interface PaymentGateConfig {
6715
+ /**
6716
+ * Gate access to the commit balance based on successful collection of payment.
6717
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
6718
+ * facilitate payment using your own payment integration. Select NONE if you do not
6719
+ * wish to payment gate the commit balance.
6720
+ */
6721
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
6722
+
6723
+ /**
6724
+ * Only applicable if using PRECALCULATED as your tax type.
6725
+ */
6726
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
6727
+
6728
+ /**
6729
+ * Only applicable if using STRIPE as your payment gateway type.
6730
+ */
6731
+ stripe_config?: PaymentGateConfig.StripeConfig;
6732
+
6733
+ /**
6734
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
6735
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
6736
+ * will default to NONE.
6737
+ */
6738
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
6739
+ }
6740
+
6741
+ export namespace PaymentGateConfig {
6742
+ /**
6743
+ * Only applicable if using PRECALCULATED as your tax type.
6744
+ */
6745
+ export interface PrecalculatedTaxConfig {
6746
+ /**
6747
+ * Amount of tax to be applied. This should be in the same currency and
6748
+ * denomination as the commit's invoice schedule
6749
+ */
6750
+ tax_amount: number;
6751
+
6752
+ /**
6753
+ * Name of the tax to be applied. This may be used in an invoice line item
6754
+ * description.
6755
+ */
6756
+ tax_name?: string;
6757
+ }
6758
+
6759
+ /**
6760
+ * Only applicable if using STRIPE as your payment gateway type.
6761
+ */
6762
+ export interface StripeConfig {
6763
+ /**
6764
+ * If left blank, will default to INVOICE
6765
+ */
6766
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
6767
+
6768
+ /**
6769
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
6770
+ * your payment type.
6771
+ */
6772
+ invoice_metadata?: { [key: string]: string };
6773
+ }
6774
+ }
6775
+ }
6776
+
6777
+ export interface AddSubscription {
6778
+ collection_schedule: 'ADVANCE' | 'ARREARS';
6779
+
6780
+ initial_quantity: number;
6781
+
6782
+ proration: AddSubscription.Proration;
6783
+
6784
+ subscription_rate: AddSubscription.SubscriptionRate;
6785
+
6786
+ custom_fields?: { [key: string]: string };
6787
+
6788
+ description?: string;
6789
+
6790
+ /**
6791
+ * Exclusive end time for the subscription. If not provided, subscription inherits
6792
+ * contract end date.
6793
+ */
6794
+ ending_before?: string;
6795
+
6796
+ name?: string;
6797
+
6798
+ /**
6799
+ * Inclusive start time for the subscription. If not provided, defaults to contract
6800
+ * start date
6801
+ */
6802
+ starting_at?: string;
6803
+ }
6804
+
6805
+ export namespace AddSubscription {
6806
+ export interface Proration {
6807
+ /**
6808
+ * Indicates how mid-period quantity adjustments are invoiced. If BILL_IMMEDIATELY
6809
+ * is selected, the quantity increase will be billed on the scheduled date. If
6810
+ * BILL_ON_NEXT_COLLECTION_DATE is selected, the quantity increase will be billed
6811
+ * for in-arrears at the end of the period.
6812
+ */
6813
+ invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
6814
+
6815
+ /**
6816
+ * Indicates if the partial period will be prorated or charged a full amount.
6817
+ */
6818
+ is_prorated?: boolean;
6819
+ }
6820
+
6821
+ export interface SubscriptionRate {
6822
+ /**
6823
+ * Frequency to bill subscription with. Together with product_id, must match
6824
+ * existing rate on the rate card.
6825
+ */
6826
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
6827
+
6828
+ /**
6829
+ * Must be subscription type product
6830
+ */
6831
+ product_id: string;
6832
+ }
6833
+ }
6834
+
6835
+ export interface ArchiveCommit {
6836
+ id: string;
6837
+ }
6838
+
6839
+ export interface ArchiveCredit {
6840
+ id: string;
6841
+ }
6842
+
6843
+ export interface ArchiveScheduledCharge {
6844
+ id: string;
6845
+ }
6846
+
6847
+ export interface RemoveOverride {
6848
+ id: string;
6849
+ }
6850
+
4128
6851
  export interface UpdateCommit {
4129
6852
  commit_id: string;
4130
6853
 
4131
6854
  access_schedule?: UpdateCommit.AccessSchedule;
4132
6855
 
4133
6856
  /**
4134
- * Which products the commit applies to. If both applicable_product_ids and
4135
- * applicable_product_tags are not provided, the commit applies to all products.
6857
+ * Which products the commit applies to. If applicable_product_ids,
6858
+ * applicable_product_tags or specifiers are not provided, the commit applies to
6859
+ * all products.
4136
6860
  */
4137
6861
  applicable_product_ids?: Array<string> | null;
4138
6862
 
4139
6863
  /**
4140
- * Which tags the commit applies to. If both applicable_product_ids and
4141
- * applicable_product_tags are not provided, the commit applies to all products.
6864
+ * Which tags the commit applies to. If applicable_product_ids,
6865
+ * applicable_product_tags or specifiers are not provided, the commit applies to
6866
+ * all products.
4142
6867
  */
4143
6868
  applicable_product_tags?: Array<string> | null;
4144
6869
 
6870
+ /**
6871
+ * Optional configuration for commit hierarchy access control
6872
+ */
6873
+ hierarchy_configuration?: UpdateCommit.HierarchyConfiguration;
6874
+
4145
6875
  invoice_schedule?: UpdateCommit.InvoiceSchedule;
4146
6876
 
4147
6877
  netsuite_sales_order_id?: string | null;
@@ -4184,6 +6914,32 @@ export namespace ContractEditParams {
4184
6914
  }
4185
6915
  }
4186
6916
 
6917
+ /**
6918
+ * Optional configuration for commit hierarchy access control
6919
+ */
6920
+ export interface HierarchyConfiguration {
6921
+ child_access:
6922
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
6923
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
6924
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
6925
+ }
6926
+
6927
+ export namespace HierarchyConfiguration {
6928
+ export interface CommitHierarchyChildAccessAll {
6929
+ type: 'ALL';
6930
+ }
6931
+
6932
+ export interface CommitHierarchyChildAccessNone {
6933
+ type: 'NONE';
6934
+ }
6935
+
6936
+ export interface CommitHierarchyChildAccessContractIDs {
6937
+ contract_ids: Array<string>;
6938
+
6939
+ type: 'CONTRACT_IDS';
6940
+ }
6941
+ }
6942
+
4187
6943
  export interface InvoiceSchedule {
4188
6944
  add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
4189
6945
 
@@ -4227,17 +6983,24 @@ export namespace ContractEditParams {
4227
6983
  access_schedule?: UpdateCredit.AccessSchedule;
4228
6984
 
4229
6985
  /**
4230
- * Which products the commit applies to. If both applicable_product_ids and
4231
- * applicable_product_tags are not provided, the commit applies to all products.
6986
+ * Which products the commit applies to. If applicable_product_ids,
6987
+ * applicable_product_tags or specifiers are not provided, the commit applies to
6988
+ * all products.
4232
6989
  */
4233
6990
  applicable_product_ids?: Array<string> | null;
4234
6991
 
4235
6992
  /**
4236
- * Which tags the commit applies to. If both applicable_product_ids and
4237
- * applicable_product_tags are not provided, the commit applies to all products.
6993
+ * Which tags the commit applies to. If applicable_product_ids,
6994
+ * applicable_product_tags or specifiers are not provided, the commit applies to
6995
+ * all products.
4238
6996
  */
4239
6997
  applicable_product_tags?: Array<string> | null;
4240
6998
 
6999
+ /**
7000
+ * Optional configuration for commit hierarchy access control
7001
+ */
7002
+ hierarchy_configuration?: UpdateCredit.HierarchyConfiguration;
7003
+
4241
7004
  netsuite_sales_order_id?: string | null;
4242
7005
 
4243
7006
  product_id?: string;
@@ -4275,6 +7038,222 @@ export namespace ContractEditParams {
4275
7038
  starting_at?: string;
4276
7039
  }
4277
7040
  }
7041
+
7042
+ /**
7043
+ * Optional configuration for commit hierarchy access control
7044
+ */
7045
+ export interface HierarchyConfiguration {
7046
+ child_access:
7047
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
7048
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
7049
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
7050
+ }
7051
+
7052
+ export namespace HierarchyConfiguration {
7053
+ export interface CommitHierarchyChildAccessAll {
7054
+ type: 'ALL';
7055
+ }
7056
+
7057
+ export interface CommitHierarchyChildAccessNone {
7058
+ type: 'NONE';
7059
+ }
7060
+
7061
+ export interface CommitHierarchyChildAccessContractIDs {
7062
+ contract_ids: Array<string>;
7063
+
7064
+ type: 'CONTRACT_IDS';
7065
+ }
7066
+ }
7067
+ }
7068
+
7069
+ export interface UpdatePrepaidBalanceThresholdConfiguration {
7070
+ commit?: UpdatePrepaidBalanceThresholdConfiguration.Commit;
7071
+
7072
+ /**
7073
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
7074
+ * commit amount will be in terms of this credit type instead of the fiat currency.
7075
+ */
7076
+ custom_credit_type_id?: string | null;
7077
+
7078
+ /**
7079
+ * When set to false, the contract will not be evaluated against the
7080
+ * threshold_amount. Toggling to true will result an immediate evaluation,
7081
+ * regardless of prior state.
7082
+ */
7083
+ is_enabled?: boolean;
7084
+
7085
+ payment_gate_config?: UpdatePrepaidBalanceThresholdConfiguration.PaymentGateConfig;
7086
+
7087
+ /**
7088
+ * Specify the amount the balance should be recharged to.
7089
+ */
7090
+ recharge_to_amount?: number;
7091
+
7092
+ /**
7093
+ * Specify the threshold amount for the contract. Each time the contract's balance
7094
+ * lowers to this amount, a threshold charge will be initiated.
7095
+ */
7096
+ threshold_amount?: number;
7097
+ }
7098
+
7099
+ export namespace UpdatePrepaidBalanceThresholdConfiguration {
7100
+ export interface Commit {
7101
+ /**
7102
+ * Which products the threshold commit applies to. If both applicable_product_ids
7103
+ * and applicable_product_tags are not provided, the commit applies to all
7104
+ * products.
7105
+ */
7106
+ applicable_product_ids?: Array<string> | null;
7107
+
7108
+ /**
7109
+ * Which tags the threshold commit applies to. If both applicable_product_ids and
7110
+ * applicable_product_tags are not provided, the commit applies to all products.
7111
+ */
7112
+ applicable_product_tags?: Array<string> | null;
7113
+
7114
+ description?: string;
7115
+
7116
+ /**
7117
+ * Specify the name of the line item for the threshold charge. If left blank, it
7118
+ * will default to the commit product name.
7119
+ */
7120
+ name?: string;
7121
+
7122
+ /**
7123
+ * The commit product that will be used to generate the line item for commit
7124
+ * payment.
7125
+ */
7126
+ product_id?: string;
7127
+
7128
+ /**
7129
+ * List of filters that determine what kind of customer usage draws down a commit
7130
+ * or credit. A customer's usage needs to meet the condition of at least one of the
7131
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
7132
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
7133
+ */
7134
+ specifiers?: Array<Commit.Specifier> | null;
7135
+ }
7136
+
7137
+ export namespace Commit {
7138
+ export interface Specifier {
7139
+ presentation_group_values?: { [key: string]: string };
7140
+
7141
+ pricing_group_values?: { [key: string]: string };
7142
+
7143
+ /**
7144
+ * If provided, the specifier will only apply to the product with the specified ID.
7145
+ */
7146
+ product_id?: string;
7147
+
7148
+ /**
7149
+ * If provided, the specifier will only apply to products with all the specified
7150
+ * tags.
7151
+ */
7152
+ product_tags?: Array<string>;
7153
+ }
7154
+ }
7155
+
7156
+ export interface PaymentGateConfig {
7157
+ /**
7158
+ * Gate access to the commit balance based on successful collection of payment.
7159
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
7160
+ * facilitate payment using your own payment integration. Select NONE if you do not
7161
+ * wish to payment gate the commit balance.
7162
+ */
7163
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
7164
+
7165
+ /**
7166
+ * Only applicable if using PRECALCULATED as your tax type.
7167
+ */
7168
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
7169
+
7170
+ /**
7171
+ * Only applicable if using STRIPE as your payment gateway type.
7172
+ */
7173
+ stripe_config?: PaymentGateConfig.StripeConfig;
7174
+
7175
+ /**
7176
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
7177
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
7178
+ * will default to NONE.
7179
+ */
7180
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
7181
+ }
7182
+
7183
+ export namespace PaymentGateConfig {
7184
+ /**
7185
+ * Only applicable if using PRECALCULATED as your tax type.
7186
+ */
7187
+ export interface PrecalculatedTaxConfig {
7188
+ /**
7189
+ * Amount of tax to be applied. This should be in the same currency and
7190
+ * denomination as the commit's invoice schedule
7191
+ */
7192
+ tax_amount: number;
7193
+
7194
+ /**
7195
+ * Name of the tax to be applied. This may be used in an invoice line item
7196
+ * description.
7197
+ */
7198
+ tax_name?: string;
7199
+ }
7200
+
7201
+ /**
7202
+ * Only applicable if using STRIPE as your payment gateway type.
7203
+ */
7204
+ export interface StripeConfig {
7205
+ /**
7206
+ * If left blank, will default to INVOICE
7207
+ */
7208
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
7209
+
7210
+ /**
7211
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
7212
+ * your payment type.
7213
+ */
7214
+ invoice_metadata?: { [key: string]: string };
7215
+ }
7216
+ }
7217
+ }
7218
+
7219
+ export interface UpdateRecurringCommit {
7220
+ recurring_commit_id: string;
7221
+
7222
+ access_amount?: UpdateRecurringCommit.AccessAmount;
7223
+
7224
+ ending_before?: string | null;
7225
+
7226
+ invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
7227
+ }
7228
+
7229
+ export namespace UpdateRecurringCommit {
7230
+ export interface AccessAmount {
7231
+ quantity?: number;
7232
+
7233
+ unit_price?: number;
7234
+ }
7235
+
7236
+ export interface InvoiceAmount {
7237
+ quantity?: number;
7238
+
7239
+ unit_price?: number;
7240
+ }
7241
+ }
7242
+
7243
+ export interface UpdateRecurringCredit {
7244
+ recurring_credit_id: string;
7245
+
7246
+ access_amount?: UpdateRecurringCredit.AccessAmount;
7247
+
7248
+ ending_before?: string | null;
7249
+ }
7250
+
7251
+ export namespace UpdateRecurringCredit {
7252
+ export interface AccessAmount {
7253
+ quantity?: number;
7254
+
7255
+ unit_price?: number;
7256
+ }
4278
7257
  }
4279
7258
 
4280
7259
  export interface UpdateScheduledCharge {
@@ -4322,6 +7301,137 @@ export namespace ContractEditParams {
4322
7301
  }
4323
7302
  }
4324
7303
  }
7304
+
7305
+ export interface UpdateSpendThresholdConfiguration {
7306
+ commit?: UpdateSpendThresholdConfiguration.Commit;
7307
+
7308
+ /**
7309
+ * When set to false, the contract will not be evaluated against the
7310
+ * threshold_amount. Toggling to true will result an immediate evaluation,
7311
+ * regardless of prior state.
7312
+ */
7313
+ is_enabled?: boolean;
7314
+
7315
+ payment_gate_config?: UpdateSpendThresholdConfiguration.PaymentGateConfig;
7316
+
7317
+ /**
7318
+ * Specify the threshold amount for the contract. Each time the contract's usage
7319
+ * hits this amount, a threshold charge will be initiated.
7320
+ */
7321
+ threshold_amount?: number;
7322
+ }
7323
+
7324
+ export namespace UpdateSpendThresholdConfiguration {
7325
+ export interface Commit {
7326
+ description?: string;
7327
+
7328
+ /**
7329
+ * Specify the name of the line item for the threshold charge. If left blank, it
7330
+ * will default to the commit product name.
7331
+ */
7332
+ name?: string;
7333
+
7334
+ /**
7335
+ * The commit product that will be used to generate the line item for commit
7336
+ * payment.
7337
+ */
7338
+ product_id?: string;
7339
+ }
7340
+
7341
+ export interface PaymentGateConfig {
7342
+ /**
7343
+ * Gate access to the commit balance based on successful collection of payment.
7344
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
7345
+ * facilitate payment using your own payment integration. Select NONE if you do not
7346
+ * wish to payment gate the commit balance.
7347
+ */
7348
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
7349
+
7350
+ /**
7351
+ * Only applicable if using PRECALCULATED as your tax type.
7352
+ */
7353
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
7354
+
7355
+ /**
7356
+ * Only applicable if using STRIPE as your payment gateway type.
7357
+ */
7358
+ stripe_config?: PaymentGateConfig.StripeConfig;
7359
+
7360
+ /**
7361
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
7362
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
7363
+ * will default to NONE.
7364
+ */
7365
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
7366
+ }
7367
+
7368
+ export namespace PaymentGateConfig {
7369
+ /**
7370
+ * Only applicable if using PRECALCULATED as your tax type.
7371
+ */
7372
+ export interface PrecalculatedTaxConfig {
7373
+ /**
7374
+ * Amount of tax to be applied. This should be in the same currency and
7375
+ * denomination as the commit's invoice schedule
7376
+ */
7377
+ tax_amount: number;
7378
+
7379
+ /**
7380
+ * Name of the tax to be applied. This may be used in an invoice line item
7381
+ * description.
7382
+ */
7383
+ tax_name?: string;
7384
+ }
7385
+
7386
+ /**
7387
+ * Only applicable if using STRIPE as your payment gateway type.
7388
+ */
7389
+ export interface StripeConfig {
7390
+ /**
7391
+ * If left blank, will default to INVOICE
7392
+ */
7393
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
7394
+
7395
+ /**
7396
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
7397
+ * your payment type.
7398
+ */
7399
+ invoice_metadata?: { [key: string]: string };
7400
+ }
7401
+ }
7402
+ }
7403
+
7404
+ export interface UpdateSubscription {
7405
+ subscription_id: string;
7406
+
7407
+ ending_before?: string | null;
7408
+
7409
+ /**
7410
+ * Quantity changes are applied on the effective date based on the order which they
7411
+ * are sent. For example, if I scheduled the quantity to be 12 on May 21 and then
7412
+ * scheduled a quantity delta change of -1, the result from that day would be 11.
7413
+ */
7414
+ quantity_updates?: Array<UpdateSubscription.QuantityUpdate>;
7415
+ }
7416
+
7417
+ export namespace UpdateSubscription {
7418
+ export interface QuantityUpdate {
7419
+ starting_at: string;
7420
+
7421
+ /**
7422
+ * The new quantity for the subscription. Must be provided if quantity_delta is not
7423
+ * provided. Must be non-negative.
7424
+ */
7425
+ quantity?: number;
7426
+
7427
+ /**
7428
+ * The delta to add to the subscription's quantity. Must be provided if quantity is
7429
+ * not provided. Can't be zero. It also can't result in a negative quantity on the
7430
+ * subscription.
7431
+ */
7432
+ quantity_delta?: number;
7433
+ }
7434
+ }
4325
7435
  }
4326
7436
 
4327
7437
  export interface ContractEditCommitParams {
@@ -4338,14 +7448,16 @@ export interface ContractEditCommitParams {
4338
7448
  access_schedule?: ContractEditCommitParams.AccessSchedule;
4339
7449
 
4340
7450
  /**
4341
- * Which products the commit applies to. If both applicable_product_ids and
4342
- * applicable_product_tags are not provided, the commit applies to all products.
7451
+ * Which products the commit applies to. If applicable_product_ids,
7452
+ * applicable_product_tags or specifiers are not provided, the commit applies to
7453
+ * all products.
4343
7454
  */
4344
7455
  applicable_product_ids?: Array<string> | null;
4345
7456
 
4346
7457
  /**
4347
- * Which tags the commit applies to. If both applicable_product_ids and
4348
- * applicable_product_tags are not provided, the commit applies to all products.
7458
+ * Which tags the commit applies to. If applicable_product_ids,
7459
+ * applicable_product_tags or specifiers are not provided, the commit applies to
7460
+ * all products.
4349
7461
  */
4350
7462
  applicable_product_tags?: Array<string> | null;
4351
7463
 
@@ -4357,6 +7469,14 @@ export interface ContractEditCommitParams {
4357
7469
  invoice_schedule?: ContractEditCommitParams.InvoiceSchedule;
4358
7470
 
4359
7471
  product_id?: string;
7472
+
7473
+ /**
7474
+ * List of filters that determine what kind of customer usage draws down a commit
7475
+ * or credit. A customer's usage needs to meet the condition of at least one of the
7476
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
7477
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
7478
+ */
7479
+ specifiers?: Array<ContractEditCommitParams.Specifier> | null;
4360
7480
  }
4361
7481
 
4362
7482
  export namespace ContractEditCommitParams {
@@ -4427,6 +7547,23 @@ export namespace ContractEditCommitParams {
4427
7547
  unit_price?: number;
4428
7548
  }
4429
7549
  }
7550
+
7551
+ export interface Specifier {
7552
+ presentation_group_values?: { [key: string]: string };
7553
+
7554
+ pricing_group_values?: { [key: string]: string };
7555
+
7556
+ /**
7557
+ * If provided, the specifier will only apply to the product with the specified ID.
7558
+ */
7559
+ product_id?: string;
7560
+
7561
+ /**
7562
+ * If provided, the specifier will only apply to products with all the specified
7563
+ * tags.
7564
+ */
7565
+ product_tags?: Array<string>;
7566
+ }
4430
7567
  }
4431
7568
 
4432
7569
  export interface ContractEditCreditParams {
@@ -4455,6 +7592,14 @@ export interface ContractEditCreditParams {
4455
7592
  applicable_product_tags?: Array<string> | null;
4456
7593
 
4457
7594
  product_id?: string;
7595
+
7596
+ /**
7597
+ * List of filters that determine what kind of customer usage draws down a commit
7598
+ * or credit. A customer's usage needs to meet the condition of at least one of the
7599
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
7600
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
7601
+ */
7602
+ specifiers?: Array<ContractEditCreditParams.Specifier> | null;
4458
7603
  }
4459
7604
 
4460
7605
  export namespace ContractEditCreditParams {
@@ -4489,6 +7634,23 @@ export namespace ContractEditCreditParams {
4489
7634
  starting_at?: string;
4490
7635
  }
4491
7636
  }
7637
+
7638
+ export interface Specifier {
7639
+ presentation_group_values?: { [key: string]: string };
7640
+
7641
+ pricing_group_values?: { [key: string]: string };
7642
+
7643
+ /**
7644
+ * If provided, the specifier will only apply to the product with the specified ID.
7645
+ */
7646
+ product_id?: string;
7647
+
7648
+ /**
7649
+ * If provided, the specifier will only apply to products with all the specified
7650
+ * tags.
7651
+ */
7652
+ product_tags?: Array<string>;
7653
+ }
4492
7654
  }
4493
7655
 
4494
7656
  export interface ContractGetEditHistoryParams {