@metronome/sdk 3.6.0 → 3.8.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 (312) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/api-promise.d.mts +1 -0
  3. package/api-promise.d.mts.map +1 -1
  4. package/api-promise.d.ts +1 -0
  5. package/api-promise.d.ts.map +1 -1
  6. package/api-promise.mjs +1 -0
  7. package/api-promise.mjs.map +1 -1
  8. package/client.d.mts.map +1 -1
  9. package/client.d.ts.map +1 -1
  10. package/client.js +9 -1
  11. package/client.js.map +1 -1
  12. package/client.mjs +9 -1
  13. package/client.mjs.map +1 -1
  14. package/core/api-promise.d.mts.map +1 -1
  15. package/core/api-promise.d.ts.map +1 -1
  16. package/core/api-promise.mjs.map +1 -1
  17. package/core/error.mjs.map +1 -1
  18. package/core/pagination.d.mts.map +1 -1
  19. package/core/pagination.d.ts.map +1 -1
  20. package/core/pagination.mjs.map +1 -1
  21. package/core/resource.d.mts.map +1 -1
  22. package/core/resource.d.ts.map +1 -1
  23. package/core/uploads.d.mts.map +1 -1
  24. package/core/uploads.d.ts.map +1 -1
  25. package/core/uploads.mjs.map +1 -1
  26. package/error.d.mts +1 -0
  27. package/error.d.mts.map +1 -1
  28. package/error.d.ts +1 -0
  29. package/error.d.ts.map +1 -1
  30. package/error.mjs +1 -0
  31. package/error.mjs.map +1 -1
  32. package/index.d.mts.map +1 -1
  33. package/index.d.ts.map +1 -1
  34. package/index.mjs.map +1 -1
  35. package/internal/detect-platform.mjs.map +1 -1
  36. package/internal/headers.mjs.map +1 -1
  37. package/internal/parse.d.mts.map +1 -1
  38. package/internal/parse.d.ts.map +1 -1
  39. package/internal/parse.mjs.map +1 -1
  40. package/internal/qs/formats.d.mts.map +1 -1
  41. package/internal/qs/formats.d.ts.map +1 -1
  42. package/internal/qs/index.d.mts +2 -2
  43. package/internal/qs/index.d.mts.map +1 -1
  44. package/internal/qs/index.d.ts +2 -2
  45. package/internal/qs/index.d.ts.map +1 -1
  46. package/internal/qs/index.mjs.map +1 -1
  47. package/internal/qs/stringify.d.mts.map +1 -1
  48. package/internal/qs/stringify.d.ts.map +1 -1
  49. package/internal/qs/stringify.mjs.map +1 -1
  50. package/internal/qs/utils.d.mts.map +1 -1
  51. package/internal/qs/utils.d.ts.map +1 -1
  52. package/internal/qs/utils.mjs.map +1 -1
  53. package/internal/request-options.d.mts.map +1 -1
  54. package/internal/request-options.d.ts.map +1 -1
  55. package/internal/shims.d.mts +6 -0
  56. package/internal/shims.d.mts.map +1 -1
  57. package/internal/shims.d.ts +6 -0
  58. package/internal/shims.d.ts.map +1 -1
  59. package/internal/to-file.d.mts.map +1 -1
  60. package/internal/to-file.d.ts.map +1 -1
  61. package/internal/to-file.mjs.map +1 -1
  62. package/internal/types.d.mts +4 -4
  63. package/internal/types.d.mts.map +1 -1
  64. package/internal/types.d.ts +4 -4
  65. package/internal/types.d.ts.map +1 -1
  66. package/internal/uploads.d.mts.map +1 -1
  67. package/internal/uploads.d.ts.map +1 -1
  68. package/internal/uploads.mjs.map +1 -1
  69. package/internal/utils/base64.mjs.map +1 -1
  70. package/internal/utils/log.d.mts.map +1 -1
  71. package/internal/utils/log.d.ts.map +1 -1
  72. package/internal/utils/log.mjs.map +1 -1
  73. package/internal/utils/path.mjs.map +1 -1
  74. package/internal/utils/query.mjs.map +1 -1
  75. package/internal/utils/values.mjs.map +1 -1
  76. package/internal/utils.d.mts.map +1 -1
  77. package/internal/utils.d.ts.map +1 -1
  78. package/internal/utils.mjs.map +1 -1
  79. package/package.json +1 -1
  80. package/pagination.d.mts +1 -0
  81. package/pagination.d.mts.map +1 -1
  82. package/pagination.d.ts +1 -0
  83. package/pagination.d.ts.map +1 -1
  84. package/pagination.mjs +1 -0
  85. package/pagination.mjs.map +1 -1
  86. package/resource.d.mts +1 -0
  87. package/resource.d.mts.map +1 -1
  88. package/resource.d.ts +1 -0
  89. package/resource.d.ts.map +1 -1
  90. package/resource.mjs +1 -0
  91. package/resource.mjs.map +1 -1
  92. package/resources/index.d.mts.map +1 -1
  93. package/resources/index.d.ts.map +1 -1
  94. package/resources/index.mjs.map +1 -1
  95. package/resources/shared.d.mts +420 -4
  96. package/resources/shared.d.mts.map +1 -1
  97. package/resources/shared.d.ts +420 -4
  98. package/resources/shared.d.ts.map +1 -1
  99. package/resources/v1/alerts.d.mts +39 -0
  100. package/resources/v1/alerts.d.mts.map +1 -1
  101. package/resources/v1/alerts.d.ts +39 -0
  102. package/resources/v1/alerts.d.ts.map +1 -1
  103. package/resources/v1/alerts.mjs.map +1 -1
  104. package/resources/v1/audit-logs.d.mts.map +1 -1
  105. package/resources/v1/audit-logs.d.ts.map +1 -1
  106. package/resources/v1/audit-logs.mjs.map +1 -1
  107. package/resources/v1/billable-metrics.d.mts.map +1 -1
  108. package/resources/v1/billable-metrics.d.ts.map +1 -1
  109. package/resources/v1/billable-metrics.mjs.map +1 -1
  110. package/resources/v1/contracts/contracts.d.mts +674 -10
  111. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  112. package/resources/v1/contracts/contracts.d.ts +674 -10
  113. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  114. package/resources/v1/contracts/contracts.js +43 -0
  115. package/resources/v1/contracts/contracts.js.map +1 -1
  116. package/resources/v1/contracts/contracts.mjs +43 -0
  117. package/resources/v1/contracts/contracts.mjs.map +1 -1
  118. package/resources/v1/contracts/index.d.mts +1 -1
  119. package/resources/v1/contracts/index.d.mts.map +1 -1
  120. package/resources/v1/contracts/index.d.ts +1 -1
  121. package/resources/v1/contracts/index.d.ts.map +1 -1
  122. package/resources/v1/contracts/index.js.map +1 -1
  123. package/resources/v1/contracts/index.mjs.map +1 -1
  124. package/resources/v1/contracts/named-schedules.d.mts.map +1 -1
  125. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  126. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  127. package/resources/v1/contracts/products.d.mts.map +1 -1
  128. package/resources/v1/contracts/products.d.ts.map +1 -1
  129. package/resources/v1/contracts/products.mjs.map +1 -1
  130. package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -1
  131. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
  132. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
  133. package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -1
  134. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  135. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  136. package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -1
  137. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  138. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  139. package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -1
  140. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  141. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  142. package/resources/v1/contracts/rate-cards/rates.d.mts +4 -0
  143. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
  144. package/resources/v1/contracts/rate-cards/rates.d.ts +4 -0
  145. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  146. package/resources/v1/contracts/rate-cards/rates.js +4 -0
  147. package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
  148. package/resources/v1/contracts/rate-cards/rates.mjs +4 -0
  149. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  150. package/resources/v1/contracts/rate-cards.d.mts.map +1 -1
  151. package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
  152. package/resources/v1/contracts/rate-cards.mjs.map +1 -1
  153. package/resources/v1/contracts.d.mts.map +1 -1
  154. package/resources/v1/contracts.d.ts.map +1 -1
  155. package/resources/v1/contracts.mjs.map +1 -1
  156. package/resources/v1/credit-grants.d.mts.map +1 -1
  157. package/resources/v1/credit-grants.d.ts.map +1 -1
  158. package/resources/v1/credit-grants.mjs.map +1 -1
  159. package/resources/v1/custom-fields.d.mts.map +1 -1
  160. package/resources/v1/custom-fields.d.ts.map +1 -1
  161. package/resources/v1/custom-fields.mjs.map +1 -1
  162. package/resources/v1/customers/alerts.d.mts +79 -2
  163. package/resources/v1/customers/alerts.d.mts.map +1 -1
  164. package/resources/v1/customers/alerts.d.ts +79 -2
  165. package/resources/v1/customers/alerts.d.ts.map +1 -1
  166. package/resources/v1/customers/alerts.js +1 -1
  167. package/resources/v1/customers/alerts.mjs +1 -1
  168. package/resources/v1/customers/alerts.mjs.map +1 -1
  169. package/resources/v1/customers/billing-config.d.mts.map +1 -1
  170. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  171. package/resources/v1/customers/billing-config.mjs.map +1 -1
  172. package/resources/v1/customers/commits.d.mts.map +1 -1
  173. package/resources/v1/customers/commits.d.ts.map +1 -1
  174. package/resources/v1/customers/commits.mjs.map +1 -1
  175. package/resources/v1/customers/credits.d.mts.map +1 -1
  176. package/resources/v1/customers/credits.d.ts.map +1 -1
  177. package/resources/v1/customers/credits.mjs.map +1 -1
  178. package/resources/v1/customers/customers.d.mts.map +1 -1
  179. package/resources/v1/customers/customers.d.ts.map +1 -1
  180. package/resources/v1/customers/customers.mjs.map +1 -1
  181. package/resources/v1/customers/index.d.mts.map +1 -1
  182. package/resources/v1/customers/index.d.ts.map +1 -1
  183. package/resources/v1/customers/index.mjs.map +1 -1
  184. package/resources/v1/customers/invoices.d.mts +5 -0
  185. package/resources/v1/customers/invoices.d.mts.map +1 -1
  186. package/resources/v1/customers/invoices.d.ts +5 -0
  187. package/resources/v1/customers/invoices.d.ts.map +1 -1
  188. package/resources/v1/customers/invoices.mjs.map +1 -1
  189. package/resources/v1/customers/named-schedules.d.mts.map +1 -1
  190. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  191. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  192. package/resources/v1/customers/plans.d.mts.map +1 -1
  193. package/resources/v1/customers/plans.d.ts.map +1 -1
  194. package/resources/v1/customers/plans.mjs.map +1 -1
  195. package/resources/v1/customers.d.mts.map +1 -1
  196. package/resources/v1/customers.d.ts.map +1 -1
  197. package/resources/v1/customers.mjs.map +1 -1
  198. package/resources/v1/dashboards.d.mts +8 -3
  199. package/resources/v1/dashboards.d.mts.map +1 -1
  200. package/resources/v1/dashboards.d.ts +8 -3
  201. package/resources/v1/dashboards.d.ts.map +1 -1
  202. package/resources/v1/dashboards.js +7 -2
  203. package/resources/v1/dashboards.js.map +1 -1
  204. package/resources/v1/dashboards.mjs +7 -2
  205. package/resources/v1/dashboards.mjs.map +1 -1
  206. package/resources/v1/index.d.mts +1 -2
  207. package/resources/v1/index.d.mts.map +1 -1
  208. package/resources/v1/index.d.ts +1 -2
  209. package/resources/v1/index.d.ts.map +1 -1
  210. package/resources/v1/index.js +1 -3
  211. package/resources/v1/index.js.map +1 -1
  212. package/resources/v1/index.mjs +0 -1
  213. package/resources/v1/index.mjs.map +1 -1
  214. package/resources/v1/invoices.d.mts.map +1 -1
  215. package/resources/v1/invoices.d.ts.map +1 -1
  216. package/resources/v1/invoices.mjs.map +1 -1
  217. package/resources/v1/packages.d.mts +297 -13
  218. package/resources/v1/packages.d.mts.map +1 -1
  219. package/resources/v1/packages.d.ts +297 -13
  220. package/resources/v1/packages.d.ts.map +1 -1
  221. package/resources/v1/packages.js +3 -4
  222. package/resources/v1/packages.js.map +1 -1
  223. package/resources/v1/packages.mjs +3 -4
  224. package/resources/v1/packages.mjs.map +1 -1
  225. package/resources/v1/plans.d.mts.map +1 -1
  226. package/resources/v1/plans.d.ts.map +1 -1
  227. package/resources/v1/plans.mjs.map +1 -1
  228. package/resources/v1/pricing-units.d.mts.map +1 -1
  229. package/resources/v1/pricing-units.d.ts.map +1 -1
  230. package/resources/v1/pricing-units.mjs.map +1 -1
  231. package/resources/v1/services.d.mts.map +1 -1
  232. package/resources/v1/services.d.ts.map +1 -1
  233. package/resources/v1/services.mjs.map +1 -1
  234. package/resources/v1/settings/billing-providers.d.mts.map +1 -1
  235. package/resources/v1/settings/billing-providers.d.ts.map +1 -1
  236. package/resources/v1/settings/billing-providers.mjs.map +1 -1
  237. package/resources/v1/settings/index.d.mts.map +1 -1
  238. package/resources/v1/settings/index.d.ts.map +1 -1
  239. package/resources/v1/settings/index.mjs.map +1 -1
  240. package/resources/v1/settings/settings.d.mts.map +1 -1
  241. package/resources/v1/settings/settings.d.ts.map +1 -1
  242. package/resources/v1/settings/settings.mjs.map +1 -1
  243. package/resources/v1/settings.d.mts.map +1 -1
  244. package/resources/v1/settings.d.ts.map +1 -1
  245. package/resources/v1/settings.mjs.map +1 -1
  246. package/resources/v1/usage.d.mts.map +1 -1
  247. package/resources/v1/usage.d.ts.map +1 -1
  248. package/resources/v1/usage.mjs.map +1 -1
  249. package/resources/v1/v1.d.mts +2 -6
  250. package/resources/v1/v1.d.mts.map +1 -1
  251. package/resources/v1/v1.d.ts +2 -6
  252. package/resources/v1/v1.d.ts.map +1 -1
  253. package/resources/v1/v1.js +0 -4
  254. package/resources/v1/v1.js.map +1 -1
  255. package/resources/v1/v1.mjs +0 -4
  256. package/resources/v1/v1.mjs.map +1 -1
  257. package/resources/v1.d.mts.map +1 -1
  258. package/resources/v1.d.ts.map +1 -1
  259. package/resources/v1.mjs.map +1 -1
  260. package/resources/v2/contracts.d.mts +1762 -5
  261. package/resources/v2/contracts.d.mts.map +1 -1
  262. package/resources/v2/contracts.d.ts +1762 -5
  263. package/resources/v2/contracts.d.ts.map +1 -1
  264. package/resources/v2/contracts.mjs.map +1 -1
  265. package/resources/v2/index.d.mts.map +1 -1
  266. package/resources/v2/index.d.ts.map +1 -1
  267. package/resources/v2/index.mjs.map +1 -1
  268. package/resources/v2/v2.d.mts.map +1 -1
  269. package/resources/v2/v2.d.ts.map +1 -1
  270. package/resources/v2/v2.mjs.map +1 -1
  271. package/resources/v2.d.mts.map +1 -1
  272. package/resources/v2.d.ts.map +1 -1
  273. package/resources/v2.mjs.map +1 -1
  274. package/resources/webhooks.d.mts.map +1 -1
  275. package/resources/webhooks.d.ts.map +1 -1
  276. package/resources/webhooks.mjs.map +1 -1
  277. package/resources.d.mts.map +1 -1
  278. package/resources.d.ts.map +1 -1
  279. package/resources.mjs.map +1 -1
  280. package/src/client.ts +9 -1
  281. package/src/resources/shared.ts +524 -4
  282. package/src/resources/v1/alerts.ts +49 -0
  283. package/src/resources/v1/contracts/contracts.ts +850 -9
  284. package/src/resources/v1/contracts/index.ts +2 -0
  285. package/src/resources/v1/contracts/rate-cards/rates.ts +4 -0
  286. package/src/resources/v1/customers/alerts.ts +99 -2
  287. package/src/resources/v1/customers/invoices.ts +6 -0
  288. package/src/resources/v1/dashboards.ts +10 -3
  289. package/src/resources/v1/index.ts +2 -11
  290. package/src/resources/v1/packages.ts +372 -13
  291. package/src/resources/v1/v1.ts +4 -26
  292. package/src/resources/v2/contracts.ts +2271 -5
  293. package/src/version.ts +1 -1
  294. package/uploads.d.mts +1 -0
  295. package/uploads.d.mts.map +1 -1
  296. package/uploads.d.ts +1 -0
  297. package/uploads.d.ts.map +1 -1
  298. package/uploads.mjs +1 -0
  299. package/uploads.mjs.map +1 -1
  300. package/version.d.mts +1 -1
  301. package/version.d.ts +1 -1
  302. package/version.js +1 -1
  303. package/version.mjs +1 -1
  304. package/resources/v1/payments.d.mts +0 -127
  305. package/resources/v1/payments.d.mts.map +0 -1
  306. package/resources/v1/payments.d.ts +0 -127
  307. package/resources/v1/payments.d.ts.map +0 -1
  308. package/resources/v1/payments.js +0 -71
  309. package/resources/v1/payments.js.map +0 -1
  310. package/resources/v1/payments.mjs +0 -67
  311. package/resources/v1/payments.mjs.map +0 -1
  312. package/src/resources/v1/payments.ts +0 -187
