@polar-sh/sdk 0.46.3 → 0.46.4

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 (269) hide show
  1. package/README.md +2 -1
  2. package/dist/commonjs/funcs/customerPortalSubscriptionsUpdate.d.ts +2 -1
  3. package/dist/commonjs/funcs/customerPortalSubscriptionsUpdate.d.ts.map +1 -1
  4. package/dist/commonjs/funcs/customerPortalSubscriptionsUpdate.js +3 -2
  5. package/dist/commonjs/funcs/customerPortalSubscriptionsUpdate.js.map +1 -1
  6. package/dist/commonjs/funcs/subscriptionsUpdate.d.ts +2 -1
  7. package/dist/commonjs/funcs/subscriptionsUpdate.d.ts.map +1 -1
  8. package/dist/commonjs/funcs/subscriptionsUpdate.js +3 -2
  9. package/dist/commonjs/funcs/subscriptionsUpdate.js.map +1 -1
  10. package/dist/commonjs/lib/config.d.ts +3 -3
  11. package/dist/commonjs/lib/config.js +3 -3
  12. package/dist/commonjs/models/components/checkoutdiscountfixedonceforeverduration.d.ts +15 -0
  13. package/dist/commonjs/models/components/checkoutdiscountfixedonceforeverduration.d.ts.map +1 -1
  14. package/dist/commonjs/models/components/checkoutdiscountfixedonceforeverduration.js +2 -0
  15. package/dist/commonjs/models/components/checkoutdiscountfixedonceforeverduration.js.map +1 -1
  16. package/dist/commonjs/models/components/checkoutdiscountfixedrepeatduration.d.ts +15 -0
  17. package/dist/commonjs/models/components/checkoutdiscountfixedrepeatduration.d.ts.map +1 -1
  18. package/dist/commonjs/models/components/checkoutdiscountfixedrepeatduration.js +2 -0
  19. package/dist/commonjs/models/components/checkoutdiscountfixedrepeatduration.js.map +1 -1
  20. package/dist/commonjs/models/components/customersubscription.d.ts +5 -0
  21. package/dist/commonjs/models/components/customersubscription.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/customersubscription.js +3 -0
  23. package/dist/commonjs/models/components/customersubscription.js.map +1 -1
  24. package/dist/commonjs/models/components/discountcreate.d.ts +2 -2
  25. package/dist/commonjs/models/components/discountcreate.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/discountcreate.js +2 -2
  27. package/dist/commonjs/models/components/discountcreate.js.map +1 -1
  28. package/dist/commonjs/models/components/discountfixedonceforeverduration.d.ts +12 -0
  29. package/dist/commonjs/models/components/discountfixedonceforeverduration.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/discountfixedonceforeverduration.js +1 -0
  31. package/dist/commonjs/models/components/discountfixedonceforeverduration.js.map +1 -1
  32. package/dist/commonjs/models/components/discountfixedonceforeverdurationbase.d.ts +15 -0
  33. package/dist/commonjs/models/components/discountfixedonceforeverdurationbase.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/discountfixedonceforeverdurationbase.js +2 -0
  35. package/dist/commonjs/models/components/discountfixedonceforeverdurationbase.js.map +1 -1
  36. package/dist/commonjs/models/components/discountfixedonceforeverdurationcreate.d.ts +14 -5
  37. package/dist/commonjs/models/components/discountfixedonceforeverdurationcreate.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/discountfixedonceforeverdurationcreate.js +3 -2
  39. package/dist/commonjs/models/components/discountfixedonceforeverdurationcreate.js.map +1 -1
  40. package/dist/commonjs/models/components/discountfixedrepeatduration.d.ts +12 -0
  41. package/dist/commonjs/models/components/discountfixedrepeatduration.d.ts.map +1 -1
  42. package/dist/commonjs/models/components/discountfixedrepeatduration.js +1 -0
  43. package/dist/commonjs/models/components/discountfixedrepeatduration.js.map +1 -1
  44. package/dist/commonjs/models/components/discountfixedrepeatdurationbase.d.ts +15 -0
  45. package/dist/commonjs/models/components/discountfixedrepeatdurationbase.d.ts.map +1 -1
  46. package/dist/commonjs/models/components/discountfixedrepeatdurationbase.js +2 -0
  47. package/dist/commonjs/models/components/discountfixedrepeatdurationbase.js.map +1 -1
  48. package/dist/commonjs/models/components/discountfixedrepeatdurationcreate.d.ts +14 -5
  49. package/dist/commonjs/models/components/discountfixedrepeatdurationcreate.d.ts.map +1 -1
  50. package/dist/commonjs/models/components/discountfixedrepeatdurationcreate.js +3 -2
  51. package/dist/commonjs/models/components/discountfixedrepeatdurationcreate.js.map +1 -1
  52. package/dist/commonjs/models/components/discountupdate.d.ts +12 -0
  53. package/dist/commonjs/models/components/discountupdate.d.ts.map +1 -1
  54. package/dist/commonjs/models/components/discountupdate.js +1 -0
  55. package/dist/commonjs/models/components/discountupdate.js.map +1 -1
  56. package/dist/commonjs/models/components/metricperiod.d.ts +5 -5
  57. package/dist/commonjs/models/components/metricperiod.d.ts.map +1 -1
  58. package/dist/commonjs/models/components/metricperiod.js +9 -9
  59. package/dist/commonjs/models/components/metricperiod.js.map +1 -1
  60. package/dist/commonjs/models/components/metrics.d.ts +1 -1
  61. package/dist/commonjs/models/components/metrics.d.ts.map +1 -1
  62. package/dist/commonjs/models/components/metrics.js +2 -2
  63. package/dist/commonjs/models/components/metrics.js.map +1 -1
  64. package/dist/commonjs/models/components/metricstotals.d.ts +5 -5
  65. package/dist/commonjs/models/components/metricstotals.d.ts.map +1 -1
  66. package/dist/commonjs/models/components/metricstotals.js +9 -9
  67. package/dist/commonjs/models/components/metricstotals.js.map +1 -1
  68. package/dist/commonjs/models/components/organizationcustomeremailsettings.d.ts +4 -0
  69. package/dist/commonjs/models/components/organizationcustomeremailsettings.d.ts.map +1 -1
  70. package/dist/commonjs/models/components/organizationcustomeremailsettings.js +8 -0
  71. package/dist/commonjs/models/components/organizationcustomeremailsettings.js.map +1 -1
  72. package/dist/commonjs/models/components/pendingsubscriptionupdate.d.ts +48 -0
  73. package/dist/commonjs/models/components/pendingsubscriptionupdate.d.ts.map +1 -0
  74. package/dist/commonjs/models/components/pendingsubscriptionupdate.js +83 -0
  75. package/dist/commonjs/models/components/pendingsubscriptionupdate.js.map +1 -0
  76. package/dist/commonjs/models/components/subscription.d.ts +6 -0
  77. package/dist/commonjs/models/components/subscription.d.ts.map +1 -1
  78. package/dist/commonjs/models/components/subscription.js +5 -0
  79. package/dist/commonjs/models/components/subscription.js.map +1 -1
  80. package/dist/commonjs/models/components/subscriptionprorationbehavior.d.ts +1 -0
  81. package/dist/commonjs/models/components/subscriptionprorationbehavior.d.ts.map +1 -1
  82. package/dist/commonjs/models/components/subscriptionprorationbehavior.js +1 -0
  83. package/dist/commonjs/models/components/subscriptionprorationbehavior.js.map +1 -1
  84. package/dist/commonjs/models/components/subscriptionupdatedbillingperiodmetadata.d.ts +11 -0
  85. package/dist/commonjs/models/components/subscriptionupdatedbillingperiodmetadata.d.ts.map +1 -0
  86. package/dist/commonjs/models/components/subscriptionupdatedbillingperiodmetadata.js +57 -0
  87. package/dist/commonjs/models/components/subscriptionupdatedbillingperiodmetadata.js.map +1 -0
  88. package/dist/commonjs/models/components/subscriptionupdateddiscountmetadata.d.ts +11 -0
  89. package/dist/commonjs/models/components/subscriptionupdateddiscountmetadata.d.ts.map +1 -0
  90. package/dist/commonjs/models/components/subscriptionupdateddiscountmetadata.js +57 -0
  91. package/dist/commonjs/models/components/subscriptionupdateddiscountmetadata.js.map +1 -0
  92. package/dist/commonjs/models/components/subscriptionupdatedevent.d.ts +75 -0
  93. package/dist/commonjs/models/components/subscriptionupdatedevent.d.ts.map +1 -0
  94. package/dist/commonjs/models/components/subscriptionupdatedevent.js +99 -0
  95. package/dist/commonjs/models/components/subscriptionupdatedevent.js.map +1 -0
  96. package/dist/commonjs/models/components/subscriptionupdatedproductmetadata.d.ts +13 -0
  97. package/dist/commonjs/models/components/subscriptionupdatedproductmetadata.d.ts.map +1 -0
  98. package/dist/commonjs/models/components/subscriptionupdatedproductmetadata.js +60 -0
  99. package/dist/commonjs/models/components/subscriptionupdatedproductmetadata.js.map +1 -0
  100. package/dist/commonjs/models/components/subscriptionupdatedseatsmetadata.d.ts +13 -0
  101. package/dist/commonjs/models/components/subscriptionupdatedseatsmetadata.d.ts.map +1 -0
  102. package/dist/commonjs/models/components/subscriptionupdatedseatsmetadata.js +59 -0
  103. package/dist/commonjs/models/components/subscriptionupdatedseatsmetadata.js.map +1 -0
  104. package/dist/commonjs/models/components/subscriptionupdatedtrialmetadata.d.ts +11 -0
  105. package/dist/commonjs/models/components/subscriptionupdatedtrialmetadata.d.ts.map +1 -0
  106. package/dist/commonjs/models/components/subscriptionupdatedtrialmetadata.js +57 -0
  107. package/dist/commonjs/models/components/subscriptionupdatedtrialmetadata.js.map +1 -0
  108. package/dist/commonjs/models/components/systemevent.d.ts +2 -1
  109. package/dist/commonjs/models/components/systemevent.d.ts.map +1 -1
  110. package/dist/commonjs/models/components/systemevent.js +2 -0
  111. package/dist/commonjs/models/components/systemevent.js.map +1 -1
  112. package/dist/commonjs/models/errors/paymentfailed.d.ts +20 -0
  113. package/dist/commonjs/models/errors/paymentfailed.d.ts.map +1 -0
  114. package/dist/commonjs/models/errors/paymentfailed.js +69 -0
  115. package/dist/commonjs/models/errors/paymentfailed.js.map +1 -0
  116. package/dist/commonjs/webhooks.d.ts +1 -1
  117. package/dist/commonjs/webhooks.d.ts.map +1 -1
  118. package/dist/commonjs/webhooks.js +15 -0
  119. package/dist/commonjs/webhooks.js.map +1 -1
  120. package/dist/esm/funcs/customerPortalSubscriptionsUpdate.d.ts +2 -1
  121. package/dist/esm/funcs/customerPortalSubscriptionsUpdate.d.ts.map +1 -1
  122. package/dist/esm/funcs/customerPortalSubscriptionsUpdate.js +3 -2
  123. package/dist/esm/funcs/customerPortalSubscriptionsUpdate.js.map +1 -1
  124. package/dist/esm/funcs/subscriptionsUpdate.d.ts +2 -1
  125. package/dist/esm/funcs/subscriptionsUpdate.d.ts.map +1 -1
  126. package/dist/esm/funcs/subscriptionsUpdate.js +3 -2
  127. package/dist/esm/funcs/subscriptionsUpdate.js.map +1 -1
  128. package/dist/esm/lib/config.d.ts +3 -3
  129. package/dist/esm/lib/config.js +3 -3
  130. package/dist/esm/models/components/checkoutdiscountfixedonceforeverduration.d.ts +15 -0
  131. package/dist/esm/models/components/checkoutdiscountfixedonceforeverduration.d.ts.map +1 -1
  132. package/dist/esm/models/components/checkoutdiscountfixedonceforeverduration.js +2 -0
  133. package/dist/esm/models/components/checkoutdiscountfixedonceforeverduration.js.map +1 -1
  134. package/dist/esm/models/components/checkoutdiscountfixedrepeatduration.d.ts +15 -0
  135. package/dist/esm/models/components/checkoutdiscountfixedrepeatduration.d.ts.map +1 -1
  136. package/dist/esm/models/components/checkoutdiscountfixedrepeatduration.js +2 -0
  137. package/dist/esm/models/components/checkoutdiscountfixedrepeatduration.js.map +1 -1
  138. package/dist/esm/models/components/customersubscription.d.ts +5 -0
  139. package/dist/esm/models/components/customersubscription.d.ts.map +1 -1
  140. package/dist/esm/models/components/customersubscription.js +3 -0
  141. package/dist/esm/models/components/customersubscription.js.map +1 -1
  142. package/dist/esm/models/components/discountcreate.d.ts +2 -2
  143. package/dist/esm/models/components/discountcreate.d.ts.map +1 -1
  144. package/dist/esm/models/components/discountcreate.js +2 -2
  145. package/dist/esm/models/components/discountcreate.js.map +1 -1
  146. package/dist/esm/models/components/discountfixedonceforeverduration.d.ts +12 -0
  147. package/dist/esm/models/components/discountfixedonceforeverduration.d.ts.map +1 -1
  148. package/dist/esm/models/components/discountfixedonceforeverduration.js +1 -0
  149. package/dist/esm/models/components/discountfixedonceforeverduration.js.map +1 -1
  150. package/dist/esm/models/components/discountfixedonceforeverdurationbase.d.ts +15 -0
  151. package/dist/esm/models/components/discountfixedonceforeverdurationbase.d.ts.map +1 -1
  152. package/dist/esm/models/components/discountfixedonceforeverdurationbase.js +2 -0
  153. package/dist/esm/models/components/discountfixedonceforeverdurationbase.js.map +1 -1
  154. package/dist/esm/models/components/discountfixedonceforeverdurationcreate.d.ts +14 -5
  155. package/dist/esm/models/components/discountfixedonceforeverdurationcreate.d.ts.map +1 -1
  156. package/dist/esm/models/components/discountfixedonceforeverdurationcreate.js +3 -2
  157. package/dist/esm/models/components/discountfixedonceforeverdurationcreate.js.map +1 -1
  158. package/dist/esm/models/components/discountfixedrepeatduration.d.ts +12 -0
  159. package/dist/esm/models/components/discountfixedrepeatduration.d.ts.map +1 -1
  160. package/dist/esm/models/components/discountfixedrepeatduration.js +1 -0
  161. package/dist/esm/models/components/discountfixedrepeatduration.js.map +1 -1
  162. package/dist/esm/models/components/discountfixedrepeatdurationbase.d.ts +15 -0
  163. package/dist/esm/models/components/discountfixedrepeatdurationbase.d.ts.map +1 -1
  164. package/dist/esm/models/components/discountfixedrepeatdurationbase.js +2 -0
  165. package/dist/esm/models/components/discountfixedrepeatdurationbase.js.map +1 -1
  166. package/dist/esm/models/components/discountfixedrepeatdurationcreate.d.ts +14 -5
  167. package/dist/esm/models/components/discountfixedrepeatdurationcreate.d.ts.map +1 -1
  168. package/dist/esm/models/components/discountfixedrepeatdurationcreate.js +3 -2
  169. package/dist/esm/models/components/discountfixedrepeatdurationcreate.js.map +1 -1
  170. package/dist/esm/models/components/discountupdate.d.ts +12 -0
  171. package/dist/esm/models/components/discountupdate.d.ts.map +1 -1
  172. package/dist/esm/models/components/discountupdate.js +1 -0
  173. package/dist/esm/models/components/discountupdate.js.map +1 -1
  174. package/dist/esm/models/components/metricperiod.d.ts +5 -5
  175. package/dist/esm/models/components/metricperiod.d.ts.map +1 -1
  176. package/dist/esm/models/components/metricperiod.js +7 -7
  177. package/dist/esm/models/components/metricperiod.js.map +1 -1
  178. package/dist/esm/models/components/metrics.d.ts +1 -1
  179. package/dist/esm/models/components/metrics.d.ts.map +1 -1
  180. package/dist/esm/models/components/metrics.js +2 -2
  181. package/dist/esm/models/components/metrics.js.map +1 -1
  182. package/dist/esm/models/components/metricstotals.d.ts +5 -5
  183. package/dist/esm/models/components/metricstotals.d.ts.map +1 -1
  184. package/dist/esm/models/components/metricstotals.js +7 -7
  185. package/dist/esm/models/components/metricstotals.js.map +1 -1
  186. package/dist/esm/models/components/organizationcustomeremailsettings.d.ts +4 -0
  187. package/dist/esm/models/components/organizationcustomeremailsettings.d.ts.map +1 -1
  188. package/dist/esm/models/components/organizationcustomeremailsettings.js +8 -0
  189. package/dist/esm/models/components/organizationcustomeremailsettings.js.map +1 -1
  190. package/dist/esm/models/components/pendingsubscriptionupdate.d.ts +48 -0
  191. package/dist/esm/models/components/pendingsubscriptionupdate.d.ts.map +1 -0
  192. package/dist/esm/models/components/pendingsubscriptionupdate.js +45 -0
  193. package/dist/esm/models/components/pendingsubscriptionupdate.js.map +1 -0
  194. package/dist/esm/models/components/subscription.d.ts +6 -0
  195. package/dist/esm/models/components/subscription.d.ts.map +1 -1
  196. package/dist/esm/models/components/subscription.js +5 -0
  197. package/dist/esm/models/components/subscription.js.map +1 -1
  198. package/dist/esm/models/components/subscriptionprorationbehavior.d.ts +1 -0
  199. package/dist/esm/models/components/subscriptionprorationbehavior.d.ts.map +1 -1
  200. package/dist/esm/models/components/subscriptionprorationbehavior.js +1 -0
  201. package/dist/esm/models/components/subscriptionprorationbehavior.js.map +1 -1
  202. package/dist/esm/models/components/subscriptionupdatedbillingperiodmetadata.d.ts +11 -0
  203. package/dist/esm/models/components/subscriptionupdatedbillingperiodmetadata.d.ts.map +1 -0
  204. package/dist/esm/models/components/subscriptionupdatedbillingperiodmetadata.js +20 -0
  205. package/dist/esm/models/components/subscriptionupdatedbillingperiodmetadata.js.map +1 -0
  206. package/dist/esm/models/components/subscriptionupdateddiscountmetadata.d.ts +11 -0
  207. package/dist/esm/models/components/subscriptionupdateddiscountmetadata.d.ts.map +1 -0
  208. package/dist/esm/models/components/subscriptionupdateddiscountmetadata.js +20 -0
  209. package/dist/esm/models/components/subscriptionupdateddiscountmetadata.js.map +1 -0
  210. package/dist/esm/models/components/subscriptionupdatedevent.d.ts +75 -0
  211. package/dist/esm/models/components/subscriptionupdatedevent.d.ts.map +1 -0
  212. package/dist/esm/models/components/subscriptionupdatedevent.js +61 -0
  213. package/dist/esm/models/components/subscriptionupdatedevent.js.map +1 -0
  214. package/dist/esm/models/components/subscriptionupdatedproductmetadata.d.ts +13 -0
  215. package/dist/esm/models/components/subscriptionupdatedproductmetadata.d.ts.map +1 -0
  216. package/dist/esm/models/components/subscriptionupdatedproductmetadata.js +23 -0
  217. package/dist/esm/models/components/subscriptionupdatedproductmetadata.js.map +1 -0
  218. package/dist/esm/models/components/subscriptionupdatedseatsmetadata.d.ts +13 -0
  219. package/dist/esm/models/components/subscriptionupdatedseatsmetadata.d.ts.map +1 -0
  220. package/dist/esm/models/components/subscriptionupdatedseatsmetadata.js +22 -0
  221. package/dist/esm/models/components/subscriptionupdatedseatsmetadata.js.map +1 -0
  222. package/dist/esm/models/components/subscriptionupdatedtrialmetadata.d.ts +11 -0
  223. package/dist/esm/models/components/subscriptionupdatedtrialmetadata.d.ts.map +1 -0
  224. package/dist/esm/models/components/subscriptionupdatedtrialmetadata.js +20 -0
  225. package/dist/esm/models/components/subscriptionupdatedtrialmetadata.js.map +1 -0
  226. package/dist/esm/models/components/systemevent.d.ts +2 -1
  227. package/dist/esm/models/components/systemevent.d.ts.map +1 -1
  228. package/dist/esm/models/components/systemevent.js +2 -0
  229. package/dist/esm/models/components/systemevent.js.map +1 -1
  230. package/dist/esm/models/errors/paymentfailed.d.ts +20 -0
  231. package/dist/esm/models/errors/paymentfailed.d.ts.map +1 -0
  232. package/dist/esm/models/errors/paymentfailed.js +32 -0
  233. package/dist/esm/models/errors/paymentfailed.js.map +1 -0
  234. package/dist/esm/webhooks.d.ts +1 -1
  235. package/dist/esm/webhooks.d.ts.map +1 -1
  236. package/dist/esm/webhooks.js +15 -0
  237. package/dist/esm/webhooks.js.map +1 -1
  238. package/jsr.json +1 -1
  239. package/package.json +1 -1
  240. package/src/funcs/customerPortalSubscriptionsUpdate.ts +9 -1
  241. package/src/funcs/subscriptionsUpdate.ts +9 -1
  242. package/src/lib/config.ts +3 -3
  243. package/src/models/components/checkoutdiscountfixedonceforeverduration.ts +13 -0
  244. package/src/models/components/checkoutdiscountfixedrepeatduration.ts +13 -0
  245. package/src/models/components/customersubscription.ts +10 -0
  246. package/src/models/components/discountcreate.ts +8 -8
  247. package/src/models/components/discountfixedonceforeverduration.ts +11 -0
  248. package/src/models/components/discountfixedonceforeverdurationbase.ts +13 -0
  249. package/src/models/components/discountfixedonceforeverdurationcreate.ts +13 -7
  250. package/src/models/components/discountfixedrepeatduration.ts +11 -0
  251. package/src/models/components/discountfixedrepeatdurationbase.ts +13 -0
  252. package/src/models/components/discountfixedrepeatdurationcreate.ts +13 -7
  253. package/src/models/components/discountupdate.ts +9 -0
  254. package/src/models/components/metricperiod.ts +23 -23
  255. package/src/models/components/metrics.ts +3 -3
  256. package/src/models/components/metricstotals.ts +23 -23
  257. package/src/models/components/organizationcustomeremailsettings.ts +14 -0
  258. package/src/models/components/pendingsubscriptionupdate.ts +119 -0
  259. package/src/models/components/subscription.ts +15 -0
  260. package/src/models/components/subscriptionprorationbehavior.ts +1 -0
  261. package/src/models/components/subscriptionupdatedbillingperiodmetadata.ts +45 -0
  262. package/src/models/components/subscriptionupdateddiscountmetadata.ts +42 -0
  263. package/src/models/components/subscriptionupdatedevent.ts +177 -0
  264. package/src/models/components/subscriptionupdatedproductmetadata.ts +49 -0
  265. package/src/models/components/subscriptionupdatedseatsmetadata.ts +47 -0
  266. package/src/models/components/subscriptionupdatedtrialmetadata.ts +41 -0
  267. package/src/models/components/systemevent.ts +7 -1
  268. package/src/models/errors/paymentfailed.ts +55 -0
  269. package/src/webhooks.ts +15 -0
