orb-billing 1.13.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (624) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +55 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +21 -0
  5. data/lib/orb/internal/transport/base_client.rb +5 -0
  6. data/lib/orb/internal/type/union.rb +13 -27
  7. data/lib/orb/internal/util.rb +22 -7
  8. data/lib/orb/models/accounting_provider_config.rb +14 -3
  9. data/lib/orb/models/adjustment_interval.rb +185 -3
  10. data/lib/orb/models/alert.rb +114 -1
  11. data/lib/orb/models/alert_create_for_customer_params.rb +8 -1
  12. data/lib/orb/models/alert_create_for_external_customer_params.rb +8 -1
  13. data/lib/orb/models/alert_create_for_subscription_params.rb +142 -1
  14. data/lib/orb/models/alert_disable_params.rb +8 -1
  15. data/lib/orb/models/alert_enable_params.rb +8 -1
  16. data/lib/orb/models/alert_retrieve_params.rb +7 -1
  17. data/lib/orb/models/alert_update_params.rb +120 -1
  18. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +3296 -631
  19. data/lib/orb/models/beta/external_plan_id_fetch_plan_version_params.rb +7 -1
  20. data/lib/orb/models/beta/external_plan_id_set_default_plan_version_params.rb +8 -1
  21. data/lib/orb/models/beta_create_plan_version_params.rb +3263 -622
  22. data/lib/orb/models/beta_fetch_plan_version_params.rb +7 -1
  23. data/lib/orb/models/beta_set_default_plan_version_params.rb +8 -1
  24. data/lib/orb/models/changed_subscription_resources.rb +200 -10
  25. data/lib/orb/models/conversion_rate_config.rb +18 -0
  26. data/lib/orb/models/coupon_archive_params.rb +7 -1
  27. data/lib/orb/models/coupon_fetch_params.rb +7 -1
  28. data/lib/orb/models/coupons/subscription_list_params.rb +8 -1
  29. data/lib/orb/models/credit_block_delete_params.rb +7 -1
  30. data/lib/orb/models/credit_block_list_invoices_params.rb +7 -1
  31. data/lib/orb/models/credit_block_list_invoices_response.rb +155 -1
  32. data/lib/orb/models/credit_block_retrieve_params.rb +7 -1
  33. data/lib/orb/models/credit_block_retrieve_response.rb +150 -1
  34. data/lib/orb/models/credit_note_fetch_params.rb +7 -1
  35. data/lib/orb/models/customer.rb +122 -3
  36. data/lib/orb/models/customer_create_params.rb +17 -1
  37. data/lib/orb/models/customer_delete_params.rb +7 -1
  38. data/lib/orb/models/customer_fetch_by_external_id_params.rb +7 -1
  39. data/lib/orb/models/customer_fetch_params.rb +7 -1
  40. data/lib/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rb +7 -1
  41. data/lib/orb/models/customer_sync_payment_methods_from_gateway_params.rb +7 -1
  42. data/lib/orb/models/customer_tax_id.rb +15 -1
  43. data/lib/orb/models/customer_update_by_external_id_params.rb +39 -5
  44. data/lib/orb/models/customer_update_params.rb +39 -5
  45. data/lib/orb/models/customers/balance_transaction_create_params.rb +8 -1
  46. data/lib/orb/models/customers/balance_transaction_list_params.rb +8 -1
  47. data/lib/orb/models/customers/cost_list_by_external_id_params.rb +8 -1
  48. data/lib/orb/models/customers/cost_list_params.rb +8 -1
  49. data/lib/orb/models/customers/credit_list_by_external_id_params.rb +8 -1
  50. data/lib/orb/models/customers/credit_list_by_external_id_response.rb +155 -1
  51. data/lib/orb/models/customers/credit_list_params.rb +8 -1
  52. data/lib/orb/models/customers/credit_list_response.rb +152 -1
  53. data/lib/orb/models/customers/credits/decrement_ledger_entry.rb +5 -1
  54. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +582 -315
  55. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +580 -313
  56. data/lib/orb/models/customers/credits/ledger_list_by_external_id_params.rb +8 -1
  57. data/lib/orb/models/customers/credits/ledger_list_params.rb +8 -1
  58. data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +8 -1
  59. data/lib/orb/models/customers/credits/top_up_create_params.rb +8 -1
  60. data/lib/orb/models/customers/credits/top_up_delete_by_external_id_params.rb +7 -1
  61. data/lib/orb/models/customers/credits/top_up_delete_params.rb +7 -1
  62. data/lib/orb/models/customers/credits/top_up_list_by_external_id_params.rb +8 -1
  63. data/lib/orb/models/customers/credits/top_up_list_params.rb +8 -1
  64. data/lib/orb/models/dimensional_price_group.rb +1 -1
  65. data/lib/orb/models/dimensional_price_group_retrieve_params.rb +7 -1
  66. data/lib/orb/models/dimensional_price_group_update_params.rb +8 -1
  67. data/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rb +7 -1
  68. data/lib/orb/models/dimensional_price_groups/external_dimensional_price_group_id_update_params.rb +8 -1
  69. data/lib/orb/models/discount.rb +145 -1
  70. data/lib/orb/models/event_deprecate_params.rb +7 -1
  71. data/lib/orb/models/event_ingest_params.rb +5 -2
  72. data/lib/orb/models/event_update_params.rb +8 -1
  73. data/lib/orb/models/events/backfill_close_params.rb +7 -1
  74. data/lib/orb/models/events/backfill_fetch_params.rb +7 -1
  75. data/lib/orb/models/events/backfill_revert_params.rb +7 -1
  76. data/lib/orb/models/invoice.rb +198 -10
  77. data/lib/orb/models/invoice_create_params.rb +6 -5
  78. data/lib/orb/models/invoice_delete_line_item_params.rb +7 -1
  79. data/lib/orb/models/invoice_fetch_params.rb +7 -1
  80. data/lib/orb/models/invoice_fetch_upcoming_response.rb +200 -10
  81. data/lib/orb/models/invoice_issue_params.rb +8 -1
  82. data/lib/orb/models/invoice_issue_summary_params.rb +8 -1
  83. data/lib/orb/models/invoice_issue_summary_response.rb +9 -3
  84. data/lib/orb/models/invoice_level_discount.rb +145 -1
  85. data/lib/orb/models/invoice_line_item_create_response.rb +189 -5
  86. data/lib/orb/models/invoice_list_summary_response.rb +9 -3
  87. data/lib/orb/models/invoice_mark_paid_params.rb +8 -1
  88. data/lib/orb/models/invoice_pay_params.rb +16 -1
  89. data/lib/orb/models/invoice_update_params.rb +8 -1
  90. data/lib/orb/models/invoice_void_params.rb +7 -1
  91. data/lib/orb/models/item_archive_params.rb +7 -1
  92. data/lib/orb/models/item_fetch_params.rb +7 -1
  93. data/lib/orb/models/item_update_params.rb +8 -1
  94. data/lib/orb/models/license_deactivate_params.rb +8 -1
  95. data/lib/orb/models/license_retrieve_by_external_id_params.rb +8 -1
  96. data/lib/orb/models/license_retrieve_params.rb +7 -1
  97. data/lib/orb/models/license_type_retrieve_params.rb +7 -1
  98. data/lib/orb/models/licenses/external_license_get_usage_params.rb +11 -4
  99. data/lib/orb/models/licenses/usage_get_all_usage_params.rb +3 -3
  100. data/lib/orb/models/licenses/usage_get_usage_params.rb +11 -4
  101. data/lib/orb/models/metric_fetch_params.rb +7 -1
  102. data/lib/orb/models/metric_update_params.rb +8 -1
  103. data/lib/orb/models/mutated_subscription.rb +169 -4
  104. data/lib/orb/models/new_allocation_price.rb +11 -1
  105. data/lib/orb/models/new_floating_bulk_price.rb +1 -3
  106. data/lib/orb/models/new_floating_bulk_with_proration_price.rb +1 -3
  107. data/lib/orb/models/new_floating_cumulative_grouped_bulk_price.rb +1 -3
  108. data/lib/orb/models/new_floating_grouped_allocation_price.rb +1 -3
  109. data/lib/orb/models/new_floating_grouped_tiered_package_price.rb +1 -3
  110. data/lib/orb/models/new_floating_grouped_tiered_price.rb +1 -3
  111. data/lib/orb/models/new_floating_grouped_with_metered_minimum_price.rb +1 -3
  112. data/lib/orb/models/new_floating_grouped_with_prorated_minimum_price.rb +1 -3
  113. data/lib/orb/models/new_floating_matrix_price.rb +1 -3
  114. data/lib/orb/models/new_floating_matrix_with_allocation_price.rb +1 -3
  115. data/lib/orb/models/new_floating_matrix_with_display_name_price.rb +1 -3
  116. data/lib/orb/models/new_floating_max_group_tiered_package_price.rb +1 -3
  117. data/lib/orb/models/new_floating_minimum_composite_price.rb +1 -3
  118. data/lib/orb/models/new_floating_package_price.rb +1 -3
  119. data/lib/orb/models/new_floating_package_with_allocation_price.rb +1 -3
  120. data/lib/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rb +1 -3
  121. data/lib/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rb +1 -3
  122. data/lib/orb/models/new_floating_threshold_total_amount_price.rb +1 -3
  123. data/lib/orb/models/new_floating_tiered_package_price.rb +1 -3
  124. data/lib/orb/models/new_floating_tiered_package_with_minimum_price.rb +1 -3
  125. data/lib/orb/models/new_floating_tiered_price.rb +1 -3
  126. data/lib/orb/models/new_floating_tiered_with_minimum_price.rb +1 -3
  127. data/lib/orb/models/new_floating_tiered_with_proration_price.rb +1 -3
  128. data/lib/orb/models/new_floating_unit_price.rb +1 -3
  129. data/lib/orb/models/new_floating_unit_with_percent_price.rb +1 -3
  130. data/lib/orb/models/new_floating_unit_with_proration_price.rb +1 -3
  131. data/lib/orb/models/new_plan_bulk_price.rb +1 -1
  132. data/lib/orb/models/new_plan_bulk_with_proration_price.rb +1 -3
  133. data/lib/orb/models/new_plan_cumulative_grouped_bulk_price.rb +1 -3
  134. data/lib/orb/models/new_plan_grouped_allocation_price.rb +1 -3
  135. data/lib/orb/models/new_plan_grouped_tiered_package_price.rb +1 -3
  136. data/lib/orb/models/new_plan_grouped_tiered_price.rb +1 -3
  137. data/lib/orb/models/new_plan_grouped_with_metered_minimum_price.rb +1 -3
  138. data/lib/orb/models/new_plan_grouped_with_prorated_minimum_price.rb +1 -3
  139. data/lib/orb/models/new_plan_matrix_price.rb +1 -5
  140. data/lib/orb/models/new_plan_matrix_with_allocation_price.rb +1 -3
  141. data/lib/orb/models/new_plan_matrix_with_display_name_price.rb +1 -3
  142. data/lib/orb/models/new_plan_max_group_tiered_package_price.rb +1 -3
  143. data/lib/orb/models/new_plan_minimum_composite_price.rb +1 -3
  144. data/lib/orb/models/new_plan_package_price.rb +1 -5
  145. data/lib/orb/models/new_plan_package_with_allocation_price.rb +1 -3
  146. data/lib/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rb +1 -3
  147. data/lib/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rb +1 -3
  148. data/lib/orb/models/new_plan_threshold_total_amount_price.rb +1 -3
  149. data/lib/orb/models/new_plan_tiered_package_price.rb +1 -3
  150. data/lib/orb/models/new_plan_tiered_package_with_minimum_price.rb +1 -3
  151. data/lib/orb/models/new_plan_tiered_price.rb +1 -5
  152. data/lib/orb/models/new_plan_tiered_with_minimum_price.rb +1 -3
  153. data/lib/orb/models/new_plan_unit_price.rb +1 -1
  154. data/lib/orb/models/new_plan_unit_with_percent_price.rb +1 -3
  155. data/lib/orb/models/new_plan_unit_with_proration_price.rb +1 -3
  156. data/lib/orb/models/new_subscription_bulk_price.rb +1 -3
  157. data/lib/orb/models/new_subscription_bulk_with_proration_price.rb +1 -3
  158. data/lib/orb/models/new_subscription_cumulative_grouped_bulk_price.rb +1 -3
  159. data/lib/orb/models/new_subscription_grouped_allocation_price.rb +1 -3
  160. data/lib/orb/models/new_subscription_grouped_tiered_package_price.rb +1 -3
  161. data/lib/orb/models/new_subscription_grouped_tiered_price.rb +1 -3
  162. data/lib/orb/models/new_subscription_grouped_with_metered_minimum_price.rb +1 -3
  163. data/lib/orb/models/new_subscription_grouped_with_prorated_minimum_price.rb +1 -3
  164. data/lib/orb/models/new_subscription_matrix_price.rb +1 -3
  165. data/lib/orb/models/new_subscription_matrix_with_allocation_price.rb +1 -3
  166. data/lib/orb/models/new_subscription_matrix_with_display_name_price.rb +1 -3
  167. data/lib/orb/models/new_subscription_max_group_tiered_package_price.rb +1 -3
  168. data/lib/orb/models/new_subscription_minimum_composite_price.rb +1 -3
  169. data/lib/orb/models/new_subscription_package_price.rb +1 -3
  170. data/lib/orb/models/new_subscription_package_with_allocation_price.rb +1 -3
  171. data/lib/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rb +1 -3
  172. data/lib/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb +1 -3
  173. data/lib/orb/models/new_subscription_threshold_total_amount_price.rb +1 -3
  174. data/lib/orb/models/new_subscription_tiered_package_price.rb +1 -3
  175. data/lib/orb/models/new_subscription_tiered_package_with_minimum_price.rb +1 -3
  176. data/lib/orb/models/new_subscription_tiered_price.rb +1 -3
  177. data/lib/orb/models/new_subscription_tiered_with_minimum_price.rb +1 -3
  178. data/lib/orb/models/new_subscription_unit_price.rb +1 -3
  179. data/lib/orb/models/new_subscription_unit_with_percent_price.rb +1 -3
  180. data/lib/orb/models/new_subscription_unit_with_proration_price.rb +1 -3
  181. data/lib/orb/models/per_price_cost.rb +2 -2
  182. data/lib/orb/models/plan.rb +189 -9
  183. data/lib/orb/models/plan_create_params.rb +1478 -158
  184. data/lib/orb/models/plan_fetch_params.rb +7 -1
  185. data/lib/orb/models/plan_update_params.rb +16 -1
  186. data/lib/orb/models/plan_version.rb +186 -5
  187. data/lib/orb/models/plans/external_plan_id_fetch_params.rb +7 -1
  188. data/lib/orb/models/plans/external_plan_id_update_params.rb +16 -1
  189. data/lib/orb/models/plans/migration_cancel_params.rb +7 -1
  190. data/lib/orb/models/plans/migration_cancel_response.rb +22 -4
  191. data/lib/orb/models/plans/migration_list_params.rb +8 -1
  192. data/lib/orb/models/plans/migration_list_response.rb +22 -4
  193. data/lib/orb/models/plans/migration_retrieve_params.rb +7 -1
  194. data/lib/orb/models/plans/migration_retrieve_response.rb +22 -4
  195. data/lib/orb/models/price.rb +2807 -1244
  196. data/lib/orb/models/price_create_params.rb +1800 -1355
  197. data/lib/orb/models/price_evaluate_multiple_params.rb +889 -54
  198. data/lib/orb/models/price_evaluate_params.rb +8 -1
  199. data/lib/orb/models/price_evaluate_preview_events_params.rb +881 -46
  200. data/lib/orb/models/price_fetch_params.rb +7 -1
  201. data/lib/orb/models/price_interval.rb +2 -2
  202. data/lib/orb/models/price_update_params.rb +8 -1
  203. data/lib/orb/models/prices/external_price_id_fetch_params.rb +7 -1
  204. data/lib/orb/models/prices/external_price_id_update_params.rb +8 -1
  205. data/lib/orb/models/subscription.rb +168 -4
  206. data/lib/orb/models/subscription_cancel_params.rb +8 -1
  207. data/lib/orb/models/subscription_change_apply_params.rb +8 -1
  208. data/lib/orb/models/subscription_change_cancel_params.rb +7 -1
  209. data/lib/orb/models/subscription_change_retrieve_params.rb +7 -1
  210. data/lib/orb/models/subscription_create_params.rb +2818 -674
  211. data/lib/orb/models/subscription_fetch_costs_params.rb +8 -1
  212. data/lib/orb/models/subscription_fetch_params.rb +7 -1
  213. data/lib/orb/models/subscription_fetch_schedule_params.rb +8 -1
  214. data/lib/orb/models/subscription_fetch_usage_params.rb +8 -1
  215. data/lib/orb/models/subscription_price_intervals_params.rb +1103 -55
  216. data/lib/orb/models/subscription_redeem_coupon_params.rb +8 -1
  217. data/lib/orb/models/subscription_schedule_plan_change_params.rb +2839 -685
  218. data/lib/orb/models/subscription_trigger_phase_params.rb +8 -1
  219. data/lib/orb/models/subscription_unschedule_cancellation_params.rb +7 -1
  220. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rb +8 -1
  221. data/lib/orb/models/subscription_unschedule_pending_plan_changes_params.rb +7 -1
  222. data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +8 -1
  223. data/lib/orb/models/subscription_update_params.rb +19 -1
  224. data/lib/orb/models/subscription_update_trial_params.rb +8 -1
  225. data/lib/orb/models.rb +2 -0
  226. data/lib/orb/resources/alerts.rb +20 -2
  227. data/lib/orb/resources/coupons.rb +1 -2
  228. data/lib/orb/resources/credit_blocks.rb +11 -8
  229. data/lib/orb/resources/customers/credits/ledger.rb +40 -81
  230. data/lib/orb/resources/customers.rb +12 -7
  231. data/lib/orb/resources/events/backfills.rb +3 -4
  232. data/lib/orb/resources/events.rb +7 -34
  233. data/lib/orb/resources/invoices.rb +18 -7
  234. data/lib/orb/resources/licenses/external_licenses.rb +1 -1
  235. data/lib/orb/resources/licenses/usage.rb +2 -2
  236. data/lib/orb/resources/metrics.rb +5 -5
  237. data/lib/orb/resources/plans/external_plan_id.rb +5 -3
  238. data/lib/orb/resources/plans.rb +9 -5
  239. data/lib/orb/resources/prices/external_price_id.rb +2 -2
  240. data/lib/orb/resources/prices.rb +13 -104
  241. data/lib/orb/resources/subscriptions.rb +24 -7
  242. data/lib/orb/version.rb +1 -1
  243. data/lib/orb.rb +1 -0
  244. data/rbi/orb/client.rbi +6 -0
  245. data/rbi/orb/internal/util.rbi +8 -0
  246. data/rbi/orb/models/accounting_provider_config.rbi +38 -5
  247. data/rbi/orb/models/adjustment_interval.rbi +336 -0
  248. data/rbi/orb/models/alert.rbi +182 -3
  249. data/rbi/orb/models/alert_create_for_customer_params.rbi +6 -0
  250. data/rbi/orb/models/alert_create_for_external_customer_params.rbi +6 -0
  251. data/rbi/orb/models/alert_create_for_subscription_params.rbi +285 -0
  252. data/rbi/orb/models/alert_disable_params.rbi +6 -0
  253. data/rbi/orb/models/alert_enable_params.rbi +6 -0
  254. data/rbi/orb/models/alert_retrieve_params.rbi +13 -5
  255. data/rbi/orb/models/alert_update_params.rbi +214 -0
  256. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +5873 -1161
  257. data/rbi/orb/models/beta/external_plan_id_fetch_plan_version_params.rbi +10 -2
  258. data/rbi/orb/models/beta/external_plan_id_set_default_plan_version_params.rbi +10 -1
  259. data/rbi/orb/models/beta_create_plan_version_params.rbi +5877 -1165
  260. data/rbi/orb/models/beta_fetch_plan_version_params.rbi +10 -2
  261. data/rbi/orb/models/beta_set_default_plan_version_params.rbi +10 -1
  262. data/rbi/orb/models/changed_subscription_resources.rbi +360 -5
  263. data/rbi/orb/models/conversion_rate_config.rbi +18 -0
  264. data/rbi/orb/models/coupon_archive_params.rbi +13 -5
  265. data/rbi/orb/models/coupon_fetch_params.rbi +13 -5
  266. data/rbi/orb/models/coupons/subscription_list_params.rbi +6 -0
  267. data/rbi/orb/models/credit_block_delete_params.rbi +13 -5
  268. data/rbi/orb/models/credit_block_list_invoices_params.rbi +13 -5
  269. data/rbi/orb/models/credit_block_list_invoices_response.rbi +346 -3
  270. data/rbi/orb/models/credit_block_retrieve_params.rbi +13 -5
  271. data/rbi/orb/models/credit_block_retrieve_response.rbi +344 -3
  272. data/rbi/orb/models/credit_note_fetch_params.rbi +13 -5
  273. data/rbi/orb/models/customer.rbi +202 -0
  274. data/rbi/orb/models/customer_create_params.rbi +27 -0
  275. data/rbi/orb/models/customer_delete_params.rbi +13 -5
  276. data/rbi/orb/models/customer_fetch_by_external_id_params.rbi +13 -5
  277. data/rbi/orb/models/customer_fetch_params.rbi +13 -5
  278. data/rbi/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbi +13 -5
  279. data/rbi/orb/models/customer_sync_payment_methods_from_gateway_params.rbi +13 -5
  280. data/rbi/orb/models/customer_tax_id.rbi +15 -1
  281. data/rbi/orb/models/customer_update_by_external_id_params.rbi +51 -4
  282. data/rbi/orb/models/customer_update_params.rbi +51 -4
  283. data/rbi/orb/models/customers/balance_transaction_create_params.rbi +6 -0
  284. data/rbi/orb/models/customers/balance_transaction_list_params.rbi +6 -0
  285. data/rbi/orb/models/customers/cost_list_by_external_id_params.rbi +6 -0
  286. data/rbi/orb/models/customers/cost_list_params.rbi +6 -0
  287. data/rbi/orb/models/customers/credit_list_by_external_id_params.rbi +6 -0
  288. data/rbi/orb/models/customers/credit_list_by_external_id_response.rbi +346 -3
  289. data/rbi/orb/models/customers/credit_list_params.rbi +6 -0
  290. data/rbi/orb/models/customers/credit_list_response.rbi +347 -3
  291. data/rbi/orb/models/customers/credits/decrement_ledger_entry.rbi +4 -0
  292. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +861 -478
  293. data/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi +861 -478
  294. data/rbi/orb/models/customers/credits/ledger_list_by_external_id_params.rbi +6 -0
  295. data/rbi/orb/models/customers/credits/ledger_list_params.rbi +6 -0
  296. data/rbi/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +6 -0
  297. data/rbi/orb/models/customers/credits/top_up_create_params.rbi +6 -0
  298. data/rbi/orb/models/customers/credits/top_up_delete_by_external_id_params.rbi +6 -1
  299. data/rbi/orb/models/customers/credits/top_up_delete_params.rbi +10 -2
  300. data/rbi/orb/models/customers/credits/top_up_list_by_external_id_params.rbi +6 -0
  301. data/rbi/orb/models/customers/credits/top_up_list_params.rbi +6 -0
  302. data/rbi/orb/models/dimensional_price_group.rbi +1 -1
  303. data/rbi/orb/models/dimensional_price_group_retrieve_params.rbi +16 -5
  304. data/rbi/orb/models/dimensional_price_group_update_params.rbi +6 -0
  305. data/rbi/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbi +16 -5
  306. data/rbi/orb/models/dimensional_price_groups/external_dimensional_price_group_id_update_params.rbi +6 -0
  307. data/rbi/orb/models/discount.rbi +269 -1
  308. data/rbi/orb/models/event_deprecate_params.rbi +13 -5
  309. data/rbi/orb/models/event_ingest_params.rbi +4 -2
  310. data/rbi/orb/models/event_update_params.rbi +6 -0
  311. data/rbi/orb/models/events/backfill_close_params.rbi +13 -5
  312. data/rbi/orb/models/events/backfill_fetch_params.rbi +13 -5
  313. data/rbi/orb/models/events/backfill_revert_params.rbi +13 -5
  314. data/rbi/orb/models/invoice.rbi +360 -5
  315. data/rbi/orb/models/invoice_create_params.rbi +12 -7
  316. data/rbi/orb/models/invoice_delete_line_item_params.rbi +10 -2
  317. data/rbi/orb/models/invoice_fetch_params.rbi +13 -5
  318. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +360 -5
  319. data/rbi/orb/models/invoice_issue_params.rbi +10 -1
  320. data/rbi/orb/models/invoice_issue_summary_params.rbi +10 -1
  321. data/rbi/orb/models/invoice_issue_summary_response.rbi +19 -4
  322. data/rbi/orb/models/invoice_level_discount.rbi +298 -1
  323. data/rbi/orb/models/invoice_line_item_create_response.rbi +339 -0
  324. data/rbi/orb/models/invoice_list_summary_response.rbi +19 -4
  325. data/rbi/orb/models/invoice_mark_paid_params.rbi +6 -0
  326. data/rbi/orb/models/invoice_pay_params.rbi +27 -5
  327. data/rbi/orb/models/invoice_update_params.rbi +6 -0
  328. data/rbi/orb/models/invoice_void_params.rbi +13 -5
  329. data/rbi/orb/models/item_archive_params.rbi +13 -5
  330. data/rbi/orb/models/item_fetch_params.rbi +13 -5
  331. data/rbi/orb/models/item_update_params.rbi +6 -0
  332. data/rbi/orb/models/license_deactivate_params.rbi +10 -1
  333. data/rbi/orb/models/license_retrieve_by_external_id_params.rbi +6 -0
  334. data/rbi/orb/models/license_retrieve_params.rbi +13 -5
  335. data/rbi/orb/models/license_type_retrieve_params.rbi +13 -5
  336. data/rbi/orb/models/licenses/external_license_get_usage_params.rbi +9 -3
  337. data/rbi/orb/models/licenses/usage_get_all_usage_params.rbi +3 -3
  338. data/rbi/orb/models/licenses/usage_get_usage_params.rbi +9 -3
  339. data/rbi/orb/models/metric_fetch_params.rbi +13 -5
  340. data/rbi/orb/models/metric_update_params.rbi +6 -0
  341. data/rbi/orb/models/mutated_subscription.rbi +324 -2
  342. data/rbi/orb/models/new_allocation_price.rbi +12 -0
  343. data/rbi/orb/models/per_price_cost.rbi +3 -0
  344. data/rbi/orb/models/plan.rbi +339 -2
  345. data/rbi/orb/models/plan_create_params.rbi +2566 -209
  346. data/rbi/orb/models/plan_fetch_params.rbi +13 -5
  347. data/rbi/orb/models/plan_update_params.rbi +14 -0
  348. data/rbi/orb/models/plan_version.rbi +339 -0
  349. data/rbi/orb/models/plans/external_plan_id_fetch_params.rbi +13 -5
  350. data/rbi/orb/models/plans/external_plan_id_update_params.rbi +14 -0
  351. data/rbi/orb/models/plans/migration_cancel_params.rbi +10 -2
  352. data/rbi/orb/models/plans/migration_cancel_response.rbi +22 -1
  353. data/rbi/orb/models/plans/migration_list_params.rbi +6 -0
  354. data/rbi/orb/models/plans/migration_list_response.rbi +22 -1
  355. data/rbi/orb/models/plans/migration_retrieve_params.rbi +10 -2
  356. data/rbi/orb/models/plans/migration_retrieve_response.rbi +22 -1
  357. data/rbi/orb/models/price.rbi +4733 -2280
  358. data/rbi/orb/models/price_create_params.rbi +3022 -2408
  359. data/rbi/orb/models/price_evaluate_multiple_params.rbi +1540 -114
  360. data/rbi/orb/models/price_evaluate_params.rbi +6 -0
  361. data/rbi/orb/models/price_evaluate_preview_events_params.rbi +1540 -114
  362. data/rbi/orb/models/price_fetch_params.rbi +13 -5
  363. data/rbi/orb/models/price_interval.rbi +3 -0
  364. data/rbi/orb/models/price_update_params.rbi +6 -0
  365. data/rbi/orb/models/prices/external_price_id_fetch_params.rbi +13 -5
  366. data/rbi/orb/models/prices/external_price_id_update_params.rbi +6 -0
  367. data/rbi/orb/models/subscription.rbi +324 -2
  368. data/rbi/orb/models/subscription_cancel_params.rbi +6 -0
  369. data/rbi/orb/models/subscription_change_apply_params.rbi +6 -0
  370. data/rbi/orb/models/subscription_change_cancel_params.rbi +16 -5
  371. data/rbi/orb/models/subscription_change_retrieve_params.rbi +16 -5
  372. data/rbi/orb/models/subscription_create_params.rbi +4998 -1186
  373. data/rbi/orb/models/subscription_fetch_costs_params.rbi +6 -0
  374. data/rbi/orb/models/subscription_fetch_params.rbi +13 -5
  375. data/rbi/orb/models/subscription_fetch_schedule_params.rbi +6 -0
  376. data/rbi/orb/models/subscription_fetch_usage_params.rbi +6 -0
  377. data/rbi/orb/models/subscription_price_intervals_params.rbi +2133 -264
  378. data/rbi/orb/models/subscription_redeem_coupon_params.rbi +6 -0
  379. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +5001 -1183
  380. data/rbi/orb/models/subscription_trigger_phase_params.rbi +6 -0
  381. data/rbi/orb/models/subscription_unschedule_cancellation_params.rbi +13 -5
  382. data/rbi/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbi +10 -1
  383. data/rbi/orb/models/subscription_unschedule_pending_plan_changes_params.rbi +13 -5
  384. data/rbi/orb/models/subscription_update_fixed_fee_quantity_params.rbi +6 -0
  385. data/rbi/orb/models/subscription_update_params.rbi +20 -0
  386. data/rbi/orb/models/subscription_update_trial_params.rbi +6 -0
  387. data/rbi/orb/models.rbi +2 -0
  388. data/rbi/orb/resources/alerts.rbi +43 -0
  389. data/rbi/orb/resources/coupons.rbi +1 -2
  390. data/rbi/orb/resources/credit_blocks.rbi +10 -7
  391. data/rbi/orb/resources/customers/credits/ledger.rbi +50 -146
  392. data/rbi/orb/resources/customers.rbi +35 -7
  393. data/rbi/orb/resources/events/backfills.rbi +3 -4
  394. data/rbi/orb/resources/events.rbi +8 -35
  395. data/rbi/orb/resources/invoices.rbi +20 -6
  396. data/rbi/orb/resources/licenses/external_licenses.rbi +1 -1
  397. data/rbi/orb/resources/licenses/usage.rbi +2 -2
  398. data/rbi/orb/resources/metrics.rbi +5 -5
  399. data/rbi/orb/resources/plans/external_plan_id.rbi +5 -2
  400. data/rbi/orb/resources/plans.rbi +9 -3
  401. data/rbi/orb/resources/prices.rbi +38 -184
  402. data/rbi/orb/resources/subscriptions.rbi +33 -4
  403. data/sig/orb/client.rbs +3 -0
  404. data/sig/orb/internal/util.rbs +4 -0
  405. data/sig/orb/models/accounting_provider_config.rbs +21 -4
  406. data/sig/orb/models/adjustment_interval.rbs +134 -0
  407. data/sig/orb/models/alert.rbs +90 -3
  408. data/sig/orb/models/alert_create_for_customer_params.rbs +5 -0
  409. data/sig/orb/models/alert_create_for_external_customer_params.rbs +5 -0
  410. data/sig/orb/models/alert_create_for_subscription_params.rbs +98 -1
  411. data/sig/orb/models/alert_disable_params.rbs +6 -1
  412. data/sig/orb/models/alert_enable_params.rbs +6 -1
  413. data/sig/orb/models/alert_retrieve_params.rbs +9 -3
  414. data/sig/orb/models/alert_update_params.rbs +90 -1
  415. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +2318 -397
  416. data/sig/orb/models/beta/external_plan_id_fetch_plan_version_params.rbs +6 -1
  417. data/sig/orb/models/beta/external_plan_id_set_default_plan_version_params.rbs +6 -1
  418. data/sig/orb/models/beta_create_plan_version_params.rbs +2300 -389
  419. data/sig/orb/models/beta_fetch_plan_version_params.rbs +10 -2
  420. data/sig/orb/models/beta_set_default_plan_version_params.rbs +10 -2
  421. data/sig/orb/models/changed_subscription_resources.rbs +140 -1
  422. data/sig/orb/models/conversion_rate_config.rbs +12 -0
  423. data/sig/orb/models/coupon_archive_params.rbs +12 -3
  424. data/sig/orb/models/coupon_fetch_params.rbs +12 -3
  425. data/sig/orb/models/coupons/subscription_list_params.rbs +5 -1
  426. data/sig/orb/models/credit_block_delete_params.rbs +8 -3
  427. data/sig/orb/models/credit_block_list_invoices_params.rbs +8 -3
  428. data/sig/orb/models/credit_block_list_invoices_response.rbs +124 -3
  429. data/sig/orb/models/credit_block_retrieve_params.rbs +8 -3
  430. data/sig/orb/models/credit_block_retrieve_response.rbs +124 -3
  431. data/sig/orb/models/credit_note_fetch_params.rbs +11 -3
  432. data/sig/orb/models/customer.rbs +79 -1
  433. data/sig/orb/models/customer_create_params.rbs +12 -1
  434. data/sig/orb/models/customer_delete_params.rbs +12 -3
  435. data/sig/orb/models/customer_fetch_by_external_id_params.rbs +11 -3
  436. data/sig/orb/models/customer_fetch_params.rbs +12 -3
  437. data/sig/orb/models/customer_sync_payment_methods_from_gateway_by_external_customer_id_params.rbs +11 -3
  438. data/sig/orb/models/customer_sync_payment_methods_from_gateway_params.rbs +11 -3
  439. data/sig/orb/models/customer_tax_id.rbs +20 -2
  440. data/sig/orb/models/customer_update_by_external_id_params.rbs +22 -1
  441. data/sig/orb/models/customer_update_params.rbs +22 -1
  442. data/sig/orb/models/customers/balance_transaction_create_params.rbs +5 -0
  443. data/sig/orb/models/customers/balance_transaction_list_params.rbs +5 -0
  444. data/sig/orb/models/customers/cost_list_by_external_id_params.rbs +5 -0
  445. data/sig/orb/models/customers/cost_list_params.rbs +5 -0
  446. data/sig/orb/models/customers/credit_list_by_external_id_params.rbs +5 -0
  447. data/sig/orb/models/customers/credit_list_by_external_id_response.rbs +124 -3
  448. data/sig/orb/models/customers/credit_list_params.rbs +5 -0
  449. data/sig/orb/models/customers/credit_list_response.rbs +124 -3
  450. data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbs +345 -157
  451. data/sig/orb/models/customers/credits/ledger_create_entry_params.rbs +345 -157
  452. data/sig/orb/models/customers/credits/ledger_list_by_external_id_params.rbs +5 -0
  453. data/sig/orb/models/customers/credits/ledger_list_params.rbs +5 -0
  454. data/sig/orb/models/customers/credits/top_up_create_by_external_id_params.rbs +5 -0
  455. data/sig/orb/models/customers/credits/top_up_create_params.rbs +5 -0
  456. data/sig/orb/models/customers/credits/top_up_delete_by_external_id_params.rbs +5 -1
  457. data/sig/orb/models/customers/credits/top_up_delete_params.rbs +6 -1
  458. data/sig/orb/models/customers/credits/top_up_list_by_external_id_params.rbs +5 -1
  459. data/sig/orb/models/customers/credits/top_up_list_params.rbs +5 -1
  460. data/sig/orb/models/dimensional_price_group_retrieve_params.rbs +12 -3
  461. data/sig/orb/models/dimensional_price_group_update_params.rbs +5 -0
  462. data/sig/orb/models/dimensional_price_groups/external_dimensional_price_group_id_retrieve_params.rbs +12 -3
  463. data/sig/orb/models/dimensional_price_groups/external_dimensional_price_group_id_update_params.rbs +5 -0
  464. data/sig/orb/models/discount.rbs +114 -0
  465. data/sig/orb/models/event_deprecate_params.rbs +9 -3
  466. data/sig/orb/models/event_update_params.rbs +5 -0
  467. data/sig/orb/models/events/backfill_close_params.rbs +11 -3
  468. data/sig/orb/models/events/backfill_fetch_params.rbs +11 -3
  469. data/sig/orb/models/events/backfill_revert_params.rbs +11 -3
  470. data/sig/orb/models/invoice.rbs +140 -1
  471. data/sig/orb/models/invoice_delete_line_item_params.rbs +6 -1
  472. data/sig/orb/models/invoice_fetch_params.rbs +12 -3
  473. data/sig/orb/models/invoice_fetch_upcoming_response.rbs +140 -1
  474. data/sig/orb/models/invoice_issue_params.rbs +6 -1
  475. data/sig/orb/models/invoice_issue_summary_params.rbs +6 -1
  476. data/sig/orb/models/invoice_issue_summary_response.rbs +2 -1
  477. data/sig/orb/models/invoice_level_discount.rbs +117 -1
  478. data/sig/orb/models/invoice_line_item_create_response.rbs +134 -0
  479. data/sig/orb/models/invoice_list_summary_response.rbs +2 -1
  480. data/sig/orb/models/invoice_mark_paid_params.rbs +10 -1
  481. data/sig/orb/models/invoice_pay_params.rbs +17 -3
  482. data/sig/orb/models/invoice_update_params.rbs +5 -0
  483. data/sig/orb/models/invoice_void_params.rbs +12 -3
  484. data/sig/orb/models/item_archive_params.rbs +9 -3
  485. data/sig/orb/models/item_fetch_params.rbs +9 -3
  486. data/sig/orb/models/item_update_params.rbs +5 -0
  487. data/sig/orb/models/license_deactivate_params.rbs +10 -2
  488. data/sig/orb/models/license_retrieve_by_external_id_params.rbs +9 -1
  489. data/sig/orb/models/license_retrieve_params.rbs +11 -3
  490. data/sig/orb/models/license_type_retrieve_params.rbs +11 -3
  491. data/sig/orb/models/licenses/external_license_get_usage_params.rbs +9 -4
  492. data/sig/orb/models/licenses/usage_get_all_usage_params.rbs +4 -4
  493. data/sig/orb/models/licenses/usage_get_usage_params.rbs +9 -4
  494. data/sig/orb/models/metric_fetch_params.rbs +12 -3
  495. data/sig/orb/models/metric_update_params.rbs +5 -1
  496. data/sig/orb/models/mutated_subscription.rbs +124 -0
  497. data/sig/orb/models/new_allocation_price.rbs +5 -0
  498. data/sig/orb/models/new_floating_bulk_price.rbs +4 -4
  499. data/sig/orb/models/new_floating_bulk_with_proration_price.rbs +4 -4
  500. data/sig/orb/models/new_floating_cumulative_grouped_bulk_price.rbs +4 -4
  501. data/sig/orb/models/new_floating_grouped_allocation_price.rbs +4 -4
  502. data/sig/orb/models/new_floating_grouped_tiered_package_price.rbs +4 -4
  503. data/sig/orb/models/new_floating_grouped_tiered_price.rbs +4 -4
  504. data/sig/orb/models/new_floating_grouped_with_metered_minimum_price.rbs +4 -4
  505. data/sig/orb/models/new_floating_grouped_with_prorated_minimum_price.rbs +4 -4
  506. data/sig/orb/models/new_floating_matrix_price.rbs +4 -4
  507. data/sig/orb/models/new_floating_matrix_with_allocation_price.rbs +4 -4
  508. data/sig/orb/models/new_floating_matrix_with_display_name_price.rbs +4 -4
  509. data/sig/orb/models/new_floating_max_group_tiered_package_price.rbs +4 -4
  510. data/sig/orb/models/new_floating_minimum_composite_price.rbs +4 -4
  511. data/sig/orb/models/new_floating_package_price.rbs +4 -4
  512. data/sig/orb/models/new_floating_package_with_allocation_price.rbs +4 -4
  513. data/sig/orb/models/new_floating_scalable_matrix_with_tiered_pricing_price.rbs +4 -4
  514. data/sig/orb/models/new_floating_scalable_matrix_with_unit_pricing_price.rbs +4 -4
  515. data/sig/orb/models/new_floating_threshold_total_amount_price.rbs +4 -4
  516. data/sig/orb/models/new_floating_tiered_package_price.rbs +4 -4
  517. data/sig/orb/models/new_floating_tiered_package_with_minimum_price.rbs +4 -4
  518. data/sig/orb/models/new_floating_tiered_price.rbs +4 -4
  519. data/sig/orb/models/new_floating_tiered_with_minimum_price.rbs +4 -4
  520. data/sig/orb/models/new_floating_tiered_with_proration_price.rbs +4 -4
  521. data/sig/orb/models/new_floating_unit_price.rbs +4 -4
  522. data/sig/orb/models/new_floating_unit_with_percent_price.rbs +4 -4
  523. data/sig/orb/models/new_floating_unit_with_proration_price.rbs +4 -4
  524. data/sig/orb/models/new_plan_bulk_price.rbs +4 -4
  525. data/sig/orb/models/new_plan_bulk_with_proration_price.rbs +4 -4
  526. data/sig/orb/models/new_plan_cumulative_grouped_bulk_price.rbs +4 -4
  527. data/sig/orb/models/new_plan_grouped_allocation_price.rbs +4 -4
  528. data/sig/orb/models/new_plan_grouped_tiered_package_price.rbs +4 -4
  529. data/sig/orb/models/new_plan_grouped_tiered_price.rbs +4 -4
  530. data/sig/orb/models/new_plan_grouped_with_metered_minimum_price.rbs +4 -4
  531. data/sig/orb/models/new_plan_grouped_with_prorated_minimum_price.rbs +4 -4
  532. data/sig/orb/models/new_plan_matrix_price.rbs +4 -4
  533. data/sig/orb/models/new_plan_matrix_with_allocation_price.rbs +4 -4
  534. data/sig/orb/models/new_plan_matrix_with_display_name_price.rbs +4 -4
  535. data/sig/orb/models/new_plan_max_group_tiered_package_price.rbs +4 -4
  536. data/sig/orb/models/new_plan_minimum_composite_price.rbs +4 -4
  537. data/sig/orb/models/new_plan_package_price.rbs +4 -4
  538. data/sig/orb/models/new_plan_package_with_allocation_price.rbs +4 -4
  539. data/sig/orb/models/new_plan_scalable_matrix_with_tiered_pricing_price.rbs +4 -4
  540. data/sig/orb/models/new_plan_scalable_matrix_with_unit_pricing_price.rbs +4 -4
  541. data/sig/orb/models/new_plan_threshold_total_amount_price.rbs +4 -4
  542. data/sig/orb/models/new_plan_tiered_package_price.rbs +4 -4
  543. data/sig/orb/models/new_plan_tiered_package_with_minimum_price.rbs +4 -4
  544. data/sig/orb/models/new_plan_tiered_price.rbs +4 -4
  545. data/sig/orb/models/new_plan_tiered_with_minimum_price.rbs +4 -4
  546. data/sig/orb/models/new_plan_unit_price.rbs +4 -4
  547. data/sig/orb/models/new_plan_unit_with_percent_price.rbs +4 -4
  548. data/sig/orb/models/new_plan_unit_with_proration_price.rbs +4 -4
  549. data/sig/orb/models/new_subscription_bulk_price.rbs +4 -4
  550. data/sig/orb/models/new_subscription_bulk_with_proration_price.rbs +4 -4
  551. data/sig/orb/models/new_subscription_cumulative_grouped_bulk_price.rbs +4 -4
  552. data/sig/orb/models/new_subscription_grouped_allocation_price.rbs +4 -4
  553. data/sig/orb/models/new_subscription_grouped_tiered_package_price.rbs +4 -4
  554. data/sig/orb/models/new_subscription_grouped_tiered_price.rbs +4 -4
  555. data/sig/orb/models/new_subscription_grouped_with_metered_minimum_price.rbs +4 -4
  556. data/sig/orb/models/new_subscription_grouped_with_prorated_minimum_price.rbs +4 -4
  557. data/sig/orb/models/new_subscription_matrix_price.rbs +4 -4
  558. data/sig/orb/models/new_subscription_matrix_with_allocation_price.rbs +4 -4
  559. data/sig/orb/models/new_subscription_matrix_with_display_name_price.rbs +4 -4
  560. data/sig/orb/models/new_subscription_max_group_tiered_package_price.rbs +4 -4
  561. data/sig/orb/models/new_subscription_minimum_composite_price.rbs +4 -4
  562. data/sig/orb/models/new_subscription_package_price.rbs +4 -4
  563. data/sig/orb/models/new_subscription_package_with_allocation_price.rbs +4 -4
  564. data/sig/orb/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rbs +4 -4
  565. data/sig/orb/models/new_subscription_scalable_matrix_with_unit_pricing_price.rbs +4 -4
  566. data/sig/orb/models/new_subscription_threshold_total_amount_price.rbs +4 -4
  567. data/sig/orb/models/new_subscription_tiered_package_price.rbs +4 -4
  568. data/sig/orb/models/new_subscription_tiered_package_with_minimum_price.rbs +4 -4
  569. data/sig/orb/models/new_subscription_tiered_price.rbs +4 -4
  570. data/sig/orb/models/new_subscription_tiered_with_minimum_price.rbs +4 -4
  571. data/sig/orb/models/new_subscription_unit_price.rbs +4 -4
  572. data/sig/orb/models/new_subscription_unit_with_percent_price.rbs +4 -4
  573. data/sig/orb/models/new_subscription_unit_with_proration_price.rbs +4 -4
  574. data/sig/orb/models/plan.rbs +134 -0
  575. data/sig/orb/models/plan_create_params.rbs +1030 -72
  576. data/sig/orb/models/plan_fetch_params.rbs +9 -3
  577. data/sig/orb/models/plan_update_params.rbs +14 -1
  578. data/sig/orb/models/plan_version.rbs +134 -0
  579. data/sig/orb/models/plans/external_plan_id_fetch_params.rbs +11 -3
  580. data/sig/orb/models/plans/external_plan_id_update_params.rbs +14 -1
  581. data/sig/orb/models/plans/migration_cancel_params.rbs +6 -1
  582. data/sig/orb/models/plans/migration_list_params.rbs +5 -1
  583. data/sig/orb/models/plans/migration_retrieve_params.rbs +6 -1
  584. data/sig/orb/models/price.rbs +2361 -1156
  585. data/sig/orb/models/price_create_params.rbs +1124 -931
  586. data/sig/orb/models/price_evaluate_multiple_params.rbs +626 -23
  587. data/sig/orb/models/price_evaluate_params.rbs +5 -0
  588. data/sig/orb/models/price_evaluate_preview_events_params.rbs +626 -23
  589. data/sig/orb/models/price_fetch_params.rbs +9 -3
  590. data/sig/orb/models/price_update_params.rbs +5 -1
  591. data/sig/orb/models/prices/external_price_id_fetch_params.rbs +11 -3
  592. data/sig/orb/models/prices/external_price_id_update_params.rbs +5 -1
  593. data/sig/orb/models/subscription.rbs +124 -0
  594. data/sig/orb/models/subscription_cancel_params.rbs +5 -0
  595. data/sig/orb/models/subscription_change_apply_params.rbs +5 -0
  596. data/sig/orb/models/subscription_change_cancel_params.rbs +12 -3
  597. data/sig/orb/models/subscription_change_retrieve_params.rbs +12 -3
  598. data/sig/orb/models/subscription_create_params.rbs +2009 -430
  599. data/sig/orb/models/subscription_fetch_costs_params.rbs +5 -0
  600. data/sig/orb/models/subscription_fetch_params.rbs +11 -3
  601. data/sig/orb/models/subscription_fetch_schedule_params.rbs +5 -0
  602. data/sig/orb/models/subscription_fetch_usage_params.rbs +5 -0
  603. data/sig/orb/models/subscription_price_intervals_params.rbs +800 -23
  604. data/sig/orb/models/subscription_redeem_coupon_params.rbs +5 -0
  605. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +2014 -430
  606. data/sig/orb/models/subscription_trigger_phase_params.rbs +9 -1
  607. data/sig/orb/models/subscription_unschedule_cancellation_params.rbs +11 -3
  608. data/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_params.rbs +10 -2
  609. data/sig/orb/models/subscription_unschedule_pending_plan_changes_params.rbs +11 -3
  610. data/sig/orb/models/subscription_update_fixed_fee_quantity_params.rbs +5 -0
  611. data/sig/orb/models/subscription_update_params.rbs +10 -0
  612. data/sig/orb/models/subscription_update_trial_params.rbs +5 -0
  613. data/sig/orb/models.rbs +2 -0
  614. data/sig/orb/resources/alerts.rbs +6 -0
  615. data/sig/orb/resources/customers/credits/ledger.rbs +2 -26
  616. data/sig/orb/resources/customers.rbs +2 -0
  617. data/sig/orb/resources/invoices.rbs +1 -0
  618. data/sig/orb/resources/licenses/external_licenses.rbs +1 -1
  619. data/sig/orb/resources/licenses/usage.rbs +2 -2
  620. data/sig/orb/resources/plans/external_plan_id.rbs +1 -0
  621. data/sig/orb/resources/plans.rbs +2 -0
  622. data/sig/orb/resources/prices.rbs +1 -48
  623. data/sig/orb/resources/subscriptions.rbs +3 -0
  624. metadata +6 -7
