orb-billing 1.35.0 → 1.37.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 (258) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +4 -0
  5. data/lib/orb/models/backfill_reflected_webhook_event.rb +180 -0
  6. data/lib/orb/models/backfill_reverted_webhook_event.rb +180 -0
  7. data/lib/orb/models/billable_metric_edited_webhook_event.rb +104 -0
  8. data/lib/orb/models/credit_block_accounting_sync_failed_webhook_event.rb +499 -0
  9. data/lib/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rb +494 -0
  10. data/lib/orb/models/credit_note_accounting_sync_failed_webhook_event.rb +161 -0
  11. data/lib/orb/models/credit_note_accounting_sync_succeeded_webhook_event.rb +155 -0
  12. data/lib/orb/models/credit_note_issued_webhook_event.rb +65 -0
  13. data/lib/orb/models/credit_note_marked_as_void_webhook_event.rb +65 -0
  14. data/lib/orb/models/customer_accounting_sync_failed_webhook_event.rb +171 -0
  15. data/lib/orb/models/customer_accounting_sync_succeeded_webhook_event.rb +165 -0
  16. data/lib/orb/models/customer_balance_transaction_created_webhook_event.rb +212 -0
  17. data/lib/orb/models/customer_created_webhook_event.rb +81 -0
  18. data/lib/orb/models/customer_credit_balance_depleted_webhook_event.rb +560 -0
  19. data/lib/orb/models/customer_credit_balance_dropped_webhook_event.rb +566 -0
  20. data/lib/orb/models/customer_credit_balance_recovered_webhook_event.rb +560 -0
  21. data/lib/orb/models/customer_credit_ledger_incremented_webhook_event.rb +474 -0
  22. data/lib/orb/models/customer_edited_webhook_event.rb +344 -0
  23. data/lib/orb/models/data_exports_transfer_error_webhook_event.rb +100 -0
  24. data/lib/orb/models/data_exports_transfer_success_webhook_event.rb +94 -0
  25. data/lib/orb/models/event_unmatched_event_webhook_event.rb +105 -0
  26. data/lib/orb/models/ingestion_unmatched_customer_ids_webhook_event.rb +64 -0
  27. data/lib/orb/models/invoice_accounting_sync_failed_webhook_event.rb +164 -0
  28. data/lib/orb/models/invoice_accounting_sync_succeeded_webhook_event.rb +158 -0
  29. data/lib/orb/models/invoice_automation_schedule_step_executed_webhook_event.rb +338 -0
  30. data/lib/orb/models/invoice_cost_data_exported_webhook_event.rb +83 -0
  31. data/lib/orb/models/invoice_due_date_recalculation_canceled_webhook_event.rb +70 -0
  32. data/lib/orb/models/invoice_due_date_recalculation_completed_webhook_event.rb +70 -0
  33. data/lib/orb/models/invoice_due_date_recalculation_started_webhook_event.rb +64 -0
  34. data/lib/orb/models/invoice_dunning_schedule_created_webhook_event.rb +186 -0
  35. data/lib/orb/models/invoice_dunning_schedule_ended_webhook_event.rb +180 -0
  36. data/lib/orb/models/invoice_dunning_schedule_reset_webhook_event.rb +184 -0
  37. data/lib/orb/models/invoice_dunning_schedule_step_executed_webhook_event.rb +133 -0
  38. data/lib/orb/models/invoice_edited_webhook_event.rb +550 -0
  39. data/lib/orb/models/invoice_invoice_date_elapsed_webhook_event.rb +120 -0
  40. data/lib/orb/models/invoice_issue_failed_webhook_event.rb +79 -0
  41. data/lib/orb/models/invoice_issued_summary_webhook_event.rb +841 -0
  42. data/lib/orb/models/invoice_issued_webhook_event.rb +79 -0
  43. data/lib/orb/models/invoice_manually_marked_as_paid_webhook_event.rb +91 -0
  44. data/lib/orb/models/invoice_manually_marked_as_void_webhook_event.rb +68 -0
  45. data/lib/orb/models/invoice_payment_failed_webhook_event.rb +92 -0
  46. data/lib/orb/models/invoice_payment_processing_webhook_event.rb +85 -0
  47. data/lib/orb/models/invoice_payment_succeeded_webhook_event.rb +101 -0
  48. data/lib/orb/models/invoice_sync_failed_webhook_event.rb +85 -0
  49. data/lib/orb/models/invoice_sync_succeeded_webhook_event.rb +85 -0
  50. data/lib/orb/models/invoice_undo_mark_as_paid_webhook_event.rb +68 -0
  51. data/lib/orb/models/metric_events_dropped_by_watermark_webhook_event.rb +98 -0
  52. data/lib/orb/models/payment_method_created_webhook_event.rb +156 -0
  53. data/lib/orb/models/payment_method_deleted_webhook_event.rb +156 -0
  54. data/lib/orb/models/plan_default_version_set_webhook_event.rb +108 -0
  55. data/lib/orb/models/plan_version_created_webhook_event.rb +108 -0
  56. data/lib/orb/models/price_edited_webhook_event.rb +105 -0
  57. data/lib/orb/models/resource_event_test_webhook_event.rb +64 -0
  58. data/lib/orb/models/sales_order_accounting_sync_failed_webhook_event.rb +164 -0
  59. data/lib/orb/models/sales_order_accounting_sync_succeeded_webhook_event.rb +158 -0
  60. data/lib/orb/models/subscription_accounting_sync_failed_webhook_event.rb +178 -0
  61. data/lib/orb/models/subscription_accounting_sync_succeeded_webhook_event.rb +172 -0
  62. data/lib/orb/models/subscription_alert_disabled_webhook_event.rb +624 -0
  63. data/lib/orb/models/subscription_cancellation_scheduled_webhook_event.rb +93 -0
  64. data/lib/orb/models/subscription_cancellation_unscheduled_webhook_event.rb +93 -0
  65. data/lib/orb/models/subscription_cost_exceeded_webhook_event.rb +540 -0
  66. data/lib/orb/models/subscription_created_webhook_event.rb +82 -0
  67. data/lib/orb/models/subscription_edited_webhook_event.rb +134 -0
  68. data/lib/orb/models/subscription_ended_webhook_event.rb +82 -0
  69. data/lib/orb/models/subscription_fixed_fee_quantity_updated_webhook_event.rb +111 -0
  70. data/lib/orb/models/subscription_grouped_cost_exceeded_webhook_event.rb +655 -0
  71. data/lib/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rb +191 -0
  72. data/lib/orb/models/subscription_license_allocation_reset_webhook_event.rb +214 -0
  73. data/lib/orb/models/subscription_license_balance_threshold_reached_webhook_event.rb +652 -0
  74. data/lib/orb/models/subscription_plan_change_scheduled_webhook_event.rb +105 -0
  75. data/lib/orb/models/subscription_plan_changed_webhook_event.rb +93 -0
  76. data/lib/orb/models/subscription_plan_version_change_scheduled_webhook_event.rb +106 -0
  77. data/lib/orb/models/subscription_plan_version_changed_webhook_event.rb +105 -0
  78. data/lib/orb/models/subscription_spend_exceeded_webhook_event.rb +541 -0
  79. data/lib/orb/models/subscription_started_webhook_event.rb +82 -0
  80. data/lib/orb/models/subscription_trial_ended_webhook_event.rb +82 -0
  81. data/lib/orb/models/subscription_usage_exceeded_webhook_event.rb +548 -0
  82. data/lib/orb/models/transaction_accounting_sync_failed_webhook_event.rb +236 -0
  83. data/lib/orb/models/transaction_accounting_sync_succeeded_webhook_event.rb +232 -0
  84. data/lib/orb/models/unwrap_webhook_event.rb +250 -0
  85. data/lib/orb/models/webhook_unwrap_params.rb +14 -0
  86. data/lib/orb/models.rb +180 -0
  87. data/lib/orb/resources/webhooks.rb +22 -0
  88. data/lib/orb/version.rb +1 -1
  89. data/lib/orb.rb +82 -0
  90. data/rbi/orb/client.rbi +3 -0
  91. data/rbi/orb/models/backfill_reflected_webhook_event.rbi +274 -0
  92. data/rbi/orb/models/backfill_reverted_webhook_event.rbi +271 -0
  93. data/rbi/orb/models/billable_metric_edited_webhook_event.rbi +198 -0
  94. data/rbi/orb/models/credit_block_accounting_sync_failed_webhook_event.rbi +1039 -0
  95. data/rbi/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbi +1034 -0
  96. data/rbi/orb/models/credit_note_accounting_sync_failed_webhook_event.rbi +315 -0
  97. data/rbi/orb/models/credit_note_accounting_sync_succeeded_webhook_event.rbi +310 -0
  98. data/rbi/orb/models/credit_note_issued_webhook_event.rbi +98 -0
  99. data/rbi/orb/models/credit_note_marked_as_void_webhook_event.rbi +102 -0
  100. data/rbi/orb/models/customer_accounting_sync_failed_webhook_event.rbi +339 -0
  101. data/rbi/orb/models/customer_accounting_sync_succeeded_webhook_event.rbi +335 -0
  102. data/rbi/orb/models/customer_balance_transaction_created_webhook_event.rbi +437 -0
  103. data/rbi/orb/models/customer_created_webhook_event.rbi +128 -0
  104. data/rbi/orb/models/customer_credit_balance_depleted_webhook_event.rbi +1091 -0
  105. data/rbi/orb/models/customer_credit_balance_dropped_webhook_event.rbi +1096 -0
  106. data/rbi/orb/models/customer_credit_balance_recovered_webhook_event.rbi +1091 -0
  107. data/rbi/orb/models/customer_credit_ledger_incremented_webhook_event.rbi +987 -0
  108. data/rbi/orb/models/customer_edited_webhook_event.rbi +599 -0
  109. data/rbi/orb/models/data_exports_transfer_error_webhook_event.rbi +170 -0
  110. data/rbi/orb/models/data_exports_transfer_success_webhook_event.rbi +165 -0
  111. data/rbi/orb/models/event_unmatched_event_webhook_event.rbi +193 -0
  112. data/rbi/orb/models/ingestion_unmatched_customer_ids_webhook_event.rbi +132 -0
  113. data/rbi/orb/models/invoice_accounting_sync_failed_webhook_event.rbi +319 -0
  114. data/rbi/orb/models/invoice_accounting_sync_succeeded_webhook_event.rbi +312 -0
  115. data/rbi/orb/models/invoice_automation_schedule_step_executed_webhook_event.rbi +614 -0
  116. data/rbi/orb/models/invoice_cost_data_exported_webhook_event.rbi +144 -0
  117. data/rbi/orb/models/invoice_due_date_recalculation_canceled_webhook_event.rbi +139 -0
  118. data/rbi/orb/models/invoice_due_date_recalculation_completed_webhook_event.rbi +139 -0
  119. data/rbi/orb/models/invoice_due_date_recalculation_started_webhook_event.rbi +132 -0
  120. data/rbi/orb/models/invoice_dunning_schedule_created_webhook_event.rbi +331 -0
  121. data/rbi/orb/models/invoice_dunning_schedule_ended_webhook_event.rbi +324 -0
  122. data/rbi/orb/models/invoice_dunning_schedule_reset_webhook_event.rbi +329 -0
  123. data/rbi/orb/models/invoice_dunning_schedule_step_executed_webhook_event.rbi +250 -0
  124. data/rbi/orb/models/invoice_edited_webhook_event.rbi +942 -0
  125. data/rbi/orb/models/invoice_invoice_date_elapsed_webhook_event.rbi +251 -0
  126. data/rbi/orb/models/invoice_issue_failed_webhook_event.rbi +132 -0
  127. data/rbi/orb/models/invoice_issued_summary_webhook_event.rbi +1432 -0
  128. data/rbi/orb/models/invoice_issued_webhook_event.rbi +134 -0
  129. data/rbi/orb/models/invoice_manually_marked_as_paid_webhook_event.rbi +165 -0
  130. data/rbi/orb/models/invoice_manually_marked_as_void_webhook_event.rbi +114 -0
  131. data/rbi/orb/models/invoice_payment_failed_webhook_event.rbi +157 -0
  132. data/rbi/orb/models/invoice_payment_processing_webhook_event.rbi +156 -0
  133. data/rbi/orb/models/invoice_payment_succeeded_webhook_event.rbi +175 -0
  134. data/rbi/orb/models/invoice_sync_failed_webhook_event.rbi +147 -0
  135. data/rbi/orb/models/invoice_sync_succeeded_webhook_event.rbi +147 -0
  136. data/rbi/orb/models/invoice_undo_mark_as_paid_webhook_event.rbi +106 -0
  137. data/rbi/orb/models/metric_events_dropped_by_watermark_webhook_event.rbi +167 -0
  138. data/rbi/orb/models/payment_method_created_webhook_event.rbi +259 -0
  139. data/rbi/orb/models/payment_method_deleted_webhook_event.rbi +259 -0
  140. data/rbi/orb/models/plan_default_version_set_webhook_event.rbi +196 -0
  141. data/rbi/orb/models/plan_version_created_webhook_event.rbi +190 -0
  142. data/rbi/orb/models/price_edited_webhook_event.rbi +235 -0
  143. data/rbi/orb/models/resource_event_test_webhook_event.rbi +116 -0
  144. data/rbi/orb/models/sales_order_accounting_sync_failed_webhook_event.rbi +321 -0
  145. data/rbi/orb/models/sales_order_accounting_sync_succeeded_webhook_event.rbi +316 -0
  146. data/rbi/orb/models/subscription_accounting_sync_failed_webhook_event.rbi +353 -0
  147. data/rbi/orb/models/subscription_accounting_sync_succeeded_webhook_event.rbi +346 -0
  148. data/rbi/orb/models/subscription_alert_disabled_webhook_event.rbi +1232 -0
  149. data/rbi/orb/models/subscription_cancellation_scheduled_webhook_event.rbi +179 -0
  150. data/rbi/orb/models/subscription_cancellation_unscheduled_webhook_event.rbi +183 -0
  151. data/rbi/orb/models/subscription_cost_exceeded_webhook_event.rbi +1034 -0
  152. data/rbi/orb/models/subscription_created_webhook_event.rbi +132 -0
  153. data/rbi/orb/models/subscription_edited_webhook_event.rbi +247 -0
  154. data/rbi/orb/models/subscription_ended_webhook_event.rbi +132 -0
  155. data/rbi/orb/models/subscription_fixed_fee_quantity_updated_webhook_event.rbi +206 -0
  156. data/rbi/orb/models/subscription_grouped_cost_exceeded_webhook_event.rbi +1262 -0
  157. data/rbi/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rbi +374 -0
  158. data/rbi/orb/models/subscription_license_allocation_reset_webhook_event.rbi +421 -0
  159. data/rbi/orb/models/subscription_license_balance_threshold_reached_webhook_event.rbi +1265 -0
  160. data/rbi/orb/models/subscription_plan_change_scheduled_webhook_event.rbi +198 -0
  161. data/rbi/orb/models/subscription_plan_changed_webhook_event.rbi +169 -0
  162. data/rbi/orb/models/subscription_plan_version_change_scheduled_webhook_event.rbi +205 -0
  163. data/rbi/orb/models/subscription_plan_version_changed_webhook_event.rbi +199 -0
  164. data/rbi/orb/models/subscription_spend_exceeded_webhook_event.rbi +1035 -0
  165. data/rbi/orb/models/subscription_started_webhook_event.rbi +132 -0
  166. data/rbi/orb/models/subscription_trial_ended_webhook_event.rbi +136 -0
  167. data/rbi/orb/models/subscription_usage_exceeded_webhook_event.rbi +1041 -0
  168. data/rbi/orb/models/transaction_accounting_sync_failed_webhook_event.rbi +455 -0
  169. data/rbi/orb/models/transaction_accounting_sync_succeeded_webhook_event.rbi +449 -0
  170. data/rbi/orb/models/unwrap_webhook_event.rbi +99 -0
  171. data/rbi/orb/models/webhook_unwrap_params.rbi +25 -0
  172. data/rbi/orb/models.rbi +224 -0
  173. data/rbi/orb/resources/webhooks.rbi +103 -0
  174. data/sig/orb/client.rbs +2 -0
  175. data/sig/orb/models/backfill_reflected_webhook_event.rbs +130 -0
  176. data/sig/orb/models/backfill_reverted_webhook_event.rbs +130 -0
  177. data/sig/orb/models/billable_metric_edited_webhook_event.rbs +94 -0
  178. data/sig/orb/models/credit_block_accounting_sync_failed_webhook_event.rbs +412 -0
  179. data/sig/orb/models/credit_block_accounting_sync_succeeded_webhook_event.rbs +407 -0
  180. data/sig/orb/models/credit_note_accounting_sync_failed_webhook_event.rbs +147 -0
  181. data/sig/orb/models/credit_note_accounting_sync_succeeded_webhook_event.rbs +142 -0
  182. data/sig/orb/models/credit_note_issued_webhook_event.rbs +50 -0
  183. data/sig/orb/models/credit_note_marked_as_void_webhook_event.rbs +50 -0
  184. data/sig/orb/models/customer_accounting_sync_failed_webhook_event.rbs +142 -0
  185. data/sig/orb/models/customer_accounting_sync_succeeded_webhook_event.rbs +137 -0
  186. data/sig/orb/models/customer_balance_transaction_created_webhook_event.rbs +171 -0
  187. data/sig/orb/models/customer_created_webhook_event.rbs +50 -0
  188. data/sig/orb/models/customer_credit_balance_depleted_webhook_event.rbs +374 -0
  189. data/sig/orb/models/customer_credit_balance_dropped_webhook_event.rbs +379 -0
  190. data/sig/orb/models/customer_credit_balance_recovered_webhook_event.rbs +374 -0
  191. data/sig/orb/models/customer_credit_ledger_incremented_webhook_event.rbs +364 -0
  192. data/sig/orb/models/customer_edited_webhook_event.rbs +139 -0
  193. data/sig/orb/models/data_exports_transfer_error_webhook_event.rbs +92 -0
  194. data/sig/orb/models/data_exports_transfer_success_webhook_event.rbs +87 -0
  195. data/sig/orb/models/event_unmatched_event_webhook_event.rbs +102 -0
  196. data/sig/orb/models/ingestion_unmatched_customer_ids_webhook_event.rbs +55 -0
  197. data/sig/orb/models/invoice_accounting_sync_failed_webhook_event.rbs +147 -0
  198. data/sig/orb/models/invoice_accounting_sync_succeeded_webhook_event.rbs +142 -0
  199. data/sig/orb/models/invoice_automation_schedule_step_executed_webhook_event.rbs +313 -0
  200. data/sig/orb/models/invoice_cost_data_exported_webhook_event.rbs +73 -0
  201. data/sig/orb/models/invoice_due_date_recalculation_canceled_webhook_event.rbs +57 -0
  202. data/sig/orb/models/invoice_due_date_recalculation_completed_webhook_event.rbs +57 -0
  203. data/sig/orb/models/invoice_due_date_recalculation_started_webhook_event.rbs +55 -0
  204. data/sig/orb/models/invoice_dunning_schedule_created_webhook_event.rbs +171 -0
  205. data/sig/orb/models/invoice_dunning_schedule_ended_webhook_event.rbs +166 -0
  206. data/sig/orb/models/invoice_dunning_schedule_reset_webhook_event.rbs +156 -0
  207. data/sig/orb/models/invoice_dunning_schedule_step_executed_webhook_event.rbs +119 -0
  208. data/sig/orb/models/invoice_edited_webhook_event.rbs +388 -0
  209. data/sig/orb/models/invoice_invoice_date_elapsed_webhook_event.rbs +111 -0
  210. data/sig/orb/models/invoice_issue_failed_webhook_event.rbs +60 -0
  211. data/sig/orb/models/invoice_issued_summary_webhook_event.rbs +504 -0
  212. data/sig/orb/models/invoice_issued_webhook_event.rbs +60 -0
  213. data/sig/orb/models/invoice_manually_marked_as_paid_webhook_event.rbs +73 -0
  214. data/sig/orb/models/invoice_manually_marked_as_void_webhook_event.rbs +50 -0
  215. data/sig/orb/models/invoice_payment_failed_webhook_event.rbs +77 -0
  216. data/sig/orb/models/invoice_payment_processing_webhook_event.rbs +71 -0
  217. data/sig/orb/models/invoice_payment_succeeded_webhook_event.rbs +82 -0
  218. data/sig/orb/models/invoice_sync_failed_webhook_event.rbs +69 -0
  219. data/sig/orb/models/invoice_sync_succeeded_webhook_event.rbs +69 -0
  220. data/sig/orb/models/invoice_undo_mark_as_paid_webhook_event.rbs +50 -0
  221. data/sig/orb/models/metric_events_dropped_by_watermark_webhook_event.rbs +82 -0
  222. data/sig/orb/models/payment_method_created_webhook_event.rbs +112 -0
  223. data/sig/orb/models/payment_method_deleted_webhook_event.rbs +112 -0
  224. data/sig/orb/models/plan_default_version_set_webhook_event.rbs +94 -0
  225. data/sig/orb/models/plan_version_created_webhook_event.rbs +91 -0
  226. data/sig/orb/models/price_edited_webhook_event.rbs +77 -0
  227. data/sig/orb/models/resource_event_test_webhook_event.rbs +57 -0
  228. data/sig/orb/models/sales_order_accounting_sync_failed_webhook_event.rbs +147 -0
  229. data/sig/orb/models/sales_order_accounting_sync_succeeded_webhook_event.rbs +142 -0
  230. data/sig/orb/models/subscription_accounting_sync_failed_webhook_event.rbs +147 -0
  231. data/sig/orb/models/subscription_accounting_sync_succeeded_webhook_event.rbs +142 -0
  232. data/sig/orb/models/subscription_alert_disabled_webhook_event.rbs +444 -0
  233. data/sig/orb/models/subscription_cancellation_scheduled_webhook_event.rbs +60 -0
  234. data/sig/orb/models/subscription_cancellation_unscheduled_webhook_event.rbs +60 -0
  235. data/sig/orb/models/subscription_cost_exceeded_webhook_event.rbs +362 -0
  236. data/sig/orb/models/subscription_created_webhook_event.rbs +50 -0
  237. data/sig/orb/models/subscription_edited_webhook_event.rbs +109 -0
  238. data/sig/orb/models/subscription_ended_webhook_event.rbs +50 -0
  239. data/sig/orb/models/subscription_fixed_fee_quantity_updated_webhook_event.rbs +82 -0
  240. data/sig/orb/models/subscription_grouped_cost_exceeded_webhook_event.rbs +465 -0
  241. data/sig/orb/models/subscription_invoicing_threshold_exceeded_webhook_event.rbs +158 -0
  242. data/sig/orb/models/subscription_license_allocation_reset_webhook_event.rbs +180 -0
  243. data/sig/orb/models/subscription_license_balance_threshold_reached_webhook_event.rbs +460 -0
  244. data/sig/orb/models/subscription_plan_change_scheduled_webhook_event.rbs +73 -0
  245. data/sig/orb/models/subscription_plan_changed_webhook_event.rbs +60 -0
  246. data/sig/orb/models/subscription_plan_version_change_scheduled_webhook_event.rbs +77 -0
  247. data/sig/orb/models/subscription_plan_version_changed_webhook_event.rbs +77 -0
  248. data/sig/orb/models/subscription_spend_exceeded_webhook_event.rbs +362 -0
  249. data/sig/orb/models/subscription_started_webhook_event.rbs +50 -0
  250. data/sig/orb/models/subscription_trial_ended_webhook_event.rbs +50 -0
  251. data/sig/orb/models/subscription_usage_exceeded_webhook_event.rbs +367 -0
  252. data/sig/orb/models/transaction_accounting_sync_failed_webhook_event.rbs +205 -0
  253. data/sig/orb/models/transaction_accounting_sync_succeeded_webhook_event.rbs +200 -0
  254. data/sig/orb/models/unwrap_webhook_event.rbs +90 -0
  255. data/sig/orb/models/webhook_unwrap_params.rbs +14 -0
  256. data/sig/orb/models.rbs +162 -0
  257. data/sig/orb/resources/webhooks.rbs +89 -0
  258. metadata +247 -1