@@ -57,8 +57,15 @@ export type DiscountUpdate = {
57
57
  duration?: DiscountDuration | null | undefined;
58
58
  durationInMonths?: number | null | undefined;
59
59
  type?: DiscountType | null | undefined;
60
+ /**
61
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
62
+ */
60
63
  amount?: number | null | undefined;
64
+ /**
65
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
66
+ */
61
67
  currency?: PresentmentCurrency | null | undefined;
68
+ amounts?: { [k: string]: number } | null | undefined;
62
69
  basisPoints?: number | null | undefined;
63
70
  products?: Array<string> | null | undefined;
64
71
  };
@@ -97,6 +104,7 @@ export type DiscountUpdate$Outbound = {
97
104
  type?: string | null | undefined;
98
105
  amount?: number | null | undefined;
99
106
  currency?: string | null | undefined;
107
+ amounts?: { [k: string]: number } | null | undefined;
100
108
  basis_points?: number | null | undefined;
101
109
  products?: Array<string> | null | undefined;
102
110
  };
@@ -127,6 +135,7 @@ export const DiscountUpdate$outboundSchema: z.ZodMiniType<
127
135
  type: z.optional(z.nullable(DiscountType$outboundSchema)),
128
136
  amount: z.optional(z.nullable(z.int())),