@@ -11,6 +11,9 @@ module Orb
11
11
  T.any(Orb::SubscriptionTriggerPhaseParams, Orb::Internal::AnyHash)
12
12
  end
13
13
 
14
+ sig { returns(String) }
15
+ attr_accessor :subscription_id
16
+
14
17
  # If false, this request will fail if it would void an issued invoice or create a
15
18
  # credit note. Consider using this as a safety mechanism if you do not expect
16
19
  # existing invoices to be changed.
@@ -24,12 +27,14 @@ module Orb
24
27
 
25
28
  sig do
26
29
  params(
30
+ subscription_id: String,
27
31
  allow_invoice_credit_or_void: T.nilable(T::Boolean),
28
32
  effective_date: T.nilable(Date),
29
33
  request_options: Orb::RequestOptions::OrHash
30
34
  ).returns(T.attached_class)
31
35
  end
32
36
  def self.new(
37
+ subscription_id:,
33
38
  # If false, this request will fail if it would void an issued invoice or create a
34
39
  # credit note. Consider using this as a safety mechanism if you do not expect
35
40
  # existing invoices to be changed.
@@ -44,6 +49,7 @@ module Orb
44
49
  sig do
45
50
  override.returns(
46
51
  {
52
+ subscription_id: String,
47
53
  allow_invoice_credit_or_void: T.nilable(T::Boolean),
48
54
  effective_date: T.nilable(Date),
49
55
  request_options: Orb::RequestOptions
@@ -14,15 +14,23 @@ module Orb
14
14
  )
15
15
  end
16
16
 
17
+ sig { returns(String) }
18
+ attr_accessor :subscription_id
19
+
17
20
  sig do
18
- params(request_options: Orb::RequestOptions::OrHash).returns(
19
- T.attached_class
20
- )
21
+ params(
22
+ subscription_id: String,
23
+ request_options: Orb::RequestOptions::OrHash
24
+ ).returns(T.attached_class)
21
25
  end
22
- def self.new(request_options: {})
26
+ def self.new(subscription_id:, request_options: {})
23
27
  end
24
28
 
25
- sig { override.returns({ request_options: Orb::RequestOptions }) }
29
+ sig do
30
+ override.returns(
31
+ { subscription_id: String, request_options: Orb::RequestOptions }
32
+ )
33
+ end
26
34
  def to_hash
27
35
  end
28
36
  end
@@ -14,17 +14,22 @@ module Orb
14
14
  )
15
15
  end
16
16
 
17
+ sig { returns(String) }
18
+ attr_accessor :subscription_id
19
+
17
20
  # Price for which the updates should be cleared. Must be a fixed fee.
18
21
  sig { returns(String) }
19
22
  attr_accessor :price_id
20
23
 
21
24
  sig do
22
25
  params(
26
+ subscription_id: String,
23
27
  price_id: String,
24
28
  request_options: Orb::RequestOptions::OrHash
25
29
  ).returns(T.attached_class)
26
30
  end
27
31
  def self.new(
32
+ subscription_id:,
28
33
  # Price for which the updates should be cleared. Must be a fixed fee.
29
34
  price_id:,
30
35
  request_options: {}
@@ -33,7 +38,11 @@ module Orb
33
38
 
34
39
  sig do
35
40
  override.returns(
36
- { price_id: String, request_options: Orb::RequestOptions }
41
+ {
42
+ subscription_id: String,
43
+ price_id: String,
44
+ request_options: Orb::RequestOptions
45
+ }
37
46
  )
38
47
  end
39
48
  def to_hash
@@ -14,15 +14,23 @@ module Orb
14
14
  )
15
15
  end
16
16
 
17
+ sig { returns(String) }
18
+ attr_accessor :subscription_id
19
+
17
20
  sig do
18
- params(request_options: Orb::RequestOptions::OrHash).returns(
19
- T.attached_class
20
- )
21
+ params(
22
+ subscription_id: String,
23
+ request_options: Orb::RequestOptions::OrHash
24
+ ).returns(T.attached_class)
21
25
  end
22
- def self.new(request_options: {})
26
+ def self.new(subscription_id:, request_options: {})
23
27
  end
24
28
 
25
- sig { override.returns({ request_options: Orb::RequestOptions }) }
29
+ sig do
30
+ override.returns(
31
+ { subscription_id: String, request_options: Orb::RequestOptions }
32
+ )
33
+ end
26
34
  def to_hash
27
35
  end
28
36
  end
@@ -14,6 +14,9 @@ module Orb
14
14
  )
