@tirdad/sdk 2.1.46 → 2.1.48

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 (322) hide show
  1. package/esm/funcs/commitments-get-commitment-billing-terms.d.ts +17 -0
  2. package/esm/funcs/commitments-get-commitment-billing-terms.d.ts.map +1 -0
  3. package/esm/funcs/commitments-get-commitment-billing-terms.js +91 -0
  4. package/esm/funcs/commitments-get-commitment-billing-terms.js.map +1 -0
  5. package/esm/funcs/commitments-list-commitment-instalments.d.ts +17 -0
  6. package/esm/funcs/commitments-list-commitment-instalments.d.ts.map +1 -0
  7. package/esm/funcs/commitments-list-commitment-instalments.js +96 -0
  8. package/esm/funcs/commitments-list-commitment-instalments.js.map +1 -0
  9. package/esm/funcs/commitments-preview-commitment-billing-terms.d.ts +17 -0
  10. package/esm/funcs/commitments-preview-commitment-billing-terms.d.ts.map +1 -0
  11. package/esm/funcs/commitments-preview-commitment-billing-terms.js +93 -0
  12. package/esm/funcs/commitments-preview-commitment-billing-terms.js.map +1 -0
  13. package/esm/funcs/commitments-replace-commitment-billing-terms.d.ts +17 -0
  14. package/esm/funcs/commitments-replace-commitment-billing-terms.d.ts.map +1 -0
  15. package/esm/funcs/commitments-replace-commitment-billing-terms.js +93 -0
  16. package/esm/funcs/commitments-replace-commitment-billing-terms.js.map +1 -0
  17. package/esm/funcs/commitments-terminate-commitment.d.ts +1 -1
  18. package/esm/funcs/commitments-terminate-commitment.js +1 -1
  19. package/esm/funcs/commitments-trigger-commitment-instalment.d.ts +17 -0
  20. package/esm/funcs/commitments-trigger-commitment-instalment.d.ts.map +1 -0
  21. package/esm/funcs/commitments-trigger-commitment-instalment.js +98 -0
  22. package/esm/funcs/commitments-trigger-commitment-instalment.js.map +1 -0
  23. package/esm/funcs/events-get-usage-analytics.d.ts +5 -0
  24. package/esm/funcs/events-get-usage-analytics.d.ts.map +1 -1
  25. package/esm/funcs/events-get-usage-analytics.js +5 -0
  26. package/esm/funcs/events-get-usage-analytics.js.map +1 -1
  27. package/esm/funcs/prices-get-price-history.d.ts +17 -0
  28. package/esm/funcs/prices-get-price-history.d.ts.map +1 -0
  29. package/esm/funcs/prices-get-price-history.js +91 -0
  30. package/esm/funcs/prices-get-price-history.js.map +1 -0
  31. package/esm/funcs/subscriptions-get-subscription-line-item-history.d.ts +17 -0
  32. package/esm/funcs/subscriptions-get-subscription-line-item-history.d.ts.map +1 -0
  33. package/esm/funcs/subscriptions-get-subscription-line-item-history.js +91 -0
  34. package/esm/funcs/subscriptions-get-subscription-line-item-history.js.map +1 -0
  35. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.d.ts +17 -0
  36. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.d.ts.map +1 -0
  37. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.js +69 -0
  38. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.js.map +1 -0
  39. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-created.d.ts +17 -0
  40. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-created.d.ts.map +1 -0
  41. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-created.js +69 -0
  42. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-created.js.map +1 -0
  43. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.d.ts +17 -0
  44. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.d.ts.map +1 -0
  45. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.js +69 -0
  46. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.js.map +1 -0
  47. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-updated.d.ts +17 -0
  48. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-updated.d.ts.map +1 -0
  49. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-updated.js +69 -0
  50. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-updated.js.map +1 -0
  51. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-created.d.ts +17 -0
  52. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-created.d.ts.map +1 -0
  53. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-created.js +69 -0
  54. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-created.js.map +1 -0
  55. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-updated.d.ts +17 -0
  56. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-updated.d.ts.map +1 -0
  57. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-updated.js +69 -0
  58. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-updated.js.map +1 -0
  59. package/esm/funcs/webhook-events-post-webhook-events-payment-attempt-failed.d.ts +17 -0
  60. package/esm/funcs/webhook-events-post-webhook-events-payment-attempt-failed.d.ts.map +1 -0
  61. package/esm/funcs/webhook-events-post-webhook-events-payment-attempt-failed.js +69 -0
  62. package/esm/funcs/webhook-events-post-webhook-events-payment-attempt-failed.js.map +1 -0
  63. package/esm/lib/config.d.ts +3 -3
  64. package/esm/lib/config.d.ts.map +1 -1
  65. package/esm/lib/config.js +10 -2
  66. package/esm/lib/config.js.map +1 -1
  67. package/esm/sdk/commitments.d.ts +36 -1
  68. package/esm/sdk/commitments.d.ts.map +1 -1
  69. package/esm/sdk/commitments.js +51 -1
  70. package/esm/sdk/commitments.js.map +1 -1
  71. package/esm/sdk/events.d.ts +5 -0
  72. package/esm/sdk/events.d.ts.map +1 -1
  73. package/esm/sdk/events.js +5 -0
  74. package/esm/sdk/events.js.map +1 -1
  75. package/esm/sdk/models/billing-term-input.d.ts +67 -0
  76. package/esm/sdk/models/billing-term-input.d.ts.map +1 -0
  77. package/esm/sdk/models/billing-term-input.js +43 -0
  78. package/esm/sdk/models/billing-term-input.js.map +1 -0
  79. package/esm/sdk/models/billing-term-kind.d.ts +12 -0
  80. package/esm/sdk/models/billing-term-kind.d.ts.map +1 -0
  81. package/esm/sdk/models/billing-term-kind.js +13 -0
  82. package/esm/sdk/models/billing-term-kind.js.map +1 -0
  83. package/esm/sdk/models/billing-term-owner-type.d.ts +9 -0
  84. package/esm/sdk/models/billing-term-owner-type.d.ts.map +1 -0
  85. package/esm/sdk/models/billing-term-owner-type.js +10 -0
  86. package/esm/sdk/models/billing-term-owner-type.js.map +1 -0
  87. package/esm/sdk/models/billing-term-split.d.ts +12 -0
  88. package/esm/sdk/models/billing-term-split.d.ts.map +1 -0
  89. package/esm/sdk/models/billing-term-split.js +13 -0
  90. package/esm/sdk/models/billing-term-split.js.map +1 -0
  91. package/esm/sdk/models/billing-term-value-type.d.ts +19 -0
  92. package/esm/sdk/models/billing-term-value-type.d.ts.map +1 -0
  93. package/esm/sdk/models/billing-term-value-type.js +17 -0
  94. package/esm/sdk/models/billing-term-value-type.js.map +1 -0
  95. package/esm/sdk/models/billing-terms-response.d.ts +13 -0
  96. package/esm/sdk/models/billing-terms-response.d.ts.map +1 -0
  97. package/esm/sdk/models/billing-terms-response.js +22 -0
  98. package/esm/sdk/models/billing-terms-response.js.map +1 -0
  99. package/esm/sdk/models/billingterm-instalment.d.ts +43 -0
  100. package/esm/sdk/models/billingterm-instalment.d.ts.map +1 -0
  101. package/esm/sdk/models/billingterm-instalment.js +68 -0
  102. package/esm/sdk/models/billingterm-instalment.js.map +1 -0
  103. package/esm/sdk/models/billingterm-term.d.ts +57 -0
  104. package/esm/sdk/models/billingterm-term.d.ts.map +1 -0
  105. package/esm/sdk/models/billingterm-term.js +65 -0
  106. package/esm/sdk/models/billingterm-term.js.map +1 -0
  107. package/esm/sdk/models/cancellation-fee-input.d.ts +18 -0
  108. package/esm/sdk/models/cancellation-fee-input.d.ts.map +1 -0
  109. package/esm/sdk/models/cancellation-fee-input.js +14 -0
  110. package/esm/sdk/models/cancellation-fee-input.js.map +1 -0
  111. package/esm/sdk/models/cancellation-fee-type.d.ts +16 -0
  112. package/esm/sdk/models/cancellation-fee-type.d.ts.map +1 -0
  113. package/esm/sdk/models/cancellation-fee-type.js +14 -0
  114. package/esm/sdk/models/cancellation-fee-type.js.map +1 -0
  115. package/esm/sdk/models/commitment-response.d.ts +9 -1
  116. package/esm/sdk/models/commitment-response.d.ts.map +1 -1
  117. package/esm/sdk/models/commitment-response.js +7 -1
  118. package/esm/sdk/models/commitment-response.js.map +1 -1
  119. package/esm/sdk/models/create-commitment-request.d.ts +12 -0
  120. package/esm/sdk/models/create-commitment-request.d.ts.map +1 -1
  121. package/esm/sdk/models/create-commitment-request.js +6 -0
  122. package/esm/sdk/models/create-commitment-request.js.map +1 -1
  123. package/esm/sdk/models/get-commitment-billing-terms-op.d.ts +15 -0
  124. package/esm/sdk/models/get-commitment-billing-terms-op.d.ts.map +1 -0
  125. package/esm/sdk/models/get-commitment-billing-terms-op.js +12 -0
  126. package/esm/sdk/models/get-commitment-billing-terms-op.js.map +1 -0
  127. package/esm/sdk/models/get-price-history-op.d.ts +15 -0
  128. package/esm/sdk/models/get-price-history-op.d.ts.map +1 -0
  129. package/esm/sdk/models/get-price-history-op.js +12 -0
  130. package/esm/sdk/models/get-price-history-op.js.map +1 -0
  131. package/esm/sdk/models/get-subscription-line-item-history-op.d.ts +15 -0
  132. package/esm/sdk/models/get-subscription-line-item-history-op.d.ts.map +1 -0
  133. package/esm/sdk/models/get-subscription-line-item-history-op.js +12 -0
  134. package/esm/sdk/models/get-subscription-line-item-history-op.js.map +1 -0
  135. package/esm/sdk/models/get-subscription-v2-op.d.ts +1 -1
  136. package/esm/sdk/models/grouped-invoicing-child-request.d.ts +3 -0
  137. package/esm/sdk/models/grouped-invoicing-child-request.d.ts.map +1 -1
  138. package/esm/sdk/models/grouped-invoicing-child-request.js +3 -0
  139. package/esm/sdk/models/grouped-invoicing-child-request.js.map +1 -1
  140. package/esm/sdk/models/index.d.ts +28 -0
  141. package/esm/sdk/models/index.d.ts.map +1 -1
  142. package/esm/sdk/models/index.js +28 -0
  143. package/esm/sdk/models/index.js.map +1 -1
  144. package/esm/sdk/models/instalment-bill-trigger.d.ts +12 -0
  145. package/esm/sdk/models/instalment-bill-trigger.d.ts.map +1 -0
  146. package/esm/sdk/models/instalment-bill-trigger.js +13 -0
  147. package/esm/sdk/models/instalment-bill-trigger.js.map +1 -0
  148. package/esm/sdk/models/instalment-delivery.d.ts +12 -0
  149. package/esm/sdk/models/instalment-delivery.d.ts.map +1 -0
  150. package/esm/sdk/models/instalment-delivery.js +13 -0
  151. package/esm/sdk/models/instalment-delivery.js.map +1 -0
  152. package/esm/sdk/models/instalment-kind.d.ts +10 -0
  153. package/esm/sdk/models/instalment-kind.d.ts.map +1 -0
  154. package/esm/sdk/models/instalment-kind.js +11 -0
  155. package/esm/sdk/models/instalment-kind.js.map +1 -0
  156. package/esm/sdk/models/instalment-status.d.ts +11 -0
  157. package/esm/sdk/models/instalment-status.d.ts.map +1 -0
  158. package/esm/sdk/models/instalment-status.js +12 -0
  159. package/esm/sdk/models/instalment-status.js.map +1 -0
  160. package/esm/sdk/models/invoice-billing-reason.d.ts +2 -0
  161. package/esm/sdk/models/invoice-billing-reason.d.ts.map +1 -1
  162. package/esm/sdk/models/invoice-billing-reason.js +2 -0
  163. package/esm/sdk/models/invoice-billing-reason.js.map +1 -1
  164. package/esm/sdk/models/invoice-line-item-response.d.ts +4 -0
  165. package/esm/sdk/models/invoice-line-item-response.d.ts.map +1 -1
  166. package/esm/sdk/models/invoice-line-item-response.js +2 -0
  167. package/esm/sdk/models/invoice-line-item-response.js.map +1 -1
  168. package/esm/sdk/models/list-commitment-instalments-op.d.ts +20 -0
  169. package/esm/sdk/models/list-commitment-instalments-op.d.ts.map +1 -0
  170. package/esm/sdk/models/list-commitment-instalments-op.js +13 -0
  171. package/esm/sdk/models/list-commitment-instalments-op.js.map +1 -0
  172. package/esm/sdk/models/list-instalments-response.d.ts +11 -0
  173. package/esm/sdk/models/list-instalments-response.d.ts.map +1 -0
  174. package/esm/sdk/models/list-instalments-response.js +15 -0
  175. package/esm/sdk/models/list-instalments-response.js.map +1 -0
  176. package/esm/sdk/models/payment-attempt-response.d.ts +1 -0
  177. package/esm/sdk/models/payment-attempt-response.d.ts.map +1 -1
  178. package/esm/sdk/models/payment-attempt-response.js +2 -0
  179. package/esm/sdk/models/payment-attempt-response.js.map +1 -1
  180. package/esm/sdk/models/preview-commitment-billing-terms-op.d.ts +21 -0
  181. package/esm/sdk/models/preview-commitment-billing-terms-op.d.ts.map +1 -0
  182. package/esm/sdk/models/preview-commitment-billing-terms-op.js +14 -0
  183. package/esm/sdk/models/preview-commitment-billing-terms-op.js.map +1 -0
  184. package/esm/sdk/models/replace-billing-terms-request.d.ts +13 -0
  185. package/esm/sdk/models/replace-billing-terms-request.d.ts.map +1 -0
  186. package/esm/sdk/models/replace-billing-terms-request.js +18 -0
  187. package/esm/sdk/models/replace-billing-terms-request.js.map +1 -0
  188. package/esm/sdk/models/replace-commitment-billing-terms-op.d.ts +21 -0
  189. package/esm/sdk/models/replace-commitment-billing-terms-op.d.ts.map +1 -0
  190. package/esm/sdk/models/replace-commitment-billing-terms-op.js +14 -0
  191. package/esm/sdk/models/replace-commitment-billing-terms-op.js.map +1 -0
  192. package/esm/sdk/models/subscription-response-v2.d.ts +5 -0
  193. package/esm/sdk/models/subscription-response-v2.d.ts.map +1 -1
  194. package/esm/sdk/models/subscription-response-v2.js +2 -0
  195. package/esm/sdk/models/subscription-response-v2.js.map +1 -1
  196. package/esm/sdk/models/subscription-response.d.ts +5 -0
  197. package/esm/sdk/models/subscription-response.d.ts.map +1 -1
  198. package/esm/sdk/models/subscription-response.js +2 -0
  199. package/esm/sdk/models/subscription-response.js.map +1 -1
  200. package/esm/sdk/models/terminate-commitment-request.d.ts +6 -2
  201. package/esm/sdk/models/terminate-commitment-request.d.ts.map +1 -1
  202. package/esm/sdk/models/terminate-commitment-request.js +2 -1
  203. package/esm/sdk/models/terminate-commitment-request.js.map +1 -1
  204. package/esm/sdk/models/trigger-commitment-instalment-op.d.ts +26 -0
  205. package/esm/sdk/models/trigger-commitment-instalment-op.d.ts.map +1 -0
  206. package/esm/sdk/models/trigger-commitment-instalment-op.js +20 -0
  207. package/esm/sdk/models/trigger-commitment-instalment-op.js.map +1 -0
  208. package/esm/sdk/models/trigger-instalment-request.d.ts +15 -0
  209. package/esm/sdk/models/trigger-instalment-request.d.ts.map +1 -0
  210. package/esm/sdk/models/trigger-instalment-request.js +17 -0
  211. package/esm/sdk/models/trigger-instalment-request.js.map +1 -0
  212. package/esm/sdk/models/update-commitment-request.d.ts +5 -0
  213. package/esm/sdk/models/update-commitment-request.d.ts.map +1 -1
  214. package/esm/sdk/models/update-commitment-request.js +2 -0
  215. package/esm/sdk/models/update-commitment-request.js.map +1 -1
  216. package/esm/sdk/models/update-subscription-request.d.ts +3 -0
  217. package/esm/sdk/models/update-subscription-request.d.ts.map +1 -1
  218. package/esm/sdk/models/update-subscription-request.js +3 -0
  219. package/esm/sdk/models/update-subscription-request.js.map +1 -1
  220. package/esm/sdk/models/webhook-dto-billing-instalment-webhook-payload.d.ts +13 -0
  221. package/esm/sdk/models/webhook-dto-billing-instalment-webhook-payload.d.ts.map +1 -0
  222. package/esm/sdk/models/webhook-dto-billing-instalment-webhook-payload.js +22 -0
  223. package/esm/sdk/models/webhook-dto-billing-instalment-webhook-payload.js.map +1 -0
  224. package/esm/sdk/models/webhook-dto-billing-terms-webhook-payload.d.ts +16 -0
  225. package/esm/sdk/models/webhook-dto-billing-terms-webhook-payload.d.ts.map +1 -0
  226. package/esm/sdk/models/webhook-dto-billing-terms-webhook-payload.js +28 -0
  227. package/esm/sdk/models/webhook-dto-billing-terms-webhook-payload.js.map +1 -0
  228. package/esm/sdk/models/webhook-dto-invoice-line-item.d.ts +1 -0
  229. package/esm/sdk/models/webhook-dto-invoice-line-item.d.ts.map +1 -1
  230. package/esm/sdk/models/webhook-dto-invoice-line-item.js +2 -0
  231. package/esm/sdk/models/webhook-dto-invoice-line-item.js.map +1 -1
  232. package/esm/sdk/models/webhook-dto-payment-attempt-webhook-payload.d.ts +17 -0
  233. package/esm/sdk/models/webhook-dto-payment-attempt-webhook-payload.d.ts.map +1 -0
  234. package/esm/sdk/models/webhook-dto-payment-attempt-webhook-payload.js +27 -0
  235. package/esm/sdk/models/webhook-dto-payment-attempt-webhook-payload.js.map +1 -0
  236. package/esm/sdk/models/webhook-dto-payment-attempt.d.ts +17 -0
  237. package/esm/sdk/models/webhook-dto-payment-attempt.d.ts.map +1 -0
  238. package/esm/sdk/models/webhook-dto-payment-attempt.js +27 -0
  239. package/esm/sdk/models/webhook-dto-payment-attempt.js.map +1 -0
  240. package/esm/sdk/models/webhook-event-name.d.ts +7 -0
  241. package/esm/sdk/models/webhook-event-name.d.ts.map +1 -1
  242. package/esm/sdk/models/webhook-event-name.js +7 -0
  243. package/esm/sdk/models/webhook-event-name.js.map +1 -1
  244. package/esm/sdk/prices.d.ts +7 -0
  245. package/esm/sdk/prices.d.ts.map +1 -1
  246. package/esm/sdk/prices.js +10 -0
  247. package/esm/sdk/prices.js.map +1 -1
  248. package/esm/sdk/subscriptions.d.ts +7 -0
  249. package/esm/sdk/subscriptions.d.ts.map +1 -1
  250. package/esm/sdk/subscriptions.js +10 -0
  251. package/esm/sdk/subscriptions.js.map +1 -1
  252. package/esm/sdk/webhook-events.d.ts +49 -0
  253. package/esm/sdk/webhook-events.d.ts.map +1 -1
  254. package/esm/sdk/webhook-events.js +70 -0
  255. package/esm/sdk/webhook-events.js.map +1 -1
  256. package/jsr.json +1 -1
  257. package/package.json +1 -1
  258. package/src/funcs/commitments-get-commitment-billing-terms.ts +182 -0
  259. package/src/funcs/commitments-list-commitment-instalments.ts +191 -0
  260. package/src/funcs/commitments-preview-commitment-billing-terms.ts +192 -0
  261. package/src/funcs/commitments-replace-commitment-billing-terms.ts +190 -0
  262. package/src/funcs/commitments-terminate-commitment.ts +1 -1
  263. package/src/funcs/commitments-trigger-commitment-instalment.ts +197 -0
  264. package/src/funcs/events-get-usage-analytics.ts +5 -0
  265. package/src/funcs/prices-get-price-history.ts +181 -0
  266. package/src/funcs/subscriptions-get-subscription-line-item-history.ts +185 -0
  267. package/src/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.ts +144 -0
  268. package/src/funcs/webhook-events-post-webhook-events-billing-instalment-created.ts +144 -0
  269. package/src/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.ts +144 -0
  270. package/src/funcs/webhook-events-post-webhook-events-billing-instalment-updated.ts +144 -0
  271. package/src/funcs/webhook-events-post-webhook-events-billing-terms-created.ts +144 -0
  272. package/src/funcs/webhook-events-post-webhook-events-billing-terms-updated.ts +144 -0
  273. package/src/funcs/webhook-events-post-webhook-events-payment-attempt-failed.ts +144 -0
  274. package/src/lib/config.ts +10 -2
  275. package/src/sdk/commitments.ts +101 -1
  276. package/src/sdk/events.ts +5 -0
  277. package/src/sdk/models/billing-term-input.ts +127 -0
  278. package/src/sdk/models/billing-term-kind.ts +24 -0
  279. package/src/sdk/models/billing-term-owner-type.ts +16 -0
  280. package/src/sdk/models/billing-term-split.ts +24 -0
  281. package/src/sdk/models/billing-term-value-type.ts +31 -0
  282. package/src/sdk/models/billing-terms-response.ts +49 -0
  283. package/src/sdk/models/billingterm-instalment.ts +128 -0
  284. package/src/sdk/models/billingterm-term.ts +143 -0
  285. package/src/sdk/models/cancellation-fee-input.ts +40 -0
  286. package/src/sdk/models/cancellation-fee-type.ts +23 -0
  287. package/src/sdk/models/commitment-response.ts +22 -2
  288. package/src/sdk/models/create-commitment-request.ts +23 -0
  289. package/src/sdk/models/get-commitment-billing-terms-op.ts +35 -0
  290. package/src/sdk/models/get-price-history-op.ts +33 -0
  291. package/src/sdk/models/get-subscription-line-item-history-op.ts +36 -0
  292. package/src/sdk/models/get-subscription-v2-op.ts +1 -1
  293. package/src/sdk/models/grouped-invoicing-child-request.ts +8 -0
  294. package/src/sdk/models/index.ts +28 -0
  295. package/src/sdk/models/instalment-bill-trigger.ts +24 -0
  296. package/src/sdk/models/instalment-delivery.ts +24 -0
  297. package/src/sdk/models/instalment-kind.ts +19 -0
  298. package/src/sdk/models/instalment-status.ts +20 -0
  299. package/src/sdk/models/invoice-billing-reason.ts +2 -0
  300. package/src/sdk/models/invoice-line-item-response.ts +6 -0
  301. package/src/sdk/models/list-commitment-instalments-op.ts +41 -0
  302. package/src/sdk/models/list-instalments-response.ts +35 -0
  303. package/src/sdk/models/payment-attempt-response.ts +3 -0
  304. package/src/sdk/models/preview-commitment-billing-terms-op.ts +46 -0
  305. package/src/sdk/models/replace-billing-terms-request.ts +43 -0
  306. package/src/sdk/models/replace-commitment-billing-terms-op.ts +46 -0
  307. package/src/sdk/models/subscription-response-v2.ts +9 -0
  308. package/src/sdk/models/subscription-response.ts +9 -0
  309. package/src/sdk/models/terminate-commitment-request.ts +11 -3
  310. package/src/sdk/models/trigger-commitment-instalment-op.ts +60 -0
  311. package/src/sdk/models/trigger-instalment-request.ts +41 -0
  312. package/src/sdk/models/update-commitment-request.ts +7 -0
  313. package/src/sdk/models/update-subscription-request.ts +8 -0
  314. package/src/sdk/models/webhook-dto-billing-instalment-webhook-payload.ts +53 -0
  315. package/src/sdk/models/webhook-dto-billing-terms-webhook-payload.ts +61 -0
  316. package/src/sdk/models/webhook-dto-invoice-line-item.ts +3 -0
  317. package/src/sdk/models/webhook-dto-payment-attempt-webhook-payload.ts +61 -0
  318. package/src/sdk/models/webhook-dto-payment-attempt.ts +52 -0
  319. package/src/sdk/models/webhook-event-name.ts +7 -0
  320. package/src/sdk/prices.ts +18 -0
  321. package/src/sdk/subscriptions.ts +18 -0
  322. package/src/sdk/webhook-events.ts +112 -0