129
137
  currency: z.optional(z.nullable(PresentmentCurrency$outboundSchema)),
138
+ amounts: z.optional(z.nullable(z.record(z.string(), z.int()))),
130
139
  basisPoints: z.optional(z.nullable(z.int())),
131
140
  products: z.optional(z.nullable(z.array(z.string()))),
132
141
  }),
@@ -23,8 +23,6 @@ export type Checkouts = number | number;
23
23
 
24
24
  export type SucceededCheckouts = number | number;
25
25
 
26
- export type CheckoutsConversion = number | number;
27
-
28
26
  export type ChurnedSubscriptions = number | number;
29
27
 
30
28
  export type Orders = number | number;
@@ -85,6 +83,8 @@ export type CanceledSubscriptionsUnused = number | number;
85
83
 
86
84
  export type CanceledSubscriptionsOther = number | number;
87
85
 
86
+ export type CheckoutsConversion = number | number;
87
+
88
88
  export type ChurnRate = number | number;
89
89
 
90
90
  export type Ltv = number | number;
@@ -107,7 +107,6 @@ export type MetricPeriod = {
107
107
  averageRevenuePerUser?: number | number | null | undefined;
108
108
  checkouts?: number | number | null | undefined;
109
109
  succeededCheckouts?: number | number | null | undefined;
110
- checkoutsConversion?: number | number | null | undefined;
111
110
  churnedSubscriptions?: number | number | null | undefined;
112
111
  orders?: number | number | null | undefined;
113
112
  revenue?: number | number | null | undefined;
@@ -138,6 +137,7 @@ export type MetricPeriod = {
138
137
  canceledSubscriptionsTooExpensive?: number | number | null | undefined;
139
138
  canceledSubscriptionsUnused?: number | number | null | undefined;
140
139
  canceledSubscriptionsOther?: number | number | null | undefined;
140
+ checkoutsConversion?: number | number | null | undefined;
141
141
  churnRate?: number | number | null | undefined;
142
142
  ltv?: number | number | null | undefined;
143
143
  grossMargin?: number | number | null | undefined;
@@ -255,22 +255,6 @@ export function succeededCheckoutsFromJSON(
255
255
  );
256
256
  }
257
257
 
258
- /** @internal */
259
- export const CheckoutsConversion$inboundSchema: z.ZodMiniType<
260
- CheckoutsConversion,
261
- unknown
262
- > = smartUnion([z.int(), z.number()]);
263
-
264
- export function checkoutsConversionFromJSON(
265
- jsonString: string,
266
- ): SafeParseResult<CheckoutsConversion, SDKValidationError> {
267
- return safeParse(
268
- jsonString,
269
- (x) => CheckoutsConversion$inboundSchema.parse(JSON.parse(x)),
270
- `Failed to parse 'CheckoutsConversion' from JSON`,
271
- );
272
- }
273
-
274
258
  /** @internal */
275
259
  export const ChurnedSubscriptions$inboundSchema: z.ZodMiniType<
276
260
  ChurnedSubscriptions,
@@ -748,6 +732,22 @@ export function canceledSubscriptionsOtherFromJSON(
748
732
  );
749
733
  }
