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