@@ -0,0 +1,43 @@
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 {
8
+ BillingTermInput,
9
+ BillingTermInput$Outbound,
10
+ BillingTermInput$outboundSchema,
11
+ } from "./billing-term-input.js";
12
+
13
+ export type ReplaceBillingTermsRequest = {
14
+ billingTerms: Array<BillingTermInput>;
15
+ };
16
+
17
+ /** @internal */
18
+ export type ReplaceBillingTermsRequest$Outbound = {
19
+ billing_terms: Array<BillingTermInput$Outbound>;
20
+ };
21
+
22
+ /** @internal */
23
+ export const ReplaceBillingTermsRequest$outboundSchema: z.ZodMiniType<
24
+ ReplaceBillingTermsRequest$Outbound,
25
+ ReplaceBillingTermsRequest
26
+ > = z.pipe(
27
+ z.object({
28
+ billingTerms: z.array(BillingTermInput$outboundSchema),
29
+ }),
30
+ z.transform((v) => {
31
+ return remap$(v, {
32
+ billingTerms: "billing_terms",
33
+ });
34
+ }),
35
+ );
36
+
37
+ export function replaceBillingTermsRequestToJSON(
38
+ replaceBillingTermsRequest: ReplaceBillingTermsRequest,
39
+ ): string {
40
+ return JSON.stringify(
41
+ ReplaceBillingTermsRequest$outboundSchema.parse(replaceBillingTermsRequest),
42
+ );
43
+ }
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import {
7
+ ReplaceBillingTermsRequest,
8
+ ReplaceBillingTermsRequest$Outbound,
9
+ ReplaceBillingTermsRequest$outboundSchema,
10
+ } from "./replace-billing-terms-request.js";
11
+
12
+ export type ReplaceCommitmentBillingTermsRequest = {
13
+ /**
14
+ * Commitment ID
15
+ */
16
+ id: string;
17
+ /**
18
+ * Billing terms
19
+ */
20
+ body: ReplaceBillingTermsRequest;
21
+ };
22
+
23
+ /** @internal */
24
+ export type ReplaceCommitmentBillingTermsRequest$Outbound = {
25
+ id: string;
26
+ body: ReplaceBillingTermsRequest$Outbound;
27
+ };
28
+
29
+ /** @internal */
30
+ export const ReplaceCommitmentBillingTermsRequest$outboundSchema: z.ZodMiniType<
31
+ ReplaceCommitmentBillingTermsRequest$Outbound,
32
+ ReplaceCommitmentBillingTermsRequest
33
+ > = z.object({
34
+ id: z.string(),
35
+ body: ReplaceBillingTermsRequest$outboundSchema,
36
+ });
37
+
38
+ export function replaceCommitmentBillingTermsRequestToJSON(
39
+ replaceCommitmentBillingTermsRequest: ReplaceCommitmentBillingTermsRequest,
40
+ ): string {
41
+ return JSON.stringify(
42
+ ReplaceCommitmentBillingTermsRequest$outboundSchema.parse(
43
+ replaceCommitmentBillingTermsRequest,
44
+ ),
45
+ );
46
+ }
@@ -16,6 +16,10 @@ import {
16
16
  BillingPeriod,
17
17
  BillingPeriod$inboundSchema,
18
18
  } from "./billing-period.js";
