orb-billing 1.59.0 → 1.61.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 (420) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +4 -0
  5. data/lib/orb/models/account/billing_entity.rb +214 -0
  6. data/lib/orb/models/account/billing_entity_archive_by_external_id_params.rb +22 -0
  7. data/lib/orb/models/account/billing_entity_archive_params.rb +22 -0
  8. data/lib/orb/models/account/billing_entity_create_params.rb +117 -0
  9. data/lib/orb/models/account/billing_entity_fetch_by_external_id_params.rb +22 -0
  10. data/lib/orb/models/account/billing_entity_fetch_params.rb +22 -0
  11. data/lib/orb/models/account/billing_entity_list_params.rb +55 -0
  12. data/lib/orb/models/account/billing_entity_unarchive_by_external_id_params.rb +22 -0
  13. data/lib/orb/models/account/billing_entity_unarchive_params.rb +22 -0
  14. data/lib/orb/models/account/billing_entity_update_by_external_id_params.rb +177 -0
  15. data/lib/orb/models/account/billing_entity_update_params.rb +179 -0
  16. data/lib/orb/models/account/payment_gateway_connection.rb +75 -0
  17. data/lib/orb/models/account/payment_gateway_connection_fetch_params.rb +22 -0
  18. data/lib/orb/models/account/payment_gateway_connection_list_params.rb +65 -0
  19. data/lib/orb/models/alert.rb +9 -1
  20. data/lib/orb/models/changed_subscription_resources.rb +9 -1
  21. data/lib/orb/models/credit_note.rb +9 -1
  22. data/lib/orb/models/credit_note_list_params.rb +11 -1
  23. data/lib/orb/models/customer.rb +12 -3
  24. data/lib/orb/models/customer_create_params.rb +10 -1
  25. data/lib/orb/models/customer_credit_balance_depleted_webhook_event.rb +9 -1
  26. data/lib/orb/models/customer_credit_balance_dropped_webhook_event.rb +9 -1
  27. data/lib/orb/models/customer_credit_balance_recovered_webhook_event.rb +9 -1
  28. data/lib/orb/models/customer_edited_webhook_event.rb +8 -1
  29. data/lib/orb/models/customer_update_by_external_id_params.rb +10 -1
  30. data/lib/orb/models/customer_update_params.rb +10 -1
  31. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rb +7 -7
  32. data/lib/orb/models/customers/credits/ledger_create_entry_params.rb +7 -7
  33. data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +6 -4
  34. data/lib/orb/models/customers/credits/top_up_create_params.rb +6 -4
  35. data/lib/orb/models/customers/credits/top_up_invoice_settings.rb +6 -4
  36. data/lib/orb/models/customers/customer_payment_gateway_connection.rb +89 -0
  37. data/lib/orb/models/customers/payment_gateway_connection_create_by_external_id_params.rb +53 -0
  38. data/lib/orb/models/customers/payment_gateway_connection_create_params.rb +52 -0
  39. data/lib/orb/models/customers/payment_gateway_connection_delete_by_external_id_params.rb +28 -0
  40. data/lib/orb/models/customers/payment_gateway_connection_delete_params.rb +28 -0
  41. data/lib/orb/models/customers/payment_gateway_connection_list_by_external_id_params.rb +39 -0
  42. data/lib/orb/models/customers/payment_gateway_connection_list_by_external_id_response.rb +25 -0
  43. data/lib/orb/models/customers/payment_gateway_connection_list_params.rb +39 -0
  44. data/lib/orb/models/customers/payment_gateway_connection_list_response.rb +25 -0
  45. data/lib/orb/models/customers/payment_gateway_connection_update_by_external_id_params.rb +68 -0
  46. data/lib/orb/models/customers/payment_gateway_connection_update_params.rb +67 -0
  47. data/lib/orb/models/invoice.rb +9 -1
  48. data/lib/orb/models/invoice_create_params.rb +25 -7
  49. data/lib/orb/models/invoice_fetch_upcoming_response.rb +9 -1
  50. data/lib/orb/models/invoice_issue_summary_response.rb +9 -1
  51. data/lib/orb/models/invoice_issued_summary_webhook_event.rb +9 -1
  52. data/lib/orb/models/invoice_list_params.rb +11 -1
  53. data/lib/orb/models/invoice_list_summary_params.rb +11 -1
  54. data/lib/orb/models/invoice_list_summary_response.rb +9 -1
  55. data/lib/orb/models/invoice_update_params.rb +7 -6
  56. data/lib/orb/models/mutated_subscription.rb +16 -6
  57. data/lib/orb/models/payment_method_created_webhook_event.rb +3 -2
  58. data/lib/orb/models/payment_method_deleted_webhook_event.rb +3 -2
  59. data/lib/orb/models/plan.rb +26 -8
  60. data/lib/orb/models/plan_create_params.rb +15 -5
  61. data/lib/orb/models/plan_created_webhook_event.rb +9 -1
  62. data/lib/orb/models/plan_default_version_set_webhook_event.rb +9 -1
  63. data/lib/orb/models/plan_edited_webhook_event.rb +7 -1
  64. data/lib/orb/models/plan_update_params.rb +10 -1
  65. data/lib/orb/models/plan_version_created_webhook_event.rb +9 -1
  66. data/lib/orb/models/plans/external_plan_id_update_params.rb +10 -1
  67. data/lib/orb/models/subscription.rb +16 -6
  68. data/lib/orb/models/subscription_alert_disabled_webhook_event.rb +18 -2
  69. data/lib/orb/models/subscription_cost_exceeded_webhook_event.rb +9 -1
  70. data/lib/orb/models/subscription_create_params.rb +27 -5
  71. data/lib/orb/models/subscription_fetch_schedule_response.rb +9 -1
  72. data/lib/orb/models/subscription_grouped_cost_exceeded_webhook_event.rb +18 -2
  73. data/lib/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rb +9 -1
  74. data/lib/orb/models/subscription_license_allocation_reset_webhook_event.rb +9 -1
  75. data/lib/orb/models/subscription_license_balance_threshold_reached_webhook_event.rb +18 -2
  76. data/lib/orb/models/subscription_list_params.rb +11 -1
  77. data/lib/orb/models/subscription_list_summary_params.rb +11 -1
  78. data/lib/orb/models/subscription_list_summary_response.rb +9 -1
  79. data/lib/orb/models/subscription_schedule_plan_change_params.rb +7 -4
  80. data/lib/orb/models/subscription_spend_exceeded_webhook_event.rb +9 -1
  81. data/lib/orb/models/subscription_update_params.rb +7 -5
  82. data/lib/orb/models/subscription_usage_exceeded_webhook_event.rb +9 -1
  83. data/lib/orb/models/webhooks/customer_credit_balance_depleted_standard_webhook_event.rb +9 -1
  84. data/lib/orb/models/webhooks/customer_credit_balance_dropped_standard_webhook_event.rb +9 -1
  85. data/lib/orb/models/webhooks/customer_credit_balance_recovered_standard_webhook_event.rb +9 -1
  86. data/lib/orb/models/webhooks/customer_edited_standard_webhook_event.rb +8 -1
  87. data/lib/orb/models/webhooks/invoice_accounting_sync_failed_standard_webhook_event.rb +9 -1
  88. data/lib/orb/models/webhooks/invoice_accounting_sync_succeeded_standard_webhook_event.rb +9 -1
  89. data/lib/orb/models/webhooks/invoice_dunning_schedule_created_standard_webhook_event.rb +9 -1
  90. data/lib/orb/models/webhooks/invoice_dunning_schedule_ended_standard_webhook_event.rb +9 -1
  91. data/lib/orb/models/webhooks/invoice_dunning_schedule_reset_standard_webhook_event.rb +9 -1
  92. data/lib/orb/models/webhooks/invoice_dunning_schedule_step_executed_standard_webhook_event.rb +9 -1
  93. data/lib/orb/models/webhooks/invoice_edited_standard_webhook_event.rb +9 -1
  94. data/lib/orb/models/webhooks/invoice_issue_failed_standard_webhook_event.rb +9 -1
  95. data/lib/orb/models/webhooks/invoice_issued_standard_webhook_event.rb +9 -1
  96. data/lib/orb/models/webhooks/invoice_issued_summary_standard_webhook_event.rb +9 -1
  97. data/lib/orb/models/webhooks/invoice_manually_marked_as_paid_standard_webhook_event.rb +9 -1
  98. data/lib/orb/models/webhooks/invoice_manually_marked_as_void_standard_webhook_event.rb +9 -1
  99. data/lib/orb/models/webhooks/invoice_payment_failed_standard_webhook_event.rb +9 -1
  100. data/lib/orb/models/webhooks/invoice_payment_processing_standard_webhook_event.rb +9 -1
  101. data/lib/orb/models/webhooks/invoice_payment_succeeded_standard_webhook_event.rb +9 -1
  102. data/lib/orb/models/webhooks/invoice_sync_failed_standard_webhook_event.rb +9 -1
  103. data/lib/orb/models/webhooks/invoice_sync_succeeded_standard_webhook_event.rb +9 -1
  104. data/lib/orb/models/webhooks/invoice_undo_mark_as_paid_standard_webhook_event.rb +9 -1
  105. data/lib/orb/models/webhooks/payment_method_created_standard_webhook_event.rb +3 -2
  106. data/lib/orb/models/webhooks/payment_method_deleted_standard_webhook_event.rb +3 -2
  107. data/lib/orb/models/webhooks/plan_created_standard_webhook_event.rb +9 -1
  108. data/lib/orb/models/webhooks/plan_default_version_set_standard_webhook_event.rb +9 -1
  109. data/lib/orb/models/webhooks/plan_edited_standard_webhook_event.rb +7 -1
  110. data/lib/orb/models/webhooks/plan_version_created_standard_webhook_event.rb +9 -1
  111. data/lib/orb/models/webhooks/sales_order_accounting_sync_failed_standard_webhook_event.rb +9 -1
  112. data/lib/orb/models/webhooks/sales_order_accounting_sync_succeeded_standard_webhook_event.rb +9 -1
  113. data/lib/orb/models/webhooks/subscription_accounting_sync_failed_standard_webhook_event.rb +9 -1
  114. data/lib/orb/models/webhooks/subscription_accounting_sync_succeeded_standard_webhook_event.rb +9 -1
  115. data/lib/orb/models/webhooks/subscription_alert_disabled_standard_webhook_event.rb +18 -2
  116. data/lib/orb/models/webhooks/subscription_cancellation_scheduled_standard_webhook_event.rb +9 -1
  117. data/lib/orb/models/webhooks/subscription_cancellation_unscheduled_standard_webhook_event.rb +9 -1
  118. data/lib/orb/models/webhooks/subscription_cost_exceeded_standard_webhook_event.rb +18 -2
  119. data/lib/orb/models/webhooks/subscription_created_standard_webhook_event.rb +9 -1
  120. data/lib/orb/models/webhooks/subscription_edited_standard_webhook_event.rb +9 -1
  121. data/lib/orb/models/webhooks/subscription_ended_standard_webhook_event.rb +9 -1
  122. data/lib/orb/models/webhooks/subscription_fixed_fee_quantity_updated_standard_webhook_event.rb +9 -1
  123. data/lib/orb/models/webhooks/subscription_grouped_cost_exceeded_standard_webhook_event.rb +18 -2
  124. data/lib/orb/models/webhooks/subscription_invoicing_threshold_exceeded_standard_webhook_event.rb +9 -1
  125. data/lib/orb/models/webhooks/subscription_license_allocation_reset_standard_webhook_event.rb +9 -1
  126. data/lib/orb/models/webhooks/subscription_license_balance_threshold_reached_standard_webhook_event.rb +18 -2
  127. data/lib/orb/models/webhooks/subscription_plan_change_scheduled_standard_webhook_event.rb +9 -1
  128. data/lib/orb/models/webhooks/subscription_plan_changed_standard_webhook_event.rb +9 -1
  129. data/lib/orb/models/webhooks/subscription_plan_version_change_scheduled_standard_webhook_event.rb +9 -1
  130. data/lib/orb/models/webhooks/subscription_plan_version_changed_standard_webhook_event.rb +9 -1
  131. data/lib/orb/models/webhooks/subscription_spend_exceeded_standard_webhook_event.rb +18 -2
  132. data/lib/orb/models/webhooks/subscription_started_standard_webhook_event.rb +9 -1
  133. data/lib/orb/models/webhooks/subscription_trial_ended_standard_webhook_event.rb +9 -1
  134. data/lib/orb/models/webhooks/subscription_usage_exceeded_standard_webhook_event.rb +18 -2
  135. data/lib/orb/models.rb +2 -0
  136. data/lib/orb/resources/account/billing_entities.rb +321 -0
  137. data/lib/orb/resources/account/payment_gateway_connections.rb +71 -0
  138. data/lib/orb/resources/account.rb +26 -0
  139. data/lib/orb/resources/credit_notes.rb +4 -3
  140. data/lib/orb/resources/customers/payment_gateway_connections.rb +310 -0
  141. data/lib/orb/resources/customers.rb +31 -3
  142. data/lib/orb/resources/invoices.rb +13 -5
  143. data/lib/orb/resources/plans/external_plan_id.rb +3 -1
  144. data/lib/orb/resources/plans.rb +7 -3
  145. data/lib/orb/resources/subscriptions.rb +14 -6
  146. data/lib/orb/version.rb +1 -1
  147. data/lib/orb.rb +29 -0
  148. data/rbi/orb/client.rbi +3 -0
  149. data/rbi/orb/models/account/billing_entity.rbi +342 -0
  150. data/rbi/orb/models/account/billing_entity_archive_by_external_id_params.rbi +43 -0
  151. data/rbi/orb/models/account/billing_entity_archive_params.rbi +40 -0
  152. data/rbi/orb/models/account/billing_entity_create_params.rbi +208 -0
  153. data/rbi/orb/models/account/billing_entity_fetch_by_external_id_params.rbi +43 -0
  154. data/rbi/orb/models/account/billing_entity_fetch_params.rbi +40 -0
  155. data/rbi/orb/models/account/billing_entity_list_params.rbi +108 -0
  156. data/rbi/orb/models/account/billing_entity_unarchive_by_external_id_params.rbi +43 -0
  157. data/rbi/orb/models/account/billing_entity_unarchive_params.rbi +40 -0
  158. data/rbi/orb/models/account/billing_entity_update_by_external_id_params.rbi +335 -0
  159. data/rbi/orb/models/account/billing_entity_update_params.rbi +331 -0
  160. data/rbi/orb/models/account/payment_gateway_connection.rbi +125 -0
  161. data/rbi/orb/models/account/payment_gateway_connection_fetch_params.rbi +43 -0
  162. data/rbi/orb/models/account/payment_gateway_connection_list_params.rbi +124 -0
  163. data/rbi/orb/models/alert.rbi +11 -3
  164. data/rbi/orb/models/changed_subscription_resources.rbi +8 -0
  165. data/rbi/orb/models/credit_note.rbi +8 -0
  166. data/rbi/orb/models/credit_note_list_params.rbi +12 -0
  167. data/rbi/orb/models/customer.rbi +12 -2
  168. data/rbi/orb/models/customer_create_params.rbi +10 -0
  169. data/rbi/orb/models/customer_credit_balance_depleted_webhook_event.rbi +11 -3
  170. data/rbi/orb/models/customer_credit_balance_dropped_webhook_event.rbi +11 -3
  171. data/rbi/orb/models/customer_credit_balance_recovered_webhook_event.rbi +11 -3
  172. data/rbi/orb/models/customer_edited_webhook_event.rbi +6 -0
  173. data/rbi/orb/models/customer_update_by_external_id_params.rbi +10 -0
  174. data/rbi/orb/models/customer_update_params.rbi +10 -0
  175. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_params.rbi +12 -12
  176. data/rbi/orb/models/customers/credits/ledger_create_entry_params.rbi +12 -12
  177. data/rbi/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +10 -6
  178. data/rbi/orb/models/customers/credits/top_up_create_params.rbi +10 -6
  179. data/rbi/orb/models/customers/credits/top_up_invoice_settings.rbi +10 -6
  180. data/rbi/orb/models/customers/customer_payment_gateway_connection.rbi +139 -0
  181. data/rbi/orb/models/customers/payment_gateway_connection_create_by_external_id_params.rbi +77 -0
  182. data/rbi/orb/models/customers/payment_gateway_connection_create_params.rbi +77 -0
  183. data/rbi/orb/models/customers/payment_gateway_connection_delete_by_external_id_params.rbi +52 -0
  184. data/rbi/orb/models/customers/payment_gateway_connection_delete_params.rbi +52 -0
  185. data/rbi/orb/models/customers/payment_gateway_connection_list_by_external_id_params.rbi +62 -0
  186. data/rbi/orb/models/customers/payment_gateway_connection_list_by_external_id_response.rbi +47 -0
  187. data/rbi/orb/models/customers/payment_gateway_connection_list_params.rbi +62 -0
  188. data/rbi/orb/models/customers/payment_gateway_connection_list_response.rbi +47 -0
  189. data/rbi/orb/models/customers/payment_gateway_connection_update_by_external_id_params.rbi +120 -0
  190. data/rbi/orb/models/customers/payment_gateway_connection_update_params.rbi +120 -0
  191. data/rbi/orb/models/invoice.rbi +8 -0
  192. data/rbi/orb/models/invoice_create_params.rbi +30 -10
  193. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +8 -0
  194. data/rbi/orb/models/invoice_issue_summary_response.rbi +8 -0
  195. data/rbi/orb/models/invoice_issued_summary_webhook_event.rbi +8 -0
  196. data/rbi/orb/models/invoice_list_params.rbi +12 -0
  197. data/rbi/orb/models/invoice_list_summary_params.rbi +12 -0
  198. data/rbi/orb/models/invoice_list_summary_response.rbi +8 -0
  199. data/rbi/orb/models/invoice_update_params.rbi +12 -10
  200. data/rbi/orb/models/mutated_subscription.rbi +20 -8
  201. data/rbi/orb/models/payment_method_created_webhook_event.rbi +4 -2
  202. data/rbi/orb/models/payment_method_deleted_webhook_event.rbi +4 -2
  203. data/rbi/orb/models/plan.rbi +33 -13
  204. data/rbi/orb/models/plan_create_params.rbi +18 -6
  205. data/rbi/orb/models/plan_created_webhook_event.rbi +11 -3
  206. data/rbi/orb/models/plan_default_version_set_webhook_event.rbi +11 -3
  207. data/rbi/orb/models/plan_edited_webhook_event.rbi +6 -0
  208. data/rbi/orb/models/plan_update_params.rbi +10 -0
  209. data/rbi/orb/models/plan_version_created_webhook_event.rbi +11 -3
  210. data/rbi/orb/models/plans/external_plan_id_update_params.rbi +10 -0
  211. data/rbi/orb/models/subscription.rbi +20 -8
  212. data/rbi/orb/models/subscription_alert_disabled_webhook_event.rbi +22 -6
  213. data/rbi/orb/models/subscription_cost_exceeded_webhook_event.rbi +11 -3
  214. data/rbi/orb/models/subscription_create_params.rbi +34 -6
  215. data/rbi/orb/models/subscription_fetch_schedule_response.rbi +11 -3
  216. data/rbi/orb/models/subscription_grouped_cost_exceeded_webhook_event.rbi +22 -6
  217. data/rbi/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rbi +11 -3
  218. data/rbi/orb/models/subscription_license_allocation_reset_webhook_event.rbi +11 -3
  219. data/rbi/orb/models/subscription_license_balance_threshold_reached_webhook_event.rbi +22 -6
  220. data/rbi/orb/models/subscription_list_params.rbi +12 -0
  221. data/rbi/orb/models/subscription_list_summary_params.rbi +12 -0
  222. data/rbi/orb/models/subscription_list_summary_response.rbi +11 -3
  223. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +12 -6
  224. data/rbi/orb/models/subscription_spend_exceeded_webhook_event.rbi +11 -3
  225. data/rbi/orb/models/subscription_update_params.rbi +12 -8
  226. data/rbi/orb/models/subscription_usage_exceeded_webhook_event.rbi +11 -3
  227. data/rbi/orb/models/webhooks/customer_credit_balance_depleted_standard_webhook_event.rbi +11 -3
  228. data/rbi/orb/models/webhooks/customer_credit_balance_dropped_standard_webhook_event.rbi +11 -3
  229. data/rbi/orb/models/webhooks/customer_credit_balance_recovered_standard_webhook_event.rbi +11 -3
  230. data/rbi/orb/models/webhooks/customer_edited_standard_webhook_event.rbi +6 -0
  231. data/rbi/orb/models/webhooks/invoice_accounting_sync_failed_standard_webhook_event.rbi +8 -0
  232. data/rbi/orb/models/webhooks/invoice_accounting_sync_succeeded_standard_webhook_event.rbi +8 -0
  233. data/rbi/orb/models/webhooks/invoice_dunning_schedule_created_standard_webhook_event.rbi +8 -0
  234. data/rbi/orb/models/webhooks/invoice_dunning_schedule_ended_standard_webhook_event.rbi +8 -0
  235. data/rbi/orb/models/webhooks/invoice_dunning_schedule_reset_standard_webhook_event.rbi +8 -0
  236. data/rbi/orb/models/webhooks/invoice_dunning_schedule_step_executed_standard_webhook_event.rbi +8 -0
  237. data/rbi/orb/models/webhooks/invoice_edited_standard_webhook_event.rbi +8 -0
  238. data/rbi/orb/models/webhooks/invoice_issue_failed_standard_webhook_event.rbi +8 -0
  239. data/rbi/orb/models/webhooks/invoice_issued_standard_webhook_event.rbi +8 -0
  240. data/rbi/orb/models/webhooks/invoice_issued_summary_standard_webhook_event.rbi +8 -0
  241. data/rbi/orb/models/webhooks/invoice_manually_marked_as_paid_standard_webhook_event.rbi +8 -0
  242. data/rbi/orb/models/webhooks/invoice_manually_marked_as_void_standard_webhook_event.rbi +8 -0
  243. data/rbi/orb/models/webhooks/invoice_payment_failed_standard_webhook_event.rbi +8 -0
  244. data/rbi/orb/models/webhooks/invoice_payment_processing_standard_webhook_event.rbi +8 -0
  245. data/rbi/orb/models/webhooks/invoice_payment_succeeded_standard_webhook_event.rbi +8 -0
  246. data/rbi/orb/models/webhooks/invoice_sync_failed_standard_webhook_event.rbi +8 -0
  247. data/rbi/orb/models/webhooks/invoice_sync_succeeded_standard_webhook_event.rbi +8 -0
  248. data/rbi/orb/models/webhooks/invoice_undo_mark_as_paid_standard_webhook_event.rbi +8 -0
  249. data/rbi/orb/models/webhooks/payment_method_created_standard_webhook_event.rbi +4 -2
  250. data/rbi/orb/models/webhooks/payment_method_deleted_standard_webhook_event.rbi +4 -2
  251. data/rbi/orb/models/webhooks/plan_created_standard_webhook_event.rbi +11 -3
  252. data/rbi/orb/models/webhooks/plan_default_version_set_standard_webhook_event.rbi +11 -3
  253. data/rbi/orb/models/webhooks/plan_edited_standard_webhook_event.rbi +6 -0
  254. data/rbi/orb/models/webhooks/plan_version_created_standard_webhook_event.rbi +11 -3
  255. data/rbi/orb/models/webhooks/sales_order_accounting_sync_failed_standard_webhook_event.rbi +8 -0
  256. data/rbi/orb/models/webhooks/sales_order_accounting_sync_succeeded_standard_webhook_event.rbi +8 -0
  257. data/rbi/orb/models/webhooks/subscription_accounting_sync_failed_standard_webhook_event.rbi +11 -3
  258. data/rbi/orb/models/webhooks/subscription_accounting_sync_succeeded_standard_webhook_event.rbi +11 -3
  259. data/rbi/orb/models/webhooks/subscription_alert_disabled_standard_webhook_event.rbi +22 -6
  260. data/rbi/orb/models/webhooks/subscription_cancellation_scheduled_standard_webhook_event.rbi +11 -3
  261. data/rbi/orb/models/webhooks/subscription_cancellation_unscheduled_standard_webhook_event.rbi +11 -3
  262. data/rbi/orb/models/webhooks/subscription_cost_exceeded_standard_webhook_event.rbi +22 -6
  263. data/rbi/orb/models/webhooks/subscription_created_standard_webhook_event.rbi +11 -3
  264. data/rbi/orb/models/webhooks/subscription_edited_standard_webhook_event.rbi +11 -3
  265. data/rbi/orb/models/webhooks/subscription_ended_standard_webhook_event.rbi +11 -3
  266. data/rbi/orb/models/webhooks/subscription_fixed_fee_quantity_updated_standard_webhook_event.rbi +11 -3
  267. data/rbi/orb/models/webhooks/subscription_grouped_cost_exceeded_standard_webhook_event.rbi +22 -6
  268. data/rbi/orb/models/webhooks/subscription_invoicing_threshold_exceeded_standard_webhook_event.rbi +11 -3
  269. data/rbi/orb/models/webhooks/subscription_license_allocation_reset_standard_webhook_event.rbi +11 -3
  270. data/rbi/orb/models/webhooks/subscription_license_balance_threshold_reached_standard_webhook_event.rbi +22 -6
  271. data/rbi/orb/models/webhooks/subscription_plan_change_scheduled_standard_webhook_event.rbi +11 -3
  272. data/rbi/orb/models/webhooks/subscription_plan_changed_standard_webhook_event.rbi +11 -3
  273. data/rbi/orb/models/webhooks/subscription_plan_version_change_scheduled_standard_webhook_event.rbi +11 -3
  274. data/rbi/orb/models/webhooks/subscription_plan_version_changed_standard_webhook_event.rbi +11 -3
  275. data/rbi/orb/models/webhooks/subscription_spend_exceeded_standard_webhook_event.rbi +22 -6
  276. data/rbi/orb/models/webhooks/subscription_started_standard_webhook_event.rbi +11 -3
  277. data/rbi/orb/models/webhooks/subscription_trial_ended_standard_webhook_event.rbi +11 -3
  278. data/rbi/orb/models/webhooks/subscription_usage_exceeded_standard_webhook_event.rbi +22 -6
  279. data/rbi/orb/models.rbi +2 -0
  280. data/rbi/orb/resources/account/billing_entities.rbi +289 -0
  281. data/rbi/orb/resources/account/payment_gateway_connections.rbi +54 -0
  282. data/rbi/orb/resources/account.rbi +22 -0
  283. data/rbi/orb/resources/credit_notes.rbi +6 -2
  284. data/rbi/orb/resources/customers/payment_gateway_connections.rbi +234 -0
  285. data/rbi/orb/resources/customers.rbi +33 -0
  286. data/rbi/orb/resources/invoices.rbi +29 -10
  287. data/rbi/orb/resources/plans/external_plan_id.rbi +4 -0
  288. data/rbi/orb/resources/plans.rbi +12 -3
  289. data/rbi/orb/resources/subscriptions.rbi +37 -10
  290. data/sig/orb/client.rbs +2 -0
  291. data/sig/orb/models/account/billing_entity.rbs +155 -0
  292. data/sig/orb/models/account/billing_entity_archive_by_external_id_params.rbs +26 -0
  293. data/sig/orb/models/account/billing_entity_archive_params.rbs +25 -0
  294. data/sig/orb/models/account/billing_entity_create_params.rbs +86 -0
  295. data/sig/orb/models/account/billing_entity_fetch_by_external_id_params.rbs +26 -0
  296. data/sig/orb/models/account/billing_entity_fetch_params.rbs +25 -0
  297. data/sig/orb/models/account/billing_entity_list_params.rbs +51 -0
  298. data/sig/orb/models/account/billing_entity_unarchive_by_external_id_params.rbs +26 -0
  299. data/sig/orb/models/account/billing_entity_unarchive_params.rbs +25 -0
  300. data/sig/orb/models/account/billing_entity_update_by_external_id_params.rbs +125 -0
  301. data/sig/orb/models/account/billing_entity_update_params.rbs +125 -0
  302. data/sig/orb/models/account/payment_gateway_connection.rbs +58 -0
  303. data/sig/orb/models/account/payment_gateway_connection_fetch_params.rbs +26 -0
  304. data/sig/orb/models/account/payment_gateway_connection_list_params.rbs +56 -0
  305. data/sig/orb/models/alert.rbs +8 -3
  306. data/sig/orb/models/changed_subscription_resources.rbs +5 -0
  307. data/sig/orb/models/credit_note.rbs +5 -0
  308. data/sig/orb/models/credit_note_list_params.rbs +5 -0
  309. data/sig/orb/models/customer.rbs +5 -0
  310. data/sig/orb/models/customer_create_params.rbs +5 -0
  311. data/sig/orb/models/customer_credit_balance_depleted_webhook_event.rbs +8 -3
  312. data/sig/orb/models/customer_credit_balance_dropped_webhook_event.rbs +8 -3
  313. data/sig/orb/models/customer_credit_balance_recovered_webhook_event.rbs +8 -3
  314. data/sig/orb/models/customer_edited_webhook_event.rbs +5 -0
  315. data/sig/orb/models/customer_update_by_external_id_params.rbs +5 -0
  316. data/sig/orb/models/customer_update_params.rbs +5 -0
  317. data/sig/orb/models/customers/customer_payment_gateway_connection.rbs +65 -0
  318. data/sig/orb/models/customers/payment_gateway_connection_create_by_external_id_params.rbs +45 -0
  319. data/sig/orb/models/customers/payment_gateway_connection_create_params.rbs +45 -0
  320. data/sig/orb/models/customers/payment_gateway_connection_delete_by_external_id_params.rbs +30 -0
  321. data/sig/orb/models/customers/payment_gateway_connection_delete_params.rbs +30 -0
  322. data/sig/orb/models/customers/payment_gateway_connection_list_by_external_id_params.rbs +38 -0
  323. data/sig/orb/models/customers/payment_gateway_connection_list_by_external_id_response.rbs +27 -0
  324. data/sig/orb/models/customers/payment_gateway_connection_list_params.rbs +38 -0
  325. data/sig/orb/models/customers/payment_gateway_connection_list_response.rbs +27 -0
  326. data/sig/orb/models/customers/payment_gateway_connection_update_by_external_id_params.rbs +53 -0
  327. data/sig/orb/models/customers/payment_gateway_connection_update_params.rbs +53 -0
  328. data/sig/orb/models/invoice.rbs +5 -0
  329. data/sig/orb/models/invoice_create_params.rbs +10 -0
  330. data/sig/orb/models/invoice_fetch_upcoming_response.rbs +5 -0
  331. data/sig/orb/models/invoice_issue_summary_response.rbs +5 -0
  332. data/sig/orb/models/invoice_issued_summary_webhook_event.rbs +5 -0
  333. data/sig/orb/models/invoice_list_params.rbs +5 -0
  334. data/sig/orb/models/invoice_list_summary_params.rbs +5 -0
  335. data/sig/orb/models/invoice_list_summary_response.rbs +5 -0
  336. data/sig/orb/models/mutated_subscription.rbs +5 -0
  337. data/sig/orb/models/plan.rbs +18 -3
  338. data/sig/orb/models/plan_create_params.rbs +5 -0
  339. data/sig/orb/models/plan_created_webhook_event.rbs +13 -3
  340. data/sig/orb/models/plan_default_version_set_webhook_event.rbs +13 -3
  341. data/sig/orb/models/plan_edited_webhook_event.rbs +5 -0
  342. data/sig/orb/models/plan_update_params.rbs +5 -0
  343. data/sig/orb/models/plan_version_created_webhook_event.rbs +13 -3
  344. data/sig/orb/models/plans/external_plan_id_update_params.rbs +5 -0
  345. data/sig/orb/models/subscription.rbs +5 -0
  346. data/sig/orb/models/subscription_alert_disabled_webhook_event.rbs +21 -6
  347. data/sig/orb/models/subscription_cost_exceeded_webhook_event.rbs +8 -3
  348. data/sig/orb/models/subscription_create_params.rbs +10 -0
  349. data/sig/orb/models/subscription_fetch_schedule_response.rbs +13 -3
  350. data/sig/orb/models/subscription_grouped_cost_exceeded_webhook_event.rbs +21 -6
  351. data/sig/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rbs +13 -3
  352. data/sig/orb/models/subscription_license_allocation_reset_webhook_event.rbs +13 -3
  353. data/sig/orb/models/subscription_license_balance_threshold_reached_webhook_event.rbs +21 -6
  354. data/sig/orb/models/subscription_list_params.rbs +5 -0
  355. data/sig/orb/models/subscription_list_summary_params.rbs +5 -0
  356. data/sig/orb/models/subscription_list_summary_response.rbs +13 -3
  357. data/sig/orb/models/subscription_spend_exceeded_webhook_event.rbs +8 -3
  358. data/sig/orb/models/subscription_usage_exceeded_webhook_event.rbs +8 -3
  359. data/sig/orb/models/webhooks/customer_credit_balance_depleted_standard_webhook_event.rbs +8 -3
  360. data/sig/orb/models/webhooks/customer_credit_balance_dropped_standard_webhook_event.rbs +8 -3
  361. data/sig/orb/models/webhooks/customer_credit_balance_recovered_standard_webhook_event.rbs +8 -3
  362. data/sig/orb/models/webhooks/customer_edited_standard_webhook_event.rbs +5 -0
  363. data/sig/orb/models/webhooks/invoice_accounting_sync_failed_standard_webhook_event.rbs +5 -0
  364. data/sig/orb/models/webhooks/invoice_accounting_sync_succeeded_standard_webhook_event.rbs +5 -0
  365. data/sig/orb/models/webhooks/invoice_dunning_schedule_created_standard_webhook_event.rbs +5 -0
  366. data/sig/orb/models/webhooks/invoice_dunning_schedule_ended_standard_webhook_event.rbs +5 -0
  367. data/sig/orb/models/webhooks/invoice_dunning_schedule_reset_standard_webhook_event.rbs +5 -0
  368. data/sig/orb/models/webhooks/invoice_dunning_schedule_step_executed_standard_webhook_event.rbs +5 -0
  369. data/sig/orb/models/webhooks/invoice_edited_standard_webhook_event.rbs +5 -0
  370. data/sig/orb/models/webhooks/invoice_issue_failed_standard_webhook_event.rbs +5 -0
  371. data/sig/orb/models/webhooks/invoice_issued_standard_webhook_event.rbs +5 -0
  372. data/sig/orb/models/webhooks/invoice_issued_summary_standard_webhook_event.rbs +5 -0
  373. data/sig/orb/models/webhooks/invoice_manually_marked_as_paid_standard_webhook_event.rbs +5 -0
  374. data/sig/orb/models/webhooks/invoice_manually_marked_as_void_standard_webhook_event.rbs +5 -0
  375. data/sig/orb/models/webhooks/invoice_payment_failed_standard_webhook_event.rbs +5 -0
  376. data/sig/orb/models/webhooks/invoice_payment_processing_standard_webhook_event.rbs +5 -0
  377. data/sig/orb/models/webhooks/invoice_payment_succeeded_standard_webhook_event.rbs +5 -0
  378. data/sig/orb/models/webhooks/invoice_sync_failed_standard_webhook_event.rbs +5 -0
  379. data/sig/orb/models/webhooks/invoice_sync_succeeded_standard_webhook_event.rbs +5 -0
  380. data/sig/orb/models/webhooks/invoice_undo_mark_as_paid_standard_webhook_event.rbs +5 -0
  381. data/sig/orb/models/webhooks/plan_created_standard_webhook_event.rbs +13 -3
  382. data/sig/orb/models/webhooks/plan_default_version_set_standard_webhook_event.rbs +13 -3
  383. data/sig/orb/models/webhooks/plan_edited_standard_webhook_event.rbs +5 -0
  384. data/sig/orb/models/webhooks/plan_version_created_standard_webhook_event.rbs +13 -3
  385. data/sig/orb/models/webhooks/sales_order_accounting_sync_failed_standard_webhook_event.rbs +5 -0
  386. data/sig/orb/models/webhooks/sales_order_accounting_sync_succeeded_standard_webhook_event.rbs +5 -0
  387. data/sig/orb/models/webhooks/subscription_accounting_sync_failed_standard_webhook_event.rbs +13 -3
  388. data/sig/orb/models/webhooks/subscription_accounting_sync_succeeded_standard_webhook_event.rbs +13 -3
  389. data/sig/orb/models/webhooks/subscription_alert_disabled_standard_webhook_event.rbs +21 -6
  390. data/sig/orb/models/webhooks/subscription_cancellation_scheduled_standard_webhook_event.rbs +13 -3
  391. data/sig/orb/models/webhooks/subscription_cancellation_unscheduled_standard_webhook_event.rbs +13 -3
  392. data/sig/orb/models/webhooks/subscription_cost_exceeded_standard_webhook_event.rbs +21 -6
  393. data/sig/orb/models/webhooks/subscription_created_standard_webhook_event.rbs +13 -3
  394. data/sig/orb/models/webhooks/subscription_edited_standard_webhook_event.rbs +13 -3
  395. data/sig/orb/models/webhooks/subscription_ended_standard_webhook_event.rbs +13 -3
  396. data/sig/orb/models/webhooks/subscription_fixed_fee_quantity_updated_standard_webhook_event.rbs +13 -3
  397. data/sig/orb/models/webhooks/subscription_grouped_cost_exceeded_standard_webhook_event.rbs +21 -6
  398. data/sig/orb/models/webhooks/subscription_invoicing_threshold_exceeded_standard_webhook_event.rbs +13 -3
  399. data/sig/orb/models/webhooks/subscription_license_allocation_reset_standard_webhook_event.rbs +13 -3
  400. data/sig/orb/models/webhooks/subscription_license_balance_threshold_reached_standard_webhook_event.rbs +21 -6
  401. data/sig/orb/models/webhooks/subscription_plan_change_scheduled_standard_webhook_event.rbs +13 -3
  402. data/sig/orb/models/webhooks/subscription_plan_changed_standard_webhook_event.rbs +13 -3
  403. data/sig/orb/models/webhooks/subscription_plan_version_change_scheduled_standard_webhook_event.rbs +13 -3
  404. data/sig/orb/models/webhooks/subscription_plan_version_changed_standard_webhook_event.rbs +13 -3
  405. data/sig/orb/models/webhooks/subscription_spend_exceeded_standard_webhook_event.rbs +21 -6
  406. data/sig/orb/models/webhooks/subscription_started_standard_webhook_event.rbs +13 -3
  407. data/sig/orb/models/webhooks/subscription_trial_ended_standard_webhook_event.rbs +13 -3
  408. data/sig/orb/models/webhooks/subscription_usage_exceeded_standard_webhook_event.rbs +21 -6
  409. data/sig/orb/models.rbs +2 -0
  410. data/sig/orb/resources/account/billing_entities.rbs +80 -0
  411. data/sig/orb/resources/account/payment_gateway_connections.rbs +22 -0
  412. data/sig/orb/resources/account.rbs +11 -0
  413. data/sig/orb/resources/credit_notes.rbs +1 -0
  414. data/sig/orb/resources/customers/payment_gateway_connections.rbs +67 -0
  415. data/sig/orb/resources/customers.rbs +5 -0
  416. data/sig/orb/resources/invoices.rbs +4 -0
  417. data/sig/orb/resources/plans/external_plan_id.rbs +1 -0
  418. data/sig/orb/resources/plans.rbs +2 -0
  419. data/sig/orb/resources/subscriptions.rbs +4 -0
  420. metadata +88 -1
