@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,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import * as Shared from './shared';
3
+ import * as Shared from "./shared.js";
4
4
 
5
5
  export interface BaseUsageFilter {
6
6
  group_key: string;
@@ -34,6 +34,12 @@ export interface Commit {
34
34
 
35
35
  applicable_product_tags?: Array<string>;
36
36
 
37
+ /**
38
+ * RFC 3339 timestamp indicating when the commit was archived. If not provided, the
39
+ * commit is not archived.
40
+ */
41
+ archived_at?: string;
42
+
37
43
  /**
38
44
  * The current balance of the credit or commit. This balance reflects the amount of
39
45
  * credit or commit that the customer has access to use at this moment - thus,
@@ -48,10 +54,15 @@ export interface Commit {
48
54
 
49
55
  contract?: Commit.Contract;
50
56
 
51
- custom_fields?: Record<string, string>;
57
+ custom_fields?: { [key: string]: string };
52
58
 
53
59
  description?: string;
54
60
 
61
+ /**
62
+ * Optional configuration for commit hierarchy access control
63
+ */
64
+ hierarchy_configuration?: Commit.HierarchyConfiguration;
65
+
55
66
  /**
56
67
  * The contract that this commit will be billed on.
57
68
  */
@@ -73,6 +84,7 @@ export interface Commit {
73
84
  | Commit.PrepaidCommitExpirationLedgerEntry
74
85
  | Commit.PrepaidCommitCanceledLedgerEntry
75
86
  | Commit.PrepaidCommitCreditedLedgerEntry
87
+ | Commit.PrepaidCommitSeatBasedAdjustmentLedgerEntry
76
88
  | Commit.PostpaidCommitInitialBalanceLedgerEntry
77
89
  | Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry
78
90
  | Commit.PostpaidCommitRolloverLedgerEntry
@@ -106,6 +118,13 @@ export interface Commit {
106
118
  */
107
119
  salesforce_opportunity_id?: string;
108
120
 
121
+ /**
122
+ * List of filters that determine what kind of customer usage draws down a commit
123
+ * or credit. A customer's usage needs to meet the condition of at least one of the
124
+ * specifiers to contribute to a commit's or credit's drawdown.
125
+ */
126
+ specifiers?: Array<Commit.Specifier>;
127
+
109
128
  /**
110
129
  * Prevents the creation of duplicates. If a request to create a commit or credit
111
130
  * is made with a uniqueness key that was previously used to create a commit or
@@ -126,6 +145,32 @@ export namespace Commit {
126
145
  id: string;
127
146
  }
128
147
 
148
+ /**
149
+ * Optional configuration for commit hierarchy access control
150
+ */
151
+ export interface HierarchyConfiguration {
152
+ child_access:
153
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
154
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
155
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
156
+ }
157
+
158
+ export namespace HierarchyConfiguration {
159
+ export interface CommitHierarchyChildAccessAll {
160
+ type: 'ALL';
161
+ }
162
+
163
+ export interface CommitHierarchyChildAccessNone {
164
+ type: 'NONE';
165
+ }
166
+
167
+ export interface CommitHierarchyChildAccessContractIDs {
168
+ contract_ids: Array<string>;
169
+
170
+ type: 'CONTRACT_IDS';
171
+ }
172
+ }
173
+
129
174
  /**
130
175
  * The contract that this commit will be billed on.
131
176
  */
@@ -201,6 +246,16 @@ export namespace Commit {
201
246
  type: 'PREPAID_COMMIT_CREDITED';
202
247
  }
203
248
 
249
+ export interface PrepaidCommitSeatBasedAdjustmentLedgerEntry {
250
+ amount: number;
251
+
252
+ segment_id: string;
253
+
254
+ timestamp: string;
255
+
256
+ type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
257
+ }
258
+
204
259
  export interface PostpaidCommitInitialBalanceLedgerEntry {
205
260
  amount: number;
206
261
 
@@ -276,6 +331,23 @@ export namespace Commit {
276
331
 
277
332
  contract_id: string;
278
333
  }
334
+
335
+ export interface Specifier {
336
+ presentation_group_values?: { [key: string]: string };
337
+
338
+ pricing_group_values?: { [key: string]: string };
339
+
340
+ /**
341
+ * If provided, the specifier will only apply to the product with the specified ID.
342
+ */
343
+ product_id?: string;
344
+
345
+ /**
346
+ * If provided, the specifier will only apply to products with all the specified
347
+ * tags.
348
+ */
349
+ product_tags?: Array<string>;
350
+ }
279
351
  }
280
352
 
281
353
  export interface ContractWithoutAmendments {
@@ -304,6 +376,14 @@ export interface ContractWithoutAmendments {
304
376
 
305
377
  ending_before?: string;
306
378
 
379
+ /**
380
+ * Either a **parent** configuration with a list of children or a **child**
381
+ * configuration with a single parent.
382
+ */
383
+ hierarchy_configuration?:
384
+ | ContractWithoutAmendments.ParentHierarchyConfiguration
385
+ | ContractWithoutAmendments.ChildHierarchyConfiguration;
386
+
307
387
  name?: string;
308
388
 
309
389
  net_payment_terms_days?: number;
@@ -313,6 +393,8 @@ export interface ContractWithoutAmendments {
313
393
  */
314
394
  netsuite_sales_order_id?: string;
315
395
 
396
+ prepaid_balance_threshold_configuration?: ContractWithoutAmendments.PrepaidBalanceThresholdConfiguration;
397
+
316
398
  /**
317
399
  * This field's availability is dependent on your client's configuration.
318
400
  */
@@ -343,7 +425,7 @@ export interface ContractWithoutAmendments {
343
425
  */
344
426
  scheduled_charges_on_usage_invoices?: 'ALL';
345
427
 
346
- threshold_billing_configuration?: ContractWithoutAmendments.ThresholdBillingConfiguration;
428
+ spend_threshold_configuration?: ContractWithoutAmendments.SpendThresholdConfiguration;
347
429
 
348
430
  /**
349
431
  * This field's availability is dependent on your client's configuration.
@@ -368,7 +450,191 @@ export namespace ContractWithoutAmendments {
368
450
  */
369
451
  billing_anchor_date: string;
370
452
 
371
- frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
453
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
454
+ }
455
+
456
+ export interface ParentHierarchyConfiguration {
457
+ /**
458
+ * List of contracts that belong to this parent.
459
+ */
460
+ children: Array<ParentHierarchyConfiguration.Child>;
461
+ }
462
+
463
+ export namespace ParentHierarchyConfiguration {
464
+ export interface Child {
465
+ contract_id: string;
466
+
467
+ customer_id: string;
468
+ }
469
+ }
470
+
471
+ export interface ChildHierarchyConfiguration {
472
+ /**
473
+ * The single parent contract/customer for this child.
474
+ */
475
+ parent: ChildHierarchyConfiguration.Parent;
476
+ }
477
+
478
+ export namespace ChildHierarchyConfiguration {
479
+ /**
480
+ * The single parent contract/customer for this child.
481
+ */
482
+ export interface Parent {
483
+ contract_id: string;
484
+
485
+ customer_id: string;
486
+ }
487
+ }
488
+
489
+ export interface PrepaidBalanceThresholdConfiguration {
490
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
491
+
492
+ /**
493
+ * When set to false, the contract will not be evaluated against the
494
+ * threshold_amount. Toggling to true will result an immediate evaluation,
495
+ * regardless of prior state.
496
+ */
497
+ is_enabled: boolean;
498
+
499
+ payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
500
+
501
+ /**
502
+ * Specify the amount the balance should be recharged to.
503
+ */
504
+ recharge_to_amount: number;
505
+
506
+ /**
507
+ * Specify the threshold amount for the contract. Each time the contract's prepaid
508
+ * balance lowers to this amount, a threshold charge will be initiated.
509
+ */
510
+ threshold_amount: number;
511
+
512
+ /**
513
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
514
+ * commit amount will be in terms of this credit type instead of the fiat currency.
515
+ */
516
+ custom_credit_type_id?: string;
517
+ }
518
+
519
+ export namespace PrepaidBalanceThresholdConfiguration {
520
+ export interface Commit {
521
+ /**
522
+ * The commit product that will be used to generate the line item for commit
523
+ * payment.
524
+ */
525
+ product_id: string;
526
+
527
+ /**
528
+ * Which products the threshold commit applies to. If applicable_product_ids,
529
+ * applicable_product_tags or specifiers are not provided, the commit applies to
530
+ * all products.
531
+ */
532
+ applicable_product_ids?: Array<string>;
533
+
534
+ /**
535
+ * Which tags the threshold commit applies to. If applicable_product_ids,
536
+ * applicable_product_tags or specifiers are not provided, the commit applies to
537
+ * all products.
538
+ */
539
+ applicable_product_tags?: Array<string>;
540
+
541
+ description?: string;
542
+
543
+ /**
544
+ * Specify the name of the line item for the threshold charge. If left blank, it
545
+ * will default to the commit product name.
546
+ */
547
+ name?: string;
548
+
549
+ /**
550
+ * List of filters that determine what kind of customer usage draws down a commit
551
+ * or credit. A customer's usage needs to meet the condition of at least one of the
552
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
553
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
554
+ */
555
+ specifiers?: Array<Commit.Specifier>;
556
+ }
557
+
558
+ export namespace Commit {
559
+ export interface Specifier {
560
+ presentation_group_values?: { [key: string]: string };
561
+
562
+ pricing_group_values?: { [key: string]: string };
563
+
564
+ /**
565
+ * If provided, the specifier will only apply to the product with the specified ID.
566
+ */
567
+ product_id?: string;
568
+
569
+ /**
570
+ * If provided, the specifier will only apply to products with all the specified
571
+ * tags.
572
+ */
573
+ product_tags?: Array<string>;
574
+ }
575
+ }
576
+
577
+ export interface PaymentGateConfig {
578
+ /**
579
+ * Gate access to the commit balance based on successful collection of payment.
580
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
581
+ * facilitate payment using your own payment integration. Select NONE if you do not
582
+ * wish to payment gate the commit balance.
583
+ */
584
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
585
+
586
+ /**
587
+ * Only applicable if using PRECALCULATED as your tax type.
588
+ */
589
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
590
+
591
+ /**
592
+ * Only applicable if using STRIPE as your payment gate type.
593
+ */
594
+ stripe_config?: PaymentGateConfig.StripeConfig;
595
+
596
+ /**
597
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
598
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
599
+ * will default to NONE.
600
+ */
601
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
602
+ }
603
+
604
+ export namespace PaymentGateConfig {
605
+ /**
606
+ * Only applicable if using PRECALCULATED as your tax type.
607
+ */
608
+ export interface PrecalculatedTaxConfig {
609
+ /**
610
+ * Amount of tax to be applied. This should be in the same currency and
611
+ * denomination as the commit's invoice schedule
612
+ */
613
+ tax_amount: number;
614
+
615
+ /**
616
+ * Name of the tax to be applied. This may be used in an invoice line item
617
+ * description.
618
+ */
619
+ tax_name?: string;
620
+ }
621
+
622
+ /**
623
+ * Only applicable if using STRIPE as your payment gate type.
624
+ */
625
+ export interface StripeConfig {
626
+ /**
627
+ * If left blank, will default to INVOICE
628
+ */
629
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
630
+
631
+ /**
632
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
633
+ * your payment type.
634
+ */
635
+ invoice_metadata?: { [key: string]: string };
636
+ }
637
+ }
372
638
  }
373
639
 
374
640
  export interface RecurringCommit {
@@ -423,6 +689,11 @@ export namespace ContractWithoutAmendments {
423
689
  */
424
690
  ending_before?: string;
425
691
 
692
+ /**
693
+ * Optional configuration for recurring commit/credit hierarchy access control
694
+ */
695
+ hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
696
+
426
697
  /**
427
698
  * The amount the customer should be billed for the commit. Not required.
428
699
  */
@@ -448,10 +719,10 @@ export namespace ContractWithoutAmendments {
448
719
  * The frequency at which the recurring commits will be created. If not provided: -
449
720
  * The commits will be created on the usage invoice frequency. If provided: - The
450
721
  * period defined in the duration will correspond to this frequency. - Commits will
451
- * be created aligned with the recurring commit's start_date rather than the usage
722
+ * be created aligned with the recurring commit's starting_at rather than the usage
452
723
  * invoice dates.
453
724
  */
454
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
725
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
455
726
 
456
727
  /**
457
728
  * Will be passed down to the individual commits. This controls how much of an
@@ -459,6 +730,13 @@ export namespace ContractWithoutAmendments {
459
730
  * between 0 and 1.
460
731
  */
461
732
  rollover_fraction?: number;
733
+
734
+ /**
735
+ * List of filters that determine what kind of customer usage draws down a commit
736
+ * or credit. A customer's usage needs to meet the condition of at least one of the
737
+ * specifiers to contribute to a commit's or credit's drawdown.
738
+ */
739
+ specifiers?: Array<RecurringCommit.Specifier>;
462
740
  }
463
741
 
464
742
  export namespace RecurringCommit {
@@ -468,9 +746,9 @@ export namespace ContractWithoutAmendments {
468
746
  export interface AccessAmount {
469
747
  credit_type_id: string;
470
748
 
471
- quantity: number;
472
-
473
749
  unit_price: number;
750
+
751
+ quantity?: number;
474
752
  }
475
753
 
476
754
  /**
@@ -492,6 +770,32 @@ export namespace ContractWithoutAmendments {
492
770
  id: string;
493
771
  }
494
772
 
773
+ /**
774
+ * Optional configuration for recurring commit/credit hierarchy access control
775
+ */
776
+ export interface HierarchyConfiguration {
777
+ child_access:
778
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
779
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
780
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
781
+ }
782
+
783
+ export namespace HierarchyConfiguration {
784
+ export interface CommitHierarchyChildAccessAll {
785
+ type: 'ALL';
786
+ }
787
+
788
+ export interface CommitHierarchyChildAccessNone {
789
+ type: 'NONE';
790
+ }
791
+
792
+ export interface CommitHierarchyChildAccessContractIDs {
793
+ contract_ids: Array<string>;
794
+
795
+ type: 'CONTRACT_IDS';
796
+ }
797
+ }
798
+
495
799
  /**
496
800
  * The amount the customer should be billed for the commit. Not required.
497
801
  */
@@ -502,6 +806,23 @@ export namespace ContractWithoutAmendments {
502
806
 
503
807
  unit_price: number;
504
808
  }
809
+
810
+ export interface Specifier {
811
+ presentation_group_values?: { [key: string]: string };
812
+
813
+ pricing_group_values?: { [key: string]: string };
814
+
815
+ /**
816
+ * If provided, the specifier will only apply to the product with the specified ID.
817
+ */
818
+ product_id?: string;
819
+
820
+ /**
821
+ * If provided, the specifier will only apply to products with all the specified
822
+ * tags.
823
+ */
824
+ product_tags?: Array<string>;
825
+ }
505
826
  }
506
827
 
507
828
  export interface RecurringCredit {
@@ -556,6 +877,11 @@ export namespace ContractWithoutAmendments {
556
877
  */
557
878
  ending_before?: string;
558
879
 
880
+ /**
881
+ * Optional configuration for recurring commit/credit hierarchy access control
882
+ */
883
+ hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
884
+
559
885
  /**
560
886
  * Displayed on invoices. Will be passed through to the individual commits
561
887
  */
@@ -576,10 +902,10 @@ export namespace ContractWithoutAmendments {
576
902
  * The frequency at which the recurring commits will be created. If not provided: -
577
903
  * The commits will be created on the usage invoice frequency. If provided: - The
578
904
  * period defined in the duration will correspond to this frequency. - Commits will
579
- * be created aligned with the recurring commit's start_date rather than the usage
905
+ * be created aligned with the recurring commit's starting_at rather than the usage
580
906
  * invoice dates.
581
907
  */
582
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
908
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
583
909
 
584
910
  /**
585
911
  * Will be passed down to the individual commits. This controls how much of an
@@ -587,6 +913,13 @@ export namespace ContractWithoutAmendments {
587
913
  * between 0 and 1.
588
914
  */
589
915
  rollover_fraction?: number;
916
+
917
+ /**
918
+ * List of filters that determine what kind of customer usage draws down a commit
919
+ * or credit. A customer's usage needs to meet the condition of at least one of the
920
+ * specifiers to contribute to a commit's or credit's drawdown.
921
+ */
922
+ specifiers?: Array<RecurringCredit.Specifier>;
590
923
  }
591
924
 
592
925
  export namespace RecurringCredit {
@@ -596,9 +929,9 @@ export namespace ContractWithoutAmendments {
596
929
  export interface AccessAmount {
597
930
  credit_type_id: string;
598
931
 
599
- quantity: number;
600
-
601
932
  unit_price: number;
933
+
934
+ quantity?: number;
602
935
  }
603
936
 
604
937
  /**
@@ -619,6 +952,49 @@ export namespace ContractWithoutAmendments {
619
952
  export interface Contract {
620
953
  id: string;
621
954
  }
955
+
956
+ /**
957
+ * Optional configuration for recurring commit/credit hierarchy access control
958
+ */
959
+ export interface HierarchyConfiguration {
960
+ child_access:
961
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
962
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
963
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
964
+ }
965
+
966
+ export namespace HierarchyConfiguration {
967
+ export interface CommitHierarchyChildAccessAll {
968
+ type: 'ALL';
969
+ }
970
+
971
+ export interface CommitHierarchyChildAccessNone {
972
+ type: 'NONE';
973
+ }
974
+
975
+ export interface CommitHierarchyChildAccessContractIDs {
976
+ contract_ids: Array<string>;
977
+
978
+ type: 'CONTRACT_IDS';
979
+ }
980
+ }
981
+
982
+ export interface Specifier {
983
+ presentation_group_values?: { [key: string]: string };
984
+
985
+ pricing_group_values?: { [key: string]: string };
986
+
987
+ /**
988
+ * If provided, the specifier will only apply to the product with the specified ID.
989
+ */
990
+ product_id?: string;
991
+
992
+ /**
993
+ * If provided, the specifier will only apply to products with all the specified
994
+ * tags.
995
+ */
996
+ product_tags?: Array<string>;
997
+ }
622
998
  }
623
999
 
624
1000
  export interface ResellerRoyalty {
@@ -649,16 +1025,18 @@ export namespace ContractWithoutAmendments {
649
1025
  reseller_contract_value?: number;
650
1026
  }
651
1027
 
652
- export interface ThresholdBillingConfiguration {
653
- commit: ThresholdBillingConfiguration.Commit;
1028
+ export interface SpendThresholdConfiguration {
1029
+ commit: SpendThresholdConfiguration.Commit;
654
1030
 
655
1031
  /**
656
1032
  * When set to false, the contract will not be evaluated against the
657
1033
  * threshold_amount. Toggling to true will result an immediate evaluation,
658
- * regardless of prior state
1034
+ * regardless of prior state.
659
1035
  */
660
1036
  is_enabled: boolean;
661
1037
 
1038
+ payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
1039
+
662
1040
  /**
663
1041
  * Specify the threshold amount for the contract. Each time the contract's usage
664
1042
  * hits this amount, a threshold charge will be initiated.
@@ -666,30 +1044,83 @@ export namespace ContractWithoutAmendments {
666
1044
  threshold_amount: number;
667
1045
  }
668
1046
 
669
- export namespace ThresholdBillingConfiguration {
1047
+ export namespace SpendThresholdConfiguration {
670
1048
  export interface Commit {
1049
+ /**
1050
+ * The commit product that will be used to generate the line item for commit
1051
+ * payment.
1052
+ */
671
1053
  product_id: string;
672
1054
 
1055
+ description?: string;
1056
+
673
1057
  /**
674
- * Which products the threshold commit applies to. If both applicable_product_ids
675
- * and applicable_product_tags are not provided, the commit applies to all
676
- * products.
1058
+ * Specify the name of the line item for the threshold charge. If left blank, it
1059
+ * will default to the commit product name.
677
1060
  */
678
- applicable_product_ids?: Array<string>;
1061
+ name?: string;
1062
+ }
679
1063
 
1064
+ export interface PaymentGateConfig {
680
1065
  /**
681
- * Which tags the threshold commit applies to. If both applicable_product_ids and
682
- * applicable_product_tags are not provided, the commit applies to all products.
1066
+ * Gate access to the commit balance based on successful collection of payment.
1067
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1068
+ * facilitate payment using your own payment integration. Select NONE if you do not
1069
+ * wish to payment gate the commit balance.
683
1070
  */
684
- applicable_product_tags?: Array<string>;
1071
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
685
1072
 
686
- description?: string;
1073
+ /**
1074
+ * Only applicable if using PRECALCULATED as your tax type.
1075
+ */
1076
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
687
1077
 
688
1078
  /**
689
- * Specify the name of the line item for the threshold charge. If left blank, it
690
- * will default to the commit product name.
1079
+ * Only applicable if using STRIPE as your payment gate type.
691
1080
  */
692
- name?: string;
1081
+ stripe_config?: PaymentGateConfig.StripeConfig;
1082
+
1083
+ /**
1084
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1085
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1086
+ * will default to NONE.
1087
+ */
1088
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1089
+ }
1090
+
1091
+ export namespace PaymentGateConfig {
1092
+ /**
1093
+ * Only applicable if using PRECALCULATED as your tax type.
1094
+ */
1095
+ export interface PrecalculatedTaxConfig {
1096
+ /**
1097
+ * Amount of tax to be applied. This should be in the same currency and
1098
+ * denomination as the commit's invoice schedule
1099
+ */
1100
+ tax_amount: number;
1101
+
1102
+ /**
1103
+ * Name of the tax to be applied. This may be used in an invoice line item
1104
+ * description.
1105
+ */
1106
+ tax_name?: string;
1107
+ }
1108
+
1109
+ /**
1110
+ * Only applicable if using STRIPE as your payment gate type.
1111
+ */
1112
+ export interface StripeConfig {
1113
+ /**
1114
+ * If left blank, will default to INVOICE
1115
+ */
1116
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1117
+
1118
+ /**
1119
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1120
+ * your payment type.
1121
+ */
1122
+ invoice_metadata?: { [key: string]: string };
1123
+ }
693
1124
  }
694
1125
  }
695
1126
 
@@ -744,10 +1175,15 @@ export interface Credit {
744
1175
 
745
1176
  contract?: Credit.Contract;
746
1177
 
747
- custom_fields?: Record<string, string>;
1178
+ custom_fields?: { [key: string]: string };
748
1179
 
749
1180
  description?: string;
750
1181
 
1182
+ /**
1183
+ * Optional configuration for credit hierarchy access control
1184
+ */
1185
+ hierarchy_configuration?: Credit.HierarchyConfiguration;
1186
+
751
1187
  /**
752
1188
  * A list of ordered events that impact the balance of a credit. For example, an
753
1189
  * invoice deduction or an expiration.
@@ -759,6 +1195,7 @@ export interface Credit {
759
1195
  | Credit.CreditCanceledLedgerEntry
760
1196
  | Credit.CreditCreditedLedgerEntry
761
1197
  | Credit.CreditManualLedgerEntry
1198
+ | Credit.CreditSeatBasedAdjustmentLedgerEntry
762
1199
  >;
763
1200
 
764
1201
  name?: string;
@@ -781,6 +1218,13 @@ export interface Credit {
781
1218
  */
782
1219
  salesforce_opportunity_id?: string;
783
1220
 
1221
+ /**
1222
+ * List of filters that determine what kind of customer usage draws down a commit
1223
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1224
+ * specifiers to contribute to a commit's or credit's drawdown.
1225
+ */
1226
+ specifiers?: Array<Credit.Specifier>;
1227
+
784
1228
  /**
785
1229
  * Prevents the creation of duplicates. If a request to create a commit or credit
786
1230
  * is made with a uniqueness key that was previously used to create a commit or
@@ -801,6 +1245,32 @@ export namespace Credit {
801
1245
  id: string;
802
1246
  }
803
1247
 
1248
+ /**
1249
+ * Optional configuration for credit hierarchy access control
1250
+ */
1251
+ export interface HierarchyConfiguration {
1252
+ child_access:
1253
+ | HierarchyConfiguration.CommitHierarchyChildAccessAll
1254
+ | HierarchyConfiguration.CommitHierarchyChildAccessNone
1255
+ | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1256
+ }
1257
+
1258
+ export namespace HierarchyConfiguration {
1259
+ export interface CommitHierarchyChildAccessAll {
1260
+ type: 'ALL';
1261
+ }
1262
+
1263
+ export interface CommitHierarchyChildAccessNone {
1264
+ type: 'NONE';
1265
+ }
1266
+
1267
+ export interface CommitHierarchyChildAccessContractIDs {
1268
+ contract_ids: Array<string>;
1269
+
1270
+ type: 'CONTRACT_IDS';
1271
+ }
1272
+ }
1273
+
804
1274
  export interface CreditSegmentStartLedgerEntry {
805
1275
  amount: number;
806
1276
 
@@ -866,6 +1336,33 @@ export namespace Credit {
866
1336
 
867
1337
  type: 'CREDIT_MANUAL';
868
1338
  }
1339
+
1340
+ export interface CreditSeatBasedAdjustmentLedgerEntry {
1341
+ amount: number;
1342
+
1343
+ segment_id: string;
1344
+
1345
+ timestamp: string;
1346
+
1347
+ type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
1348
+ }
1349
+
1350
+ export interface Specifier {
1351
+ presentation_group_values?: { [key: string]: string };
1352
+
1353
+ pricing_group_values?: { [key: string]: string };
1354
+
1355
+ /**
1356
+ * If provided, the specifier will only apply to the product with the specified ID.
1357
+ */
1358
+ product_id?: string;
1359
+
1360
+ /**
1361
+ * If provided, the specifier will only apply to products with all the specified
1362
+ * tags.
1363
+ */
1364
+ product_tags?: Array<string>;
1365
+ }
869
1366
  }
870
1367
 
871
1368
  export interface CreditTypeData {
@@ -881,7 +1378,7 @@ export interface Discount {
881
1378
 
882
1379
  schedule: SchedulePointInTime;
883
1380
 
884
- custom_fields?: Record<string, string>;
1381
+ custom_fields?: { [key: string]: string };
885
1382
 
886
1383
  name?: string;
887
1384
 
@@ -981,18 +1478,18 @@ export interface Override {
981
1478
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
982
1479
  * processors.
983
1480
  */
984
- value?: Record<string, unknown>;
1481
+ value?: { [key: string]: unknown };
985
1482
  }
986
1483
 
987
1484
  export namespace Override {
988
1485
  export interface OverrideSpecifier {
989
- billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL';
1486
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
990
1487
 
991
1488
  commit_ids?: Array<string>;
992
1489
 
993
- presentation_group_values?: Record<string, string | null>;
1490
+ presentation_group_values?: { [key: string]: string | null };
994
1491
 
995
- pricing_group_values?: Record<string, string>;
1492
+ pricing_group_values?: { [key: string]: string };
996
1493
 
997
1494
  product_id?: string;
998
1495
 
@@ -1018,7 +1515,7 @@ export namespace Override {
1018
1515
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1019
1516
  * processors.
1020
1517
  */
1021
- custom_rate?: Record<string, unknown>;
1518
+ custom_rate?: { [key: string]: unknown };
1022
1519
 
1023
1520
  /**
1024
1521
  * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
@@ -1103,7 +1600,7 @@ export interface ProService {
1103
1600
  */
1104
1601
  unit_price: number;
1105
1602
 
1106
- custom_fields?: Record<string, string>;
1603
+ custom_fields?: { [key: string]: string };
1107
1604
 
1108
1605
  description?: string;
1109
1606
 
@@ -1122,7 +1619,7 @@ export interface Rate {
1122
1619
  * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1123
1620
  * processors.
1124
1621
  */
1125
- custom_rate?: Record<string, unknown>;
1622
+ custom_rate?: { [key: string]: unknown };
1126
1623
 
1127
1624
  /**
1128
1625
  * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
@@ -1140,7 +1637,7 @@ export interface Rate {
1140
1637
  * if pricing groups are used, this will contain the values used to calculate the
1141
1638
  * price
1142
1639
  */
1143
- pricing_group_values?: Record<string, string>;
1640
+ pricing_group_values?: { [key: string]: string };
1144
1641
 
1145
1642
  /**
1146
1643
  * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
@@ -1167,7 +1664,9 @@ export interface ScheduledCharge {
1167
1664
 
1168
1665
  schedule: SchedulePointInTime;
1169
1666
 
1170
- custom_fields?: Record<string, string>;
1667
+ archived_at?: string;
1668
+
1669
+ custom_fields?: { [key: string]: string };
1171
1670
 
1172
1671
  /**
1173
1672
  * displayed on invoices
@@ -1218,13 +1717,13 @@ export namespace SchedulePointInTime {
1218
1717
 
1219
1718
  amount: number;
1220
1719
 
1221
- invoice_id: string;
1222
-
1223
1720
  quantity: number;
1224
1721
 
1225
1722
  timestamp: string;
1226
1723
 
1227
1724
  unit_price: number;
1725
+
1726
+ invoice_id?: string | null;
1228
1727
  }
1229
1728
  }
1230
1729