750
734
 
735
+ /** @internal */
736
+ export const CheckoutsConversion$inboundSchema: z.ZodMiniType<
737
+ CheckoutsConversion,
738
+ unknown
739
+ > = smartUnion([z.int(), z.number()]);
740
+
741
+ export function checkoutsConversionFromJSON(
742
+ jsonString: string,
743
+ ): SafeParseResult<CheckoutsConversion, SDKValidationError> {
744
+ return safeParse(
745
+ jsonString,
746
+ (x) => CheckoutsConversion$inboundSchema.parse(JSON.parse(x)),
747
+ `Failed to parse 'CheckoutsConversion' from JSON`,
748
+ );
749
+ }
750
+
751
751
  /** @internal */
752
752
  export const ChurnRate$inboundSchema: z.ZodMiniType<ChurnRate, unknown> =
753
753
  smartUnion([z.int(), z.number()]);
@@ -849,9 +849,6 @@ export const MetricPeriod$inboundSchema: z.ZodMiniType<MetricPeriod, unknown> =
849
849
  succeeded_checkouts: z.optional(
850
850
  z.nullable(smartUnion([z.int(), z.number()])),
851
851
  ),
852
- checkouts_conversion: z.optional(
853
- z.nullable(smartUnion([z.int(), z.number()])),
854
- ),
855
852
  churned_subscriptions: z.optional(
856
853
  z.nullable(smartUnion([z.int(), z.number()])),
857
854
  ),