@@ -0,0 +1,1432 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ class InvoiceIssuedSummaryWebhookEvent < Orb::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Orb::InvoiceIssuedSummaryWebhookEvent, Orb::Internal::AnyHash)
9
+ end
10
+
11
+ # The ID of this webhook event.
12
+ sig { returns(String) }
13
+ attr_accessor :id
14
+
15
+ # The time at which this event was created, to the second.
16
+ sig { returns(Time) }
17
+ attr_accessor :created_at
18
+
19
+ # #InvoiceApiResourceWithoutLineItems
20
+ sig { returns(Orb::InvoiceIssuedSummaryWebhookEvent::Invoice) }
21
+ attr_reader :invoice
22
+
23
+ sig do
24
+ params(
25
+ invoice: Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::OrHash
26
+ ).void
27
+ end
28
+ attr_writer :invoice
29
+
30
+ sig { returns(Orb::InvoiceIssuedSummaryWebhookEvent::Properties) }
31
+ attr_reader :properties
32
+
33
+ sig do
34
+ params(
35
+ properties: Orb::InvoiceIssuedSummaryWebhookEvent::Properties::OrHash
36
+ ).void
37
+ end
38
+ attr_writer :properties
39
+
40
+ # The event this payload describes.
41
+ sig { returns(Orb::InvoiceIssuedSummaryWebhookEvent::Type::TaggedSymbol) }
42
+ attr_accessor :type
43
+
44
+ # A lightweight variant of invoice.issued for accounts configured to receive a
45
+ # summarized invoice payload.
46
+ sig do
47
+ params(
48
+ id: String,
49
+ created_at: Time,
50
+ invoice: Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::OrHash,
51
+ properties: Orb::InvoiceIssuedSummaryWebhookEvent::Properties::OrHash,
52
+ type: Orb::InvoiceIssuedSummaryWebhookEvent::Type::OrSymbol
53
+ ).returns(T.attached_class)
54
+ end
55
+ def self.new(
56
+ # The ID of this webhook event.
57
+ id:,
58
+ # The time at which this event was created, to the second.
59
+ created_at:,
60
+ # #InvoiceApiResourceWithoutLineItems
61
+ invoice:,
62
+ properties:,
63
+ # The event this payload describes.
64
+ type:
65
+ )
66
+ end
67
+
68
+ sig do
69
+ override.returns(
70
+ {
71
+ id: String,
72
+ created_at: Time,
73
+ invoice: Orb::InvoiceIssuedSummaryWebhookEvent::Invoice,
74
+ properties: Orb::InvoiceIssuedSummaryWebhookEvent::Properties,
75
+ type: Orb::InvoiceIssuedSummaryWebhookEvent::Type::TaggedSymbol
76
+ }
77
+ )
78
+ end
79
+ def to_hash
80
+ end
81
+
82
+ class Invoice < Orb::Internal::Type::BaseModel
83
+ OrHash =
84
+ T.type_alias do
85
+ T.any(
86
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice,
87
+ Orb::Internal::AnyHash
88
+ )
89
+ end
90
+
91
+ sig { returns(String) }
92
+ attr_accessor :id
93
+
94
+ # This is the final amount required to be charged to the customer and reflects the
95
+ # application of the customer balance to the `total` of the invoice.
96
+ sig { returns(String) }
97
+ attr_accessor :amount_due
98
+
99
+ sig do
100
+ returns(
101
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::AutoCollection
102
+ )
103
+ end
104
+ attr_reader :auto_collection
105
+
106
+ sig do
107
+ params(
108
+ auto_collection:
109
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::AutoCollection::OrHash
110
+ ).void
111
+ end
112
+ attr_writer :auto_collection
113
+
114
+ sig { returns(T.nilable(Orb::Address)) }
115
+ attr_reader :billing_address
116
+
117
+ sig { params(billing_address: T.nilable(Orb::Address::OrHash)).void }
118
+ attr_writer :billing_address
119
+
120
+ # The creation time of the resource in Orb.
121
+ sig { returns(Time) }
122
+ attr_accessor :created_at
123
+
124
+ # A list of credit notes associated with the invoice
125
+ sig do
126
+ returns(
127
+ T::Array[Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CreditNote]
128
+ )
129
+ end
130
+ attr_accessor :credit_notes
131
+
132
+ # An ISO 4217 currency string or `credits`
133
+ sig { returns(String) }
134
+ attr_accessor :currency
135
+
136
+ sig { returns(Orb::CustomerMinified) }
137
+ attr_reader :customer
138
+
139
+ sig { params(customer: Orb::CustomerMinified::OrHash).void }
140
+ attr_writer :customer
141
+
142
+ sig do
143
+ returns(
144
+ T::Array[
145
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction
146
+ ]
147
+ )
148
+ end
149
+ attr_accessor :customer_balance_transactions
150
+
151
+ # Tax IDs are commonly required to be displayed on customer invoices, which are
152
+ # added to the headers of invoices.
153
+ #
154
+ # ### Supported Tax ID Countries and Types
155
+ #
156
+ # | Country | Type | Description |
157
+ # | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
158
+ # | Albania | `al_tin` | Albania Tax Identification Number |
159
+ # | Andorra | `ad_nrt` | Andorran NRT Number |
160
+ # | Angola | `ao_tin` | Angola Tax Identification Number |
161
+ # | Argentina | `ar_cuit` | Argentinian Tax ID Number |
162
+ # | Armenia | `am_tin` | Armenia Tax Identification Number |
163
+ # | Aruba | `aw_tin` | Aruba Tax Identification Number |
164
+ # | Australia | `au_abn` | Australian Business Number (AU ABN) |
165
+ # | Australia | `au_arn` | Australian Taxation Office Reference Number |
166
+ # | Austria | `eu_vat` | European VAT Number |
167
+ # | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number |
168
+ # | Bahamas | `bs_tin` | Bahamas Tax Identification Number |
169
+ # | Bahrain | `bh_vat` | Bahraini VAT Number |
170
+ # | Bangladesh | `bd_bin` | Bangladesh Business Identification Number |
171
+ # | Barbados | `bb_tin` | Barbados Tax Identification Number |
172
+ # | Belarus | `by_tin` | Belarus TIN Number |
173
+ # | Belgium | `eu_vat` | European VAT Number |
174
+ # | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) |
175
+ # | Bolivia | `bo_tin` | Bolivian Tax ID |
176
+ # | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number |
177
+ # | Brazil | `br_cnpj` | Brazilian CNPJ Number |
178
+ # | Brazil | `br_cpf` | Brazilian CPF Number |
179
+ # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
180
+ # | Bulgaria | `eu_vat` | European VAT Number |
181
+ # | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) |
182
+ # | Cambodia | `kh_tin` | Cambodia Tax Identification Number |
183
+ # | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) |
184
+ # | Canada | `ca_bn` | Canadian BN |
185
+ # | Canada | `ca_gst_hst` | Canadian GST/HST Number |
186
+ # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
187
+ # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
188
+ # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
189
+ # | Canada | `ca_qst` | Canadian QST Number (Québec) |
190
+ # | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) |
191
+ # | Chile | `cl_tin` | Chilean TIN |
192
+ # | China | `cn_tin` | Chinese Tax ID |
193
+ # | Colombia | `co_nit` | Colombian NIT Number |
194
+ # | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) |
195
+ # | Costa Rica | `cr_tin` | Costa Rican Tax ID |
196
+ # | Croatia | `eu_vat` | European VAT Number |
197
+ # | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) |
198
+ # | Cyprus | `eu_vat` | European VAT Number |
199
+ # | Czech Republic | `eu_vat` | European VAT Number |
200
+ # | Denmark | `eu_vat` | European VAT Number |
201
+ # | Dominican Republic | `do_rcn` | Dominican RCN Number |
202
+ # | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
203
+ # | Egypt | `eg_tin` | Egyptian Tax Identification Number |
204
+ # | El Salvador | `sv_nit` | El Salvadorian NIT Number |
205
+ # | Estonia | `eu_vat` | European VAT Number |
206
+ # | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
207
+ # | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
208
+ # | Faroe Islands | `fo_vat` | Faroe Islands VAT Number |
209
+ # | Finland | `eu_vat` | European VAT Number |
210
+ # | France | `eu_vat` | European VAT Number |
211
+ # | Georgia | `ge_vat` | Georgian VAT |
212
+ # | Germany | `de_stn` | German Tax Number (Steuernummer) |
213
+ # | Germany | `eu_vat` | European VAT Number |
214
+ # | Gibraltar | `gi_tin` | Gibraltar Tax Identification Number |
215
+ # | Greece | `eu_vat` | European VAT Number |
216
+ # | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
217
+ # | Hong Kong | `hk_br` | Hong Kong BR Number |
218
+ # | Hungary | `eu_vat` | European VAT Number |
219
+ # | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
220
+ # | Iceland | `is_vat` | Icelandic VAT |
221
+ # | India | `in_gst` | Indian GST Number |
222
+ # | Indonesia | `id_npwp` | Indonesian NPWP Number |
223
+ # | Ireland | `eu_vat` | European VAT Number |
224
+ # | Israel | `il_vat` | Israel VAT |
225
+ # | Italy | `eu_vat` | European VAT Number |
226
+ # | Italy | `it_cf` | Italian Codice Fiscale Number |
227
+ # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
228
+ # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
229
+ # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
230
+ # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
231
+ # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
232
+ # | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number |
233
+ # | Laos | `la_tin` | Laos Tax Identification Number |
234
+ # | Latvia | `eu_vat` | European VAT Number |
235
+ # | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
236
+ # | Liechtenstein | `li_vat` | Liechtenstein VAT Number |
237
+ # | Lithuania | `eu_vat` | European VAT Number |
238
+ # | Luxembourg | `eu_vat` | European VAT Number |
239
+ # | Malaysia | `my_frp` | Malaysian FRP Number |
240
+ # | Malaysia | `my_itn` | Malaysian ITN |
241
+ # | Malaysia | `my_sst` | Malaysian SST Number |
242
+ # | Malta | `eu_vat` | European VAT Number |
243
+ # | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) |
244
+ # | Mexico | `mx_rfc` | Mexican RFC Number |
245
+ # | Moldova | `md_vat` | Moldova VAT Number |
246
+ # | Montenegro | `me_pib` | Montenegro PIB Number |
247
+ # | Morocco | `ma_vat` | Morocco VAT Number |
248
+ # | Nepal | `np_pan` | Nepal PAN Number |
249
+ # | Netherlands | `eu_vat` | European VAT Number |
250
+ # | New Zealand | `nz_gst` | New Zealand GST Number |
251
+ # | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
252
+ # | North Macedonia | `mk_vat` | North Macedonia VAT Number |
253
+ # | Northern Ireland | `eu_vat` | Northern Ireland VAT Number |
254
+ # | Norway | `no_vat` | Norwegian VAT Number |
255
+ # | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
256
+ # | Oman | `om_vat` | Omani VAT Number |
257
+ # | Paraguay | `py_ruc` | Paraguayan RUC Number |
258
+ # | Peru | `pe_ruc` | Peruvian RUC Number |
259
+ # | Philippines | `ph_tin` | Philippines Tax Identification Number |
260
+ # | Poland | `eu_vat` | European VAT Number |
261
+ # | Poland | `pl_nip` | Polish Tax ID Number |
262
+ # | Portugal | `eu_vat` | European VAT Number |
263
+ # | Romania | `eu_vat` | European VAT Number |
264
+ # | Romania | `ro_tin` | Romanian Tax ID Number |
265
+ # | Russia | `ru_inn` | Russian INN |
266
+ # | Russia | `ru_kpp` | Russian KPP |
267
+ # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
268
+ # | Senegal | `sn_ninea` | Senegal NINEA Number |
269
+ # | Serbia | `rs_pib` | Serbian PIB Number |
270
+ # | Singapore | `sg_gst` | Singaporean GST |
271
+ # | Singapore | `sg_uen` | Singaporean UEN |
272
+ # | Slovakia | `eu_vat` | European VAT Number |
273
+ # | Slovenia | `eu_vat` | European VAT Number |
274
+ # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
275
+ # | South Africa | `za_vat` | South African VAT Number |
276
+ # | South Korea | `kr_brn` | Korean BRN |
277
+ # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
278
+ # | Spain | `eu_vat` | European VAT Number |
279
+ # | Sri Lanka | `lk_vat` | Sri Lanka VAT Number |
280
+ # | Suriname | `sr_fin` | Suriname FIN Number |
281
+ # | Sweden | `eu_vat` | European VAT Number |
282
+ # | Switzerland | `ch_uid` | Switzerland UID Number |
283
+ # | Switzerland | `ch_vat` | Switzerland VAT Number |
284
+ # | Taiwan | `tw_vat` | Taiwanese VAT |
285
+ # | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number |
286
+ # | Tanzania | `tz_vat` | Tanzania VAT Number |
287
+ # | Thailand | `th_vat` | Thai VAT |
288
+ # | Turkey | `tr_tin` | Turkish Tax Identification Number |
289
+ # | Uganda | `ug_tin` | Uganda Tax Identification Number |
290
+ # | Ukraine | `ua_vat` | Ukrainian VAT |
291
+ # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
292
+ # | United Kingdom | `gb_vat` | United Kingdom VAT Number |
293
+ # | United States | `us_ein` | United States EIN |
294
+ # | Uruguay | `uy_ruc` | Uruguayan RUC Number |
295
+ # | Uzbekistan | `uz_tin` | Uzbekistan TIN Number |
296
+ # | Uzbekistan | `uz_vat` | Uzbekistan VAT Number |
297
+ # | Venezuela | `ve_rif` | Venezuelan RIF Number |
298
+ # | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
299
+ # | Zambia | `zm_tin` | Zambia Tax Identification Number |
300
+ # | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number |
301
+ sig { returns(T.nilable(Orb::CustomerTaxID)) }
302
+ attr_reader :customer_tax_id
303
+
304
+ sig do
305
+ params(customer_tax_id: T.nilable(Orb::CustomerTaxID::OrHash)).void
306
+ end
307
+ attr_writer :customer_tax_id
308
+
309
+ # When the invoice payment is due. The due date is null if the invoice is not yet
310
+ # finalized.
311
+ sig { returns(T.nilable(Time)) }
312
+ attr_accessor :due_date
313
+
314
+ # If the invoice has a status of `draft`, this will be the time that the invoice
315
+ # will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
316
+ # true, the invoice will automatically begin issuing at this time.
317
+ sig { returns(T.nilable(Time)) }
318
+ attr_accessor :eligible_to_issue_at
319
+
320
+ # A URL for the customer-facing invoice portal. This URL expires 60 days after the
321
+ # link is generated, or 30 days after the invoice's due date — whichever is later.
322
+ sig { returns(T.nilable(String)) }
323
+ attr_accessor :hosted_invoice_url
324
+
325
+ # The scheduled date of the invoice
326
+ sig { returns(Time) }
327
+ attr_accessor :invoice_date
328
+
329
+ # Automatically generated invoice number to help track and reconcile invoices.
330
+ # Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
331
+ # account or customer.
332
+ sig { returns(String) }
333
+ attr_accessor :invoice_number
334
+
335
+ # The link to download the PDF representation of the `Invoice`.
336
+ sig { returns(T.nilable(String)) }
337
+ attr_accessor :invoice_pdf
338
+
339
+ sig do
340
+ returns(
341
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::InvoiceSource::TaggedSymbol
342
+ )
343
+ end
344
+ attr_accessor :invoice_source
345
+
346
+ # If the invoice failed to issue, this will be the last time it failed to issue
347
+ # (even if it is now in a different state.)
348
+ sig { returns(T.nilable(Time)) }
349
+ attr_accessor :issue_failed_at
350
+
351
+ # If the invoice has been issued, this will be the time it transitioned to
352
+ # `issued` (even if it is now in a different state.)
353
+ sig { returns(T.nilable(Time)) }
354
+ attr_accessor :issued_at
355
+
356
+ # Free-form text which is available on the invoice PDF and the Orb invoice portal.
357
+ sig { returns(T.nilable(String)) }
358
+ attr_accessor :memo
359
+
360
+ # User specified key-value pairs for the resource. If not present, this defaults
361
+ # to an empty dictionary. Individual keys can be removed by setting the value to
362
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
363
+ # `null`.
364
+ sig { returns(T::Hash[Symbol, String]) }
365
+ attr_accessor :metadata
366
+
367
+ # If the invoice has a status of `paid`, this gives a timestamp when the invoice
368
+ # was paid.
369
+ sig { returns(T.nilable(Time)) }
370
+ attr_accessor :paid_at
371
+
372
+ # A list of payment attempts associated with the invoice
373
+ sig do
374
+ returns(
375
+ T::Array[
376
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::PaymentAttempt
377
+ ]
378
+ )
379
+ end
380
+ attr_accessor :payment_attempts
381
+
382
+ # If payment was attempted on this invoice but failed, this will be the time of
383
+ # the most recent attempt.
384
+ sig { returns(T.nilable(Time)) }
385
+ attr_accessor :payment_failed_at
386
+
387
+ # If payment was attempted on this invoice, this will be the start time of the
388
+ # most recent attempt. This field is especially useful for delayed-notification
389
+ # payment mechanisms (like bank transfers), where payment can take 3 days or more.
390
+ sig { returns(T.nilable(Time)) }
391
+ attr_accessor :payment_started_at
392
+
393
+ # If the invoice is in draft, this timestamp will reflect when the invoice is
394
+ # scheduled to be issued.
395
+ sig { returns(T.nilable(Time)) }
396
+ attr_accessor :scheduled_issue_at
397
+
398
+ sig { returns(T.nilable(Orb::Address)) }
399
+ attr_reader :shipping_address
400
+
401
+ sig { params(shipping_address: T.nilable(Orb::Address::OrHash)).void }
402
+ attr_writer :shipping_address
403
+
404
+ sig do
405
+ returns(
406
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::Status::TaggedSymbol
407
+ )
408
+ end
409
+ attr_accessor :status
410
+
411
+ sig { returns(T.nilable(Orb::SubscriptionMinified)) }
412
+ attr_reader :subscription
413
+
414
+ sig do
415
+ params(
416
+ subscription: T.nilable(Orb::SubscriptionMinified::OrHash)
417
+ ).void
418
+ end
419
+ attr_writer :subscription
420
+
421
+ # If the invoice failed to sync, this will be the last time an external invoicing
422
+ # provider sync was attempted. This field will always be `null` for invoices using
423
+ # Orb Invoicing.
424
+ sig { returns(T.nilable(Time)) }
425
+ attr_accessor :sync_failed_at
426
+
427
+ # The total after any minimums and discounts have been applied.
428
+ sig { returns(String) }
429
+ attr_accessor :total
430
+
431
+ # If the invoice has a status of `void`, this gives a timestamp when the invoice
432
+ # was voided.
433
+ sig { returns(T.nilable(Time)) }
434
+ attr_accessor :voided_at
435
+
436
+ # This is true if the invoice will be automatically issued in the future, and
437
+ # false otherwise.
438
+ sig { returns(T::Boolean) }
439
+ attr_accessor :will_auto_issue
440
+
441
+ # #InvoiceApiResourceWithoutLineItems
442
+ sig do
443
+ params(
444
+ id: String,
445
+ amount_due: String,
446
+ auto_collection:
447
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::AutoCollection::OrHash,
448
+ billing_address: T.nilable(Orb::Address::OrHash),
449
+ created_at: Time,
450
+ credit_notes:
451
+ T::Array[
452
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CreditNote::OrHash
453
+ ],
454
+ currency: String,
455
+ customer: Orb::CustomerMinified::OrHash,
456
+ customer_balance_transactions:
457
+ T::Array[
458
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::OrHash
459
+ ],
460
+ customer_tax_id: T.nilable(Orb::CustomerTaxID::OrHash),
461
+ due_date: T.nilable(Time),
462
+ eligible_to_issue_at: T.nilable(Time),
463
+ hosted_invoice_url: T.nilable(String),
464
+ invoice_date: Time,
465
+ invoice_number: String,
466
+ invoice_pdf: T.nilable(String),
467
+ invoice_source:
468
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::InvoiceSource::OrSymbol,
469
+ issue_failed_at: T.nilable(Time),
470
+ issued_at: T.nilable(Time),
471
+ memo: T.nilable(String),
472
+ metadata: T::Hash[Symbol, String],
473
+ paid_at: T.nilable(Time),
474
+ payment_attempts:
475
+ T::Array[
476
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::PaymentAttempt::OrHash
477
+ ],
478
+ payment_failed_at: T.nilable(Time),
479
+ payment_started_at: T.nilable(Time),
480
+ scheduled_issue_at: T.nilable(Time),
481
+ shipping_address: T.nilable(Orb::Address::OrHash),
482
+ status:
483
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::Status::OrSymbol,
484
+ subscription: T.nilable(Orb::SubscriptionMinified::OrHash),
485
+ sync_failed_at: T.nilable(Time),
486
+ total: String,
487
+ voided_at: T.nilable(Time),
488
+ will_auto_issue: T::Boolean
489
+ ).returns(T.attached_class)
490
+ end
491
+ def self.new(
492
+ id:,
493
+ # This is the final amount required to be charged to the customer and reflects the
494
+ # application of the customer balance to the `total` of the invoice.
495
+ amount_due:,
496
+ auto_collection:,
497
+ billing_address:,
498
+ # The creation time of the resource in Orb.
499
+ created_at:,
500
+ # A list of credit notes associated with the invoice
501
+ credit_notes:,
502
+ # An ISO 4217 currency string or `credits`
503
+ currency:,
504
+ customer:,
505
+ customer_balance_transactions:,
506
+ # Tax IDs are commonly required to be displayed on customer invoices, which are
507
+ # added to the headers of invoices.
508
+ #
509
+ # ### Supported Tax ID Countries and Types
510
+ #
511
+ # | Country | Type | Description |
512
+ # | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
513
+ # | Albania | `al_tin` | Albania Tax Identification Number |
514
+ # | Andorra | `ad_nrt` | Andorran NRT Number |
515
+ # | Angola | `ao_tin` | Angola Tax Identification Number |
516
+ # | Argentina | `ar_cuit` | Argentinian Tax ID Number |
517
+ # | Armenia | `am_tin` | Armenia Tax Identification Number |
518
+ # | Aruba | `aw_tin` | Aruba Tax Identification Number |
519
+ # | Australia | `au_abn` | Australian Business Number (AU ABN) |
520
+ # | Australia | `au_arn` | Australian Taxation Office Reference Number |
521
+ # | Austria | `eu_vat` | European VAT Number |
522
+ # | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number |
523
+ # | Bahamas | `bs_tin` | Bahamas Tax Identification Number |
524
+ # | Bahrain | `bh_vat` | Bahraini VAT Number |
525
+ # | Bangladesh | `bd_bin` | Bangladesh Business Identification Number |
526
+ # | Barbados | `bb_tin` | Barbados Tax Identification Number |
527
+ # | Belarus | `by_tin` | Belarus TIN Number |
528
+ # | Belgium | `eu_vat` | European VAT Number |
529
+ # | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) |
530
+ # | Bolivia | `bo_tin` | Bolivian Tax ID |
531
+ # | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number |
532
+ # | Brazil | `br_cnpj` | Brazilian CNPJ Number |
533
+ # | Brazil | `br_cpf` | Brazilian CPF Number |
534
+ # | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
535
+ # | Bulgaria | `eu_vat` | European VAT Number |
536
+ # | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) |
537
+ # | Cambodia | `kh_tin` | Cambodia Tax Identification Number |
538
+ # | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) |
539
+ # | Canada | `ca_bn` | Canadian BN |
540
+ # | Canada | `ca_gst_hst` | Canadian GST/HST Number |
541
+ # | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
542
+ # | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
543
+ # | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
544
+ # | Canada | `ca_qst` | Canadian QST Number (Québec) |
545
+ # | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) |
546
+ # | Chile | `cl_tin` | Chilean TIN |
547
+ # | China | `cn_tin` | Chinese Tax ID |
548
+ # | Colombia | `co_nit` | Colombian NIT Number |
549
+ # | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) |
550
+ # | Costa Rica | `cr_tin` | Costa Rican Tax ID |
551
+ # | Croatia | `eu_vat` | European VAT Number |
552
+ # | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) |
553
+ # | Cyprus | `eu_vat` | European VAT Number |
554
+ # | Czech Republic | `eu_vat` | European VAT Number |
555
+ # | Denmark | `eu_vat` | European VAT Number |
556
+ # | Dominican Republic | `do_rcn` | Dominican RCN Number |
557
+ # | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
558
+ # | Egypt | `eg_tin` | Egyptian Tax Identification Number |
559
+ # | El Salvador | `sv_nit` | El Salvadorian NIT Number |
560
+ # | Estonia | `eu_vat` | European VAT Number |
561
+ # | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
562
+ # | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
563
+ # | Faroe Islands | `fo_vat` | Faroe Islands VAT Number |
564
+ # | Finland | `eu_vat` | European VAT Number |
565
+ # | France | `eu_vat` | European VAT Number |
566
+ # | Georgia | `ge_vat` | Georgian VAT |
567
+ # | Germany | `de_stn` | German Tax Number (Steuernummer) |
568
+ # | Germany | `eu_vat` | European VAT Number |
569
+ # | Gibraltar | `gi_tin` | Gibraltar Tax Identification Number |
570
+ # | Greece | `eu_vat` | European VAT Number |
571
+ # | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
572
+ # | Hong Kong | `hk_br` | Hong Kong BR Number |
573
+ # | Hungary | `eu_vat` | European VAT Number |
574
+ # | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
575
+ # | Iceland | `is_vat` | Icelandic VAT |
576
+ # | India | `in_gst` | Indian GST Number |
577
+ # | Indonesia | `id_npwp` | Indonesian NPWP Number |
578
+ # | Ireland | `eu_vat` | European VAT Number |
579
+ # | Israel | `il_vat` | Israel VAT |
580
+ # | Italy | `eu_vat` | European VAT Number |
581
+ # | Italy | `it_cf` | Italian Codice Fiscale Number |
582
+ # | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
583
+ # | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
584
+ # | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
585
+ # | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
586
+ # | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
587
+ # | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number |
588
+ # | Laos | `la_tin` | Laos Tax Identification Number |
589
+ # | Latvia | `eu_vat` | European VAT Number |
590
+ # | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
591
+ # | Liechtenstein | `li_vat` | Liechtenstein VAT Number |
592
+ # | Lithuania | `eu_vat` | European VAT Number |
593
+ # | Luxembourg | `eu_vat` | European VAT Number |
594
+ # | Malaysia | `my_frp` | Malaysian FRP Number |
595
+ # | Malaysia | `my_itn` | Malaysian ITN |
596
+ # | Malaysia | `my_sst` | Malaysian SST Number |
597
+ # | Malta | `eu_vat` | European VAT Number |
598
+ # | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) |
599
+ # | Mexico | `mx_rfc` | Mexican RFC Number |
600
+ # | Moldova | `md_vat` | Moldova VAT Number |
601
+ # | Montenegro | `me_pib` | Montenegro PIB Number |
602
+ # | Morocco | `ma_vat` | Morocco VAT Number |
603
+ # | Nepal | `np_pan` | Nepal PAN Number |
604
+ # | Netherlands | `eu_vat` | European VAT Number |
605
+ # | New Zealand | `nz_gst` | New Zealand GST Number |
606
+ # | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
607
+ # | North Macedonia | `mk_vat` | North Macedonia VAT Number |
608
+ # | Northern Ireland | `eu_vat` | Northern Ireland VAT Number |
609
+ # | Norway | `no_vat` | Norwegian VAT Number |
610
+ # | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
611
+ # | Oman | `om_vat` | Omani VAT Number |
612
+ # | Paraguay | `py_ruc` | Paraguayan RUC Number |
613
+ # | Peru | `pe_ruc` | Peruvian RUC Number |
614
+ # | Philippines | `ph_tin` | Philippines Tax Identification Number |
615
+ # | Poland | `eu_vat` | European VAT Number |
616
+ # | Poland | `pl_nip` | Polish Tax ID Number |
617
+ # | Portugal | `eu_vat` | European VAT Number |
618
+ # | Romania | `eu_vat` | European VAT Number |
619
+ # | Romania | `ro_tin` | Romanian Tax ID Number |
620
+ # | Russia | `ru_inn` | Russian INN |
621
+ # | Russia | `ru_kpp` | Russian KPP |
622
+ # | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
623
+ # | Senegal | `sn_ninea` | Senegal NINEA Number |
624
+ # | Serbia | `rs_pib` | Serbian PIB Number |
625
+ # | Singapore | `sg_gst` | Singaporean GST |
626
+ # | Singapore | `sg_uen` | Singaporean UEN |
627
+ # | Slovakia | `eu_vat` | European VAT Number |
628
+ # | Slovenia | `eu_vat` | European VAT Number |
629
+ # | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
630
+ # | South Africa | `za_vat` | South African VAT Number |
631
+ # | South Korea | `kr_brn` | Korean BRN |
632
+ # | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
633
+ # | Spain | `eu_vat` | European VAT Number |
634
+ # | Sri Lanka | `lk_vat` | Sri Lanka VAT Number |
635
+ # | Suriname | `sr_fin` | Suriname FIN Number |
636
+ # | Sweden | `eu_vat` | European VAT Number |
637
+ # | Switzerland | `ch_uid` | Switzerland UID Number |
638
+ # | Switzerland | `ch_vat` | Switzerland VAT Number |
639
+ # | Taiwan | `tw_vat` | Taiwanese VAT |
640
+ # | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number |
641
+ # | Tanzania | `tz_vat` | Tanzania VAT Number |
642
+ # | Thailand | `th_vat` | Thai VAT |
643
+ # | Turkey | `tr_tin` | Turkish Tax Identification Number |
644
+ # | Uganda | `ug_tin` | Uganda Tax Identification Number |
645
+ # | Ukraine | `ua_vat` | Ukrainian VAT |
646
+ # | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
647
+ # | United Kingdom | `gb_vat` | United Kingdom VAT Number |
648
+ # | United States | `us_ein` | United States EIN |
649
+ # | Uruguay | `uy_ruc` | Uruguayan RUC Number |
650
+ # | Uzbekistan | `uz_tin` | Uzbekistan TIN Number |
651
+ # | Uzbekistan | `uz_vat` | Uzbekistan VAT Number |
652
+ # | Venezuela | `ve_rif` | Venezuelan RIF Number |
653
+ # | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
654
+ # | Zambia | `zm_tin` | Zambia Tax Identification Number |
655
+ # | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number |
656
+ customer_tax_id:,
657
+ # When the invoice payment is due. The due date is null if the invoice is not yet
658
+ # finalized.
659
+ due_date:,
660
+ # If the invoice has a status of `draft`, this will be the time that the invoice
661
+ # will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
662
+ # true, the invoice will automatically begin issuing at this time.
663
+ eligible_to_issue_at:,
664
+ # A URL for the customer-facing invoice portal. This URL expires 60 days after the
665
+ # link is generated, or 30 days after the invoice's due date — whichever is later.
666
+ hosted_invoice_url:,
667
+ # The scheduled date of the invoice
668
+ invoice_date:,
669
+ # Automatically generated invoice number to help track and reconcile invoices.
670
+ # Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
671
+ # account or customer.
672
+ invoice_number:,
673
+ # The link to download the PDF representation of the `Invoice`.
674
+ invoice_pdf:,
675
+ invoice_source:,
676
+ # If the invoice failed to issue, this will be the last time it failed to issue
677
+ # (even if it is now in a different state.)
678
+ issue_failed_at:,
679
+ # If the invoice has been issued, this will be the time it transitioned to
680
+ # `issued` (even if it is now in a different state.)
681
+ issued_at:,
682
+ # Free-form text which is available on the invoice PDF and the Orb invoice portal.
683
+ memo:,
684
+ # User specified key-value pairs for the resource. If not present, this defaults
685
+ # to an empty dictionary. Individual keys can be removed by setting the value to
686
+ # `null`, and the entire metadata mapping can be cleared by setting `metadata` to
687
+ # `null`.
688
+ metadata:,
689
+ # If the invoice has a status of `paid`, this gives a timestamp when the invoice
690
+ # was paid.
691
+ paid_at:,
692
+ # A list of payment attempts associated with the invoice
693
+ payment_attempts:,
694
+ # If payment was attempted on this invoice but failed, this will be the time of
695
+ # the most recent attempt.
696
+ payment_failed_at:,
697
+ # If payment was attempted on this invoice, this will be the start time of the
698
+ # most recent attempt. This field is especially useful for delayed-notification
699
+ # payment mechanisms (like bank transfers), where payment can take 3 days or more.
700
+ payment_started_at:,
701
+ # If the invoice is in draft, this timestamp will reflect when the invoice is
702
+ # scheduled to be issued.
703
+ scheduled_issue_at:,
704
+ shipping_address:,
705
+ status:,
706
+ subscription:,
707
+ # If the invoice failed to sync, this will be the last time an external invoicing
708
+ # provider sync was attempted. This field will always be `null` for invoices using
709
+ # Orb Invoicing.
710
+ sync_failed_at:,
711
+ # The total after any minimums and discounts have been applied.
712
+ total:,
713
+ # If the invoice has a status of `void`, this gives a timestamp when the invoice
714
+ # was voided.
715
+ voided_at:,
716
+ # This is true if the invoice will be automatically issued in the future, and
717
+ # false otherwise.
718
+ will_auto_issue:
719
+ )
720
+ end
721
+
722
+ sig do
723
+ override.returns(
724
+ {
725
+ id: String,
726
+ amount_due: String,
727
+ auto_collection:
728
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::AutoCollection,
729
+ billing_address: T.nilable(Orb::Address),
730
+ created_at: Time,
731
+ credit_notes:
732
+ T::Array[
733
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CreditNote
734
+ ],
735
+ currency: String,
736
+ customer: Orb::CustomerMinified,
737
+ customer_balance_transactions:
738
+ T::Array[
739
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction
740
+ ],
741
+ customer_tax_id: T.nilable(Orb::CustomerTaxID),
742
+ due_date: T.nilable(Time),
743
+ eligible_to_issue_at: T.nilable(Time),
744
+ hosted_invoice_url: T.nilable(String),
745
+ invoice_date: Time,
746
+ invoice_number: String,
747
+ invoice_pdf: T.nilable(String),
748
+ invoice_source:
749
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::InvoiceSource::TaggedSymbol,
750
+ issue_failed_at: T.nilable(Time),
751
+ issued_at: T.nilable(Time),
752
+ memo: T.nilable(String),
753
+ metadata: T::Hash[Symbol, String],
754
+ paid_at: T.nilable(Time),
755
+ payment_attempts:
756
+ T::Array[
757
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::PaymentAttempt
758
+ ],
759
+ payment_failed_at: T.nilable(Time),
760
+ payment_started_at: T.nilable(Time),
761
+ scheduled_issue_at: T.nilable(Time),
762
+ shipping_address: T.nilable(Orb::Address),
763
+ status:
764
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::Status::TaggedSymbol,
765
+ subscription: T.nilable(Orb::SubscriptionMinified),
766
+ sync_failed_at: T.nilable(Time),
767
+ total: String,
768
+ voided_at: T.nilable(Time),
769
+ will_auto_issue: T::Boolean
770
+ }
771
+ )
772
+ end
773
+ def to_hash
774
+ end
775
+
776
+ class AutoCollection < Orb::Internal::Type::BaseModel
777
+ OrHash =
778
+ T.type_alias do
779
+ T.any(
780
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::AutoCollection,
781
+ Orb::Internal::AnyHash
782
+ )
783
+ end
784
+
785
+ # True only if auto-collection is enabled for this invoice.
786
+ sig { returns(T.nilable(T::Boolean)) }
787
+ attr_accessor :enabled
788
+
789
+ # If the invoice is scheduled for auto-collection, this field will reflect when
790
+ # the next attempt will occur. If dunning has been exhausted, or auto-collection
791
+ # is not enabled for this invoice, this field will be `null`.
792
+ sig { returns(T.nilable(Time)) }
793
+ attr_accessor :next_attempt_at
794
+
795
+ # Number of auto-collection payment attempts.
796
+ sig { returns(T.nilable(Integer)) }
797
+ attr_accessor :num_attempts
798
+
799
+ # If Orb has ever attempted payment auto-collection for this invoice, this field
800
+ # will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
801
+ # this can be used to tell whether the invoice is currently in dunning (that is,
802
+ # `previously_attempted_at` is non-null, and `next_attempt_at` is non-null), or if
803
+ # dunning has been exhausted (`previously_attempted_at` is non-null, but
804
+ # `next_attempt_at` is null).
805
+ sig { returns(T.nilable(Time)) }
806
+ attr_accessor :previously_attempted_at
807
+
808
+ sig do
809
+ params(
810
+ enabled: T.nilable(T::Boolean),
811
+ next_attempt_at: T.nilable(Time),
812
+ num_attempts: T.nilable(Integer),
813
+ previously_attempted_at: T.nilable(Time)
814
+ ).returns(T.attached_class)
815
+ end
816
+ def self.new(
817
+ # True only if auto-collection is enabled for this invoice.
818
+ enabled:,
819
+ # If the invoice is scheduled for auto-collection, this field will reflect when
820
+ # the next attempt will occur. If dunning has been exhausted, or auto-collection
821
+ # is not enabled for this invoice, this field will be `null`.
822
+ next_attempt_at:,
823
+ # Number of auto-collection payment attempts.
824
+ num_attempts:,
825
+ # If Orb has ever attempted payment auto-collection for this invoice, this field
826
+ # will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
827
+ # this can be used to tell whether the invoice is currently in dunning (that is,
828
+ # `previously_attempted_at` is non-null, and `next_attempt_at` is non-null), or if
829
+ # dunning has been exhausted (`previously_attempted_at` is non-null, but
830
+ # `next_attempt_at` is null).
831
+ previously_attempted_at:
832
+ )
833
+ end
834
+
835
+ sig do
836
+ override.returns(
837
+ {
838
+ enabled: T.nilable(T::Boolean),
839
+ next_attempt_at: T.nilable(Time),
840
+ num_attempts: T.nilable(Integer),
841
+ previously_attempted_at: T.nilable(Time)
842
+ }
843
+ )
844
+ end
845
+ def to_hash
846
+ end
847
+ end
848
+
849
+ class CreditNote < Orb::Internal::Type::BaseModel
850
+ OrHash =
851
+ T.type_alias do
852
+ T.any(
853
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CreditNote,
854
+ Orb::Internal::AnyHash
855
+ )
856
+ end
857
+
858
+ sig { returns(String) }
859
+ attr_accessor :id
860
+
861
+ sig { returns(String) }
862
+ attr_accessor :credit_note_number
863
+
864
+ # An optional memo supplied on the credit note.
865
+ sig { returns(T.nilable(String)) }
866
+ attr_accessor :memo
867
+
868
+ sig { returns(String) }
869
+ attr_accessor :reason
870
+
871
+ sig { returns(String) }
872
+ attr_accessor :total
873
+
874
+ sig { returns(String) }
875
+ attr_accessor :type
876
+
877
+ # If the credit note has a status of `void`, this gives a timestamp when the
878
+ # credit note was voided.
879
+ sig { returns(T.nilable(Time)) }
880
+ attr_accessor :voided_at
881
+
882
+ sig do
883
+ params(
884
+ id: String,
885
+ credit_note_number: String,
886
+ memo: T.nilable(String),
887
+ reason: String,
888
+ total: String,
889
+ type: String,
890
+ voided_at: T.nilable(Time)
891
+ ).returns(T.attached_class)
892
+ end
893
+ def self.new(
894
+ id:,
895
+ credit_note_number:,
896
+ # An optional memo supplied on the credit note.
897
+ memo:,
898
+ reason:,
899
+ total:,
900
+ type:,
901
+ # If the credit note has a status of `void`, this gives a timestamp when the
902
+ # credit note was voided.
903
+ voided_at:
904
+ )
905
+ end
906
+
907
+ sig do
908
+ override.returns(
909
+ {
910
+ id: String,
911
+ credit_note_number: String,
912
+ memo: T.nilable(String),
913
+ reason: String,
914
+ total: String,
915
+ type: String,
916
+ voided_at: T.nilable(Time)
917
+ }
918
+ )
919
+ end
920
+ def to_hash
921
+ end
922
+ end
923
+
924
+ class CustomerBalanceTransaction < Orb::Internal::Type::BaseModel
925
+ OrHash =
926
+ T.type_alias do
927
+ T.any(
928
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction,
929
+ Orb::Internal::AnyHash
930
+ )
931
+ end
932
+
933
+ # A unique id for this transaction.
934
+ sig { returns(String) }
935
+ attr_accessor :id
936
+
937
+ sig do
938
+ returns(
939
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
940
+ )
941
+ end
942
+ attr_accessor :action
943
+
944
+ # The value of the amount changed in the transaction.
945
+ sig { returns(String) }
946
+ attr_accessor :amount
947
+
948
+ # The creation time of this transaction.
949
+ sig { returns(Time) }
950
+ attr_accessor :created_at
951
+
952
+ sig { returns(T.nilable(Orb::CreditNoteTiny)) }
953
+ attr_reader :credit_note
954
+
955
+ sig do
956
+ params(credit_note: T.nilable(Orb::CreditNoteTiny::OrHash)).void
957
+ end
958
+ attr_writer :credit_note
959
+
960
+ # An optional description provided for manual customer balance adjustments.
961
+ sig { returns(T.nilable(String)) }
962
+ attr_accessor :description
963
+
964
+ # The new value of the customer's balance prior to the transaction, in the
965
+ # customer's currency.
966
+ sig { returns(String) }
967
+ attr_accessor :ending_balance
968
+
969
+ sig { returns(T.nilable(Orb::InvoiceTiny)) }
970
+ attr_reader :invoice
971
+
972
+ sig { params(invoice: T.nilable(Orb::InvoiceTiny::OrHash)).void }
973
+ attr_writer :invoice
974
+
975
+ # The original value of the customer's balance prior to the transaction, in the
976
+ # customer's currency.
977
+ sig { returns(String) }
978
+ attr_accessor :starting_balance
979
+
980
+ sig do
981
+ returns(
982
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Type::TaggedSymbol
983
+ )
984
+ end
985
+ attr_accessor :type
986
+
987
+ sig do
988
+ params(
989
+ id: String,
990
+ action:
991
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::OrSymbol,
992
+ amount: String,
993
+ created_at: Time,
994
+ credit_note: T.nilable(Orb::CreditNoteTiny::OrHash),
995
+ description: T.nilable(String),
996
+ ending_balance: String,
997
+ invoice: T.nilable(Orb::InvoiceTiny::OrHash),
998
+ starting_balance: String,
999
+ type:
1000
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Type::OrSymbol
1001
+ ).returns(T.attached_class)
1002
+ end
1003
+ def self.new(
1004
+ # A unique id for this transaction.
1005
+ id:,
1006
+ action:,
1007
+ # The value of the amount changed in the transaction.
1008
+ amount:,
1009
+ # The creation time of this transaction.
1010
+ created_at:,
1011
+ credit_note:,
1012
+ # An optional description provided for manual customer balance adjustments.
1013
+ description:,
1014
+ # The new value of the customer's balance prior to the transaction, in the
1015
+ # customer's currency.
1016
+ ending_balance:,
1017
+ invoice:,
1018
+ # The original value of the customer's balance prior to the transaction, in the
1019
+ # customer's currency.
1020
+ starting_balance:,
1021
+ type:
1022
+ )
1023
+ end
1024
+
1025
+ sig do
1026
+ override.returns(
1027
+ {
1028
+ id: String,
1029
+ action:
1030
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol,
1031
+ amount: String,
1032
+ created_at: Time,
1033
+ credit_note: T.nilable(Orb::CreditNoteTiny),
1034
+ description: T.nilable(String),
1035
+ ending_balance: String,
1036
+ invoice: T.nilable(Orb::InvoiceTiny),
1037
+ starting_balance: String,
1038
+ type:
1039
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Type::TaggedSymbol
1040
+ }
1041
+ )
1042
+ end
1043
+ def to_hash
1044
+ end
1045
+
1046
+ module Action
1047
+ extend Orb::Internal::Type::Enum
1048
+
1049
+ TaggedSymbol =
1050
+ T.type_alias do
1051
+ T.all(
1052
+ Symbol,
1053
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action
1054
+ )
1055
+ end
1056
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1057
+
1058
+ APPLIED_TO_INVOICE =
1059
+ T.let(
1060
+ :applied_to_invoice,
1061
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1062
+ )
1063
+ MANUAL_ADJUSTMENT =
1064
+ T.let(
1065
+ :manual_adjustment,
1066
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1067
+ )
1068
+ PRORATED_REFUND =
1069
+ T.let(
1070
+ :prorated_refund,
1071
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1072
+ )
1073
+ REVERT_PRORATED_REFUND =
1074
+ T.let(
1075
+ :revert_prorated_refund,
1076
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1077
+ )
1078
+ RETURN_FROM_VOIDING =
1079
+ T.let(
1080
+ :return_from_voiding,
1081
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1082
+ )
1083
+ CREDIT_NOTE_APPLIED =
1084
+ T.let(
1085
+ :credit_note_applied,
1086
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1087
+ )
1088
+ CREDIT_NOTE_VOIDED =
1089
+ T.let(
1090
+ :credit_note_voided,
1091
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1092
+ )
1093
+ OVERPAYMENT_REFUND =
1094
+ T.let(
1095
+ :overpayment_refund,
1096
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1097
+ )
1098
+ EXTERNAL_PAYMENT =
1099
+ T.let(
1100
+ :external_payment,
1101
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1102
+ )
1103
+ SMALL_INVOICE_CARRYOVER =
1104
+ T.let(
1105
+ :small_invoice_carryover,
1106
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1107
+ )
1108
+ PREPAID_COMMIT_CANCEL =
1109
+ T.let(
1110
+ :prepaid_commit_cancel,
1111
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1112
+ )
1113
+
1114
+ sig do
1115
+ override.returns(
1116
+ T::Array[
1117
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Action::TaggedSymbol
1118
+ ]
1119
+ )
1120
+ end
1121
+ def self.values
1122
+ end
1123
+ end
1124
+
1125
+ module Type
1126
+ extend Orb::Internal::Type::Enum
1127
+
1128
+ TaggedSymbol =
1129
+ T.type_alias do
1130
+ T.all(
1131
+ Symbol,
1132
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Type
1133
+ )
1134
+ end
1135
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1136
+
1137
+ INCREMENT =
1138
+ T.let(
1139
+ :increment,
1140
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Type::TaggedSymbol
1141
+ )
1142
+ DECREMENT =
1143
+ T.let(
1144
+ :decrement,
1145
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Type::TaggedSymbol
1146
+ )
1147
+
1148
+ sig do
1149
+ override.returns(
1150
+ T::Array[
1151
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::CustomerBalanceTransaction::Type::TaggedSymbol
1152
+ ]
1153
+ )
1154
+ end
1155
+ def self.values
1156
+ end
1157
+ end
1158
+ end
1159
+
1160
+ module InvoiceSource
1161
+ extend Orb::Internal::Type::Enum
1162
+
1163
+ TaggedSymbol =
1164
+ T.type_alias do
1165
+ T.all(
1166
+ Symbol,
1167
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::InvoiceSource
1168
+ )
1169
+ end
1170
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1171
+
1172
+ SUBSCRIPTION =
1173
+ T.let(
1174
+ :subscription,
1175
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::InvoiceSource::TaggedSymbol
1176
+ )
1177
+ PARTIAL =
1178
+ T.let(
1179
+ :partial,
1180
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::InvoiceSource::TaggedSymbol
1181
+ )
1182
+ ONE_OFF =
1183
+ T.let(
1184
+ :one_off,
1185
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::InvoiceSource::TaggedSymbol
1186
+ )
1187
+
1188
+ sig do
1189
+ override.returns(
1190
+ T::Array[
1191
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::InvoiceSource::TaggedSymbol
1192
+ ]
1193
+ )
1194
+ end
1195
+ def self.values
1196
+ end
1197
+ end
1198
+
1199
+ class PaymentAttempt < Orb::Internal::Type::BaseModel
1200
+ OrHash =
1201
+ T.type_alias do
1202
+ T.any(
1203
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::PaymentAttempt,
1204
+ Orb::Internal::AnyHash
1205
+ )
1206
+ end
1207
+
1208
+ # The ID of the payment attempt.
1209
+ sig { returns(String) }
1210
+ attr_accessor :id
1211
+
1212
+ # The amount of the payment attempt.
1213
+ sig { returns(String) }
1214
+ attr_accessor :amount
1215
+
1216
+ # The time at which the payment attempt was created.
1217
+ sig { returns(Time) }
1218
+ attr_accessor :created_at
1219
+
1220
+ # The payment provider that attempted to collect the payment.
1221
+ sig do
1222
+ returns(
1223
+ T.nilable(
1224
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::PaymentAttempt::PaymentProvider::TaggedSymbol
1225
+ )
1226
+ )
1227
+ end
1228
+ attr_accessor :payment_provider
1229
+
1230
+ # The ID of the payment attempt in the payment provider.
1231
+ sig { returns(T.nilable(String)) }
1232
+ attr_accessor :payment_provider_id
1233
+
1234
+ # URL to the downloadable PDF version of the receipt. This field will be `null`
1235
+ # for payment attempts that did not succeed.
1236
+ sig { returns(T.nilable(String)) }
1237
+ attr_accessor :receipt_pdf
1238
+
1239
+ # Whether the payment attempt succeeded.
1240
+ sig { returns(T::Boolean) }
1241
+ attr_accessor :succeeded
1242
+
1243
+ sig do
1244
+ params(
1245
+ id: String,
1246
+ amount: String,
1247
+ created_at: Time,
1248
+ payment_provider:
1249
+ T.nilable(
1250
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::PaymentAttempt::PaymentProvider::OrSymbol
1251
+ ),
1252
+ payment_provider_id: T.nilable(String),
1253
+ receipt_pdf: T.nilable(String),
1254
+ succeeded: T::Boolean
1255
+ ).returns(T.attached_class)
1256
+ end
1257
+ def self.new(
1258
+ # The ID of the payment attempt.
1259
+ id:,
1260
+ # The amount of the payment attempt.
1261
+ amount:,
1262
+ # The time at which the payment attempt was created.
1263
+ created_at:,
1264
+ # The payment provider that attempted to collect the payment.
1265
+ payment_provider:,
1266
+ # The ID of the payment attempt in the payment provider.
1267
+ payment_provider_id:,
1268
+ # URL to the downloadable PDF version of the receipt. This field will be `null`
1269
+ # for payment attempts that did not succeed.
1270
+ receipt_pdf:,
1271
+ # Whether the payment attempt succeeded.
1272
+ succeeded:
1273
+ )
1274
+ end
1275
+
1276
+ sig do
1277
+ override.returns(
1278
+ {
1279
+ id: String,
1280
+ amount: String,
1281
+ created_at: Time,
1282
+ payment_provider:
1283
+ T.nilable(
1284
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::PaymentAttempt::PaymentProvider::TaggedSymbol
1285
+ ),
1286
+ payment_provider_id: T.nilable(String),
1287
+ receipt_pdf: T.nilable(String),
1288
+ succeeded: T::Boolean
1289
+ }
1290
+ )
1291
+ end
1292
+ def to_hash
1293
+ end
1294
+
1295
+ # The payment provider that attempted to collect the payment.
1296
+ module PaymentProvider
1297
+ extend Orb::Internal::Type::Enum
1298
+
1299
+ TaggedSymbol =
1300
+ T.type_alias do
1301
+ T.all(
1302
+ Symbol,
1303
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::PaymentAttempt::PaymentProvider
1304
+ )
1305
+ end
1306
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1307
+
1308
+ STRIPE =
1309
+ T.let(
1310
+ :stripe,
1311
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::PaymentAttempt::PaymentProvider::TaggedSymbol
1312
+ )
1313
+ ADYEN =
1314
+ T.let(
1315
+ :adyen,
1316
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::PaymentAttempt::PaymentProvider::TaggedSymbol
1317
+ )
1318
+
1319
+ sig do
1320
+ override.returns(
1321
+ T::Array[
1322
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::PaymentAttempt::PaymentProvider::TaggedSymbol
1323
+ ]
1324
+ )
1325
+ end
1326
+ def self.values
1327
+ end
1328
+ end
1329
+ end
1330
+
1331
+ module Status
1332
+ extend Orb::Internal::Type::Enum
1333
+
1334
+ TaggedSymbol =
1335
+ T.type_alias do
1336
+ T.all(
1337
+ Symbol,
1338
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::Status
1339
+ )
1340
+ end
1341
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1342
+
1343
+ ISSUED =
1344
+ T.let(
1345
+ :issued,
1346
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::Status::TaggedSymbol
1347
+ )
1348
+ PAID =
1349
+ T.let(
1350
+ :paid,
1351
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::Status::TaggedSymbol
1352
+ )
1353
+ SYNCED =
1354
+ T.let(
1355
+ :synced,
1356
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::Status::TaggedSymbol
1357
+ )
1358
+ VOID =
1359
+ T.let(
1360
+ :void,
1361
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::Status::TaggedSymbol
1362
+ )
1363
+ DRAFT =
1364
+ T.let(
1365
+ :draft,
1366
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::Status::TaggedSymbol
1367
+ )
1368
+
1369
+ sig do
1370
+ override.returns(
1371
+ T::Array[
1372
+ Orb::InvoiceIssuedSummaryWebhookEvent::Invoice::Status::TaggedSymbol
1373
+ ]
1374
+ )
1375
+ end
1376
+ def self.values
1377
+ end
1378
+ end
1379
+ end
1380
+
1381
+ class Properties < Orb::Internal::Type::BaseModel
1382
+ OrHash =
1383
+ T.type_alias do
1384
+ T.any(
1385
+ Orb::InvoiceIssuedSummaryWebhookEvent::Properties,
1386
+ Orb::Internal::AnyHash
1387
+ )
1388
+ end
1389
+
1390
+ sig { returns(T::Boolean) }
1391
+ attr_accessor :automatically_marked_as_paid
1392
+
1393
+ sig do
1394
+ params(automatically_marked_as_paid: T::Boolean).returns(
1395
+ T.attached_class
1396
+ )
1397
+ end
1398
+ def self.new(automatically_marked_as_paid:)
1399
+ end
1400
+
1401
+ sig { override.returns({ automatically_marked_as_paid: T::Boolean }) }
1402
+ def to_hash
1403
+ end
1404
+ end
1405
+
1406
+ # The event this payload describes.
1407
+ module Type
1408
+ extend Orb::Internal::Type::Enum
1409
+
1410
+ TaggedSymbol =
1411
+ T.type_alias do
1412
+ T.all(Symbol, Orb::InvoiceIssuedSummaryWebhookEvent::Type)
1413
+ end
1414
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1415
+
1416
+ INVOICE_ISSUED_SUMMARY =
1417
+ T.let(
1418
+ :"invoice.issued_summary",
1419
+ Orb::InvoiceIssuedSummaryWebhookEvent::Type::TaggedSymbol
1420
+ )
1421
+
1422
+ sig do
1423
+ override.returns(
1424
+ T::Array[Orb::InvoiceIssuedSummaryWebhookEvent::Type::TaggedSymbol]
1425
+ )
1426
+ end
1427
+ def self.values
1428
+ end
1429
+ end
1430
+ end
1431
+ end
1432
+ end