data/lib/orb/models.rb CHANGED
@@ -39,6 +39,8 @@ module Orb
39
39
  mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
40
40
  end
41
41
 
42
+ Account = Orb::Models::Account
43
+
42
44
  AccountingProviderConfig = Orb::Models::AccountingProviderConfig
43
45
 
44
46
  Address = Orb::Models::Address
@@ -0,0 +1,321 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Resources
5
+ class Account
6
+ # A billing entity is a legal entity an account invoices from, with its own legal
7
+ # name, address and tax registrations.
8
+ class BillingEntities
9
+ # Some parameter documentations has been truncated, see
10
+ # {Orb::Models::Account::BillingEntityCreateParams} for more details.
11
+ #
12
+ # This endpoint creates a billing entity: a legal entity the account invoices
13
+ # from, with its own legal name, address, tax registrations, and invoice settings.
14
+ # `external_billing_entity_id` cannot be changed after creation. This endpoint
15
+ # requires an admin API key.
16
+ #
17
+ # @overload create(address:, legal_name:, name:, external_billing_entity_id: nil, invoice_settings: nil, tax_registrations: nil, request_options: {})
18
+ #
19
+ # @param address [Orb::Models::AddressInput] The address printed on invoices.
20
+ #
21
+ # @param legal_name [String] The legal name printed on invoices.
22
+ #
23
+ # @param name [String] An internal name for the billing entity.
24
+ #
25
+ # @param external_billing_entity_id [String, nil] An optional user-defined ID for this billing entity, unique within the account.
26
+ #
27
+ # @param invoice_settings [Orb::Models::Account::BillingEntityCreateParams::InvoiceSettings, nil] Settings that override the account's for this billing entity.
28
+ #
29
+ # @param tax_registrations [Array<Orb::Models::Account::BillingEntityCreateParams::TaxRegistration>]
30
+ #
31
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
32
+ #
33
+ # @return [Orb::Models::Account::BillingEntity]
34
+ #
35
+ # @see Orb::Models::Account::BillingEntityCreateParams
36
+ def create(params)
37
+ parsed, options = Orb::Account::BillingEntityCreateParams.dump_request(params)
38
+ @client.request(
39
+ method: :post,
40
+ path: "account/billing_entities",
41
+ body: parsed,
42
+ model: Orb::Account::BillingEntity,
43
+ options: options
44
+ )
45
+ end
46
+
47
+ # Some parameter documentations has been truncated, see
48
+ # {Orb::Models::Account::BillingEntityUpdateParams} for more details.
49
+ #
50
+ # This endpoint updates a billing entity, including the default one. Omitted
51
+ # fields keep their value. A change to the name, legal name, address, or tax
52
+ # registrations writes a new version of the billing entity; invoices already
53
+ # issued keep the version they were issued with. In `invoice_settings`, a null
54
+ # `memo` clears it so the billing entity uses the account's memo. An archived
55
+ # billing entity cannot be updated until it is unarchived. This endpoint requires
56
+ # an admin API key.
57
+ #
58
+ # `payment_gateway_connections` is the full set of connections the billing entity
59
+ # collects payments through; a connection left out is disconnected from the
60
+ # billing entity. If a payment through a connection left out is still in progress,
61
+ # the whole update is rejected and can be retried once the payment finishes.
62
+ #
63
+ # @overload update(billing_entity_id, address: nil, default_payment_gateway_connection_id: nil, invoice_settings: nil, legal_name: nil, name: nil, payment_gateway_connections: nil, tax_registrations: nil, request_options: {})
64
+ #
65
+ # @param billing_entity_id [String]
66
+ #
67
+ # @param address [Orb::Models::AddressInput, nil] Replaces the whole address. Omit it to keep the current one.
68
+ #
69
+ # @param default_payment_gateway_connection_id [String, nil] The ID of the connection Orb charges when the customer is not mapped to any of t
70
+ #
71
+ # @param invoice_settings [Orb::Models::Account::BillingEntityUpdateParams::InvoiceSettings, nil] The invoice settings to change. Omitted fields keep their value; null clears a f
72
+ #
73
+ # @param legal_name [String, nil] The legal name printed on invoices.
74
+ #
75
+ # @param name [String, nil] An internal name for the billing entity.
76
+ #
77
+ # @param payment_gateway_connections [Array<Orb::Models::Account::BillingEntityUpdateParams::PaymentGatewayConnection>, nil] The full set of payment gateway connections the billing entity collects payments
78
+ #
79
+ # @param tax_registrations [Array<Orb::Models::Account::BillingEntityUpdateParams::TaxRegistration>, nil] The full list of registrations. Omit it to keep the current ones.
80
+ #
81
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
82
+ #
83
+ # @return [Orb::Models::Account::BillingEntity]
84
+ #
85
+ # @see Orb::Models::Account::BillingEntityUpdateParams
86
+ def update(billing_entity_id, params = {})
87
+ parsed, options = Orb::Account::BillingEntityUpdateParams.dump_request(params)
88
+ @client.request(
89
+ method: :put,
90
+ path: ["account/billing_entities/%1$s", billing_entity_id],
91
+ body: parsed,
92
+ model: Orb::Account::BillingEntity,
93
+ options: options
94
+ )
95
+ end
96
+
97
+ # Some parameter documentations has been truncated, see
98
+ # {Orb::Models::Account::BillingEntityListParams} for more details.
99
+ #
100
+ # This endpoint returns the account's billing entities, including the default
101
+ # billing entity (`is_default: true`), ordered in descending order by creation
102
+ # time.
103
+ #
104
+ # @overload list(cursor: nil, limit: nil, status: nil, request_options: {})
105
+ #
106
+ # @param cursor [String, nil] Cursor for pagination. This can be populated by the `next_cursor` value returned
107
+ #
108
+ # @param limit [Integer] The number of items to fetch. Defaults to 20.
109
+ #
110
+ # @param status [Symbol, Orb::Models::Account::BillingEntityListParams::Status, nil] Only return billing entities with this status. Omit to return both.
111
+ #
112
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
113
+ #
114
+ # @return [Orb::Internal::Page<Orb::Models::Account::BillingEntity>]
115
+ #
116
+ # @see Orb::Models::Account::BillingEntityListParams
117
+ def list(params = {})
118
+ parsed, options = Orb::Account::BillingEntityListParams.dump_request(params)
119
+ query = Orb::Internal::Util.encode_query_params(parsed)
120
+ @client.request(
121
+ method: :get,
122
+ path: "account/billing_entities",
123
+ query: query,
124
+ page: Orb::Internal::Page,
125
+ model: Orb::Account::BillingEntity,
126
+ options: options
127
+ )
128
+ end
129
+
130
+ # This endpoint archives a billing entity. An archived billing entity cannot be
131
+ # updated; invoices already issued keep it. The default billing entity cannot be
132
+ # archived. Archiving a billing entity that is already archived returns it
133
+ # unchanged. This endpoint requires an admin API key.
134
+ #
135
+ # @overload archive(billing_entity_id, request_options: {})
136
+ #
137
+ # @param billing_entity_id [String]
138
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
139
+ #
140
+ # @return [Orb::Models::Account::BillingEntity]
141
+ #
142
+ # @see Orb::Models::Account::BillingEntityArchiveParams
143
+ def archive(billing_entity_id, params = {})
144
+ @client.request(
145
+ method: :post,
146
+ path: ["account/billing_entities/%1$s/archive", billing_entity_id],
147
+ model: Orb::Account::BillingEntity,
148
+ options: params[:request_options]
149
+ )
150
+ end
151
+
152
+ # This endpoint archives a billing entity. An archived billing entity cannot be
153
+ # updated; invoices already issued keep it. The default billing entity cannot be
154
+ # archived. Archiving a billing entity that is already archived returns it
155
+ # unchanged. This endpoint requires an admin API key.
156
+ #
157
+ # @overload archive_by_external_id(external_billing_entity_id, request_options: {})
158
+ #
159
+ # @param external_billing_entity_id [String]
160
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
161
+ #
162
+ # @return [Orb::Models::Account::BillingEntity]
163
+ #
164
+ # @see Orb::Models::Account::BillingEntityArchiveByExternalIDParams
165
+ def archive_by_external_id(external_billing_entity_id, params = {})
166
+ @client.request(
167
+ method: :post,
168
+ path: [
169
+ "account/billing_entities/external_billing_entity_id/%1$s/archive",
170
+ external_billing_entity_id
171
+ ],
172
+ model: Orb::Account::BillingEntity,
173
+ options: params[:request_options]
174
+ )
175
+ end
176
+
177
+ # This endpoint returns a billing entity identified by its ID, or by the
178
+ # `external_billing_entity_id` set when it was created.
179
+ #
180
+ # @overload fetch(billing_entity_id, request_options: {})
181
+ #
182
+ # @param billing_entity_id [String]
183
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
184
+ #
185
+ # @return [Orb::Models::Account::BillingEntity]
186
+ #
187
+ # @see Orb::Models::Account::BillingEntityFetchParams
188
+ def fetch(billing_entity_id, params = {})
189
+ @client.request(
190
+ method: :get,
191
+ path: ["account/billing_entities/%1$s", billing_entity_id],
192
+ model: Orb::Account::BillingEntity,
193
+ options: params[:request_options]
194
+ )
195
+ end
196
+
197
+ # This endpoint returns a billing entity identified by its ID, or by the
198
+ # `external_billing_entity_id` set when it was created.
199
+ #
200
+ # @overload fetch_by_external_id(external_billing_entity_id, request_options: {})
201
+ #
202
+ # @param external_billing_entity_id [String]
203
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
204
+ #
205
+ # @return [Orb::Models::Account::BillingEntity]
206
+ #
207
+ # @see Orb::Models::Account::BillingEntityFetchByExternalIDParams
208
+ def fetch_by_external_id(external_billing_entity_id, params = {})
209
+ @client.request(
210
+ method: :get,
211
+ path: ["account/billing_entities/external_billing_entity_id/%1$s", external_billing_entity_id],
212
+ model: Orb::Account::BillingEntity,
213
+ options: params[:request_options]
214
+ )
215
+ end
216
+
217
+ # This endpoint restores an archived billing entity to active. Unarchiving an
218
+ # active billing entity returns it unchanged. This endpoint requires an admin API
219
+ # key.
220
+ #
221
+ # @overload unarchive(billing_entity_id, request_options: {})
222
+ #
223
+ # @param billing_entity_id [String]
224
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
225
+ #
226
+ # @return [Orb::Models::Account::BillingEntity]
227
+ #
228
+ # @see Orb::Models::Account::BillingEntityUnarchiveParams
229
+ def unarchive(billing_entity_id, params = {})
230
+ @client.request(
231
+ method: :post,
232
+ path: ["account/billing_entities/%1$s/unarchive", billing_entity_id],
233
+ model: Orb::Account::BillingEntity,
234
+ options: params[:request_options]
235
+ )
236
+ end
237
+
238
+ # This endpoint restores an archived billing entity to active. Unarchiving an
239
+ # active billing entity returns it unchanged. This endpoint requires an admin API
240
+ # key.
241
+ #
242
+ # @overload unarchive_by_external_id(external_billing_entity_id, request_options: {})
243
+ #
244
+ # @param external_billing_entity_id [String]
245
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
246
+ #
247
+ # @return [Orb::Models::Account::BillingEntity]
248
+ #
249
+ # @see Orb::Models::Account::BillingEntityUnarchiveByExternalIDParams
250
+ def unarchive_by_external_id(external_billing_entity_id, params = {})
251
+ @client.request(
252
+ method: :post,
253
+ path: [
254
+ "account/billing_entities/external_billing_entity_id/%1$s/unarchive",
255
+ external_billing_entity_id
256
+ ],
257
+ model: Orb::Account::BillingEntity,
258
+ options: params[:request_options]
259
+ )
260
+ end
261
+
262
+ # Some parameter documentations has been truncated, see
263
+ # {Orb::Models::Account::BillingEntityUpdateByExternalIDParams} for more details.
264
+ #
265
+ # This endpoint updates a billing entity, including the default one. Omitted
266
+ # fields keep their value. A change to the name, legal name, address, or tax
267
+ # registrations writes a new version of the billing entity; invoices already
268
+ # issued keep the version they were issued with. In `invoice_settings`, a null
269
+ # `memo` clears it so the billing entity uses the account's memo. An archived
270
+ # billing entity cannot be updated until it is unarchived. This endpoint requires
271
+ # an admin API key.
272
+ #
273
+ # `payment_gateway_connections` is the full set of connections the billing entity
274
+ # collects payments through; a connection left out is disconnected from the
275
+ # billing entity. If a payment through a connection left out is still in progress,
276
+ # the whole update is rejected and can be retried once the payment finishes.
277
+ #
278
+ # @overload update_by_external_id(external_billing_entity_id, address: nil, default_payment_gateway_connection_id: nil, invoice_settings: nil, legal_name: nil, name: nil, payment_gateway_connections: nil, tax_registrations: nil, request_options: {})
279
+ #
280
+ # @param external_billing_entity_id [String]
281
+ #
282
+ # @param address [Orb::Models::AddressInput, nil] Replaces the whole address. Omit it to keep the current one.
283
+ #
284
+ # @param default_payment_gateway_connection_id [String, nil] The ID of the connection Orb charges when the customer is not mapped to any of t
285
+ #
286
+ # @param invoice_settings [Orb::Models::Account::BillingEntityUpdateByExternalIDParams::InvoiceSettings, nil] The invoice settings to change. Omitted fields keep their value; null clears a f
287
+ #
288
+ # @param legal_name [String, nil] The legal name printed on invoices.
289
+ #
290
+ # @param name [String, nil] An internal name for the billing entity.
291
+ #
292
+ # @param payment_gateway_connections [Array<Orb::Models::Account::BillingEntityUpdateByExternalIDParams::PaymentGatewayConnection>, nil] The full set of payment gateway connections the billing entity collects payments
293
+ #
294
+ # @param tax_registrations [Array<Orb::Models::Account::BillingEntityUpdateByExternalIDParams::TaxRegistration>, nil] The full list of registrations. Omit it to keep the current ones.
295
+ #
296
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
297
+ #
298
+ # @return [Orb::Models::Account::BillingEntity]
299
+ #
300
+ # @see Orb::Models::Account::BillingEntityUpdateByExternalIDParams
301
+ def update_by_external_id(external_billing_entity_id, params = {})
302
+ parsed, options = Orb::Account::BillingEntityUpdateByExternalIDParams.dump_request(params)
303
+ @client.request(
304
+ method: :put,
305
+ path: ["account/billing_entities/external_billing_entity_id/%1$s", external_billing_entity_id],
306
+ body: parsed,
307
+ model: Orb::Account::BillingEntity,
308
+ options: options
309
+ )
310
+ end
311
+
312
+ # @api private
313
+ #
314
+ # @param client [Orb::Client]
315
+ def initialize(client:)
316
+ @client = client
317
+ end
318
+ end
319
+ end
320
+ end
321
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Resources
5
+ class Account
6
+ # A payment gateway connection is one Stripe account or one Adyen merchant account
7
+ # that a billing entity collects payments through.
8
+ class PaymentGatewayConnections
9
+ # Some parameter documentations has been truncated, see
10
+ # {Orb::Models::Account::PaymentGatewayConnectionListParams} for more details.
11
+ #
12
+ # This endpoint returns the account's payment gateway connections with the billing
13
+ # entity each one collects for, ordered in descending order by creation time.
14
+ #
15
+ # @overload list(billing_entity_id: nil, cursor: nil, limit: nil, provider_type: nil, request_options: {})
16
+ #
17
+ # @param billing_entity_id [String, nil] Only return connections of this billing entity.
18
+ #
19
+ # @param cursor [String, nil] Cursor for pagination. This can be populated by the `next_cursor` value returned
20
+ #
21
+ # @param limit [Integer] The number of items to fetch. Defaults to 20.
22
+ #
23
+ # @param provider_type [Symbol, Orb::Models::Account::PaymentGatewayConnectionListParams::ProviderType, nil] Only return connections of this payment provider.
24
+ #
25
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
26
+ #
27
+ # @return [Orb::Internal::Page<Orb::Models::Account::PaymentGatewayConnection>]
28
+ #
29
+ # @see Orb::Models::Account::PaymentGatewayConnectionListParams
30
+ def list(params = {})
31
+ parsed, options = Orb::Account::PaymentGatewayConnectionListParams.dump_request(params)
32
+ query = Orb::Internal::Util.encode_query_params(parsed)
33
+ @client.request(
34
+ method: :get,
35
+ path: "account/payment_gateway_connections",
36
+ query: query,
37
+ page: Orb::Internal::Page,
38
+ model: Orb::Account::PaymentGatewayConnection,
39
+ options: options
40
+ )
41
+ end
42
+
43
+ # This endpoint returns a payment gateway connection identified by its ID.
44
+ #
45
+ # @overload fetch(payment_gateway_connection_id, request_options: {})
46
+ #
47
+ # @param payment_gateway_connection_id [String]
48
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]
49
+ #
50
+ # @return [Orb::Models::Account::PaymentGatewayConnection]
51
+ #
52
+ # @see Orb::Models::Account::PaymentGatewayConnectionFetchParams
53
+ def fetch(payment_gateway_connection_id, params = {})
54
+ @client.request(
55
+ method: :get,
56
+ path: ["account/payment_gateway_connections/%1$s", payment_gateway_connection_id],
57
+ model: Orb::Account::PaymentGatewayConnection,
58
+ options: params[:request_options]
59
+ )
60
+ end
61
+
62
+ # @api private
63
+ #
64
+ # @param client [Orb::Client]
65
+ def initialize(client:)
66
+ @client = client
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Resources
5
+ class Account
6
+ # A billing entity is a legal entity an account invoices from, with its own legal
7
+ # name, address and tax registrations.
8
+ # @return [Orb::Resources::Account::BillingEntities]
9
+ attr_reader :billing_entities
10
+
11
+ # A payment gateway connection is one Stripe account or one Adyen merchant account
12
+ # that a billing entity collects payments through.
13
+ # @return [Orb::Resources::Account::PaymentGatewayConnections]
14
+ attr_reader :payment_gateway_connections
15
+
16
+ # @api private
17
+ #
18
+ # @param client [Orb::Client]
19
+ def initialize(client:)
20
+ @client = client
21
+ @billing_entities = Orb::Resources::Account::BillingEntities.new(client: client)
22
+ @payment_gateway_connections = Orb::Resources::Account::PaymentGatewayConnections.new(client: client)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -67,11 +67,12 @@ module Orb
67
67
  # Some parameter documentations has been truncated, see
68
68
  # {Orb::Models::CreditNoteListParams} for more details.
69
69
  #
70
- # Get a paginated list of CreditNotes. Users can also filter by customer_id,
71
- # subscription_id, or external_customer_id. The credit notes will be returned in
70
+ # Get a paginated list of CreditNotes. The credit notes will be returned in
72
71
  # reverse chronological order by `creation_time`.
73
72
  #
74
- # @overload list(created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, limit: nil, request_options: {})
73
+ # @overload list(billing_entity_id: nil, created_at_gt: nil, created_at_gte: nil, created_at_lt: nil, created_at_lte: nil, cursor: nil, limit: nil, request_options: {})
74
+ #
75
+ # @param billing_entity_id [String, nil] Filters to objects issued by this billing entity. Filtering on the account's def
75
76
  #
76
77
  # @param created_at_gt [Time, nil]
77
78
  #