@@ -932,6 +929,9 @@ export const MetricPeriod$inboundSchema: z.ZodMiniType<MetricPeriod, unknown> =
932
929
  canceled_subscriptions_other: z.optional(
933
930
  z.nullable(smartUnion([z.int(), z.number()])),
934
931
  ),
932
+ checkouts_conversion: z.optional(
933
+ z.nullable(smartUnion([z.int(), z.number()])),
934
+ ),
935
935
  churn_rate: z.optional(z.nullable(smartUnion([z.int(), z.number()]))),
936
936
  ltv: z.optional(z.nullable(smartUnion([z.int(), z.number()]))),
937
937
  gross_margin: z.optional(z.nullable(smartUnion([z.int(), z.number()]))),
@@ -949,7 +949,6 @@ export const MetricPeriod$inboundSchema: z.ZodMiniType<MetricPeriod, unknown> =
949
949
  "committedMonthlyRecurringRevenue",
950
950
  "average_revenue_per_user": "averageRevenuePerUser",
951
951
  "succeeded_checkouts": "succeededCheckouts",
952
- "checkouts_conversion": "checkoutsConversion",
953
952
  "churned_subscriptions": "churnedSubscriptions",
954
953
  "net_revenue": "netRevenue",
955
954
  "cumulative_revenue": "cumulativeRevenue",
@@ -981,6 +980,7 @@ export const MetricPeriod$inboundSchema: z.ZodMiniType<MetricPeriod, unknown> =
981
980
  "canceledSubscriptionsTooExpensive",
982
981
  "canceled_subscriptions_unused": "canceledSubscriptionsUnused",
983
982
  "canceled_subscriptions_other": "canceledSubscriptionsOther",
983
+ "checkouts_conversion": "checkoutsConversion",
984
984
  "churn_rate": "churnRate",
985
985
  "gross_margin": "grossMargin",
986
986
  "gross_margin_percentage": "grossMarginPercentage",