15
15
  end
16
16
 
17
+ sig { returns(String) }
18
+ attr_accessor :subscription_id
19
+
17
20
  # Price for which the quantity should be updated. Must be a fixed fee.
18
21
  sig { returns(String) }
19
22
  attr_accessor :price_id
@@ -55,6 +58,7 @@ module Orb
55
58
 
56
59
  sig do
57
60
  params(
61
+ subscription_id: String,
58
62
  price_id: String,
59
63
  quantity: Float,
60
64
  allow_invoice_credit_or_void: T.nilable(T::Boolean),
@@ -65,6 +69,7 @@ module Orb
65
69
  ).returns(T.attached_class)
66
70
  end
67
71
  def self.new(
72
+ subscription_id:,
68
73
  # Price for which the quantity should be updated. Must be a fixed fee.
69
74
  price_id:,
70
75
  quantity:,
@@ -87,6 +92,7 @@ module Orb
87
92
  sig do
88
93
  override.returns(
89
94
  {
95
+ subscription_id: String,
90
96
  price_id: String,
91
97
  quantity: Float,
92
98
  allow_invoice_credit_or_void: T.nilable(T::Boolean),
@@ -11,12 +11,22 @@ module Orb
11
11
  T.any(Orb::SubscriptionUpdateParams, Orb::Internal::AnyHash)
12
12
  end
13
13
 
14
+ sig { returns(String) }
15
+ attr_accessor :subscription_id
16
+
14
17
  # Determines whether issued invoices for this subscription will automatically be
15
18
  # charged with the saved payment method on the due date. This property defaults to
16
19
  # the plan's behavior.
17
20
  sig { returns(T.nilable(T::Boolean)) }
18
21
  attr_accessor :auto_collection
19
22
 
23
+ # Used to determine if invoices for this subscription will be automatically
24
+ # issued. If true, invoices will be automatically issued. If false, invoices will
25
+ # require manual approval. If `null` is specified, this defaults to the behavior
26
+ # configured for this customer.
27
+ sig { returns(T.nilable(T::Boolean)) }
28
+ attr_accessor :auto_issuance
29
+
20
30
  # Determines the default memo on this subscription's invoices. Note that if this
21
31
  # is not provided, it is determined by the plan configuration.
22
32
  sig { returns(T.nilable(String)) }
@@ -43,7 +53,9 @@ module Orb
43
53
 
44
54
  sig do
45
55
  params(
56
+ subscription_id: String,
46
57
  auto_collection: T.nilable(T::Boolean),
58
+ auto_issuance: T.nilable(T::Boolean),
47
59
  default_invoice_memo: T.nilable(String),
48
60
  invoicing_threshold: T.nilable(String),
49
61
  metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
@@ -52,10 +64,16 @@ module Orb
52
64
  ).returns(T.attached_class)
53
65
  end
54
66
  def self.new(
67
+ subscription_id:,
55
68
  # Determines whether issued invoices for this subscription will automatically be
56
69
  # charged with the saved payment method on the due date. This property defaults to
57
70
  # the plan's behavior.
58
71
  auto_collection: nil,
72
+ # Used to determine if invoices for this subscription will be automatically
73
+ # issued. If true, invoices will be automatically issued. If false, invoices will
74
+ # require manual approval. If `null` is specified, this defaults to the behavior
75
+ # configured for this customer.
76
+ auto_issuance: nil,
59
77
  # Determines the default memo on this subscription's invoices. Note that if this
60
78
  # is not provided, it is determined by the plan configuration.
61
79
  default_invoice_memo: nil,
@@ -79,7 +97,9 @@ module Orb
79
97
  sig do
80
98
  override.returns(
81
99
  {
100
+ subscription_id: String,
82
101
  auto_collection: T.nilable(T::Boolean),
102
+ auto_issuance: T.nilable(T::Boolean),
83
103
  default_invoice_memo: T.nilable(String),
84
104
  invoicing_threshold: T.nilable(String),
85
105
  metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
@@ -11,6 +11,9 @@ module Orb
11
11
  T.any(Orb::SubscriptionUpdateTrialParams, Orb::Internal::AnyHash)
12
12
  end
13
13
 
14
+ sig { returns(String) }
15
+ attr_accessor :subscription_id
16
+
14
17
  # The new date that the trial should end, or the literal string `immediate` to end
15
18
  # the trial immediately.
16
19
  sig do
@@ -33,6 +36,7 @@ module Orb
33
36
 
34
37
  sig do
35
38
  params(
39
+ subscription_id: String,
36
40
  trial_end_date:
37
41
  T.any(
38
42
  Time,
@@ -43,6 +47,7 @@ module Orb
43
47
  ).returns(T.attached_class)
44
48
  end
45
49
  def self.new(
50
+ subscription_id:,
46
51
  # The new date that the trial should end, or the literal string `immediate` to end
47
52
  # the trial immediately.
48
53
  trial_end_date:,
@@ -56,6 +61,7 @@ module Orb
56
61
  sig do
57
62
  override.returns(
58
63
  {
64
+ subscription_id: String,
59
65
  trial_end_date:
60
66
  T.any(
61
67
  Time,
data/rbi/orb/models.rbi CHANGED
@@ -61,6 +61,8 @@ module Orb
61
61
 
62
62
  ChangedSubscriptionResources = Orb::Models::ChangedSubscriptionResources
63
63
 
64
+ ConversionRateConfig = Orb::Models::ConversionRateConfig
65
+
64
66
  ConversionRateTier = Orb::Models::ConversionRateTier
65
67
 
66
68
  ConversionRateTieredConfig = Orb::Models::ConversionRateTieredConfig
@@ -23,6 +23,12 @@ module Orb
23
23
  params(
24
24
  alert_configuration_id: String,
25
25
  thresholds: T::Array[Orb::Threshold::OrHash],
26
+ price_filters:
27
+ T.nilable(T::Array[Orb::AlertUpdateParams::PriceFilter::OrHash]),
28
+ threshold_overrides:
29
+ T.nilable(
30
+ T::Array[Orb::AlertUpdateParams::ThresholdOverride::OrHash]
31
+ ),
26
32
  request_options: Orb::RequestOptions::OrHash
27
33
  ).returns(Orb::Alert)
28
34
  end
@@ -30,6 +36,13 @@ module Orb
30
36
  alert_configuration_id,
31
37
  # The thresholds that define the values at which the alert will be triggered.
32
38
  thresholds:,
39
+ # Replaces the price filters on a grouped cost alert; an empty list clears them.
40
+ # Only applicable to cost alerts with grouping_keys. Omit to leave unchanged.
41
+ price_filters: nil,
42
+ # Replaces the per-group threshold overrides on a grouped cost alert; an empty
43
+ # list clears them. Only applicable to cost alerts with grouping_keys. Omit to
44
+ # leave unchanged.
45
+ threshold_overrides: nil,
33
46
  request_options: {}
34
47
  )
35
48
  end
@@ -153,7 +166,21 @@ module Orb
153
166
  subscription_id: String,
154
167
  thresholds: T::Array[Orb::Threshold::OrHash],
155
168
  type: Orb::AlertCreateForSubscriptionParams::Type::OrSymbol,
169
+ currency: T.nilable(String),
170
+ grouping_keys: T.nilable(T::Array[String]),
156
171
  metric_id: T.nilable(String),
172
+ price_filters:
173
+ T.nilable(
174
+ T::Array[
175
+ Orb::AlertCreateForSubscriptionParams::PriceFilter::OrHash
176
+ ]
177
+ ),
178
+ threshold_overrides:
179
+ T.nilable(
180
+ T::Array[
181
+ Orb::AlertCreateForSubscriptionParams::ThresholdOverride::OrHash
182
+ ]
183
+ ),
157
184
  request_options: Orb::RequestOptions::OrHash
158
185
  ).returns(Orb::Alert)
159
186
  end
@@ -163,8 +190,24 @@ module Orb
163
190
  thresholds:,
164
191
  # The type of alert to create. This must be a valid alert type.
165
192
  type:,
193
+ # The case sensitive currency or custom pricing unit to use for grouped cost
194
+ # alerts. Required when grouping_keys is set.
195
+ currency: nil,
196
+ # The property keys to group cost alerts by. Only applicable for cost_exceeded
197
+ # alerts.
198
+ grouping_keys: nil,
166
199
  # The metric to track usage for.
167
200
  metric_id: nil,
201
+ # Filters to scope which prices are included in grouped cost alert evaluation.
202
+ # Supports filtering by price_id, item_id, or price_type with includes/excludes
203
+ # operators. Only applicable when grouping_keys is set.
204
+ price_filters: nil,
205
+ # Per-group threshold overrides. Each override maps a specific combination of
206
+ # grouping_keys values to a list of thresholds that fully replaces the default
207
+ # thresholds for that group. An empty thresholds list silences the group. Groups
208
+ # without an override use the default thresholds. Only applicable when
209
+ # grouping_keys is set.
210
+ threshold_overrides: nil,
168
211
  request_options: {}
169
212
  )
170
213
  end
@@ -49,8 +49,7 @@ module Orb
49
49
  #
50
50
  # The list of coupons is ordered starting from the most recently created coupon.
51
51
  # The response also includes `pagination_metadata`, which lets the caller retrieve
52
- # the next page of results if they exist. More information about pagination can be
53
- # found in the Pagination-metadata schema.
52
+ # the next page of results if they exist.
54
53
  sig do
55
54
  params(
56
55
  cursor: T.nilable(String),
@@ -41,14 +41,17 @@ module Orb
41
41
 
42
42
  # This endpoint returns the credit block and its associated purchasing invoices.
43
43
  #
44
- # If a credit block was purchased (as opposed to being manually added or allocated
45
- # from a subscription), this endpoint returns the invoices that were created to
46
- # charge the customer for the credit block. For credit blocks with payment
47
- # schedules spanning multiple periods (e.g., monthly payments over 12 months),
48
- # multiple invoices will be returned.
44
+ # If a credit block was purchased (as opposed to being manually added), this
45
+ # endpoint returns the invoices that were created to charge the customer for the
46
+ # credit block. For credit blocks with payment schedules spanning multiple periods
47
+ # (e.g., monthly payments over 12 months), multiple invoices will be returned.
49
48
  #
50
- # If the credit block was not purchased (e.g., manual increment, allocation), an
51
- # empty invoices list is returned.
49
+ # For credit blocks created by subscription allocation prices, this endpoint
50
+ # returns the subscription invoice containing the allocation line item that
51
+ # created the block.
52
+ #
53
+ # If the credit block was not purchased (e.g., manual increment), an empty
54
+ # invoices list is returned.
52
55
  #
53
56
  # **Note: This endpoint is currently experimental and its interface may change in
54
57
  # future releases. Please contact support before building production integrations
@@ -172,8 +172,9 @@ module Orb
172
172
  # }
173
173
  # ```
174
174
  #
175
- # Note that by default, Orb will always first increment any _negative_ balance in
176
- # existing blocks before adding the remaining amount to the desired credit block.
175
+ # Note that an `increment` entry always creates a new credit block (defined by the
176
+ # optional `effective_date` and `expiry_date`); it never modifies an existing
177
+ # block.
177
178
  #
178
179
  # ### Invoicing for credits
179
180
  #
@@ -182,7 +183,9 @@ module Orb
182
183
  # also generate a one-off invoice for the customer for the credits pre-purchase.
183
184
  # Note that you _must_ provide the `per_unit_cost_basis`, since the total charges
184
185
  # on the invoice are calculated by multiplying the cost basis with the number of
185
- # credit units added.
186
+ # credit units added. If you invoice or handle payment of credits outside of Orb
187
+ # (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to
188
+ # `true` to prevent duplicate invoicing effects.
186
189
  #
187
190
  # - if `per_unit_cost_basis` is greater than zero, an invoice will be generated
188
191
  # and `invoice_settings` must be included
@@ -192,11 +195,17 @@ module Orb
192
195
  # ## Deducting Credits
193
196
  #
194
197
  # Orb allows you to deduct credits from a customer by creating an entry of type
195
- # `decrement`. Orb matches the algorithm for automatic deductions for determining
196
- # which credit blocks to decrement from. In the case that the deduction leads to
197
- # multiple ledger entries, the response from this endpoint will be the final
198
- # deduction. Orb also optionally allows specifying a description to assist with
199
- # auditing.
198
+ # `decrement`. A `decrement` entry records credits as usage and immediately
199
+ # recognizes revenue at the block's `per_unit_cost_basis`.
200
+ #
201
+ # For most credit removals, use `void` (no revenue impact) or `expiration_change`
202
+ # (revenue recognized on expiration) instead. Only use `decrement` when credits
203
+ # were genuinely consumed outside of normal event ingestion.
204
+ #
205
+ # Orb matches the algorithm for automatic deductions for determining which credit
206
+ # blocks to decrement from. In the case that the deduction leads to multiple
207
+ # ledger entries, the response from this endpoint will be the final deduction. Orb
208
+ # also optionally allows specifying a description to assist with auditing.
200
209
  #
201
210
  # The following snippet illustrates a sample request body to decrement credits.
202
211
  #
@@ -250,79 +259,20 @@ module Orb
250
259
  sig do
251
260
  params(
252
261
  customer_id: String,
253
- amount: Float,
254
- entry_type:
255
- Orb::Customers::Credits::LedgerCreateEntryParams::EntryType::OrSymbol,
256
- target_expiry_date: Date,
257
- block_id: String,
258
- currency: T.nilable(String),
259
- description: T.nilable(String),
260
- effective_date: T.nilable(Time),
261
- expiry_date: T.nilable(Time),
262
- filters:
263
- T.nilable(
264
- T::Array[
265
- Orb::Customers::Credits::LedgerCreateEntryParams::Filter::OrHash
266
- ]
267
- ),
268
- invoice_settings:
269
- T.nilable(
270
- Orb::Customers::Credits::LedgerCreateEntryParams::InvoiceSettings::OrHash
271
- ),
272
- metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
273
- per_unit_cost_basis: T.nilable(String),
274
- void_reason:
275
- T.nilable(
276
- Orb::Customers::Credits::LedgerCreateEntryParams::VoidReason::OrSymbol
262
+ body:
263
+ T.any(
264
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Increment::OrHash,
265
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Decrement::OrHash,
266
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::ExpirationChange::OrHash,
267
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Void::OrHash,
268
+ Orb::Customers::Credits::LedgerCreateEntryParams::Body::Amendment::OrHash
277
269
  ),
278
270
  request_options: Orb::RequestOptions::OrHash
279
271
  ).returns(
280
272
  Orb::Models::Customers::Credits::LedgerCreateEntryResponse::Variants
281
273
  )
282
274
  end
283
- def create_entry(
284
- customer_id,
285
- # The number of credits to effect. Note that this is required for increment,
286
- # decrement or void operations.
287
- amount:,
288
- entry_type:,
289
- # A future date (specified in YYYY-MM-DD format) used for expiration change,
290
- # denoting when credits transferred (as part of a partial block expiration) should
291
- # expire.
292
- target_expiry_date:,
293
- # The ID of the block to reverse a decrement from.
294
- block_id:,
295
- # The currency or custom pricing unit to use for this ledger entry. If this is a
296
- # real-world currency, it must match the customer's invoicing currency.
297
- currency: nil,
298
- # Optional metadata that can be specified when adding ledger results via the API.
299
- # For example, this can be used to note an increment refers to trial credits, or
300
- # for noting corrections as a result of an incident, etc.
301
- description: nil,
302
- # An ISO 8601 format date that denotes when this credit balance should become
303
- # available for use.
304
- effective_date: nil,
305
- # An ISO 8601 format date that identifies the origination credit block to expire
306
- expiry_date: nil,
307
- # Optional filter to specify which items this credit block applies to. If not
308
- # specified, the block will apply to all items for the pricing unit.
309
- filters: nil,
310
- # Passing `invoice_settings` automatically generates an invoice for the newly
311
- # added credits. If `invoice_settings` is passed, you must specify
312
- # per_unit_cost_basis, as the calculation of the invoice total is done on that
313
- # basis.
314
- invoice_settings: nil,
315
- # User-specified key/value pairs for the resource. Individual keys can be removed
316
- # by setting the value to `null`, and the entire metadata mapping can be cleared
317
- # by setting `metadata` to `null`.
318
- metadata: nil,
319
- # Can only be specified when entry_type=increment. How much, in the customer's
320
- # currency, a customer paid for a single credit in this block
321
- per_unit_cost_basis: nil,
322
- # Can only be specified when `entry_type=void`. The reason for the void.
323
- void_reason: nil,
324
- request_options: {}
325
- )
275
+ def create_entry(customer_id, body:, request_options: {})
326
276
  end
327
277
 
328
278
  # This endpoint allows you to create a new ledger entry for a specified customer's
@@ -365,8 +315,9 @@ module Orb
365
315
  # }
366
316
  # ```
367
317
  #
368
- # Note that by default, Orb will always first increment any _negative_ balance in
369
- # existing blocks before adding the remaining amount to the desired credit block.
318
+ # Note that an `increment` entry always creates a new credit block (defined by the
319
+ # optional `effective_date` and `expiry_date`); it never modifies an existing
320
+ # block.
370
321
  #
371
322
  # ### Invoicing for credits
372
323
  #
@@ -375,7 +326,9 @@ module Orb
375
326
  # also generate a one-off invoice for the customer for the credits pre-purchase.
376
327
  # Note that you _must_ provide the `per_unit_cost_basis`, since the total charges
377
328
  # on the invoice are calculated by multiplying the cost basis with the number of
378
- # credit units added.
329
+ # credit units added. If you invoice or handle payment of credits outside of Orb
330
+ # (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to
331
+ # `true` to prevent duplicate invoicing effects.
379
332
  #
380
333
  # - if `per_unit_cost_basis` is greater than zero, an invoice will be generated
381
334
  # and `invoice_settings` must be included
@@ -385,11 +338,17 @@ module Orb
385
338
  # ## Deducting Credits
386
339
  #
387
340
  # Orb allows you to deduct credits from a customer by creating an entry of type
388
- # `decrement`. Orb matches the algorithm for automatic deductions for determining
389
- # which credit blocks to decrement from. In the case that the deduction leads to
390
- # multiple ledger entries, the response from this endpoint will be the final
391
- # deduction. Orb also optionally allows specifying a description to assist with
392
- # auditing.
341
+ # `decrement`. A `decrement` entry records credits as usage and immediately
342
+ # recognizes revenue at the block's `per_unit_cost_basis`.
343
+ #
344
+ # For most credit removals, use `void` (no revenue impact) or `expiration_change`
345
+ # (revenue recognized on expiration) instead. Only use `decrement` when credits
346
+ # were genuinely consumed outside of normal event ingestion.
347
+ #
348
+ # Orb matches the algorithm for automatic deductions for determining which credit
349
+ # blocks to decrement from. In the case that the deduction leads to multiple
350
+ # ledger entries, the response from this endpoint will be the final deduction. Orb
351
+ # also optionally allows specifying a description to assist with auditing.
393
352
  #
394
353
  # The following snippet illustrates a sample request body to decrement credits.
395
354
  #
@@ -443,30 +402,13 @@ module Orb
443
402
  sig do
444
403
  params(
445
404
  external_customer_id: String,
446
- amount: Float,
447
- entry_type:
448
- Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::EntryType::OrSymbol,
449
- target_expiry_date: Date,
450
- block_id: String,
451
- currency: T.nilable(String),
452
- description: T.nilable(String),
453
- effective_date: T.nilable(Time),
454
- expiry_date: T.nilable(Time),
455
- filters:
456
- T.nilable(
457
- T::Array[
458
- Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::Filter::OrHash
459
- ]
460
- ),
461
- invoice_settings:
462
- T.nilable(
463
- Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::InvoiceSettings::OrHash
464
- ),
465
- metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
466
- per_unit_cost_basis: T.nilable(String),
467
- void_reason:
468
- T.nilable(
469
- Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::VoidReason::OrSymbol
405
+ body:
406
+ T.any(
407
+ Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::Body::Increment::OrHash,
408
+ Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::Body::Decrement::OrHash,
409
+ Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::Body::ExpirationChange::OrHash,
410
+ Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::Body::Void::OrHash,
411
+ Orb::Customers::Credits::LedgerCreateEntryByExternalIDParams::Body::Amendment::OrHash
470
412
  ),
471
413
  request_options: Orb::RequestOptions::OrHash
472
414
  ).returns(
@@ -475,45 +417,7 @@ module Orb
475
417
  end
476
418
  def create_entry_by_external_id(
477
419
  external_customer_id,
478
- # The number of credits to effect. Note that this is required for increment,
479
- # decrement or void operations.
480
- amount:,
481
- entry_type:,
482
- # A future date (specified in YYYY-MM-DD format) used for expiration change,
483
- # denoting when credits transferred (as part of a partial block expiration) should
484
- # expire.
485
- target_expiry_date:,
486
- # The ID of the block to reverse a decrement from.
487
- block_id:,
488
- # The currency or custom pricing unit to use for this ledger entry. If this is a
489
- # real-world currency, it must match the customer's invoicing currency.
490
- currency: nil,
491
- # Optional metadata that can be specified when adding ledger results via the API.
492
- # For example, this can be used to note an increment refers to trial credits, or
493
- # for noting corrections as a result of an incident, etc.
494
- description: nil,
495
- # An ISO 8601 format date that denotes when this credit balance should become
496
- # available for use.
497
- effective_date: nil,
498
- # An ISO 8601 format date that identifies the origination credit block to expire
499
- expiry_date: nil,
500
- # Optional filter to specify which items this credit block applies to. If not
501
- # specified, the block will apply to all items for the pricing unit.
502
- filters: nil,
503
- # Passing `invoice_settings` automatically generates an invoice for the newly
504
- # added credits. If `invoice_settings` is passed, you must specify
505
- # per_unit_cost_basis, as the calculation of the invoice total is done on that
506
- # basis.
507
- invoice_settings: nil,
508
- # User-specified key/value pairs for the resource. Individual keys can be removed
509
- # by setting the value to `null`, and the entire metadata mapping can be cleared
510
- # by setting `metadata` to `null`.
511
- metadata: nil,
512
- # Can only be specified when entry_type=increment. How much, in the customer's
513
- # currency, a customer paid for a single credit in this block
514
- per_unit_cost_basis: nil,
515
- # Can only be specified when `entry_type=void`. The reason for the void.
516
- void_reason: nil,
420
+ body:,
517
421
  request_options: {}
518
422
  )
519
423
  end