@@ -145,10 +145,9 @@ export class Packages extends APIResource {
145
145
  *
146
146
  * ### **Usage guidelines:**
147
147
  *
148
- * Use the **`starting_at`**, **`covering_date`**,
149
- * and **`include_archived`** parameters to filter the list of returned contracts.
150
- * For example, to list only currently active contracts,
151
- * pass **`covering_date`** equal to the current time.
148
+ * Use the **`starting_at`**, **`covering_date`**, and **`include_archived`**
149
+ * parameters to filter the list of returned contracts. For example, to list only
150
+ * currently active contracts, pass **`covering_date`** equal to the current time.
152
151
  *
153
152
  * @example
154
153
  * ```ts
@@ -259,6 +258,8 @@ export namespace PackageRetrieveResponse {
259
258
 
260
259
  spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
261
260
 
261
+ spend_trackers?: Array<Data.SpendTracker>;
262
+
262
263
  subscriptions?: Array<Data.Subscription>;
263
264
 
264
265
  /**
@@ -429,6 +430,8 @@ export namespace PackageRetrieveResponse {
429
430
 
430
431
  export namespace Override {
431
432
  export interface OverrideSpecifier {
433
+ any_commit_or_credit_template_ids?: Array<string>;
434
+
432
435
  billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
433
436
 
434
437
  commit_template_ids?: Array<string>;
@@ -665,6 +668,11 @@ export namespace PackageRetrieveResponse {
665
668
  */
666
669
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
667
670
 
671
+ /**
672
+ * Rounding configuration for prorated recurring commit amounts.
673
+ */
674
+ proration_rounding?: RecurringCommit.ProrationRounding | null;
675
+
668
676
  /**
669
677
  * The frequency at which the recurring commits will be created. If not provided: -
670
678
  * The commits will be created on the usage invoice frequency. If provided: - The
@@ -672,7 +680,7 @@ export namespace PackageRetrieveResponse {
672
680
  * be created aligned with the recurring commit's starting_at rather than the usage
673
681
  * invoice dates.
674
682
  */
675
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
683
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
676
684
 
677
685
  /**
678
686
  * Will be passed down to the individual commits. This controls how much of an
@@ -752,6 +760,41 @@ export namespace PackageRetrieveResponse {
752
760
  unit_price: number;
753
761
  }
754
762
 
763
+ /**
764
+ * Rounding configuration for prorated recurring commit amounts.
765
+ */
766
+ export interface ProrationRounding {
767
+ access?: ProrationRounding.Access;
768
+
769
+ invoice?: ProrationRounding.Invoice;
770
+ }
771
+
772
+ export namespace ProrationRounding {
773
+ export interface Access {
774
+ /**
775
+ * Number of decimal places to round to. Applied directly to the stored monetary
776
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
777
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
778
+ * dollar).
779
+ */
780
+ decimal_places: number;
781
+
782
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
783
+ }
784
+
785
+ export interface Invoice {
786
+ /**
787
+ * Number of decimal places to round to. Applied directly to the stored monetary
788
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
789
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
790
+ * dollar).
791
+ */
792
+ decimal_places: number;
793
+
794
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
795
+ }
796
+ }
797
+
755
798
  /**
756
799
  * Attach a subscription to the recurring commit/credit.
757
800
  */
@@ -827,6 +870,11 @@ export namespace PackageRetrieveResponse {
827
870
  */
828
871
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
829
872
 
873
+ /**
874
+ * Rounding configuration for prorated recurring credit amounts.
875
+ */
876
+ proration_rounding?: RecurringCredit.ProrationRounding | null;
877
+
830
878
  /**
831
879
  * The frequency at which the recurring commits will be created. If not provided: -
832
880
  * The commits will be created on the usage invoice frequency. If provided: - The
@@ -834,7 +882,7 @@ export namespace PackageRetrieveResponse {
834
882
  * be created aligned with the recurring commit's starting_at rather than the usage
835
883
  * invoice dates.
836
884
  */
837
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
885
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
838
886
 
839
887
  /**
840
888
  * Will be passed down to the individual commits. This controls how much of an
@@ -903,6 +951,27 @@ export namespace PackageRetrieveResponse {
903
951
  value: number;
904
952
  }
905
953
 
954
+ /**
955
+ * Rounding configuration for prorated recurring credit amounts.
956
+ */
957
+ export interface ProrationRounding {
958
+ access?: ProrationRounding.Access;
959
+ }
960
+
961
+ export namespace ProrationRounding {
962
+ export interface Access {
963
+ /**
964
+ * Number of decimal places to round to. Applied directly to the stored monetary
965
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
966
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
967
+ * dollar).
968
+ */
969
+ decimal_places: number;
970
+
971
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
972
+ }
973
+ }
974
+
906
975
  /**
907
976
  * Attach a subscription to the recurring commit/credit.
908
977
  */
@@ -924,6 +993,29 @@ export namespace PackageRetrieveResponse {
924
993
  }
925
994
  }
926
995
 
996
+ export interface SpendTracker {
997
+ /**
998
+ * Human-readable identifier, unique per contract.
999
+ */
1000
+ alias: string;
1001
+
1002
+ applicable_spend_specifiers: Array<SpendTracker.ApplicableSpendSpecifier>;
1003
+
1004
+ credit_type_id: string;
1005
+
1006
+ reset_frequency: 'BILLING_PERIOD';
1007
+ }
1008
+
1009
+ export namespace SpendTracker {
1010
+ export interface ApplicableSpendSpecifier {
1011
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
1012
+
1013
+ spend_type: 'COMMIT_PURCHASE';
1014
+
1015
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
1016
+ }
1017
+ }
1018
+
927
1019
  export interface Subscription {
928
1020
  collection_schedule: 'ADVANCE' | 'ARREARS';
929
1021
 
@@ -933,6 +1025,8 @@ export namespace PackageRetrieveResponse {
933
1025
 
934
1026
  id?: string;
935
1027
 
1028
+ billing_cycle_config?: Subscription.BillingCycleConfig;
1029
+
936
1030
  /**
937
1031
  * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
938
1032
  */
@@ -971,6 +1065,22 @@ export namespace PackageRetrieveResponse {
971
1065
  invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
972
1066
 
973
1067
  is_prorated: boolean;
1068
+
1069
+ rounding?: Proration.Rounding;
1070
+ }
1071
+
1072
+ export namespace Proration {
1073
+ export interface Rounding {
1074
+ /**
1075
+ * Number of decimal places to round to. Applied directly to the stored monetary
1076
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
1077
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
1078
+ * dollar).
1079
+ */
1080
+ decimal_places: number;
1081
+
1082
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
1083
+ }
974
1084
  }
975
1085
 
976
1086
  export interface SubscriptionRate {
@@ -987,6 +1097,10 @@ export namespace PackageRetrieveResponse {
987
1097
  }
988
1098
  }
989
1099
 
1100
+ export interface BillingCycleConfig {
1101
+ invoice_placement?: 'ON_SCHEDULED_INVOICE' | 'ON_USAGE_INVOICE';
1102
+ }
1103
+
990
1104
  export interface Duration {
991
1105
  unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
992
1106
 
@@ -1086,6 +1200,8 @@ export interface PackageListResponse {
1086
1200
 
1087
1201
  spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
1088
1202
 
1203
+ spend_trackers?: Array<PackageListResponse.SpendTracker>;
1204
+
1089
1205
  subscriptions?: Array<PackageListResponse.Subscription>;
1090
1206
 
1091
1207
  /**
@@ -1256,6 +1372,8 @@ export namespace PackageListResponse {
1256
1372
 
1257
1373
  export namespace Override {
1258
1374
  export interface OverrideSpecifier {
1375
+ any_commit_or_credit_template_ids?: Array<string>;
1376
+
1259
1377
  billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1260
1378
 
1261
1379
  commit_template_ids?: Array<string>;
@@ -1492,6 +1610,11 @@ export namespace PackageListResponse {
1492
1610
  */
1493
1611
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1494
1612
 
1613
+ /**
1614
+ * Rounding configuration for prorated recurring commit amounts.
1615
+ */
1616
+ proration_rounding?: RecurringCommit.ProrationRounding | null;
1617
+
1495
1618
  /**
1496
1619
  * The frequency at which the recurring commits will be created. If not provided: -
1497
1620
  * The commits will be created on the usage invoice frequency. If provided: - The
@@ -1499,7 +1622,7 @@ export namespace PackageListResponse {
1499
1622
  * be created aligned with the recurring commit's starting_at rather than the usage
1500
1623
  * invoice dates.
1501
1624
  */
1502
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1625
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
1503
1626
 
1504
1627
  /**
1505
1628
  * Will be passed down to the individual commits. This controls how much of an
@@ -1579,6 +1702,41 @@ export namespace PackageListResponse {
1579
1702
  unit_price: number;
1580
1703
  }
1581
1704
 
1705
+ /**
1706
+ * Rounding configuration for prorated recurring commit amounts.
1707
+ */
1708
+ export interface ProrationRounding {
1709
+ access?: ProrationRounding.Access;
1710
+
1711
+ invoice?: ProrationRounding.Invoice;
1712
+ }
1713
+
1714
+ export namespace ProrationRounding {
1715
+ export interface Access {
1716
+ /**
1717
+ * Number of decimal places to round to. Applied directly to the stored monetary
1718
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
1719
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
1720
+ * dollar).
1721
+ */
1722
+ decimal_places: number;
1723
+
1724
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
1725
+ }
1726
+
1727
+ export interface Invoice {
1728
+ /**
1729
+ * Number of decimal places to round to. Applied directly to the stored monetary
1730
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
1731
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
1732
+ * dollar).
1733
+ */
1734
+ decimal_places: number;
1735
+
1736
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
1737
+ }
1738
+ }
1739
+
1582
1740
  /**
1583
1741
  * Attach a subscription to the recurring commit/credit.
1584
1742
  */
@@ -1654,6 +1812,11 @@ export namespace PackageListResponse {
1654
1812
  */
1655
1813
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1656
1814
 
1815
+ /**
1816
+ * Rounding configuration for prorated recurring credit amounts.
1817
+ */
1818
+ proration_rounding?: RecurringCredit.ProrationRounding | null;
1819
+
1657
1820
  /**
1658
1821
  * The frequency at which the recurring commits will be created. If not provided: -
1659
1822
  * The commits will be created on the usage invoice frequency. If provided: - The
@@ -1661,7 +1824,7 @@ export namespace PackageListResponse {
1661
1824
  * be created aligned with the recurring commit's starting_at rather than the usage
1662
1825
  * invoice dates.
1663
1826
  */
1664
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1827
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
1665
1828
 
1666
1829
  /**
1667
1830
  * Will be passed down to the individual commits. This controls how much of an
@@ -1730,6 +1893,27 @@ export namespace PackageListResponse {
1730
1893
  value: number;
1731
1894
  }
1732
1895
 
1896
+ /**
1897
+ * Rounding configuration for prorated recurring credit amounts.
1898
+ */
1899
+ export interface ProrationRounding {
1900
+ access?: ProrationRounding.Access;
1901
+ }
1902
+
1903
+ export namespace ProrationRounding {
1904
+ export interface Access {
1905
+ /**
1906
+ * Number of decimal places to round to. Applied directly to the stored monetary
1907
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
1908
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
1909
+ * dollar).
1910
+ */
1911
+ decimal_places: number;
1912
+
1913
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
1914
+ }
1915
+ }
1916
+
1733
1917
  /**
1734
1918
  * Attach a subscription to the recurring commit/credit.
1735
1919
  */
@@ -1751,6 +1935,29 @@ export namespace PackageListResponse {
1751
1935
  }
1752
1936
  }
1753
1937
 
1938
+ export interface SpendTracker {
1939
+ /**
1940
+ * Human-readable identifier, unique per contract.
1941
+ */
1942
+ alias: string;
1943
+
1944
+ applicable_spend_specifiers: Array<SpendTracker.ApplicableSpendSpecifier>;
1945
+
1946
+ credit_type_id: string;
1947
+
1948
+ reset_frequency: 'BILLING_PERIOD';
1949
+ }
1950
+
1951
+ export namespace SpendTracker {
1952
+ export interface ApplicableSpendSpecifier {
1953
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
1954
+
1955
+ spend_type: 'COMMIT_PURCHASE';
1956
+
1957
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
1958
+ }
1959
+ }
1960
+
1754
1961
  export interface Subscription {
1755
1962
  collection_schedule: 'ADVANCE' | 'ARREARS';
1756
1963
 
@@ -1760,6 +1967,8 @@ export namespace PackageListResponse {
1760
1967
 
1761
1968
  id?: string;
1762
1969
 
1970
+ billing_cycle_config?: Subscription.BillingCycleConfig;
1971
+
1763
1972
  /**
1764
1973
  * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1765
1974
  */
@@ -1798,6 +2007,22 @@ export namespace PackageListResponse {
1798
2007
  invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
1799
2008
 
1800
2009
  is_prorated: boolean;
2010
+
2011
+ rounding?: Proration.Rounding;
2012
+ }
2013
+
2014
+ export namespace Proration {
2015
+ export interface Rounding {
2016
+ /**
2017
+ * Number of decimal places to round to. Applied directly to the stored monetary
2018
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2019
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
2020
+ * dollar).
2021
+ */
2022
+ decimal_places: number;
2023
+
2024
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2025
+ }
1801
2026
  }
1802
2027
 
1803
2028
  export interface SubscriptionRate {
@@ -1814,6 +2039,10 @@ export namespace PackageListResponse {
1814
2039
  }
1815
2040
  }
1816
2041
 
2042
+ export interface BillingCycleConfig {
2043
+ invoice_placement?: 'ON_SCHEDULED_INVOICE' | 'ON_USAGE_INVOICE';
2044
+ }
2045
+
1817
2046
  export interface Duration {
1818
2047
  unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1819
2048
 
@@ -1917,6 +2146,8 @@ export interface PackageCreateParams {
1917
2146
 
1918
2147
  spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
1919
2148
 
2149
+ spend_trackers?: Array<PackageCreateParams.SpendTracker>;
2150
+
1920
2151
  subscriptions?: Array<PackageCreateParams.Subscription>;
1921
2152
 
1922
2153
  /**
@@ -2256,9 +2487,10 @@ export namespace PackageCreateParams {
2256
2487
 
2257
2488
  /**
2258
2489
  * Indicates whether the override should only apply to commits. Defaults to
2259
- * `false`. If `true`, you can specify relevant commits in `override_specifiers` by
2260
- * passing `commit_ids`. if you do not specify `commit_ids`, then the override will
2261
- * apply when consuming any prepaid or postpaid commit.
2490
+ * `false`. If `true` you can specify relevant commits in `override_specifiers` by
2491
+ * passing `commit_ids`, `recurring_commit_ids`, or `any_commit_or_credit_ids`. If
2492
+ * you do not specify any of these fields, the override will apply when consuming
2493
+ * any prepaid commit, postpaid commit, or credit
2262
2494
  */
2263
2495
  is_commit_specific?: boolean;
2264
2496
 
@@ -2300,6 +2532,15 @@ export namespace PackageCreateParams {
2300
2532
 
2301
2533
  export namespace Override {
2302
2534
  export interface OverrideSpecifier {
2535
+ /**
2536
+ * Can only be used for commit specific overrides. Must be used in conjunction with
2537
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
2538
+ * `presentation_group_values`. Must be used instead of both `commit_ids` and
2539
+ * `recurring_commit_ids` If provided, the override will apply to any specified
2540
+ * commit, credit, recurring commit or recurring credit IDs.
2541
+ */
2542
+ any_commit_or_credit_ids?: Array<string>;
2543
+
2303
2544
  billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2304
2545
 
2305
2546
  /**
@@ -2469,6 +2710,11 @@ export namespace PackageCreateParams {
2469
2710
  */
2470
2711
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2471
2712
 
2713
+ /**
2714
+ * Optional rounding configuration for prorated recurring commit amounts.
2715
+ */
2716
+ proration_rounding?: RecurringCommit.ProrationRounding;
2717
+
2472
2718
  /**
2473
2719
  * Whether the created commits will use the commit rate or list rate
2474
2720
  */
@@ -2481,7 +2727,7 @@ export namespace PackageCreateParams {
2481
2727
  * be created aligned with the recurring commit's starting_at rather than the usage
2482
2728
  * invoice dates.
2483
2729
  */
2484
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2730
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
2485
2731
 
2486
2732
  /**
2487
2733
  * Will be passed down to the individual commits. This controls how much of an
@@ -2568,6 +2814,41 @@ export namespace PackageCreateParams {
2568
2814
  unit_price: number;
2569
2815
  }
2570
2816
 
2817
+ /**
2818
+ * Optional rounding configuration for prorated recurring commit amounts.
2819
+ */
2820
+ export interface ProrationRounding {
2821
+ access?: ProrationRounding.Access;
2822
+
2823
+ invoice?: ProrationRounding.Invoice;
2824
+ }
2825
+
2826
+ export namespace ProrationRounding {
2827
+ export interface Access {
2828
+ /**
2829
+ * Number of decimal places to round to. Applied directly to the stored monetary
2830
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2831
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
2832
+ * dollar).
2833
+ */
2834
+ decimal_places: number;
2835
+
2836
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2837
+ }
2838
+
2839
+ export interface Invoice {
2840
+ /**
2841
+ * Number of decimal places to round to. Applied directly to the stored monetary
2842
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
2843
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
2844
+ * dollar).
2845
+ */
2846
+ decimal_places: number;
2847
+
2848
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
2849
+ }
2850
+ }
2851
+
2571
2852
  /**
2572
2853
  * Attach a subscription to the recurring commit/credit.
2573
2854
  */
@@ -2654,6 +2935,11 @@ export namespace PackageCreateParams {
2654
2935
  */
2655
2936
  proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2656
2937
 
2938
+ /**
2939
+ * Optional rounding configuration for prorated recurring credit amounts.
2940
+ */
2941
+ proration_rounding?: RecurringCredit.ProrationRounding;
2942
+
2657
2943
  /**
2658
2944
  * Whether the created commits will use the commit rate or list rate
2659
2945
  */
@@ -2666,7 +2952,7 @@ export namespace PackageCreateParams {
2666
2952
  * be created aligned with the recurring commit's starting_at rather than the usage
2667
2953
  * invoice dates.
2668
2954
  */
2669
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2955
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY';
2670
2956
 
2671
2957
  /**
2672
2958
  * Will be passed down to the individual commits. This controls how much of an
@@ -2742,6 +3028,27 @@ export namespace PackageCreateParams {
2742
3028
  value: number;
2743
3029
  }
2744
3030
 
3031
+ /**
3032
+ * Optional rounding configuration for prorated recurring credit amounts.
3033
+ */
3034
+ export interface ProrationRounding {
3035
+ access?: ProrationRounding.Access;
3036
+ }
3037
+
3038
+ export namespace ProrationRounding {
3039
+ export interface Access {
3040
+ /**
3041
+ * Number of decimal places to round to. Applied directly to the stored monetary
3042
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
3043
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
3044
+ * dollar).
3045
+ */
3046
+ decimal_places: number;
3047
+
3048
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
3049
+ }
3050
+ }
3051
+
2745
3052
  /**
2746
3053
  * Attach a subscription to the recurring commit/credit.
2747
3054
  */
@@ -2838,6 +3145,32 @@ export namespace PackageCreateParams {
2838
3145
  }
2839
3146
  }
2840
3147
 
3148
+ export interface SpendTracker {
3149
+ /**
3150
+ * Human-readable identifier, unique per contract.
3151
+ */
3152
+ alias: string;
3153
+
3154
+ applicable_spend_specifiers: Array<SpendTracker.ApplicableSpendSpecifier>;
3155
+
3156
+ credit_type_id: string;
3157
+
3158
+ reset_frequency: 'BILLING_PERIOD';
3159
+ }
3160
+
3161
+ export namespace SpendTracker {
3162
+ export interface ApplicableSpendSpecifier {
3163
+ sources: Array<'THRESHOLD_RECHARGE' | 'MANUAL'>;
3164
+
3165
+ spend_type: 'COMMIT_PURCHASE';
3166
+
3167
+ /**
3168
+ * Filter by whether the spend was discounted. Defaults to ANY if omitted.
3169
+ */
3170
+ discounted?: 'ANY' | 'DISCOUNTED_ONLY' | 'UNDISCOUNTED_ONLY';
3171
+ }
3172
+ }
3173
+
2841
3174
  export interface Subscription {
2842
3175
  collection_schedule: 'ADVANCE' | 'ARREARS';
2843
3176
 
@@ -2845,6 +3178,8 @@ export namespace PackageCreateParams {
2845
3178
 
2846
3179
  subscription_rate: Subscription.SubscriptionRate;
2847
3180
 
3181
+ billing_cycle_config?: Subscription.BillingCycleConfig;
3182
+
2848
3183
  /**
2849
3184
  * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2850
3185
  */
@@ -2909,6 +3244,22 @@ export namespace PackageCreateParams {
2909
3244
  * Indicates if the partial period will be prorated or charged a full amount.
2910
3245
  */
2911
3246
  is_prorated?: boolean;
3247
+
3248
+ rounding?: Proration.Rounding;
3249
+ }
3250
+
3251
+ export namespace Proration {
3252
+ export interface Rounding {
3253
+ /**
3254
+ * Number of decimal places to round to. Applied directly to the stored monetary
3255
+ * representation. Negative values round to powers of 10 (e.g., -2 rounds to
3256
+ * nearest 100 in the stored unit. For USD, this means rounding to the nearest
3257
+ * dollar).
3258
+ */
3259
+ decimal_places: number;
3260
+
3261
+ rounding_method: 'HALF_UP' | 'FLOOR' | 'CEILING';
3262
+ }
2912
3263
  }
2913
3264
 
2914
3265
  export interface SubscriptionRate {
@@ -2924,6 +3275,14 @@ export namespace PackageCreateParams {
2924
3275
  product_id: string;
2925
3276
  }
2926
3277
 
3278
+ export interface BillingCycleConfig {
3279
+ /**
3280
+ * Controls whether subscriptions consolidate onto usage invoices. Defaults to
3281
+ * ON_USAGE_INVOICE if omitted.
3282
+ */
3283
+ invoice_placement?: 'ON_SCHEDULED_INVOICE' | 'ON_USAGE_INVOICE';
3284
+ }
3285
+
2927
3286
  /**
2928
3287
  * Lifetime of the subscription from its start. If not provided, subscription
2929
3288
  * inherits contract end date.