@@ -17,7 +17,6 @@ export type Metrics = {
17
17
  averageRevenuePerUser?: Metric | null | undefined;
18
18
  checkouts?: Metric | null | undefined;
19
19
  succeededCheckouts?: Metric | null | undefined;
20
- checkoutsConversion?: Metric | null | undefined;
21
20
  churnedSubscriptions?: Metric | null | undefined;
22
21
  orders?: Metric | null | undefined;
23
22
  revenue?: Metric | null | undefined;
@@ -48,6 +47,7 @@ export type Metrics = {
48
47
  canceledSubscriptionsTooExpensive?: Metric | null | undefined;
49
48
  canceledSubscriptionsUnused?: Metric | null | undefined;
50
49
  canceledSubscriptionsOther?: Metric | null | undefined;
50
+ checkoutsConversion?: Metric | null | undefined;
51
51
  churnRate?: Metric | null | undefined;
52
52
  ltv?: Metric | null | undefined;
53
53
  grossMargin?: Metric | null | undefined;
@@ -67,7 +67,6 @@ export const Metrics$inboundSchema: z.ZodMiniType<Metrics, unknown> = z.pipe(
67
67
  average_revenue_per_user: z.optional(z.nullable(Metric$inboundSchema)),
68
68
  checkouts: z.optional(z.nullable(Metric$inboundSchema)),
69
69
  succeeded_checkouts: z.optional(z.nullable(Metric$inboundSchema)),
70
- checkouts_conversion: z.optional(z.nullable(Metric$inboundSchema)),
71
70
  churned_subscriptions: z.optional(z.nullable(Metric$inboundSchema)),
72
71
  orders: z.optional(z.nullable(Metric$inboundSchema)),
73
72
  revenue: z.optional(z.nullable(Metric$inboundSchema)),
@@ -112,6 +111,7 @@ export const Metrics$inboundSchema: z.ZodMiniType<Metrics, unknown> = z.pipe(
112
111
  ),
113
112
  canceled_subscriptions_unused: z.optional(z.nullable(Metric$inboundSchema)),
114
113
  canceled_subscriptions_other: z.optional(z.nullable(Metric$inboundSchema)),
114
+ checkouts_conversion: z.optional(z.nullable(Metric$inboundSchema)),
115
115
  churn_rate: z.optional(z.nullable(Metric$inboundSchema)),
116
116
  ltv: z.optional(z.nullable(Metric$inboundSchema)),
117
117
  gross_margin: z.optional(z.nullable(Metric$inboundSchema)),
@@ -126,7 +126,6 @@ export const Metrics$inboundSchema: z.ZodMiniType<Metrics, unknown> = z.pipe(
126
126
  "committed_monthly_recurring_revenue": "committedMonthlyRecurringRevenue",
127
127
  "average_revenue_per_user": "averageRevenuePerUser",
128
128
  "succeeded_checkouts": "succeededCheckouts",
129
- "checkouts_conversion": "checkoutsConversion",
130
129
  "churned_subscriptions": "churnedSubscriptions",
131
130
  "net_revenue": "netRevenue",
132
131
  "cumulative_revenue": "cumulativeRevenue",
@@ -158,6 +157,7 @@ export const Metrics$inboundSchema: z.ZodMiniType<Metrics, unknown> = z.pipe(
158
157
  "canceledSubscriptionsTooExpensive",
159
158
  "canceled_subscriptions_unused": "canceledSubscriptionsUnused",
160
159
  "canceled_subscriptions_other": "canceledSubscriptionsOther",
160
+ "checkouts_conversion": "checkoutsConversion",
161
161
  "churn_rate": "churnRate",
162
162
  "gross_margin": "grossMargin",
163
163
  "gross_margin_percentage": "grossMarginPercentage",
@@ -23,8 +23,6 @@ export type MetricsTotalsCheckouts = number | number;
23
23
 
24
24
  export type MetricsTotalsSucceededCheckouts = number | number;
25
25
 
26
- export type MetricsTotalsCheckoutsConversion = number | number;
27
-
28
26
  export type MetricsTotalsChurnedSubscriptions = number | number;
29
27
 
30
28
  export type MetricsTotalsOrders = number | number;
@@ -85,6 +83,8 @@ export type MetricsTotalsCanceledSubscriptionsUnused = number | number;
85
83
 
86
84
  export type MetricsTotalsCanceledSubscriptionsOther = number | number;
87
85
 
86
+ export type MetricsTotalsCheckoutsConversion = number | number;
87
+
88
88
  export type MetricsTotalsChurnRate = number | number;
89
89
 
90
90
  export type MetricsTotalsLtv = number | number;
@@ -103,7 +103,6 @@ export type MetricsTotals = {
103
103
  averageRevenuePerUser?: number | number | null | undefined;
104
104
  checkouts?: number | number | null | undefined;
105
105
  succeededCheckouts?: number | number | null | undefined;
106
- checkoutsConversion?: number | number | null | undefined;
107
106
  churnedSubscriptions?: number | number | null | undefined;
108
107
  orders?: number | number | null | undefined;
109
108
  revenue?: number | number | null | undefined;
@@ -134,6 +133,7 @@ export type MetricsTotals = {
134
133
  canceledSubscriptionsTooExpensive?: number | number | null | undefined;
135
134
  canceledSubscriptionsUnused?: number | number | null | undefined;
136
135
  canceledSubscriptionsOther?: number | number | null | undefined;
136
+ checkoutsConversion?: number | number | null | undefined;
137
137
  churnRate?: number | number | null | undefined;
138
138
  ltv?: number | number | null | undefined;
139
139
  grossMargin?: number | number | null | undefined;
@@ -261,22 +261,6 @@ export function metricsTotalsSucceededCheckoutsFromJSON(
261
261
  );
262
262
  }
263
263
 
264
- /** @internal */
265
- export const MetricsTotalsCheckoutsConversion$inboundSchema: z.ZodMiniType<
266
- MetricsTotalsCheckoutsConversion,
267
- unknown
268
- > = smartUnion([z.int(), z.number()]);
269
-
270
- export function metricsTotalsCheckoutsConversionFromJSON(
271
- jsonString: string,
272
- ): SafeParseResult<MetricsTotalsCheckoutsConversion, SDKValidationError> {
273
- return safeParse(
274
- jsonString,
275
- (x) => MetricsTotalsCheckoutsConversion$inboundSchema.parse(JSON.parse(x)),
276
- `Failed to parse 'MetricsTotalsCheckoutsConversion' from JSON`,
277
- );
278
- }
279
-
280
264
  /** @internal */
281
265
  export const MetricsTotalsChurnedSubscriptions$inboundSchema: z.ZodMiniType<
282
266
  MetricsTotalsChurnedSubscriptions,
@@ -823,6 +807,22 @@ export function metricsTotalsCanceledSubscriptionsOtherFromJSON(
823
807
  );
824
808
  }
825
809
 
810
+ /** @internal */
811
+ export const MetricsTotalsCheckoutsConversion$inboundSchema: z.ZodMiniType<
812
+ MetricsTotalsCheckoutsConversion,
813
+ unknown
814
+ > = smartUnion([z.int(), z.number()]);
815
+
816
+ export function metricsTotalsCheckoutsConversionFromJSON(
817
+ jsonString: string,
818
+ ): SafeParseResult<MetricsTotalsCheckoutsConversion, SDKValidationError> {
819
+ return safeParse(
820
+ jsonString,
821
+ (x) => MetricsTotalsCheckoutsConversion$inboundSchema.parse(JSON.parse(x)),
822
+ `Failed to parse 'MetricsTotalsCheckoutsConversion' from JSON`,
823
+ );
824
+ }
825
+
826
826
  /** @internal */
827
827
  export const MetricsTotalsChurnRate$inboundSchema: z.ZodMiniType<
828
828
  MetricsTotalsChurnRate,
@@ -929,9 +929,6 @@ export const MetricsTotals$inboundSchema: z.ZodMiniType<
929
929
  succeeded_checkouts: z.optional(
930
930
  z.nullable(smartUnion([z.int(), z.number()])),
931
931
  ),
932
- checkouts_conversion: z.optional(
933
- z.nullable(smartUnion([z.int(), z.number()])),
934
- ),
935
932
  churned_subscriptions: z.optional(
936
933
  z.nullable(smartUnion([z.int(), z.number()])),
937
934
  ),
@@ -1010,6 +1007,9 @@ export const MetricsTotals$inboundSchema: z.ZodMiniType<
1010
1007
  canceled_subscriptions_other: z.optional(
1011
1008
  z.nullable(smartUnion([z.int(), z.number()])),
1012
1009
  ),
1010
+ checkouts_conversion: z.optional(
1011
+ z.nullable(smartUnion([z.int(), z.number()])),
1012
+ ),
1013
1013
  churn_rate: z.optional(z.nullable(smartUnion([z.int(), z.number()]))),
1014
1014
  ltv: z.optional(z.nullable(smartUnion([z.int(), z.number()]))),
1015
1015
  gross_margin: z.optional(z.nullable(smartUnion([z.int(), z.number()]))),
@@ -1026,7 +1026,6 @@ export const MetricsTotals$inboundSchema: z.ZodMiniType<
1026
1026
  "committed_monthly_recurring_revenue": "committedMonthlyRecurringRevenue",
1027
1027
  "average_revenue_per_user": "averageRevenuePerUser",
1028
1028
  "succeeded_checkouts": "succeededCheckouts",
1029
- "checkouts_conversion": "checkoutsConversion",
1030
1029
  "churned_subscriptions": "churnedSubscriptions",
1031
1030
  "net_revenue": "netRevenue",
1032
1031
  "cumulative_revenue": "cumulativeRevenue",
@@ -1058,6 +1057,7 @@ export const MetricsTotals$inboundSchema: z.ZodMiniType<
1058
1057
  "canceledSubscriptionsTooExpensive",
1059
1058
  "canceled_subscriptions_unused": "canceledSubscriptionsUnused",
1060
1059
  "canceled_subscriptions_other": "canceledSubscriptionsOther",
1060
+ "checkouts_conversion": "checkoutsConversion",
1061
1061
  "churn_rate": "churnRate",
1062
1062
  "gross_margin": "grossMargin",
1063
1063
  "gross_margin_percentage": "grossMarginPercentage",
@@ -15,7 +15,9 @@ export type OrganizationCustomerEmailSettings = {
15
15
  subscriptionCycled: boolean;
16
16
  subscriptionCycledAfterTrial: boolean;
17
17
  subscriptionPastDue: boolean;
18
+ subscriptionRenewalReminder: boolean;
18
19
  subscriptionRevoked: boolean;
20
+ subscriptionTrialConversionReminder: boolean;
19
21
  subscriptionUncanceled: boolean;
20
22
  subscriptionUpdated: boolean;
21
23
  };
@@ -32,7 +34,9 @@ export const OrganizationCustomerEmailSettings$inboundSchema: z.ZodMiniType<
32
34
  subscription_cycled: z.boolean(),
33
35
  subscription_cycled_after_trial: z.boolean(),
34
36
  subscription_past_due: z.boolean(),
37
+ subscription_renewal_reminder: z.boolean(),
35
38
  subscription_revoked: z.boolean(),
39
+ subscription_trial_conversion_reminder: z.boolean(),
36
40
  subscription_uncanceled: z.boolean(),
37
41
  subscription_updated: z.boolean(),
38
42
  }),
@@ -44,7 +48,10 @@ export const OrganizationCustomerEmailSettings$inboundSchema: z.ZodMiniType<
44
48
  "subscription_cycled": "subscriptionCycled",
45
49
  "subscription_cycled_after_trial": "subscriptionCycledAfterTrial",
46
50
  "subscription_past_due": "subscriptionPastDue",
51
+ "subscription_renewal_reminder": "subscriptionRenewalReminder",
47
52
  "subscription_revoked": "subscriptionRevoked",
53
+ "subscription_trial_conversion_reminder":
54
+ "subscriptionTrialConversionReminder",
48
55
  "subscription_uncanceled": "subscriptionUncanceled",
49
56
  "subscription_updated": "subscriptionUpdated",
50
57
  });
@@ -58,7 +65,9 @@ export type OrganizationCustomerEmailSettings$Outbound = {
58
65
  subscription_cycled: boolean;
59
66
  subscription_cycled_after_trial: boolean;
60
67
  subscription_past_due: boolean;
68
+ subscription_renewal_reminder: boolean;
61
69
  subscription_revoked: boolean;
70
+ subscription_trial_conversion_reminder: boolean;
62
71
  subscription_uncanceled: boolean;
63
72
  subscription_updated: boolean;
64
73
  };
@@ -75,7 +84,9 @@ export const OrganizationCustomerEmailSettings$outboundSchema: z.ZodMiniType<
75
84
  subscriptionCycled: z.boolean(),
76
85
  subscriptionCycledAfterTrial: z.boolean(),
77
86
  subscriptionPastDue: z.boolean(),
87
+ subscriptionRenewalReminder: z.boolean(),
78
88
  subscriptionRevoked: z.boolean(),
89
+ subscriptionTrialConversionReminder: z.boolean(),
79
90
  subscriptionUncanceled: z.boolean(),
80
91
  subscriptionUpdated: z.boolean(),
81
92
  }),