19
+ import {
20
+ CommitmentResponse,
21
+ CommitmentResponse$inboundSchema,
22
+ } from "./commitment-response.js";
19
23
  import {
20
24
  CouponAssociationResponse,
21
25
  CouponAssociationResponse$inboundSchema,
@@ -114,6 +118,10 @@ export type SubscriptionResponseV2 = {
114
118
  */
115
119
  commitmentAmount?: string | undefined;
116
120
  commitmentDuration?: BillingPeriod | undefined;
121
+ /**
122
+ * Commitments are included when "commitments" is in expand parameter
123
+ */
124
+ commitments?: Array<CommitmentResponse> | undefined;
117
125
  /**
118
126
  * CouponAssociations are included when "coupon_associations" is in expand parameter
119
127
  */
@@ -275,6 +283,7 @@ export const SubscriptionResponseV2$inboundSchema: z.ZodMiniType<
275
283
  collection_method: types.optional(types.string()),
276
284
  commitment_amount: types.optional(types.string()),
277
285
  commitment_duration: types.optional(BillingPeriod$inboundSchema),
286
+ commitments: types.optional(z.array(CommitmentResponse$inboundSchema)),
278
287
  coupon_associations: types.optional(
279
288
  z.array(CouponAssociationResponse$inboundSchema),
280
289
  ),
@@ -24,6 +24,10 @@ import {
24
24
  CheckoutSessionResponse,
25
25
  CheckoutSessionResponse$inboundSchema,
26
26
  } from "./checkout-session-response.js";
27
+ import {
28
+ CommitmentResponse,
29
+ CommitmentResponse$inboundSchema,
30
+ } from "./commitment-response.js";
27
31
  import {
28
32
  CouponAssociationResponse,
29
33
  CouponAssociationResponse$inboundSchema,
@@ -127,6 +131,10 @@ export type SubscriptionResponse = {
127
131
  */
128
132
  commitmentAmount?: string | undefined;
129
133
  commitmentDuration?: BillingPeriod | undefined;
134
+ /**
135
+ * Commitments are the commitments created with the subscription; set on create only.
136
+ */
137
+ commitments?: Array<CommitmentResponse> | undefined;
130
138
  /**
131
139
  * CouponAssociations are the coupon associations for this subscription
132
140
  */
@@ -281,6 +289,7 @@ export const SubscriptionResponse$inboundSchema: z.ZodMiniType<
281
289
  collection_method: types.optional(types.string()),
282
290
  commitment_amount: types.optional(types.string()),
283
291
  commitment_duration: types.optional(BillingPeriod$inboundSchema),
292
+ commitments: types.optional(z.array(CommitmentResponse$inboundSchema)),
284
293
  coupon_associations: types.optional(
285
294
  z.array(CouponAssociationResponse$inboundSchema),
286
295
  ),
@@ -4,15 +4,23 @@
4
4
 
5
5
  import * as z from "zod/v4-mini";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
+ import {
8
+ CancellationFeeInput,
9
+ CancellationFeeInput$Outbound,
10
+ CancellationFeeInput$outboundSchema,
11
+ } from "./cancellation-fee-input.js";
7
12
 
8
13
  export type TerminateCommitmentRequest = {
9
- cancellationFee?: string | undefined;
14
+ cancellationFee?: CancellationFeeInput | undefined;
15
+ /**
16
+ * EffectiveAt defaults to now; within a second after a billing period edge it is taken as that edge.
17
+ */
10
18
  effectiveAt?: Date | undefined;
11
19
  };
12
20
 
13
21
  /** @internal */
14
22
  export type TerminateCommitmentRequest$Outbound = {
15
- cancellation_fee?: string | undefined;
23
+ cancellation_fee?: CancellationFeeInput$Outbound | undefined;
16
24
  effective_at?: string | undefined;
17
25
  };
18
26
 
@@ -22,7 +30,7 @@ export const TerminateCommitmentRequest$outboundSchema: z.ZodMiniType<
22
30
  TerminateCommitmentRequest
23
31
  > = z.pipe(
24
32
  z.object({
25
- cancellationFee: z.optional(z.string()),
33
+ cancellationFee: z.optional(CancellationFeeInput$outboundSchema),
26
34
  effectiveAt: z.optional(
27
35
  z.pipe(z.date(), z.transform(v => v.toISOString())),
28
36
  ),
@@ -0,0 +1,60 @@
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 {
8
+ TriggerInstalmentRequest,
9
+ TriggerInstalmentRequest$Outbound,
10
+ TriggerInstalmentRequest$outboundSchema,
11
+ } from "./trigger-instalment-request.js";
12
+
13
+ export type TriggerCommitmentInstalmentRequest = {
14
+ /**
15
+ * Commitment ID
16
+ */
17
+ id: string;
18
+ /**
19
+ * Instalment ID
20
+ */
21
+ instalmentId: string;
22
+ /**
23
+ * Trigger request
24
+ */
25
+ body?: TriggerInstalmentRequest | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export type TriggerCommitmentInstalmentRequest$Outbound = {
30
+ id: string;
31
+ instalment_id: string;
32
+ body?: TriggerInstalmentRequest$Outbound | undefined;
33
+ };
34
+
35
+ /** @internal */
36
+ export const TriggerCommitmentInstalmentRequest$outboundSchema: z.ZodMiniType<
37
+ TriggerCommitmentInstalmentRequest$Outbound,
38
+ TriggerCommitmentInstalmentRequest
39
+ > = z.pipe(
40
+ z.object({
41
+ id: z.string(),
42
+ instalmentId: z.string(),
43
+ body: z.optional(TriggerInstalmentRequest$outboundSchema),
44
+ }),
45
+ z.transform((v) => {
46
+ return remap$(v, {
47
+ instalmentId: "instalment_id",
48
+ });
49
+ }),
50
+ );
51
+
52
+ export function triggerCommitmentInstalmentRequestToJSON(
53
+ triggerCommitmentInstalmentRequest: TriggerCommitmentInstalmentRequest,
54
+ ): string {
55
+ return JSON.stringify(
56
+ TriggerCommitmentInstalmentRequest$outboundSchema.parse(
57
+ triggerCommitmentInstalmentRequest,
58
+ ),
59
+ );
60
+ }
@@ -0,0 +1,41 @@
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
+
8
+ export type TriggerInstalmentRequest = {
9
+ /**
10
+ * BillOn within a second after a billing period edge is taken as that edge.
11
+ */
12
+ billOn?: string | undefined;
13
+ };
14
+
15
+ /** @internal */
16
+ export type TriggerInstalmentRequest$Outbound = {
17
+ bill_on?: string | undefined;
18
+ };
19
+
20
+ /** @internal */
21
+ export const TriggerInstalmentRequest$outboundSchema: z.ZodMiniType<
22
+ TriggerInstalmentRequest$Outbound,
23
+ TriggerInstalmentRequest
24
+ > = z.pipe(
25
+ z.object({
26
+ billOn: z.optional(z.string()),
27
+ }),
28
+ z.transform((v) => {
29
+ return remap$(v, {
30
+ billOn: "bill_on",
31
+ });
32
+ }),
33
+ );
34
+
35
+ export function triggerInstalmentRequestToJSON(
36
+ triggerInstalmentRequest: TriggerInstalmentRequest,
37
+ ): string {
38
+ return JSON.stringify(
39
+ TriggerInstalmentRequest$outboundSchema.parse(triggerInstalmentRequest),
40
+ );
41
+ }
@@ -6,6 +6,10 @@ import * as z from "zod/v4-mini";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
 
8
8
  export type UpdateCommitmentRequest = {
9
+ /**
10
+ * EndDate can't be changed yet; terminate the commitment to end it.
11
+ */
12
+ endDate?: Date | undefined;
9
13
  invoiceDescription?: string | undefined;
10
14
  invoiceLabel?: string | undefined;
11
15
  metadata?: { [k: string]: string } | undefined;
@@ -14,6 +18,7 @@ export type UpdateCommitmentRequest = {
14
18
 
15
19
  /** @internal */
16
20
  export type UpdateCommitmentRequest$Outbound = {
21
+ end_date?: string | undefined;
17
22
  invoice_description?: string | undefined;
18
23
  invoice_label?: string | undefined;
19
24
  metadata?: { [k: string]: string } | undefined;
@@ -26,6 +31,7 @@ export const UpdateCommitmentRequest$outboundSchema: z.ZodMiniType<
26
31
  UpdateCommitmentRequest
27
32
  > = z.pipe(
28
33
  z.object({
34
+ endDate: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
29
35
  invoiceDescription: z.optional(z.string()),
30
36
  invoiceLabel: z.optional(z.string()),
31
37
  metadata: z.optional(z.record(z.string(), z.string())),
@@ -33,6 +39,7 @@ export const UpdateCommitmentRequest$outboundSchema: z.ZodMiniType<
33
39
  }),
34
40
  z.transform((v) => {
35
41
  return remap$(v, {
42
+ endDate: "end_date",
36
43
  invoiceDescription: "invoice_description",
37
44
  invoiceLabel: "invoice_label",
38
45
  });
@@ -4,6 +4,10 @@
4
4
 
5
5
  import * as z from "zod/v4-mini";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
+ import {
8
+ ProrationBehavior,
9
+ ProrationBehavior$outboundSchema,
10
+ } from "./proration-behavior.js";
7
11
  import {
8
12
  SubscriptionStatus,
9
13
  SubscriptionStatus$outboundSchema,
@@ -19,6 +23,7 @@ export type UpdateSubscriptionRequest = {
19
23
  * ParentSubscriptionID sets or clears the parent subscription. Omit to leave unchanged; send "" to clear.
20
24
  */
21
25
  parentSubscriptionId?: string | undefined;
26
+ prorationBehavior?: ProrationBehavior | undefined;
22
27
  status?: SubscriptionStatus | undefined;
23
28
  };
24
29
 
@@ -27,6 +32,7 @@ export type UpdateSubscriptionRequest$Outbound = {
27
32
  cancel_at?: string | undefined;
28
33
  cancel_at_period_end?: boolean | undefined;
29
34
  parent_subscription_id?: string | undefined;
35
+ proration_behavior?: string | undefined;
30
36
  status?: string | undefined;
31
37
  };
32
38
 
@@ -39,6 +45,7 @@ export const UpdateSubscriptionRequest$outboundSchema: z.ZodMiniType<
39
45
  cancelAt: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
40
46
  cancelAtPeriodEnd: z.optional(z.boolean()),
41
47
  parentSubscriptionId: z.optional(z.string()),
48
+ prorationBehavior: z.optional(ProrationBehavior$outboundSchema),
42
49
  status: z.optional(SubscriptionStatus$outboundSchema),
43
50
  }),
44
51
  z.transform((v) => {
@@ -46,6 +53,7 @@ export const UpdateSubscriptionRequest$outboundSchema: z.ZodMiniType<
46
53
  cancelAt: "cancel_at",
47
54
  cancelAtPeriodEnd: "cancel_at_period_end",
48
55
  parentSubscriptionId: "parent_subscription_id",
56
+ prorationBehavior: "proration_behavior",
49
57
  });
50
58
  }),
51
59
  );
@@ -0,0 +1,53 @@
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 * as types from "../../types/primitives.js";
10
+ import {
11
+ BillingtermInstalment,
12
+ BillingtermInstalment$inboundSchema,
13
+ } from "./billingterm-instalment.js";
14
+ import { SDKValidationError } from "./sdk-validation-error.js";
15
+ import {
16
+ WebhookEventName,
17
+ WebhookEventName$inboundSchema,
18
+ } from "./webhook-event-name.js";
19
+
20
+ export type WebhookDtoBillingInstalmentWebhookPayload = {
21
+ eventType?: WebhookEventName | undefined;
22
+ instalment?: BillingtermInstalment | undefined;
23
+ };
24
+
25
+ /** @internal */
26
+ export const WebhookDtoBillingInstalmentWebhookPayload$inboundSchema:
27
+ z.ZodMiniType<WebhookDtoBillingInstalmentWebhookPayload, unknown> = z.pipe(
28
+ z.object({
29
+ event_type: types.optional(WebhookEventName$inboundSchema),
30
+ instalment: types.optional(BillingtermInstalment$inboundSchema),
31
+ }),
32
+ z.transform((v) => {
33
+ return remap$(v, {
34
+ "event_type": "eventType",
35
+ });
36
+ }),
37
+ );
38
+
39
+ export function webhookDtoBillingInstalmentWebhookPayloadFromJSON(
40
+ jsonString: string,
41
+ ): SafeParseResult<
42
+ WebhookDtoBillingInstalmentWebhookPayload,
43
+ SDKValidationError
44
+ > {
45
+ return safeParse(
46
+ jsonString,
47
+ (x) =>
48
+ WebhookDtoBillingInstalmentWebhookPayload$inboundSchema.parse(
49
+ JSON.parse(x),
50
+ ),
51
+ `Failed to parse 'WebhookDtoBillingInstalmentWebhookPayload' from JSON`,
52
+ );
53
+ }
@@ -0,0 +1,61 @@
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 * as types from "../../types/primitives.js";
10
+ import {
11
+ BillingTermOwnerType,
12
+ BillingTermOwnerType$inboundSchema,
13
+ } from "./billing-term-owner-type.js";
14
+ import {
15
+ BillingtermTerm,
16
+ BillingtermTerm$inboundSchema,
17
+ } from "./billingterm-term.js";
18
+ import { SDKValidationError } from "./sdk-validation-error.js";
19
+ import {
20
+ WebhookEventName,
21
+ WebhookEventName$inboundSchema,
22
+ } from "./webhook-event-name.js";
23
+
24
+ export type WebhookDtoBillingTermsWebhookPayload = {
25
+ billingTerms?: Array<BillingtermTerm> | undefined;
26
+ eventType?: WebhookEventName | undefined;
27
+ ownerId?: string | undefined;
28
+ ownerType?: BillingTermOwnerType | undefined;
29
+ };
30
+
31
+ /** @internal */
32
+ export const WebhookDtoBillingTermsWebhookPayload$inboundSchema: z.ZodMiniType<
33
+ WebhookDtoBillingTermsWebhookPayload,
34
+ unknown
35
+ > = z.pipe(
36
+ z.object({
37
+ billing_terms: types.optional(z.array(BillingtermTerm$inboundSchema)),
38
+ event_type: types.optional(WebhookEventName$inboundSchema),
39
+ owner_id: types.optional(types.string()),
40
+ owner_type: types.optional(BillingTermOwnerType$inboundSchema),
41
+ }),
42
+ z.transform((v) => {
43
+ return remap$(v, {
44
+ "billing_terms": "billingTerms",
45
+ "event_type": "eventType",
46
+ "owner_id": "ownerId",
47
+ "owner_type": "ownerType",
48
+ });
49
+ }),
50
+ );
51
+
52
+ export function webhookDtoBillingTermsWebhookPayloadFromJSON(
53
+ jsonString: string,
54
+ ): SafeParseResult<WebhookDtoBillingTermsWebhookPayload, SDKValidationError> {
55
+ return safeParse(
56
+ jsonString,
57
+ (x) =>
58
+ WebhookDtoBillingTermsWebhookPayload$inboundSchema.parse(JSON.parse(x)),
59
+ `Failed to parse 'WebhookDtoBillingTermsWebhookPayload' from JSON`,
60
+ );
61
+ }
@@ -17,6 +17,7 @@ import { SDKValidationError } from "./sdk-validation-error.js";
17
17
  export type WebhookDtoInvoiceLineItem = {
18
18
  adjustedEntitlementQuantity?: string | undefined;
19
19
  amount?: string | undefined;
20
+ billingInstalmentId?: string | undefined;
20
21
  commitmentInfo?: CommitmentInfo | undefined;
21
22
  currency?: string | undefined;
22
23
  displayName?: string | undefined;
@@ -49,6 +50,7 @@ export const WebhookDtoInvoiceLineItem$inboundSchema: z.ZodMiniType<
49
50
  z.object({
50
51
  adjusted_entitlement_quantity: types.optional(types.string()),
51
52
  amount: types.optional(types.string()),
53
+ billing_instalment_id: types.optional(types.string()),
52
54
  commitment_info: types.optional(CommitmentInfo$inboundSchema),
53
55
  currency: types.optional(types.string()),
54
56
  display_name: types.optional(types.string()),
@@ -75,6 +77,7 @@ export const WebhookDtoInvoiceLineItem$inboundSchema: z.ZodMiniType<
75
77
  z.transform((v) => {
76
78
  return remap$(v, {
77
79
  "adjusted_entitlement_quantity": "adjustedEntitlementQuantity",
80
+ "billing_instalment_id": "billingInstalmentId",
78
81
  "commitment_info": "commitmentInfo",
79
82
  "display_name": "displayName",
80
83
  "entity_id": "entityId",
@@ -0,0 +1,61 @@
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 * as types from "../../types/primitives.js";
10
+ import { SDKValidationError } from "./sdk-validation-error.js";
11
+ import {
12
+ WebhookDtoCheckoutSession,
13
+ WebhookDtoCheckoutSession$inboundSchema,
14
+ } from "./webhook-dto-checkout-session.js";
15
+ import {
16
+ WebhookDtoPaymentAttempt,
17
+ WebhookDtoPaymentAttempt$inboundSchema,
18
+ } from "./webhook-dto-payment-attempt.js";
19
+ import {
20
+ WebhookDtoPayment,
21
+ WebhookDtoPayment$inboundSchema,
22
+ } from "./webhook-dto-payment.js";
23
+ import {
24
+ WebhookEventName,
25
+ WebhookEventName$inboundSchema,
26
+ } from "./webhook-event-name.js";
27
+
28
+ export type WebhookDtoPaymentAttemptWebhookPayload = {
29
+ attempt?: WebhookDtoPaymentAttempt | undefined;
30
+ checkoutSession?: WebhookDtoCheckoutSession | undefined;
31
+ eventType?: WebhookEventName | undefined;
32
+ payment?: WebhookDtoPayment | undefined;
33
+ };
34
+
35
+ /** @internal */
36
+ export const WebhookDtoPaymentAttemptWebhookPayload$inboundSchema:
37
+ z.ZodMiniType<WebhookDtoPaymentAttemptWebhookPayload, unknown> = z.pipe(
38
+ z.object({
39
+ attempt: types.optional(WebhookDtoPaymentAttempt$inboundSchema),
40
+ checkout_session: types.optional(WebhookDtoCheckoutSession$inboundSchema),
41
+ event_type: types.optional(WebhookEventName$inboundSchema),
42
+ payment: types.optional(WebhookDtoPayment$inboundSchema),
43
+ }),
44
+ z.transform((v) => {
45
+ return remap$(v, {
46
+ "checkout_session": "checkoutSession",
47
+ "event_type": "eventType",
48
+ });
49
+ }),
50
+ );
51
+
52
+ export function webhookDtoPaymentAttemptWebhookPayloadFromJSON(
53
+ jsonString: string,
54
+ ): SafeParseResult<WebhookDtoPaymentAttemptWebhookPayload, SDKValidationError> {
55
+ return safeParse(
56
+ jsonString,
57
+ (x) =>
58
+ WebhookDtoPaymentAttemptWebhookPayload$inboundSchema.parse(JSON.parse(x)),
59
+ `Failed to parse 'WebhookDtoPaymentAttemptWebhookPayload' from JSON`,
60
+ );
61
+ }
@@ -0,0 +1,52 @@
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 * as types from "../../types/primitives.js";
10
+ import { SDKValidationError } from "./sdk-validation-error.js";
11
+
12
+ export type WebhookDtoPaymentAttempt = {
13
+ attemptNumber?: number | undefined;
14
+ createdAt?: Date | undefined;
15
+ errorMessage?: string | undefined;
16
+ gatewayAttemptId?: string | undefined;
17
+ id?: string | undefined;
18
+ metadata?: { [k: string]: string } | undefined;
19
+ };
20
+
21
+ /** @internal */
22
+ export const WebhookDtoPaymentAttempt$inboundSchema: z.ZodMiniType<
23
+ WebhookDtoPaymentAttempt,
24
+ unknown
25
+ > = z.pipe(
26
+ z.object({
27
+ attempt_number: types.optional(types.number()),
28
+ created_at: types.optional(types.date()),
29
+ error_message: types.optional(types.string()),
30
+ gateway_attempt_id: types.optional(types.string()),
31
+ id: types.optional(types.string()),
32
+ metadata: types.optional(z.record(z.string(), types.string())),
33
+ }),
34
+ z.transform((v) => {
35
+ return remap$(v, {
36
+ "attempt_number": "attemptNumber",
37
+ "created_at": "createdAt",
38
+ "error_message": "errorMessage",
39
+ "gateway_attempt_id": "gatewayAttemptId",
40
+ });
41
+ }),
42
+ );
43
+
44
+ export function webhookDtoPaymentAttemptFromJSON(
45
+ jsonString: string,
46
+ ): SafeParseResult<WebhookDtoPaymentAttempt, SDKValidationError> {
47
+ return safeParse(
48
+ jsonString,
49
+ (x) => WebhookDtoPaymentAttempt$inboundSchema.parse(JSON.parse(x)),
50
+ `Failed to parse 'WebhookDtoPaymentAttempt' from JSON`,
51
+ );
52
+ }
@@ -28,6 +28,12 @@ export const WebhookEventName = {
28
28
  CommitmentCreated: "commitment.created",
29
29
  CommitmentUpdated: "commitment.updated",
30
30
  CommitmentTerminated: "commitment.terminated",
31
+ BillingTermsCreated: "billing_terms.created",
32
+ BillingTermsUpdated: "billing_terms.updated",
33
+ BillingInstalmentCreated: "billing_instalment.created",
34
+ BillingInstalmentUpdated: "billing_instalment.updated",
35
+ BillingInstalmentCancelled: "billing_instalment.cancelled",
36
+ BillingInstalmentInvoiced: "billing_instalment.invoiced",
31
37
  WalletCreated: "wallet.created",
32
38
  WalletUpdated: "wallet.updated",
33
39
  WalletTerminated: "wallet.terminated",
@@ -36,6 +42,7 @@ export const WebhookEventName = {
36
42
  PaymentCreated: "payment.created",
37
43
  PaymentUpdated: "payment.updated",
38
44
  PaymentFailed: "payment.failed",
45
+ PaymentAttemptFailed: "payment.attempt.failed",
39
46
  PaymentSuccess: "payment.success",
40
47
  PaymentPending: "payment.pending",
41
48
  RefundCreated: "refund.created",
package/src/sdk/prices.ts CHANGED
@@ -6,6 +6,7 @@ import { pricesCreatePrice } from "../funcs/prices-create-price.js";
6
6
  import { pricesCreatePricesBulk } from "../funcs/prices-create-prices-bulk.js";
7
7
  import { pricesDeletePrice } from "../funcs/prices-delete-price.js";
8
8
  import { pricesGetPriceByLookupKey } from "../funcs/prices-get-price-by-lookup-key.js";
9
+ import { pricesGetPriceHistory } from "../funcs/prices-get-price-history.js";
9
10
  import { pricesGetPrice } from "../funcs/prices-get-price.js";
10
11
  import { pricesQueryPrice } from "../funcs/prices-query-price.js";
11
12
  import { pricesUpdatePrice } from "../funcs/prices-update-price.js";
@@ -136,4 +137,21 @@ export class Prices extends ClientSDK {
136
137
  options,
137
138
  ));
138
139
  }
140
+
141
+ /**
142
+ * Get price history
143
+ *
144
+ * @remarks
145
+ * Use when you need every version of a plan price, oldest first. Pass the ID of any version; the same timeline is returned.
146
+ */
147
+ async getPriceHistory(
148
+ id: string,
149
+ options?: RequestOptions,
150
+ ): Promise<models.ListPricesResponse> {
151
+ return unwrapAsync(pricesGetPriceHistory(
152
+ this,
153
+ id,
154
+ options,
155
+ ));
156
+ }
139
157
  }