@@ -87,7 +98,10 @@ export const OrganizationCustomerEmailSettings$outboundSchema: z.ZodMiniType<
87
98
  subscriptionCycled: "subscription_cycled",
88
99
  subscriptionCycledAfterTrial: "subscription_cycled_after_trial",
89
100
  subscriptionPastDue: "subscription_past_due",
101
+ subscriptionRenewalReminder: "subscription_renewal_reminder",
90
102
  subscriptionRevoked: "subscription_revoked",
103
+ subscriptionTrialConversionReminder:
104
+ "subscription_trial_conversion_reminder",
91
105
  subscriptionUncanceled: "subscription_uncanceled",
92
106
  subscriptionUpdated: "subscription_updated",
93
107
  });
@@ -0,0 +1,119 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * Pending update to be applied to a subscription at the beginning of the next period.
13
+ */
14
+ export type PendingSubscriptionUpdate = {
15
+ /**
16
+ * Creation timestamp of the object.
17
+ */
18
+ createdAt: Date;
19
+ /**
20
+ * Last modification timestamp of the object.
21
+ */
22
+ modifiedAt: Date | null;
23
+ /**
24
+ * The ID of the object.
25
+ */
26
+ id: string;
27
+ /**
28
+ * The date and time when the subscription update will be applied.
29
+ */
30
+ appliesAt: Date;
31
+ /**
32
+ * ID of the new product to apply to the subscription. If `null`, the product won't be changed.
33
+ */
34
+ productId: string | null;
35
+ /**
36
+ * Number of seats to apply to the subscription. If `null`, the number of seats won't be changed.
37
+ */
38
+ seats: number | null;
39
+ };
40
+
41
+ /** @internal */
42
+ export const PendingSubscriptionUpdate$inboundSchema: z.ZodMiniType<
43
+ PendingSubscriptionUpdate,
44
+ unknown
45
+ > = z.pipe(
46
+ z.object({
47
+ created_at: z.pipe(
48
+ z.iso.datetime({ offset: true }),
49
+ z.transform(v => new Date(v)),
50
+ ),
51
+ modified_at: z.nullable(
52
+ z.pipe(z.iso.datetime({ offset: true }), z.transform(v => new Date(v))),
53
+ ),
54
+ id: z.string(),
55
+ applies_at: z.pipe(
56
+ z.iso.datetime({ offset: true }),
57
+ z.transform(v => new Date(v)),
58
+ ),
59
+ product_id: z.nullable(z.string()),
60
+ seats: z.nullable(z.int()),
61
+ }),
62
+ z.transform((v) => {
63
+ return remap$(v, {
64
+ "created_at": "createdAt",
65
+ "modified_at": "modifiedAt",
66
+ "applies_at": "appliesAt",
67
+ "product_id": "productId",
68
+ });
69
+ }),
70
+ );
71
+ /** @internal */
72
+ export type PendingSubscriptionUpdate$Outbound = {
73
+ created_at: string;
74
+ modified_at: string | null;
75
+ id: string;
76
+ applies_at: string;
77
+ product_id: string | null;
78
+ seats: number | null;
79
+ };
80
+
81
+ /** @internal */
82
+ export const PendingSubscriptionUpdate$outboundSchema: z.ZodMiniType<
83
+ PendingSubscriptionUpdate$Outbound,
84
+ PendingSubscriptionUpdate
85
+ > = z.pipe(
86
+ z.object({
87
+ createdAt: z.pipe(z.date(), z.transform(v => v.toISOString())),
88
+ modifiedAt: z.nullable(z.pipe(z.date(), z.transform(v => v.toISOString()))),
89
+ id: z.string(),
90
+ appliesAt: z.pipe(z.date(), z.transform(v => v.toISOString())),
91
+ productId: z.nullable(z.string()),
92
+ seats: z.nullable(z.int()),
93
+ }),
94
+ z.transform((v) => {
95
+ return remap$(v, {
96
+ createdAt: "created_at",
97
+ modifiedAt: "modified_at",
98
+ appliesAt: "applies_at",
99
+ productId: "product_id",
100
+ });
101
+ }),
102
+ );
103
+
104
+ export function pendingSubscriptionUpdateToJSON(
105
+ pendingSubscriptionUpdate: PendingSubscriptionUpdate,
106
+ ): string {
107
+ return JSON.stringify(
108
+ PendingSubscriptionUpdate$outboundSchema.parse(pendingSubscriptionUpdate),
109
+ );
110
+ }
111
+ export function pendingSubscriptionUpdateFromJSON(
112
+ jsonString: string,
113
+ ): SafeParseResult<PendingSubscriptionUpdate, SDKValidationError> {
114
+ return safeParse(
115
+ jsonString,
116
+ (x) => PendingSubscriptionUpdate$inboundSchema.parse(JSON.parse(x)),
117
+ `Failed to parse 'PendingSubscriptionUpdate' from JSON`,
118
+ );
119
+ }
@@ -49,6 +49,12 @@ import {
49
49
  MetadataOutputType$Outbound,
50
50
  MetadataOutputType$outboundSchema,
51
51
  } from "./metadataoutputtype.js";
52
+ import {
53
+ PendingSubscriptionUpdate,
54
+ PendingSubscriptionUpdate$inboundSchema,
55
+ PendingSubscriptionUpdate$Outbound,
56
+ PendingSubscriptionUpdate$outboundSchema,
57
+ } from "./pendingsubscriptionupdate.js";
52
58
  import {
53
59
  Product,
54
60
  Product$inboundSchema,
@@ -202,6 +208,10 @@ export type Subscription = {
202
208
  * List of meters associated with the subscription.
203
209
  */
204
210
  meters: Array<SubscriptionMeter>;
211
+ /**
212
+ * Pending subscription update that will be applied at the beginning of the next period. If `null`, there is no pending update.
213
+ */
214
+ pendingUpdate: PendingSubscriptionUpdate | null;
205
215
  };
206
216
 
207
217
  /** @internal */
@@ -414,6 +424,7 @@ export const Subscription$inboundSchema: z.ZodMiniType<Subscription, unknown> =
414
424
  ]),
415
425
  ),
416
426
  meters: z.array(SubscriptionMeter$inboundSchema),
427
+ pending_update: z.nullable(PendingSubscriptionUpdate$inboundSchema),
417
428
  }),
418
429
  z.transform((v) => {
419
430
  return remap$(v, {
@@ -437,6 +448,7 @@ export const Subscription$inboundSchema: z.ZodMiniType<Subscription, unknown> =
437
448
  "customer_cancellation_reason": "customerCancellationReason",
438
449
  "customer_cancellation_comment": "customerCancellationComment",
439
450
  "custom_field_data": "customFieldData",
451
+ "pending_update": "pendingUpdate",
440
452
  });
441
453
  }),
442
454
  );
@@ -480,6 +492,7 @@ export type Subscription$Outbound = {
480
492
  | null;
481
493
  prices: Array<LegacyRecurringProductPrice$Outbound | ProductPrice$Outbound>;
482
494
  meters: Array<SubscriptionMeter$Outbound>;
495
+ pending_update: PendingSubscriptionUpdate$Outbound | null;
483
496
  };
484
497
 
485
498
  /** @internal */
@@ -545,6 +558,7 @@ export const Subscription$outboundSchema: z.ZodMiniType<
545
558
  ]),
546
559
  ),
547
560
  meters: z.array(SubscriptionMeter$outboundSchema),
561
+ pendingUpdate: z.nullable(PendingSubscriptionUpdate$outboundSchema),
548
562
  }),
549
563
  z.transform((v) => {
550
564
  return remap$(v, {
@@ -568,6 +582,7 @@ export const Subscription$outboundSchema: z.ZodMiniType<
568
582
  customerCancellationReason: "customer_cancellation_reason",
569
583
  customerCancellationComment: "customer_cancellation_comment",
570
584
  customFieldData: "custom_field_data",
585
+ pendingUpdate: "pending_update",
571
586
  });
572
587
  }),
573
588
  );
@@ -9,6 +9,7 @@ import { OpenEnum } from "../../types/enums.js";
9
9
  export const SubscriptionProrationBehavior = {
10
10
  Invoice: "invoice",
11
11
  Prorate: "prorate",
12
+ NextPeriod: "next_period",
12
13
  } as const;
13
14
  export type SubscriptionProrationBehavior = OpenEnum<
14
15
  typeof SubscriptionProrationBehavior
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type SubscriptionUpdatedBillingPeriodMetadata = {
12
+ subscriptionId: string;
13
+ billingPeriodEnd: string;
14
+ };
15
+
16
+ /** @internal */
17
+ export const SubscriptionUpdatedBillingPeriodMetadata$inboundSchema:
18
+ z.ZodMiniType<SubscriptionUpdatedBillingPeriodMetadata, unknown> = z.pipe(
19
+ z.object({
20
+ subscription_id: z.string(),
21
+ billing_period_end: z.string(),
22
+ }),
23
+ z.transform((v) => {
24
+ return remap$(v, {
25
+ "subscription_id": "subscriptionId",
26
+ "billing_period_end": "billingPeriodEnd",
27
+ });
28
+ }),
29
+ );
30
+
31
+ export function subscriptionUpdatedBillingPeriodMetadataFromJSON(
32
+ jsonString: string,
33
+ ): SafeParseResult<
34
+ SubscriptionUpdatedBillingPeriodMetadata,
35
+ SDKValidationError
36
+ > {
37
+ return safeParse(
38
+ jsonString,
39
+ (x) =>
40
+ SubscriptionUpdatedBillingPeriodMetadata$inboundSchema.parse(
41
+ JSON.parse(x),
42
+ ),
43
+ `Failed to parse 'SubscriptionUpdatedBillingPeriodMetadata' from JSON`,
44
+ );
45
+ }
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type SubscriptionUpdatedDiscountMetadata = {
12
+ subscriptionId: string;
13
+ discountId: string | null;
14
+ };
15
+
16
+ /** @internal */
17
+ export const SubscriptionUpdatedDiscountMetadata$inboundSchema: z.ZodMiniType<
18
+ SubscriptionUpdatedDiscountMetadata,
19
+ unknown
20
+ > = z.pipe(
21
+ z.object({
22
+ subscription_id: z.string(),
23
+ discount_id: z.nullable(z.string()),
24
+ }),
25
+ z.transform((v) => {
26
+ return remap$(v, {
27
+ "subscription_id": "subscriptionId",
28
+ "discount_id": "discountId",
29
+ });
30
+ }),
31
+ );
32
+
33
+ export function subscriptionUpdatedDiscountMetadataFromJSON(
34
+ jsonString: string,
35
+ ): SafeParseResult<SubscriptionUpdatedDiscountMetadata, SDKValidationError> {
36
+ return safeParse(
37
+ jsonString,
38
+ (x) =>
39
+ SubscriptionUpdatedDiscountMetadata$inboundSchema.parse(JSON.parse(x)),
40
+ `Failed to parse 'SubscriptionUpdatedDiscountMetadata' from JSON`,
41
+ );
42
+ }