From a11c7c89c80081ae902ca3ba82713bc0ba635230 Mon Sep 17 00:00:00 2001 From: lucassus Date: Fri, 13 Mar 2026 15:16:06 +0000 Subject: [PATCH 1/9] Automated commit message --- lib/advanced_billing.rb | 790 +++++++++--------- .../utilities/union_type_lookup.rb | 462 +++++----- 2 files changed, 626 insertions(+), 626 deletions(-) diff --git a/lib/advanced_billing.rb b/lib/advanced_billing.rb index f78f9ed..5cb171b 100644 --- a/lib/advanced_billing.rb +++ b/lib/advanced_billing.rb @@ -31,681 +31,681 @@ # Models require_relative 'advanced_billing/models/base_model' require_relative 'advanced_billing/models/payment_method_apple_pay' -require_relative 'advanced_billing/models/payment_method_bank_account' +require_relative 'advanced_billing/models/refund_invoice_event' +require_relative 'advanced_billing/models/void_invoice_event' +require_relative 'advanced_billing/models/list_invoice_events_response' +require_relative 'advanced_billing/models/bank_account_payment_profile' +require_relative 'advanced_billing/models/credit_card_payment_profile' +require_relative 'advanced_billing/models/account_balance' +require_relative 'advanced_billing/models/activate_event_based_component' +require_relative 'advanced_billing/models/allocate_components' +require_relative 'advanced_billing/models/allocation_preview_item' require_relative 'advanced_billing/models/payment_method_credit_card' -require_relative 'advanced_billing/models/payment_method_external' -require_relative 'advanced_billing/models/payment_method_paypal' require_relative 'advanced_billing/models/apply_credit_note_event' require_relative 'advanced_billing/models/apply_debit_note_event' -require_relative 'advanced_billing/models/apply_payment_event' -require_relative 'advanced_billing/models/backport_invoice_event' require_relative 'advanced_billing/models/change_chargeback_status_event' +require_relative 'advanced_billing/models/create_credit_note_event' +require_relative 'advanced_billing/models/remove_payment_event' +require_relative 'advanced_billing/models/paypal_payment_profile' +require_relative 'advanced_billing/models/add_subscription_to_a_group' +require_relative 'advanced_billing/models/address_change' +require_relative 'advanced_billing/models/allocation' +require_relative 'advanced_billing/models/payment_method_bank_account' +require_relative 'advanced_billing/models/payment_method_external' +require_relative 'advanced_billing/models/backport_invoice_event' +require_relative 'advanced_billing/models/void_remainder_event' +require_relative 'advanced_billing/models/allocation_expiration_date' +require_relative 'advanced_billing/models/payment_method_paypal' +require_relative 'advanced_billing/models/apply_payment_event' require_relative 'advanced_billing/models/' \ 'change_invoice_collection_method_event' require_relative 'advanced_billing/models/change_invoice_status_event' -require_relative 'advanced_billing/models/create_credit_note_event' require_relative 'advanced_billing/models/create_debit_note_event' require_relative 'advanced_billing/models/failed_payment_event' require_relative 'advanced_billing/models/issue_invoice_event' -require_relative 'advanced_billing/models/refund_invoice_event' -require_relative 'advanced_billing/models/remove_payment_event' -require_relative 'advanced_billing/models/void_invoice_event' -require_relative 'advanced_billing/models/void_remainder_event' -require_relative 'advanced_billing/models/list_invoice_events_response' require_relative 'advanced_billing/models/apple_pay_payment_profile' -require_relative 'advanced_billing/models/bank_account_payment_profile' -require_relative 'advanced_billing/models/credit_card_payment_profile' -require_relative 'advanced_billing/models/paypal_payment_profile' -require_relative 'advanced_billing/models/account_balance' require_relative 'advanced_billing/models/account_balances' require_relative 'advanced_billing/models/ach_agreement' -require_relative 'advanced_billing/models/activate_event_based_component' require_relative 'advanced_billing/models/activate_subscription_request' require_relative 'advanced_billing/models/add_coupons_request' -require_relative 'advanced_billing/models/add_subscription_to_a_group' -require_relative 'advanced_billing/models/address_change' require_relative 'advanced_billing/models/agreement_acceptance' -require_relative 'advanced_billing/models/allocate_components' -require_relative 'advanced_billing/models/allocation' -require_relative 'advanced_billing/models/allocation_expiration_date' require_relative 'advanced_billing/models/allocation_preview' -require_relative 'advanced_billing/models/allocation_preview_item' require_relative 'advanced_billing/models/allocation_preview_line_item' -require_relative 'advanced_billing/models/allocation_preview_response' +require_relative 'advanced_billing/models/apply_debit_note_event_data' +require_relative 'advanced_billing/models/bank_account_attributes' +require_relative 'advanced_billing/models/base_string_error' +require_relative 'advanced_billing/models/batch_job' +require_relative 'advanced_billing/models/' \ + 'bulk_create_product_price_points_response' +require_relative 'advanced_billing/models/chargify_ebb' +require_relative 'advanced_billing/models/component_allocation_change' +require_relative 'advanced_billing/models/component_allocation_error_item' +require_relative 'advanced_billing/models/component_custom_price' require_relative 'advanced_billing/models/allocation_response' require_relative 'advanced_billing/models/allocation_settings' require_relative 'advanced_billing/models/applied_credit_note_data' -require_relative 'advanced_billing/models/apply_credit_note_event_data' -require_relative 'advanced_billing/models/apply_debit_note_event_data' -require_relative 'advanced_billing/models/apply_payment_event_data' require_relative 'advanced_billing/models/attribute_error' require_relative 'advanced_billing/models/auto_resume' -require_relative 'advanced_billing/models/available_actions' -require_relative 'advanced_billing/models/bank_account_attributes' -require_relative 'advanced_billing/models/bank_account_response' require_relative 'advanced_billing/models/bank_account_verification' -require_relative 'advanced_billing/models/bank_account_verification_request' -require_relative 'advanced_billing/models/base_refund_error' -require_relative 'advanced_billing/models/base_string_error' -require_relative 'advanced_billing/models/batch_job_response' -require_relative 'advanced_billing/models/batch_job' -require_relative 'advanced_billing/models/billing_manifest' -require_relative 'advanced_billing/models/billing_manifest_item' require_relative 'advanced_billing/models/billing_schedule' require_relative 'advanced_billing/models/breakouts' require_relative 'advanced_billing/models/' \ 'bulk_components_price_point_assignment' require_relative 'advanced_billing/models/' \ 'bulk_create_product_price_points_request' -require_relative 'advanced_billing/models/' \ - 'bulk_create_product_price_points_response' -require_relative 'advanced_billing/models/bulk_create_segments' -require_relative 'advanced_billing/models/bulk_update_segments' -require_relative 'advanced_billing/models/bulk_update_segments_item' -require_relative 'advanced_billing/models/calendar_billing' -require_relative 'advanced_billing/models/cancel_grouped_subscriptions_request' require_relative 'advanced_billing/models/cancellation_options' require_relative 'advanced_billing/models/cancellation_request' -require_relative 'advanced_billing/models/change_chargeback_status_event_data' require_relative 'advanced_billing/models/' \ 'change_invoice_collection_method_event_data' require_relative 'advanced_billing/models/change_invoice_status_event_data' -require_relative 'advanced_billing/models/chargify_ebb' +require_relative 'advanced_billing/models/component_currency_price' +require_relative 'advanced_billing/models/allocation_preview_response' +require_relative 'advanced_billing/models/apply_credit_note_event_data' +require_relative 'advanced_billing/models/apply_payment_event_data' +require_relative 'advanced_billing/models/available_actions' +require_relative 'advanced_billing/models/bank_account_response' +require_relative 'advanced_billing/models/batch_job_response' +require_relative 'advanced_billing/models/calendar_billing' +require_relative 'advanced_billing/models/change_chargeback_status_event_data' +require_relative 'advanced_billing/models/component' +require_relative 'advanced_billing/models/component_currency_prices_response' +require_relative 'advanced_billing/models/component_price' +require_relative 'advanced_billing/models/bank_account_verification_request' +require_relative 'advanced_billing/models/base_refund_error' +require_relative 'advanced_billing/models/billing_manifest' +require_relative 'advanced_billing/models/billing_manifest_item' +require_relative 'advanced_billing/models/bulk_create_segments' +require_relative 'advanced_billing/models/bulk_update_segments' +require_relative 'advanced_billing/models/bulk_update_segments_item' +require_relative 'advanced_billing/models/cancel_grouped_subscriptions_request' require_relative 'advanced_billing/models/clone_component_price_point' require_relative 'advanced_billing/models/clone_component_price_point_request' -require_relative 'advanced_billing/models/component' -require_relative 'advanced_billing/models/component_allocation_change' -require_relative 'advanced_billing/models/component_allocation_error_item' require_relative 'advanced_billing/models/component_cost_data' require_relative 'advanced_billing/models/component_cost_data_rate_tier' -require_relative 'advanced_billing/models/component_currency_price' -require_relative 'advanced_billing/models/component_currency_prices_response' -require_relative 'advanced_billing/models/component_custom_price' -require_relative 'advanced_billing/models/component_price' require_relative 'advanced_billing/models/component_price_point' -require_relative 'advanced_billing/models/component_price_point_assignment' -require_relative 'advanced_billing/models/' \ - 'component_price_point_currency_overage_response' require_relative 'advanced_billing/models/component_price_point_item' -require_relative 'advanced_billing/models/component_price_point_response' require_relative 'advanced_billing/models/component_price_points_response' -require_relative 'advanced_billing/models/component_price_point_error_item' require_relative 'advanced_billing/models/component_response' require_relative 'advanced_billing/models/consolidated_invoice' -require_relative 'advanced_billing/models/contract' require_relative 'advanced_billing/models/count_response' require_relative 'advanced_billing/models/coupon' -require_relative 'advanced_billing/models/coupon_currency' require_relative 'advanced_billing/models/coupon_currency_request' -require_relative 'advanced_billing/models/coupon_currency_response' -require_relative 'advanced_billing/models/coupon_payload' -require_relative 'advanced_billing/models/coupon_request' require_relative 'advanced_billing/models/coupon_response' -require_relative 'advanced_billing/models/coupon_restriction' -require_relative 'advanced_billing/models/coupon_subcodes' -require_relative 'advanced_billing/models/coupon_subcodes_response' require_relative 'advanced_billing/models/coupon_usage' require_relative 'advanced_billing/models/create_allocation' -require_relative 'advanced_billing/models/create_allocation_request' -require_relative 'advanced_billing/models/create_component_price_point' -require_relative 'advanced_billing/models/create_component_price_point_request' -require_relative 'advanced_billing/models/create_component_price_points_request' -require_relative 'advanced_billing/models/create_currency_price' require_relative 'advanced_billing/models/create_currency_prices_request' -require_relative 'advanced_billing/models/create_customer' -require_relative 'advanced_billing/models/create_customer_request' -require_relative 'advanced_billing/models/create_ebb_component' +require_relative 'advanced_billing/models/create_invoice_payment_application' +require_relative 'advanced_billing/models/create_metadata' +require_relative 'advanced_billing/models/create_metafield' +require_relative 'advanced_billing/models/create_multi_invoice_payment' +require_relative 'advanced_billing/models/create_offer' +require_relative 'advanced_billing/models/create_or_update_endpoint' +require_relative 'advanced_billing/models/create_payment_profile_request' +require_relative 'advanced_billing/models/create_prepayment' +require_relative 'advanced_billing/models/create_product_family' +require_relative 'advanced_billing/models/create_product_family_request' +require_relative 'advanced_billing/models/create_usage_request' +require_relative 'advanced_billing/models/credit_note' +require_relative 'advanced_billing/models/credit_note_application' +require_relative 'advanced_billing/models/deduct_service_credit_request' +require_relative 'advanced_billing/models/deliver_proforma_invoice_request' +require_relative 'advanced_billing/models/dunner_data' +require_relative 'advanced_billing/models/dunning_step_reached' +require_relative 'advanced_billing/models/ebb_component' +require_relative 'advanced_billing/models/ebb_event' +require_relative 'advanced_billing/models/enable_webhooks_request' +require_relative 'advanced_billing/models/enable_webhooks_response' +require_relative 'advanced_billing/models/invoice_discount' +require_relative 'advanced_billing/models/invoice_line_item' +require_relative 'advanced_billing/models/invoice_previous_balance' +require_relative 'advanced_billing/models/invoice_refund' +require_relative 'advanced_billing/models/coupon_request' +require_relative 'advanced_billing/models/create_currency_price' require_relative 'advanced_billing/models/create_invoice' require_relative 'advanced_billing/models/create_invoice_address' +require_relative 'advanced_billing/models/create_offer_request' +require_relative 'advanced_billing/models/create_or_update_product' +require_relative 'advanced_billing/models/create_prepaid_component' +require_relative 'advanced_billing/models/' \ + 'create_prepaid_usage_component_price_point' +require_relative 'advanced_billing/models/create_subscription_group_request' +require_relative 'advanced_billing/models/create_usage' +require_relative 'advanced_billing/models/customer_attributes' +require_relative 'advanced_billing/models/customer_error' +require_relative 'advanced_billing/models/delete_subscription_group_response' +require_relative 'advanced_billing/models/errors' +require_relative 'advanced_billing/models/event_based_billing_segment_error' +require_relative 'advanced_billing/models/failed_payment_event_data' +require_relative 'advanced_billing/models/invoice_balance_item' +require_relative 'advanced_billing/models/invoice_credit' +require_relative 'advanced_billing/models/invoice_line_item_component_cost_data' +require_relative 'advanced_billing/models/invoice_payer' +require_relative 'advanced_billing/models/invoice_payment' +require_relative 'advanced_billing/models/invoice_payment_application' +require_relative 'advanced_billing/models/invoice_pre_payment' +require_relative 'advanced_billing/models/invoice_seller' +require_relative 'advanced_billing/models/component_price_point_error_item' +require_relative 'advanced_billing/models/coupon_payload' +require_relative 'advanced_billing/models/coupon_subcodes' +require_relative 'advanced_billing/models/coupon_subcodes_response' +require_relative 'advanced_billing/models/create_component_price_point_request' +require_relative 'advanced_billing/models/create_customer' +require_relative 'advanced_billing/models/create_ebb_component' require_relative 'advanced_billing/models/create_invoice_coupon' -require_relative 'advanced_billing/models/create_invoice_item' require_relative 'advanced_billing/models/create_invoice_payment' -require_relative 'advanced_billing/models/create_invoice_payment_application' require_relative 'advanced_billing/models/create_invoice_payment_request' require_relative 'advanced_billing/models/create_invoice_request' -require_relative 'advanced_billing/models/create_metadata' -require_relative 'advanced_billing/models/create_metadata_request' -require_relative 'advanced_billing/models/create_metafield' require_relative 'advanced_billing/models/create_metafields_request' -require_relative 'advanced_billing/models/create_metered_component' -require_relative 'advanced_billing/models/create_multi_invoice_payment' require_relative 'advanced_billing/models/create_multi_invoice_payment_request' -require_relative 'advanced_billing/models/create_offer' require_relative 'advanced_billing/models/create_offer_component' -require_relative 'advanced_billing/models/create_offer_request' -require_relative 'advanced_billing/models/create_on_off_component' -require_relative 'advanced_billing/models/create_or_update_endpoint' require_relative 'advanced_billing/models/create_or_update_endpoint_request' -require_relative 'advanced_billing/models/create_or_update_product' -require_relative 'advanced_billing/models/create_or_update_product_request' require_relative 'advanced_billing/models/create_or_update_segment_price' require_relative 'advanced_billing/models/create_payment' -require_relative 'advanced_billing/models/create_payment_profile' -require_relative 'advanced_billing/models/create_payment_profile_request' -require_relative 'advanced_billing/models/create_prepaid_component' -require_relative 'advanced_billing/models/' \ - 'create_prepaid_usage_component_price_point' -require_relative 'advanced_billing/models/create_prepayment' -require_relative 'advanced_billing/models/create_prepayment_request' require_relative 'advanced_billing/models/create_prepayment_response' -require_relative 'advanced_billing/models/create_product_currency_price' require_relative 'advanced_billing/models/' \ 'create_product_currency_prices_request' -require_relative 'advanced_billing/models/create_product_family' -require_relative 'advanced_billing/models/create_product_family_request' -require_relative 'advanced_billing/models/create_product_price_point' require_relative 'advanced_billing/models/create_product_price_point_request' require_relative 'advanced_billing/models/create_quantity_based_component' require_relative 'advanced_billing/models/create_reason_code' -require_relative 'advanced_billing/models/create_reason_code_request' require_relative 'advanced_billing/models/create_segment' require_relative 'advanced_billing/models/create_segment_request' -require_relative 'advanced_billing/models/create_subscription' -require_relative 'advanced_billing/models/create_subscription_component' -require_relative 'advanced_billing/models/create_subscription_group' -require_relative 'advanced_billing/models/create_subscription_group_request' -require_relative 'advanced_billing/models/create_subscription_request' -require_relative 'advanced_billing/models/create_usage' -require_relative 'advanced_billing/models/create_usage_request' -require_relative 'advanced_billing/models/created_prepayment' require_relative 'advanced_billing/models/credit_account_balance_changed' -require_relative 'advanced_billing/models/credit_card_attributes' -require_relative 'advanced_billing/models/credit_note' -require_relative 'advanced_billing/models/credit_note_application' require_relative 'advanced_billing/models/credit_note_line_item' -require_relative 'advanced_billing/models/credit_scheme_request' require_relative 'advanced_billing/models/currency_overage_prices' -require_relative 'advanced_billing/models/currency_price' require_relative 'advanced_billing/models/currency_prices_response' require_relative 'advanced_billing/models/custom_field_value_change' require_relative 'advanced_billing/models/customer' -require_relative 'advanced_billing/models/customer_attributes' require_relative 'advanced_billing/models/customer_change' require_relative 'advanced_billing/models/customer_changes_preview_response' -require_relative 'advanced_billing/models/customer_custom_fields_change' -require_relative 'advanced_billing/models/customer_error' require_relative 'advanced_billing/models/customer_payer_change' -require_relative 'advanced_billing/models/customer_response' -require_relative 'advanced_billing/models/debit_note' -require_relative 'advanced_billing/models/deduct_service_credit' -require_relative 'advanced_billing/models/deduct_service_credit_request' require_relative 'advanced_billing/models/delayed_cancellation_response' -require_relative 'advanced_billing/models/delete_subscription_group_response' -require_relative 'advanced_billing/models/deliver_proforma_invoice_request' -require_relative 'advanced_billing/models/dunner_data' require_relative 'advanced_billing/models/dunning_step_data' -require_relative 'advanced_billing/models/dunning_step_reached' -require_relative 'advanced_billing/models/ebb_component' -require_relative 'advanced_billing/models/ebb_event' -require_relative 'advanced_billing/models/enable_webhooks_request' -require_relative 'advanced_billing/models/enable_webhooks_response' require_relative 'advanced_billing/models/endpoint' -require_relative 'advanced_billing/models/endpoint_response' -require_relative 'advanced_billing/models/errors' -require_relative 'advanced_billing/models/event' -require_relative 'advanced_billing/models/event_based_billing_segment_error' require_relative 'advanced_billing/models/event_response' -require_relative 'advanced_billing/models/failed_payment_event_data' require_relative 'advanced_billing/models/full_subscription_group_response' -require_relative 'advanced_billing/models/get_one_time_token_payment_profile' -require_relative 'advanced_billing/models/get_one_time_token_request' -require_relative 'advanced_billing/models/group_billing' require_relative 'advanced_billing/models/group_settings' require_relative 'advanced_billing/models/group_target' require_relative 'advanced_billing/models/historic_usage' -require_relative 'advanced_billing/models/invoice' -require_relative 'advanced_billing/models/invoice_address' -require_relative 'advanced_billing/models/invoice_avatax_details' -require_relative 'advanced_billing/models/invoice_balance_item' -require_relative 'advanced_billing/models/invoice_credit' -require_relative 'advanced_billing/models/invoice_custom_field' -require_relative 'advanced_billing/models/invoice_customer' -require_relative 'advanced_billing/models/invoice_debit' -require_relative 'advanced_billing/models/invoice_discount' -require_relative 'advanced_billing/models/invoice_discount_breakout' -require_relative 'advanced_billing/models/invoice_display_settings' -require_relative 'advanced_billing/models/invoice_issued' -require_relative 'advanced_billing/models/invoice_line_item' -require_relative 'advanced_billing/models/invoice_line_item_component_cost_data' -require_relative 'advanced_billing/models/invoice_line_item_event_data' +require_relative 'advanced_billing/models/component_price_point_assignment' +require_relative 'advanced_billing/models/' \ + 'component_price_point_currency_overage_response' +require_relative 'advanced_billing/models/component_price_point_response' +require_relative 'advanced_billing/models/contract' +require_relative 'advanced_billing/models/coupon_currency' +require_relative 'advanced_billing/models/coupon_currency_response' +require_relative 'advanced_billing/models/coupon_restriction' +require_relative 'advanced_billing/models/create_allocation_request' +require_relative 'advanced_billing/models/create_component_price_point' +require_relative 'advanced_billing/models/create_component_price_points_request' +require_relative 'advanced_billing/models/create_customer_request' +require_relative 'advanced_billing/models/create_invoice_item' +require_relative 'advanced_billing/models/create_metadata_request' +require_relative 'advanced_billing/models/create_metered_component' +require_relative 'advanced_billing/models/create_on_off_component' +require_relative 'advanced_billing/models/create_or_update_product_request' +require_relative 'advanced_billing/models/create_payment_profile' +require_relative 'advanced_billing/models/create_prepayment_request' +require_relative 'advanced_billing/models/create_product_currency_price' +require_relative 'advanced_billing/models/create_product_price_point' +require_relative 'advanced_billing/models/create_reason_code_request' +require_relative 'advanced_billing/models/create_subscription' +require_relative 'advanced_billing/models/create_subscription_component' +require_relative 'advanced_billing/models/create_subscription_group' +require_relative 'advanced_billing/models/create_subscription_request' +require_relative 'advanced_billing/models/created_prepayment' +require_relative 'advanced_billing/models/credit_card_attributes' +require_relative 'advanced_billing/models/credit_scheme_request' +require_relative 'advanced_billing/models/currency_price' +require_relative 'advanced_billing/models/customer_custom_fields_change' +require_relative 'advanced_billing/models/customer_response' +require_relative 'advanced_billing/models/debit_note' +require_relative 'advanced_billing/models/deduct_service_credit' +require_relative 'advanced_billing/models/endpoint_response' +require_relative 'advanced_billing/models/event' +require_relative 'advanced_billing/models/get_one_time_token_payment_profile' +require_relative 'advanced_billing/models/get_one_time_token_request' +require_relative 'advanced_billing/models/group_billing' +require_relative 'advanced_billing/models/invoice' +require_relative 'advanced_billing/models/invoice_avatax_details' +require_relative 'advanced_billing/models/invoice_custom_field' +require_relative 'advanced_billing/models/invoice_customer' +require_relative 'advanced_billing/models/invoice_debit' +require_relative 'advanced_billing/models/invoice_discount_breakout' +require_relative 'advanced_billing/models/invoice_display_settings' +require_relative 'advanced_billing/models/invoice_issued' +require_relative 'advanced_billing/models/invoice_response' +require_relative 'advanced_billing/models/invoice_address' +require_relative 'advanced_billing/models/invoice_line_item_event_data' require_relative 'advanced_billing/models/invoice_line_item_pricing_detail' -require_relative 'advanced_billing/models/invoice_payer' require_relative 'advanced_billing/models/invoice_payer_change' -require_relative 'advanced_billing/models/invoice_payment' -require_relative 'advanced_billing/models/invoice_payment_application' require_relative 'advanced_billing/models/invoice_payment_method' -require_relative 'advanced_billing/models/invoice_pre_payment' -require_relative 'advanced_billing/models/invoice_previous_balance' -require_relative 'advanced_billing/models/invoice_refund' -require_relative 'advanced_billing/models/invoice_response' -require_relative 'advanced_billing/models/invoice_seller' require_relative 'advanced_billing/models/invoice_tax' -require_relative 'advanced_billing/models/invoice_tax_breakout' +require_relative 'advanced_billing/models/list_coupons_filter' +require_relative 'advanced_billing/models/list_offers_response' +require_relative 'advanced_billing/models/list_prepayments_filter' +require_relative 'advanced_billing/models/list_price_points_filter' +require_relative 'advanced_billing/models/list_product_price_points_response' +require_relative 'advanced_billing/models/list_products_filter' +require_relative 'advanced_billing/models/list_proforma_invoices_response' +require_relative 'advanced_billing/models/list_public_keys_meta' +require_relative 'advanced_billing/models/list_subscription_components_filter' +require_relative 'advanced_billing/models/list_subscription_groups_meta' +require_relative 'advanced_billing/models/metadata' +require_relative 'advanced_billing/models/metered_usage' +require_relative 'advanced_billing/models/multi_invoice_payment_response' +require_relative 'advanced_billing/models/net_terms' +require_relative 'advanced_billing/models/offer_signup_page' require_relative 'advanced_billing/models/invoice_tax_component_breakout' require_relative 'advanced_billing/models/issue_advance_invoice_request' require_relative 'advanced_billing/models/issue_invoice_event_data' -require_relative 'advanced_billing/models/issue_invoice_request' require_relative 'advanced_billing/models/issue_service_credit' -require_relative 'advanced_billing/models/issue_service_credit_request' require_relative 'advanced_billing/models/item_price_point_changed' require_relative 'advanced_billing/models/item_price_point_data' -require_relative 'advanced_billing/models/list_components_filter' require_relative 'advanced_billing/models/list_components_price_points_response' -require_relative 'advanced_billing/models/list_coupons_filter' require_relative 'advanced_billing/models/list_credit_notes_response' require_relative 'advanced_billing/models/list_invoices_response' -require_relative 'advanced_billing/models/list_metafields_response' require_relative 'advanced_billing/models/list_mrr_filter' require_relative 'advanced_billing/models/list_mrr_response' require_relative 'advanced_billing/models/list_mrr_response_result' -require_relative 'advanced_billing/models/list_offers_response' -require_relative 'advanced_billing/models/list_prepayments_filter' -require_relative 'advanced_billing/models/list_price_points_filter' -require_relative 'advanced_billing/models/list_product_price_points_response' -require_relative 'advanced_billing/models/list_products_filter' -require_relative 'advanced_billing/models/list_proforma_invoices_meta' -require_relative 'advanced_billing/models/list_proforma_invoices_response' -require_relative 'advanced_billing/models/list_public_keys_meta' require_relative 'advanced_billing/models/list_public_keys_response' -require_relative 'advanced_billing/models/list_sale_rep_item' -require_relative 'advanced_billing/models/list_segments_filter' require_relative 'advanced_billing/models/list_segments_response' -require_relative 'advanced_billing/models/list_service_credits_response' -require_relative 'advanced_billing/models/' \ - 'list_subcription_group_prepayment_item' -require_relative 'advanced_billing/models/list_subscription_components_filter' require_relative 'advanced_billing/models/' \ 'list_subscription_components_for_site_filter' -require_relative 'advanced_billing/models/list_subscription_components_response' require_relative 'advanced_billing/models/list_subscription_group_prepayment' -require_relative 'advanced_billing/models/' \ - 'list_subscription_group_prepayment_response' -require_relative 'advanced_billing/models/list_subscription_groups_item' -require_relative 'advanced_billing/models/list_subscription_groups_meta' require_relative 'advanced_billing/models/list_subscription_groups_response' -require_relative 'advanced_billing/models/metadata' require_relative 'advanced_billing/models/metafield' require_relative 'advanced_billing/models/metafield_scope' +require_relative 'advanced_billing/models/movement_line_item' +require_relative 'advanced_billing/models/mrr_movement' +require_relative 'advanced_billing/models/offer' +require_relative 'advanced_billing/models/offer_response' +require_relative 'advanced_billing/models/issue_invoice_request' +require_relative 'advanced_billing/models/issue_service_credit_request' +require_relative 'advanced_billing/models/list_metafields_response' +require_relative 'advanced_billing/models/list_sale_rep_item' +require_relative 'advanced_billing/models/' \ + 'list_subcription_group_prepayment_item' +require_relative 'advanced_billing/models/list_subscription_components_response' +require_relative 'advanced_billing/models/' \ + 'list_subscription_group_prepayment_response' require_relative 'advanced_billing/models/metered_component' -require_relative 'advanced_billing/models/metered_usage' +require_relative 'advanced_billing/models/multi_invoice_payment' +require_relative 'advanced_billing/models/invoice_tax_breakout' +require_relative 'advanced_billing/models/list_components_filter' +require_relative 'advanced_billing/models/list_proforma_invoices_meta' +require_relative 'advanced_billing/models/list_segments_filter' +require_relative 'advanced_billing/models/list_service_credits_response' +require_relative 'advanced_billing/models/list_subscription_groups_item' require_relative 'advanced_billing/models/movement' -require_relative 'advanced_billing/models/movement_line_item' require_relative 'advanced_billing/models/mrr' -require_relative 'advanced_billing/models/mrr_movement' require_relative 'advanced_billing/models/mrr_response' -require_relative 'advanced_billing/models/multi_invoice_payment' -require_relative 'advanced_billing/models/multi_invoice_payment_response' require_relative 'advanced_billing/models/nested_subscription_group' -require_relative 'advanced_billing/models/net_terms' -require_relative 'advanced_billing/models/offer' require_relative 'advanced_billing/models/offer_discount' require_relative 'advanced_billing/models/offer_item' -require_relative 'advanced_billing/models/offer_response' -require_relative 'advanced_billing/models/offer_signup_page' require_relative 'advanced_billing/models/ok_response' -require_relative 'advanced_billing/models/on_off_component' -require_relative 'advanced_billing/models/organization_address' require_relative 'advanced_billing/models/origin_invoice' -require_relative 'advanced_billing/models/overage_pricing' -require_relative 'advanced_billing/models/override_subscription' require_relative 'advanced_billing/models/override_subscription_request' +require_relative 'advanced_billing/models/payment_profile_attributes' +require_relative 'advanced_billing/models/pending_cancellation_change' +require_relative 'advanced_billing/models/product_family_response' +require_relative 'advanced_billing/models/product_response' +require_relative 'advanced_billing/models/proforma_invoice_credit' +require_relative 'advanced_billing/models/reactivate_subscription_request' +require_relative 'advanced_billing/models/referral_code' +require_relative 'advanced_billing/models/refund_invoice' +require_relative 'advanced_billing/models/refund_prepayment_base_refund_error' +require_relative 'advanced_billing/models/register' +require_relative 'advanced_billing/models/resent_invitation' +require_relative 'advanced_billing/models/sale_rep_item_mrr' +require_relative 'advanced_billing/models/sale_rep_settings' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_component_custom_price' +require_relative 'advanced_billing/models/segment_response' +require_relative 'advanced_billing/models/service_credit' +require_relative 'advanced_billing/models/signup_proforma_preview_response' +require_relative 'advanced_billing/models/site' +require_relative 'advanced_billing/models/site_statistics' +require_relative 'advanced_billing/models/site_summary' +require_relative 'advanced_billing/models/subscription_custom_price' +require_relative 'advanced_billing/models/subscription_group_balances' +require_relative 'advanced_billing/models/subscription_group_credit_card' +require_relative 'advanced_billing/models/override_subscription' require_relative 'advanced_billing/models/paginated_metadata' require_relative 'advanced_billing/models/paid_invoice' +require_relative 'advanced_billing/models/payment_related_events' +require_relative 'advanced_billing/models/prepaid_configuration' +require_relative 'advanced_billing/models/prepayment' +require_relative 'advanced_billing/models/preview_allocations_request' +require_relative 'advanced_billing/models/product_price_point_errors' +require_relative 'advanced_billing/models/' \ + 'reactivate_subscription_group_response' +require_relative 'advanced_billing/models/reactivation_billing' +require_relative 'advanced_billing/models/reason_code' +require_relative 'advanced_billing/models/reason_code_response' +require_relative 'advanced_billing/models/record_payment_request' +require_relative 'advanced_billing/models/record_payment_response' +require_relative 'advanced_billing/models/refund_consolidated_invoice' +require_relative 'advanced_billing/models/refund_invoice_event_data' +require_relative 'advanced_billing/models/refund_prepayment_request' +require_relative 'advanced_billing/models/remove_payment_event_data' +require_relative 'advanced_billing/models/renewal_preview' +require_relative 'advanced_billing/models/replay_webhooks_request' +require_relative 'advanced_billing/models/replay_webhooks_response' +require_relative 'advanced_billing/models/resume_options' +require_relative 'advanced_billing/models/sale_rep_subscription' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_configuration_item_response' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_configuration_request_body' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_configurations_response' +require_relative 'advanced_billing/models/segment' +require_relative 'advanced_billing/models/send_invoice_request' +require_relative 'advanced_billing/models/send_email' +require_relative 'advanced_billing/models/service_credit1' +require_relative 'advanced_billing/models/site_response' +require_relative 'advanced_billing/models/subscription' +require_relative 'advanced_billing/models/overage_pricing' require_relative 'advanced_billing/models/pause_request' require_relative 'advanced_billing/models/payer_attributes' -require_relative 'advanced_billing/models/payer_error' require_relative 'advanced_billing/models/payment_collection_method_changed' -require_relative 'advanced_billing/models/payment_for_allocation' -require_relative 'advanced_billing/models/payment_profile_attributes' require_relative 'advanced_billing/models/payment_profile_response' -require_relative 'advanced_billing/models/payment_related_events' -require_relative 'advanced_billing/models/pending_cancellation_change' -require_relative 'advanced_billing/models/portal_management_link' -require_relative 'advanced_billing/models/prepaid_configuration' require_relative 'advanced_billing/models/prepaid_configuration_response' require_relative 'advanced_billing/models/prepaid_product_price_point_filter' require_relative 'advanced_billing/models/prepaid_subscription_balance_changed' +require_relative 'advanced_billing/models/prepayment_response' +require_relative 'advanced_billing/models/proforma_error' +require_relative 'advanced_billing/models/proforma_invoice' +require_relative 'advanced_billing/models/proforma_invoice_tax' +require_relative 'advanced_billing/models/proration' +require_relative 'advanced_billing/models/public_signup_page' +require_relative 'advanced_billing/models/refund_prepayment' +require_relative 'advanced_billing/models/refund_success' +require_relative 'advanced_billing/models/renewal_preview_request' +require_relative 'advanced_billing/models/revoked_invitation' +require_relative 'advanced_billing/models/sale_rep' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_configuration_item_request' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_configuration_request' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_configuration_response' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_item_request_body_component' +require_relative 'advanced_billing/models/scheduled_renewal_product_price_point' +require_relative 'advanced_billing/models/service_credit_response' +require_relative 'advanced_billing/models/signup_proforma_preview' +require_relative 'advanced_billing/models/subscription_component' +require_relative 'advanced_billing/models/' \ + 'subscription_component_allocation_error_item' +require_relative 'advanced_billing/models/subscription_component_subscription' +require_relative 'advanced_billing/models/subscription_filter' +require_relative 'advanced_billing/models/subscription_group' +require_relative 'advanced_billing/models/subscription_group_bank_account' +require_relative 'advanced_billing/models/on_off_component' +require_relative 'advanced_billing/models/organization_address' +require_relative 'advanced_billing/models/payer_error' +require_relative 'advanced_billing/models/payment_for_allocation' +require_relative 'advanced_billing/models/portal_management_link' require_relative 'advanced_billing/models/prepaid_usage' require_relative 'advanced_billing/models/prepaid_usage_allocation_detail' require_relative 'advanced_billing/models/prepaid_usage_component' -require_relative 'advanced_billing/models/prepayment' require_relative 'advanced_billing/models/prepayment_account_balance_changed' -require_relative 'advanced_billing/models/prepayment_response' require_relative 'advanced_billing/models/prepayments_response' -require_relative 'advanced_billing/models/preview_allocations_request' require_relative 'advanced_billing/models/price' require_relative 'advanced_billing/models/product' require_relative 'advanced_billing/models/product_family' -require_relative 'advanced_billing/models/product_family_response' require_relative 'advanced_billing/models/product_price_point' -require_relative 'advanced_billing/models/product_price_point_errors' require_relative 'advanced_billing/models/product_price_point_response' -require_relative 'advanced_billing/models/product_response' -require_relative 'advanced_billing/models/proforma_error' -require_relative 'advanced_billing/models/proforma_invoice' -require_relative 'advanced_billing/models/proforma_invoice_credit' require_relative 'advanced_billing/models/proforma_invoice_discount' require_relative 'advanced_billing/models/proforma_invoice_issued' require_relative 'advanced_billing/models/proforma_invoice_payment' -require_relative 'advanced_billing/models/proforma_invoice_tax' -require_relative 'advanced_billing/models/proration' require_relative 'advanced_billing/models/public_key' -require_relative 'advanced_billing/models/public_signup_page' require_relative 'advanced_billing/models/quantity_based_component' require_relative 'advanced_billing/models/reactivate_subscription_group_request' -require_relative 'advanced_billing/models/' \ - 'reactivate_subscription_group_response' -require_relative 'advanced_billing/models/reactivate_subscription_request' -require_relative 'advanced_billing/models/reactivation_billing' -require_relative 'advanced_billing/models/reason_code' -require_relative 'advanced_billing/models/reason_code_response' -require_relative 'advanced_billing/models/record_payment_request' -require_relative 'advanced_billing/models/record_payment_response' -require_relative 'advanced_billing/models/referral_code' require_relative 'advanced_billing/models/referral_validation_response' -require_relative 'advanced_billing/models/refund_consolidated_invoice' -require_relative 'advanced_billing/models/refund_invoice' -require_relative 'advanced_billing/models/refund_invoice_event_data' require_relative 'advanced_billing/models/refund_invoice_request' -require_relative 'advanced_billing/models/refund_prepayment' -require_relative 'advanced_billing/models/refund_prepayment_base_refund_error' -require_relative 'advanced_billing/models/refund_prepayment_request' -require_relative 'advanced_billing/models/refund_success' -require_relative 'advanced_billing/models/register' -require_relative 'advanced_billing/models/remove_payment_event_data' -require_relative 'advanced_billing/models/renewal_preview' -require_relative 'advanced_billing/models/renewal_preview_component' -require_relative 'advanced_billing/models/renewal_preview_line_item' -require_relative 'advanced_billing/models/renewal_preview_request' -require_relative 'advanced_billing/models/renewal_preview_response' -require_relative 'advanced_billing/models/replay_webhooks_request' -require_relative 'advanced_billing/models/replay_webhooks_response' -require_relative 'advanced_billing/models/resent_invitation' -require_relative 'advanced_billing/models/resume_options' -require_relative 'advanced_billing/models/revoked_invitation' -require_relative 'advanced_billing/models/sale_rep' -require_relative 'advanced_billing/models/sale_rep_item_mrr' -require_relative 'advanced_billing/models/sale_rep_settings' -require_relative 'advanced_billing/models/sale_rep_subscription' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_component_custom_price' +require_relative 'advanced_billing/models/renewal_preview_component' +require_relative 'advanced_billing/models/renewal_preview_line_item' +require_relative 'advanced_billing/models/renewal_preview_response' require_relative 'advanced_billing/models/scheduled_renewal_configuration' require_relative 'advanced_billing/models/scheduled_renewal_configuration_item' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_configuration_item_request' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_configuration_item_response' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_configuration_request' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_configuration_request_body' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_configuration_response' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_configurations_response' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_item_request_body_component' require_relative 'advanced_billing/models/' \ 'scheduled_renewal_item_request_body_product' require_relative 'advanced_billing/models/scheduled_renewal_lock_in_request' -require_relative 'advanced_billing/models/scheduled_renewal_product_price_point' require_relative 'advanced_billing/models/scheduled_renewal_update_request' -require_relative 'advanced_billing/models/segment' require_relative 'advanced_billing/models/segment_price' -require_relative 'advanced_billing/models/segment_response' -require_relative 'advanced_billing/models/send_invoice_request' -require_relative 'advanced_billing/models/send_email' -require_relative 'advanced_billing/models/service_credit' -require_relative 'advanced_billing/models/service_credit_response' -require_relative 'advanced_billing/models/service_credit1' -require_relative 'advanced_billing/models/signup_proforma_preview' -require_relative 'advanced_billing/models/signup_proforma_preview_response' -require_relative 'advanced_billing/models/site' -require_relative 'advanced_billing/models/site_response' -require_relative 'advanced_billing/models/site_statistics' -require_relative 'advanced_billing/models/site_summary' -require_relative 'advanced_billing/models/subscription' -require_relative 'advanced_billing/models/subscription_component' -require_relative 'advanced_billing/models/' \ - 'subscription_component_allocation_error_item' require_relative 'advanced_billing/models/subscription_component_response' -require_relative 'advanced_billing/models/subscription_component_subscription' -require_relative 'advanced_billing/models/subscription_custom_price' -require_relative 'advanced_billing/models/subscription_filter' -require_relative 'advanced_billing/models/subscription_group' -require_relative 'advanced_billing/models/subscription_group_balances' -require_relative 'advanced_billing/models/subscription_group_bank_account' require_relative 'advanced_billing/models/' \ 'subscription_group_component_custom_price' -require_relative 'advanced_billing/models/subscription_group_credit_card' -require_relative 'advanced_billing/models/subscription_group_customer' -require_relative 'advanced_billing/models/subscription_group_item' require_relative 'advanced_billing/models/' \ 'subscription_group_members_array_error' -require_relative 'advanced_billing/models/subscription_group_payment_profile' require_relative 'advanced_billing/models/subscription_group_prepayment' require_relative 'advanced_billing/models/subscription_group_prepayment_request' +require_relative 'advanced_billing/models/subscription_mrr_breakout' +require_relative 'advanced_billing/models/subscription_mrr_response' +require_relative 'advanced_billing/models/subscription_preview_response' +require_relative 'advanced_billing/models/subscription_product_migration' +require_relative 'advanced_billing/models/update_component_price_point' +require_relative 'advanced_billing/models/update_component_price_point_request' +require_relative 'advanced_billing/models/update_coupon_currency' +require_relative 'advanced_billing/models/update_currency_price' +require_relative 'advanced_billing/models/update_metadata' +require_relative 'advanced_billing/models/update_metadata_request' +require_relative 'advanced_billing/models/update_metafield' +require_relative 'advanced_billing/models/update_reason_code_request' +require_relative 'advanced_billing/models/update_segment_request' +require_relative 'advanced_billing/models/upsert_prepaid_configuration' +require_relative 'advanced_billing/models/void_invoice_request' +require_relative 'advanced_billing/models/webhook_response' +require_relative 'advanced_billing/models/subscription_group_customer' +require_relative 'advanced_billing/models/subscription_group_payment_profile' require_relative 'advanced_billing/models/' \ 'subscription_group_prepayment_response' -require_relative 'advanced_billing/models/subscription_group_response' require_relative 'advanced_billing/models/subscription_group_signup' require_relative 'advanced_billing/models/subscription_group_signup_component' +require_relative 'advanced_billing/models/subscription_migration_preview' +require_relative 'advanced_billing/models/' \ + 'subscription_migration_preview_options' +require_relative 'advanced_billing/models/subscription_note' +require_relative 'advanced_billing/models/update_component' +require_relative 'advanced_billing/models/update_payment_profile' +require_relative 'advanced_billing/models/update_price' +require_relative 'advanced_billing/models/update_product_price_point_request' +require_relative 'advanced_billing/models/update_subscription_component' +require_relative 'advanced_billing/models/update_subscription_note_request' +require_relative 'advanced_billing/models/upsert_prepaid_configuration_request' +require_relative 'advanced_billing/models/void_invoice' require_relative 'advanced_billing/models/subscription_group_signup_error' require_relative 'advanced_billing/models/subscription_group_signup_event_data' require_relative 'advanced_billing/models/' \ 'subscription_group_signup_failure_data' require_relative 'advanced_billing/models/subscription_group_signup_item' -require_relative 'advanced_billing/models/subscription_group_signup_request' require_relative 'advanced_billing/models/subscription_group_signup_response' -require_relative 'advanced_billing/models/subscription_group_single_error' -require_relative 'advanced_billing/models/subscription_group_subscription_error' -require_relative 'advanced_billing/models/subscription_group_update_error' -require_relative 'advanced_billing/models/subscription_included_coupon' -require_relative 'advanced_billing/models/subscription_migration_preview' -require_relative 'advanced_billing/models/' \ - 'subscription_migration_preview_options' -require_relative 'advanced_billing/models/' \ - 'subscription_migration_preview_request' require_relative 'advanced_billing/models/' \ 'subscription_migration_preview_response' require_relative 'advanced_billing/models/subscription_mrr' -require_relative 'advanced_billing/models/subscription_mrr_breakout' -require_relative 'advanced_billing/models/subscription_mrr_response' -require_relative 'advanced_billing/models/subscription_note' require_relative 'advanced_billing/models/subscription_note_response' -require_relative 'advanced_billing/models/subscription_preview' -require_relative 'advanced_billing/models/subscription_preview_response' require_relative 'advanced_billing/models/subscription_product_change' -require_relative 'advanced_billing/models/subscription_product_migration' require_relative 'advanced_billing/models/' \ 'subscription_product_migration_request' -require_relative 'advanced_billing/models/subscription_response' require_relative 'advanced_billing/models/subscription_state_change' -require_relative 'advanced_billing/models/tax_configuration' require_relative 'advanced_billing/models/too_many_management_link_requests' require_relative 'advanced_billing/models/update_allocation_expiration_date' -require_relative 'advanced_billing/models/update_component' -require_relative 'advanced_billing/models/update_component_price_point' -require_relative 'advanced_billing/models/update_component_price_point_request' require_relative 'advanced_billing/models/update_component_request' -require_relative 'advanced_billing/models/update_coupon_currency' -require_relative 'advanced_billing/models/update_currency_price' -require_relative 'advanced_billing/models/update_currency_prices_request' -require_relative 'advanced_billing/models/update_customer' require_relative 'advanced_billing/models/update_customer_request' -require_relative 'advanced_billing/models/update_metadata' -require_relative 'advanced_billing/models/update_metadata_request' -require_relative 'advanced_billing/models/update_metafield' require_relative 'advanced_billing/models/update_metafields_request' -require_relative 'advanced_billing/models/update_payment_profile' require_relative 'advanced_billing/models/update_payment_profile_request' -require_relative 'advanced_billing/models/update_price' require_relative 'advanced_billing/models/update_product_price_point' -require_relative 'advanced_billing/models/update_product_price_point_request' -require_relative 'advanced_billing/models/update_reason_code' -require_relative 'advanced_billing/models/update_reason_code_request' -require_relative 'advanced_billing/models/update_segment' -require_relative 'advanced_billing/models/update_segment_request' require_relative 'advanced_billing/models/update_subscription' -require_relative 'advanced_billing/models/update_subscription_component' require_relative 'advanced_billing/models/update_subscription_group' -require_relative 'advanced_billing/models/update_subscription_group_request' require_relative 'advanced_billing/models/update_subscription_note' -require_relative 'advanced_billing/models/update_subscription_note_request' -require_relative 'advanced_billing/models/update_subscription_request' -require_relative 'advanced_billing/models/upsert_prepaid_configuration' -require_relative 'advanced_billing/models/upsert_prepaid_configuration_request' require_relative 'advanced_billing/models/usage' require_relative 'advanced_billing/models/usage_response' -require_relative 'advanced_billing/models/void_invoice' require_relative 'advanced_billing/models/void_invoice_event_data' -require_relative 'advanced_billing/models/void_invoice_request' require_relative 'advanced_billing/models/void_remainder_event_data' +require_relative 'advanced_billing/models/subscription_group_item' +require_relative 'advanced_billing/models/subscription_group_response' +require_relative 'advanced_billing/models/subscription_group_signup_request' +require_relative 'advanced_billing/models/subscription_group_single_error' +require_relative 'advanced_billing/models/subscription_group_subscription_error' +require_relative 'advanced_billing/models/subscription_group_update_error' +require_relative 'advanced_billing/models/subscription_included_coupon' +require_relative 'advanced_billing/models/' \ + 'subscription_migration_preview_request' +require_relative 'advanced_billing/models/subscription_preview' +require_relative 'advanced_billing/models/subscription_response' +require_relative 'advanced_billing/models/tax_configuration' +require_relative 'advanced_billing/models/update_currency_prices_request' +require_relative 'advanced_billing/models/update_customer' +require_relative 'advanced_billing/models/update_reason_code' +require_relative 'advanced_billing/models/update_segment' +require_relative 'advanced_billing/models/update_subscription_group_request' +require_relative 'advanced_billing/models/update_subscription_request' require_relative 'advanced_billing/models/webhook' -require_relative 'advanced_billing/models/webhook_response' -require_relative 'advanced_billing/models/all_vaults' require_relative 'advanced_billing/models/allocation_preview_direction' +require_relative 'advanced_billing/models/all_vaults' +require_relative 'advanced_billing/models/bank_account_type' +require_relative 'advanced_billing/models/basic_date_field' +require_relative 'advanced_billing/models/card_type' +require_relative 'advanced_billing/models/component_kind' require_relative 'advanced_billing/models/allocation_preview_line_item_kind' -require_relative 'advanced_billing/models/apple_pay_vault' require_relative 'advanced_billing/models/auto_invite' require_relative 'advanced_billing/models/bank_account_holder_type' -require_relative 'advanced_billing/models/bank_account_type' require_relative 'advanced_billing/models/bank_account_vault' -require_relative 'advanced_billing/models/basic_date_field' +require_relative 'advanced_billing/models/collection_method' +require_relative 'advanced_billing/models/apple_pay_vault' require_relative 'advanced_billing/models/billing_manifest_line_item_kind' require_relative 'advanced_billing/models/cancellation_method' -require_relative 'advanced_billing/models/card_type' require_relative 'advanced_billing/models/chargeback_status' require_relative 'advanced_billing/models/cleanup_scope' -require_relative 'advanced_billing/models/collection_method' -require_relative 'advanced_billing/models/component_kind' require_relative 'advanced_billing/models/compounding_strategy' -require_relative 'advanced_billing/models/create_invoice_status' -require_relative 'advanced_billing/models/create_prepayment_method' require_relative 'advanced_billing/models/' \ 'create_signup_proforma_preview_include' -require_relative 'advanced_billing/models/credit_card_vault' require_relative 'advanced_billing/models/credit_note_status' -require_relative 'advanced_billing/models/credit_scheme' -require_relative 'advanced_billing/models/credit_type' -require_relative 'advanced_billing/models/currency_price_role' require_relative 'advanced_billing/models/custom_field_owner' -require_relative 'advanced_billing/models/debit_note_role' -require_relative 'advanced_billing/models/debit_note_status' require_relative 'advanced_billing/models/direction' -require_relative 'advanced_billing/models/discount_type' require_relative 'advanced_billing/models/downgrade_credit_credit_type' -require_relative 'advanced_billing/models/event_key' require_relative 'advanced_billing/models/expiration_interval_unit' +require_relative 'advanced_billing/models/invoice_discount_source_type' +require_relative 'advanced_billing/models/invoice_event_type' +require_relative 'advanced_billing/models/create_invoice_status' +require_relative 'advanced_billing/models/credit_card_vault' +require_relative 'advanced_billing/models/credit_scheme' +require_relative 'advanced_billing/models/discount_type' +require_relative 'advanced_billing/models/event_key' require_relative 'advanced_billing/models/failed_payment_action' -require_relative 'advanced_billing/models/first_charge_type' require_relative 'advanced_billing/models/group_target_type' require_relative 'advanced_billing/models/group_type' +require_relative 'advanced_billing/models/interval_unit' +require_relative 'advanced_billing/models/invoice_date_field' +require_relative 'advanced_billing/models/currency_price_role' require_relative 'advanced_billing/models/include_not_null' require_relative 'advanced_billing/models/include_null_or_not_null' +require_relative 'advanced_billing/models/create_prepayment_method' +require_relative 'advanced_billing/models/credit_type' +require_relative 'advanced_billing/models/debit_note_role' +require_relative 'advanced_billing/models/debit_note_status' +require_relative 'advanced_billing/models/first_charge_type' require_relative 'advanced_billing/models/include_option' -require_relative 'advanced_billing/models/interval_unit' -require_relative 'advanced_billing/models/invoice_consolidation_level' -require_relative 'advanced_billing/models/invoice_date_field' -require_relative 'advanced_billing/models/invoice_discount_source_type' require_relative 'advanced_billing/models/invoice_discount_type' -require_relative 'advanced_billing/models/invoice_event_payment_method' -require_relative 'advanced_billing/models/invoice_event_type' require_relative 'advanced_billing/models/invoice_payment_method_type' -require_relative 'advanced_billing/models/invoice_payment_type' require_relative 'advanced_billing/models/invoice_role' +require_relative 'advanced_billing/models/invoice_consolidation_level' +require_relative 'advanced_billing/models/invoice_event_payment_method' +require_relative 'advanced_billing/models/invoice_payment_type' require_relative 'advanced_billing/models/invoice_sort_field' require_relative 'advanced_billing/models/invoice_status' -require_relative 'advanced_billing/models/item_category' require_relative 'advanced_billing/models/line_item_kind' -require_relative 'advanced_billing/models/line_item_transaction_type' -require_relative 'advanced_billing/models/list_components_price_points_include' require_relative 'advanced_billing/models/list_events_date_field' +require_relative 'advanced_billing/models/metafield_input' require_relative 'advanced_billing/models/list_prepayment_date_field' require_relative 'advanced_billing/models/list_products_include' require_relative 'advanced_billing/models/list_products_price_points_include' require_relative 'advanced_billing/models/list_subscription_components_include' require_relative 'advanced_billing/models/list_subscription_components_sort' -require_relative 'advanced_billing/models/metafield_input' +require_relative 'advanced_billing/models/item_category' +require_relative 'advanced_billing/models/line_item_transaction_type' +require_relative 'advanced_billing/models/list_components_price_points_include' +require_relative 'advanced_billing/models/proforma_invoice_discount_source_type' +require_relative 'advanced_billing/models/proforma_invoice_status' +require_relative 'advanced_billing/models/resource_type' require_relative 'advanced_billing/models/payment_type' -require_relative 'advanced_billing/models/pay_pal_vault' -require_relative 'advanced_billing/models/prepayment_method' -require_relative 'advanced_billing/models/price_point_type' require_relative 'advanced_billing/models/pricing_scheme' -require_relative 'advanced_billing/models/proforma_invoice_discount_source_type' require_relative 'advanced_billing/models/proforma_invoice_role' -require_relative 'advanced_billing/models/proforma_invoice_status' +require_relative 'advanced_billing/models/pay_pal_vault' +require_relative 'advanced_billing/models/price_point_type' +require_relative 'advanced_billing/models/recurring_scheme' +require_relative 'advanced_billing/models/resumption_charge' +require_relative 'advanced_billing/models/subscription_date_field' +require_relative 'advanced_billing/models/prepayment_method' require_relative 'advanced_billing/models/proforma_invoice_tax_source_type' require_relative 'advanced_billing/models/reactivation_charge' -require_relative 'advanced_billing/models/recurring_scheme' -require_relative 'advanced_billing/models/resource_type' require_relative 'advanced_billing/models/restriction_type' -require_relative 'advanced_billing/models/resumption_charge' require_relative 'advanced_billing/models/service_credit_type' require_relative 'advanced_billing/models/sorting_direction' require_relative 'advanced_billing/models/status' -require_relative 'advanced_billing/models/subscription_date_field' -require_relative 'advanced_billing/models/subscription_group_include' require_relative 'advanced_billing/models/subscription_group_prepayment_method' -require_relative 'advanced_billing/models/subscription_groups_list_include' +require_relative 'advanced_billing/models/tax_configuration_kind' +require_relative 'advanced_billing/models/tax_destination_address' +require_relative 'advanced_billing/models/trial_type' +require_relative 'advanced_billing/models/webhook_order' +require_relative 'advanced_billing/models/webhook_subscription' +require_relative 'advanced_billing/models/subscription_group_include' require_relative 'advanced_billing/models/subscription_include' -require_relative 'advanced_billing/models/subscription_list_date_field' require_relative 'advanced_billing/models/subscription_list_include' +require_relative 'advanced_billing/models/subscription_state_filter' +require_relative 'advanced_billing/models/upgrade_charge_credit_type' +require_relative 'advanced_billing/models/subscription_list_date_field' +require_relative 'advanced_billing/models/subscription_groups_list_include' require_relative 'advanced_billing/models/subscription_purge_type' require_relative 'advanced_billing/models/subscription_sort' require_relative 'advanced_billing/models/subscription_state' -require_relative 'advanced_billing/models/subscription_state_filter' -require_relative 'advanced_billing/models/tax_configuration_kind' -require_relative 'advanced_billing/models/tax_destination_address' -require_relative 'advanced_billing/models/trial_type' -require_relative 'advanced_billing/models/upgrade_charge_credit_type' -require_relative 'advanced_billing/models/webhook_order' require_relative 'advanced_billing/models/webhook_status' -require_relative 'advanced_billing/models/webhook_subscription' # Exceptions require_relative 'advanced_billing/exceptions/api_exception' require_relative 'advanced_billing/exceptions/' \ 'component_allocation_error_exception' -require_relative 'advanced_billing/exceptions/' \ - 'component_price_point_error_exception' require_relative 'advanced_billing/exceptions/customer_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'error_array_map_response_exception' -require_relative 'advanced_billing/exceptions/error_list_response_exception' require_relative 'advanced_billing/exceptions/' \ 'error_string_map_response_exception' +require_relative 'advanced_billing/exceptions/error_list_response_exception' require_relative 'advanced_billing/exceptions/' \ - 'event_based_billing_list_segments_errors_exception' + 'component_price_point_error_exception' require_relative 'advanced_billing/exceptions/' \ - 'event_based_billing_segment_exception' + 'event_based_billing_list_segments_errors_exception' require_relative 'advanced_billing/exceptions/' \ 'event_based_billing_segment_errors_exception' require_relative 'advanced_billing/exceptions/' \ - 'product_price_point_error_response_exception' + 'event_based_billing_segment_exception' require_relative 'advanced_billing/exceptions/' \ 'proforma_bad_request_error_response_exception' +require_relative 'advanced_billing/exceptions/single_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'refund_prepayment_base_errors_response_exception' -require_relative 'advanced_billing/exceptions/single_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'single_string_error_response_exception' +require_relative 'advanced_billing/exceptions/' \ + 'subscription_group_create_error_response_exception' +require_relative 'advanced_billing/exceptions/' \ + 'product_price_point_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'subscription_add_coupon_error_exception' require_relative 'advanced_billing/exceptions/' \ 'subscription_component_allocation_error_exception' -require_relative 'advanced_billing/exceptions/' \ - 'subscription_group_create_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'subscription_group_signup_error_response_exception' -require_relative 'advanced_billing/exceptions/' \ - 'subscription_group_update_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'subscription_remove_coupon_errors_exception' require_relative 'advanced_billing/exceptions/' \ 'subscription_response_error_exception' require_relative 'advanced_billing/exceptions/' \ 'subscriptions_mrr_error_response_exception' +require_relative 'advanced_billing/exceptions/' \ + 'subscription_group_update_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'too_many_management_link_requests_error_exception' diff --git a/lib/advanced_billing/utilities/union_type_lookup.rb b/lib/advanced_billing/utilities/union_type_lookup.rb index 7153bb6..af8075b 100644 --- a/lib/advanced_billing/utilities/union_type_lookup.rb +++ b/lib/advanced_billing/utilities/union_type_lookup.rb @@ -221,7 +221,7 @@ def self.union_types ) ), - :AllocationQuantity => OneOf.new( + :AllocationPreviewItemQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -231,7 +231,7 @@ def self.union_types ) ), - :AllocationPreviousQuantity => OneOf.new( + :AllocationPreviewItemPreviousQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -241,7 +241,7 @@ def self.union_types ) ), - :AllocationPreviewItemQuantity => OneOf.new( + :AllocationQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -251,7 +251,17 @@ def self.union_types ) ), - :AllocationPreviewItemPreviousQuantity => OneOf.new( + :AllocationPreviousQuantity => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + + :ComponentAllocationChangeAllocatedQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -296,27 +306,37 @@ def self.union_types ) ), - :ComponentAllocationChangeAllocatedQuantity => OneOf.new( + :CreateAllocationPricePointId => OneOf.new( [ - LeafType.new(Integer), - LeafType.new(String) + LeafType.new(String), + LeafType.new(Integer) ], UnionTypeContext.new( - is_optional: true + is_optional: true, + is_nullable: true ) ), - :ComponentPricePointAssignmentPricePoint => OneOf.new( + :CreateMultiInvoicePaymentAmount => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float) + ] + ), + + :CustomerErrorResponseErrors => OneOf.new( + [ + LeafType.new(CustomerError), + LeafType.new(String, UnionTypeContext.new( + is_array: true + )) ], UnionTypeContext.new( is_optional: true ) ), - :CouponPayloadPercentage => OneOf.new( + :EBBComponentUnitPrice => OneOf.new( [ LeafType.new(String), LeafType.new(Float) @@ -326,14 +346,13 @@ def self.union_types ) ), - :CreateAllocationPricePointId => OneOf.new( + :CouponPayloadPercentage => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float) ], UnionTypeContext.new( - is_optional: true, - is_nullable: true + is_optional: true ) ), @@ -344,16 +363,6 @@ def self.union_types ] ), - :CreateComponentPricePointsRequestPricePoints => AnyOf.new( - [ - LeafType.new(CreateComponentPricePoint), - LeafType.new(CreatePrepaidUsageComponentPricePoint) - ], - UnionTypeContext.new( - is_array: true - ) - ), - :CreateInvoiceCouponPercentage => OneOf.new( [ LeafType.new(String), @@ -384,57 +393,81 @@ def self.union_types ) ), - :CreateInvoiceItemQuantity => OneOf.new( + :CreateInvoicePaymentAmount => OneOf.new( [ - LeafType.new(Float), - LeafType.new(String) + LeafType.new(String), + LeafType.new(Float) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemUnitPrice => OneOf.new( + :CreateMetafieldsRequestMetafields => OneOf.new( [ + LeafType.new(CreateMetafield), + LeafType.new(CreateMetafield, UnionTypeContext.new( + is_array: true + )) + ] + ), + + :CreateOrUpdateSegmentPriceUnitPrice => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Float) + ] + ), + + :CreateSegmentSegmentProperty1Value => OneOf.new( + [ + LeafType.new(String), LeafType.new(Float), - LeafType.new(String) + LeafType.new(Integer), + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemProductId => OneOf.new( + :CreateSegmentSegmentProperty2Value => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float), + LeafType.new(Integer), + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemComponentId => OneOf.new( + :CreateSegmentSegmentProperty3Value => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float), + LeafType.new(Integer), + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemPricePointId => OneOf.new( + :CreateSegmentSegmentProperty4Value => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float), + LeafType.new(Integer), + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemProductPricePointId => OneOf.new( + :ComponentPricePointAssignmentPricePoint => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -444,101 +477,90 @@ def self.union_types ) ), - :CreateInvoicePaymentAmount => OneOf.new( + :CreateComponentPricePointsRequestPricePoints => AnyOf.new( [ - LeafType.new(String), - LeafType.new(Float) + LeafType.new(CreateComponentPricePoint), + LeafType.new(CreatePrepaidUsageComponentPricePoint) ], UnionTypeContext.new( - is_optional: true + is_array: true ) ), - :CreateMetafieldsRequestMetafields => OneOf.new( + :CreateInvoiceItemQuantity => OneOf.new( [ - LeafType.new(CreateMetafield), - LeafType.new(CreateMetafield, UnionTypeContext.new( - is_array: true - )) - ] + LeafType.new(Float), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) ), - :CreateMultiInvoicePaymentAmount => OneOf.new( + :CreateInvoiceItemUnitPrice => OneOf.new( [ - LeafType.new(String), - LeafType.new(Float) - ] + LeafType.new(Float), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) ), - :CreateOrUpdateSegmentPriceUnitPrice => OneOf.new( + :CreateInvoiceItemProductId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) - ] - ), - - :CreatePaymentProfileExpirationMonth => OneOf.new( - [ - LeafType.new(Integer), - LeafType.new(String) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :CreatePaymentProfileExpirationYear => OneOf.new( + :CreateInvoiceItemComponentId => OneOf.new( [ - LeafType.new(Integer), - LeafType.new(String) + LeafType.new(String), + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSegmentSegmentProperty1Value => OneOf.new( + :CreateInvoiceItemPricePointId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSegmentSegmentProperty2Value => OneOf.new( + :CreateInvoiceItemProductPricePointId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSegmentSegmentProperty3Value => OneOf.new( + :CreatePaymentProfileExpirationMonth => OneOf.new( [ - LeafType.new(String), - LeafType.new(Float), LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSegmentSegmentProperty4Value => OneOf.new( + :CreatePaymentProfileExpirationYear => OneOf.new( [ - LeafType.new(String), - LeafType.new(Float), LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(String) ], UnionTypeContext.new( is_optional: true @@ -585,18 +607,6 @@ def self.union_types ) ), - :CustomerErrorResponseErrors => OneOf.new( - [ - LeafType.new(CustomerError), - LeafType.new(String, UnionTypeContext.new( - is_array: true - )) - ], - UnionTypeContext.new( - is_optional: true - ) - ), - :DeductServiceCreditAmount => OneOf.new( [ LeafType.new(String), @@ -604,16 +614,6 @@ def self.union_types ] ), - :EBBComponentUnitPrice => OneOf.new( - [ - LeafType.new(String), - LeafType.new(Float) - ], - UnionTypeContext.new( - is_optional: true - ) - ), - :EventEventSpecificData => OneOf.new( [ LeafType.new(SubscriptionProductChange), @@ -670,13 +670,6 @@ def self.union_types ) ), - :OnOffComponentUnitPrice => OneOf.new( - [ - LeafType.new(String), - LeafType.new(Float) - ] - ), - :PaymentProfileAttributesExpirationMonth => OneOf.new( [ LeafType.new(Integer), @@ -697,106 +690,61 @@ def self.union_types ) ), - :PaymentProfile => AnyOf.new( - [ - LeafType.new(ApplePayPaymentProfile, UnionTypeContext.new( - discriminator_value: 'apple_pay', - discriminator: 'payment_type' - )), - LeafType.new(BankAccountPaymentProfile, UnionTypeContext.new( - discriminator_value: 'bank_account', - discriminator: 'payment_type' - )), - LeafType.new(CreditCardPaymentProfile, UnionTypeContext.new( - discriminator_value: 'credit_card', - discriminator: 'payment_type' - )), - LeafType.new(PaypalPaymentProfile, UnionTypeContext.new( - discriminator_value: 'paypal_account', - discriminator: 'payment_type' - )) - ] - ), - - :PrepaidUsageComponentUnitPrice => OneOf.new( + :ReactivateSubscriptionRequestResume => OneOf.new( [ - LeafType.new(String), - LeafType.new(Float) + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]), + LeafType.new(ResumeOptions) ], UnionTypeContext.new( is_optional: true ) ), - :PriceStartingQuantity => OneOf.new( + :SubscriptionCustomPricePriceInCents => OneOf.new( [ - LeafType.new(Integer), - LeafType.new(String) + LeafType.new(String), + LeafType.new(Integer) ] ), - :PriceEndingQuantity => OneOf.new( - [ - LeafType.new(Integer), - LeafType.new(String) - ], - UnionTypeContext.new( - is_optional: true, - is_nullable: true - ) - ), - - :PriceUnitPrice => OneOf.new( + :SubscriptionCustomPriceInterval => OneOf.new( [ - LeafType.new(Float), - LeafType.new(String) + LeafType.new(String), + LeafType.new(Integer) ] ), - :QuantityBasedComponentUnitPrice => OneOf.new( + :SubscriptionCustomPriceTrialPriceInCents => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :ReactivateSubscriptionRequestResume => OneOf.new( + :SubscriptionCustomPriceTrialInterval => OneOf.new( [ - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]), - LeafType.new(ResumeOptions) + LeafType.new(String), + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :RefundConsolidatedInvoiceSegmentUids => OneOf.new( - [ - LeafType.new(String, UnionTypeContext.new( - is_array: true - )), - LeafType.new(String) - ] - ), - - :RefundInvoiceRequestRefund => AnyOf.new( - [ - LeafType.new(RefundInvoice), - LeafType.new(RefundConsolidatedInvoice) - ] - ), - - :RefundPrepaymentAmount => OneOf.new( + :SubscriptionCustomPriceInitialChargeInCents => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) - ] + LeafType.new(Integer) + ], + UnionTypeContext.new( + is_optional: true + ) ), - :RenewalPreviewComponentComponentId => OneOf.new( + :SubscriptionCustomPriceExpirationInterval => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -806,7 +754,7 @@ def self.union_types ) ), - :RenewalPreviewComponentPricePointId => OneOf.new( + :SubscriptionGroupCreditCardFullNumber => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -816,31 +764,32 @@ def self.union_types ) ), - :ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem => OneOf.new( - [ - LeafType.new(ScheduledRenewalItemRequestBodyComponent), - LeafType.new(ScheduledRenewalItemRequestBodyProduct) - ] - ), - - :ScheduledRenewalProductPricePointPriceInCents => OneOf.new( + :SubscriptionGroupCreditCardExpirationMonth => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) - ] + ], + UnionTypeContext.new( + is_optional: true + ) ), - :ScheduledRenewalProductPricePointInterval => OneOf.new( + :SubscriptionGroupCreditCardExpirationYear => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) - ] + ], + UnionTypeContext.new( + is_optional: true + ) ), - :ScheduledRenewalUpdateRequestRenewalConfigurationItem => OneOf.new( + :RefundConsolidatedInvoiceSegmentUids => OneOf.new( [ - LeafType.new(ScheduledRenewalItemRequestBodyComponent), - LeafType.new(ScheduledRenewalItemRequestBodyProduct) + LeafType.new(String, UnionTypeContext.new( + is_array: true + )), + LeafType.new(String) ] ), @@ -892,89 +841,133 @@ def self.union_types ) ), - :SubscriptionComponentAllocatedQuantity => OneOf.new( + :PaymentProfile => AnyOf.new( [ - LeafType.new(Integer), - LeafType.new(String) - ], - UnionTypeContext.new( - is_optional: true - ) + LeafType.new(ApplePayPaymentProfile, UnionTypeContext.new( + discriminator_value: 'apple_pay', + discriminator: 'payment_type' + )), + LeafType.new(BankAccountPaymentProfile, UnionTypeContext.new( + discriminator_value: 'bank_account', + discriminator: 'payment_type' + )), + LeafType.new(CreditCardPaymentProfile, UnionTypeContext.new( + discriminator_value: 'credit_card', + discriminator: 'payment_type' + )), + LeafType.new(PaypalPaymentProfile, UnionTypeContext.new( + discriminator_value: 'paypal_account', + discriminator: 'payment_type' + )) + ] ), - :SubscriptionCustomPricePriceInCents => OneOf.new( + :RefundPrepaymentAmount => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float) ] ), - :SubscriptionCustomPriceInterval => OneOf.new( + :ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem => OneOf.new( + [ + LeafType.new(ScheduledRenewalItemRequestBodyComponent), + LeafType.new(ScheduledRenewalItemRequestBodyProduct) + ] + ), + + :ScheduledRenewalProductPricePointPriceInCents => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) ] ), - :SubscriptionCustomPriceTrialPriceInCents => OneOf.new( + :ScheduledRenewalProductPricePointInterval => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) + ] + ), + + :SubscriptionComponentAllocatedQuantity => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionCustomPriceTrialInterval => OneOf.new( + :SubscriptionGroupCreateErrorResponseErrors => OneOf.new( + [ + LeafType.new(SubscriptionGroupMembersArrayError), + LeafType.new(SubscriptionGroupSingleError), + LeafType.new(String) + ] + ), + + :OnOffComponentUnitPrice => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) - ], - UnionTypeContext.new( - is_optional: true - ) + LeafType.new(Float) + ] ), - :SubscriptionCustomPriceInitialChargeInCents => OneOf.new( + :PrepaidUsageComponentUnitPrice => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionCustomPriceExpirationInterval => OneOf.new( + :PriceStartingQuantity => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) + ] + ), + + :PriceEndingQuantity => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( - is_optional: true + is_optional: true, + is_nullable: true ) ), - :SubscriptionGroupCreateErrorResponseErrors => OneOf.new( + :PriceUnitPrice => OneOf.new( [ - LeafType.new(SubscriptionGroupMembersArrayError), - LeafType.new(SubscriptionGroupSingleError), + LeafType.new(Float), LeafType.new(String) ] ), - :SubscriptionGroupCreditCardFullNumber => OneOf.new( + :QuantityBasedComponentUnitPrice => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionGroupCreditCardExpirationMonth => OneOf.new( + :RefundInvoiceRequestRefund => AnyOf.new( + [ + LeafType.new(RefundInvoice), + LeafType.new(RefundConsolidatedInvoice) + ] + ), + + :RenewalPreviewComponentComponentId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -984,7 +977,7 @@ def self.union_types ) ), - :SubscriptionGroupCreditCardExpirationYear => OneOf.new( + :RenewalPreviewComponentPricePointId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -994,6 +987,13 @@ def self.union_types ) ), + :ScheduledRenewalUpdateRequestRenewalConfigurationItem => OneOf.new( + [ + LeafType.new(ScheduledRenewalItemRequestBodyComponent), + LeafType.new(ScheduledRenewalItemRequestBodyProduct) + ] + ), + :SubscriptionGroupSignupComponentComponentId => OneOf.new( [ LeafType.new(String), @@ -1034,18 +1034,6 @@ def self.union_types ) ), - :UpdateMetafieldsRequestMetafields => OneOf.new( - [ - LeafType.new(UpdateMetafield), - LeafType.new(UpdateMetafield, UnionTypeContext.new( - is_array: true - )) - ], - UnionTypeContext.new( - is_optional: true - ) - ), - :UpdatePriceEndingQuantity => OneOf.new( [ LeafType.new(Integer), @@ -1076,6 +1064,18 @@ def self.union_types ) ), + :UpdateMetafieldsRequestMetafields => OneOf.new( + [ + LeafType.new(UpdateMetafield), + LeafType.new(UpdateMetafield, UnionTypeContext.new( + is_array: true + )) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + :UpdateSubscriptionSnapDay => OneOf.new( [ LeafType.new(String), From e975cab5e72f32042764b9005090c94d2c3ef92f Mon Sep 17 00:00:00 2001 From: lucassus Date: Tue, 9 Jun 2026 19:58:07 +0000 Subject: [PATCH 2/9] Automated commit message --- README.md | 96 +-- advanced_billing.gemspec | 2 +- doc/controllers/advance-invoice.md | 18 + doc/controllers/api-exports.md | 54 ++ doc/controllers/billing-portal.md | 24 + doc/controllers/component-price-points.md | 72 ++ doc/controllers/components.md | 78 +- doc/controllers/coupons.md | 84 ++ doc/controllers/custom-fields.md | 54 ++ doc/controllers/customers.md | 42 + .../events-based-billing-segments.md | 36 + doc/controllers/events.md | 18 + doc/controllers/insights.md | 28 +- doc/controllers/invoices.md | 144 +++- doc/controllers/offers.md | 30 + doc/controllers/payment-profiles.md | 139 ++-- doc/controllers/product-families.md | 24 + doc/controllers/product-price-points.md | 66 ++ doc/controllers/products.md | 36 + doc/controllers/proforma-invoices.md | 60 ++ doc/controllers/reason-codes.md | 30 + doc/controllers/referral-codes.md | 6 + doc/controllers/sales-commissions.md | 18 + doc/controllers/sites.md | 28 +- doc/controllers/subscription-components.md | 142 +++- .../subscription-group-invoice-account.md | 32 +- doc/controllers/subscription-group-status.md | 40 +- doc/controllers/subscription-groups.md | 80 +- .../subscription-invoice-account.md | 60 +- doc/controllers/subscription-notes.md | 38 +- doc/controllers/subscription-products.md | 61 +- doc/controllers/subscription-renewals.md | 66 ++ doc/controllers/subscription-status.md | 94 ++- doc/controllers/subscriptions.md | 120 ++- doc/controllers/webhooks.md | 56 +- doc/models/activate-event-based-component.md | 2 +- doc/models/bank-account-payment-profile.md | 7 +- doc/models/bank-account-response.md | 1 - doc/models/billing-schedule.md | 6 +- ...location-preview-item-previous-quantity.md | 20 + .../allocation-preview-item-quantity.md | 20 + .../allocation-previous-quantity.md | 20 + doc/models/containers/allocation-quantity.md | 20 + ...hive-component-price-point-component-id.md | 20 + ...ve-component-price-point-price-point-id.md | 20 + ...hive-product-price-point-price-point-id.md | 20 + .../archive-product-price-point-product-id.md | 20 + .../containers/calendar-billing-snap-day.md | 20 + ...lone-component-price-point-component-id.md | 20 + ...ne-component-price-point-price-point-id.md | 20 + ...nt-allocation-change-allocated-quantity.md | 20 + ...nent-price-point-assignment-price-point.md | 20 + .../containers/coupon-payload-percentage.md | 20 + .../create-allocation-price-point-id.md | 20 + ...mponent-price-point-request-price-point.md | 43 + ...onent-price-points-request-price-points.md | 43 + .../create-invoice-coupon-amount.md | 20 + .../create-invoice-coupon-percentage.md | 20 + ...create-invoice-coupon-product-family-id.md | 20 + .../create-invoice-item-component-id.md | 20 + .../create-invoice-item-price-point-id.md | 20 + .../create-invoice-item-product-id.md | 20 + ...ate-invoice-item-product-price-point-id.md | 20 + .../create-invoice-item-quantity.md | 20 + .../create-invoice-item-unit-price.md | 20 + .../create-invoice-payment-amount.md | 20 + .../create-metafields-request-metafields.md | 36 + .../create-multi-invoice-payment-amount.md | 20 + ...eate-or-update-segment-price-unit-price.md | 20 + ...create-payment-profile-expiration-month.md | 20 + .../create-payment-profile-expiration-year.md | 20 + .../create-product-price-point-product-id.md | 20 + ...create-segment-segment-property-1-value.md | 40 + ...create-segment-segment-property-2-value.md | 40 + ...create-segment-segment-property-3-value.md | 40 + ...create-segment-segment-property-4-value.md | 40 + ...bscription-component-allocated-quantity.md | 20 + ...ate-subscription-component-component-id.md | 20 + ...e-subscription-component-price-point-id.md | 20 + .../create-subscription-offer-id.md | 20 + .../containers/create-usage-component-id.md | 20 + ...eate-usage-subscription-id-or-reference.md | 20 + .../customer-error-response-errors.md | 22 + .../deduct-service-credit-amount.md | 20 + .../containers/ebb-component-unit-price.md | 20 + .../containers/event-event-specific-data.md | 315 +++++++ .../containers/invoice-event-payment.md | 70 ++ doc/models/containers/invoice-event.md | 387 +++++++++ .../containers/issue-service-credit-amount.md | 20 + ...t-product-price-points-input-product-id.md | 20 + .../list-usages-input-component-id.md | 20 + ...ages-input-subscription-id-or-reference.md | 20 + doc/models/containers/metafield-enum.md | 22 + .../metered-component-unit-price.md | 20 + .../containers/on-off-component-unit-price.md | 20 + ...ent-profile-attributes-expiration-month.md | 20 + ...ment-profile-attributes-expiration-year.md | 20 + doc/models/containers/payment-profile.md | 68 ++ .../prepaid-usage-component-unit-price.md | 20 + .../containers/price-ending-quantity.md | 20 + .../containers/price-starting-quantity.md | 20 + doc/models/containers/price-unit-price.md | 20 + .../quantity-based-component-unit-price.md | 20 + .../reactivate-subscription-request-resume.md | 20 + ...read-component-price-point-component-id.md | 20 + ...ad-component-price-point-price-point-id.md | 20 + ...read-product-price-point-price-point-id.md | 20 + .../read-product-price-point-product-id.md | 20 + ...efund-consolidated-invoice-segment-uids.md | 22 + .../refund-invoice-request-refund.md | 31 + .../containers/refund-prepayment-amount.md | 20 + .../renewal-preview-component-component-id.md | 20 + ...enewal-preview-component-price-point-id.md | 20 + ...item-request-renewal-configuration-item.md | 26 + ...ed-renewal-product-price-point-interval.md | 20 + ...ewal-product-price-point-price-in-cents.md | 20 + ...date-request-renewal-configuration-item.md | 26 + .../segment-segment-property-1-value.md | 40 + .../segment-segment-property-2-value.md | 40 + .../segment-segment-property-3-value.md | 40 + .../segment-segment-property-4-value.md | 40 + ...bscription-component-allocated-quantity.md | 20 + ...iption-custom-price-expiration-interval.md | 20 + ...on-custom-price-initial-charge-in-cents.md | 20 + .../subscription-custom-price-interval.md | 20 + ...ubscription-custom-price-price-in-cents.md | 20 + ...ubscription-custom-price-trial-interval.md | 20 + ...ption-custom-price-trial-price-in-cents.md | 20 + ...tion-group-create-error-response-errors.md | 36 + ...tion-group-credit-card-expiration-month.md | 20 + ...ption-group-credit-card-expiration-year.md | 20 + ...scription-group-credit-card-full-number.md | 20 + ...oup-signup-component-allocated-quantity.md | 20 + ...ion-group-signup-component-component-id.md | 20 + ...n-group-signup-component-price-point-id.md | 20 + ...ion-group-signup-component-unit-balance.md | 20 + ...date-component-price-point-component-id.md | 20 + ...te-component-price-point-price-point-id.md | 20 + .../update-metafields-request-metafields.md | 22 + .../update-price-ending-quantity.md | 20 + .../update-price-starting-quantity.md | 20 + .../containers/update-price-unit-price.md | 20 + ...date-product-price-point-price-point-id.md | 20 + .../update-product-price-point-product-id.md | 20 + .../update-subscription-net-terms.md | 20 + .../update-subscription-snap-day.md | 20 + doc/models/containers/usage-quantity.md | 20 + doc/models/create-allocation.md | 2 +- doc/models/create-invoice.md | 2 +- doc/models/create-on-off-component.md | 2 +- doc/models/create-or-update-endpoint.md | 2 +- doc/models/create-payment-profile.md | 6 +- doc/models/create-usage.md | 2 +- doc/models/credit-card-payment-profile.md | 2 +- doc/models/credit-note-line-item.md | 1 + doc/models/event-key.md | 1 + doc/models/event-response.md | 2 +- doc/models/event.md | 2 +- doc/models/invoice-line-item.md | 1 + doc/models/payment-profile-attributes.md | 2 +- doc/models/webhook-subscription.md | 1 + lib/advanced_billing.rb | 766 +++++++++--------- .../controllers/base_controller.rb | 2 +- .../controllers/components_controller.rb | 6 +- .../controllers/invoices_controller.rb | 46 +- .../payment_profiles_controller.rb | 102 +-- .../controllers/sites_controller.rb | 17 +- .../subscription_components_controller.rb | 66 +- ...iption_group_invoice_account_controller.rb | 21 +- .../subscription_group_status_controller.rb | 32 +- .../subscription_groups_controller.rb | 26 +- ...subscription_invoice_account_controller.rb | 34 +- .../subscription_notes_controller.rb | 11 +- .../subscription_products_controller.rb | 88 +- .../subscription_status_controller.rb | 62 +- .../controllers/subscriptions_controller.rb | 69 +- .../controllers/webhooks_controller.rb | 10 +- .../models/activate_event_based_component.rb | 7 +- .../models/bank_account_payment_profile.rb | 44 +- .../models/billing_schedule.rb | 18 +- .../models/create_allocation.rb | 7 +- lib/advanced_billing/models/create_invoice.rb | 5 +- .../models/create_payment_profile.rb | 13 +- lib/advanced_billing/models/create_usage.rb | 7 +- .../models/credit_card_payment_profile.rb | 12 +- .../models/credit_note_line_item.rb | 49 +- lib/advanced_billing/models/event_key.rb | 4 + .../models/invoice_line_item.rb | 55 +- .../models/payment_profile_attributes.rb | 12 +- .../models/webhook_subscription.rb | 4 + .../utilities/union_type_lookup.rb | 462 +++++------ 191 files changed, 5944 insertions(+), 1322 deletions(-) diff --git a/README.md b/README.md index 0abd96b..ce65978 100644 --- a/README.md +++ b/README.md @@ -29,16 +29,16 @@ curl -u :x -H Accept:application/json -H Content-Type:application/json Install the gem from the command line: ```bash -gem install maxio-advanced-billing-sdk -v 9.0.0 +gem install maxio-advanced-billing-sdk -v 9.1.0 ``` Or add the gem to your Gemfile and run `bundle`: ```ruby -gem 'maxio-advanced-billing-sdk', '9.0.0' +gem 'maxio-advanced-billing-sdk', '9.1.0' ``` -For additional gem details, see the [RubyGems page for the maxio-advanced-billing-sdk gem](https://rubygems.org/gems/maxio-advanced-billing-sdk/versions/9.0.0). +For additional gem details, see the [RubyGems page for the maxio-advanced-billing-sdk gem](https://rubygems.org/gems/maxio-advanced-billing-sdk/versions/9.1.0). ## IRB Console Usage @@ -77,14 +77,14 @@ ruby bin/console ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/client.md) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | | site | `String` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | -| environment | [`Environment`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/README.md#environments) | The API environment.
**Default: `Environment.US`** | +| environment | [`Environment`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/README.md#environments) | The API environment.
**Default: `Environment.US`** | | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests | | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests | | timeout | `Float` | The value to use for connection timeout.
**Default: 120** | @@ -94,8 +94,8 @@ The following parameters are configurable for the API Client: | retry_statuses | `Array` | A list of HTTP statuses to retry.
**Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | | retry_methods | `Array` | A list of HTTP methods to retry.
**Default: %i[get put]** | | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. | -| proxy_settings | [`ProxySettings`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | -| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | +| proxy_settings | [`ProxySettings`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | +| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | The API client can be initialized as follows: @@ -125,7 +125,7 @@ include AdvancedBilling client = Client.from_env ``` -See the [`Environment-Based Client Initialization`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/environment-based-client-initialization.md) section for details. +See the [`Environment-Based Client Initialization`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/environment-based-client-initialization.md) section for details. ## Environments @@ -142,58 +142,58 @@ The SDK can be configured to use a different environment for making API calls. A This API uses the following authentication schemes. -* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/auth/basic-authentication.md) +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/auth/basic-authentication.md) ## List of APIs -* [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/api-exports.md) -* [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/advance-invoice.md) -* [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/billing-portal.md) -* [Component Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/component-price-points.md) -* [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/custom-fields.md) -* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/events-based-billing-segments.md) -* [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/payment-profiles.md) -* [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/product-families.md) -* [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/product-price-points.md) -* [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/proforma-invoices.md) -* [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/reason-codes.md) -* [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/referral-codes.md) -* [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/sales-commissions.md) -* [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/subscription-components.md) -* [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/subscription-groups.md) -* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/subscription-group-invoice-account.md) -* [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/subscription-group-status.md) -* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/subscription-invoice-account.md) -* [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/subscription-notes.md) -* [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/subscription-products.md) -* [Subscription Renewals](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/subscription-renewals.md) -* [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/subscription-status.md) -* [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/coupons.md) -* [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/components.md) -* [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/customers.md) -* [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/events.md) -* [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/insights.md) -* [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/invoices.md) -* [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/offers.md) -* [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/products.md) -* [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/sites.md) -* [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/subscriptions.md) -* [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/controllers/webhooks.md) +* [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/api-exports.md) +* [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/advance-invoice.md) +* [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/billing-portal.md) +* [Component Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/component-price-points.md) +* [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/custom-fields.md) +* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/events-based-billing-segments.md) +* [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/payment-profiles.md) +* [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/product-families.md) +* [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/product-price-points.md) +* [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/proforma-invoices.md) +* [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/reason-codes.md) +* [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/referral-codes.md) +* [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/sales-commissions.md) +* [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-components.md) +* [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-groups.md) +* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-group-invoice-account.md) +* [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-group-status.md) +* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-invoice-account.md) +* [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-notes.md) +* [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-products.md) +* [Subscription Renewals](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-renewals.md) +* [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-status.md) +* [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/coupons.md) +* [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/components.md) +* [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/customers.md) +* [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/events.md) +* [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/insights.md) +* [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/invoices.md) +* [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/offers.md) +* [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/products.md) +* [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/sites.md) +* [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscriptions.md) +* [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/webhooks.md) ## SDK Infrastructure ### Configuration -* [ProxySettings](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/proxy-settings.md) -* [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/environment-based-client-initialization.md) +* [ProxySettings](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/proxy-settings.md) +* [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/environment-based-client-initialization.md) ### HTTP -* [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/http-response.md) -* [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/http-request.md) +* [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/http-response.md) +* [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/http-request.md) ### Utilities -* [ApiHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/api-helper.md) -* [DateTimeHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.0.0/doc/date-time-helper.md) +* [ApiHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/api-helper.md) +* [DateTimeHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/date-time-helper.md) diff --git a/advanced_billing.gemspec b/advanced_billing.gemspec index 6b29f57..7376f42 100644 --- a/advanced_billing.gemspec +++ b/advanced_billing.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'maxio-advanced-billing-sdk' - s.version = '9.0.0' + s.version = '9.1.0' s.summary = 'SDK for Maxio Advanced Billing' s.description = "Ultimate billing and pricing flexibility for B2B SaaS.\nMaxio integrates directly into your product, so you can seamlessly manage your product catalog, bill customers, and collect payments." s.authors = ['Maxio SDK'] diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index e8d5789..0d55e4e 100644 --- a/doc/controllers/advance-invoice.md +++ b/doc/controllers/advance-invoice.md @@ -27,6 +27,10 @@ def issue_advance_invoice(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -36,6 +40,8 @@ def issue_advance_invoice(subscription_id, ## Response Type +**201**: Created + [`Invoice`](../../doc/models/invoice.md) ## Example Usage @@ -70,6 +76,10 @@ Once an advance invoice has been generated for a subscription's upcoming renewal def read_advance_invoice(subscription_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -78,6 +88,8 @@ def read_advance_invoice(subscription_id) ## Response Type +**200**: OK + [`Invoice`](../../doc/models/invoice.md) ## Example Usage @@ -106,6 +118,10 @@ def void_advance_invoice(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -115,6 +131,8 @@ def void_advance_invoice(subscription_id, ## Response Type +**201**: Created + [`Invoice`](../../doc/models/invoice.md) ## Example Usage diff --git a/doc/controllers/api-exports.md b/doc/controllers/api-exports.md index aa97dad..af8ea40 100644 --- a/doc/controllers/api-exports.md +++ b/doc/controllers/api-exports.md @@ -31,6 +31,10 @@ Example: `GET https://{subdomain}.chargify.com/api_exports/proforma_invoices/123 def list_exported_proforma_invoices(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -41,6 +45,8 @@ def list_exported_proforma_invoices(options = {}) ## Response Type +**200**: OK + [`Array[ProformaInvoice]`](../../doc/models/proforma-invoice.md) ## Example Usage @@ -73,6 +79,10 @@ Example: `GET https://{subdomain}.chargify.com/api_exports/invoices/123/rows?per def list_exported_invoices(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -83,6 +93,8 @@ def list_exported_invoices(options = {}) ## Response Type +**200**: OK + [`Array[Invoice]`](../../doc/models/invoice.md) ## Example Usage @@ -115,6 +127,10 @@ Example: `GET https://{subdomain}.chargify.com/api_exports/subscriptions/123/row def list_exported_subscriptions(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -125,6 +141,8 @@ def list_exported_subscriptions(options = {}) ## Response Type +**200**: OK + [`Array[Subscription]`](../../doc/models/subscription.md) ## Example Usage @@ -157,8 +175,14 @@ It is only available for Relationship Invoicing architecture. def export_proforma_invoices ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Response Type +**201**: Created + [`BatchJobResponse`](../../doc/models/batch-job-response.md) ## Example Usage @@ -184,8 +208,14 @@ This API creates an invoices export and returns a batchjob object. def export_invoices ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Response Type +**201**: Created + [`BatchJobResponse`](../../doc/models/batch-job-response.md) ## Example Usage @@ -211,8 +241,14 @@ This API creates a subscriptions export and returns a batchjob object. def export_subscriptions ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Response Type +**201**: Created + [`BatchJobResponse`](../../doc/models/batch-job-response.md) ## Example Usage @@ -237,6 +273,10 @@ This API returns a batchjob object for proforma invoices export. def read_proforma_invoices_export(batch_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -245,6 +285,8 @@ def read_proforma_invoices_export(batch_id) ## Response Type +**200**: OK + [`BatchJobResponse`](../../doc/models/batch-job-response.md) ## Example Usage @@ -271,6 +313,10 @@ This API returns a batchjob object for invoices export. def read_invoices_export(batch_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -279,6 +325,8 @@ def read_invoices_export(batch_id) ## Response Type +**200**: OK + [`BatchJobResponse`](../../doc/models/batch-job-response.md) ## Example Usage @@ -305,6 +353,10 @@ This API returns a batchjob object for subscriptions export. def read_subscriptions_export(batch_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -313,6 +365,8 @@ def read_subscriptions_export(batch_id) ## Response Type +**200**: OK + [`BatchJobResponse`](../../doc/models/batch-job-response.md) ## Example Usage diff --git a/doc/controllers/billing-portal.md b/doc/controllers/billing-portal.md index 54b0a94..ee06d63 100644 --- a/doc/controllers/billing-portal.md +++ b/doc/controllers/billing-portal.md @@ -39,6 +39,10 @@ def enable_billing_portal_for_customer(customer_id, auto_invite: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -48,6 +52,8 @@ def enable_billing_portal_for_customer(customer_id, ## Response Type +**200**: OK + [`CustomerResponse`](../../doc/models/customer-response.md) ## Example Usage @@ -82,6 +88,10 @@ This method will provide to the API user the exact URL required for a subscriber def read_billing_portal_link(customer_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -90,6 +100,8 @@ def read_billing_portal_link(customer_id) ## Response Type +**200**: OK + [`PortalManagementLink`](../../doc/models/portal-management-link.md) ## Example Usage @@ -142,6 +154,10 @@ This endpoint will only return a JSON response. def resend_billing_portal_invitation(customer_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -150,6 +166,8 @@ def resend_billing_portal_invitation(customer_id) ## Response Type +**200**: OK + [`ResentInvitation`](../../doc/models/resent-invitation.md) ## Example Usage @@ -194,6 +212,10 @@ This endpoint will only return a JSON response. def revoke_billing_portal_access(customer_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -202,6 +224,8 @@ def revoke_billing_portal_access(customer_id) ## Response Type +**200**: OK + [`RevokedInvitation`](../../doc/models/revoked-invitation.md) ## Example Usage diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index c2a787c..3fedd00 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -37,6 +37,10 @@ def promote_component_price_point_to_default(component_id, price_point_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -46,6 +50,8 @@ def promote_component_price_point_to_default(component_id, ## Response Type +**200**: OK + [`ComponentResponse`](../../doc/models/component-response.md) ## Example Usage @@ -105,6 +111,10 @@ def create_component_price_point(component_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -114,6 +124,8 @@ def create_component_price_point(component_id, ## Response Type +**200**: OK + [`ComponentPricePointResponse`](../../doc/models/component-price-point-response.md) ## Example Usage @@ -170,6 +182,10 @@ If the price point is set to `use_site_exchange_rate: true`, it will return pric def list_component_price_points(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -182,6 +198,8 @@ def list_component_price_points(options = {}) ## Response Type +**201**: Created + [`ComponentPricePointsResponse`](../../doc/models/component-price-points-response.md) ## Example Usage @@ -257,6 +275,10 @@ def bulk_create_component_price_points(component_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -266,6 +288,8 @@ def bulk_create_component_price_points(component_id, ## Response Type +**200**: OK + [`ComponentPricePointsResponse`](../../doc/models/component-price-points-response.md) ## Example Usage @@ -392,6 +416,10 @@ def clone_component_price_point(component_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -402,6 +430,8 @@ def clone_component_price_point(component_id, ## Response Type +**201**: Created + [`ComponentPricePointCurrencyOverageResponse`](../../doc/models/component-price-point-currency-overage-response.md) ## Example Usage @@ -521,6 +551,10 @@ def update_component_price_point(component_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -531,6 +565,8 @@ def update_component_price_point(component_id, ## Response Type +**200**: OK + [`ComponentPricePointResponse`](../../doc/models/component-price-point-response.md) ## Example Usage @@ -586,6 +622,10 @@ def read_component_price_point(component_id, currency_prices: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -596,6 +636,8 @@ def read_component_price_point(component_id, ## Response Type +**200**: OK + [`ComponentPricePointCurrencyOverageResponse`](../../doc/models/component-price-point-currency-overage-response.md) ## Example Usage @@ -622,6 +664,10 @@ def archive_component_price_point(component_id, price_point_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -631,6 +677,8 @@ def archive_component_price_point(component_id, ## Response Type +**200**: OK + [`ComponentPricePointResponse`](../../doc/models/component-price-point-response.md) ## Example Usage @@ -697,6 +745,10 @@ def unarchive_component_price_point(component_id, price_point_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -706,6 +758,8 @@ def unarchive_component_price_point(component_id, ## Response Type +**200**: OK + [`ComponentPricePointResponse`](../../doc/models/component-price-point-response.md) ## Example Usage @@ -770,6 +824,10 @@ def create_currency_prices(price_point_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -779,6 +837,8 @@ def create_currency_prices(price_point_id, ## Response Type +**200**: OK + [`ComponentCurrencyPricesResponse`](../../doc/models/component-currency-prices-response.md) ## Example Usage @@ -843,6 +903,10 @@ def update_currency_prices(price_point_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -852,6 +916,8 @@ def update_currency_prices(price_point_id, ## Response Type +**200**: OK + [`ComponentCurrencyPricesResponse`](../../doc/models/component-currency-prices-response.md) ## Example Usage @@ -911,6 +977,10 @@ This method allows to retrieve a list of Components Price Points belonging to a def list_all_component_price_points(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -923,6 +993,8 @@ def list_all_component_price_points(options = {}) ## Response Type +**200**: OK + [`ListComponentsPricePointsResponse`](../../doc/models/list-components-price-points-response.md) ## Example Usage diff --git a/doc/controllers/components.md b/doc/controllers/components.md index 2d8a4c1..dcc5e8b 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -12,7 +12,7 @@ components_controller = client.components * [Create Metered Component](../../doc/controllers/components.md#create-metered-component) * [Create Quantity Based Component](../../doc/controllers/components.md#create-quantity-based-component) -* [Create on Off Component](../../doc/controllers/components.md#create-on-off-component) +* [Create On Off Component](../../doc/controllers/components.md#create-on-off-component) * [Create Prepaid Usage Component](../../doc/controllers/components.md#create-prepaid-usage-component) * [Create Event Based Component](../../doc/controllers/components.md#create-event-based-component) * [Find Component](../../doc/controllers/components.md#find-component) @@ -28,7 +28,7 @@ components_controller = client.components This request will create a component definition of kind **metered_component** under the specified product family. Metered component can then be added and “allocated” for a subscription. -Metered components are used to bill for any type of unit that resets to 0 at the end of the billing period (think daily Google Adwords clicks or monthly cell phone minutes). This is most commonly associated with usage-based billing and many other pricing schemes. +Metered components are used to bill for any type of unit that resets to 0 at the end of the billing period (think daily Google Ads clicks or monthly cell phone minutes). This is most commonly associated with usage-based billing and many other pricing schemes. Note that this is different from recurring quantity-based components, which DO NOT reset to zero at the start of every billing period. If you want to bill for a quantity of something that does not change unless you change it, then you want quantity components, instead. @@ -39,6 +39,10 @@ def create_metered_component(product_family_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -48,6 +52,8 @@ def create_metered_component(product_family_id, ## Response Type +**201**: Created + [`ComponentResponse`](../../doc/models/component-response.md) ## Example Usage @@ -158,6 +164,10 @@ def create_quantity_based_component(product_family_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -167,6 +177,8 @@ def create_quantity_based_component(product_family_id, ## Response Type +**201**: Created + [`ComponentResponse`](../../doc/models/component-response.md) ## Example Usage @@ -255,7 +267,7 @@ puts result | 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | -# Create on Off Component +# Create On Off Component This request will create a component definition of kind **on_off_component** under the specified product family. On/Off component can then be added and “allocated” for a subscription. @@ -268,6 +280,10 @@ def create_on_off_component(product_family_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -277,6 +293,8 @@ def create_on_off_component(product_family_id, ## Response Type +**201**: Created + [`ComponentResponse`](../../doc/models/component-response.md) ## Example Usage @@ -363,6 +381,10 @@ def create_prepaid_usage_component(product_family_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -372,6 +394,8 @@ def create_prepaid_usage_component(product_family_id, ## Response Type +**201**: Created + [`ComponentResponse`](../../doc/models/component-response.md) ## Example Usage @@ -498,6 +522,10 @@ def create_event_based_component(product_family_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -507,6 +535,8 @@ def create_event_based_component(product_family_id, ## Response Type +**201**: Created + [`ComponentResponse`](../../doc/models/component-response.md) ## Example Usage @@ -594,6 +624,10 @@ This request will return information regarding a component having the handle you def find_component(handle) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -602,6 +636,8 @@ def find_component(handle) ## Response Type +**200**: OK + [`ComponentResponse`](../../doc/models/component-response.md) ## Example Usage @@ -655,6 +691,10 @@ def read_component(product_family_id, component_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -664,6 +704,8 @@ def read_component(product_family_id, ## Response Type +**200**: OK + [`ComponentResponse`](../../doc/models/component-response.md) ## Example Usage @@ -724,6 +766,10 @@ def update_product_family_component(product_family_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -734,6 +780,8 @@ def update_product_family_component(product_family_id, ## Response Type +**200**: OK + [`ComponentResponse`](../../doc/models/component-response.md) ## Example Usage @@ -803,6 +851,10 @@ def archive_component(product_family_id, component_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -812,6 +864,8 @@ def archive_component(product_family_id, ## Response Type +**200**: OK + [`Component`](../../doc/models/component.md) ## Example Usage @@ -869,6 +923,10 @@ This request will return a list of components for a site. def list_components(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -885,6 +943,8 @@ def list_components(options = {}) ## Response Type +**200**: OK + [`Array[ComponentResponse]`](../../doc/models/component-response.md) ## Example Usage @@ -1018,6 +1078,10 @@ def update_component(component_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1027,6 +1091,8 @@ def update_component(component_id, ## Response Type +**200**: OK + [`ComponentResponse`](../../doc/models/component-response.md) ## Example Usage @@ -1092,6 +1158,10 @@ This request will return a list of components for a particular product family. def list_components_for_product_family(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1109,6 +1179,8 @@ def list_components_for_product_family(options = {}) ## Response Type +**200**: OK + [`Array[ComponentResponse]`](../../doc/models/component-response.md) ## Example Usage diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index 38e04b1..22b541c 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -48,6 +48,10 @@ def create_coupon(product_family_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -57,6 +61,8 @@ def create_coupon(product_family_id, ## Response Type +**201**: Created + [`CouponResponse`](../../doc/models/coupon-response.md) ## Example Usage @@ -110,6 +116,10 @@ List coupons for a specific Product Family in a Site. def list_coupons_for_product_family(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -122,6 +132,8 @@ def list_coupons_for_product_family(options = {}) ## Response Type +**200**: OK + [`Array[CouponResponse]`](../../doc/models/coupon-response.md) ## Example Usage @@ -257,6 +269,10 @@ def find_coupon(product_family_id: nil, currency_prices: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -267,6 +283,8 @@ def find_coupon(product_family_id: nil, ## Response Type +**200**: OK + [`CouponResponse`](../../doc/models/coupon-response.md) ## Example Usage @@ -294,6 +312,10 @@ def read_coupon(product_family_id, currency_prices: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -304,6 +326,8 @@ def read_coupon(product_family_id, ## Response Type +**200**: OK + [`CouponResponse`](../../doc/models/coupon-response.md) ## Example Usage @@ -368,6 +392,10 @@ def update_coupon(product_family_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -378,6 +406,8 @@ def update_coupon(product_family_id, ## Response Type +**200**: OK + [`CouponResponse`](../../doc/models/coupon-response.md) ## Example Usage @@ -464,6 +494,10 @@ def archive_coupon(product_family_id, coupon_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -473,6 +507,8 @@ def archive_coupon(product_family_id, ## Response Type +**200**: OK + [`CouponResponse`](../../doc/models/coupon-response.md) ## Example Usage @@ -527,6 +563,10 @@ You can retrieve a list of coupons. def list_coupons(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -538,6 +578,8 @@ def list_coupons(options = {}) ## Response Type +**200**: OK + [`Array[CouponResponse]`](../../doc/models/coupon-response.md) ## Example Usage @@ -626,6 +668,10 @@ def read_coupon_usage(product_family_id, coupon_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -635,6 +681,8 @@ def read_coupon_usage(product_family_id, ## Response Type +**200**: OK + [`Array[CouponUsage]`](../../doc/models/coupon-usage.md) ## Example Usage @@ -715,6 +763,10 @@ def validate_coupon(code, product_family_id: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -724,6 +776,8 @@ def validate_coupon(code, ## Response Type +**200**: OK + [`CouponResponse`](../../doc/models/coupon-response.md) ## Example Usage @@ -782,6 +836,10 @@ def create_or_update_coupon_currency_prices(coupon_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -791,6 +849,8 @@ def create_or_update_coupon_currency_prices(coupon_id, ## Response Type +**200**: OK + [`CouponCurrencyResponse`](../../doc/models/coupon-currency-response.md) ## Example Usage @@ -873,6 +933,10 @@ def create_coupon_subcodes(coupon_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -882,6 +946,8 @@ def create_coupon_subcodes(coupon_id, ## Response Type +**200**: OK + [`CouponSubcodesResponse`](../../doc/models/coupon-subcodes-response.md) ## Example Usage @@ -925,6 +991,10 @@ This request allows you to request the subcodes that are attached to a coupon. def list_coupon_subcodes(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -935,6 +1005,8 @@ def list_coupon_subcodes(options = {}) ## Response Type +**200**: OK + [`CouponSubcodes`](../../doc/models/coupon-subcodes.md) ## Example Usage @@ -999,6 +1071,10 @@ def update_coupon_subcodes(coupon_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1008,6 +1084,8 @@ def update_coupon_subcodes(coupon_id, ## Response Type +**200**: OK + [`CouponSubcodesResponse`](../../doc/models/coupon-subcodes-response.md) ## Example Usage @@ -1061,6 +1139,10 @@ def delete_coupon_subcode(coupon_id, subcode) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1070,6 +1152,8 @@ def delete_coupon_subcode(coupon_id, ## Response Type +**200**: OK + `void` ## Example Usage diff --git a/doc/controllers/custom-fields.md b/doc/controllers/custom-fields.md index 23a3512..8830621 100644 --- a/doc/controllers/custom-fields.md +++ b/doc/controllers/custom-fields.md @@ -43,6 +43,10 @@ def create_metafields(resource_type, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -52,6 +56,8 @@ def create_metafields(resource_type, ## Response Type +**200**: OK + [`Array[Metafield]`](../../doc/models/metafield.md) ## Example Usage @@ -129,6 +135,10 @@ Lists the metafields and their associated details for a Site and resource type. def list_metafields(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -141,6 +151,8 @@ def list_metafields(options = {}) ## Response Type +**200**: OK + [`ListMetafieldsResponse`](../../doc/models/list-metafields-response.md) ## Example Usage @@ -220,6 +232,10 @@ def update_metafield(resource_type, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -229,6 +245,8 @@ def update_metafield(resource_type, ## Response Type +**200**: OK + [`Array[Metafield]`](../../doc/models/metafield.md) ## Example Usage @@ -256,6 +274,10 @@ def delete_metafield(resource_type, name: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -265,6 +287,8 @@ def delete_metafield(resource_type, ## Response Type +**200**: OK + `void` ## Example Usage @@ -296,6 +320,10 @@ def create_metadata(resource_type, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -306,6 +334,8 @@ def create_metadata(resource_type, ## Response Type +**200**: OK + [`Array[Metadata]`](../../doc/models/metadata.md) ## Example Usage @@ -351,6 +381,10 @@ Lists metadata and metafields for a specific customer or subscription. def list_metadata(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -362,6 +396,8 @@ def list_metadata(options = {}) ## Response Type +**200**: OK + [`PaginatedMetadata`](../../doc/models/paginated-metadata.md) ## Example Usage @@ -414,6 +450,10 @@ def update_metadata(resource_type, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -424,6 +464,8 @@ def update_metadata(resource_type, ## Response Type +**200**: OK + [`Array[Metadata]`](../../doc/models/metadata.md) ## Example Usage @@ -458,6 +500,10 @@ def delete_metadata(resource_type, names: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -469,6 +515,8 @@ def delete_metadata(resource_type, ## Response Type +**200**: OK + `void` ## Example Usage @@ -499,6 +547,10 @@ Lists metadata for a specified array of subscriptions or customers. def list_metadata_for_resource_type(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -517,6 +569,8 @@ def list_metadata_for_resource_type(options = {}) ## Response Type +**200**: OK + [`PaginatedMetadata`](../../doc/models/paginated-metadata.md) ## Example Usage diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index ccbe528..e23db8d 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -50,6 +50,10 @@ For more: [Customer Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672 def create_customer(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -58,6 +62,8 @@ def create_customer(body: nil) ## Response Type +**200**: OK + [`CustomerResponse`](../../doc/models/customer-response.md) ## Example Usage @@ -150,6 +156,10 @@ To retrieve a single, exact match by reference, use the [lookup endpoint](https: def list_customers(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -166,6 +176,8 @@ def list_customers(options = {}) ## Response Type +**200**: OK + [`Array[CustomerResponse]`](../../doc/models/customer-response.md) ## Example Usage @@ -274,6 +286,10 @@ Retrieves the Customer properties by Advanced Billing-generated Customer ID. def read_customer(id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -282,6 +298,8 @@ def read_customer(id) ## Response Type +**200**: OK + [`CustomerResponse`](../../doc/models/customer-response.md) ## Example Usage @@ -340,6 +358,10 @@ def update_customer(id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -349,6 +371,8 @@ def update_customer(id, ## Response Type +**200**: OK + [`CustomerResponse`](../../doc/models/customer-response.md) ## Example Usage @@ -418,6 +442,10 @@ This method allows you to delete the Customer. def delete_customer(id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -426,6 +454,8 @@ def delete_customer(id) ## Response Type +**204**: No Content + `void` ## Example Usage @@ -445,6 +475,10 @@ Use this method to return the customer object if you have the unique **Reference def read_customer_by_reference(reference) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -453,6 +487,8 @@ def read_customer_by_reference(reference) ## Response Type +**200**: OK + [`CustomerResponse`](../../doc/models/customer-response.md) ## Example Usage @@ -473,6 +509,10 @@ This method lists all subscriptions that belong to a customer. def list_customer_subscriptions(customer_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -481,6 +521,8 @@ def list_customer_subscriptions(customer_id) ## Response Type +**200**: OK + [`Array[SubscriptionResponse]`](../../doc/models/subscription-response.md) ## Example Usage diff --git a/doc/controllers/events-based-billing-segments.md b/doc/controllers/events-based-billing-segments.md index 5355ad5..135d894 100644 --- a/doc/controllers/events-based-billing-segments.md +++ b/doc/controllers/events-based-billing-segments.md @@ -30,6 +30,10 @@ def create_segment(component_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -40,6 +44,8 @@ def create_segment(component_id, ## Response Type +**201**: Created + [`SegmentResponse`](../../doc/models/segment-response.md) ## Example Usage @@ -96,6 +102,10 @@ You may specify component and/or price point by using either the numeric ID or t def list_segments_for_price_point(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -108,6 +118,8 @@ def list_segments_for_price_point(options = {}) ## Response Type +**200**: OK + [`ListSegmentsResponse`](../../doc/models/list-segments-response.md) ## Example Usage @@ -148,6 +160,10 @@ def update_segment(component_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -159,6 +175,8 @@ def update_segment(component_id, ## Response Type +**200**: OK + [`SegmentResponse`](../../doc/models/segment-response.md) ## Example Usage @@ -198,6 +216,10 @@ def delete_segment(component_id, id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -208,6 +230,8 @@ def delete_segment(component_id, ## Response Type +**204**: No Content + `void` ## Example Usage @@ -248,6 +272,10 @@ def bulk_create_segments(component_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -258,6 +286,8 @@ def bulk_create_segments(component_id, ## Response Type +**201**: Created + [`ListSegmentsResponse`](../../doc/models/list-segments-response.md) ## Example Usage @@ -296,6 +326,10 @@ def bulk_update_segments(component_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -306,6 +340,8 @@ def bulk_update_segments(component_id, ## Response Type +**200**: OK + [`ListSegmentsResponse`](../../doc/models/list-segments-response.md) ## Example Usage diff --git a/doc/controllers/events.md b/doc/controllers/events.md index b9b0b0a..8fddf5c 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -90,6 +90,10 @@ Here’s an example event for the `subscription_state_change` event: def list_events(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -108,6 +112,8 @@ def list_events(options = {}) ## Response Type +**200**: OK + [`Array[EventResponse]`](../../doc/models/event-response.md) ## Example Usage @@ -209,6 +215,10 @@ For precise mappings from key to event_specific_data, refer to [Event](../../doc def list_subscription_events(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -223,6 +233,8 @@ def list_subscription_events(options = {}) ## Response Type +**200**: OK + [`Array[EventResponse]`](../../doc/models/event-response.md) ## Example Usage @@ -295,6 +307,10 @@ Get a count of all the events for a given site by using this method. def read_events_count(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -308,6 +324,8 @@ def read_events_count(options = {}) ## Response Type +**200**: OK + [`CountResponse`](../../doc/models/count-response.md) ## Example Usage diff --git a/doc/controllers/insights.md b/doc/controllers/insights.md index d6915d7..ad1f415 100644 --- a/doc/controllers/insights.md +++ b/doc/controllers/insights.md @@ -13,7 +13,7 @@ insights_controller = client.insights * [Read Site Stats](../../doc/controllers/insights.md#read-site-stats) * [Read Mrr](../../doc/controllers/insights.md#read-mrr) * [List Mrr Movements](../../doc/controllers/insights.md#list-mrr-movements) -* [List Mrr Per Subscription](../../doc/controllers/insights.md#list-mrr-per-subscription) +* [List Mrr per Subscription](../../doc/controllers/insights.md#list-mrr-per-subscription) # Read Site Stats @@ -32,8 +32,14 @@ https://subdomain.chargify.com/dashboard def read_site_stats ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Response Type +**200**: OK + [`SiteSummary`](../../doc/models/site-summary.md) ## Example Usage @@ -74,6 +80,10 @@ def read_mrr(at_time: nil, subscription_id: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -83,6 +93,8 @@ def read_mrr(at_time: nil, ## Response Type +**200**: OK + [`MRRResponse`](../../doc/models/mrr-response.md) ## Example Usage @@ -146,6 +158,10 @@ Usage includes revenue from: def list_mrr_movements(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -157,6 +173,8 @@ def list_mrr_movements(options = {}) ## Response Type +**200**: OK + [`ListMRRResponse`](../../doc/models/list-mrr-response.md) ## Example Usage @@ -224,7 +242,7 @@ puts result ``` -# List Mrr Per Subscription +# List Mrr per Subscription **This endpoint is deprecated.** @@ -234,6 +252,10 @@ This endpoint returns your site's current MRR, including plan and usage breakout def list_mrr_per_subscription(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -246,6 +268,8 @@ def list_mrr_per_subscription(options = {}) ## Response Type +**200**: OK + [`SubscriptionMRRResponse`](../../doc/models/subscription-mrr-response.md) ## Example Usage diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index 24db06e..d2f76a2 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -37,13 +37,17 @@ Refund an invoice, segment, or consolidated invoice. A refund less than the total of a consolidated invoice will be split across its segments. -A $50.00 refund on a $100.00 consolidated invoice with one $60.00 and one $40.00 segment, the refunded amount will be applied as 50% of each ($30.00 and $20.00 respectively). +For a $50.00 refund on a $100.00 consolidated invoice with one $60.00 segment and one $40.00 segment, the refunded amount will be applied as 50% of each ($30.00 and $20.00, respectively). ```ruby def refund_invoice(uid, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -53,6 +57,8 @@ def refund_invoice(uid, ## Response Type +**200**: OK + [`Invoice`](../../doc/models/invoice.md) ## Example Usage @@ -93,6 +99,10 @@ By default, invoices returned on the index will only include totals, not detaile def list_invoices(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -123,6 +133,8 @@ def list_invoices(options = {}) ## Response Type +**200**: OK + [`ListInvoicesResponse`](../../doc/models/list-invoices-response.md) ## Example Usage @@ -455,6 +467,10 @@ Response: A single Invoice. def read_invoice(uid) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -463,6 +479,8 @@ def read_invoice(uid) ## Response Type +**200**: OK + [`Invoice`](../../doc/models/invoice.md) ## Example Usage @@ -551,6 +569,7 @@ puts result "subtotal_amount": "100.0", "discount_amount": "0.0", "tax_amount": "0.0", + "tax_included": false, "total_amount": "100.0", "tiered_unit_price": false, "period_range_start": "2018-07-26", @@ -615,6 +634,10 @@ Note - invoice events that occurred prior to 09/05/2018 __will not__ contain an def list_invoice_events(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -629,6 +652,8 @@ def list_invoice_events(options = {}) ## Response Type +**200**: OK + [`ListInvoiceEventsResponse`](../../doc/models/list-invoice-events-response.md) ## Example Usage @@ -746,6 +771,7 @@ puts result "subtotal_amount": "99.0", "discount_amount": "9.9", "tax_amount": "6.01425", + "tax_included": false, "total_amount": "95.11425", "tiered_unit_price": false, "period_range_start": "2018-08-01", @@ -766,6 +792,7 @@ puts result "subtotal_amount": "15.5", "discount_amount": "1.55", "tax_amount": "0.941625", + "tax_included": false, "total_amount": "14.891625", "tiered_unit_price": true, "period_range_start": "2018-07-22", @@ -814,6 +841,7 @@ puts result "subtotal_amount": "47.0", "discount_amount": "4.7", "tax_amount": "2.85525", + "tax_included": false, "total_amount": "45.15525", "tiered_unit_price": true, "period_range_start": "2018-07-22", @@ -862,6 +890,7 @@ puts result "subtotal_amount": "14.0", "discount_amount": "1.4", "tax_amount": "0.8505", + "tax_included": false, "total_amount": "13.4505", "tiered_unit_price": false, "period_range_start": "2018-08-01", @@ -1036,6 +1065,10 @@ def record_payment_for_invoice(uid, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1045,6 +1078,8 @@ def record_payment_for_invoice(uid, ## Response Type +**200**: OK + [`Invoice`](../../doc/models/invoice.md) ## Example Usage @@ -1079,7 +1114,7 @@ puts result This API call should be used when you want to record an external payment against multiple invoices. -In order apply a payment to multiple invoices, at minimum, specify the `amount` and `applications` (i.e., `invoice_uid` and `amount`) details. +To apply a payment to multiple invoices, at minimum, specify the `amount` and `applications` (i.e., `invoice_uid` and `amount`) details. ``` { @@ -1108,6 +1143,10 @@ Note that the invoice payment amounts must be greater than 0. Total amount must def record_payment_for_multiple_invoices(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1116,6 +1155,8 @@ def record_payment_for_multiple_invoices(body: nil) ## Response Type +**200**: OK + [`MultiInvoicePaymentResponse`](../../doc/models/multi-invoice-payment-response.md) ## Example Usage @@ -1185,6 +1226,10 @@ By default, the credit notes returned by this endpoint will exclude the arrays o def list_credit_notes(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1200,6 +1245,8 @@ def list_credit_notes(options = {}) ## Response Type +**200**: OK + [`ListCreditNotesResponse`](../../doc/models/list-credit-notes-response.md) ## Example Usage @@ -1288,6 +1335,7 @@ puts result "subtotal_amount": "1.971004", "discount_amount": "0.19862831", "tax_amount": "0.11963536", + "tax_included": false, "total_amount": "1.89201105", "tiered_unit_price": false, "period_range_start": "2018-11-30", @@ -1306,6 +1354,7 @@ puts result "subtotal_amount": "114.21127834", "discount_amount": "11.42112783", "tax_amount": "6.93833516", + "tax_included": false, "total_amount": "109.72848567", "tiered_unit_price": false, "period_range_start": "2018-12-30", @@ -1324,6 +1373,7 @@ puts result "subtotal_amount": "9.16746047", "discount_amount": "0.91674605", "tax_amount": "0.55692322", + "tax_included": false, "total_amount": "8.80763764", "tiered_unit_price": true, "period_range_start": "2018-11-30", @@ -1342,6 +1392,7 @@ puts result "subtotal_amount": "72.57572871", "discount_amount": "7.25757287", "tax_amount": "4.40897552", + "tax_included": false, "total_amount": "69.72713136", "tiered_unit_price": true, "period_range_start": "2018-11-30", @@ -1360,6 +1411,7 @@ puts result "subtotal_amount": "3.12839588", "discount_amount": "0.31322157", "tax_amount": "0.19002427", + "tax_included": false, "total_amount": "3.00519858", "tiered_unit_price": true, "period_range_start": "2018-11-30", @@ -1378,6 +1430,7 @@ puts result "subtotal_amount": "7.63955039", "discount_amount": "0.76395504", "tax_amount": "0.46410269", + "tax_included": false, "total_amount": "7.33969804", "tiered_unit_price": false, "period_range_start": "2018-12-30", @@ -1529,6 +1582,10 @@ Use this endpoint to retrieve the details for a credit note. def read_credit_note(uid) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1537,6 +1594,8 @@ def read_credit_note(uid) ## Response Type +**200**: OK + [`CreditNote`](../../doc/models/credit-note.md) ## Example Usage @@ -1615,6 +1674,7 @@ puts result "subtotal_amount": "1.971004", "discount_amount": "0.19862831", "tax_amount": "0.11963536", + "tax_included": false, "total_amount": "1.89201105", "tiered_unit_price": false, "period_range_start": "2018-11-30", @@ -1635,6 +1695,7 @@ puts result "subtotal_amount": "114.21127834", "discount_amount": "11.42112783", "tax_amount": "6.93833516", + "tax_included": false, "total_amount": "109.72848567", "tiered_unit_price": false, "period_range_start": "2018-12-30", @@ -1655,6 +1716,7 @@ puts result "subtotal_amount": "9.16746047", "discount_amount": "0.91674605", "tax_amount": "0.55692322", + "tax_included": false, "total_amount": "8.80763764", "tiered_unit_price": true, "period_range_start": "2018-11-30", @@ -1675,6 +1737,7 @@ puts result "subtotal_amount": "72.57572871", "discount_amount": "7.25757287", "tax_amount": "4.40897552", + "tax_included": false, "total_amount": "69.72713136", "tiered_unit_price": true, "period_range_start": "2018-11-30", @@ -1695,6 +1758,7 @@ puts result "subtotal_amount": "3.12839588", "discount_amount": "0.31322157", "tax_amount": "0.19002427", + "tax_included": false, "total_amount": "3.00519858", "tiered_unit_price": true, "period_range_start": "2018-11-30", @@ -1715,6 +1779,7 @@ puts result "subtotal_amount": "7.63955039", "discount_amount": "0.76395504", "tax_amount": "0.46410269", + "tax_included": false, "total_amount": "7.33969804", "tiered_unit_price": false, "period_range_start": "2018-12-30", @@ -1873,6 +1938,10 @@ def record_payment_for_subscription(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1882,6 +1951,8 @@ def record_payment_for_subscription(subscription_id, ## Response Type +**201**: OK + [`RecordPaymentResponse`](../../doc/models/record-payment-response.md) ## Example Usage @@ -1953,6 +2024,10 @@ When reopening a consolidated invoice, all of its canceled segments will also be def reopen_invoice(uid) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1961,6 +2036,8 @@ def reopen_invoice(uid) ## Response Type +**200**: OK + [`Invoice`](../../doc/models/invoice.md) ## Example Usage @@ -1989,6 +2066,10 @@ def void_invoice(uid, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1998,6 +2079,8 @@ def void_invoice(uid, ## Response Type +**200**: OK + [`Invoice`](../../doc/models/invoice.md) ## Example Usage @@ -2034,6 +2117,10 @@ Invoice segments returned on the index will only include totals, not detailed br def list_consolidated_invoice_segments(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -2045,6 +2132,8 @@ def list_consolidated_invoice_segments(options = {}) ## Response Type +**200**: OK + [`ConsolidatedInvoice`](../../doc/models/consolidated-invoice.md) ## Example Usage @@ -2376,13 +2465,13 @@ Instead of creating custom products like in above example, You can pass existing The price for each line item will be calculated as well as a total due amount for the invoice. Multiple line items can be sent. -### Line items types +### Line item types -When defining line item, You can choose one of 3 types for one line item: +When defining a line item, You can choose one of 3 types for a line item: #### Custom item -Like in basic behavior example above, You can pass `title` and `unit_price` for custom item. +As shown in the basic behavior example, You can pass `title` and `unit_price` for custom item. #### Product id @@ -2390,7 +2479,7 @@ Product handle (with handle: prefix) or id from the scope of current subscriptio #### Component id -Component handle (with handle: prefix) or id from the scope of current subscription's site can be provided with `component_id`. If `component_id` is used, following fields cannot be used: `title`, `product_id`. By default `unit_price` is taken from product's default price point, but can be overwritten by passing `unit_price` or `price_point_id`. At this moment price points are supportted only for quantity based, on/off and metered components. For prepaid and event based billing components `unit_price` is required. +Component handle (with handle: prefix) or id from the scope of current subscription's site can be provided with `component_id`. If `component_id` is used, following fields cannot be used: `title`, `product_id`. By default `unit_price` is taken from product's default price point, but can be overwritten by passing `unit_price` or `price_point_id`. At this moment price points are supported only for quantity based, on/off and metered components. For prepaid and event based billing components `unit_price` is required. ### Coupons @@ -2527,7 +2616,7 @@ Optional `description` parameter, it will overwrite default generated descriptio #### Issue Date -By default, invoices will be created with a issue date set to today. `issue_date` parameter can be send to alter that. Only dates in the past can be send. `issue_date` should be send in `YYYY-MM-DD` format. +By default, invoices will be created with a issue date set to today in your site's time zone. The `issue_date` parameter can be sent to alter the default. Only today or dates in the past are accepted. This date is interpreted and validated in your site's time zone. The format for `issue_date` is `YYYY-MM-DD`. #### Net Terms @@ -2539,7 +2628,7 @@ The seller, shipping and billing addresses can be sent to override the site's de #### Memo and Payment Instructions -A custom memo can be sent with the `memo` parameter to override the site's default. Likewise, custom payment instructions can be sent with the `payment_instrucions` parameter. +A custom memo can be sent with the `memo` parameter to override the site's default. Likewise, custom payment instructions can be sent with the `payment_instructions` parameter. #### Status @@ -2550,6 +2639,10 @@ def create_invoice(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -2559,6 +2652,8 @@ def create_invoice(subscription_id, ## Response Type +**200**: OK + [`InvoiceResponse`](../../doc/models/invoice-response.md) ## Example Usage @@ -2666,6 +2761,7 @@ puts result "subtotal_amount": "1800.0", "discount_amount": "0.0", "tax_amount": "0.0", + "tax_included": false, "total_amount": "1800.0", "tiered_unit_price": false, "period_range_start": "2020-12-02", @@ -2704,6 +2800,10 @@ def send_invoice(uid, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -2713,6 +2813,8 @@ def send_invoice(uid, ## Response Type +**204**: No Content + `void` ## Example Usage @@ -2747,7 +2849,7 @@ invoices_controller.send_invoice( # Preview Customer Information Changes -Customer information may change after an invoice is issued which may lead to a mismatch between customer information that are present on an open invoice and actual customer information. This endpoint allows to preview these differences, if any. +Customer information may change after an invoice is issued, which may lead to a mismatch between customer information that is present on an open invoice and actual customer information. This endpoint allows you to preview these differences, if any. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. @@ -2755,6 +2857,10 @@ The endpoint doesn't accept a request body. Customer information differences are def preview_customer_information_changes(uid) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -2763,6 +2869,8 @@ def preview_customer_information_changes(uid) ## Response Type +**200**: OK + [`CustomerChangesPreviewResponse`](../../doc/models/customer-changes-preview-response.md) ## Example Usage @@ -2837,7 +2945,7 @@ puts result # Update Customer Information -This endpoint updates customer information on an open invoice and returns the updated invoice. If you would like to preview changes that will be applied, use the `/invoices/{uid}/customer_information/preview.json` endpoint before. +This endpoint updates customer information on an open invoice and returns the updated invoice. If you would like to preview changes that will be applied, use the `/invoices/{uid}/customer_information/preview.json` endpoint first. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. @@ -2845,6 +2953,10 @@ The endpoint doesn't accept a request body. Customer information differences are def update_customer_information(uid) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -2853,6 +2965,8 @@ def update_customer_information(uid) ## Response Type +**200**: OK + [`Invoice`](../../doc/models/invoice.md) ## Example Usage @@ -3066,9 +3180,9 @@ This endpoint allows you to issue an invoice that is in "pending" or "draft" sta You cannot issue a pending child invoice that was created for a member subscription in a group. -For Remittance subscriptions, the invoice will go into "open" status and payment won't be attempted. The value for `on_failed_payment` would be rejected if sent. Any prepayments or service credits that exist on subscription will be automatically applied. Additionally, if setting is on, an email will be sent for issued invoice. +For Remittance subscriptions, the invoice will go into "open" status and payment won't be attempted. The value for `on_failed_payment` would be rejected if sent. Any prepayments or service credits that exist on the subscription will be automatically applied. Additionally, if the setting is enabled, an email will be sent for the issued invoice. -For Automatic subscriptions, prepayments and service credits will apply to the invoice and before payment is attempted. On successful payment, the invoice will go into "paid" status and email will be sent to the customer (if setting applies). When payment fails, the next event depends on the `on_failed_payment` value: +For Automatic subscriptions, prepayments and service credits will apply to the invoice before payment is attempted. On successful payment, the invoice will go into "paid" status and email will be sent to the customer (if setting applies). When payment fails, the next event depends on the `on_failed_payment` value: - `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option. - `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history. @@ -3079,6 +3193,10 @@ def issue_invoice(uid, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -3088,6 +3206,8 @@ def issue_invoice(uid, ## Response Type +**200**: OK + [`Invoice`](../../doc/models/invoice.md) ## Example Usage diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index f89b9d8..a89784e 100644 --- a/doc/controllers/offers.md +++ b/doc/controllers/offers.md @@ -37,6 +37,10 @@ You can optionally pass in a `product_price_point_id` that corresponds with the def create_offer(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -45,6 +49,8 @@ def create_offer(body: nil) ## Response Type +**201**: Created + [`OfferResponse`](../../doc/models/offer-response.md) ## Example Usage @@ -130,6 +136,10 @@ This endpoint will list offers for a site. def list_offers(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -140,6 +150,8 @@ def list_offers(options = {}) ## Response Type +**200**: OK + [`ListOffersResponse`](../../doc/models/list-offers-response.md) ## Example Usage @@ -225,6 +237,10 @@ This method allows you to list a specific offer's attributes. This is different def read_offer(offer_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -233,6 +249,8 @@ def read_offer(offer_id) ## Response Type +**200**: OK + [`OfferResponse`](../../doc/models/offer-response.md) ## Example Usage @@ -253,6 +271,10 @@ Archive an existing offer. Please provide an `offer_id` in order to archive the def archive_offer(offer_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -261,6 +283,8 @@ def archive_offer(offer_id) ## Response Type +**200**: OK + `void` ## Example Usage @@ -280,6 +304,10 @@ Unarchive a previously archived offer. Please provide an `offer_id` in order to def unarchive_offer(offer_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -288,6 +316,8 @@ def unarchive_offer(offer_id) ## Response Type +**200**: OK + `void` ## Example Usage diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index 8b3b1b8..291c1d2 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -34,7 +34,7 @@ Select an option from the **Request Examples** drop-down on the right side of th Do not use real card information for testing. See the Sites articles that cover [testing your site setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overview#testing-overview-0-0) for more details on testing in your sandbox. -Note that collecting and sending raw card details in production requires [PCI compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compliance#pci-compliance-0-0) on your end. If your business is not PCI compliant, use [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0) to collect credit card or bank account information. +Note that collecting and sending raw card details in production requires [PCI compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compliance#pci-compliance-0-0) on your end. If your business is not PCI compliant, use [Maxio.js (formerly Chargify.js)](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0) to collect credit card or bank account information. See the following articles to learn more about subscriptions and payments: @@ -42,73 +42,32 @@ See the following articles to learn more about subscriptions and payments: + [Self Service Pages](https://maxio.zendesk.com/hc/en-us/articles/24261425318541-Self-Service-Pages) (Allows credit card updates by Subscriber) + [Public Signup Pages payment settings](https://maxio.zendesk.com/hc/en-us/articles/24261368332557-Individual-Page-Settings) + [Taxes](https://developers.chargify.com/docs/developer-docs/d2e9e34db740e-signups#taxes) -+ [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview) - + [Chargify.js with GoCardless - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQZKCER8CFK40MR6XJ) - + [Chargify.js with GoCardless - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) - + [Chargify.js with Stripe Direct Debit - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) - + [Chargify.js with Stripe Direct Debit - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QRECQQ4ECS3ZA55GY7) - + [Chargify.js with Stripe BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) - + [Chargify.js with Stripe BECS Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) ++ [Maxio.js (formerly Chargify.js)](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview) + + [Maxio.js with GoCardless - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQZKCER8CFK40MR6XJ) + + [Maxio.js with GoCardless - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) + + [Maxio.js with Stripe Direct Debit - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) + + [Maxio.js with Stripe Direct Debit - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QRECQQ4ECS3ZA55GY7) + + [CMaxio.js with Stripe BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) + + [Maxio.js with Stripe BECS Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) + [Full documentation on GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909-GoCardless) + [Full documentation on Stripe SEPA Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) + [Full documentation on Stripe BECS Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) + [Full documentation on Stripe BACS Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) -## 3D Secure Authentication during payment profile creation. +## 3D Secure (3DS) Authentication post-authentication flow -When a payment requires 3D Secure Authentication to adhear to Strong Customer Authentication (SCA) during payment profile creation, the request enters a [post-authentication flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2-flows-pre-authentication-and-post-authentication). In this case, a 422 Unprocessable Entity status is returned with the following response: +When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. -```json -{ - "jsonapi": { - "version": "1.0" - }, - "errors": [ - { - "title": "This card requires 3DSecure verification.", - "detail": "This card requires 3D secure authentication. Redirect the customer to the URL from the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you want to redirect a customer back to your page after 3D Secure authentication. Example: https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbodx5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost:4000&redirect_url=https://yourpage.com will do a POST request to https://localhost:4000 after credit card is authenticated and will redirect a customer to https://yourpage.com after 3DS authentication.", - "links": { - "action_link": "https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbodx5jhvkg6yeu?one_time_token_id=93" - } - } - ] -} -``` - -To let the customer go through 3D Secure Authentication, they need to be redirected to the URL specified in `action_link`. - -Optionally, you can specify the `callback_url` parameter in the `action_link` URL to receive notification about the result of 3D Secure Authentication. - -The `callback_url` will return the following information: - -- whether the authentication was successful (`success`) -- the payment profile ID (`payment_profile_id`) - -You can also specify a `redirect_url` parameter in the `action_link` URL to redirect the customer back to your site. - -You cannot use action_link in an iframe inside a custom application. You must redirect the customer directly to the `action_link` and use the `redirect_url` or `callback_url` to be notified of the result. - -The final URL that you send a customer to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: - -`https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhkbodx5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost:4000&redirect_url=https://yourpage.com` - -### Example Redirect Flow - -Here's an example flow to redirect customers to different pages depending on whether SCA was performed successfully: - -1. Create a payment profile via the API; it requires 3DS. -2. You receive an `action_link` in the response. -3. Use this `action_link` to, for example, connect with your internal resources or generate a `session_id`. -4. Include one of those attributes inside the `callback_url` and `redirect_url` to be aware which “session” this applies to. -5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied -6. After the customer completes 3DS authentication, we notify you of the result via the applied `callback_url`. -7. After that, we redirect the customer to the `redirect_url`; at this point the result of authentication is known. -8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine if the redirect was successful. +See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow. ```ruby def create_payment_profile(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -117,6 +76,8 @@ def create_payment_profile(body: nil) ## Response Type +**200**: OK + [`PaymentProfileResponse`](../../doc/models/payment-profile-response.md) ## Example Usage @@ -178,6 +139,10 @@ This method will return all of the active `payment_profiles` for a Site, or for def list_payment_profiles(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -188,6 +153,8 @@ def list_payment_profiles(options = {}) ## Response Type +**200**: OK + [`Array[PaymentProfileResponse]`](../../doc/models/payment-profile-response.md) ## Example Usage @@ -310,6 +277,10 @@ Example response for Bank Account: def read_payment_profile(payment_profile_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -318,6 +289,8 @@ def read_payment_profile(payment_profile_id) ## Response Type +**200**: OK + [`PaymentProfileResponse`](../../doc/models/payment-profile-response.md) ## Example Usage @@ -409,6 +382,10 @@ def update_payment_profile(payment_profile_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -418,6 +395,8 @@ def update_payment_profile(payment_profile_id, ## Response Type +**200**: OK + [`PaymentProfileResponse`](../../doc/models/payment-profile-response.md) ## Example Usage @@ -482,6 +461,10 @@ If the payment profile is in use by one or more subscriptions or groups, a 422 a def delete_unused_payment_profile(payment_profile_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -490,6 +473,8 @@ def delete_unused_payment_profile(payment_profile_id) ## Response Type +**204**: No Content + `void` ## Example Usage @@ -521,6 +506,10 @@ def delete_subscriptions_payment_profile(subscription_id, payment_profile_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -530,6 +519,8 @@ def delete_subscriptions_payment_profile(subscription_id, ## Response Type +**204**: No Content + `void` ## Example Usage @@ -555,6 +546,10 @@ def verify_bank_account(bank_account_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -564,6 +559,8 @@ def verify_bank_account(bank_account_id, ## Response Type +**200**: OK + [`BankAccountResponse`](../../doc/models/bank-account-response.md) ## Example Usage @@ -632,6 +629,10 @@ def delete_subscription_group_payment_profile(uid, payment_profile_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -641,6 +642,8 @@ def delete_subscription_group_payment_profile(uid, ## Response Type +**204**: No Content + `void` ## Example Usage @@ -668,6 +671,10 @@ def change_subscription_default_payment_profile(subscription_id, payment_profile_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -677,6 +684,8 @@ def change_subscription_default_payment_profile(subscription_id, ## Response Type +**201**: Created + [`PaymentProfileResponse`](../../doc/models/payment-profile-response.md) ## Example Usage @@ -743,6 +752,10 @@ def change_subscription_group_default_payment_profile(uid, payment_profile_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -752,6 +765,8 @@ def change_subscription_group_default_payment_profile(uid, ## Response Type +**201**: Created + [`PaymentProfileResponse`](../../doc/models/payment-profile-response.md) ## Example Usage @@ -816,6 +831,10 @@ To obtain a One Time Token you have to use [Chargify.js](https://docs.maxio.com/ def read_one_time_token(chargify_token) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -824,6 +843,8 @@ def read_one_time_token(chargify_token) ## Response Type +**200**: OK + [`GetOneTimeTokenRequest`](../../doc/models/get-one-time-token-request.md) ## Example Usage @@ -856,6 +877,10 @@ These error responses are designed to prevent excessive or invalid requests, and def send_request_update_payment_email(subscription_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -864,6 +889,8 @@ def send_request_update_payment_email(subscription_id) ## Response Type +**201**: Created + `void` ## Example Usage diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index 6679351..d46f80e 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -24,6 +24,10 @@ Retrieves a list of Products belonging to a Product Family. def list_products_for_product_family(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -42,6 +46,8 @@ def list_products_for_product_family(options = {}) ## Response Type +**200**: OK + [`Array[ProductResponse]`](../../doc/models/product-response.md) ## Example Usage @@ -182,6 +188,10 @@ Full documentation on how Product Families operate within the Advanced Billing U def create_product_family(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -190,6 +200,8 @@ def create_product_family(body: nil) ## Response Type +**201**: Created + [`ProductFamilyResponse`](../../doc/models/product-family-response.md) ## Example Usage @@ -235,6 +247,10 @@ Retrieve a list of Product Families for a site. def list_product_families(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -247,6 +263,8 @@ def list_product_families(options = {}) ## Response Type +**200**: OK + [`Array[ProductFamilyResponse]`](../../doc/models/product-family-response.md) ## Example Usage @@ -302,6 +320,10 @@ The product family can be specified either with the id number, or with the `hand def read_product_family(id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -310,6 +332,8 @@ def read_product_family(id) ## Response Type +**200**: OK + [`ProductFamilyResponse`](../../doc/models/product-family-response.md) ## Example Usage diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index db95360..e526323 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -32,6 +32,10 @@ def create_product_price_point(product_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -41,6 +45,8 @@ def create_product_price_point(product_id, ## Response Type +**201**: Created + [`ProductPricePointResponse`](../../doc/models/product-price-point-response.md) ## Example Usage @@ -115,6 +121,10 @@ Retrieves a list of product price points. def list_product_price_points(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -128,6 +138,8 @@ def list_product_price_points(options = {}) ## Response Type +**200**: OK + [`ListProductPricePointsResponse`](../../doc/models/list-product-price-points-response.md) ## Example Usage @@ -186,6 +198,10 @@ def update_product_price_point(product_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -196,6 +212,8 @@ def update_product_price_point(product_id, ## Response Type +**200**: OK + [`ProductPricePointResponse`](../../doc/models/product-price-point-response.md) ## Example Usage @@ -258,6 +276,10 @@ def read_product_price_point(product_id, currency_prices: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -268,6 +290,8 @@ def read_product_price_point(product_id, ## Response Type +**200**: OK + [`ProductPricePointResponse`](../../doc/models/product-price-point-response.md) ## Example Usage @@ -321,6 +345,10 @@ def archive_product_price_point(product_id, price_point_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -330,6 +358,8 @@ def archive_product_price_point(product_id, ## Response Type +**200**: OK + [`ProductPricePointResponse`](../../doc/models/product-price-point-response.md) ## Example Usage @@ -389,6 +419,10 @@ def unarchive_product_price_point(product_id, price_point_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -398,6 +432,8 @@ def unarchive_product_price_point(product_id, ## Response Type +**200**: OK + [`ProductPricePointResponse`](../../doc/models/product-price-point-response.md) ## Example Usage @@ -453,6 +489,10 @@ def promote_product_price_point_to_default(product_id, price_point_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -462,6 +502,8 @@ def promote_product_price_point_to_default(product_id, ## Response Type +**200**: OK + [`ProductResponse`](../../doc/models/product-response.md) ## Example Usage @@ -541,6 +583,10 @@ def bulk_create_product_price_points(product_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -550,6 +596,8 @@ def bulk_create_product_price_points(product_id, ## Response Type +**201**: Created + [`BulkCreateProductPricePointsResponse`](../../doc/models/bulk-create-product-price-points-response.md) ## Example Usage @@ -648,6 +696,10 @@ def create_product_currency_prices(product_price_point_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -657,6 +709,8 @@ def create_product_currency_prices(product_price_point_id, ## Response Type +**200**: OK + [`CurrencyPricesResponse`](../../doc/models/currency-prices-response.md) ## Example Usage @@ -728,6 +782,10 @@ def update_product_currency_prices(product_price_point_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -737,6 +795,8 @@ def update_product_currency_prices(product_price_point_id, ## Response Type +**200**: OK + [`CurrencyPricesResponse`](../../doc/models/currency-prices-response.md) ## Example Usage @@ -796,6 +856,10 @@ This method allows retrieval of a list of Products Price Points belonging to a S def list_all_product_price_points(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -808,6 +872,8 @@ def list_all_product_price_points(options = {}) ## Response Type +**200**: OK + [`ListProductPricePointsResponse`](../../doc/models/list-product-price-points-response.md) ## Example Usage diff --git a/doc/controllers/products.md b/doc/controllers/products.md index 2f16057..b577e43 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -32,6 +32,10 @@ def create_product(product_family_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -41,6 +45,8 @@ def create_product(product_family_id, ## Response Type +**201**: Created + [`ProductResponse`](../../doc/models/product-response.md) ## Example Usage @@ -134,6 +140,10 @@ Reads the current details of a product. def read_product(product_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -142,6 +152,8 @@ def read_product(product_id) ## Response Type +**200**: OK + [`ProductResponse`](../../doc/models/product-response.md) ## Example Usage @@ -214,6 +226,10 @@ def update_product(product_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -223,6 +239,8 @@ def update_product(product_id, ## Response Type +**200**: OK + [`ProductResponse`](../../doc/models/product-response.md) ## Example Usage @@ -299,6 +317,10 @@ This will restrict the option to chose the product for purchase via the Billing def archive_product(product_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -307,6 +329,8 @@ def archive_product(product_id) ## Response Type +**200**: OK + [`ProductResponse`](../../doc/models/product-response.md) ## Example Usage @@ -376,6 +400,10 @@ Retrieves a Product object by its `api_handle`. def read_product_by_handle(api_handle) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -384,6 +412,8 @@ def read_product_by_handle(api_handle) ## Response Type +**200**: OK + [`ProductResponse`](../../doc/models/product-response.md) ## Example Usage @@ -472,6 +502,10 @@ This method allows to retrieve a list of Products belonging to a Site. def list_products(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -489,6 +523,8 @@ def list_products(options = {}) ## Response Type +**200**: OK + [`Array[ProductResponse]`](../../doc/models/product-response.md) ## Example Usage diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 75574a3..ec8c3ab 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -36,6 +36,10 @@ Proforma invoices are only available on Relationship Invoicing sites. To create def create_consolidated_proforma_invoice(uid) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -44,6 +48,8 @@ def create_consolidated_proforma_invoice(uid) ## Response Type +**201**: Created + `void` ## Example Usage @@ -71,6 +77,10 @@ By default, proforma invoices returned on the index will only include totals, no def list_subscription_group_proforma_invoices(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -85,6 +95,8 @@ def list_subscription_group_proforma_invoices(options = {}) ## Response Type +**200**: OK + [`ListProformaInvoicesResponse`](../../doc/models/list-proforma-invoices-response.md) ## Example Usage @@ -123,6 +135,10 @@ Proforma invoices are only available on Relationship Invoicing sites. def read_proforma_invoice(proforma_invoice_uid) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -131,6 +147,8 @@ def read_proforma_invoice(proforma_invoice_uid) ## Response Type +**200**: OK + [`ProformaInvoice`](../../doc/models/proforma-invoice.md) ## Example Usage @@ -163,6 +181,10 @@ Proforma invoices are only available on Relationship Invoicing sites. To create def create_proforma_invoice(subscription_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -171,6 +193,8 @@ def create_proforma_invoice(subscription_id) ## Response Type +**200**: OK + [`ProformaInvoice`](../../doc/models/proforma-invoice.md) ## Example Usage @@ -197,6 +221,10 @@ By default, proforma invoices returned on the index will only include totals, no def list_proforma_invoices(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -217,6 +245,8 @@ def list_proforma_invoices(options = {}) ## Response Type +**200**: OK + [`ListProformaInvoicesResponse`](../../doc/models/list-proforma-invoices-response.md) ## Example Usage @@ -254,6 +284,10 @@ def deliver_proforma_invoice(proforma_invoice_uid, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -263,6 +297,8 @@ def deliver_proforma_invoice(proforma_invoice_uid, ## Response Type +**201**: Created + [`ProformaInvoice`](../../doc/models/proforma-invoice.md) ## Example Usage @@ -314,6 +350,10 @@ def void_proforma_invoice(proforma_invoice_uid, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -323,6 +363,8 @@ def void_proforma_invoice(proforma_invoice_uid, ## Response Type +**200**: OK + [`ProformaInvoice`](../../doc/models/proforma-invoice.md) ## Example Usage @@ -356,6 +398,10 @@ Alternatively, if you have some proforma invoices already, you may make a previe def preview_proforma_invoice(subscription_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -364,6 +410,8 @@ def preview_proforma_invoice(subscription_id) ## Response Type +**200**: OK + [`ProformaInvoice`](../../doc/models/proforma-invoice.md) ## Example Usage @@ -397,6 +445,10 @@ A product and customer first name, last name, and email are the minimum requirem def create_signup_proforma_invoice(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -405,6 +457,8 @@ def create_signup_proforma_invoice(body: nil) ## Response Type +**201**: Created + [`ProformaInvoice`](../../doc/models/proforma-invoice.md) ## Example Usage @@ -448,6 +502,10 @@ def preview_signup_proforma_invoice(include: nil, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -457,6 +515,8 @@ def preview_signup_proforma_invoice(include: nil, ## Response Type +**201**: Created + [`SignupProformaPreviewResponse`](../../doc/models/signup-proforma-preview-response.md) ## Example Usage diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index 7515fe2..a1f0e02 100644 --- a/doc/controllers/reason-codes.md +++ b/doc/controllers/reason-codes.md @@ -39,6 +39,10 @@ This method gives a merchant the option to create a reason codes for a given Sit def create_reason_code(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -47,6 +51,8 @@ def create_reason_code(body: nil) ## Response Type +**200**: OK + [`ReasonCodeResponse`](../../doc/models/reason-code-response.md) ## Example Usage @@ -79,6 +85,10 @@ This method gives a merchant the option to retrieve a list of all of the current def list_reason_codes(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -88,6 +98,8 @@ def list_reason_codes(options = {}) ## Response Type +**200**: OK + [`Array[ReasonCodeResponse]`](../../doc/models/reason-code-response.md) ## Example Usage @@ -157,6 +169,10 @@ This method gives a merchant the option to retrieve a list of a particular code def read_reason_code(reason_code_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -165,6 +181,8 @@ def read_reason_code(reason_code_id) ## Response Type +**200**: OK + [`ReasonCodeResponse`](../../doc/models/reason-code-response.md) ## Example Usage @@ -192,6 +210,10 @@ def update_reason_code(reason_code_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -201,6 +223,8 @@ def update_reason_code(reason_code_id, ## Response Type +**200**: OK + [`ReasonCodeResponse`](../../doc/models/reason-code-response.md) ## Example Usage @@ -228,6 +252,10 @@ This method gives a merchant the option to delete one reason code from the Churn def delete_reason_code(reason_code_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -236,6 +264,8 @@ def delete_reason_code(reason_code_id) ## Response Type +**200**: OK + [`OkResponse`](../../doc/models/ok-response.md) ## Example Usage diff --git a/doc/controllers/referral-codes.md b/doc/controllers/referral-codes.md index b6b9b27..e72533a 100644 --- a/doc/controllers/referral-codes.md +++ b/doc/controllers/referral-codes.md @@ -25,6 +25,10 @@ If the referral code is valid the status code will be `200` and the referral cod def validate_referral_code(code) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -33,6 +37,8 @@ def validate_referral_code(code) ## Response Type +**200**: OK + [`ReferralValidationResponse`](../../doc/models/referral-validation-response.md) ## Example Usage diff --git a/doc/controllers/sales-commissions.md b/doc/controllers/sales-commissions.md index 046e895..74f067e 100644 --- a/doc/controllers/sales-commissions.md +++ b/doc/controllers/sales-commissions.md @@ -31,6 +31,10 @@ Access to the Sales Commission API endpoints is available to users with financia def list_sales_commission_settings(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -43,6 +47,8 @@ def list_sales_commission_settings(options = {}) ## Response Type +**200**: OK + [`Array[SaleRepSettings]`](../../doc/models/sale-rep-settings.md) ## Example Usage @@ -110,6 +116,10 @@ Access to the Sales Commission API endpoints is available to users with financia def list_sales_reps(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -122,6 +132,8 @@ def list_sales_reps(options = {}) ## Response Type +**200**: OK + [`Array[ListSaleRepItem]`](../../doc/models/list-sale-rep-item.md) ## Example Usage @@ -243,6 +255,10 @@ def read_sales_rep(seller_id, per_page: 100) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -256,6 +272,8 @@ def read_sales_rep(seller_id, ## Response Type +**200**: OK + [`SaleRep`](../../doc/models/sale-rep.md) ## Example Usage diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index a7d6e76..d4402cb 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -17,15 +17,15 @@ sites_controller = client.sites # Read Site -This endpoint allows you to fetch some site data. +Retrieves site data. Full documentation on Sites in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites). -Specifically, the [Clearing Site Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-Site-Data) section is extremely relevant to this endpoint documentation. +Specifically, the [Clearing Site Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-Site-Data) section is relevant to this endpoint documentation. #### Relationship invoicing enabled -If site has RI enabled then you will see more settings like: +If the site has RI enabled then you will see more settings like: "customer_hierarchy_enabled": true, "whopays_enabled": true, @@ -38,8 +38,14 @@ You can read more about these settings here: def read_site ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Response Type +**200**: OK + [`SiteResponse`](../../doc/models/site-response.md) ## Example Usage @@ -103,7 +109,7 @@ puts result # Clear Site -This call is asynchronous and there may be a delay before the site data is fully deleted. If you are clearing site data for an automated test, you will need to build in a delay and/or check that there are no products, etc., in the site before proceeding. +Clears all data from a test site asynchronously. This call is asynchronous and there may be a delay before the site data is fully deleted. If you are clearing site data for an automated test, you will need to build in a delay and/or check that there are no products, etc., in the site before proceeding. **This functionality will only work on sites in TEST mode. Attempts to perform this on sites in “live” mode will result in a response of 403 FORBIDDEN.** @@ -111,6 +117,10 @@ This call is asynchronous and there may be a delay before the site data is fully def clear_site(cleanup_scope: CleanupScope::ALL) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -119,6 +129,8 @@ def clear_site(cleanup_scope: CleanupScope::ALL) ## Response Type +**200**: OK + `void` ## Example Usage @@ -132,12 +144,16 @@ sites_controller.clear_site(cleanup_scope: cleanup_scope) # List Chargify Js Public Keys -This endpoint returns public keys used for Chargify.js. +Returns public keys used for Maxio.js (formerly Chargify.js). ```ruby def list_chargify_js_public_keys(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -147,6 +163,8 @@ def list_chargify_js_public_keys(options = {}) ## Response Type +**200**: OK + [`ListPublicKeysResponse`](../../doc/models/list-public-keys-response.md) ## Example Usage diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index f9ae110..d458089 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -31,13 +31,17 @@ subscription_components_controller = client.subscription_components # Read Subscription Component -This request will list information regarding a specific component owned by a subscription. +Returns information for a specific component on a subscription. ```ruby def read_subscription_component(subscription_id, component_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -47,6 +51,8 @@ def read_subscription_component(subscription_id, ## Response Type +**200**: OK + [`SubscriptionComponentResponse`](../../doc/models/subscription-component-response.md) ## Example Usage @@ -91,7 +97,7 @@ puts result # List Subscription Components -This request will list a subscription's applied components. +Lists a subscription's applied components. ## Archived Components @@ -101,6 +107,10 @@ When requesting to list components for a given subscription, if the subscription def list_subscription_components(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -121,6 +131,8 @@ def list_subscription_components(options = {}) ## Response Type +**200**: OK + [`Array[SubscriptionComponentResponse]`](../../doc/models/subscription-component-response.md) ## Example Usage @@ -198,6 +210,10 @@ def bulk_update_subscription_components_price_points(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -207,6 +223,8 @@ def bulk_update_subscription_components_price_points(subscription_id, ## Response Type +**200**: OK + [`BulkComponentsPricePointAssignment`](../../doc/models/bulk-components-price-point-assignment.md) ## Example Usage @@ -272,6 +290,10 @@ Resets all of a subscription's components to use the current default. def bulk_reset_subscription_components_price_points(subscription_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -280,6 +302,8 @@ def bulk_reset_subscription_components_price_points(subscription_id) ## Response Type +**201**: Created + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -398,7 +422,7 @@ Creates an allocation, sets the current allocated quantity for the component, an When creating an allocation via the API, you can pass the `upgrade_charge`, `downgrade_credit`, and `accrue_charge` to be applied. -> **Note:** These proration and accural fields are ignored for Prepaid Components since this component type always generate charges immediately without proration. +> **Note:** These proration and accrual fields are ignored for Prepaid Components since this component type always generates charges immediately without proration. For information on prorated components and upgrade/downgrade schemes, see [Setting Component Allocations.](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration) @@ -416,7 +440,7 @@ For information on prorated components and upgrade/downgrade schemes, see [Setti > **Note:** Proration uses the current price of the component as well as the current tax rates. Changes to either may cause the prorated charge/credit to be wrong. -For more informaiton see the [Component Allocations](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview) product Documentation. +For more information, see the [Component Allocations](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview) product Documentation. ```ruby def allocate_component(subscription_id, @@ -424,6 +448,10 @@ def allocate_component(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -434,6 +462,8 @@ def allocate_component(subscription_id, ## Response Type +**200**: OK + [`AllocationResponse`](../../doc/models/allocation-response.md) ## Example Usage @@ -531,7 +561,7 @@ puts result # List Allocations -This endpoint returns the 50 most recent Allocations, ordered by most recent first. +Returns the 50 most recent Allocations, ordered by most recent first. ## On/Off Components @@ -543,6 +573,10 @@ def list_allocations(subscription_id, page: 1) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -553,6 +587,8 @@ def list_allocations(subscription_id, ## Response Type +**200**: OK + [`Array[AllocationResponse]`](../../doc/models/allocation-response.md) ## Example Usage @@ -627,7 +663,7 @@ puts result # Allocate Components -Creates multiple allocations, sets the current allocated quantity for each of the components, and recording a memo. A `component_id` is required for each allocation. +Creates multiple allocations, sets the current allocated quantity for each of the components, and records a memo. A `component_id` is required for each allocation. The charges and/or credits that are created will be rolled up into a single total which is used to determine whether this is an upgrade or a downgrade. @@ -645,13 +681,17 @@ The charges and/or credits that are created will be rolled up into a single tota > **Note:** Proration uses the current price of the component as well as the current tax rates. Changes to either may cause the prorated charge/credit to be wrong. -For more informaiton see the [Component Allocations](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview) product Documentation. +For more information, see the [Component Allocations](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview) product documentation. ```ruby def allocate_components(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -661,6 +701,8 @@ def allocate_components(subscription_id, ## Response Type +**200**: OK + [`Array[AllocationResponse]`](../../doc/models/allocation-response.md) ## Example Usage @@ -745,7 +787,7 @@ puts result # Preview Allocations -Advanced Billing offers the ability to preview a potential subscription's **quantity-based** or **on/off** component allocation in the middle of the current billing period. This is useful if you want users to be able to see the effect of a component operation before actually doing it. +Previews a potential subscription's **quantity-based** or **on/off** component allocation in the middle of the current billing period. This is useful if you want users to be able to see the effect of a component operation before actually doing it. ## Fine-grained Component Control: Use with multiple `upgrade_charge`s or `downgrade_credits` @@ -758,6 +800,10 @@ def preview_allocations(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -767,6 +813,8 @@ def preview_allocations(subscription_id, ## Response Type +**200**: OK + [`AllocationPreviewResponse`](../../doc/models/allocation-preview-response.md) ## Example Usage @@ -907,7 +955,7 @@ puts result # Update Prepaid Usage Allocation Expiration Date -When the expiration interval options are selected on a prepaid usage component price point, all allocations will be created with an expiration date. This expiration date can be changed after the fact to allow for extending or shortening the allocation's active window. +Updates the expiration date for a prepaid usage allocation. This expiration date can be changed after the fact to allow for extending or shortening the allocation's active window. In order to change a prepaid usage allocation's expiration date, a PUT call must be made to the allocation's endpoint with a new expiration date. @@ -926,6 +974,10 @@ def update_prepaid_usage_allocation_expiration_date(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -937,6 +989,8 @@ def update_prepaid_usage_allocation_expiration_date(subscription_id, ## Response Type +**204**: OK + `void` ## Example Usage @@ -972,7 +1026,9 @@ subscription_components_controller.update_prepaid_usage_allocation_expiration_da # Delete Prepaid Usage Allocation -Prepaid Usage components are unique in that their allocations are always additive. In order to reduce a subscription's allocated quantity for a prepaid usage component each allocation must be destroyed individually via this endpoint. +Deletes a prepaid usage allocation. + +Prepaid Usage components are unique in that their allocations are always additive. In order to reduce a subscription's allocated quantity for a prepaid usage component, each allocation must be destroyed individually via this endpoint. ## Credit Scheme @@ -989,6 +1045,10 @@ def delete_prepaid_usage_allocation(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1000,6 +1060,8 @@ def delete_prepaid_usage_allocation(subscription_id, ## Response Type +**200**: OK + `void` ## Example Usage @@ -1039,11 +1101,11 @@ You can report metered or prepaid usage to Advanced Billing as often as you wish Full documentation on how to create Components in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Create-Edit-and-Archive-Components). Additionally, for information on how to record component usage against a subscription, see the following resources: -It is not possible to record metered usage for more than one component at a time Usage should be reported as one API call per component on a single subscription. For example, to record that a subscriber has sent both an SMS Message and an Email, send an API call for each. +It is not possible to record metered usage for more than one component at a time. Usage should be reported as one API call per component on a single subscription. For example, to record that a subscriber has sent both an SMS Message and an Email, send an API call for each. -See the following product documention articles for more information: +See the following product documentation articles for more information: -- [Create and Manage Components](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Create-Edit-and-Archive-Components). A +- [Create and Manage Components](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Create-Edit-and-Archive-Components) - [Recording Metered Component Usage](https://maxio.zendesk.com/hc/en-us/articles/24251890500109-Reporting-Component-Allocations#reporting-metered-component-usage) - [Reporting Prepaid Component Status](https://maxio.zendesk.com/hc/en-us/articles/24251890500109-Reporting-Component-Allocations#reporting-prepaid-component-status) @@ -1091,6 +1153,10 @@ def create_usage(subscription_id_or_reference, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1101,6 +1167,8 @@ def create_usage(subscription_id_or_reference, ## Response Type +**200**: OK + [`UsageResponse`](../../doc/models/usage-response.md) ## Example Usage @@ -1152,7 +1220,7 @@ puts result # List Usages -This request will return a list of the usages associated with a subscription for a particular metered component. This will display the previously recorded components for a subscription. +Returns a list of usages associated with a subscription for a particular metered component. This will display the previously recorded components for a subscription. This endpoint is not compatible with quantity-based components. @@ -1172,6 +1240,10 @@ Use this endpoint to read the previously recorded components for a subscription. def list_usages(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1187,6 +1259,8 @@ def list_usages(options = {}) ## Response Type +**200**: OK + [`Array[UsageResponse]`](../../doc/models/usage-response.md) ## Example Usage @@ -1237,6 +1311,8 @@ puts result # Activate Event Based Component +Activates an event-based component for a single subscription. + In order to bill your subscribers on your Events data under the Events-Based Billing feature, the components must be activated for the subscriber. Learn more about the role of activation in the [Events-Based Billing docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Based-Billing-Overview). @@ -1251,6 +1327,10 @@ def activate_event_based_component(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1261,6 +1341,8 @@ def activate_event_based_component(subscription_id, ## Response Type +**200**: OK + `void` ## Example Usage @@ -1300,13 +1382,17 @@ subscription_components_controller.activate_event_based_component( # Deactivate Event Based Component -Use this endpoint to deactivate an event-based component for a single subscription. Deactivating the event-based component causes Advanced Billing to ignore related events at subscription renewal. +Deactivates an event-based component for a single subscription. Deactivating the event-based component causes Advanced Billing to ignore related events at subscription renewal. ```ruby def deactivate_event_based_component(subscription_id, component_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1316,6 +1402,8 @@ def deactivate_event_based_component(subscription_id, ## Response Type +**200**: OK + `void` ## Example Usage @@ -1334,6 +1422,8 @@ subscription_components_controller.deactivate_event_based_component( # Record Event +Records a single event for Events-Based Billing. + ## Documentation Events-Based Billing is an evolved form of metered billing that is based on data-rich events streamed in real-time from your system to Advanced Billing. @@ -1360,6 +1450,10 @@ def record_event(api_handle, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1374,6 +1468,8 @@ def record_event(api_handle, ## Response Type +**201**: Created + `void` ## Example Usage @@ -1397,7 +1493,7 @@ subscription_components_controller.record_event( # Bulk Record Events -Use this endpoint to record a collection of events. +Records a collection of events. *Note: this endpoint differs from the standard Chargify API endpoints in that the subdomain will be `events` and your site subdomain will be included in the URL path.* @@ -1409,6 +1505,10 @@ def bulk_record_events(api_handle, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1423,6 +1523,8 @@ def bulk_record_events(api_handle, ## Response Type +**201**: Created + `void` ## Example Usage @@ -1448,12 +1550,16 @@ subscription_components_controller.bulk_record_events( # List Subscription Components for Site -This request will list components applied to each subscription. +Lists components applied to each subscription. ```ruby def list_subscription_components_for_site(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1475,6 +1581,8 @@ def list_subscription_components_for_site(options = {}) ## Response Type +**200**: OK + [`ListSubscriptionComponentsResponse`](../../doc/models/list-subscription-components-response.md) ## Example Usage diff --git a/doc/controllers/subscription-group-invoice-account.md b/doc/controllers/subscription-group-invoice-account.md index 27fa044..dc906cc 100644 --- a/doc/controllers/subscription-group-invoice-account.md +++ b/doc/controllers/subscription-group-invoice-account.md @@ -18,13 +18,17 @@ subscription_group_invoice_account_controller = client.subscription_group_invoic # Create Subscription Group Prepayment -A prepayment can be added for a subscription group identified by the group's `uid`. This endpoint requires a `amount`, `details`, `method`, and `memo`. On success, the prepayment will be added to the group's prepayment balance. +Adds a prepayment for a subscription group. This endpoint requires an `amount`, `details`, `method`, and `memo`. On success, the prepayment will be added to the group's prepayment balance. ```ruby def create_subscription_group_prepayment(uid, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -34,6 +38,8 @@ def create_subscription_group_prepayment(uid, ## Response Type +**200**: OK + [`SubscriptionGroupPrepaymentResponse`](../../doc/models/subscription-group-prepayment-response.md) ## Example Usage @@ -66,12 +72,16 @@ puts result # List Prepayments for Subscription Group -This request will list a subscription group's prepayments. +Lists a subscription group's prepayments. ```ruby def list_prepayments_for_subscription_group(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -83,6 +93,8 @@ def list_prepayments_for_subscription_group(options = {}) ## Response Type +**200**: OK + [`ListSubscriptionGroupPrepaymentResponse`](../../doc/models/list-subscription-group-prepayment-response.md) ## Example Usage @@ -134,13 +146,17 @@ puts result # Issue Subscription Group Service Credit -Credit can be issued for a subscription group identified by the group's `uid`. Credit will be added to the group in the amount specified in the request body. The credit will be applied to group member invoices as they are generated. +Issues service credit for a subscription group. Credit will be added to the group in the amount specified in the request body. The credit will be applied to group member invoices as they are generated. ```ruby def issue_subscription_group_service_credit(uid, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -150,6 +166,8 @@ def issue_subscription_group_service_credit(uid, ## Response Type +**200**: OK + [`ServiceCreditResponse`](../../doc/models/service-credit-response.md) ## Example Usage @@ -194,13 +212,17 @@ puts result # Deduct Subscription Group Service Credit -Credit can be deducted for a subscription group identified by the group's `uid`. Credit will be deducted from the group in the amount specified in the request body. +Deducts service credit for a subscription group. Credit will be deducted from the group in the amount specified in the request body. ```ruby def deduct_subscription_group_service_credit(uid, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -210,6 +232,8 @@ def deduct_subscription_group_service_credit(uid, ## Response Type +**201**: Created + [`ServiceCredit`](../../doc/models/service-credit.md) ## Example Usage diff --git a/doc/controllers/subscription-group-status.md b/doc/controllers/subscription-group-status.md index e94842c..9f1f508 100644 --- a/doc/controllers/subscription-group-status.md +++ b/doc/controllers/subscription-group-status.md @@ -27,6 +27,10 @@ def cancel_subscriptions_in_group(uid, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -36,6 +40,8 @@ def cancel_subscriptions_in_group(uid, ## Response Type +**200**: OK + `void` ## Example Usage @@ -62,7 +68,7 @@ subscription_group_status_controller.cancel_subscriptions_in_group( # Initiate Delayed Cancellation for Group -This endpoint will schedule all subscriptions within the specified group to be canceled at the end of their billing period. The group is identified by its uid passed in the URL. +Schedules all subscriptions within the specified group to be canceled at the end of their billing period. The group is identified by its uid passed in the URL. All subscriptions in the group must be on automatic billing in order to successfully cancel them, and the group must not be in a "past_due" state. @@ -70,6 +76,10 @@ All subscriptions in the group must be on automatic billing in order to successf def initiate_delayed_cancellation_for_group(uid) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -78,6 +88,8 @@ def initiate_delayed_cancellation_for_group(uid) ## Response Type +**200**: OK + `void` ## Example Usage @@ -97,12 +109,18 @@ subscription_group_status_controller.initiate_delayed_cancellation_for_group(uid # Cancel Delayed Cancellation for Group +Removes the delayed cancellation on a subscription group. + Removing the delayed cancellation on a subscription group will ensure that the subscriptions do not get canceled at the end of the period. The request will reset the `cancel_at_end_of_period` flag to false on each member in the group. ```ruby def cancel_delayed_cancellation_for_group(uid) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -111,6 +129,8 @@ def cancel_delayed_cancellation_for_group(uid) ## Response Type +**200**: OK + `void` ## Example Usage @@ -130,15 +150,15 @@ subscription_group_status_controller.cancel_delayed_cancellation_for_group(uid) # Reactivate Subscription Group -This endpoint will attempt to reactivate or resume a cancelled subscription group. Upon reactivation, any canceled invoices created after the beginning of the primary subscription's billing period will be reopened and payment will be attempted on them. If the subscription group is being reactivated (as opposed to resumed), new charges will also be assessed for the new billing period. +Reactivates or resumes a cancelled subscription group. Upon reactivation, any canceled invoices created after the beginning of the primary subscription's billing period will be reopened and payment will be attempted on them. If the subscription group is being reactivated (as opposed to resumed), new charges will also be assessed for the new billing period. Whether a subscription group is reactivated (a new billing period is created) or resumed (the current billing period is respected) will depend on the parameters that are sent with the request as well as the date of the request relative to the primary subscription's period. ## Reactivating within the current period -If a subscription group is cancelled and reactivated within the primary subscription's current period, we can choose to either start a new billing period or maintain the existing one. If we want to maintain the existing billing period the `resume=true` option must be passed in request parameters. +If a subscription group is cancelled and reactivated within the primary subscription's current period, we can choose to either start a new billing period or maintain the existing one. If we want to maintain the existing billing period, the `resume=true` option must be passed in request parameters. -An exception to the above are subscriptions that are on calendar billing. These subscriptions cannot be reactivated within the current period. If the `resume=true` option is not passed the request will return an error. +An exception to the above are subscriptions that are on calendar billing. These subscriptions cannot be reactivated within the current period. If the `resume=true` option is not passed, the request will return an error. The `resume_members` option is ignored in this case. All eligible group members will be automatically resumed. @@ -150,11 +170,21 @@ Member subscriptions can have billing periods that are longer than the primary ( For calendar billing subscriptions, the new billing period created will be a partial one, spanning from the date of reactivation to the next corresponding calendar renewal date. +## 3D Secure (3DS) Authentication post-authentication flow + +When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. + +See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow. + ```ruby def reactivate_subscription_group(uid, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -164,6 +194,8 @@ def reactivate_subscription_group(uid, ## Response Type +**200**: OK + [`ReactivateSubscriptionGroupResponse`](../../doc/models/reactivate-subscription-group-response.md) ## Example Usage diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index 515f3a8..2c4bf8f 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -10,7 +10,7 @@ subscription_groups_controller = client.subscription_groups ## Methods -* [Signup With Subscription Group](../../doc/controllers/subscription-groups.md#signup-with-subscription-group) +* [Signup with Subscription Group](../../doc/controllers/subscription-groups.md#signup-with-subscription-group) * [Create Subscription Group](../../doc/controllers/subscription-groups.md#create-subscription-group) * [List Subscription Groups](../../doc/controllers/subscription-groups.md#list-subscription-groups) * [Read Subscription Group](../../doc/controllers/subscription-groups.md#read-subscription-group) @@ -18,12 +18,12 @@ subscription_groups_controller = client.subscription_groups * [Delete Subscription Group](../../doc/controllers/subscription-groups.md#delete-subscription-group) * [Find Subscription Group](../../doc/controllers/subscription-groups.md#find-subscription-group) * [Add Subscription to Group](../../doc/controllers/subscription-groups.md#add-subscription-to-group) -* [Remove Subscription From Group](../../doc/controllers/subscription-groups.md#remove-subscription-from-group) +* [Remove Subscription from Group](../../doc/controllers/subscription-groups.md#remove-subscription-from-group) -# Signup With Subscription Group +# Signup with Subscription Group -Create multiple subscriptions at once under the same customer and consolidate them into a subscription group. +Creates multiple subscriptions at once under the same customer and consolidates them into a subscription group. You must provide one and only one of the `payer_id`/`payer_reference`/`payer_attributes` for the customer attached to the group. @@ -31,14 +31,18 @@ You must provide one and only one of the `payment_profile_id`/`credit_card_attri Only one of the `subscriptions` can have `"primary": true` attribute set. -When passing product to a subscription you can use either `product_id` or `product_handle` or `offer_id`. You can also use `custom_price` instead. +When passing a product to a subscription you can use either `product_id` or `product_handle` or `offer_id`. You can also use `custom_price` instead. The subscription request examples below will be split into two sections. -The first section, "Subscription Customization", will focus on passing different information with a subscription, such as components, calendar billing, and custom fields. These examples will presume you are using a secure chargify_token generated by Chargify.js. +The first section, "Subscription Customization", will focus on passing different information with a subscription, such as components, calendar billing, and custom fields. These examples will presume you are using a secure chargify_token generated by Maxio.js (formerly Chargify.js). ```ruby def signup_with_subscription_group(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -47,6 +51,8 @@ def signup_with_subscription_group(body: nil) ## Response Type +**201**: Created + [`SubscriptionGroupSignupResponse`](../../doc/models/subscription-group-signup-response.md) ## Example Usage @@ -90,6 +96,10 @@ Creates a subscription group with given members. def create_subscription_group(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -98,6 +108,8 @@ def create_subscription_group(body: nil) ## Response Type +**200**: OK + [`SubscriptionGroupResponse`](../../doc/models/subscription-group-response.md) ## Example Usage @@ -160,6 +172,10 @@ Account balance information for the subscription groups is not returned by defau def list_subscription_groups(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -170,6 +186,8 @@ def list_subscription_groups(options = {}) ## Response Type +**200**: OK + [`ListSubscriptionGroupsResponse`](../../doc/models/list-subscription-groups-response.md) ## Example Usage @@ -228,7 +246,7 @@ puts result # Read Subscription Group -Use this endpoint to find subscription group details. +Returns subscription group details. #### Current Billing Amount in Cents @@ -239,6 +257,10 @@ def read_subscription_group(uid, include: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -248,6 +270,8 @@ def read_subscription_group(uid, ## Response Type +**200**: OK + [`FullSubscriptionGroupResponse`](../../doc/models/full-subscription-group-response.md) ## Example Usage @@ -311,14 +335,18 @@ puts result # Update Subscription Group Members -Use this endpoint to update subscription group members. -`"member_ids"` should contain an array of both subscription IDs to set as group members and subscription IDs already present in the groups. Not including them will result in removing them from subscription group. To clean up members, just leave the array empty. +Updates subscription group members. +`"member_ids"` should contain an array of both subscription IDs to set as group members and subscription IDs already present in the groups. Not including them will result in removing them from the subscription group. To clean up members, just leave the array empty. ```ruby def update_subscription_group_members(uid, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -328,6 +356,8 @@ def update_subscription_group_members(uid, ## Response Type +**200**: OK + [`SubscriptionGroupResponse`](../../doc/models/subscription-group-response.md) ## Example Usage @@ -389,6 +419,10 @@ Only groups without members can be deleted. def delete_subscription_group(uid) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -397,6 +431,8 @@ def delete_subscription_group(uid) ## Response Type +**200**: OK + [`DeleteSubscriptionGroupResponse`](../../doc/models/delete-subscription-group-response.md) ## Example Usage @@ -426,14 +462,18 @@ puts result # Find Subscription Group -Use this endpoint to find subscription group associated with subscription. +Finds the subscription group associated with a subscription. -If the subscription is not in a group endpoint will return 404 code. +If the subscription is not in a group, the endpoint will return a 404 code. ```ruby def find_subscription_group(subscription_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -442,6 +482,8 @@ def find_subscription_group(subscription_id) ## Response Type +**200**: OK + [`FullSubscriptionGroupResponse`](../../doc/models/full-subscription-group-response.md) ## Example Usage @@ -523,6 +565,10 @@ def add_subscription_to_group(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -532,6 +578,8 @@ def add_subscription_to_group(subscription_id, ## Response Type +**200**: OK + [`SubscriptionGroupResponse`](../../doc/models/subscription-group-response.md) ## Example Usage @@ -583,14 +631,18 @@ puts result ``` -# Remove Subscription From Group +# Remove Subscription from Group -For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to remove existing subscription from subscription group. +For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to remove an existing subscription from a subscription group. ```ruby def remove_subscription_from_group(subscription_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -599,6 +651,8 @@ def remove_subscription_from_group(subscription_id) ## Response Type +**204**: No Content + `void` ## Example Usage diff --git a/doc/controllers/subscription-invoice-account.md b/doc/controllers/subscription-invoice-account.md index 534a858..4c2135a 100644 --- a/doc/controllers/subscription-invoice-account.md +++ b/doc/controllers/subscription-invoice-account.md @@ -27,6 +27,10 @@ Returns the `balance_in_cents` of the Subscription's Pending Discount, Service C def read_account_balances(subscription_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -35,6 +39,8 @@ def read_account_balances(subscription_id) ## Response Type +**200**: OK + [`AccountBalances`](../../doc/models/account-balances.md) ## Example Usage @@ -49,7 +55,7 @@ puts result # Create Prepayment -## Create Prepayment +Creates a prepayment for a subscription. In order to specify a prepayment made against a subscription, specify the `amount, memo, details, method`. @@ -57,11 +63,21 @@ When the `method` specified is `"credit_card_on_file"`, the prepayment amount wi Note that passing `amount_in_cents` is now allowed. +## 3D Secure (3DS) Authentication post-authentication flow + +When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. + +See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow. + ```ruby def create_prepayment(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -71,6 +87,8 @@ def create_prepayment(subscription_id, ## Response Type +**201**: Created + [`CreatePrepaymentResponse`](../../doc/models/create-prepayment-response.md) ## Example Usage @@ -119,12 +137,16 @@ puts result # List Prepayments -This request will list a subscription's prepayments. +Lists a subscription's prepayments. ```ruby def list_prepayments(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -136,6 +158,8 @@ def list_prepayments(options = {}) ## Response Type +**200**: OK + [`PrepaymentsResponse`](../../doc/models/prepayments-response.md) ## Example Usage @@ -186,13 +210,17 @@ puts result # Issue Service Credit -Credit will be added to the subscription in the amount specified in the request body. The credit is subsequently applied to the next generated invoice. +Adds a service credit to the subscription in the specified amount. The credit is subsequently applied to the next generated invoice. ```ruby def issue_service_credit(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -202,6 +230,8 @@ def issue_service_credit(subscription_id, ## Response Type +**201**: Created + [`ServiceCredit`](../../doc/models/service-credit.md) ## Example Usage @@ -243,13 +273,17 @@ puts result # Deduct Service Credit -Credit will be removed from the subscription in the amount specified in the request body. The credit amount being deducted must be equal to or less than the current credit balance. +Deducts a service credit from the subscription in the specified amount. The credit amount being deducted must be equal to or less than the current credit balance. ```ruby def deduct_service_credit(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -259,6 +293,8 @@ def deduct_service_credit(subscription_id, ## Response Type +**201**: OK + `void` ## Example Usage @@ -288,7 +324,7 @@ subscription_invoice_account_controller.deduct_service_credit( # List Service Credits -This request will list a subscription's service credits. +Lists a subscription's service credits. ```ruby def list_service_credits(subscription_id, @@ -297,6 +333,10 @@ def list_service_credits(subscription_id, direction: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -308,6 +348,8 @@ def list_service_credits(subscription_id, ## Response Type +**200**: OK + [`ListServiceCreditsResponse`](../../doc/models/list-service-credits-response.md) ## Example Usage @@ -366,7 +408,7 @@ puts result # Refund Prepayment -This endpoint will refund, completely or partially, a particular prepayment applied to a subscription. The `prepayment_id` will be the account transaction ID of the original payment. The prepayment must have some amount remaining in order to be refunded. +Refunds a prepayment applied to a subscription, either fully or partially. The `prepayment_id` will be the account transaction ID of the original payment. The prepayment must have some amount remaining in order to be refunded. The amount may be passed either as a decimal, with `amount`, or an integer in cents, with `amount_in_cents`. @@ -376,6 +418,10 @@ def refund_prepayment(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -386,6 +432,8 @@ def refund_prepayment(subscription_id, ## Response Type +**201**: Created + [`PrepaymentResponse`](../../doc/models/prepayment-response.md) ## Example Usage diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index 4227078..6ec186e 100644 --- a/doc/controllers/subscription-notes.md +++ b/doc/controllers/subscription-notes.md @@ -19,7 +19,7 @@ subscription_notes_controller = client.subscription_notes # Create Subscription Note -Use the following method to create a note for a subscription. +Creates a note for a subscription. ## How to Use Subscription Notes @@ -34,6 +34,10 @@ def create_subscription_note(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -43,6 +47,8 @@ def create_subscription_note(subscription_id, ## Response Type +**200**: OK + [`SubscriptionNoteResponse`](../../doc/models/subscription-note-response.md) ## Example Usage @@ -73,12 +79,16 @@ puts result # List Subscription Notes -Use this method to retrieve a list of Notes associated with a Subscription. The response will be an array of Notes. +Retrieves a list of notes associated with a subscription. The response will be an array of Notes. ```ruby def list_subscription_notes(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -89,6 +99,8 @@ def list_subscription_notes(options = {}) ## Response Type +**200**: OK + [`Array[SubscriptionNoteResponse]`](../../doc/models/subscription-note-response.md) ## Example Usage @@ -140,13 +152,17 @@ puts result # Read Subscription Note -Once you have obtained the ID of the note you wish to read, use this method to show a particular note attached to a subscription. +Retrieves a specific note attached to a subscription. ```ruby def read_subscription_note(subscription_id, note_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -156,6 +172,8 @@ def read_subscription_note(subscription_id, ## Response Type +**200**: OK + [`SubscriptionNoteResponse`](../../doc/models/subscription-note-response.md) ## Example Usage @@ -190,7 +208,7 @@ puts result # Update Subscription Note -Use the following method to update a note for a Subscription. +Updates a note for a subscription. ```ruby def update_subscription_note(subscription_id, @@ -198,6 +216,10 @@ def update_subscription_note(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -208,6 +230,8 @@ def update_subscription_note(subscription_id, ## Response Type +**200**: OK + [`SubscriptionNoteResponse`](../../doc/models/subscription-note-response.md) ## Example Usage @@ -248,6 +272,10 @@ def delete_subscription_note(subscription_id, note_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -257,6 +285,8 @@ def delete_subscription_note(subscription_id, ## Response Type +**200**: OK + `void` ## Example Usage diff --git a/doc/controllers/subscription-products.md b/doc/controllers/subscription-products.md index bf3adba..d9bacd6 100644 --- a/doc/controllers/subscription-products.md +++ b/doc/controllers/subscription-products.md @@ -16,6 +16,8 @@ subscription_products_controller = client.subscription_products # Migrate Subscription Product +Migrates a subscription to a different product. + In order to create a migration, you must pass the `product_id` or `product_handle` in the object when you send a POST request. You may also pass either a `product_price_point_id` or `product_price_point_handle` to choose which price point the subscription is moved to. If no price point identifier is passed the subscription will be moved to the products default price point. The response will be the updated subscription. ## Valid Subscriptions @@ -30,54 +32,23 @@ Full documentation on how to record Migrations in the Advanced Billing UI can be ## Failed Migrations -Importaint note: One of the most common ways that a migration can fail is when the attempt is made to migrate a subscription to its current product. - -## Migration 3D Secure - Stripe - -When a payment requires 3D Secure Authentication to adhear to Strong Customer Authentication (SCA) when the subscription is migrated to a new product, the request enters a [post-authentication flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-Implementing-3D-Secure#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: - -```json -{ - "errors": [ - "Your card was declined. This transaction requires 3D secure authentication." - ], - "gateway_payment_id": "pi_1F0aGoJ2UDb3Q4av7zU3sHPh", - "description": "This card requires 3D secure authentication. Redirect the customer to the URL from the action_link attribute to authenticate. Attach callback_url param to this URL if you want to be notified about the result of 3D Secure authentication. Attach redirect_url param to this URL if you want to redirect a customer back to your page after 3D Secure authentication. Example: https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.com will do a POST request to https://localhost:4000 after payment is authenticated and will redirect a customer to https://yourpage.com after 3DS authentication.", - "action_link": "http://acme.chargify.com/3d-secure/pi_1F0aGoJ2UDb3Q4av7zU3sHPh?one_time_token_id=242" -} -``` - -To let the customer go through 3D Secure Authentication, they need to be redirected to the URL specified in `action_link`. -Optionally, you can specify `callback_url` parameter in the `action_link` URL if you’d like to be notified about the result of 3D Secure Authentication. The `callback_url` will return the following information: - -- whether the authentication was successful (`success`) -- the gateway ID for the payment (`gateway_payment_id`) -- the subscription ID (`subscription_id`) +Important note: One of the most common ways that a migration can fail is when the attempt is made to migrate a subscription to its current product. -Lastly, you can also specify a `redirect_url` within the `action_link` URL if you’d like to redirect a customer back to your site. +## 3D Secure (3DS) Authentication post-authentication flow -It is not possible to use `action_link` in an iframe inside a custom application. You have to redirect the customer directly to the `action_link`, then, to be notified about the result, use `redirect_url` or `callback_url`. +When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. -The final URL that you send a customer to to complete 3D Secure may resemble the following, where the first half is the `action_link` and the second half contains a `redirect_url` and `callback_url`: `https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yourpage.com` - -### Example Redirect Flow - -You may wish to redirect customers to different pages depending on whether SCA was performed successfully. Here's an example flow to use as a reference: - -1. Create a migration via API; it requires 3DS -2. You receive a `gateway_payment_id` in the `action_link` along other params in the response. -3. Use this `gateway_payment_id` to, for example, connect with your internal resources or generate a session_id -4. Include 1 of those attributes inside the `callback_url` and `redirect_url` to be aware which “session” this applies to -5. Redirect the customer to the `action_link` with `callback_url` and `redirect_url` applied -6. After the customer finishes 3DS authentication, we let you know the result by making a request to applied `callback_url`. -7. After that, we redirect the customer to the `redirect_url`; at this point the result of authentication is known -8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was successful or not. +See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow. ```ruby def migrate_subscription_product(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -87,6 +58,8 @@ def migrate_subscription_product(subscription_id, ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -244,9 +217,11 @@ puts result # Preview Subscription Product Migration +Previews the charges resulting from migrating a subscription to a different product. + ## Previewing a future date -It is also possible to preview the migration for a date in the future, as long as it's still within the subscription's current billing period, by passing a `proration_date` along with the request (eg: `"proration_date": "2020-12-18T18:25:43.511Z"`). +It is also possible to preview the migration for a date in the future, as long as it's still within the subscription's current billing period, by passing a `proration_date` along with the request (e.g., `"proration_date": "2020-12-18T18:25:43.511Z"`). This will calculate the prorated adjustment, charge, payment and credit applied values assuming the migration is done at that date in the future as opposed to right now. @@ -255,6 +230,10 @@ def preview_subscription_product_migration(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -264,6 +243,8 @@ def preview_subscription_product_migration(subscription_id, ## Response Type +**200**: OK + [`SubscriptionMigrationPreviewResponse`](../../doc/models/subscription-migration-preview-response.md) ## Example Usage diff --git a/doc/controllers/subscription-renewals.md b/doc/controllers/subscription-renewals.md index fbcb4fe..20b5d3e 100644 --- a/doc/controllers/subscription-renewals.md +++ b/doc/controllers/subscription-renewals.md @@ -32,6 +32,10 @@ def create_scheduled_renewal_configuration(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -41,6 +45,8 @@ def create_scheduled_renewal_configuration(subscription_id, ## Response Type +**201**: Created + [`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) ## Example Usage @@ -123,6 +129,10 @@ def list_scheduled_renewal_configurations(subscription_id, status: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -132,6 +142,8 @@ def list_scheduled_renewal_configurations(subscription_id, ## Response Type +**200**: OK + [`ScheduledRenewalConfigurationsResponse`](../../doc/models/scheduled-renewal-configurations-response.md) ## Example Usage @@ -198,6 +210,10 @@ def read_scheduled_renewal_configuration(subscription_id, id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -207,6 +223,8 @@ def read_scheduled_renewal_configuration(subscription_id, ## Response Type +**200**: OK + [`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) ## Example Usage @@ -277,6 +295,10 @@ def update_scheduled_renewal_configuration(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -287,6 +309,8 @@ def update_scheduled_renewal_configuration(subscription_id, ## Response Type +**200**: OK + [`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) ## Example Usage @@ -372,6 +396,10 @@ def schedule_scheduled_renewal_lock_in(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -382,6 +410,8 @@ def schedule_scheduled_renewal_lock_in(subscription_id, ## Response Type +**200**: OK + [`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) ## Example Usage @@ -462,6 +492,10 @@ def lock_in_scheduled_renewal_immediately(subscription_id, id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -471,6 +505,8 @@ def lock_in_scheduled_renewal_immediately(subscription_id, ## Response Type +**200**: OK + [`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) ## Example Usage @@ -545,6 +581,10 @@ def unpublish_scheduled_renewal_configuration(subscription_id, id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -554,6 +594,8 @@ def unpublish_scheduled_renewal_configuration(subscription_id, ## Response Type +**200**: OK + [`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) ## Example Usage @@ -620,6 +662,10 @@ def cancel_scheduled_renewal_configuration(subscription_id, id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -629,6 +675,8 @@ def cancel_scheduled_renewal_configuration(subscription_id, ## Response Type +**200**: OK + [`ScheduledRenewalConfigurationResponse`](../../doc/models/scheduled-renewal-configuration-response.md) ## Example Usage @@ -696,6 +744,10 @@ def create_scheduled_renewal_configuration_item(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -706,6 +758,8 @@ def create_scheduled_renewal_configuration_item(subscription_id, ## Response Type +**201**: Created + [`ScheduledRenewalConfigurationItemResponse`](../../doc/models/scheduled-renewal-configuration-item-response.md) ## Example Usage @@ -779,6 +833,10 @@ def update_scheduled_renewal_configuration_item(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -790,6 +848,8 @@ def update_scheduled_renewal_configuration_item(subscription_id, ## Response Type +**200**: OK + [`ScheduledRenewalConfigurationItemResponse`](../../doc/models/scheduled-renewal-configuration-item-response.md) ## Example Usage @@ -865,6 +925,10 @@ def delete_scheduled_renewal_configuration_item(subscription_id, id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -875,6 +939,8 @@ def delete_scheduled_renewal_configuration_item(subscription_id, ## Response Type +**204**: No Content + `void` ## Example Usage diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index 7790579..149fb71 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -24,20 +24,22 @@ subscription_status_controller = client.subscription_status # Retry Subscription -Advanced Billing offers the ability to retry collecting the balance due on a past due Subscription without waiting for the next scheduled attempt. +Retries collecting the balance due on a past-due subscription without waiting for the next scheduled attempt. -## Successful Reactivation +## 3D Secure (3DS) Authentication post-authentication flow -The response will be `200 OK` with the updated Subscription. +When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. -## Failed Reactivation - -The response will be `422 "Unprocessable Entity`. +See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow. ```ruby def retry_subscription(subscription_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -46,6 +48,8 @@ def retry_subscription(subscription_id) ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -210,6 +214,10 @@ def cancel_subscription(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -219,6 +227,8 @@ def cancel_subscription(subscription_id, ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -376,13 +386,17 @@ puts result # Resume Subscription -Resume a paused (on-hold) subscription. If the normal next renewal date has not passed, the subscription will return to active and will renew on that date. Otherwise, it will behave like a reactivation, setting the billing date to 'now' and charging the subscriber. +Resumes a paused (on-hold) subscription. If the normal next renewal date has not passed, the subscription will return to active and will renew on that date. Otherwise, it will behave like a reactivation, setting the billing date to 'now' and charging the subscriber. ```ruby def resume_subscription(subscription_id, calendar_billing_resumption_charge: ResumptionCharge::PRORATED) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -392,6 +406,8 @@ def resume_subscription(subscription_id, ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -521,7 +537,7 @@ puts result # Pause Subscription -This will place the subscription in the on_hold state and it will not renew. +Places the subscription on hold, preventing it from renewing. ## Limitations @@ -532,6 +548,10 @@ def pause_subscription(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -541,6 +561,8 @@ def pause_subscription(subscription_id, ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -679,19 +701,23 @@ puts result # Update Automatic Subscription Resumption -Once a subscription has been paused / put on hold, you can update the date which was specified to automatically resume the subscription. +Updates the date on which a paused subscription will automatically resume. To update a subscription's resume date, use this method to change or update the `automatically_resume_at` date. ### Remove the resume date -Alternately, you can change the `automatically_resume_at` to `null` if you would like the subscription to not have a resume date. +Alternatively, you can change the `automatically_resume_at` to `null` if you would like the subscription to not have a resume date. ```ruby def update_automatic_subscription_resumption(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -701,6 +727,8 @@ def update_automatic_subscription_resumption(subscription_id, ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -850,7 +878,7 @@ puts result # Reactivate Subscription -Reactivate a previously canceled subscription. For details on how the reactivation works, and how to reactivate subscriptions through the application, see [reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming). +Reactivates a previously canceled subscription. For details on how the reactivation works, and how to reactivate subscriptions through the application, see [reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming). **Note: The term "resume" is used also during another process in Advanced Billing. This occurs when an on-hold subscription is "resumed". This returns the subscription to an active state.** @@ -871,7 +899,7 @@ If a reactivation with `resume: true` were attempted _before_ what would have be If a reactivation with `resume: true` were attempted _after_ what would have been the next billing date of July 1st, then Advanced Billing would not resume the subscription, and instead it would be reactivated with a new billing period. -If a reactivation with `resume: false`, or where 'resume" is omited were attempted, then Advanced Billing would reactivate the subscription with a new billing period regardless of whether or not resuming the previous billing period were possible. +If a reactivation with `resume: false`, or where 'resume' is omitted were attempted, then Advanced Billing would reactivate the subscription with a new billing period regardless of whether or not resuming the previous billing period was possible. | Canceled | Reactivation | Resumable? | |---|---|---| @@ -1011,11 +1039,21 @@ PUT request sent to: + The next billing date should not have changed + Any product-related charges should have been collected +## 3D Secure (3DS) Authentication post-authentication flow + +When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. + +See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow. + ```ruby def reactivate_subscription(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1025,6 +1063,8 @@ def reactivate_subscription(subscription_id, ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -1176,6 +1216,10 @@ def initiate_delayed_cancellation(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1185,6 +1229,8 @@ def initiate_delayed_cancellation(subscription_id, ## Response Type +**200**: OK + [`DelayedCancellationResponse`](../../doc/models/delayed-cancellation-response.md) ## Example Usage @@ -1206,7 +1252,7 @@ puts result # Cancel Delayed Cancellation -Removing the delayed cancellation on a subscription will ensure that it doesn't get canceled at the end of the period that it is in. The request will reset the `cancel_at_end_of_period` flag to `false`. +Removes the delayed cancellation from a subscription, ensuring it is not canceled at the end of the current period. The request will reset the `cancel_at_end_of_period` flag to `false`. This endpoint is idempotent. If the subscription was not set to cancel in the future, removing the delayed cancellation has no effect and the call will be successful. @@ -1214,6 +1260,10 @@ This endpoint is idempotent. If the subscription was not set to cancel in the fu def cancel_delayed_cancellation(subscription_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1222,6 +1272,8 @@ def cancel_delayed_cancellation(subscription_id) ## Response Type +**200**: OK + [`DelayedCancellationResponse`](../../doc/models/delayed-cancellation-response.md) ## Example Usage @@ -1250,12 +1302,16 @@ puts result # Cancel Dunning -If a subscription is currently in dunning, the subscription will be set to active and the active Dunner will be resolved. +Cancels the active dunning process for a subscription and sets it to active. ```ruby def cancel_dunning(subscription_id) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1264,6 +1320,8 @@ def cancel_dunning(subscription_id) ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -1284,7 +1342,7 @@ puts result # Preview Renewal -The Chargify API allows you to preview a renewal by posting to the renewals endpoint. Renewal Preview is an object representing a subscription’s next assessment. You can retrieve it to see a snapshot of how much your customer will be charged on their next renewal. +Previews a subscription’s next renewal assessment. Renewal Preview is an object representing a subscription’s next assessment. You can retrieve it to see a snapshot of how much your customer will be charged on their next renewal. The "Next Billing" amount and "Next Billing" date are already represented in the UI on each Subscriber's Summary. For more information, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). @@ -1312,6 +1370,10 @@ def preview_renewal(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1321,6 +1383,8 @@ def preview_renewal(subscription_id, ## Response Type +**200**: OK + [`RenewalPreviewResponse`](../../doc/models/renewal-preview-response.md) ## Example Usage diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index 4a8883c..663af6c 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -20,32 +20,44 @@ subscriptions_controller = client.subscriptions * [Update Prepaid Subscription Configuration](../../doc/controllers/subscriptions.md#update-prepaid-subscription-configuration) * [Preview Subscription](../../doc/controllers/subscriptions.md#preview-subscription) * [Apply Coupons to Subscription](../../doc/controllers/subscriptions.md#apply-coupons-to-subscription) -* [Remove Coupon From Subscription](../../doc/controllers/subscriptions.md#remove-coupon-from-subscription) +* [Remove Coupon from Subscription](../../doc/controllers/subscriptions.md#remove-coupon-from-subscription) * [Activate Subscription](../../doc/controllers/subscriptions.md#activate-subscription) # Create Subscription -Creates a Subscription for a customer and product +Creates a Subscription for a customer and product. -Specify the product with `product_id` or `product_handle`. To set a specific product pricepPoint, use `product_price_point_handle` or `product_price_point_id`. +Specify the product with `product_id` or `product_handle`. To set a specific product price point, use `product_price_point_handle` or `product_price_point_id`. Identify an existing customer with `customer_id` or `customer_reference`. Optionally, include an existing payment profile using `payment_profile_id`. To create a new customer, pass customer_attributes. Select an option from the **Request Examples** drop-down on the right side of the portal to see examples of common scenarios for creating subscriptions. +See the [Subscription Signups](page:introduction/basic-concepts/subscription-signup) article for more information on working with subscriptions in Advanced Billing. + +## Payment information + Payment information may be required to create a subscription, depending on the options for the Product being subscribed. See [product options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-Products) for more information. See the [Payments Profile](../../doc/controllers/payment-profiles.md#create-payment-profile) endpoint for details on payment parameters. Do not use real card information for testing. See the Sites articles that cover [testing your site setup](https://docs.maxio.com/hc/en-us/articles/24250712113165-Testing-Overview#testing-overview-0-0) for more details on testing in your sandbox. -Note that collecting and sending raw card details in production requires [PCI compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compliance#pci-compliance-0-0) on your end. If your business is not PCI compliant, use [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0) to collect credit card or bank account information. +Note that collecting and sending raw card details in production requires [PCI compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Compliance#pci-compliance-0-0) on your end. If your business is not PCI compliant, use [Maxio.js (formerly Chargify.js)](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0) to collect credit card or bank account information. -See the [Subscription Signups](page:introduction/basic-concepts/subscription-signup) article for more information on working with subscriptions in Advanced Billing. +## 3D Secure (3DS) Authentication post-authentication flow + +When a payment requires 3DS Authentication to adhere to Strong Customer Authentication (SCA), the request enters a post-authentication flow where a 422 Unprocessable Entity status is returned with an action_link that will direct the customer through 3DS Authentication. + +See the [3D Secure Post-Authentication Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Post-Authentication-Flow) article in the product documentation to learn how to manage the redirect flow. ```ruby def create_subscription(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -54,6 +66,8 @@ def create_subscription(body: nil) ## Response Type +**201**: Created + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -232,7 +246,7 @@ puts result # List Subscriptions -returns an array of subscriptions from a Site. Pay close attention to query string filters and pagination in order to control responses from the server. +Returns an array of subscriptions from a Site. Pay close attention to query string filters and pagination in order to control responses from the server. ## Search for a subscription @@ -246,6 +260,10 @@ Self-Service Page token for the subscriptions is not returned by default. If thi def list_subscriptions(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -269,6 +287,8 @@ def list_subscriptions(options = {}) ## Response Type +**200**: OK + [`Array[SubscriptionResponse]`](../../doc/models/subscription-response.md) ## Example Usage @@ -328,27 +348,31 @@ You can also perform a delayed change to the price point by passing in either `p ## Billing Date Changes -You can update dates for a subscrption. +You can update dates for a subscription. ### Regular Billing Date Changes Send the `next_billing_at` to set the next billing date for the subscription. After that date passes and the subscription is processed, the following billing date will be set according to the subscription's product period. -> Note: If you pass an invalid date, the correct date is automatically set to he correct date. For example, if February 30 is passed, the next billing would be set to March 2nd in a non-leap year. +> Note: If you pass an invalid date, the correct date is automatically set to the correct date. For example, if February 30 is passed, the next billing would be set to March 2nd in a non-leap year. The server response will not return data under the key/value pair of `next_billing_at`. View the key/value pair of `current_period_ends_at` to verify that the `next_billing_at` date has been changed successfully. -### Calendar Billing and Snap Day Changes +### Calendar Billing and Snap Day Changes For a subscription using Calendar Billing, setting the next billing date is a bit different. Send the `snap_day` attribute to change the calendar billing date for **a subscription using a product eligible for calendar billing**. -> Note: If you change the product associated with a subscription that contains a `snap_day` and immediately `READ/GET` the subscription data, it will still contain original `snap_day`. The `snap_day`will will reset to 'null on the next billing cycle. This is because a product change is instantanous and only affects the product associated with a subscription. +> Note: If you change the product associated with a subscription that contains a `snap_day` and immediately `READ/GET` the subscription data, it will still contain original `snap_day`. The `snap_day` will reset to null on the next billing cycle. This is because a product change is instantaneous and only affects the product associated with a subscription. ```ruby def update_subscription(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -358,6 +382,8 @@ def update_subscription(subscription_id, ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -509,6 +535,10 @@ def read_subscription(subscription_id, include: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -518,6 +548,8 @@ def read_subscription(subscription_id, ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -679,7 +711,7 @@ puts result # Override Subscription -This API endpoint allows you to set certain subscription fields that are usually managed for you automatically. Some of the fields can be set via the normal Subscriptions Update API, but others can only be set using this endpoint. +Sets certain subscription fields that are usually managed automatically. Some of the fields can be set via the normal Subscriptions Update API, but others can only be set using this endpoint. This endpoint is provided for cases where you need to “align” Advanced Billing data with data that happened in your system, perhaps before you started using Advanced Billing. For example, you may choose to import your historical subscription data, and would like the activation and cancellation dates in Advanced Billing to match your existing historical dates. Advanced Billing does not backfill historical events (i.e. from the Events API), but some static data can be changed via this API. @@ -704,6 +736,10 @@ def override_subscription(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -713,6 +749,8 @@ def override_subscription(subscription_id, ## Response Type +**204**: No Content + `void` ## Example Usage @@ -744,12 +782,16 @@ subscriptions_controller.override_subscription( # Find Subscription -Use this endpoint to find a subscription by its reference. +Finds a subscription by its reference. ```ruby def find_subscription(reference: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -758,6 +800,8 @@ def find_subscription(reference: nil) ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -776,7 +820,7 @@ puts result # Purge Subscription -For sites in test mode, you may purge individual subscriptions. +Purges an individual subscription for sites in test mode. Provide the subscription ID in the url. To confirm, supply the customer ID in the query string `ack` parameter. You may also delete the customer record and/or payment profiles by passing `cascade` parameters. For example, to delete just the customer record, the query params would be: `?ack={customer_id}&cascade[]=customer` @@ -792,6 +836,10 @@ def purge_subscription(subscription_id, cascade: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -802,6 +850,8 @@ def purge_subscription(subscription_id, ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -833,13 +883,17 @@ puts result # Update Prepaid Subscription Configuration -Use this endpoint to update a subscription's prepaid configuration. +Updates a subscription's prepaid configuration. ```ruby def update_prepaid_subscription_configuration(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -849,6 +903,8 @@ def update_prepaid_subscription_configuration(subscription_id, ## Response Type +**200**: OK + [`PrepaidConfigurationResponse`](../../doc/models/prepaid-configuration-response.md) ## Example Usage @@ -895,7 +951,7 @@ puts result # Preview Subscription -The Chargify API allows you to preview a subscription by POSTing the same JSON or XML as for a subscription creation. +Previews a subscription by POSTing the same JSON or XML as for a subscription creation. The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. @@ -925,6 +981,10 @@ If you'd like to calculate subscriptions that do not include tax you may leave o def preview_subscription(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -933,6 +993,8 @@ def preview_subscription(body: nil) ## Response Type +**200**: OK + [`SubscriptionPreviewResponse`](../../doc/models/subscription-preview-response.md) ## Example Usage @@ -1071,6 +1133,8 @@ puts result # Apply Coupons to Subscription +Applies one or more coupon codes to an existing subscription. + An existing subscription can accommodate multiple discounts/coupon codes. This is only applicable if each coupon is stackable. For more information on stackable coupons, we recommend reviewing our [coupon documentation.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#stackability-rules) ## Query Parameters vs Request Body Parameters @@ -1085,6 +1149,10 @@ def apply_coupons_to_subscription(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1095,6 +1163,8 @@ def apply_coupons_to_subscription(subscription_id, ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -1273,17 +1343,21 @@ puts result | 422 | Unprocessable Entity (WebDAV) | [`SubscriptionAddCouponErrorException`](../../doc/models/subscription-add-coupon-error-exception.md) | -# Remove Coupon From Subscription +# Remove Coupon from Subscription -Use this endpoint to remove a coupon from an existing subscription. +Removes a coupon from an existing subscription. -For more information on the expected behaviour of removing a coupon from a subscription, See our documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon) +For more information on the expected behavior of removing a coupon from a subscription, see our documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon) ```ruby def remove_coupon_from_subscription(subscription_id, coupon_code: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1293,6 +1367,8 @@ def remove_coupon_from_subscription(subscription_id, ## Response Type +**200**: OK + `String` ## Example Usage @@ -1319,7 +1395,7 @@ puts result # Activate Subscription -Advanced Billing offers the ability to activate awaiting signup and trialing subscriptions. This feature is only available on the Relationship Invoicing architecture. Subscriptions in a group may not be activated immediately. +Activates awaiting signup and trialing subscriptions. This feature is only available on the Relationship Invoicing architecture. Subscriptions in a group may not be activated immediately. For details on how the activation works, and how to activate subscriptions through the application, see [activation](#). @@ -1368,6 +1444,10 @@ def activate_subscription(subscription_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -1377,6 +1457,8 @@ def activate_subscription(subscription_id, ## Response Type +**200**: OK + [`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage diff --git a/doc/controllers/webhooks.md b/doc/controllers/webhooks.md index b16e72f..2028cd6 100644 --- a/doc/controllers/webhooks.md +++ b/doc/controllers/webhooks.md @@ -20,12 +20,16 @@ webhooks_controller = client.webhooks # List Webhooks -Allows you to view a list of webhooks. You can pass query parameters if you want to filter webhooks. See the [Webhooks](page:introduction/webhooks/webhooks) documentation for more information. +Retrieves a list of webhooks. You can pass query parameters if you want to filter webhooks. See the [Webhooks](page:introduction/webhooks/webhooks) documentation for more information. ```ruby def list_webhooks(options = {}) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -40,6 +44,8 @@ def list_webhooks(options = {}) ## Response Type +**201**: OK + [`Array[WebhookResponse]`](../../doc/models/webhook-response.md) ## Example Usage @@ -96,12 +102,16 @@ puts result # Enable Webhooks -Allows you to enable webhooks for your site +Enables webhooks for your site. ```ruby def enable_webhooks(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -110,6 +120,8 @@ def enable_webhooks(body: nil) ## Response Type +**200**: OK + [`EnableWebhooksResponse`](../../doc/models/enable-webhooks-response.md) ## Example Usage @@ -140,6 +152,10 @@ Replays webhooks. Posting to this endpoint does not immediately resend the webho def replay_webhooks(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -148,6 +164,8 @@ def replay_webhooks(body: nil) ## Response Type +**200**: OK + [`ReplayWebhooksResponse`](../../doc/models/replay-webhooks-response.md) ## Example Usage @@ -175,13 +193,17 @@ puts result # Create Endpoint -Creates an endpoint and assigns a list of webhooks subscriptions (events) to it. +Creates an endpoint and assigns a list of webhook subscriptions (events) to it. See the [Webhooks Reference](page:introduction/webhooks/webhooks-reference#events) page for available events. ```ruby def create_endpoint(body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -190,6 +212,8 @@ def create_endpoint(body: nil) ## Response Type +**200**: OK + [`EndpointResponse`](../../doc/models/endpoint-response.md) ## Example Usage @@ -200,7 +224,8 @@ body = CreateOrUpdateEndpointRequest.new( url: 'https://your.site/webhooks', webhook_subscriptions: [ WebhookSubscription::PAYMENT_SUCCESS, - WebhookSubscription::PAYMENT_FAILURE + WebhookSubscription::PAYMENT_FAILURE, + WebhookSubscription::INVOICE_PENDING ] ) ) @@ -220,7 +245,8 @@ puts result "status": "enabled", "webhook_subscriptions": [ "payment_success", - "payment_failure" + "payment_failure", + "invoice_pending" ] } } @@ -241,8 +267,14 @@ Returns created endpoints for a site. def list_endpoints ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Response Type +**200**: OK + [`Array[Endpoint]`](../../doc/models/endpoint.md) ## Example Usage @@ -263,7 +295,8 @@ puts result "status": "enabled", "webhook_subscriptions": [ "payment_success", - "payment_failure" + "payment_failure", + "invoice_pending" ] }, { @@ -287,13 +320,17 @@ Updates an Endpoint. You can change the `url` of your endpoint or the list of `w Always send a complete list of events to which you want to subscribe. Sending a PUT request for an existing endpoint with an empty list of `webhook_subscriptions` will unsubscribe all events. -If you want unsubscribe from a specific event, send a list of `webhook_subscriptions` without the specific event key. +If you want to unsubscribe from a specific event, send a list of `webhook_subscriptions` without the specific event key. ```ruby def update_endpoint(endpoint_id, body: nil) ``` +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + ## Parameters | Parameter | Type | Tags | Description | @@ -303,6 +340,8 @@ def update_endpoint(endpoint_id, ## Response Type +**200**: OK + [`EndpointResponse`](../../doc/models/endpoint-response.md) ## Example Usage @@ -316,7 +355,8 @@ body = CreateOrUpdateEndpointRequest.new( webhook_subscriptions: [ WebhookSubscription::PAYMENT_FAILURE, WebhookSubscription::PAYMENT_SUCCESS, - WebhookSubscription::REFUND_FAILURE + WebhookSubscription::REFUND_FAILURE, + WebhookSubscription::INVOICE_PENDING ] ) ) diff --git a/doc/models/activate-event-based-component.md b/doc/models/activate-event-based-component.md index ba7bd02..37ee98f 100644 --- a/doc/models/activate-event-based-component.md +++ b/doc/models/activate-event-based-component.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `price_point_id` | `Integer` | Optional | The Chargify id of the price point | -| `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. This only works for site with Multifrequency enabled. | +| `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | | `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | ## Example (as JSON) diff --git a/doc/models/bank-account-payment-profile.md b/doc/models/bank-account-payment-profile.md index 8bfa60c..68a15e4 100644 --- a/doc/models/bank-account-payment-profile.md +++ b/doc/models/bank-account-payment-profile.md @@ -14,7 +14,7 @@ | `last_name` | `String` | Optional | The last name of the bank account holder | | `customer_id` | `Integer` | Optional | The Chargify-assigned id for the customer record to which the bank account belongs | | `current_vault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | -| `vault_token` | `String` | Optional | The “token” provided by your vault storage for an already stored payment profile | +| `vault_token` | `String` | Optional | The "token" provided by your vault storage for an already stored payment profile | | `billing_address` | `String` | Optional | The current billing street address for the bank account | | `billing_city` | `String` | Optional | The current billing address city for the bank account | | `billing_state` | `String` | Optional | The current billing address state for the bank account | @@ -23,8 +23,8 @@ | `customer_vault_token` | `String` | Optional | (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token. | | `billing_address_2` | `String` | Optional | The current billing street address, second line, for the bank account | | `bank_name` | `String` | Optional | The bank where the account resides | -| `masked_bank_routing_number` | `String` | Optional | A string representation of the stored bank routing number with all but the last 4 digits marked with X’s (i.e. ‘XXXXXXX1111’). payment_type will be bank_account | -| `masked_bank_account_number` | `String` | Required | A string representation of the stored bank account number with all but the last 4 digits marked with X’s (i.e. ‘XXXXXXX1111’) | +| `masked_bank_routing_number` | `String` | Optional | A string representation of the stored bank routing number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account | +| `masked_bank_account_number` | `String` | Optional | A string representation of the stored bank account number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111') | | `bank_account_type` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | | `bank_account_holder_type` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType::BANK_ACCOUNT` | @@ -38,7 +38,6 @@ ```json { - "masked_bank_account_number": "masked_bank_account_number8", "payment_type": "bank_account", "verified": false, "id": 188, diff --git a/doc/models/bank-account-response.md b/doc/models/bank-account-response.md index 6c1a92a..6b72b30 100644 --- a/doc/models/bank-account-response.md +++ b/doc/models/bank-account-response.md @@ -16,7 +16,6 @@ ```json { "payment_profile": { - "masked_bank_account_number": "masked_bank_account_number6", "payment_type": "bank_account", "verified": false, "id": 44, diff --git a/doc/models/billing-schedule.md b/doc/models/billing-schedule.md index e49e2e7..d6cef77 100644 --- a/doc/models/billing-schedule.md +++ b/doc/models/billing-schedule.md @@ -1,7 +1,7 @@ # Billing Schedule -This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. This only works for site with Multifrequency enabled. +Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. ## Structure @@ -11,13 +11,13 @@ This attribute is particularly useful when you need to align billing events for | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `initial_billing_at` | `Date` | Optional | The initial_billing_at attribute in Maxio allows you to specify a custom starting date for billing cycles associated with components that have their own billing frequency set. Only ISO8601 format is supported. | +| `initial_billing_at` | `Date` | Optional | Custom start date (ISO 8601 date, YYYY-MM-DD) for the component's first billing period. If omitted or null, billing aligns with the product schedule. If provided, date must be on or after the minimum allowed date for the subscription or component. | ## Example (as JSON) ```json { - "initial_billing_at": "2024-01-01" + "initial_billing_at": "2026-01-01" } ``` diff --git a/doc/models/containers/allocation-preview-item-previous-quantity.md b/doc/models/containers/allocation-preview-item-previous-quantity.md index 5906213..51dad06 100644 --- a/doc/models/containers/allocation-preview-item-previous-quantity.md +++ b/doc/models/containers/allocation-preview-item-previous-quantity.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/allocation-preview-item-quantity.md b/doc/models/containers/allocation-preview-item-quantity.md index 28cd91d..6e54b67 100644 --- a/doc/models/containers/allocation-preview-item-quantity.md +++ b/doc/models/containers/allocation-preview-item-quantity.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/allocation-previous-quantity.md b/doc/models/containers/allocation-previous-quantity.md index 895ca6b..08048ab 100644 --- a/doc/models/containers/allocation-previous-quantity.md +++ b/doc/models/containers/allocation-previous-quantity.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/allocation-quantity.md b/doc/models/containers/allocation-quantity.md index 1842772..ae4df5a 100644 --- a/doc/models/containers/allocation-quantity.md +++ b/doc/models/containers/allocation-quantity.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/archive-component-price-point-component-id.md b/doc/models/containers/archive-component-price-point-component-id.md index 63eb8d1..e544f58 100644 --- a/doc/models/containers/archive-component-price-point-component-id.md +++ b/doc/models/containers/archive-component-price-point-component-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/archive-component-price-point-price-point-id.md b/doc/models/containers/archive-component-price-point-price-point-id.md index 1afea57..3e36bc7 100644 --- a/doc/models/containers/archive-component-price-point-price-point-id.md +++ b/doc/models/containers/archive-component-price-point-price-point-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/archive-product-price-point-price-point-id.md b/doc/models/containers/archive-product-price-point-price-point-id.md index 7953efc..aa56a43 100644 --- a/doc/models/containers/archive-product-price-point-price-point-id.md +++ b/doc/models/containers/archive-product-price-point-price-point-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/archive-product-price-point-product-id.md b/doc/models/containers/archive-product-price-point-product-id.md index 36cd0a0..197a2c7 100644 --- a/doc/models/containers/archive-product-price-point-product-id.md +++ b/doc/models/containers/archive-product-price-point-product-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/calendar-billing-snap-day.md b/doc/models/containers/calendar-billing-snap-day.md index 6e04756..08b4915 100644 --- a/doc/models/containers/calendar-billing-snap-day.md +++ b/doc/models/containers/calendar-billing-snap-day.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/clone-component-price-point-component-id.md b/doc/models/containers/clone-component-price-point-component-id.md index a7ef7ac..0e001c2 100644 --- a/doc/models/containers/clone-component-price-point-component-id.md +++ b/doc/models/containers/clone-component-price-point-component-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/clone-component-price-point-price-point-id.md b/doc/models/containers/clone-component-price-point-price-point-id.md index 31804e8..c093200 100644 --- a/doc/models/containers/clone-component-price-point-price-point-id.md +++ b/doc/models/containers/clone-component-price-point-price-point-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/component-allocation-change-allocated-quantity.md b/doc/models/containers/component-allocation-change-allocated-quantity.md index 537e19e..b685a04 100644 --- a/doc/models/containers/component-allocation-change-allocated-quantity.md +++ b/doc/models/containers/component-allocation-change-allocated-quantity.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/component-price-point-assignment-price-point.md b/doc/models/containers/component-price-point-assignment-price-point.md index 130ff1f..13eefef 100644 --- a/doc/models/containers/component-price-point-assignment-price-point.md +++ b/doc/models/containers/component-price-point-assignment-price-point.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/coupon-payload-percentage.md b/doc/models/containers/coupon-payload-percentage.md index 8800999..49ebcda 100644 --- a/doc/models/containers/coupon-payload-percentage.md +++ b/doc/models/containers/coupon-payload-percentage.md @@ -12,3 +12,23 @@ | `String` | | `Float` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/create-allocation-price-point-id.md b/doc/models/containers/create-allocation-price-point-id.md index 2cb38cf..1dcd6cd 100644 --- a/doc/models/containers/create-allocation-price-point-id.md +++ b/doc/models/containers/create-allocation-price-point-id.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/create-component-price-point-request-price-point.md b/doc/models/containers/create-component-price-point-request-price-point.md index 1832c26..1d209e2 100644 --- a/doc/models/containers/create-component-price-point-request-price-point.md +++ b/doc/models/containers/create-component-price-point-request-price-point.md @@ -12,3 +12,46 @@ | [`CreateComponentPricePoint`](../../../doc/models/create-component-price-point.md) | | [`CreatePrepaidUsageComponentPricePoint`](../../../doc/models/create-prepaid-usage-component-price-point.md) | +## CreateComponentPricePoint + +### Initialization Code + +#### Example + +```ruby +value = CreateComponentPricePoint.new( + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26 + ) + ], + use_site_exchange_rate: true +) +``` + +## CreatePrepaidUsageComponentPricePoint + +### Initialization Code + +#### Example + +```ruby +value = CreatePrepaidUsageComponentPricePoint.new( + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26 + ) + ], + overage_pricing: OveragePricing.new( + pricing_scheme: PricingScheme::STAIRSTEP + ), + use_site_exchange_rate: true +) +``` + diff --git a/doc/models/containers/create-component-price-points-request-price-points.md b/doc/models/containers/create-component-price-points-request-price-points.md index 6c4e227..0b4ac8d 100644 --- a/doc/models/containers/create-component-price-points-request-price-points.md +++ b/doc/models/containers/create-component-price-points-request-price-points.md @@ -12,3 +12,46 @@ | [`CreateComponentPricePoint`](../../../doc/models/create-component-price-point.md) | | [`CreatePrepaidUsageComponentPricePoint`](../../../doc/models/create-prepaid-usage-component-price-point.md) | +## CreateComponentPricePoint + +### Initialization Code + +#### Example + +```ruby +value = CreateComponentPricePoint.new( + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26 + ) + ], + use_site_exchange_rate: true +) +``` + +## CreatePrepaidUsageComponentPricePoint + +### Initialization Code + +#### Example + +```ruby +value = CreatePrepaidUsageComponentPricePoint.new( + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26 + ) + ], + overage_pricing: OveragePricing.new( + pricing_scheme: PricingScheme::STAIRSTEP + ), + use_site_exchange_rate: true +) +``` + diff --git a/doc/models/containers/create-invoice-coupon-amount.md b/doc/models/containers/create-invoice-coupon-amount.md index 4bffa96..d46270d 100644 --- a/doc/models/containers/create-invoice-coupon-amount.md +++ b/doc/models/containers/create-invoice-coupon-amount.md @@ -12,3 +12,23 @@ | `String` | | `Float` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/create-invoice-coupon-percentage.md b/doc/models/containers/create-invoice-coupon-percentage.md index d783331..6b1682b 100644 --- a/doc/models/containers/create-invoice-coupon-percentage.md +++ b/doc/models/containers/create-invoice-coupon-percentage.md @@ -12,3 +12,23 @@ | `String` | | `Float` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/create-invoice-coupon-product-family-id.md b/doc/models/containers/create-invoice-coupon-product-family-id.md index 31086dc..061b8ec 100644 --- a/doc/models/containers/create-invoice-coupon-product-family-id.md +++ b/doc/models/containers/create-invoice-coupon-product-family-id.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/create-invoice-item-component-id.md b/doc/models/containers/create-invoice-item-component-id.md index 1f14648..dba8fec 100644 --- a/doc/models/containers/create-invoice-item-component-id.md +++ b/doc/models/containers/create-invoice-item-component-id.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/create-invoice-item-price-point-id.md b/doc/models/containers/create-invoice-item-price-point-id.md index 50cc067..ed15477 100644 --- a/doc/models/containers/create-invoice-item-price-point-id.md +++ b/doc/models/containers/create-invoice-item-price-point-id.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/create-invoice-item-product-id.md b/doc/models/containers/create-invoice-item-product-id.md index 084725c..2577ecd 100644 --- a/doc/models/containers/create-invoice-item-product-id.md +++ b/doc/models/containers/create-invoice-item-product-id.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/create-invoice-item-product-price-point-id.md b/doc/models/containers/create-invoice-item-product-price-point-id.md index 382d5bd..7b62c0a 100644 --- a/doc/models/containers/create-invoice-item-product-price-point-id.md +++ b/doc/models/containers/create-invoice-item-product-price-point-id.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/create-invoice-item-quantity.md b/doc/models/containers/create-invoice-item-quantity.md index 8fe8649..3673032 100644 --- a/doc/models/containers/create-invoice-item-quantity.md +++ b/doc/models/containers/create-invoice-item-quantity.md @@ -12,3 +12,23 @@ | `Float` | | `String` | +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/create-invoice-item-unit-price.md b/doc/models/containers/create-invoice-item-unit-price.md index 5477df3..48d060b 100644 --- a/doc/models/containers/create-invoice-item-unit-price.md +++ b/doc/models/containers/create-invoice-item-unit-price.md @@ -12,3 +12,23 @@ | `Float` | | `String` | +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/create-invoice-payment-amount.md b/doc/models/containers/create-invoice-payment-amount.md index a5ce061..cda3157 100644 --- a/doc/models/containers/create-invoice-payment-amount.md +++ b/doc/models/containers/create-invoice-payment-amount.md @@ -12,3 +12,23 @@ | `String` | | `Float` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/create-metafields-request-metafields.md b/doc/models/containers/create-metafields-request-metafields.md index b561ff2..9a7200c 100644 --- a/doc/models/containers/create-metafields-request-metafields.md +++ b/doc/models/containers/create-metafields-request-metafields.md @@ -12,3 +12,39 @@ | [`CreateMetafield`](../../../doc/models/create-metafield.md) | | [`Array[CreateMetafield]`](../../../doc/models/create-metafield.md) | +## CreateMetafield + +### Initialization Code + +#### Example + +```ruby +value = CreateMetafield.new( + name: 'my_field', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE, + public_edit: IncludeOption::EXCLUDE + ), + input_type: MetafieldInput::TEXT, + enum: [ + 'string' + ] +) +``` + +## Array[CreateMetafield] + +### Initialization Code + +#### Example + +```ruby +value = [ + CreateMetafield.new +] +``` + diff --git a/doc/models/containers/create-multi-invoice-payment-amount.md b/doc/models/containers/create-multi-invoice-payment-amount.md index 58387aa..7f90b50 100644 --- a/doc/models/containers/create-multi-invoice-payment-amount.md +++ b/doc/models/containers/create-multi-invoice-payment-amount.md @@ -12,3 +12,23 @@ | `String` | | `Float` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/create-or-update-segment-price-unit-price.md b/doc/models/containers/create-or-update-segment-price-unit-price.md index 42a4da1..e265bed 100644 --- a/doc/models/containers/create-or-update-segment-price-unit-price.md +++ b/doc/models/containers/create-or-update-segment-price-unit-price.md @@ -12,3 +12,23 @@ | `String` | | `Float` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/create-payment-profile-expiration-month.md b/doc/models/containers/create-payment-profile-expiration-month.md index a0ed244..7dfa8de 100644 --- a/doc/models/containers/create-payment-profile-expiration-month.md +++ b/doc/models/containers/create-payment-profile-expiration-month.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/create-payment-profile-expiration-year.md b/doc/models/containers/create-payment-profile-expiration-year.md index 8cb1a89..5035d22 100644 --- a/doc/models/containers/create-payment-profile-expiration-year.md +++ b/doc/models/containers/create-payment-profile-expiration-year.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/create-product-price-point-product-id.md b/doc/models/containers/create-product-price-point-product-id.md index d1f7777..edc31a7 100644 --- a/doc/models/containers/create-product-price-point-product-id.md +++ b/doc/models/containers/create-product-price-point-product-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/create-segment-segment-property-1-value.md b/doc/models/containers/create-segment-segment-property-1-value.md index 2a04b05..8565027 100644 --- a/doc/models/containers/create-segment-segment-property-1-value.md +++ b/doc/models/containers/create-segment-segment-property-1-value.md @@ -14,3 +14,43 @@ | `Integer` | | `TrueClass \| FalseClass` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## TrueClass | FalseClass + +### Initialization Code + +#### Example + +```ruby +value = false +``` + diff --git a/doc/models/containers/create-segment-segment-property-2-value.md b/doc/models/containers/create-segment-segment-property-2-value.md index f183ba4..0fad00f 100644 --- a/doc/models/containers/create-segment-segment-property-2-value.md +++ b/doc/models/containers/create-segment-segment-property-2-value.md @@ -14,3 +14,43 @@ | `Integer` | | `TrueClass \| FalseClass` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## TrueClass | FalseClass + +### Initialization Code + +#### Example + +```ruby +value = false +``` + diff --git a/doc/models/containers/create-segment-segment-property-3-value.md b/doc/models/containers/create-segment-segment-property-3-value.md index c1b86e0..c4a1441 100644 --- a/doc/models/containers/create-segment-segment-property-3-value.md +++ b/doc/models/containers/create-segment-segment-property-3-value.md @@ -14,3 +14,43 @@ | `Integer` | | `TrueClass \| FalseClass` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## TrueClass | FalseClass + +### Initialization Code + +#### Example + +```ruby +value = false +``` + diff --git a/doc/models/containers/create-segment-segment-property-4-value.md b/doc/models/containers/create-segment-segment-property-4-value.md index 5154dbf..3f1ef19 100644 --- a/doc/models/containers/create-segment-segment-property-4-value.md +++ b/doc/models/containers/create-segment-segment-property-4-value.md @@ -14,3 +14,43 @@ | `Integer` | | `TrueClass \| FalseClass` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## TrueClass | FalseClass + +### Initialization Code + +#### Example + +```ruby +value = false +``` + diff --git a/doc/models/containers/create-subscription-component-allocated-quantity.md b/doc/models/containers/create-subscription-component-allocated-quantity.md index eb2dad1..b17fece 100644 --- a/doc/models/containers/create-subscription-component-allocated-quantity.md +++ b/doc/models/containers/create-subscription-component-allocated-quantity.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/create-subscription-component-component-id.md b/doc/models/containers/create-subscription-component-component-id.md index e437249..f627e26 100644 --- a/doc/models/containers/create-subscription-component-component-id.md +++ b/doc/models/containers/create-subscription-component-component-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/create-subscription-component-price-point-id.md b/doc/models/containers/create-subscription-component-price-point-id.md index 4090a71..a794e89 100644 --- a/doc/models/containers/create-subscription-component-price-point-id.md +++ b/doc/models/containers/create-subscription-component-price-point-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/create-subscription-offer-id.md b/doc/models/containers/create-subscription-offer-id.md index 97a38f5..21a180f 100644 --- a/doc/models/containers/create-subscription-offer-id.md +++ b/doc/models/containers/create-subscription-offer-id.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/create-usage-component-id.md b/doc/models/containers/create-usage-component-id.md index 7b2ac58..0c1dbe2 100644 --- a/doc/models/containers/create-usage-component-id.md +++ b/doc/models/containers/create-usage-component-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/create-usage-subscription-id-or-reference.md b/doc/models/containers/create-usage-subscription-id-or-reference.md index 5e3897f..28f9dc7 100644 --- a/doc/models/containers/create-usage-subscription-id-or-reference.md +++ b/doc/models/containers/create-usage-subscription-id-or-reference.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/customer-error-response-errors.md b/doc/models/containers/customer-error-response-errors.md index d528718..f8f6fc5 100644 --- a/doc/models/containers/customer-error-response-errors.md +++ b/doc/models/containers/customer-error-response-errors.md @@ -12,3 +12,25 @@ | [`CustomerError`](../../../doc/models/customer-error.md) | | `Array[String]` | +## CustomerError + +### Initialization Code + +#### Example + +```ruby +value = CustomerError.new +``` + +## Array[String] + +### Initialization Code + +#### Example + +```ruby +value = [ + 'String1' +] +``` + diff --git a/doc/models/containers/deduct-service-credit-amount.md b/doc/models/containers/deduct-service-credit-amount.md index 3bbd3c7..eb1399f 100644 --- a/doc/models/containers/deduct-service-credit-amount.md +++ b/doc/models/containers/deduct-service-credit-amount.md @@ -12,3 +12,23 @@ | `String` | | `Float` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/ebb-component-unit-price.md b/doc/models/containers/ebb-component-unit-price.md index 1c71ccb..1d7cc41 100644 --- a/doc/models/containers/ebb-component-unit-price.md +++ b/doc/models/containers/ebb-component-unit-price.md @@ -12,3 +12,23 @@ | `String` | | `Float` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/event-event-specific-data.md b/doc/models/containers/event-event-specific-data.md index 1fae19f..c3faf72 100644 --- a/doc/models/containers/event-event-specific-data.md +++ b/doc/models/containers/event-event-specific-data.md @@ -28,3 +28,318 @@ | [`ItemPricePointChanged`](../../../doc/models/item-price-point-changed.md) | | [`CustomFieldValueChange`](../../../doc/models/custom-field-value-change.md) | +## SubscriptionProductChange + +### Initialization Code + +#### Example + +```ruby +value = SubscriptionProductChange.new( + previous_product_id: 126, + new_product_id: 12 +) +``` + +## SubscriptionStateChange + +### Initialization Code + +#### Example + +```ruby +value = SubscriptionStateChange.new( + previous_subscription_state: 'previous_subscription_state2', + new_subscription_state: 'new_subscription_state6' +) +``` + +## PaymentRelatedEvents + +### Initialization Code + +#### Example + +```ruby +value = PaymentRelatedEvents.new( + product_id: 42, + account_transaction_id: 58 +) +``` + +## RefundSuccess + +### Initialization Code + +#### Example + +```ruby +value = RefundSuccess.new( + refund_id: 12, + gateway_transaction_id: 182, + product_id: 168 +) +``` + +## ComponentAllocationChange + +### Initialization Code + +#### Example + +```ruby +value = ComponentAllocationChange.new( + previous_allocation: 94, + new_allocation: 102, + component_id: 88, + component_handle: 'component_handle8', + memo: 'memo2', + allocation_id: 158 +) +``` + +## MeteredUsage + +### Initialization Code + +#### Example + +```ruby +value = MeteredUsage.new( + previous_unit_balance: 'previous_unit_balance6', + new_unit_balance: 80, + usage_quantity: 42, + component_id: 4, + component_handle: 'component_handle8', + memo: 'memo2' +) +``` + +## PrepaidUsage + +### Initialization Code + +#### Example + +```ruby +value = PrepaidUsage.new( + previous_unit_balance: 'previous_unit_balance0', + previous_overage_unit_balance: 'previous_overage_unit_balance4', + new_unit_balance: 252, + new_overage_unit_balance: 224, + usage_quantity: 214, + overage_usage_quantity: 106, + component_id: 176, + component_handle: 'component_handle4', + memo: 'memo8', + allocation_details: [ + PrepaidUsageAllocationDetail.new + ] +) +``` + +## DunningStepReached + +### Initialization Code + +#### Example + +```ruby +value = DunningStepReached.new( + dunner: DunnerData.new( + state: 'state8', + subscription_id: 194, + revenue_at_risk_in_cents: 98, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + attempts: 42, + last_attempted_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ), + current_step: DunningStepData.new( + day_threshold: 198, + action: 'action4', + send_email: false, + send_bcc_email: false, + send_sms: false + ), + next_step: DunningStepData.new( + day_threshold: 30, + action: 'action4', + send_email: false, + send_bcc_email: false, + send_sms: false + ) +) +``` + +## InvoiceIssued + +### Initialization Code + +#### Example + +```ruby +value = InvoiceIssued.new( + uid: 'uid4', + number: 'number8', + role: 'role2', + due_date: Date.iso8601('2016-03-13'), + issue_date: 'issue_date0', + paid_date: 'paid_date6', + due_amount: 'due_amount6', + paid_amount: 'paid_amount4', + tax_amount: 'tax_amount2', + refund_amount: 'refund_amount0', + total_amount: 'total_amount0', + status_amount: 'status_amount4', + product_name: 'product_name0', + consolidation_level: 'consolidation_level4', + line_items: [ + InvoiceLineItemEventData.new + ] +) +``` + +## PendingCancellationChange + +### Initialization Code + +#### Example + +```ruby +value = PendingCancellationChange.new( + cancellation_state: 'cancellation_state8', + cancels_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) +``` + +## PrepaidSubscriptionBalanceChanged + +### Initialization Code + +#### Example + +```ruby +value = PrepaidSubscriptionBalanceChanged.new( + reason: 'reason8', + current_account_balance_in_cents: 250, + prepayment_account_balance_in_cents: 44, + current_usage_amount_in_cents: 242 +) +``` + +## ProformaInvoiceIssued + +### Initialization Code + +#### Example + +```ruby +value = ProformaInvoiceIssued.new( + uid: 'uid0', + number: 'number2', + role: 'role6', + delivery_date: Date.iso8601('2016-03-13'), + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + due_amount: 'due_amount2', + paid_amount: 'paid_amount8', + tax_amount: 'tax_amount6', + total_amount: 'total_amount6', + product_name: 'product_name6', + line_items: [ + InvoiceLineItemEventData.new + ] +) +``` + +## SubscriptionGroupSignupEventData + +### Initialization Code + +#### Example + +```ruby +value = SubscriptionGroupSignupEventData.new( + subscription_group: SubscriptionGroupSignupFailureData.new, + customer: Customer.new +) +``` + +## CreditAccountBalanceChanged + +### Initialization Code + +#### Example + +```ruby +value = CreditAccountBalanceChanged.new( + reason: 'reason8', + service_credit_account_balance_in_cents: 10, + service_credit_balance_change_in_cents: 116, + currency_code: 'currency_code8', + at_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) +``` + +## PrepaymentAccountBalanceChanged + +### Initialization Code + +#### Example + +```ruby +value = PrepaymentAccountBalanceChanged.new( + reason: 'reason4', + prepayment_account_balance_in_cents: 182, + prepayment_balance_change_in_cents: 206, + currency_code: 'currency_code4' +) +``` + +## PaymentCollectionMethodChanged + +### Initialization Code + +#### Example + +```ruby +value = PaymentCollectionMethodChanged.new( + previous_value: 'previous_value4', + current_value: 'current_value2' +) +``` + +## ItemPricePointChanged + +### Initialization Code + +#### Example + +```ruby +value = ItemPricePointChanged.new( + item_id: 66, + item_type: 'item_type6', + item_handle: 'item_handle4', + item_name: 'item_name8', + previous_price_point: ItemPricePointData.new, + current_price_point: ItemPricePointData.new +) +``` + +## CustomFieldValueChange + +### Initialization Code + +#### Example + +```ruby +value = CustomFieldValueChange.new( + event_type: 'event_type2', + metafield_name: 'metafield_name6', + metafield_id: 78, + old_value: 'old_value2', + new_value: 'new_value8', + resource_type: 'resource_type2', + resource_id: 74 +) +``` + diff --git a/doc/models/containers/invoice-event-payment.md b/doc/models/containers/invoice-event-payment.md index 339d419..30148bb 100644 --- a/doc/models/containers/invoice-event-payment.md +++ b/doc/models/containers/invoice-event-payment.md @@ -1,6 +1,8 @@ # Invoice-Event-Payment +A nested data structure detailing the method of payment + ## Data Type `PaymentMethodApplePay | PaymentMethodBankAccount | PaymentMethodCreditCard | PaymentMethodExternal | PaymentMethodPaypal` @@ -15,3 +17,71 @@ | [`PaymentMethodExternal`](../../../doc/models/payment-method-external.md) | | [`PaymentMethodPaypal`](../../../doc/models/payment-method-paypal.md) | +## PaymentMethodApplePay + +### Initialization Code + +#### Example + +```ruby +value = PaymentMethodApplePay.new( + type: InvoiceEventPaymentMethod::APPLE_PAY +) +``` + +## PaymentMethodBankAccount + +### Initialization Code + +#### Example + +```ruby +value = PaymentMethodBankAccount.new( + masked_account_number: 'masked_account_number2', + masked_routing_number: 'masked_routing_number2', + type: InvoiceEventPaymentMethod::BANK_ACCOUNT +) +``` + +## PaymentMethodCreditCard + +### Initialization Code + +#### Example + +```ruby +value = PaymentMethodCreditCard.new( + card_brand: 'card_brand4', + masked_card_number: 'masked_card_number0', + type: InvoiceEventPaymentMethod::CREDIT_CARD +) +``` + +## PaymentMethodExternal + +### Initialization Code + +#### Example + +```ruby +value = PaymentMethodExternal.new( + details: 'details4', + kind: 'kind2', + memo: 'memo8', + type: InvoiceEventPaymentMethod::EXTERNAL +) +``` + +## PaymentMethodPaypal + +### Initialization Code + +#### Example + +```ruby +value = PaymentMethodPaypal.new( + email: 'email2', + type: InvoiceEventPaymentMethod::PAYPAL_ACCOUNT +) +``` + diff --git a/doc/models/containers/invoice-event.md b/doc/models/containers/invoice-event.md index 94c8fa4..0c62727 100644 --- a/doc/models/containers/invoice-event.md +++ b/doc/models/containers/invoice-event.md @@ -25,3 +25,390 @@ | [`VoidInvoiceEvent`](../../../doc/models/void-invoice-event.md) | | [`VoidRemainderEvent`](../../../doc/models/void-remainder-event.md) | +## ApplyCreditNoteEvent + +### Initialization Code + +#### Example + +```ruby +value = ApplyCreditNoteEvent.new( + id: 214, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::APPLY_CREDIT_NOTE, + event_data: ApplyCreditNoteEventData.new( + uid: 'uid6', + credit_note_number: 'credit_note_number0', + credit_note_uid: 'credit_note_uid0', + original_amount: 'original_amount0', + applied_amount: 'applied_amount2' + ) +) +``` + +## ApplyDebitNoteEvent + +### Initialization Code + +#### Example + +```ruby +value = ApplyDebitNoteEvent.new( + id: 164, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::APPLY_DEBIT_NOTE, + event_data: ApplyDebitNoteEventData.new( + debit_note_number: 'debit_note_number6', + debit_note_uid: 'debit_note_uid2', + original_amount: 'original_amount0', + applied_amount: 'applied_amount2' + ) +) +``` + +## ApplyPaymentEvent + +### Initialization Code + +#### Example + +```ruby +value = ApplyPaymentEvent.new( + id: 234, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::APPLY_PAYMENT, + event_data: ApplyPaymentEventData.new( + consolidation_level: InvoiceConsolidationLevel::CHILD, + memo: 'memo0', + original_amount: 'original_amount0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + payment_method: PaymentMethodApplePay.new( + type: InvoiceEventPaymentMethod::APPLE_PAY + ) + ) +) +``` + +## BackportInvoiceEvent + +### Initialization Code + +#### Example + +```ruby +value = BackportInvoiceEvent.new( + id: 78, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::BACKPORT_INVOICE, + event_data: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ) +) +``` + +## ChangeChargebackStatusEvent + +### Initialization Code + +#### Example + +```ruby +value = ChangeChargebackStatusEvent.new( + id: 214, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CHANGE_CHARGEBACK_STATUS, + event_data: ChangeChargebackStatusEventData.new( + chargeback_status: ChargebackStatus::WON + ) +) +``` + +## ChangeInvoiceCollectionMethodEvent + +### Initialization Code + +#### Example + +```ruby +value = ChangeInvoiceCollectionMethodEvent.new( + id: 246, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CHANGE_INVOICE_COLLECTION_METHOD, + event_data: ChangeInvoiceCollectionMethodEventData.new( + from_collection_method: 'from_collection_method4', + to_collection_method: 'to_collection_method8' + ) +) +``` + +## ChangeInvoiceStatusEvent + +### Initialization Code + +#### Example + +```ruby +value = ChangeInvoiceStatusEvent.new( + id: 92, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CHANGE_INVOICE_STATUS, + event_data: ChangeInvoiceStatusEventData.new( + from_status: InvoiceStatus::OPEN, + to_status: InvoiceStatus::PENDING + ) +) +``` + +## CreateCreditNoteEvent + +### Initialization Code + +#### Example + +```ruby +value = CreateCreditNoteEvent.new( + id: 28, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CREATE_CREDIT_NOTE, + event_data: CreditNote.new +) +``` + +## CreateDebitNoteEvent + +### Initialization Code + +#### Example + +```ruby +value = CreateDebitNoteEvent.new( + id: 98, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CREATE_DEBIT_NOTE, + event_data: DebitNote.new +) +``` + +## FailedPaymentEvent + +### Initialization Code + +#### Example + +```ruby +value = FailedPaymentEvent.new( + id: 120, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::FAILED_PAYMENT, + event_data: FailedPaymentEventData.new( + amount_in_cents: 220, + applied_amount: 194, + payment_method: InvoicePaymentMethodType::CASH, + transaction_id: 78 + ) +) +``` + +## IssueInvoiceEvent + +### Initialization Code + +#### Example + +```ruby +value = IssueInvoiceEvent.new( + id: 130, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::ISSUE_INVOICE, + event_data: IssueInvoiceEventData.new( + consolidation_level: InvoiceConsolidationLevel::CHILD, + from_status: InvoiceStatus::OPEN, + to_status: InvoiceStatus::PENDING, + due_amount: 'due_amount8', + total_amount: 'total_amount2' + ) +) +``` + +## RefundInvoiceEvent + +### Initialization Code + +#### Example + +```ruby +value = RefundInvoiceEvent.new( + id: 54, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::REFUND_INVOICE, + event_data: RefundInvoiceEventData.new( + apply_credit: false, + credit_note_attributes: CreditNote.new, + payment_id: 204, + refund_amount: 'refund_amount8', + refund_id: 248, + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) +``` + +## RemovePaymentEvent + +### Initialization Code + +#### Example + +```ruby +value = RemovePaymentEvent.new( + id: 236, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::REMOVE_PAYMENT, + event_data: RemovePaymentEventData.new( + transaction_id: 78, + memo: 'memo0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + payment_method: PaymentMethodApplePay.new( + type: InvoiceEventPaymentMethod::APPLE_PAY + ), + prepayment: false + ) +) +``` + +## VoidInvoiceEvent + +### Initialization Code + +#### Example + +```ruby +value = VoidInvoiceEvent.new( + id: 16, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::VOID_INVOICE, + event_data: VoidInvoiceEventData.new( + credit_note_attributes: CreditNote.new, + memo: 'memo0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + is_advance_invoice: false, + reason: 'reason2' + ) +) +``` + +## VoidRemainderEvent + +### Initialization Code + +#### Example + +```ruby +value = VoidRemainderEvent.new( + id: 128, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::VOID_REMAINDER, + event_data: VoidRemainderEventData.new( + credit_note_attributes: CreditNote.new, + memo: 'memo0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) +``` + diff --git a/doc/models/containers/issue-service-credit-amount.md b/doc/models/containers/issue-service-credit-amount.md index b206f36..e32ee9f 100644 --- a/doc/models/containers/issue-service-credit-amount.md +++ b/doc/models/containers/issue-service-credit-amount.md @@ -12,3 +12,23 @@ | `Float` | | `String` | +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/list-product-price-points-input-product-id.md b/doc/models/containers/list-product-price-points-input-product-id.md index 7c12a17..d423969 100644 --- a/doc/models/containers/list-product-price-points-input-product-id.md +++ b/doc/models/containers/list-product-price-points-input-product-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/list-usages-input-component-id.md b/doc/models/containers/list-usages-input-component-id.md index b3b5364..37cad7c 100644 --- a/doc/models/containers/list-usages-input-component-id.md +++ b/doc/models/containers/list-usages-input-component-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/list-usages-input-subscription-id-or-reference.md b/doc/models/containers/list-usages-input-subscription-id-or-reference.md index 704961c..ad12a16 100644 --- a/doc/models/containers/list-usages-input-subscription-id-or-reference.md +++ b/doc/models/containers/list-usages-input-subscription-id-or-reference.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/metafield-enum.md b/doc/models/containers/metafield-enum.md index 855b51a..d91b457 100644 --- a/doc/models/containers/metafield-enum.md +++ b/doc/models/containers/metafield-enum.md @@ -12,3 +12,25 @@ | `String` | | `Array[String]` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Array[String] + +### Initialization Code + +#### Example + +```ruby +value = [ + 'String1' +] +``` + diff --git a/doc/models/containers/metered-component-unit-price.md b/doc/models/containers/metered-component-unit-price.md index 4ce635a..46e6c59 100644 --- a/doc/models/containers/metered-component-unit-price.md +++ b/doc/models/containers/metered-component-unit-price.md @@ -12,3 +12,23 @@ | `String` | | `Float` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/on-off-component-unit-price.md b/doc/models/containers/on-off-component-unit-price.md index 35b367c..2cf9f99 100644 --- a/doc/models/containers/on-off-component-unit-price.md +++ b/doc/models/containers/on-off-component-unit-price.md @@ -12,3 +12,23 @@ | `String` | | `Float` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/payment-profile-attributes-expiration-month.md b/doc/models/containers/payment-profile-attributes-expiration-month.md index 79f25a2..f47486f 100644 --- a/doc/models/containers/payment-profile-attributes-expiration-month.md +++ b/doc/models/containers/payment-profile-attributes-expiration-month.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/payment-profile-attributes-expiration-year.md b/doc/models/containers/payment-profile-attributes-expiration-year.md index c9fef2c..08ea490 100644 --- a/doc/models/containers/payment-profile-attributes-expiration-year.md +++ b/doc/models/containers/payment-profile-attributes-expiration-year.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/payment-profile.md b/doc/models/containers/payment-profile.md index 797ccec..a6e1290 100644 --- a/doc/models/containers/payment-profile.md +++ b/doc/models/containers/payment-profile.md @@ -14,3 +14,71 @@ | [`CreditCardPaymentProfile`](../../../doc/models/credit-card-payment-profile.md) | | [`PaypalPaymentProfile`](../../../doc/models/paypal-payment-profile.md) | +## ApplePayPaymentProfile + +### Initialization Code + +#### Example + +```ruby +value = ApplePayPaymentProfile.new( + payment_type: PaymentType::APPLE_PAY +) +``` + +## BankAccountPaymentProfile + +### Initialization Code + +#### Example + +```ruby +value = BankAccountPaymentProfile.new( + payment_type: PaymentType::BANK_ACCOUNT, + verified: false +) +``` + +## CreditCardPaymentProfile + +### Initialization Code + +#### Example + +```ruby +value = CreditCardPaymentProfile.new( + payment_type: PaymentType::CREDIT_CARD, + id: 10088716, + first_name: 'Test', + last_name: 'Subscription', + masked_card_number: 'XXXX-XXXX-XXXX-1', + card_type: CardType::BOGUS, + expiration_month: 1, + expiration_year: 2022, + customer_id: 14543792, + current_vault: CreditCardVault::BOGUS, + vault_token: '1', + billing_address: '123 Montana Way', + billing_city: 'Billings', + billing_state: 'MT', + billing_zip: '59101', + billing_country: 'US', + customer_vault_token: 'customer_vault_token2', + billing_address_2: '', + site_gateway_setting_id: 1, + gateway_handle: 'gateway_handle8' +) +``` + +## PaypalPaymentProfile + +### Initialization Code + +#### Example + +```ruby +value = PaypalPaymentProfile.new( + payment_type: PaymentType::PAYPAL_ACCOUNT +) +``` + diff --git a/doc/models/containers/prepaid-usage-component-unit-price.md b/doc/models/containers/prepaid-usage-component-unit-price.md index d2a25ac..030e1a8 100644 --- a/doc/models/containers/prepaid-usage-component-unit-price.md +++ b/doc/models/containers/prepaid-usage-component-unit-price.md @@ -12,3 +12,23 @@ | `String` | | `Float` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/price-ending-quantity.md b/doc/models/containers/price-ending-quantity.md index 0e33c87..bb105e8 100644 --- a/doc/models/containers/price-ending-quantity.md +++ b/doc/models/containers/price-ending-quantity.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/price-starting-quantity.md b/doc/models/containers/price-starting-quantity.md index aa4d32c..d015304 100644 --- a/doc/models/containers/price-starting-quantity.md +++ b/doc/models/containers/price-starting-quantity.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/price-unit-price.md b/doc/models/containers/price-unit-price.md index 6170c75..6aa137a 100644 --- a/doc/models/containers/price-unit-price.md +++ b/doc/models/containers/price-unit-price.md @@ -12,3 +12,23 @@ | `Float` | | `String` | +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/quantity-based-component-unit-price.md b/doc/models/containers/quantity-based-component-unit-price.md index f9ac2f3..bfa4203 100644 --- a/doc/models/containers/quantity-based-component-unit-price.md +++ b/doc/models/containers/quantity-based-component-unit-price.md @@ -12,3 +12,23 @@ | `String` | | `Float` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/reactivate-subscription-request-resume.md b/doc/models/containers/reactivate-subscription-request-resume.md index fb43ef5..cb2945b 100644 --- a/doc/models/containers/reactivate-subscription-request-resume.md +++ b/doc/models/containers/reactivate-subscription-request-resume.md @@ -12,3 +12,23 @@ | `TrueClass \| FalseClass` | | [`ResumeOptions`](../../../doc/models/resume-options.md) | +## TrueClass | FalseClass + +### Initialization Code + +#### Example + +```ruby +value = false +``` + +## ResumeOptions + +### Initialization Code + +#### Example + +```ruby +value = ResumeOptions.new +``` + diff --git a/doc/models/containers/read-component-price-point-component-id.md b/doc/models/containers/read-component-price-point-component-id.md index 472686c..8280c6e 100644 --- a/doc/models/containers/read-component-price-point-component-id.md +++ b/doc/models/containers/read-component-price-point-component-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/read-component-price-point-price-point-id.md b/doc/models/containers/read-component-price-point-price-point-id.md index 6e257ba..a202fdd 100644 --- a/doc/models/containers/read-component-price-point-price-point-id.md +++ b/doc/models/containers/read-component-price-point-price-point-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/read-product-price-point-price-point-id.md b/doc/models/containers/read-product-price-point-price-point-id.md index f97fddc..2938386 100644 --- a/doc/models/containers/read-product-price-point-price-point-id.md +++ b/doc/models/containers/read-product-price-point-price-point-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/read-product-price-point-product-id.md b/doc/models/containers/read-product-price-point-product-id.md index 9ba8cbe..73a5bfc 100644 --- a/doc/models/containers/read-product-price-point-product-id.md +++ b/doc/models/containers/read-product-price-point-product-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/refund-consolidated-invoice-segment-uids.md b/doc/models/containers/refund-consolidated-invoice-segment-uids.md index b7011da..e37acec 100644 --- a/doc/models/containers/refund-consolidated-invoice-segment-uids.md +++ b/doc/models/containers/refund-consolidated-invoice-segment-uids.md @@ -12,3 +12,25 @@ | `Array[String]` | | `String` | +## Array[String] + +### Initialization Code + +#### Example + +```ruby +value = [ + 'String1' +] +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/refund-invoice-request-refund.md b/doc/models/containers/refund-invoice-request-refund.md index 9cb056d..d1518cb 100644 --- a/doc/models/containers/refund-invoice-request-refund.md +++ b/doc/models/containers/refund-invoice-request-refund.md @@ -12,3 +12,34 @@ | [`RefundInvoice`](../../../doc/models/refund-invoice.md) | | [`RefundConsolidatedInvoice`](../../../doc/models/refund-consolidated-invoice.md) | +## RefundInvoice + +### Initialization Code + +#### Example + +```ruby +value = RefundInvoice.new( + amount: 'amount8', + memo: 'memo0', + payment_id: 0 +) +``` + +## RefundConsolidatedInvoice + +### Initialization Code + +#### Example + +```ruby +value = RefundConsolidatedInvoice.new( + memo: 'memo0', + payment_id: 46, + segment_uids: [ + 'String0', + 'String1' + ] +) +``` + diff --git a/doc/models/containers/refund-prepayment-amount.md b/doc/models/containers/refund-prepayment-amount.md index 5cca82c..ee24960 100644 --- a/doc/models/containers/refund-prepayment-amount.md +++ b/doc/models/containers/refund-prepayment-amount.md @@ -12,3 +12,23 @@ | `String` | | `Float` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/renewal-preview-component-component-id.md b/doc/models/containers/renewal-preview-component-component-id.md index c080bb5..6bbe14e 100644 --- a/doc/models/containers/renewal-preview-component-component-id.md +++ b/doc/models/containers/renewal-preview-component-component-id.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/renewal-preview-component-price-point-id.md b/doc/models/containers/renewal-preview-component-price-point-id.md index 8771e05..416d870 100644 --- a/doc/models/containers/renewal-preview-component-price-point-id.md +++ b/doc/models/containers/renewal-preview-component-price-point-id.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/scheduled-renewal-configuration-item-request-renewal-configuration-item.md b/doc/models/containers/scheduled-renewal-configuration-item-request-renewal-configuration-item.md index 8810848..96da55c 100644 --- a/doc/models/containers/scheduled-renewal-configuration-item-request-renewal-configuration-item.md +++ b/doc/models/containers/scheduled-renewal-configuration-item-request-renewal-configuration-item.md @@ -12,3 +12,29 @@ | [`ScheduledRenewalItemRequestBodyComponent`](../../../doc/models/scheduled-renewal-item-request-body-component.md) | | [`ScheduledRenewalItemRequestBodyProduct`](../../../doc/models/scheduled-renewal-item-request-body-product.md) | +## ScheduledRenewalItemRequestBodyComponent + +### Initialization Code + +#### Example + +```ruby +value = ScheduledRenewalItemRequestBodyComponent.new( + item_type: 'Component', + item_id: 108 +) +``` + +## ScheduledRenewalItemRequestBodyProduct + +### Initialization Code + +#### Example + +```ruby +value = ScheduledRenewalItemRequestBodyProduct.new( + item_type: 'Product', + item_id: 32 +) +``` + diff --git a/doc/models/containers/scheduled-renewal-product-price-point-interval.md b/doc/models/containers/scheduled-renewal-product-price-point-interval.md index a067375..a5b6e4d 100644 --- a/doc/models/containers/scheduled-renewal-product-price-point-interval.md +++ b/doc/models/containers/scheduled-renewal-product-price-point-interval.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/scheduled-renewal-product-price-point-price-in-cents.md b/doc/models/containers/scheduled-renewal-product-price-point-price-in-cents.md index 59a0156..c7b6571 100644 --- a/doc/models/containers/scheduled-renewal-product-price-point-price-in-cents.md +++ b/doc/models/containers/scheduled-renewal-product-price-point-price-in-cents.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/scheduled-renewal-update-request-renewal-configuration-item.md b/doc/models/containers/scheduled-renewal-update-request-renewal-configuration-item.md index b6d6cce..1bbe7e4 100644 --- a/doc/models/containers/scheduled-renewal-update-request-renewal-configuration-item.md +++ b/doc/models/containers/scheduled-renewal-update-request-renewal-configuration-item.md @@ -12,3 +12,29 @@ | [`ScheduledRenewalItemRequestBodyComponent`](../../../doc/models/scheduled-renewal-item-request-body-component.md) | | [`ScheduledRenewalItemRequestBodyProduct`](../../../doc/models/scheduled-renewal-item-request-body-product.md) | +## ScheduledRenewalItemRequestBodyComponent + +### Initialization Code + +#### Example + +```ruby +value = ScheduledRenewalItemRequestBodyComponent.new( + item_type: 'Component', + item_id: 108 +) +``` + +## ScheduledRenewalItemRequestBodyProduct + +### Initialization Code + +#### Example + +```ruby +value = ScheduledRenewalItemRequestBodyProduct.new( + item_type: 'Product', + item_id: 32 +) +``` + diff --git a/doc/models/containers/segment-segment-property-1-value.md b/doc/models/containers/segment-segment-property-1-value.md index 33d6768..d647784 100644 --- a/doc/models/containers/segment-segment-property-1-value.md +++ b/doc/models/containers/segment-segment-property-1-value.md @@ -14,3 +14,43 @@ | `Integer` | | `TrueClass \| FalseClass` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## TrueClass | FalseClass + +### Initialization Code + +#### Example + +```ruby +value = false +``` + diff --git a/doc/models/containers/segment-segment-property-2-value.md b/doc/models/containers/segment-segment-property-2-value.md index faa56f5..0e64f50 100644 --- a/doc/models/containers/segment-segment-property-2-value.md +++ b/doc/models/containers/segment-segment-property-2-value.md @@ -14,3 +14,43 @@ | `Integer` | | `TrueClass \| FalseClass` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## TrueClass | FalseClass + +### Initialization Code + +#### Example + +```ruby +value = false +``` + diff --git a/doc/models/containers/segment-segment-property-3-value.md b/doc/models/containers/segment-segment-property-3-value.md index a44ab68..5f14eed 100644 --- a/doc/models/containers/segment-segment-property-3-value.md +++ b/doc/models/containers/segment-segment-property-3-value.md @@ -14,3 +14,43 @@ | `Integer` | | `TrueClass \| FalseClass` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## TrueClass | FalseClass + +### Initialization Code + +#### Example + +```ruby +value = false +``` + diff --git a/doc/models/containers/segment-segment-property-4-value.md b/doc/models/containers/segment-segment-property-4-value.md index af8b329..74126b2 100644 --- a/doc/models/containers/segment-segment-property-4-value.md +++ b/doc/models/containers/segment-segment-property-4-value.md @@ -14,3 +14,43 @@ | `Integer` | | `TrueClass \| FalseClass` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## TrueClass | FalseClass + +### Initialization Code + +#### Example + +```ruby +value = false +``` + diff --git a/doc/models/containers/subscription-component-allocated-quantity.md b/doc/models/containers/subscription-component-allocated-quantity.md index 11f9592..cbc38a3 100644 --- a/doc/models/containers/subscription-component-allocated-quantity.md +++ b/doc/models/containers/subscription-component-allocated-quantity.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/subscription-custom-price-expiration-interval.md b/doc/models/containers/subscription-custom-price-expiration-interval.md index df197b9..8e0b05c 100644 --- a/doc/models/containers/subscription-custom-price-expiration-interval.md +++ b/doc/models/containers/subscription-custom-price-expiration-interval.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/subscription-custom-price-initial-charge-in-cents.md b/doc/models/containers/subscription-custom-price-initial-charge-in-cents.md index 610258f..cb56b78 100644 --- a/doc/models/containers/subscription-custom-price-initial-charge-in-cents.md +++ b/doc/models/containers/subscription-custom-price-initial-charge-in-cents.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/subscription-custom-price-interval.md b/doc/models/containers/subscription-custom-price-interval.md index 1a20310..dcd5001 100644 --- a/doc/models/containers/subscription-custom-price-interval.md +++ b/doc/models/containers/subscription-custom-price-interval.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/subscription-custom-price-price-in-cents.md b/doc/models/containers/subscription-custom-price-price-in-cents.md index eb73495..75e9769 100644 --- a/doc/models/containers/subscription-custom-price-price-in-cents.md +++ b/doc/models/containers/subscription-custom-price-price-in-cents.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/subscription-custom-price-trial-interval.md b/doc/models/containers/subscription-custom-price-trial-interval.md index 60bafdd..af3b9d2 100644 --- a/doc/models/containers/subscription-custom-price-trial-interval.md +++ b/doc/models/containers/subscription-custom-price-trial-interval.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/subscription-custom-price-trial-price-in-cents.md b/doc/models/containers/subscription-custom-price-trial-price-in-cents.md index ea48954..38732b5 100644 --- a/doc/models/containers/subscription-custom-price-trial-price-in-cents.md +++ b/doc/models/containers/subscription-custom-price-trial-price-in-cents.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/subscription-group-create-error-response-errors.md b/doc/models/containers/subscription-group-create-error-response-errors.md index 4048cdf..e232fd4 100644 --- a/doc/models/containers/subscription-group-create-error-response-errors.md +++ b/doc/models/containers/subscription-group-create-error-response-errors.md @@ -13,3 +13,39 @@ | [`SubscriptionGroupSingleError`](../../../doc/models/subscription-group-single-error.md) | | `String` | +## SubscriptionGroupMembersArrayError + +### Initialization Code + +#### Example + +```ruby +value = SubscriptionGroupMembersArrayError.new( + members: [ + 'members6' + ] +) +``` + +## SubscriptionGroupSingleError + +### Initialization Code + +#### Example + +```ruby +value = SubscriptionGroupSingleError.new( + subscription_group: 'subscription_group2' +) +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/subscription-group-credit-card-expiration-month.md b/doc/models/containers/subscription-group-credit-card-expiration-month.md index dd6577e..ffccc6b 100644 --- a/doc/models/containers/subscription-group-credit-card-expiration-month.md +++ b/doc/models/containers/subscription-group-credit-card-expiration-month.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/subscription-group-credit-card-expiration-year.md b/doc/models/containers/subscription-group-credit-card-expiration-year.md index d9d4568..471e948 100644 --- a/doc/models/containers/subscription-group-credit-card-expiration-year.md +++ b/doc/models/containers/subscription-group-credit-card-expiration-year.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/subscription-group-credit-card-full-number.md b/doc/models/containers/subscription-group-credit-card-full-number.md index ff811c5..89494d3 100644 --- a/doc/models/containers/subscription-group-credit-card-full-number.md +++ b/doc/models/containers/subscription-group-credit-card-full-number.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/subscription-group-signup-component-allocated-quantity.md b/doc/models/containers/subscription-group-signup-component-allocated-quantity.md index 7de7e42..9d22f3e 100644 --- a/doc/models/containers/subscription-group-signup-component-allocated-quantity.md +++ b/doc/models/containers/subscription-group-signup-component-allocated-quantity.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/subscription-group-signup-component-component-id.md b/doc/models/containers/subscription-group-signup-component-component-id.md index ac4afe9..ff26c65 100644 --- a/doc/models/containers/subscription-group-signup-component-component-id.md +++ b/doc/models/containers/subscription-group-signup-component-component-id.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/subscription-group-signup-component-price-point-id.md b/doc/models/containers/subscription-group-signup-component-price-point-id.md index 4678893..5830e08 100644 --- a/doc/models/containers/subscription-group-signup-component-price-point-id.md +++ b/doc/models/containers/subscription-group-signup-component-price-point-id.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/subscription-group-signup-component-unit-balance.md b/doc/models/containers/subscription-group-signup-component-unit-balance.md index 125c563..ffda551 100644 --- a/doc/models/containers/subscription-group-signup-component-unit-balance.md +++ b/doc/models/containers/subscription-group-signup-component-unit-balance.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/update-component-price-point-component-id.md b/doc/models/containers/update-component-price-point-component-id.md index 3f71cd9..e370fa8 100644 --- a/doc/models/containers/update-component-price-point-component-id.md +++ b/doc/models/containers/update-component-price-point-component-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/update-component-price-point-price-point-id.md b/doc/models/containers/update-component-price-point-price-point-id.md index 3c256ca..2608d3a 100644 --- a/doc/models/containers/update-component-price-point-price-point-id.md +++ b/doc/models/containers/update-component-price-point-price-point-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/update-metafields-request-metafields.md b/doc/models/containers/update-metafields-request-metafields.md index ed76f85..3a222b2 100644 --- a/doc/models/containers/update-metafields-request-metafields.md +++ b/doc/models/containers/update-metafields-request-metafields.md @@ -12,3 +12,25 @@ | [`UpdateMetafield`](../../../doc/models/update-metafield.md) | | [`Array[UpdateMetafield]`](../../../doc/models/update-metafield.md) | +## UpdateMetafield + +### Initialization Code + +#### Example + +```ruby +value = UpdateMetafield.new +``` + +## Array[UpdateMetafield] + +### Initialization Code + +#### Example + +```ruby +value = [ + UpdateMetafield.new +] +``` + diff --git a/doc/models/containers/update-price-ending-quantity.md b/doc/models/containers/update-price-ending-quantity.md index b6d923e..1349d3f 100644 --- a/doc/models/containers/update-price-ending-quantity.md +++ b/doc/models/containers/update-price-ending-quantity.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/update-price-starting-quantity.md b/doc/models/containers/update-price-starting-quantity.md index 41716f4..b6310fe 100644 --- a/doc/models/containers/update-price-starting-quantity.md +++ b/doc/models/containers/update-price-starting-quantity.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/update-price-unit-price.md b/doc/models/containers/update-price-unit-price.md index b58b2bf..3b2eafc 100644 --- a/doc/models/containers/update-price-unit-price.md +++ b/doc/models/containers/update-price-unit-price.md @@ -12,3 +12,23 @@ | `Float` | | `String` | +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/update-product-price-point-price-point-id.md b/doc/models/containers/update-product-price-point-price-point-id.md index afa5dd7..3b37a4a 100644 --- a/doc/models/containers/update-product-price-point-price-point-id.md +++ b/doc/models/containers/update-product-price-point-price-point-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/update-product-price-point-product-id.md b/doc/models/containers/update-product-price-point-product-id.md index 11a08dd..ce04ac5 100644 --- a/doc/models/containers/update-product-price-point-product-id.md +++ b/doc/models/containers/update-product-price-point-product-id.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/update-subscription-net-terms.md b/doc/models/containers/update-subscription-net-terms.md index 03d198b..01d07b9 100644 --- a/doc/models/containers/update-subscription-net-terms.md +++ b/doc/models/containers/update-subscription-net-terms.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/update-subscription-snap-day.md b/doc/models/containers/update-subscription-snap-day.md index dd4d7fd..e5a99bc 100644 --- a/doc/models/containers/update-subscription-snap-day.md +++ b/doc/models/containers/update-subscription-snap-day.md @@ -12,3 +12,23 @@ | `String` | | `Integer` | +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/usage-quantity.md b/doc/models/containers/usage-quantity.md index b6f395e..a0d0aaa 100644 --- a/doc/models/containers/usage-quantity.md +++ b/doc/models/containers/usage-quantity.md @@ -12,3 +12,23 @@ | `Integer` | | `String` | +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/create-allocation.md b/doc/models/create-allocation.md index d386fb2..8c093e5 100644 --- a/doc/models/create-allocation.md +++ b/doc/models/create-allocation.md @@ -22,7 +22,7 @@ | `accrue_charge` | `TrueClass \| FalseClass` | Optional | "If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately.

`true` - Attempt to charge the customer at the next renewal.

`false` - Attempt to charge the customer right away. If it fails, the charge will be accrued until the next renewal.

Defaults to the site setting if unspecified in the request. | | `initiate_dunning` | `TrueClass \| FalseClass` | Optional | If set to true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. Defaults to false. | | `price_point_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | -| `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. This only works for site with Multifrequency enabled. | +| `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | | `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | ## Example (as JSON) diff --git a/doc/models/create-invoice.md b/doc/models/create-invoice.md index 0613f2b..457d3cc 100644 --- a/doc/models/create-invoice.md +++ b/doc/models/create-invoice.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `line_items` | [`Array[CreateInvoiceItem]`](../../doc/models/create-invoice-item.md) | Optional | - | -| `issue_date` | `Date` | Optional | - | +| `issue_date` | `Date` | Optional | Date on which the invoice will be issued (format YYYY-MM-DD). This date is interpreted and validated in your site's time zone. It must be today or a date in the past — future dates are not accepted. If omitted, defaults to today in your site's time zone. | | `net_terms` | `Integer` | Optional | By default, invoices will be created with a due date matching the date of invoice creation. If a different due date is desired, the net_terms parameter can be sent indicating the number of days in advance the due date should be. | | `payment_instructions` | `String` | Optional | - | | `memo` | `String` | Optional | A custom memo can be sent to override the site's default. | diff --git a/doc/models/create-on-off-component.md b/doc/models/create-on-off-component.md index 606acd5..a87d8fc 100644 --- a/doc/models/create-on-off-component.md +++ b/doc/models/create-on-off-component.md @@ -1,5 +1,5 @@ -# Create on Off Component +# Create On Off Component ## Structure diff --git a/doc/models/create-or-update-endpoint.md b/doc/models/create-or-update-endpoint.md index 1ae5c65..51226a2 100644 --- a/doc/models/create-or-update-endpoint.md +++ b/doc/models/create-or-update-endpoint.md @@ -20,7 +20,7 @@ Used to Create or Update Endpoint { "url": "url8", "webhook_subscriptions": [ - "payment_success" + "subscription_prepayment_account_balance_changed" ] } ``` diff --git a/doc/models/create-payment-profile.md b/doc/models/create-payment-profile.md index f229b86..fae2203 100644 --- a/doc/models/create-payment-profile.md +++ b/doc/models/create-payment-profile.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `chargify_token` | `String` | Optional | Token received after sending billing information using chargify.js. | +| `chargify_token` | `String` | Optional | Token received after sending billing information using Maxio.js (formerly Chargify.js). | | `id` | `Integer` | Optional | - | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Optional | - | | `first_name` | `String` | Optional | First name on card or bank account. If omitted, the first_name from customer attributes will be used. | @@ -29,8 +29,8 @@ | `vault_token` | `String` | Optional | The “token” provided by your vault storage for an already stored payment profile | | `customer_vault_token` | `String` | Optional | (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | | `customer_id` | `Integer` | Optional | (Required when creating a new payment profile) The Chargify customer id. | -| `paypal_email` | `String` | Optional | used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Chargify.js instead. | -| `payment_method_nonce` | `String` | Optional | used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Chargify.js instead. | +| `paypal_email` | `String` | Optional | used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Maxio.js (formerly Chargify.js) instead. | +| `payment_method_nonce` | `String` | Optional | used by merchants that implemented BraintreeBlue javaScript libraries on their own. We recommend using Maxio.js (formerly Chargify.js) instead. | | `gateway_handle` | `String` | Optional | This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. | | `cvv` | `String` | Optional | The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | | `bank_name` | `String` | Optional | (Required when creating with ACH or GoCardless, optional with Stripe Direct Debit). The name of the bank where the customerʼs account resides | diff --git a/doc/models/create-usage.md b/doc/models/create-usage.md index 4958417..6dad891 100644 --- a/doc/models/create-usage.md +++ b/doc/models/create-usage.md @@ -12,7 +12,7 @@ | `quantity` | `Float` | Optional | integer by default or decimal number if fractional quantities are enabled for the component | | `price_point_id` | `String` | Optional | - | | `memo` | `String` | Optional | - | -| `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. This only works for site with Multifrequency enabled. | +| `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | | `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | ## Example (as JSON) diff --git a/doc/models/credit-card-payment-profile.md b/doc/models/credit-card-payment-profile.md index db5948f..893b2e2 100644 --- a/doc/models/credit-card-payment-profile.md +++ b/doc/models/credit-card-payment-profile.md @@ -28,7 +28,7 @@ | `billing_address_2` | `String` | Optional | The current billing street address, second line, for the card. | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType::CREDIT_CARD` | | `disabled` | `TrueClass \| FalseClass` | Optional | - | -| `chargify_token` | `String` | Optional | Token received after sending billing information using chargify.js. This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | +| `chargify_token` | `String` | Optional | Token received after sending billing information using Maxio.js (formerly Chargify.js). This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | | `site_gateway_setting_id` | `Integer` | Optional | - | | `gateway_handle` | `String` | Optional | An identifier of connected gateway. | | `created_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was created | diff --git a/doc/models/credit-note-line-item.md b/doc/models/credit-note-line-item.md index 8ada1dc..e686479 100644 --- a/doc/models/credit-note-line-item.md +++ b/doc/models/credit-note-line-item.md @@ -17,6 +17,7 @@ | `subtotal_amount` | `String` | Optional | The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount). | | `discount_amount` | `String` | Optional | The approximate discount of just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total discount among many lines. Several lines may have been summed prior to applying the discount to arrive at `discount_amount` for the invoice - backing that out to the discount on a single line may introduce rounding or precision errors. | | `tax_amount` | `String` | Optional | The approximate tax of just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | +| `tax_included` | `TrueClass \| FalseClass` | Optional | Whether the unit price for this line item is tax-inclusive.

When `true`, `unit_price` already includes tax and `tax_amount` represents the portion of the price attributable to tax. When `false`, any applicable tax is added on top of the price.

The value is inherited from the source price point's `tax_included` setting. Custom or ad-hoc line items (which have no associated price point) always return `false`. | | `total_amount` | `String` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | | `tiered_unit_price` | `TrueClass \| FalseClass` | Optional | When `true`, indicates that the actual pricing scheme for the line was tiered, so the `unit_price` shown is the blended average for all units. | | `period_range_start` | `Date` | Optional | Start date for the period credited by this line. The format is `"YYYY-MM-DD"`. | diff --git a/doc/models/event-key.md b/doc/models/event-key.md index feb4046..e95df01 100644 --- a/doc/models/event-key.md +++ b/doc/models/event-key.md @@ -42,6 +42,7 @@ | `TRIAL_END_NOTICE` | | `DUNNING_STEP_REACHED` | | `INVOICE_ISSUED` | +| `INVOICE_PENDING` | | `PREPAID_SUBSCRIPTION_BALANCE_CHANGED` | | `SUBSCRIPTION_GROUP_SIGNUP_SUCCESS` | | `SUBSCRIPTION_GROUP_SIGNUP_FAILURE` | diff --git a/doc/models/event-response.md b/doc/models/event-response.md index 75b1061..f63a649 100644 --- a/doc/models/event-response.md +++ b/doc/models/event-response.md @@ -17,7 +17,7 @@ { "event": { "id": 242, - "key": "subscription_state_change", + "key": "prepaid_subscription_balance_changed", "message": "message0", "subscription_id": 96, "customer_id": 24, diff --git a/doc/models/event.md b/doc/models/event.md index 5155854..020ba52 100644 --- a/doc/models/event.md +++ b/doc/models/event.md @@ -22,7 +22,7 @@ ```json { "id": 40, - "key": "invoice_issued", + "key": "expiring_card", "message": "message8", "subscription_id": 150, "customer_id": 78, diff --git a/doc/models/invoice-line-item.md b/doc/models/invoice-line-item.md index 407f90b..b41d500 100644 --- a/doc/models/invoice-line-item.md +++ b/doc/models/invoice-line-item.md @@ -17,6 +17,7 @@ | `subtotal_amount` | `String` | Optional | The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount). | | `discount_amount` | `String` | Optional | The approximate discount applied to just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total discount among many lines. Several lines may have been summed prior to applying the discount to arrive at `discount_amount` for the invoice - backing that out to the discount on a single line may introduce rounding or precision errors. | | `tax_amount` | `String` | Optional | The approximate tax applied to just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | +| `tax_included` | `TrueClass \| FalseClass` | Optional | Whether the unit price for this line item is tax-inclusive.

When `true`, `unit_price` already includes tax and `tax_amount` represents the portion of the price attributable to tax. When `false`, any applicable tax is added on top of the price.

The value is inherited from the source price point's `tax_included` setting. Custom or ad-hoc line items (which have no associated price point) always return `false`. | | `total_amount` | `String` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | | `tiered_unit_price` | `TrueClass \| FalseClass` | Optional | When `true`, indicates that the actual pricing scheme for the line was tiered, so the `unit_price` shown is the blended average for all units. | | `period_range_start` | `Date` | Optional | Start date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the billing date, and the end date will be in the future.
* For periodic charges paid in arrears (e.g. metered charges), this date will be the date of the previous billing, and the end date will be the current billing date.
* For non-periodic charges, this date and the end date will match. | diff --git a/doc/models/payment-profile-attributes.md b/doc/models/payment-profile-attributes.md index 1a9fa8f..d352438 100644 --- a/doc/models/payment-profile-attributes.md +++ b/doc/models/payment-profile-attributes.md @@ -11,7 +11,7 @@ alias to credit_card_attributes | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `chargify_token` | `String` | Optional | (Optional) Token received after sending billing information using chargify.js. This token must be passed as a sole attribute of `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | +| `chargify_token` | `String` | Optional | (Optional) Token received after sending billing information using Maxio.js (formerly Chargify.js). This token must be passed as a sole attribute of `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | | `id` | `Integer` | Optional | - | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Optional | - | | `first_name` | `String` | Optional | (Optional) First name on card or bank account. If omitted, the first_name from customer attributes will be used. | diff --git a/doc/models/webhook-subscription.md b/doc/models/webhook-subscription.md index ced689e..172e795 100644 --- a/doc/models/webhook-subscription.md +++ b/doc/models/webhook-subscription.md @@ -17,6 +17,7 @@ | `EXPIRING_CARD` | | `EXPIRATION_DATE_CHANGE` | | `INVOICE_ISSUED` | +| `INVOICE_PENDING` | | `METERED_USAGE` | | `PAYMENT_FAILURE` | | `PAYMENT_SUCCESS` | diff --git a/lib/advanced_billing.rb b/lib/advanced_billing.rb index 5cb171b..f78f9ed 100644 --- a/lib/advanced_billing.rb +++ b/lib/advanced_billing.rb @@ -31,681 +31,681 @@ # Models require_relative 'advanced_billing/models/base_model' require_relative 'advanced_billing/models/payment_method_apple_pay' -require_relative 'advanced_billing/models/refund_invoice_event' -require_relative 'advanced_billing/models/void_invoice_event' -require_relative 'advanced_billing/models/list_invoice_events_response' -require_relative 'advanced_billing/models/bank_account_payment_profile' -require_relative 'advanced_billing/models/credit_card_payment_profile' -require_relative 'advanced_billing/models/account_balance' -require_relative 'advanced_billing/models/activate_event_based_component' -require_relative 'advanced_billing/models/allocate_components' -require_relative 'advanced_billing/models/allocation_preview_item' -require_relative 'advanced_billing/models/payment_method_credit_card' -require_relative 'advanced_billing/models/apply_credit_note_event' -require_relative 'advanced_billing/models/apply_debit_note_event' -require_relative 'advanced_billing/models/change_chargeback_status_event' -require_relative 'advanced_billing/models/create_credit_note_event' -require_relative 'advanced_billing/models/remove_payment_event' -require_relative 'advanced_billing/models/paypal_payment_profile' -require_relative 'advanced_billing/models/add_subscription_to_a_group' -require_relative 'advanced_billing/models/address_change' -require_relative 'advanced_billing/models/allocation' require_relative 'advanced_billing/models/payment_method_bank_account' +require_relative 'advanced_billing/models/payment_method_credit_card' require_relative 'advanced_billing/models/payment_method_external' -require_relative 'advanced_billing/models/backport_invoice_event' -require_relative 'advanced_billing/models/void_remainder_event' -require_relative 'advanced_billing/models/allocation_expiration_date' require_relative 'advanced_billing/models/payment_method_paypal' +require_relative 'advanced_billing/models/apply_credit_note_event' +require_relative 'advanced_billing/models/apply_debit_note_event' require_relative 'advanced_billing/models/apply_payment_event' +require_relative 'advanced_billing/models/backport_invoice_event' +require_relative 'advanced_billing/models/change_chargeback_status_event' require_relative 'advanced_billing/models/' \ 'change_invoice_collection_method_event' require_relative 'advanced_billing/models/change_invoice_status_event' +require_relative 'advanced_billing/models/create_credit_note_event' require_relative 'advanced_billing/models/create_debit_note_event' require_relative 'advanced_billing/models/failed_payment_event' require_relative 'advanced_billing/models/issue_invoice_event' +require_relative 'advanced_billing/models/refund_invoice_event' +require_relative 'advanced_billing/models/remove_payment_event' +require_relative 'advanced_billing/models/void_invoice_event' +require_relative 'advanced_billing/models/void_remainder_event' +require_relative 'advanced_billing/models/list_invoice_events_response' require_relative 'advanced_billing/models/apple_pay_payment_profile' +require_relative 'advanced_billing/models/bank_account_payment_profile' +require_relative 'advanced_billing/models/credit_card_payment_profile' +require_relative 'advanced_billing/models/paypal_payment_profile' +require_relative 'advanced_billing/models/account_balance' require_relative 'advanced_billing/models/account_balances' require_relative 'advanced_billing/models/ach_agreement' +require_relative 'advanced_billing/models/activate_event_based_component' require_relative 'advanced_billing/models/activate_subscription_request' require_relative 'advanced_billing/models/add_coupons_request' +require_relative 'advanced_billing/models/add_subscription_to_a_group' +require_relative 'advanced_billing/models/address_change' require_relative 'advanced_billing/models/agreement_acceptance' +require_relative 'advanced_billing/models/allocate_components' +require_relative 'advanced_billing/models/allocation' +require_relative 'advanced_billing/models/allocation_expiration_date' require_relative 'advanced_billing/models/allocation_preview' +require_relative 'advanced_billing/models/allocation_preview_item' require_relative 'advanced_billing/models/allocation_preview_line_item' -require_relative 'advanced_billing/models/apply_debit_note_event_data' -require_relative 'advanced_billing/models/bank_account_attributes' -require_relative 'advanced_billing/models/base_string_error' -require_relative 'advanced_billing/models/batch_job' -require_relative 'advanced_billing/models/' \ - 'bulk_create_product_price_points_response' -require_relative 'advanced_billing/models/chargify_ebb' -require_relative 'advanced_billing/models/component_allocation_change' -require_relative 'advanced_billing/models/component_allocation_error_item' -require_relative 'advanced_billing/models/component_custom_price' +require_relative 'advanced_billing/models/allocation_preview_response' require_relative 'advanced_billing/models/allocation_response' require_relative 'advanced_billing/models/allocation_settings' require_relative 'advanced_billing/models/applied_credit_note_data' +require_relative 'advanced_billing/models/apply_credit_note_event_data' +require_relative 'advanced_billing/models/apply_debit_note_event_data' +require_relative 'advanced_billing/models/apply_payment_event_data' require_relative 'advanced_billing/models/attribute_error' require_relative 'advanced_billing/models/auto_resume' +require_relative 'advanced_billing/models/available_actions' +require_relative 'advanced_billing/models/bank_account_attributes' +require_relative 'advanced_billing/models/bank_account_response' require_relative 'advanced_billing/models/bank_account_verification' +require_relative 'advanced_billing/models/bank_account_verification_request' +require_relative 'advanced_billing/models/base_refund_error' +require_relative 'advanced_billing/models/base_string_error' +require_relative 'advanced_billing/models/batch_job_response' +require_relative 'advanced_billing/models/batch_job' +require_relative 'advanced_billing/models/billing_manifest' +require_relative 'advanced_billing/models/billing_manifest_item' require_relative 'advanced_billing/models/billing_schedule' require_relative 'advanced_billing/models/breakouts' require_relative 'advanced_billing/models/' \ 'bulk_components_price_point_assignment' require_relative 'advanced_billing/models/' \ 'bulk_create_product_price_points_request' -require_relative 'advanced_billing/models/cancellation_options' -require_relative 'advanced_billing/models/cancellation_request' require_relative 'advanced_billing/models/' \ - 'change_invoice_collection_method_event_data' -require_relative 'advanced_billing/models/change_invoice_status_event_data' -require_relative 'advanced_billing/models/component_currency_price' -require_relative 'advanced_billing/models/allocation_preview_response' -require_relative 'advanced_billing/models/apply_credit_note_event_data' -require_relative 'advanced_billing/models/apply_payment_event_data' -require_relative 'advanced_billing/models/available_actions' -require_relative 'advanced_billing/models/bank_account_response' -require_relative 'advanced_billing/models/batch_job_response' -require_relative 'advanced_billing/models/calendar_billing' -require_relative 'advanced_billing/models/change_chargeback_status_event_data' -require_relative 'advanced_billing/models/component' -require_relative 'advanced_billing/models/component_currency_prices_response' -require_relative 'advanced_billing/models/component_price' -require_relative 'advanced_billing/models/bank_account_verification_request' -require_relative 'advanced_billing/models/base_refund_error' -require_relative 'advanced_billing/models/billing_manifest' -require_relative 'advanced_billing/models/billing_manifest_item' + 'bulk_create_product_price_points_response' require_relative 'advanced_billing/models/bulk_create_segments' require_relative 'advanced_billing/models/bulk_update_segments' require_relative 'advanced_billing/models/bulk_update_segments_item' +require_relative 'advanced_billing/models/calendar_billing' require_relative 'advanced_billing/models/cancel_grouped_subscriptions_request' +require_relative 'advanced_billing/models/cancellation_options' +require_relative 'advanced_billing/models/cancellation_request' +require_relative 'advanced_billing/models/change_chargeback_status_event_data' +require_relative 'advanced_billing/models/' \ + 'change_invoice_collection_method_event_data' +require_relative 'advanced_billing/models/change_invoice_status_event_data' +require_relative 'advanced_billing/models/chargify_ebb' require_relative 'advanced_billing/models/clone_component_price_point' require_relative 'advanced_billing/models/clone_component_price_point_request' +require_relative 'advanced_billing/models/component' +require_relative 'advanced_billing/models/component_allocation_change' +require_relative 'advanced_billing/models/component_allocation_error_item' require_relative 'advanced_billing/models/component_cost_data' require_relative 'advanced_billing/models/component_cost_data_rate_tier' +require_relative 'advanced_billing/models/component_currency_price' +require_relative 'advanced_billing/models/component_currency_prices_response' +require_relative 'advanced_billing/models/component_custom_price' +require_relative 'advanced_billing/models/component_price' require_relative 'advanced_billing/models/component_price_point' +require_relative 'advanced_billing/models/component_price_point_assignment' +require_relative 'advanced_billing/models/' \ + 'component_price_point_currency_overage_response' require_relative 'advanced_billing/models/component_price_point_item' +require_relative 'advanced_billing/models/component_price_point_response' require_relative 'advanced_billing/models/component_price_points_response' +require_relative 'advanced_billing/models/component_price_point_error_item' require_relative 'advanced_billing/models/component_response' require_relative 'advanced_billing/models/consolidated_invoice' +require_relative 'advanced_billing/models/contract' require_relative 'advanced_billing/models/count_response' require_relative 'advanced_billing/models/coupon' +require_relative 'advanced_billing/models/coupon_currency' require_relative 'advanced_billing/models/coupon_currency_request' -require_relative 'advanced_billing/models/coupon_response' -require_relative 'advanced_billing/models/coupon_usage' -require_relative 'advanced_billing/models/create_allocation' -require_relative 'advanced_billing/models/create_currency_prices_request' -require_relative 'advanced_billing/models/create_invoice_payment_application' -require_relative 'advanced_billing/models/create_metadata' -require_relative 'advanced_billing/models/create_metafield' -require_relative 'advanced_billing/models/create_multi_invoice_payment' -require_relative 'advanced_billing/models/create_offer' -require_relative 'advanced_billing/models/create_or_update_endpoint' -require_relative 'advanced_billing/models/create_payment_profile_request' -require_relative 'advanced_billing/models/create_prepayment' -require_relative 'advanced_billing/models/create_product_family' -require_relative 'advanced_billing/models/create_product_family_request' -require_relative 'advanced_billing/models/create_usage_request' -require_relative 'advanced_billing/models/credit_note' -require_relative 'advanced_billing/models/credit_note_application' -require_relative 'advanced_billing/models/deduct_service_credit_request' -require_relative 'advanced_billing/models/deliver_proforma_invoice_request' -require_relative 'advanced_billing/models/dunner_data' -require_relative 'advanced_billing/models/dunning_step_reached' -require_relative 'advanced_billing/models/ebb_component' -require_relative 'advanced_billing/models/ebb_event' -require_relative 'advanced_billing/models/enable_webhooks_request' -require_relative 'advanced_billing/models/enable_webhooks_response' -require_relative 'advanced_billing/models/invoice_discount' -require_relative 'advanced_billing/models/invoice_line_item' -require_relative 'advanced_billing/models/invoice_previous_balance' -require_relative 'advanced_billing/models/invoice_refund' -require_relative 'advanced_billing/models/coupon_request' -require_relative 'advanced_billing/models/create_currency_price' -require_relative 'advanced_billing/models/create_invoice' -require_relative 'advanced_billing/models/create_invoice_address' -require_relative 'advanced_billing/models/create_offer_request' -require_relative 'advanced_billing/models/create_or_update_product' -require_relative 'advanced_billing/models/create_prepaid_component' -require_relative 'advanced_billing/models/' \ - 'create_prepaid_usage_component_price_point' -require_relative 'advanced_billing/models/create_subscription_group_request' -require_relative 'advanced_billing/models/create_usage' -require_relative 'advanced_billing/models/customer_attributes' -require_relative 'advanced_billing/models/customer_error' -require_relative 'advanced_billing/models/delete_subscription_group_response' -require_relative 'advanced_billing/models/errors' -require_relative 'advanced_billing/models/event_based_billing_segment_error' -require_relative 'advanced_billing/models/failed_payment_event_data' -require_relative 'advanced_billing/models/invoice_balance_item' -require_relative 'advanced_billing/models/invoice_credit' -require_relative 'advanced_billing/models/invoice_line_item_component_cost_data' -require_relative 'advanced_billing/models/invoice_payer' -require_relative 'advanced_billing/models/invoice_payment' -require_relative 'advanced_billing/models/invoice_payment_application' -require_relative 'advanced_billing/models/invoice_pre_payment' -require_relative 'advanced_billing/models/invoice_seller' -require_relative 'advanced_billing/models/component_price_point_error_item' +require_relative 'advanced_billing/models/coupon_currency_response' require_relative 'advanced_billing/models/coupon_payload' +require_relative 'advanced_billing/models/coupon_request' +require_relative 'advanced_billing/models/coupon_response' +require_relative 'advanced_billing/models/coupon_restriction' require_relative 'advanced_billing/models/coupon_subcodes' require_relative 'advanced_billing/models/coupon_subcodes_response' +require_relative 'advanced_billing/models/coupon_usage' +require_relative 'advanced_billing/models/create_allocation' +require_relative 'advanced_billing/models/create_allocation_request' +require_relative 'advanced_billing/models/create_component_price_point' require_relative 'advanced_billing/models/create_component_price_point_request' +require_relative 'advanced_billing/models/create_component_price_points_request' +require_relative 'advanced_billing/models/create_currency_price' +require_relative 'advanced_billing/models/create_currency_prices_request' require_relative 'advanced_billing/models/create_customer' +require_relative 'advanced_billing/models/create_customer_request' require_relative 'advanced_billing/models/create_ebb_component' +require_relative 'advanced_billing/models/create_invoice' +require_relative 'advanced_billing/models/create_invoice_address' require_relative 'advanced_billing/models/create_invoice_coupon' +require_relative 'advanced_billing/models/create_invoice_item' require_relative 'advanced_billing/models/create_invoice_payment' +require_relative 'advanced_billing/models/create_invoice_payment_application' require_relative 'advanced_billing/models/create_invoice_payment_request' require_relative 'advanced_billing/models/create_invoice_request' +require_relative 'advanced_billing/models/create_metadata' +require_relative 'advanced_billing/models/create_metadata_request' +require_relative 'advanced_billing/models/create_metafield' require_relative 'advanced_billing/models/create_metafields_request' +require_relative 'advanced_billing/models/create_metered_component' +require_relative 'advanced_billing/models/create_multi_invoice_payment' require_relative 'advanced_billing/models/create_multi_invoice_payment_request' +require_relative 'advanced_billing/models/create_offer' require_relative 'advanced_billing/models/create_offer_component' +require_relative 'advanced_billing/models/create_offer_request' +require_relative 'advanced_billing/models/create_on_off_component' +require_relative 'advanced_billing/models/create_or_update_endpoint' require_relative 'advanced_billing/models/create_or_update_endpoint_request' +require_relative 'advanced_billing/models/create_or_update_product' +require_relative 'advanced_billing/models/create_or_update_product_request' require_relative 'advanced_billing/models/create_or_update_segment_price' require_relative 'advanced_billing/models/create_payment' +require_relative 'advanced_billing/models/create_payment_profile' +require_relative 'advanced_billing/models/create_payment_profile_request' +require_relative 'advanced_billing/models/create_prepaid_component' +require_relative 'advanced_billing/models/' \ + 'create_prepaid_usage_component_price_point' +require_relative 'advanced_billing/models/create_prepayment' +require_relative 'advanced_billing/models/create_prepayment_request' require_relative 'advanced_billing/models/create_prepayment_response' +require_relative 'advanced_billing/models/create_product_currency_price' require_relative 'advanced_billing/models/' \ 'create_product_currency_prices_request' +require_relative 'advanced_billing/models/create_product_family' +require_relative 'advanced_billing/models/create_product_family_request' +require_relative 'advanced_billing/models/create_product_price_point' require_relative 'advanced_billing/models/create_product_price_point_request' require_relative 'advanced_billing/models/create_quantity_based_component' require_relative 'advanced_billing/models/create_reason_code' +require_relative 'advanced_billing/models/create_reason_code_request' require_relative 'advanced_billing/models/create_segment' require_relative 'advanced_billing/models/create_segment_request' -require_relative 'advanced_billing/models/credit_account_balance_changed' -require_relative 'advanced_billing/models/credit_note_line_item' -require_relative 'advanced_billing/models/currency_overage_prices' -require_relative 'advanced_billing/models/currency_prices_response' -require_relative 'advanced_billing/models/custom_field_value_change' -require_relative 'advanced_billing/models/customer' -require_relative 'advanced_billing/models/customer_change' -require_relative 'advanced_billing/models/customer_changes_preview_response' -require_relative 'advanced_billing/models/customer_payer_change' -require_relative 'advanced_billing/models/delayed_cancellation_response' -require_relative 'advanced_billing/models/dunning_step_data' -require_relative 'advanced_billing/models/endpoint' -require_relative 'advanced_billing/models/event_response' -require_relative 'advanced_billing/models/full_subscription_group_response' -require_relative 'advanced_billing/models/group_settings' -require_relative 'advanced_billing/models/group_target' -require_relative 'advanced_billing/models/historic_usage' -require_relative 'advanced_billing/models/component_price_point_assignment' -require_relative 'advanced_billing/models/' \ - 'component_price_point_currency_overage_response' -require_relative 'advanced_billing/models/component_price_point_response' -require_relative 'advanced_billing/models/contract' -require_relative 'advanced_billing/models/coupon_currency' -require_relative 'advanced_billing/models/coupon_currency_response' -require_relative 'advanced_billing/models/coupon_restriction' -require_relative 'advanced_billing/models/create_allocation_request' -require_relative 'advanced_billing/models/create_component_price_point' -require_relative 'advanced_billing/models/create_component_price_points_request' -require_relative 'advanced_billing/models/create_customer_request' -require_relative 'advanced_billing/models/create_invoice_item' -require_relative 'advanced_billing/models/create_metadata_request' -require_relative 'advanced_billing/models/create_metered_component' -require_relative 'advanced_billing/models/create_on_off_component' -require_relative 'advanced_billing/models/create_or_update_product_request' -require_relative 'advanced_billing/models/create_payment_profile' -require_relative 'advanced_billing/models/create_prepayment_request' -require_relative 'advanced_billing/models/create_product_currency_price' -require_relative 'advanced_billing/models/create_product_price_point' -require_relative 'advanced_billing/models/create_reason_code_request' require_relative 'advanced_billing/models/create_subscription' require_relative 'advanced_billing/models/create_subscription_component' require_relative 'advanced_billing/models/create_subscription_group' +require_relative 'advanced_billing/models/create_subscription_group_request' require_relative 'advanced_billing/models/create_subscription_request' +require_relative 'advanced_billing/models/create_usage' +require_relative 'advanced_billing/models/create_usage_request' require_relative 'advanced_billing/models/created_prepayment' +require_relative 'advanced_billing/models/credit_account_balance_changed' require_relative 'advanced_billing/models/credit_card_attributes' +require_relative 'advanced_billing/models/credit_note' +require_relative 'advanced_billing/models/credit_note_application' +require_relative 'advanced_billing/models/credit_note_line_item' require_relative 'advanced_billing/models/credit_scheme_request' +require_relative 'advanced_billing/models/currency_overage_prices' require_relative 'advanced_billing/models/currency_price' +require_relative 'advanced_billing/models/currency_prices_response' +require_relative 'advanced_billing/models/custom_field_value_change' +require_relative 'advanced_billing/models/customer' +require_relative 'advanced_billing/models/customer_attributes' +require_relative 'advanced_billing/models/customer_change' +require_relative 'advanced_billing/models/customer_changes_preview_response' require_relative 'advanced_billing/models/customer_custom_fields_change' +require_relative 'advanced_billing/models/customer_error' +require_relative 'advanced_billing/models/customer_payer_change' require_relative 'advanced_billing/models/customer_response' require_relative 'advanced_billing/models/debit_note' require_relative 'advanced_billing/models/deduct_service_credit' +require_relative 'advanced_billing/models/deduct_service_credit_request' +require_relative 'advanced_billing/models/delayed_cancellation_response' +require_relative 'advanced_billing/models/delete_subscription_group_response' +require_relative 'advanced_billing/models/deliver_proforma_invoice_request' +require_relative 'advanced_billing/models/dunner_data' +require_relative 'advanced_billing/models/dunning_step_data' +require_relative 'advanced_billing/models/dunning_step_reached' +require_relative 'advanced_billing/models/ebb_component' +require_relative 'advanced_billing/models/ebb_event' +require_relative 'advanced_billing/models/enable_webhooks_request' +require_relative 'advanced_billing/models/enable_webhooks_response' +require_relative 'advanced_billing/models/endpoint' require_relative 'advanced_billing/models/endpoint_response' +require_relative 'advanced_billing/models/errors' require_relative 'advanced_billing/models/event' +require_relative 'advanced_billing/models/event_based_billing_segment_error' +require_relative 'advanced_billing/models/event_response' +require_relative 'advanced_billing/models/failed_payment_event_data' +require_relative 'advanced_billing/models/full_subscription_group_response' require_relative 'advanced_billing/models/get_one_time_token_payment_profile' require_relative 'advanced_billing/models/get_one_time_token_request' require_relative 'advanced_billing/models/group_billing' +require_relative 'advanced_billing/models/group_settings' +require_relative 'advanced_billing/models/group_target' +require_relative 'advanced_billing/models/historic_usage' require_relative 'advanced_billing/models/invoice' +require_relative 'advanced_billing/models/invoice_address' require_relative 'advanced_billing/models/invoice_avatax_details' +require_relative 'advanced_billing/models/invoice_balance_item' +require_relative 'advanced_billing/models/invoice_credit' require_relative 'advanced_billing/models/invoice_custom_field' require_relative 'advanced_billing/models/invoice_customer' require_relative 'advanced_billing/models/invoice_debit' +require_relative 'advanced_billing/models/invoice_discount' require_relative 'advanced_billing/models/invoice_discount_breakout' require_relative 'advanced_billing/models/invoice_display_settings' require_relative 'advanced_billing/models/invoice_issued' -require_relative 'advanced_billing/models/invoice_response' -require_relative 'advanced_billing/models/invoice_address' +require_relative 'advanced_billing/models/invoice_line_item' +require_relative 'advanced_billing/models/invoice_line_item_component_cost_data' require_relative 'advanced_billing/models/invoice_line_item_event_data' require_relative 'advanced_billing/models/invoice_line_item_pricing_detail' +require_relative 'advanced_billing/models/invoice_payer' require_relative 'advanced_billing/models/invoice_payer_change' +require_relative 'advanced_billing/models/invoice_payment' +require_relative 'advanced_billing/models/invoice_payment_application' require_relative 'advanced_billing/models/invoice_payment_method' +require_relative 'advanced_billing/models/invoice_pre_payment' +require_relative 'advanced_billing/models/invoice_previous_balance' +require_relative 'advanced_billing/models/invoice_refund' +require_relative 'advanced_billing/models/invoice_response' +require_relative 'advanced_billing/models/invoice_seller' require_relative 'advanced_billing/models/invoice_tax' -require_relative 'advanced_billing/models/list_coupons_filter' -require_relative 'advanced_billing/models/list_offers_response' -require_relative 'advanced_billing/models/list_prepayments_filter' -require_relative 'advanced_billing/models/list_price_points_filter' -require_relative 'advanced_billing/models/list_product_price_points_response' -require_relative 'advanced_billing/models/list_products_filter' -require_relative 'advanced_billing/models/list_proforma_invoices_response' -require_relative 'advanced_billing/models/list_public_keys_meta' -require_relative 'advanced_billing/models/list_subscription_components_filter' -require_relative 'advanced_billing/models/list_subscription_groups_meta' -require_relative 'advanced_billing/models/metadata' -require_relative 'advanced_billing/models/metered_usage' -require_relative 'advanced_billing/models/multi_invoice_payment_response' -require_relative 'advanced_billing/models/net_terms' -require_relative 'advanced_billing/models/offer_signup_page' +require_relative 'advanced_billing/models/invoice_tax_breakout' require_relative 'advanced_billing/models/invoice_tax_component_breakout' require_relative 'advanced_billing/models/issue_advance_invoice_request' require_relative 'advanced_billing/models/issue_invoice_event_data' +require_relative 'advanced_billing/models/issue_invoice_request' require_relative 'advanced_billing/models/issue_service_credit' +require_relative 'advanced_billing/models/issue_service_credit_request' require_relative 'advanced_billing/models/item_price_point_changed' require_relative 'advanced_billing/models/item_price_point_data' +require_relative 'advanced_billing/models/list_components_filter' require_relative 'advanced_billing/models/list_components_price_points_response' +require_relative 'advanced_billing/models/list_coupons_filter' require_relative 'advanced_billing/models/list_credit_notes_response' require_relative 'advanced_billing/models/list_invoices_response' +require_relative 'advanced_billing/models/list_metafields_response' require_relative 'advanced_billing/models/list_mrr_filter' require_relative 'advanced_billing/models/list_mrr_response' require_relative 'advanced_billing/models/list_mrr_response_result' +require_relative 'advanced_billing/models/list_offers_response' +require_relative 'advanced_billing/models/list_prepayments_filter' +require_relative 'advanced_billing/models/list_price_points_filter' +require_relative 'advanced_billing/models/list_product_price_points_response' +require_relative 'advanced_billing/models/list_products_filter' +require_relative 'advanced_billing/models/list_proforma_invoices_meta' +require_relative 'advanced_billing/models/list_proforma_invoices_response' +require_relative 'advanced_billing/models/list_public_keys_meta' require_relative 'advanced_billing/models/list_public_keys_response' +require_relative 'advanced_billing/models/list_sale_rep_item' +require_relative 'advanced_billing/models/list_segments_filter' require_relative 'advanced_billing/models/list_segments_response' +require_relative 'advanced_billing/models/list_service_credits_response' +require_relative 'advanced_billing/models/' \ + 'list_subcription_group_prepayment_item' +require_relative 'advanced_billing/models/list_subscription_components_filter' require_relative 'advanced_billing/models/' \ 'list_subscription_components_for_site_filter' +require_relative 'advanced_billing/models/list_subscription_components_response' require_relative 'advanced_billing/models/list_subscription_group_prepayment' +require_relative 'advanced_billing/models/' \ + 'list_subscription_group_prepayment_response' +require_relative 'advanced_billing/models/list_subscription_groups_item' +require_relative 'advanced_billing/models/list_subscription_groups_meta' require_relative 'advanced_billing/models/list_subscription_groups_response' +require_relative 'advanced_billing/models/metadata' require_relative 'advanced_billing/models/metafield' require_relative 'advanced_billing/models/metafield_scope' -require_relative 'advanced_billing/models/movement_line_item' -require_relative 'advanced_billing/models/mrr_movement' -require_relative 'advanced_billing/models/offer' -require_relative 'advanced_billing/models/offer_response' -require_relative 'advanced_billing/models/issue_invoice_request' -require_relative 'advanced_billing/models/issue_service_credit_request' -require_relative 'advanced_billing/models/list_metafields_response' -require_relative 'advanced_billing/models/list_sale_rep_item' -require_relative 'advanced_billing/models/' \ - 'list_subcription_group_prepayment_item' -require_relative 'advanced_billing/models/list_subscription_components_response' -require_relative 'advanced_billing/models/' \ - 'list_subscription_group_prepayment_response' require_relative 'advanced_billing/models/metered_component' -require_relative 'advanced_billing/models/multi_invoice_payment' -require_relative 'advanced_billing/models/invoice_tax_breakout' -require_relative 'advanced_billing/models/list_components_filter' -require_relative 'advanced_billing/models/list_proforma_invoices_meta' -require_relative 'advanced_billing/models/list_segments_filter' -require_relative 'advanced_billing/models/list_service_credits_response' -require_relative 'advanced_billing/models/list_subscription_groups_item' +require_relative 'advanced_billing/models/metered_usage' require_relative 'advanced_billing/models/movement' +require_relative 'advanced_billing/models/movement_line_item' require_relative 'advanced_billing/models/mrr' +require_relative 'advanced_billing/models/mrr_movement' require_relative 'advanced_billing/models/mrr_response' +require_relative 'advanced_billing/models/multi_invoice_payment' +require_relative 'advanced_billing/models/multi_invoice_payment_response' require_relative 'advanced_billing/models/nested_subscription_group' +require_relative 'advanced_billing/models/net_terms' +require_relative 'advanced_billing/models/offer' require_relative 'advanced_billing/models/offer_discount' require_relative 'advanced_billing/models/offer_item' +require_relative 'advanced_billing/models/offer_response' +require_relative 'advanced_billing/models/offer_signup_page' require_relative 'advanced_billing/models/ok_response' +require_relative 'advanced_billing/models/on_off_component' +require_relative 'advanced_billing/models/organization_address' require_relative 'advanced_billing/models/origin_invoice' -require_relative 'advanced_billing/models/override_subscription_request' -require_relative 'advanced_billing/models/payment_profile_attributes' -require_relative 'advanced_billing/models/pending_cancellation_change' -require_relative 'advanced_billing/models/product_family_response' -require_relative 'advanced_billing/models/product_response' -require_relative 'advanced_billing/models/proforma_invoice_credit' -require_relative 'advanced_billing/models/reactivate_subscription_request' -require_relative 'advanced_billing/models/referral_code' -require_relative 'advanced_billing/models/refund_invoice' -require_relative 'advanced_billing/models/refund_prepayment_base_refund_error' -require_relative 'advanced_billing/models/register' -require_relative 'advanced_billing/models/resent_invitation' -require_relative 'advanced_billing/models/sale_rep_item_mrr' -require_relative 'advanced_billing/models/sale_rep_settings' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_component_custom_price' -require_relative 'advanced_billing/models/segment_response' -require_relative 'advanced_billing/models/service_credit' -require_relative 'advanced_billing/models/signup_proforma_preview_response' -require_relative 'advanced_billing/models/site' -require_relative 'advanced_billing/models/site_statistics' -require_relative 'advanced_billing/models/site_summary' -require_relative 'advanced_billing/models/subscription_custom_price' -require_relative 'advanced_billing/models/subscription_group_balances' -require_relative 'advanced_billing/models/subscription_group_credit_card' +require_relative 'advanced_billing/models/overage_pricing' require_relative 'advanced_billing/models/override_subscription' +require_relative 'advanced_billing/models/override_subscription_request' require_relative 'advanced_billing/models/paginated_metadata' require_relative 'advanced_billing/models/paid_invoice' -require_relative 'advanced_billing/models/payment_related_events' -require_relative 'advanced_billing/models/prepaid_configuration' -require_relative 'advanced_billing/models/prepayment' -require_relative 'advanced_billing/models/preview_allocations_request' -require_relative 'advanced_billing/models/product_price_point_errors' -require_relative 'advanced_billing/models/' \ - 'reactivate_subscription_group_response' -require_relative 'advanced_billing/models/reactivation_billing' -require_relative 'advanced_billing/models/reason_code' -require_relative 'advanced_billing/models/reason_code_response' -require_relative 'advanced_billing/models/record_payment_request' -require_relative 'advanced_billing/models/record_payment_response' -require_relative 'advanced_billing/models/refund_consolidated_invoice' -require_relative 'advanced_billing/models/refund_invoice_event_data' -require_relative 'advanced_billing/models/refund_prepayment_request' -require_relative 'advanced_billing/models/remove_payment_event_data' -require_relative 'advanced_billing/models/renewal_preview' -require_relative 'advanced_billing/models/replay_webhooks_request' -require_relative 'advanced_billing/models/replay_webhooks_response' -require_relative 'advanced_billing/models/resume_options' -require_relative 'advanced_billing/models/sale_rep_subscription' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_configuration_item_response' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_configuration_request_body' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_configurations_response' -require_relative 'advanced_billing/models/segment' -require_relative 'advanced_billing/models/send_invoice_request' -require_relative 'advanced_billing/models/send_email' -require_relative 'advanced_billing/models/service_credit1' -require_relative 'advanced_billing/models/site_response' -require_relative 'advanced_billing/models/subscription' -require_relative 'advanced_billing/models/overage_pricing' require_relative 'advanced_billing/models/pause_request' require_relative 'advanced_billing/models/payer_attributes' +require_relative 'advanced_billing/models/payer_error' require_relative 'advanced_billing/models/payment_collection_method_changed' +require_relative 'advanced_billing/models/payment_for_allocation' +require_relative 'advanced_billing/models/payment_profile_attributes' require_relative 'advanced_billing/models/payment_profile_response' +require_relative 'advanced_billing/models/payment_related_events' +require_relative 'advanced_billing/models/pending_cancellation_change' +require_relative 'advanced_billing/models/portal_management_link' +require_relative 'advanced_billing/models/prepaid_configuration' require_relative 'advanced_billing/models/prepaid_configuration_response' require_relative 'advanced_billing/models/prepaid_product_price_point_filter' require_relative 'advanced_billing/models/prepaid_subscription_balance_changed' -require_relative 'advanced_billing/models/prepayment_response' -require_relative 'advanced_billing/models/proforma_error' -require_relative 'advanced_billing/models/proforma_invoice' -require_relative 'advanced_billing/models/proforma_invoice_tax' -require_relative 'advanced_billing/models/proration' -require_relative 'advanced_billing/models/public_signup_page' -require_relative 'advanced_billing/models/refund_prepayment' -require_relative 'advanced_billing/models/refund_success' -require_relative 'advanced_billing/models/renewal_preview_request' -require_relative 'advanced_billing/models/revoked_invitation' -require_relative 'advanced_billing/models/sale_rep' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_configuration_item_request' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_configuration_request' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_configuration_response' -require_relative 'advanced_billing/models/' \ - 'scheduled_renewal_item_request_body_component' -require_relative 'advanced_billing/models/scheduled_renewal_product_price_point' -require_relative 'advanced_billing/models/service_credit_response' -require_relative 'advanced_billing/models/signup_proforma_preview' -require_relative 'advanced_billing/models/subscription_component' -require_relative 'advanced_billing/models/' \ - 'subscription_component_allocation_error_item' -require_relative 'advanced_billing/models/subscription_component_subscription' -require_relative 'advanced_billing/models/subscription_filter' -require_relative 'advanced_billing/models/subscription_group' -require_relative 'advanced_billing/models/subscription_group_bank_account' -require_relative 'advanced_billing/models/on_off_component' -require_relative 'advanced_billing/models/organization_address' -require_relative 'advanced_billing/models/payer_error' -require_relative 'advanced_billing/models/payment_for_allocation' -require_relative 'advanced_billing/models/portal_management_link' require_relative 'advanced_billing/models/prepaid_usage' require_relative 'advanced_billing/models/prepaid_usage_allocation_detail' require_relative 'advanced_billing/models/prepaid_usage_component' +require_relative 'advanced_billing/models/prepayment' require_relative 'advanced_billing/models/prepayment_account_balance_changed' +require_relative 'advanced_billing/models/prepayment_response' require_relative 'advanced_billing/models/prepayments_response' +require_relative 'advanced_billing/models/preview_allocations_request' require_relative 'advanced_billing/models/price' require_relative 'advanced_billing/models/product' require_relative 'advanced_billing/models/product_family' +require_relative 'advanced_billing/models/product_family_response' require_relative 'advanced_billing/models/product_price_point' +require_relative 'advanced_billing/models/product_price_point_errors' require_relative 'advanced_billing/models/product_price_point_response' +require_relative 'advanced_billing/models/product_response' +require_relative 'advanced_billing/models/proforma_error' +require_relative 'advanced_billing/models/proforma_invoice' +require_relative 'advanced_billing/models/proforma_invoice_credit' require_relative 'advanced_billing/models/proforma_invoice_discount' require_relative 'advanced_billing/models/proforma_invoice_issued' require_relative 'advanced_billing/models/proforma_invoice_payment' +require_relative 'advanced_billing/models/proforma_invoice_tax' +require_relative 'advanced_billing/models/proration' require_relative 'advanced_billing/models/public_key' +require_relative 'advanced_billing/models/public_signup_page' require_relative 'advanced_billing/models/quantity_based_component' require_relative 'advanced_billing/models/reactivate_subscription_group_request' +require_relative 'advanced_billing/models/' \ + 'reactivate_subscription_group_response' +require_relative 'advanced_billing/models/reactivate_subscription_request' +require_relative 'advanced_billing/models/reactivation_billing' +require_relative 'advanced_billing/models/reason_code' +require_relative 'advanced_billing/models/reason_code_response' +require_relative 'advanced_billing/models/record_payment_request' +require_relative 'advanced_billing/models/record_payment_response' +require_relative 'advanced_billing/models/referral_code' require_relative 'advanced_billing/models/referral_validation_response' +require_relative 'advanced_billing/models/refund_consolidated_invoice' +require_relative 'advanced_billing/models/refund_invoice' +require_relative 'advanced_billing/models/refund_invoice_event_data' require_relative 'advanced_billing/models/refund_invoice_request' +require_relative 'advanced_billing/models/refund_prepayment' +require_relative 'advanced_billing/models/refund_prepayment_base_refund_error' +require_relative 'advanced_billing/models/refund_prepayment_request' +require_relative 'advanced_billing/models/refund_success' +require_relative 'advanced_billing/models/register' +require_relative 'advanced_billing/models/remove_payment_event_data' +require_relative 'advanced_billing/models/renewal_preview' require_relative 'advanced_billing/models/renewal_preview_component' require_relative 'advanced_billing/models/renewal_preview_line_item' +require_relative 'advanced_billing/models/renewal_preview_request' require_relative 'advanced_billing/models/renewal_preview_response' +require_relative 'advanced_billing/models/replay_webhooks_request' +require_relative 'advanced_billing/models/replay_webhooks_response' +require_relative 'advanced_billing/models/resent_invitation' +require_relative 'advanced_billing/models/resume_options' +require_relative 'advanced_billing/models/revoked_invitation' +require_relative 'advanced_billing/models/sale_rep' +require_relative 'advanced_billing/models/sale_rep_item_mrr' +require_relative 'advanced_billing/models/sale_rep_settings' +require_relative 'advanced_billing/models/sale_rep_subscription' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_component_custom_price' require_relative 'advanced_billing/models/scheduled_renewal_configuration' require_relative 'advanced_billing/models/scheduled_renewal_configuration_item' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_configuration_item_request' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_configuration_item_response' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_configuration_request' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_configuration_request_body' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_configuration_response' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_configurations_response' +require_relative 'advanced_billing/models/' \ + 'scheduled_renewal_item_request_body_component' require_relative 'advanced_billing/models/' \ 'scheduled_renewal_item_request_body_product' require_relative 'advanced_billing/models/scheduled_renewal_lock_in_request' +require_relative 'advanced_billing/models/scheduled_renewal_product_price_point' require_relative 'advanced_billing/models/scheduled_renewal_update_request' +require_relative 'advanced_billing/models/segment' require_relative 'advanced_billing/models/segment_price' +require_relative 'advanced_billing/models/segment_response' +require_relative 'advanced_billing/models/send_invoice_request' +require_relative 'advanced_billing/models/send_email' +require_relative 'advanced_billing/models/service_credit' +require_relative 'advanced_billing/models/service_credit_response' +require_relative 'advanced_billing/models/service_credit1' +require_relative 'advanced_billing/models/signup_proforma_preview' +require_relative 'advanced_billing/models/signup_proforma_preview_response' +require_relative 'advanced_billing/models/site' +require_relative 'advanced_billing/models/site_response' +require_relative 'advanced_billing/models/site_statistics' +require_relative 'advanced_billing/models/site_summary' +require_relative 'advanced_billing/models/subscription' +require_relative 'advanced_billing/models/subscription_component' +require_relative 'advanced_billing/models/' \ + 'subscription_component_allocation_error_item' require_relative 'advanced_billing/models/subscription_component_response' +require_relative 'advanced_billing/models/subscription_component_subscription' +require_relative 'advanced_billing/models/subscription_custom_price' +require_relative 'advanced_billing/models/subscription_filter' +require_relative 'advanced_billing/models/subscription_group' +require_relative 'advanced_billing/models/subscription_group_balances' +require_relative 'advanced_billing/models/subscription_group_bank_account' require_relative 'advanced_billing/models/' \ 'subscription_group_component_custom_price' +require_relative 'advanced_billing/models/subscription_group_credit_card' +require_relative 'advanced_billing/models/subscription_group_customer' +require_relative 'advanced_billing/models/subscription_group_item' require_relative 'advanced_billing/models/' \ 'subscription_group_members_array_error' +require_relative 'advanced_billing/models/subscription_group_payment_profile' require_relative 'advanced_billing/models/subscription_group_prepayment' require_relative 'advanced_billing/models/subscription_group_prepayment_request' -require_relative 'advanced_billing/models/subscription_mrr_breakout' -require_relative 'advanced_billing/models/subscription_mrr_response' -require_relative 'advanced_billing/models/subscription_preview_response' -require_relative 'advanced_billing/models/subscription_product_migration' -require_relative 'advanced_billing/models/update_component_price_point' -require_relative 'advanced_billing/models/update_component_price_point_request' -require_relative 'advanced_billing/models/update_coupon_currency' -require_relative 'advanced_billing/models/update_currency_price' -require_relative 'advanced_billing/models/update_metadata' -require_relative 'advanced_billing/models/update_metadata_request' -require_relative 'advanced_billing/models/update_metafield' -require_relative 'advanced_billing/models/update_reason_code_request' -require_relative 'advanced_billing/models/update_segment_request' -require_relative 'advanced_billing/models/upsert_prepaid_configuration' -require_relative 'advanced_billing/models/void_invoice_request' -require_relative 'advanced_billing/models/webhook_response' -require_relative 'advanced_billing/models/subscription_group_customer' -require_relative 'advanced_billing/models/subscription_group_payment_profile' require_relative 'advanced_billing/models/' \ 'subscription_group_prepayment_response' +require_relative 'advanced_billing/models/subscription_group_response' require_relative 'advanced_billing/models/subscription_group_signup' require_relative 'advanced_billing/models/subscription_group_signup_component' -require_relative 'advanced_billing/models/subscription_migration_preview' -require_relative 'advanced_billing/models/' \ - 'subscription_migration_preview_options' -require_relative 'advanced_billing/models/subscription_note' -require_relative 'advanced_billing/models/update_component' -require_relative 'advanced_billing/models/update_payment_profile' -require_relative 'advanced_billing/models/update_price' -require_relative 'advanced_billing/models/update_product_price_point_request' -require_relative 'advanced_billing/models/update_subscription_component' -require_relative 'advanced_billing/models/update_subscription_note_request' -require_relative 'advanced_billing/models/upsert_prepaid_configuration_request' -require_relative 'advanced_billing/models/void_invoice' require_relative 'advanced_billing/models/subscription_group_signup_error' require_relative 'advanced_billing/models/subscription_group_signup_event_data' require_relative 'advanced_billing/models/' \ 'subscription_group_signup_failure_data' require_relative 'advanced_billing/models/subscription_group_signup_item' +require_relative 'advanced_billing/models/subscription_group_signup_request' require_relative 'advanced_billing/models/subscription_group_signup_response' +require_relative 'advanced_billing/models/subscription_group_single_error' +require_relative 'advanced_billing/models/subscription_group_subscription_error' +require_relative 'advanced_billing/models/subscription_group_update_error' +require_relative 'advanced_billing/models/subscription_included_coupon' +require_relative 'advanced_billing/models/subscription_migration_preview' +require_relative 'advanced_billing/models/' \ + 'subscription_migration_preview_options' +require_relative 'advanced_billing/models/' \ + 'subscription_migration_preview_request' require_relative 'advanced_billing/models/' \ 'subscription_migration_preview_response' require_relative 'advanced_billing/models/subscription_mrr' +require_relative 'advanced_billing/models/subscription_mrr_breakout' +require_relative 'advanced_billing/models/subscription_mrr_response' +require_relative 'advanced_billing/models/subscription_note' require_relative 'advanced_billing/models/subscription_note_response' +require_relative 'advanced_billing/models/subscription_preview' +require_relative 'advanced_billing/models/subscription_preview_response' require_relative 'advanced_billing/models/subscription_product_change' +require_relative 'advanced_billing/models/subscription_product_migration' require_relative 'advanced_billing/models/' \ 'subscription_product_migration_request' +require_relative 'advanced_billing/models/subscription_response' require_relative 'advanced_billing/models/subscription_state_change' +require_relative 'advanced_billing/models/tax_configuration' require_relative 'advanced_billing/models/too_many_management_link_requests' require_relative 'advanced_billing/models/update_allocation_expiration_date' +require_relative 'advanced_billing/models/update_component' +require_relative 'advanced_billing/models/update_component_price_point' +require_relative 'advanced_billing/models/update_component_price_point_request' require_relative 'advanced_billing/models/update_component_request' +require_relative 'advanced_billing/models/update_coupon_currency' +require_relative 'advanced_billing/models/update_currency_price' +require_relative 'advanced_billing/models/update_currency_prices_request' +require_relative 'advanced_billing/models/update_customer' require_relative 'advanced_billing/models/update_customer_request' +require_relative 'advanced_billing/models/update_metadata' +require_relative 'advanced_billing/models/update_metadata_request' +require_relative 'advanced_billing/models/update_metafield' require_relative 'advanced_billing/models/update_metafields_request' +require_relative 'advanced_billing/models/update_payment_profile' require_relative 'advanced_billing/models/update_payment_profile_request' +require_relative 'advanced_billing/models/update_price' require_relative 'advanced_billing/models/update_product_price_point' +require_relative 'advanced_billing/models/update_product_price_point_request' +require_relative 'advanced_billing/models/update_reason_code' +require_relative 'advanced_billing/models/update_reason_code_request' +require_relative 'advanced_billing/models/update_segment' +require_relative 'advanced_billing/models/update_segment_request' require_relative 'advanced_billing/models/update_subscription' +require_relative 'advanced_billing/models/update_subscription_component' require_relative 'advanced_billing/models/update_subscription_group' +require_relative 'advanced_billing/models/update_subscription_group_request' require_relative 'advanced_billing/models/update_subscription_note' +require_relative 'advanced_billing/models/update_subscription_note_request' +require_relative 'advanced_billing/models/update_subscription_request' +require_relative 'advanced_billing/models/upsert_prepaid_configuration' +require_relative 'advanced_billing/models/upsert_prepaid_configuration_request' require_relative 'advanced_billing/models/usage' require_relative 'advanced_billing/models/usage_response' +require_relative 'advanced_billing/models/void_invoice' require_relative 'advanced_billing/models/void_invoice_event_data' +require_relative 'advanced_billing/models/void_invoice_request' require_relative 'advanced_billing/models/void_remainder_event_data' -require_relative 'advanced_billing/models/subscription_group_item' -require_relative 'advanced_billing/models/subscription_group_response' -require_relative 'advanced_billing/models/subscription_group_signup_request' -require_relative 'advanced_billing/models/subscription_group_single_error' -require_relative 'advanced_billing/models/subscription_group_subscription_error' -require_relative 'advanced_billing/models/subscription_group_update_error' -require_relative 'advanced_billing/models/subscription_included_coupon' -require_relative 'advanced_billing/models/' \ - 'subscription_migration_preview_request' -require_relative 'advanced_billing/models/subscription_preview' -require_relative 'advanced_billing/models/subscription_response' -require_relative 'advanced_billing/models/tax_configuration' -require_relative 'advanced_billing/models/update_currency_prices_request' -require_relative 'advanced_billing/models/update_customer' -require_relative 'advanced_billing/models/update_reason_code' -require_relative 'advanced_billing/models/update_segment' -require_relative 'advanced_billing/models/update_subscription_group_request' -require_relative 'advanced_billing/models/update_subscription_request' require_relative 'advanced_billing/models/webhook' -require_relative 'advanced_billing/models/allocation_preview_direction' +require_relative 'advanced_billing/models/webhook_response' require_relative 'advanced_billing/models/all_vaults' -require_relative 'advanced_billing/models/bank_account_type' -require_relative 'advanced_billing/models/basic_date_field' -require_relative 'advanced_billing/models/card_type' -require_relative 'advanced_billing/models/component_kind' +require_relative 'advanced_billing/models/allocation_preview_direction' require_relative 'advanced_billing/models/allocation_preview_line_item_kind' +require_relative 'advanced_billing/models/apple_pay_vault' require_relative 'advanced_billing/models/auto_invite' require_relative 'advanced_billing/models/bank_account_holder_type' +require_relative 'advanced_billing/models/bank_account_type' require_relative 'advanced_billing/models/bank_account_vault' -require_relative 'advanced_billing/models/collection_method' -require_relative 'advanced_billing/models/apple_pay_vault' +require_relative 'advanced_billing/models/basic_date_field' require_relative 'advanced_billing/models/billing_manifest_line_item_kind' require_relative 'advanced_billing/models/cancellation_method' +require_relative 'advanced_billing/models/card_type' require_relative 'advanced_billing/models/chargeback_status' require_relative 'advanced_billing/models/cleanup_scope' +require_relative 'advanced_billing/models/collection_method' +require_relative 'advanced_billing/models/component_kind' require_relative 'advanced_billing/models/compounding_strategy' +require_relative 'advanced_billing/models/create_invoice_status' +require_relative 'advanced_billing/models/create_prepayment_method' require_relative 'advanced_billing/models/' \ 'create_signup_proforma_preview_include' +require_relative 'advanced_billing/models/credit_card_vault' require_relative 'advanced_billing/models/credit_note_status' +require_relative 'advanced_billing/models/credit_scheme' +require_relative 'advanced_billing/models/credit_type' +require_relative 'advanced_billing/models/currency_price_role' require_relative 'advanced_billing/models/custom_field_owner' +require_relative 'advanced_billing/models/debit_note_role' +require_relative 'advanced_billing/models/debit_note_status' require_relative 'advanced_billing/models/direction' -require_relative 'advanced_billing/models/downgrade_credit_credit_type' -require_relative 'advanced_billing/models/expiration_interval_unit' -require_relative 'advanced_billing/models/invoice_discount_source_type' -require_relative 'advanced_billing/models/invoice_event_type' -require_relative 'advanced_billing/models/create_invoice_status' -require_relative 'advanced_billing/models/credit_card_vault' -require_relative 'advanced_billing/models/credit_scheme' require_relative 'advanced_billing/models/discount_type' +require_relative 'advanced_billing/models/downgrade_credit_credit_type' require_relative 'advanced_billing/models/event_key' +require_relative 'advanced_billing/models/expiration_interval_unit' require_relative 'advanced_billing/models/failed_payment_action' +require_relative 'advanced_billing/models/first_charge_type' require_relative 'advanced_billing/models/group_target_type' require_relative 'advanced_billing/models/group_type' -require_relative 'advanced_billing/models/interval_unit' -require_relative 'advanced_billing/models/invoice_date_field' -require_relative 'advanced_billing/models/currency_price_role' require_relative 'advanced_billing/models/include_not_null' require_relative 'advanced_billing/models/include_null_or_not_null' -require_relative 'advanced_billing/models/create_prepayment_method' -require_relative 'advanced_billing/models/credit_type' -require_relative 'advanced_billing/models/debit_note_role' -require_relative 'advanced_billing/models/debit_note_status' -require_relative 'advanced_billing/models/first_charge_type' require_relative 'advanced_billing/models/include_option' -require_relative 'advanced_billing/models/invoice_discount_type' -require_relative 'advanced_billing/models/invoice_payment_method_type' -require_relative 'advanced_billing/models/invoice_role' +require_relative 'advanced_billing/models/interval_unit' require_relative 'advanced_billing/models/invoice_consolidation_level' +require_relative 'advanced_billing/models/invoice_date_field' +require_relative 'advanced_billing/models/invoice_discount_source_type' +require_relative 'advanced_billing/models/invoice_discount_type' require_relative 'advanced_billing/models/invoice_event_payment_method' +require_relative 'advanced_billing/models/invoice_event_type' +require_relative 'advanced_billing/models/invoice_payment_method_type' require_relative 'advanced_billing/models/invoice_payment_type' +require_relative 'advanced_billing/models/invoice_role' require_relative 'advanced_billing/models/invoice_sort_field' require_relative 'advanced_billing/models/invoice_status' +require_relative 'advanced_billing/models/item_category' require_relative 'advanced_billing/models/line_item_kind' +require_relative 'advanced_billing/models/line_item_transaction_type' +require_relative 'advanced_billing/models/list_components_price_points_include' require_relative 'advanced_billing/models/list_events_date_field' -require_relative 'advanced_billing/models/metafield_input' require_relative 'advanced_billing/models/list_prepayment_date_field' require_relative 'advanced_billing/models/list_products_include' require_relative 'advanced_billing/models/list_products_price_points_include' require_relative 'advanced_billing/models/list_subscription_components_include' require_relative 'advanced_billing/models/list_subscription_components_sort' -require_relative 'advanced_billing/models/item_category' -require_relative 'advanced_billing/models/line_item_transaction_type' -require_relative 'advanced_billing/models/list_components_price_points_include' -require_relative 'advanced_billing/models/proforma_invoice_discount_source_type' -require_relative 'advanced_billing/models/proforma_invoice_status' -require_relative 'advanced_billing/models/resource_type' +require_relative 'advanced_billing/models/metafield_input' require_relative 'advanced_billing/models/payment_type' -require_relative 'advanced_billing/models/pricing_scheme' -require_relative 'advanced_billing/models/proforma_invoice_role' require_relative 'advanced_billing/models/pay_pal_vault' -require_relative 'advanced_billing/models/price_point_type' -require_relative 'advanced_billing/models/recurring_scheme' -require_relative 'advanced_billing/models/resumption_charge' -require_relative 'advanced_billing/models/subscription_date_field' require_relative 'advanced_billing/models/prepayment_method' +require_relative 'advanced_billing/models/price_point_type' +require_relative 'advanced_billing/models/pricing_scheme' +require_relative 'advanced_billing/models/proforma_invoice_discount_source_type' +require_relative 'advanced_billing/models/proforma_invoice_role' +require_relative 'advanced_billing/models/proforma_invoice_status' require_relative 'advanced_billing/models/proforma_invoice_tax_source_type' require_relative 'advanced_billing/models/reactivation_charge' +require_relative 'advanced_billing/models/recurring_scheme' +require_relative 'advanced_billing/models/resource_type' require_relative 'advanced_billing/models/restriction_type' +require_relative 'advanced_billing/models/resumption_charge' require_relative 'advanced_billing/models/service_credit_type' require_relative 'advanced_billing/models/sorting_direction' require_relative 'advanced_billing/models/status' -require_relative 'advanced_billing/models/subscription_group_prepayment_method' -require_relative 'advanced_billing/models/tax_configuration_kind' -require_relative 'advanced_billing/models/tax_destination_address' -require_relative 'advanced_billing/models/trial_type' -require_relative 'advanced_billing/models/webhook_order' -require_relative 'advanced_billing/models/webhook_subscription' +require_relative 'advanced_billing/models/subscription_date_field' require_relative 'advanced_billing/models/subscription_group_include' +require_relative 'advanced_billing/models/subscription_group_prepayment_method' +require_relative 'advanced_billing/models/subscription_groups_list_include' require_relative 'advanced_billing/models/subscription_include' -require_relative 'advanced_billing/models/subscription_list_include' -require_relative 'advanced_billing/models/subscription_state_filter' -require_relative 'advanced_billing/models/upgrade_charge_credit_type' require_relative 'advanced_billing/models/subscription_list_date_field' -require_relative 'advanced_billing/models/subscription_groups_list_include' +require_relative 'advanced_billing/models/subscription_list_include' require_relative 'advanced_billing/models/subscription_purge_type' require_relative 'advanced_billing/models/subscription_sort' require_relative 'advanced_billing/models/subscription_state' +require_relative 'advanced_billing/models/subscription_state_filter' +require_relative 'advanced_billing/models/tax_configuration_kind' +require_relative 'advanced_billing/models/tax_destination_address' +require_relative 'advanced_billing/models/trial_type' +require_relative 'advanced_billing/models/upgrade_charge_credit_type' +require_relative 'advanced_billing/models/webhook_order' require_relative 'advanced_billing/models/webhook_status' +require_relative 'advanced_billing/models/webhook_subscription' # Exceptions require_relative 'advanced_billing/exceptions/api_exception' require_relative 'advanced_billing/exceptions/' \ 'component_allocation_error_exception' +require_relative 'advanced_billing/exceptions/' \ + 'component_price_point_error_exception' require_relative 'advanced_billing/exceptions/customer_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'error_array_map_response_exception' -require_relative 'advanced_billing/exceptions/' \ - 'error_string_map_response_exception' require_relative 'advanced_billing/exceptions/error_list_response_exception' require_relative 'advanced_billing/exceptions/' \ - 'component_price_point_error_exception' + 'error_string_map_response_exception' require_relative 'advanced_billing/exceptions/' \ 'event_based_billing_list_segments_errors_exception' +require_relative 'advanced_billing/exceptions/' \ + 'event_based_billing_segment_exception' require_relative 'advanced_billing/exceptions/' \ 'event_based_billing_segment_errors_exception' require_relative 'advanced_billing/exceptions/' \ - 'event_based_billing_segment_exception' + 'product_price_point_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'proforma_bad_request_error_response_exception' -require_relative 'advanced_billing/exceptions/single_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'refund_prepayment_base_errors_response_exception' +require_relative 'advanced_billing/exceptions/single_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'single_string_error_response_exception' -require_relative 'advanced_billing/exceptions/' \ - 'subscription_group_create_error_response_exception' -require_relative 'advanced_billing/exceptions/' \ - 'product_price_point_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'subscription_add_coupon_error_exception' require_relative 'advanced_billing/exceptions/' \ 'subscription_component_allocation_error_exception' +require_relative 'advanced_billing/exceptions/' \ + 'subscription_group_create_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'subscription_group_signup_error_response_exception' +require_relative 'advanced_billing/exceptions/' \ + 'subscription_group_update_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'subscription_remove_coupon_errors_exception' require_relative 'advanced_billing/exceptions/' \ 'subscription_response_error_exception' require_relative 'advanced_billing/exceptions/' \ 'subscriptions_mrr_error_response_exception' -require_relative 'advanced_billing/exceptions/' \ - 'subscription_group_update_error_response_exception' require_relative 'advanced_billing/exceptions/' \ 'too_many_management_link_requests_error_exception' diff --git a/lib/advanced_billing/controllers/base_controller.rb b/lib/advanced_billing/controllers/base_controller.rb index 002a87d..1f1beee 100644 --- a/lib/advanced_billing/controllers/base_controller.rb +++ b/lib/advanced_billing/controllers/base_controller.rb @@ -10,7 +10,7 @@ class BaseController attr_accessor :config, :http_call_back def self.user_agent - 'AB SDK Ruby:9.0.0 on OS {os-info}' + 'AB SDK Ruby:9.1.0 on OS {os-info}' end def self.user_agent_parameters diff --git a/lib/advanced_billing/controllers/components_controller.rb b/lib/advanced_billing/controllers/components_controller.rb index 5b9c729..a825d2e 100644 --- a/lib/advanced_billing/controllers/components_controller.rb +++ b/lib/advanced_billing/controllers/components_controller.rb @@ -10,9 +10,9 @@ class ComponentsController < BaseController # **metered_component** under the specified product family. Metered # component can then be added and “allocated” for a subscription. # Metered components are used to bill for any type of unit that resets to 0 - # at the end of the billing period (think daily Google Adwords clicks or - # monthly cell phone minutes). This is most commonly associated with - # usage-based billing and many other pricing schemes. + # at the end of the billing period (think daily Google Ads clicks or monthly + # cell phone minutes). This is most commonly associated with usage-based + # billing and many other pricing schemes. # Note that this is different from recurring quantity-based components, # which DO NOT reset to zero at the start of every billing period. If you # want to bill for a quantity of something that does not change unless you diff --git a/lib/advanced_billing/controllers/invoices_controller.rb b/lib/advanced_billing/controllers/invoices_controller.rb index 8eade0d..fb9fa83 100644 --- a/lib/advanced_billing/controllers/invoices_controller.rb +++ b/lib/advanced_billing/controllers/invoices_controller.rb @@ -10,9 +10,9 @@ class InvoicesController < BaseController # ## Partial Refund for Consolidated Invoice # A refund less than the total of a consolidated invoice will be split # across its segments. - # A $50.00 refund on a $100.00 consolidated invoice with one $60.00 and one - # $40.00 segment, the refunded amount will be applied as 50% of each ($30.00 - # and $20.00 respectively). + # For a $50.00 refund on a $100.00 consolidated invoice with one $60.00 + # segment and one $40.00 segment, the refunded amount will be applied as 50% + # of each ($30.00 and $20.00, respectively). # @param [String] uid Required parameter: The unique identifier for the # invoice, this does not refer to the public facing invoice number. # @param [RefundInvoiceRequest] body Optional parameter: TODO: type @@ -297,8 +297,8 @@ def record_payment_for_invoice(uid, # This API call should be used when you want to record an external payment # against multiple invoices. - # In order apply a payment to multiple invoices, at minimum, specify the - # `amount` and `applications` (i.e., `invoice_uid` and `amount`) details. + # To apply a payment to multiple invoices, at minimum, specify the `amount` + # and `applications` (i.e., `invoice_uid` and `amount`) details. # ``` # { # "payment": { @@ -604,10 +604,10 @@ def list_consolidated_invoice_segments(options = {}) # ``` # The price for each line item will be calculated as well as a total due # amount for the invoice. Multiple line items can be sent. - # ### Line items types - # When defining line item, You can choose one of 3 types for one line item: + # ### Line item types + # When defining a line item, You can choose one of 3 types for a line item: # #### Custom item - # Like in basic behavior example above, You can pass `title` and + # As shown in the basic behavior example, You can pass `title` and # `unit_price` for custom item. # #### Product id # Product handle (with handle: prefix) or id from the scope of current @@ -622,7 +622,7 @@ def list_consolidated_invoice_segments(options = {}) # is used, following fields cannot be used: `title`, `product_id`. By # default `unit_price` is taken from product's default price point, but can # be overwritten by passing `unit_price` or `price_point_id`. At this moment - # price points are supportted only for quantity based, on/off and metered + # price points are supported only for quantity based, on/off and metered # components. For prepaid and event based billing components `unit_price` is # required. # ### Coupons @@ -750,9 +750,11 @@ def list_consolidated_invoice_segments(options = {}) # description for line item. # ### Invoice Options # #### Issue Date - # By default, invoices will be created with a issue date set to today. - # `issue_date` parameter can be send to alter that. Only dates in the past - # can be send. `issue_date` should be send in `YYYY-MM-DD` format. + # By default, invoices will be created with a issue date set to today in + # your site's time zone. The `issue_date` parameter can be sent to alter the + # default. Only today or dates in the past are accepted. This date is + # interpreted and validated in your site's time zone. The format for + # `issue_date` is `YYYY-MM-DD`. # #### Net Terms # By default, invoices will be created with a due date matching the date of # invoice creation. If a different due date is desired, the `net_terms` @@ -766,7 +768,7 @@ def list_consolidated_invoice_segments(options = {}) # #### Memo and Payment Instructions # A custom memo can be sent with the `memo` parameter to override the site's # default. Likewise, custom payment instructions can be sent with the - # `payment_instrucions` parameter. + # `payment_instructions` parameter. # #### Status # By default, invoices will be created with open status. Possible # alternative is `draft`. @@ -844,10 +846,10 @@ def send_invoice(uid, .execute end - # Customer information may change after an invoice is issued which may lead - # to a mismatch between customer information that are present on an open - # invoice and actual customer information. This endpoint allows to preview - # these differences, if any. + # Customer information may change after an invoice is issued, which may lead + # to a mismatch between customer information that is present on an open + # invoice and actual customer information. This endpoint allows you to + # preview these differences, if any. # The endpoint doesn't accept a request body. Customer information # differences are calculated on the application side. # @param [String] uid Required parameter: The unique identifier for the @@ -879,7 +881,7 @@ def preview_customer_information_changes(uid) # This endpoint updates customer information on an open invoice and returns # the updated invoice. If you would like to preview changes that will be # applied, use the `/invoices/{uid}/customer_information/preview.json` - # endpoint before. + # endpoint first. # The endpoint doesn't accept a request body. Customer information # differences are calculated on the application side. # @param [String] uid Required parameter: The unique identifier for the @@ -916,11 +918,11 @@ def update_customer_information(uid) # subscription in a group. # For Remittance subscriptions, the invoice will go into "open" status and # payment won't be attempted. The value for `on_failed_payment` would be - # rejected if sent. Any prepayments or service credits that exist on - # subscription will be automatically applied. Additionally, if setting is - # on, an email will be sent for issued invoice. + # rejected if sent. Any prepayments or service credits that exist on the + # subscription will be automatically applied. Additionally, if the setting + # is enabled, an email will be sent for the issued invoice. # For Automatic subscriptions, prepayments and service credits will apply to - # the invoice and before payment is attempted. On successful payment, the + # the invoice before payment is attempted. On successful payment, the # invoice will go into "paid" status and email will be sent to the customer # (if setting applies). When payment fails, the next event depends on the # `on_failed_payment` value: diff --git a/lib/advanced_billing/controllers/payment_profiles_controller.rb b/lib/advanced_billing/controllers/payment_profiles_controller.rb index 2186c51..4a5b4e1 100644 --- a/lib/advanced_billing/controllers/payment_profiles_controller.rb +++ b/lib/advanced_billing/controllers/payment_profiles_controller.rb @@ -22,8 +22,8 @@ class PaymentProfilesController < BaseController # [PCI # compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Co # mpliance#pci-compliance-0-0) on your end. If your business is not PCI - # compliant, use - # [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Char + # compliant, use [Maxio.js (formerly + # Chargify.js)](https://docs.maxio.com/hc/en-us/articles/38163190843789-Char # gify-js-Overview#chargify-js-overview-0-0) to collect credit card or bank # account information. # See the following articles to learn more about subscriptions and payments: @@ -39,26 +39,26 @@ class PaymentProfilesController < BaseController # + # [Taxes](https://developers.chargify.com/docs/developer-docs/d2e9e34db740e- # signups#taxes) - # + - # [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Char + # + [Maxio.js (formerly + # Chargify.js)](https://docs.maxio.com/hc/en-us/articles/38163190843789-Char # gify-js-Overview) - # + [Chargify.js with GoCardless - minimal + # + [Maxio.js with GoCardless - minimal # example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples# # h_01K0PJ15QQZKCER8CFK40MR6XJ) - # + [Chargify.js with GoCardless - full + # + [Maxio.js with GoCardless - full # example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples# # h_01K0PJ15QR09JVHWW0MCA7HVJV) - # + [Chargify.js with Stripe Direct Debit - minimal + # + [Maxio.js with Stripe Direct Debit - minimal # example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples# # h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) - # + [Chargify.js with Stripe Direct Debit - full + # + [Maxio.js with Stripe Direct Debit - full # example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples# # h_01K0PJ15QRECQQ4ECS3ZA55GY7) - # + [Chargify.js with Stripe BECS Direct Debit - minimal + # + [CMaxio.js with Stripe BECS Direct Debit - minimal # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN # DIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway # ) - # + [Chargify.js with Stripe BECS Direct Debit - full + # + [Maxio.js with Stripe BECS Direct Debit - full # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN # DIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) # + [Full documentation on @@ -73,79 +73,15 @@ class PaymentProfilesController < BaseController # + [Full documentation on Stripe BACS Direct # Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-S # EPA-and-BECS-Direct-Debit) - # ## 3D Secure Authentication during payment profile creation. - # When a payment requires 3D Secure Authentication to adhear to Strong - # Customer Authentication (SCA) during payment profile creation, the request - # enters a [post-authentication - # flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-I - # mplementing-3D-Secure#psd2-flows-pre-authentication-and-post-authenticatio - # n). In this case, a 422 Unprocessable Entity status is returned with the - # following response: - # ```json - # { - # "jsonapi": { - # "version": "1.0" - # }, - # "errors": [ - # { - # "title": "This card requires 3DSecure verification.", - # "detail": "This card requires 3D secure authentication. - # Redirect the customer to the URL from the action_link attribute to - # authenticate. Attach callback_url param to this URL if you want to be - # notified about the result of 3D Secure authentication. Attach redirect_url - # param to this URL if you want to redirect a customer back to your page - # after 3D Secure authentication. Example: - # https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uhk - # bodx5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost:4000&red - # irect_url=https://yourpage.com will do a POST request to - # https://localhost:4000 after credit card is authenticated and will - # redirect a customer to https://yourpage.com after 3DS authentication.", - # "links": { - # "action_link": - # "https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uh - # kbodx5jhvkg6yeu?one_time_token_id=93" - # } - # } - # ] - # } - # ``` - # To let the customer go through 3D Secure Authentication, they need to be - # redirected to the URL specified in `action_link`. - # Optionally, you can specify the `callback_url` parameter in the - # `action_link` URL to receive notification about the result of 3D Secure - # Authentication. - # The `callback_url` will return the following information: - # - whether the authentication was successful (`success`) - # - the payment profile ID (`payment_profile_id`) - # You can also specify a `redirect_url` parameter in the `action_link` URL - # to redirect the customer back to your site. - # You cannot use action_link in an iframe inside a custom application. You - # must redirect the customer directly to the `action_link` and use the - # `redirect_url` or `callback_url` to be notified of the result. - # The final URL that you send a customer to complete 3D Secure may resemble - # the following, where the first half is the `action_link` and the second - # half contains a `redirect_url` and `callback_url`: - # - # `https://checkout-test.chargifypay.test/3d-secure/checkout/pay_uerzhsxd5uh - # kbodx5jhvkg6yeu?one_time_token_id=93&callback_url=http://localhost:4000&re - # direct_url=https://yourpage.com` - # ### Example Redirect Flow - # Here's an example flow to redirect customers to different pages depending - # on whether SCA was performed successfully: - # 1. Create a payment profile via the API; it requires 3DS. - # 2. You receive an `action_link` in the response. - # 3. Use this `action_link` to, for example, connect with your internal - # resources or generate a `session_id`. - # 4. Include one of those attributes inside the `callback_url` and - # `redirect_url` to be aware which “session” this applies to. - # 5. Redirect the customer to the `action_link` with `callback_url` and - # `redirect_url` applied - # 6. After the customer completes 3DS authentication, we notify you of the - # result via the applied `callback_url`. - # 7. After that, we redirect the customer to the `redirect_url`; at this - # point the result of authentication is known. - # 8. Optionally, you can use the applied "msg" param in the `redirect_url` - # to determine if the redirect was successful. + # ## 3D Secure (3DS) Authentication post-authentication flow + # When a payment requires 3DS Authentication to adhere to Strong Customer + # Authentication (SCA), the request enters a post-authentication flow where + # a 422 Unprocessable Entity status is returned with an action_link that + # will direct the customer through 3DS Authentication. + # See the [3D Secure Post-Authentication + # Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Po + # st-Authentication-Flow) article in the product documentation to learn how + # to manage the redirect flow. # @param [CreatePaymentProfileRequest] body Optional parameter: When # following the IBAN or the Local Bank details examples, a customer, bank # account and mandate will be created in your current vault. If the diff --git a/lib/advanced_billing/controllers/sites_controller.rb b/lib/advanced_billing/controllers/sites_controller.rb index f533017..3d9475d 100644 --- a/lib/advanced_billing/controllers/sites_controller.rb +++ b/lib/advanced_billing/controllers/sites_controller.rb @@ -6,14 +6,14 @@ module AdvancedBilling # SitesController class SitesController < BaseController - # This endpoint allows you to fetch some site data. + # Retrieves site data. # Full documentation on Sites in the Advanced Billing UI can be located # [here](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites). # Specifically, the [Clearing Site # Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing- - # Site-Data) section is extremely relevant to this endpoint documentation. + # Site-Data) section is relevant to this endpoint documentation. # #### Relationship invoicing enabled - # If site has RI enabled then you will see more settings like: + # If the site has RI enabled then you will see more settings like: # "customer_hierarchy_enabled": true, # "whopays_enabled": true, # "whopays_default_payer": "self" @@ -35,10 +35,11 @@ def read_site .execute end - # This call is asynchronous and there may be a delay before the site data is - # fully deleted. If you are clearing site data for an automated test, you - # will need to build in a delay and/or check that there are no products, - # etc., in the site before proceeding. + # Clears all data from a test site asynchronously. This call is asynchronous + # and there may be a delay before the site data is fully deleted. If you are + # clearing site data for an automated test, you will need to build in a + # delay and/or check that there are no products, etc., in the site before + # proceeding. # **This functionality will only work on sites in TEST mode. Attempts to # perform this on sites in “live” mode will result in a response of 403 # FORBIDDEN.** @@ -60,7 +61,7 @@ def clear_site(cleanup_scope: CleanupScope::ALL) .execute end - # This endpoint returns public keys used for Chargify.js. + # Returns public keys used for Maxio.js (formerly Chargify.js). # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start diff --git a/lib/advanced_billing/controllers/subscription_components_controller.rb b/lib/advanced_billing/controllers/subscription_components_controller.rb index 2163bd3..fa2faa7 100644 --- a/lib/advanced_billing/controllers/subscription_components_controller.rb +++ b/lib/advanced_billing/controllers/subscription_components_controller.rb @@ -6,8 +6,7 @@ module AdvancedBilling # SubscriptionComponentsController class SubscriptionComponentsController < BaseController - # This request will list information regarding a specific component owned by - # a subscription. + # Returns information for a specific component on a subscription. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] component_id Required parameter: The Advanced Billing id @@ -37,7 +36,7 @@ def read_subscription_component(subscription_id, .execute end - # This request will list a subscription's applied components. + # Lists a subscription's applied components. # ## Archived Components # When requesting to list components for a given subscription, if the # subscription contains **archived** components they will be listed in the @@ -177,8 +176,8 @@ def bulk_reset_subscription_components_price_points(subscription_id) # Quantity, On/Off, and Prepaid Components. # When creating an allocation via the API, you can pass the # `upgrade_charge`, `downgrade_credit`, and `accrue_charge` to be applied. - # > **Note:** These proration and accural fields are ignored for Prepaid - # Components since this component type always generate charges immediately + # > **Note:** These proration and accrual fields are ignored for Prepaid + # Components since this component type always generates charges immediately # without proration. # For information on prorated components and upgrade/downgrade schemes, see # [Setting Component @@ -202,7 +201,7 @@ def bulk_reset_subscription_components_price_points(subscription_id) # > **Note:** Proration uses the current price of the component as well as # the current tax rates. Changes to either may cause the prorated # charge/credit to be wrong. - # For more informaiton see the [Component + # For more information, see the [Component # Allocations](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Co # mponent-Allocations-Overview) product Documentation. # @param [Integer] subscription_id Required parameter: The Chargify id of @@ -240,8 +239,7 @@ def allocate_component(subscription_id, .execute end - # This endpoint returns the 50 most recent Allocations, ordered by most - # recent first. + # Returns the 50 most recent Allocations, ordered by most recent first. # ## On/Off Components # When a subscription's on/off component has been toggled to on (`1`) or off # (`0`), usage will be logged in this response. @@ -288,8 +286,8 @@ def list_allocations(subscription_id, end # Creates multiple allocations, sets the current allocated quantity for each - # of the components, and recording a memo. A `component_id` is required - # for each allocation. + # of the components, and records a memo. A `component_id` is required for + # each allocation. # The charges and/or credits that are created will be rolled up into a # single total which is used to determine whether this is an upgrade or a # downgrade. @@ -311,9 +309,9 @@ def list_allocations(subscription_id, # > **Note:** Proration uses the current price of the component as well as # the current tax rates. Changes to either may cause the prorated # charge/credit to be wrong. - # For more informaiton see the [Component + # For more information, see the [Component # Allocations](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Co - # mponent-Allocations-Overview) product Documentation. + # mponent-Allocations-Overview) product documentation. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [AllocateComponents] body Optional parameter: TODO: type @@ -347,10 +345,10 @@ def allocate_components(subscription_id, .execute end - # Advanced Billing offers the ability to preview a potential subscription's - # **quantity-based** or **on/off** component allocation in the middle of the - # current billing period. This is useful if you want users to be able to - # see the effect of a component operation before actually doing it. + # Previews a potential subscription's **quantity-based** or **on/off** + # component allocation in the middle of the current billing period. This is + # useful if you want users to be able to see the effect of a component + # operation before actually doing it. # ## Fine-grained Component Control: Use with multiple `upgrade_charge`s or # `downgrade_credits` # When the allocation uses multiple different types of `upgrade_charge`s or @@ -388,10 +386,9 @@ def preview_allocations(subscription_id, .execute end - # When the expiration interval options are selected on a prepaid usage - # component price point, all allocations will be created with an expiration - # date. This expiration date can be changed after the fact to allow for - # extending or shortening the allocation's active window. + # Updates the expiration date for a prepaid usage allocation. This + # expiration date can be changed after the fact to allow for extending or + # shortening the allocation's active window. # In order to change a prepaid usage allocation's expiration date, a PUT # call must be made to the allocation's endpoint with a new expiration date. # ## Limitations @@ -444,10 +441,11 @@ def update_prepaid_usage_allocation_expiration_date(subscription_id, .execute end + # Deletes a prepaid usage allocation. # Prepaid Usage components are unique in that their allocations are always # additive. In order to reduce a subscription's allocated quantity for a - # prepaid usage component each allocation must be destroyed individually via - # this endpoint. + # prepaid usage component, each allocation must be destroyed individually + # via this endpoint. # ## Credit Scheme # By default, destroying an allocation will generate a service credit on the # subscription. This behavior can be modified with the optional @@ -512,13 +510,13 @@ def delete_prepaid_usage_allocation(subscription_id, # record component usage against a subscription, see the following # resources: # It is not possible to record metered usage for more than one component at - # a time Usage should be reported as one API call per component on a single + # a time. Usage should be reported as one API call per component on a single # subscription. For example, to record that a subscriber has sent both an # SMS Message and an Email, send an API call for each. - # See the following product documention articles for more information: + # See the following product documentation articles for more information: # - [Create and Manage # Components](https://maxio.zendesk.com/hc/en-us/articles/24261149711501-Cre - # ate-Edit-and-Archive-Components). A + # ate-Edit-and-Archive-Components) # - [Recording Metered Component # Usage](https://maxio.zendesk.com/hc/en-us/articles/24251890500109-Reportin # g-Component-Allocations#reporting-metered-component-usage) @@ -610,9 +608,9 @@ def create_usage(subscription_id_or_reference, .execute end - # This request will return a list of the usages associated with a - # subscription for a particular metered component. This will display the - # previously recorded components for a subscription. + # Returns a list of usages associated with a subscription for a particular + # metered component. This will display the previously recorded components + # for a subscription. # This endpoint is not compatible with quantity-based components. # ## Since Date and Until Date Usage # Note: The `since_date` and `until_date` attributes each default to @@ -692,6 +690,7 @@ def list_usages(options = {}) .execute end + # Activates an event-based component for a single subscription. # In order to bill your subscribers on your Events data under the # Events-Based Billing feature, the components must be activated for the # subscriber. @@ -734,9 +733,9 @@ def activate_event_based_component(subscription_id, .execute end - # Use this endpoint to deactivate an event-based component for a single - # subscription. Deactivating the event-based component causes Advanced - # Billing to ignore related events at subscription renewal. + # Deactivates an event-based component for a single subscription. + # Deactivating the event-based component causes Advanced Billing to ignore + # related events at subscription renewal. # @param [Integer] subscription_id Required parameter: The Advanced Billing # id of the subscription # @param [Integer] component_id Required parameter: The Advanced Billing id @@ -760,6 +759,7 @@ def deactivate_event_based_component(subscription_id, .execute end + # Records a single event for Events-Based Billing. # ## Documentation # Events-Based Billing is an evolved form of metered billing that is based # on data-rich events streamed in real-time from your system to Advanced @@ -806,7 +806,7 @@ def record_event(api_handle, .execute end - # Use this endpoint to record a collection of events. + # Records a collection of events. # *Note: this endpoint differs from the standard Chargify API endpoints in # that the subdomain will be `events` and your site subdomain will be # included in the URL path.* @@ -840,7 +840,7 @@ def bulk_record_events(api_handle, .execute end - # This request will list components applied to each subscription. + # Lists components applied to each subscription. # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start diff --git a/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb b/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb index a5e1483..b95cfce 100644 --- a/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +++ b/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb @@ -6,10 +6,9 @@ module AdvancedBilling # SubscriptionGroupInvoiceAccountController class SubscriptionGroupInvoiceAccountController < BaseController - # A prepayment can be added for a subscription group identified by the - # group's `uid`. This endpoint requires a `amount`, `details`, `method`, and - # `memo`. On success, the prepayment will be added to the group's prepayment - # balance. + # Adds a prepayment for a subscription group. This endpoint requires an + # `amount`, `details`, `method`, and `memo`. On success, the prepayment will + # be added to the group's prepayment balance. # @param [String] uid Required parameter: The uid of the subscription # group # @param [SubscriptionGroupPrepaymentRequest] body Optional parameter: TODO: @@ -39,7 +38,7 @@ def create_subscription_group_prepayment(uid, .execute end - # This request will list a subscription group's prepayments. + # Lists a subscription group's prepayments. # @param [String] uid Required parameter: The uid of the subscription # group # @param [Integer] page Optional parameter: Result records are organized in @@ -79,10 +78,9 @@ def list_prepayments_for_subscription_group(options = {}) .execute end - # Credit can be issued for a subscription group identified by the group's - # `uid`. Credit will be added to the group in the amount specified in the - # request body. The credit will be applied to group member invoices as they - # are generated. + # Issues service credit for a subscription group. Credit will be added to + # the group in the amount specified in the request body. The credit will be + # applied to group member invoices as they are generated. # @param [String] uid Required parameter: The uid of the subscription # group # @param [IssueServiceCreditRequest] body Optional parameter: TODO: type @@ -112,9 +110,8 @@ def issue_subscription_group_service_credit(uid, .execute end - # Credit can be deducted for a subscription group identified by the group's - # `uid`. Credit will be deducted from the group in the amount specified in - # the request body. + # Deducts service credit for a subscription group. Credit will be deducted + # from the group in the amount specified in the request body. # @param [String] uid Required parameter: The uid of the subscription # group # @param [DeductServiceCreditRequest] body Optional parameter: TODO: type diff --git a/lib/advanced_billing/controllers/subscription_group_status_controller.rb b/lib/advanced_billing/controllers/subscription_group_status_controller.rb index 34316d5..1eca8c8 100644 --- a/lib/advanced_billing/controllers/subscription_group_status_controller.rb +++ b/lib/advanced_billing/controllers/subscription_group_status_controller.rb @@ -41,9 +41,9 @@ def cancel_subscriptions_in_group(uid, .execute end - # This endpoint will schedule all subscriptions within the specified group - # to be canceled at the end of their billing period. The group is identified - # by its uid passed in the URL. + # Schedules all subscriptions within the specified group to be canceled at + # the end of their billing period. The group is identified by its uid passed + # in the URL. # All subscriptions in the group must be on automatic billing in order to # successfully cancel them, and the group must not be in a "past_due" state. # @param [String] uid Required parameter: The uid of the subscription @@ -67,6 +67,7 @@ def initiate_delayed_cancellation_for_group(uid) .execute end + # Removes the delayed cancellation on a subscription group. # Removing the delayed cancellation on a subscription group will ensure that # the subscriptions do not get canceled at the end of the period. The # request will reset the `cancel_at_end_of_period` flag to false on each @@ -92,12 +93,12 @@ def cancel_delayed_cancellation_for_group(uid) .execute end - # This endpoint will attempt to reactivate or resume a cancelled - # subscription group. Upon reactivation, any canceled invoices created after - # the beginning of the primary subscription's billing period will be - # reopened and payment will be attempted on them. If the subscription group - # is being reactivated (as opposed to resumed), new charges will also be - # assessed for the new billing period. + # Reactivates or resumes a cancelled subscription group. Upon reactivation, + # any canceled invoices created after the beginning of the primary + # subscription's billing period will be reopened and payment will be + # attempted on them. If the subscription group is being reactivated (as + # opposed to resumed), new charges will also be assessed for the new billing + # period. # Whether a subscription group is reactivated (a new billing period is # created) or resumed (the current billing period is respected) will depend # on the parameters that are sent with the request as well as the date of @@ -106,11 +107,11 @@ def cancel_delayed_cancellation_for_group(uid) # If a subscription group is cancelled and reactivated within the primary # subscription's current period, we can choose to either start a new billing # period or maintain the existing one. If we want to maintain the existing - # billing period the `resume=true` option must be passed in request + # billing period, the `resume=true` option must be passed in request # parameters. # An exception to the above are subscriptions that are on calendar billing. # These subscriptions cannot be reactivated within the current period. If - # the `resume=true` option is not passed the request will return an error. + # the `resume=true` option is not passed, the request will return an error. # The `resume_members` option is ignored in this case. All eligible group # members will be automatically resumed. # ## Reactivating beyond the current period @@ -125,6 +126,15 @@ def cancel_delayed_cancellation_for_group(uid) # For calendar billing subscriptions, the new billing period created will be # a partial one, spanning from the date of reactivation to the next # corresponding calendar renewal date. + # ## 3D Secure (3DS) Authentication post-authentication flow + # When a payment requires 3DS Authentication to adhere to Strong Customer + # Authentication (SCA), the request enters a post-authentication flow where + # a 422 Unprocessable Entity status is returned with an action_link that + # will direct the customer through 3DS Authentication. + # See the [3D Secure Post-Authentication + # Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Po + # st-Authentication-Flow) article in the product documentation to learn how + # to manage the redirect flow. # @param [String] uid Required parameter: The uid of the subscription # group # @param [ReactivateSubscriptionGroupRequest] body Optional parameter: TODO: diff --git a/lib/advanced_billing/controllers/subscription_groups_controller.rb b/lib/advanced_billing/controllers/subscription_groups_controller.rb index 74ae982..ea30b65 100644 --- a/lib/advanced_billing/controllers/subscription_groups_controller.rb +++ b/lib/advanced_billing/controllers/subscription_groups_controller.rb @@ -6,8 +6,8 @@ module AdvancedBilling # SubscriptionGroupsController class SubscriptionGroupsController < BaseController - # Create multiple subscriptions at once under the same customer and - # consolidate them into a subscription group. + # Creates multiple subscriptions at once under the same customer and + # consolidates them into a subscription group. # You must provide one and only one of the # `payer_id`/`payer_reference`/`payer_attributes` for the customer attached # to the group. @@ -15,13 +15,14 @@ class SubscriptionGroupsController < BaseController # `payment_profile_id`/`credit_card_attributes`/`bank_account_attributes` # for the payment profile attached to the group. # Only one of the `subscriptions` can have `"primary": true` attribute set. - # When passing product to a subscription you can use either `product_id` or - # `product_handle` or `offer_id`. You can also use `custom_price` instead. + # When passing a product to a subscription you can use either `product_id` + # or `product_handle` or `offer_id`. You can also use `custom_price` + # instead. # The subscription request examples below will be split into two sections. # The first section, "Subscription Customization", will focus on passing # different information with a subscription, such as components, calendar # billing, and custom fields. These examples will presume you are using a - # secure chargify_token generated by Chargify.js. + # secure chargify_token generated by Maxio.js (formerly Chargify.js). # @param [SubscriptionGroupSignupRequest] body Optional parameter: TODO: # type description here # @return [SubscriptionGroupSignupResponse] Response from the API call. @@ -108,7 +109,7 @@ def list_subscription_groups(options = {}) .execute end - # Use this endpoint to find subscription group details. + # Returns subscription group details. # #### Current Billing Amount in Cents # Current billing amount for the subscription group is not returned by # default. If this information is desired, the @@ -139,11 +140,11 @@ def read_subscription_group(uid, .execute end - # Use this endpoint to update subscription group members. + # Updates subscription group members. # `"member_ids"` should contain an array of both subscription IDs to set as # group members and subscription IDs already present in the groups. Not - # including them will result in removing them from subscription group. To - # clean up members, just leave the array empty. + # including them will result in removing them from the subscription group. + # To clean up members, just leave the array empty. # @param [String] uid Required parameter: The uid of the subscription # group # @param [UpdateSubscriptionGroupRequest] body Optional parameter: TODO: @@ -197,8 +198,9 @@ def delete_subscription_group(uid) .execute end - # Use this endpoint to find subscription group associated with subscription. - # If the subscription is not in a group endpoint will return 404 code. + # Finds the subscription group associated with a subscription. + # If the subscription is not in a group, the endpoint will return a 404 + # code. # @param [String] subscription_id Required parameter: The Advanced Billing # id of the subscription associated with the subscription group # @return [FullSubscriptionGroupResponse] Response from the API call. @@ -280,7 +282,7 @@ def add_subscription_to_group(subscription_id, # ed-Billing-Invoices-Overview) and [Customer # Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Cust # omer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to - # remove existing subscription from subscription group. + # remove an existing subscription from a subscription group. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @return [void] Response from the API call. diff --git a/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb b/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb index d078bd5..925e1a0 100644 --- a/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +++ b/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb @@ -28,7 +28,7 @@ def read_account_balances(subscription_id) .execute end - # ## Create Prepayment + # Creates a prepayment for a subscription. # In order to specify a prepayment made against a subscription, specify the # `amount, memo, details, method`. # When the `method` specified is `"credit_card_on_file"`, the prepayment @@ -36,6 +36,15 @@ def read_account_balances(subscription_id) # applied to the prepayment account balance. This is especially useful for # manual replenishment of prepaid subscriptions. # Note that passing `amount_in_cents` is now allowed. + # ## 3D Secure (3DS) Authentication post-authentication flow + # When a payment requires 3DS Authentication to adhere to Strong Customer + # Authentication (SCA), the request enters a post-authentication flow where + # a 422 Unprocessable Entity status is returned with an action_link that + # will direct the customer through 3DS Authentication. + # See the [3D Secure Post-Authentication + # Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Po + # st-Authentication-Flow) article in the product documentation to learn how + # to manage the redirect flow. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [CreatePrepaymentRequest] body Optional parameter: TODO: type @@ -65,7 +74,7 @@ def create_prepayment(subscription_id, .execute end - # This request will list a subscription's prepayments. + # Lists a subscription's prepayments. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] page Optional parameter: Result records are organized in @@ -105,9 +114,8 @@ def list_prepayments(options = {}) .execute end - # Credit will be added to the subscription in the amount specified in the - # request body. The credit is subsequently applied to the next generated - # invoice. + # Adds a service credit to the subscription in the specified amount. The + # credit is subsequently applied to the next generated invoice. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [IssueServiceCreditRequest] body Optional parameter: TODO: type @@ -137,9 +145,9 @@ def issue_service_credit(subscription_id, .execute end - # Credit will be removed from the subscription in the amount specified in - # the request body. The credit amount being deducted must be equal to or - # less than the current credit balance. + # Deducts a service credit from the subscription in the specified amount. + # The credit amount being deducted must be equal to or less than the current + # credit balance. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [DeductServiceCreditRequest] body Optional parameter: TODO: type @@ -167,7 +175,7 @@ def deduct_service_credit(subscription_id, .execute end - # This request will list a subscription's service credits. + # Lists a subscription's service credits. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] page Optional parameter: Result records are organized in @@ -213,10 +221,10 @@ def list_service_credits(subscription_id, .execute end - # This endpoint will refund, completely or partially, a particular - # prepayment applied to a subscription. The `prepayment_id` will be the - # account transaction ID of the original payment. The prepayment must have - # some amount remaining in order to be refunded. + # Refunds a prepayment applied to a subscription, either fully or partially. + # The `prepayment_id` will be the account transaction ID of the original + # payment. The prepayment must have some amount remaining in order to be + # refunded. # The amount may be passed either as a decimal, with `amount`, or an integer # in cents, with `amount_in_cents`. # @param [Integer] subscription_id Required parameter: The Chargify id of diff --git a/lib/advanced_billing/controllers/subscription_notes_controller.rb b/lib/advanced_billing/controllers/subscription_notes_controller.rb index b5d4892..0b43c6e 100644 --- a/lib/advanced_billing/controllers/subscription_notes_controller.rb +++ b/lib/advanced_billing/controllers/subscription_notes_controller.rb @@ -6,7 +6,7 @@ module AdvancedBilling # SubscriptionNotesController class SubscriptionNotesController < BaseController - # Use the following method to create a note for a subscription. + # Creates a note for a subscription. # ## How to Use Subscription Notes # Notes allow you to record information about a particular Subscription in a # free text format. @@ -45,8 +45,8 @@ def create_subscription_note(subscription_id, .execute end - # Use this method to retrieve a list of Notes associated with a - # Subscription. The response will be an array of Notes. + # Retrieves a list of notes associated with a subscription. The response + # will be an array of Notes. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] page Optional parameter: Result records are organized in @@ -84,8 +84,7 @@ def list_subscription_notes(options = {}) .execute end - # Once you have obtained the ID of the note you wish to read, use this - # method to show a particular note attached to a subscription. + # Retrieves a specific note attached to a subscription. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] note_id Required parameter: The Advanced Billing id of @@ -111,7 +110,7 @@ def read_subscription_note(subscription_id, .execute end - # Use the following method to update a note for a Subscription. + # Updates a note for a subscription. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] note_id Required parameter: The Advanced Billing id of diff --git a/lib/advanced_billing/controllers/subscription_products_controller.rb b/lib/advanced_billing/controllers/subscription_products_controller.rb index 8dbeb29..8ab5ac5 100644 --- a/lib/advanced_billing/controllers/subscription_products_controller.rb +++ b/lib/advanced_billing/controllers/subscription_products_controller.rb @@ -6,6 +6,7 @@ module AdvancedBilling # SubscriptionProductsController class SubscriptionProductsController < BaseController + # Migrates a subscription to a different product. # In order to create a migration, you must pass the `product_id` or # `product_handle` in the object when you send a POST request. You may also # pass either a `product_price_point_id` or `product_price_point_handle` to @@ -26,78 +27,17 @@ class SubscriptionProductsController < BaseController # [here](https://maxio.zendesk.com/hc/en-us/articles/24181589372429-Data-Mig # ration-to-Advanced-Billing). # ## Failed Migrations - # Importaint note: One of the most common ways that a migration can fail is + # Important note: One of the most common ways that a migration can fail is # when the attempt is made to migrate a subscription to its current product. - # ## Migration 3D Secure - Stripe - # When a payment requires 3D Secure Authentication to adhear to Strong - # Customer Authentication (SCA) when the subscription is migrated to a new - # product, the request enters a [post-authentication - # flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-I - # mplementing-3D-Secure#psd2-flows-pre-authentication-and-post-authenticatio - # n). The server returns `422 Unprocessable Entity` in this case with the - # following response: - # ```json - # { - # "errors": [ - # "Your card was declined. This transaction requires 3D secure - # authentication." - # ], - # "gateway_payment_id": "pi_1F0aGoJ2UDb3Q4av7zU3sHPh", - # "description": "This card requires 3D secure authentication. Redirect - # the customer to the URL from the action_link attribute to authenticate. - # Attach callback_url param to this URL if you want to be notified about the - # result of 3D Secure authentication. Attach redirect_url param to this URL - # if you want to redirect a customer back to your page after 3D Secure - # authentication. Example: - # https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time - # _token_id=128&callback_url=https://localhost:4000&redirect_url=https://you - # rpage.com will do a POST request to https://localhost:4000 after payment - # is authenticated and will redirect a customer to https://yourpage.com - # after 3DS authentication.", - # "action_link": - # "http://acme.chargify.com/3d-secure/pi_1F0aGoJ2UDb3Q4av7zU3sHPh?one_time_t - # oken_id=242" - # } - # ``` - # To let the customer go through 3D Secure Authentication, they need to be - # redirected to the URL specified in `action_link`. - # Optionally, you can specify `callback_url` parameter in the `action_link` - # URL if you’d like to be notified about the result of 3D Secure - # Authentication. The `callback_url` will return the following information: - # - whether the authentication was successful (`success`) - # - the gateway ID for the payment (`gateway_payment_id`) - # - the subscription ID (`subscription_id`) - # Lastly, you can also specify a `redirect_url` within the `action_link` URL - # if you’d like to redirect a customer back to your site. - # It is not possible to use `action_link` in an iframe inside a custom - # application. You have to redirect the customer directly to the - # `action_link`, then, to be notified about the result, use `redirect_url` - # or `callback_url`. - # The final URL that you send a customer to to complete 3D Secure may - # resemble the following, where the first half is the `action_link` and the - # second half contains a `redirect_url` and `callback_url`: - # `https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_tim - # e_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yo - # urpage.com` - # ### Example Redirect Flow - # You may wish to redirect customers to different pages depending on whether - # SCA was performed successfully. Here's an example flow to use as a - # reference: - # 1. Create a migration via API; it requires 3DS - # 2. You receive a `gateway_payment_id` in the `action_link` along other - # params in the response. - # 3. Use this `gateway_payment_id` to, for example, connect with your - # internal resources or generate a session_id - # 4. Include 1 of those attributes inside the `callback_url` and - # `redirect_url` to be aware which “session” this applies to - # 5. Redirect the customer to the `action_link` with `callback_url` and - # `redirect_url` applied - # 6. After the customer finishes 3DS authentication, we let you know the - # result by making a request to applied `callback_url`. - # 7. After that, we redirect the customer to the `redirect_url`; at this - # point the result of authentication is known - # 8. Optionally, you can use the applied "msg" param in the `redirect_url` - # to determine whether it was successful or not. + # ## 3D Secure (3DS) Authentication post-authentication flow + # When a payment requires 3DS Authentication to adhere to Strong Customer + # Authentication (SCA), the request enters a post-authentication flow where + # a 422 Unprocessable Entity status is returned with an action_link that + # will direct the customer through 3DS Authentication. + # See the [3D Secure Post-Authentication + # Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Po + # st-Authentication-Flow) article in the product documentation to learn how + # to manage the redirect flow. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [SubscriptionProductMigrationRequest] body Optional parameter: @@ -127,11 +67,13 @@ def migrate_subscription_product(subscription_id, .execute end + # Previews the charges resulting from migrating a subscription to a + # different product. # ## Previewing a future date # It is also possible to preview the migration for a date in the future, as # long as it's still within the subscription's current billing period, by - # passing a `proration_date` along with the request (eg: `"proration_date": - # "2020-12-18T18:25:43.511Z"`). + # passing a `proration_date` along with the request (e.g., + # `"proration_date": "2020-12-18T18:25:43.511Z"`). # This will calculate the prorated adjustment, charge, payment and credit # applied values assuming the migration is done at that date in the future # as opposed to right now. diff --git a/lib/advanced_billing/controllers/subscription_status_controller.rb b/lib/advanced_billing/controllers/subscription_status_controller.rb index 3da7957..275283a 100644 --- a/lib/advanced_billing/controllers/subscription_status_controller.rb +++ b/lib/advanced_billing/controllers/subscription_status_controller.rb @@ -6,12 +6,17 @@ module AdvancedBilling # SubscriptionStatusController class SubscriptionStatusController < BaseController - # Advanced Billing offers the ability to retry collecting the balance due on - # a past due Subscription without waiting for the next scheduled attempt. - # ## Successful Reactivation - # The response will be `200 OK` with the updated Subscription. - # ## Failed Reactivation - # The response will be `422 "Unprocessable Entity`. + # Retries collecting the balance due on a past-due subscription without + # waiting for the next scheduled attempt. + # ## 3D Secure (3DS) Authentication post-authentication flow + # When a payment requires 3DS Authentication to adhere to Strong Customer + # Authentication (SCA), the request enters a post-authentication flow where + # a 422 Unprocessable Entity status is returned with an action_link that + # will direct the customer through 3DS Authentication. + # See the [3D Secure Post-Authentication + # Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Po + # st-Authentication-Flow) article in the product documentation to learn how + # to manage the redirect flow. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @return [SubscriptionResponse] Response from the API call. @@ -72,7 +77,7 @@ def cancel_subscription(subscription_id, .execute end - # Resume a paused (on-hold) subscription. If the normal next renewal date + # Resumes a paused (on-hold) subscription. If the normal next renewal date # has not passed, the subscription will return to active and will renew on # that date. Otherwise, it will behave like a reactivation, setting the # billing date to 'now' and charging the subscriber. @@ -104,8 +109,7 @@ def resume_subscription(subscription_id, .execute end - # This will place the subscription in the on_hold state and it will not - # renew. + # Places the subscription on hold, preventing it from renewing. # ## Limitations # You may not place a subscription on hold if the `next_billing_at` date is # within 24 hours. @@ -138,13 +142,12 @@ def pause_subscription(subscription_id, .execute end - # Once a subscription has been paused / put on hold, you can update the date - # which was specified to automatically resume the subscription. + # Updates the date on which a paused subscription will automatically resume. # To update a subscription's resume date, use this method to change or # update the `automatically_resume_at` date. # ### Remove the resume date - # Alternately, you can change the `automatically_resume_at` to `null` if you - # would like the subscription to not have a resume date. + # Alternatively, you can change the `automatically_resume_at` to `null` if + # you would like the subscription to not have a resume date. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [PauseRequest] body Optional parameter: TODO: type description @@ -174,7 +177,7 @@ def update_automatic_subscription_resumption(subscription_id, .execute end - # Reactivate a previously canceled subscription. For details on how the + # Reactivates a previously canceled subscription. For details on how the # reactivation works, and how to reactivate subscriptions through the # application, see # [reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629- @@ -205,10 +208,10 @@ def update_automatic_subscription_resumption(subscription_id, # have been the next billing date of July 1st, then Advanced Billing would # not resume the subscription, and instead it would be reactivated with a # new billing period. - # If a reactivation with `resume: false`, or where 'resume" is omited were + # If a reactivation with `resume: false`, or where 'resume' is omitted were # attempted, then Advanced Billing would reactivate the subscription with a # new billing period regardless of whether or not resuming the previous - # billing period were possible. + # billing period was possible. # | Canceled | Reactivation | Resumable? | # |---|---|---| # | Jun 15 | June 28 | Yes | @@ -315,6 +318,15 @@ def update_automatic_subscription_resumption(subscription_id, # + The subscription will transition to active # + The next billing date should not have changed # + Any product-related charges should have been collected + # ## 3D Secure (3DS) Authentication post-authentication flow + # When a payment requires 3DS Authentication to adhere to Strong Customer + # Authentication (SCA), the request enters a post-authentication flow where + # a 422 Unprocessable Entity status is returned with an action_link that + # will direct the customer through 3DS Authentication. + # See the [3D Secure Post-Authentication + # Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Po + # st-Authentication-Flow) article in the product documentation to learn how + # to manage the redirect flow. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [ReactivateSubscriptionRequest] body Optional parameter: TODO: type @@ -380,9 +392,9 @@ def initiate_delayed_cancellation(subscription_id, .execute end - # Removing the delayed cancellation on a subscription will ensure that it - # doesn't get canceled at the end of the period that it is in. The request - # will reset the `cancel_at_end_of_period` flag to `false`. + # Removes the delayed cancellation from a subscription, ensuring it is not + # canceled at the end of the current period. The request will reset the + # `cancel_at_end_of_period` flag to `false`. # This endpoint is idempotent. If the subscription was not set to cancel in # the future, removing the delayed cancellation has no effect and the call # will be successful. @@ -408,8 +420,8 @@ def cancel_delayed_cancellation(subscription_id) .execute end - # If a subscription is currently in dunning, the subscription will be set to - # active and the active Dunner will be resolved. + # Cancels the active dunning process for a subscription and sets it to + # active. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @return [SubscriptionResponse] Response from the API call. @@ -433,10 +445,10 @@ def cancel_dunning(subscription_id) .execute end - # The Chargify API allows you to preview a renewal by posting to the - # renewals endpoint. Renewal Preview is an object representing a - # subscription’s next assessment. You can retrieve it to see a snapshot of - # how much your customer will be charged on their next renewal. + # Previews a subscription’s next renewal assessment. Renewal Preview is an + # object representing a subscription’s next assessment. You can retrieve it + # to see a snapshot of how much your customer will be charged on their next + # renewal. # The "Next Billing" amount and "Next Billing" date are already represented # in the UI on each Subscriber's Summary. For more information, see our # documentation diff --git a/lib/advanced_billing/controllers/subscriptions_controller.rb b/lib/advanced_billing/controllers/subscriptions_controller.rb index c966c6f..a544a46 100644 --- a/lib/advanced_billing/controllers/subscriptions_controller.rb +++ b/lib/advanced_billing/controllers/subscriptions_controller.rb @@ -6,9 +6,9 @@ module AdvancedBilling # SubscriptionsController class SubscriptionsController < BaseController - # Creates a Subscription for a customer and product + # Creates a Subscription for a customer and product. # Specify the product with `product_id` or `product_handle`. To set a - # specific product pricepPoint, use `product_price_point_handle` or + # specific product price point, use `product_price_point_handle` or # `product_price_point_id`. # Identify an existing customer with `customer_id` or `customer_reference`. # Optionally, include an existing payment profile using @@ -16,6 +16,10 @@ class SubscriptionsController < BaseController # Select an option from the **Request Examples** drop-down on the right side # of the portal to see examples of common scenarios for creating # subscriptions. + # See the [Subscription + # Signups](page:introduction/basic-concepts/subscription-signup) article for + # more information on working with subscriptions in Advanced Billing. + # ## Payment information # Payment information may be required to create a subscription, depending on # the options for the Product being subscribed. See [product # options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-Prod @@ -30,13 +34,19 @@ class SubscriptionsController < BaseController # [PCI # compliance](https://docs.maxio.com/hc/en-us/articles/24183956938381-PCI-Co # mpliance#pci-compliance-0-0) on your end. If your business is not PCI - # compliant, use - # [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Char + # compliant, use [Maxio.js (formerly + # Chargify.js)](https://docs.maxio.com/hc/en-us/articles/38163190843789-Char # gify-js-Overview#chargify-js-overview-0-0) to collect credit card or bank # account information. - # See the [Subscription - # Signups](page:introduction/basic-concepts/subscription-signup) article for - # more information on working with subscriptions in Advanced Billing. + # ## 3D Secure (3DS) Authentication post-authentication flow + # When a payment requires 3DS Authentication to adhere to Strong Customer + # Authentication (SCA), the request enters a post-authentication flow where + # a 422 Unprocessable Entity status is returned with an action_link that + # will direct the customer through 3DS Authentication. + # See the [3D Secure Post-Authentication + # Flow](https://docs.maxio.com/hc/en-us/articles/44277749524365-3D-Secure-Po + # st-Authentication-Flow) article in the product documentation to learn how + # to manage the redirect flow. # @param [CreateSubscriptionRequest] body Optional parameter: TODO: type # description here # @return [SubscriptionResponse] Response from the API call. @@ -60,7 +70,7 @@ def create_subscription(body: nil) .execute end - # returns an array of subscriptions from a Site. Pay close attention to + # Returns an array of subscriptions from a Site. Pay close attention to # query string filters and pagination in order to control responses from the # server. # ## Search for a subscription @@ -209,28 +219,28 @@ def list_subscriptions(options = {}) # > **Note:** To cancel a delayed product change, set `next_product_id` to # an empty string. # ## Billing Date Changes - # You can update dates for a subscrption. + # You can update dates for a subscription. # ### Regular Billing Date Changes # Send the `next_billing_at` to set the next billing date for the # subscription. After that date passes and the subscription is processed, # the following billing date will be set according to the subscription's # product period. # > Note: If you pass an invalid date, the correct date is automatically set - # to he correct date. For example, if February 30 is passed, the next + # to the correct date. For example, if February 30 is passed, the next # billing would be set to March 2nd in a non-leap year. # The server response will not return data under the key/value pair of # `next_billing_at`. View the key/value pair of `current_period_ends_at` to # verify that the `next_billing_at` date has been changed successfully. - # ### Calendar Billing and Snap Day Changes + # ### Calendar Billing and Snap Day Changes # For a subscription using Calendar Billing, setting the next billing date # is a bit different. Send the `snap_day` attribute to change the calendar # billing date for **a subscription using a product eligible for calendar # billing**. # > Note: If you change the product associated with a subscription that # contains a `snap_day` and immediately `READ/GET` the subscription data, it - # will still contain original `snap_day`. The `snap_day`will will reset to - # 'null on the next billing cycle. This is because a product change is - # instantanous and only affects the product associated with a subscription. + # will still contain original `snap_day`. The `snap_day` will reset to null + # on the next billing cycle. This is because a product change is + # instantaneous and only affects the product associated with a subscription. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [UpdateSubscriptionRequest] body Optional parameter: TODO: type @@ -290,10 +300,9 @@ def read_subscription(subscription_id, .execute end - # This API endpoint allows you to set certain subscription fields that are - # usually managed for you automatically. Some of the fields can be set via - # the normal Subscriptions Update API, but others can only be set using this - # endpoint. + # Sets certain subscription fields that are usually managed automatically. + # Some of the fields can be set via the normal Subscriptions Update API, but + # others can only be set using this endpoint. # This endpoint is provided for cases where you need to “align” Advanced # Billing data with data that happened in your system, perhaps before you # started using Advanced Billing. For example, you may choose to import your @@ -349,7 +358,7 @@ def override_subscription(subscription_id, .execute end - # Use this endpoint to find a subscription by its reference. + # Finds a subscription by its reference. # @param [String] reference Optional parameter: Subscription reference # @return [SubscriptionResponse] Response from the API call. def find_subscription(reference: nil) @@ -369,7 +378,7 @@ def find_subscription(reference: nil) .execute end - # For sites in test mode, you may purge individual subscriptions. + # Purges an individual subscription for sites in test mode. # Provide the subscription ID in the url. To confirm, supply the customer # ID in the query string `ack` parameter. You may also delete the customer # record and/or payment profiles by passing `cascade` parameters. For @@ -413,7 +422,7 @@ def purge_subscription(subscription_id, .execute end - # Use this endpoint to update a subscription's prepaid configuration. + # Updates a subscription's prepaid configuration. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [UpsertPrepaidConfigurationRequest] body Optional parameter: TODO: @@ -443,8 +452,8 @@ def update_prepaid_subscription_configuration(subscription_id, .execute end - # The Chargify API allows you to preview a subscription by POSTing the same - # JSON or XML as for a subscription creation. + # Previews a subscription by POSTing the same JSON or XML as for a + # subscription creation. # The "Next Billing" amount and "Next Billing" date are represented in each # Subscriber's Summary. # A subscription will not be created by utilizing this endpoint; it is meant @@ -497,6 +506,7 @@ def preview_subscription(body: nil) .execute end + # Applies one or more coupon codes to an existing subscription. # An existing subscription can accommodate multiple discounts/coupon codes. # This is only applicable if each coupon is stackable. For more information # on stackable coupons, we recommend reviewing our [coupon @@ -543,9 +553,9 @@ def apply_coupons_to_subscription(subscription_id, .execute end - # Use this endpoint to remove a coupon from an existing subscription. - # For more information on the expected behaviour of removing a coupon from a - # subscription, See our documentation + # Removes a coupon from an existing subscription. + # For more information on the expected behavior of removing a coupon from a + # subscription, see our documentation # [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons # -and-Subscriptions#removing-a-coupon) # @param [Integer] subscription_id Required parameter: The Chargify id of @@ -574,10 +584,9 @@ def remove_coupon_from_subscription(subscription_id, .execute end - # Advanced Billing offers the ability to activate awaiting signup and - # trialing subscriptions. This feature is only available on the Relationship - # Invoicing architecture. Subscriptions in a group may not be activated - # immediately. + # Activates awaiting signup and trialing subscriptions. This feature is only + # available on the Relationship Invoicing architecture. Subscriptions in a + # group may not be activated immediately. # For details on how the activation works, and how to activate subscriptions # through the application, see [activation](#). # The `revert_on_failure` parameter controls the behavior upon activation diff --git a/lib/advanced_billing/controllers/webhooks_controller.rb b/lib/advanced_billing/controllers/webhooks_controller.rb index 6bfc885..3a731aa 100644 --- a/lib/advanced_billing/controllers/webhooks_controller.rb +++ b/lib/advanced_billing/controllers/webhooks_controller.rb @@ -6,8 +6,8 @@ module AdvancedBilling # WebhooksController class WebhooksController < BaseController - # Allows you to view a list of webhooks. You can pass query parameters if - # you want to filter webhooks. See the + # Retrieves a list of webhooks. You can pass query parameters if you want + # to filter webhooks. See the # [Webhooks](page:introduction/webhooks/webhooks) documentation for more # information. # @param [WebhookStatus] status Optional parameter: Webhooks with matching @@ -55,7 +55,7 @@ def list_webhooks(options = {}) .execute end - # Allows you to enable webhooks for your site + # Enables webhooks for your site. # @param [EnableWebhooksRequest] body Optional parameter: TODO: type # description here # @return [EnableWebhooksResponse] Response from the API call. @@ -98,7 +98,7 @@ def replay_webhooks(body: nil) .execute end - # Creates an endpoint and assigns a list of webhooks subscriptions (events) + # Creates an endpoint and assigns a list of webhook subscriptions (events) # to it. # See the [Webhooks # Reference](page:introduction/webhooks/webhooks-reference#events) page for @@ -149,7 +149,7 @@ def list_endpoints # Always send a complete list of events to which you want to subscribe. # Sending a PUT request for an existing endpoint with an empty list of # `webhook_subscriptions` will unsubscribe all events. - # If you want unsubscribe from a specific event, send a list of + # If you want to unsubscribe from a specific event, send a list of # `webhook_subscriptions` without the specific event key. # @param [Integer] endpoint_id Required parameter: The Advanced Billing id # for the endpoint that should be updated diff --git a/lib/advanced_billing/models/activate_event_based_component.rb b/lib/advanced_billing/models/activate_event_based_component.rb index 0c58ff1..1305984 100644 --- a/lib/advanced_billing/models/activate_event_based_component.rb +++ b/lib/advanced_billing/models/activate_event_based_component.rb @@ -13,9 +13,10 @@ class ActivateEventBasedComponent < BaseModel # @return [Integer] attr_accessor :price_point_id - # This attribute is particularly useful when you need to align billing - # events for different components on distinct schedules within a - # subscription. This only works for site with Multifrequency enabled. + # Billing schedule settings for component allocations or usages on + # multi-frequency subscriptions. Use this to start a component's billing + # period on a custom date instead of aligning with the product charge + # schedule. # @return [BillingSchedule] attr_accessor :billing_schedule diff --git a/lib/advanced_billing/models/bank_account_payment_profile.rb b/lib/advanced_billing/models/bank_account_payment_profile.rb index e67a0bd..e8efffa 100644 --- a/lib/advanced_billing/models/bank_account_payment_profile.rb +++ b/lib/advanced_billing/models/bank_account_payment_profile.rb @@ -34,7 +34,7 @@ class BankAccountPaymentProfile < BaseModel # @return [BankAccountVault] attr_accessor :current_vault - # The “token” provided by your vault storage for an already stored payment + # The "token" provided by your vault storage for an already stored payment # profile # @return [String] attr_accessor :vault_token @@ -73,13 +73,13 @@ class BankAccountPaymentProfile < BaseModel attr_accessor :bank_name # A string representation of the stored bank routing number with all but the - # last 4 digits marked with X’s (i.e. ‘XXXXXXX1111’). payment_type will be + # last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be # bank_account # @return [String] attr_accessor :masked_bank_routing_number # A string representation of the stored bank account number with all but the - # last 4 digits marked with X’s (i.e. ‘XXXXXXX1111’) + # last 4 digits marked with X's (i.e. 'XXXXXXX1111') # @return [String] attr_accessor :masked_bank_account_number @@ -166,6 +166,7 @@ def self.optionals billing_address_2 bank_name masked_bank_routing_number + masked_bank_account_number bank_account_type bank_account_holder_type verified @@ -186,20 +187,22 @@ def self.nullables billing_country customer_vault_token billing_address_2 + masked_bank_routing_number + masked_bank_account_number site_gateway_setting_id gateway_handle ] end - def initialize(masked_bank_account_number:, - payment_type: PaymentType::BANK_ACCOUNT, id: SKIP, + def initialize(payment_type: PaymentType::BANK_ACCOUNT, id: SKIP, first_name: SKIP, last_name: SKIP, customer_id: SKIP, current_vault: SKIP, vault_token: SKIP, billing_address: SKIP, billing_city: SKIP, billing_state: SKIP, billing_zip: SKIP, billing_country: SKIP, customer_vault_token: SKIP, billing_address_2: SKIP, bank_name: SKIP, - masked_bank_routing_number: SKIP, bank_account_type: SKIP, + masked_bank_routing_number: SKIP, + masked_bank_account_number: SKIP, bank_account_type: SKIP, bank_account_holder_type: SKIP, verified: false, site_gateway_setting_id: SKIP, gateway_handle: SKIP, created_at: SKIP, updated_at: SKIP, @@ -227,7 +230,10 @@ def initialize(masked_bank_account_number:, @masked_bank_routing_number = masked_bank_routing_number end - @masked_bank_account_number = masked_bank_account_number + unless masked_bank_account_number == SKIP + @masked_bank_account_number = + masked_bank_account_number + end @bank_account_type = bank_account_type unless bank_account_type == SKIP @bank_account_holder_type = bank_account_holder_type unless bank_account_holder_type == SKIP @payment_type = payment_type @@ -243,8 +249,6 @@ def self.from_hash(hash) return nil unless hash # Extract variables from the hash. - masked_bank_account_number = - hash.key?('masked_bank_account_number') ? hash['masked_bank_account_number'] : nil payment_type = hash['payment_type'] ||= PaymentType::BANK_ACCOUNT id = hash.key?('id') ? hash['id'] : SKIP first_name = hash.key?('first_name') ? hash['first_name'] : SKIP @@ -266,6 +270,8 @@ def self.from_hash(hash) bank_name = hash.key?('bank_name') ? hash['bank_name'] : SKIP masked_bank_routing_number = hash.key?('masked_bank_routing_number') ? hash['masked_bank_routing_number'] : SKIP + masked_bank_account_number = + hash.key?('masked_bank_account_number') ? hash['masked_bank_account_number'] : SKIP bank_account_type = hash.key?('bank_account_type') ? hash['bank_account_type'] : SKIP bank_account_holder_type = @@ -290,8 +296,7 @@ def self.from_hash(hash) additional_properties = hash.reject { |k, _| names.value?(k) } # Create object from extracted values. - BankAccountPaymentProfile.new(masked_bank_account_number: masked_bank_account_number, - payment_type: payment_type, + BankAccountPaymentProfile.new(payment_type: payment_type, id: id, first_name: first_name, last_name: last_name, @@ -307,6 +312,7 @@ def self.from_hash(hash) billing_address_2: billing_address_2, bank_name: bank_name, masked_bank_routing_number: masked_bank_routing_number, + masked_bank_account_number: masked_bank_account_number, bank_account_type: bank_account_type, bank_account_holder_type: bank_account_holder_type, verified: verified, @@ -329,22 +335,14 @@ def to_custom_updated_at # @param [BankAccountPaymentProfile | Hash] The value against the validation is performed. def self.validate(value) if value.instance_of? self - return ( - APIHelper.valid_type?(value.masked_bank_account_number, - ->(val) { val.instance_of? String }) and - APIHelper.valid_type?(value.payment_type, - ->(val) { PaymentType.validate(val) }) - ) + return APIHelper.valid_type?(value.payment_type, + ->(val) { PaymentType.validate(val) }) end return false unless value.instance_of? Hash - ( - APIHelper.valid_type?(value['masked_bank_account_number'], - ->(val) { val.instance_of? String }) and - APIHelper.valid_type?(value['payment_type'], - ->(val) { PaymentType.validate(val) }) - ) + APIHelper.valid_type?(value['payment_type'], + ->(val) { PaymentType.validate(val) }) end # Provides a human-readable string representation of the object. diff --git a/lib/advanced_billing/models/billing_schedule.rb b/lib/advanced_billing/models/billing_schedule.rb index 1e21971..1d8d1ec 100644 --- a/lib/advanced_billing/models/billing_schedule.rb +++ b/lib/advanced_billing/models/billing_schedule.rb @@ -4,16 +4,18 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # This attribute is particularly useful when you need to align billing events - # for different components on distinct schedules within a subscription. This - # only works for site with Multifrequency enabled. + # Billing schedule settings for component allocations or usages on + # multi-frequency subscriptions. Use this to start a component's billing + # period on a custom date instead of aligning with the product charge + # schedule. class BillingSchedule < BaseModel SKIP = Object.new private_constant :SKIP - # The initial_billing_at attribute in Maxio allows you to specify a custom - # starting date for billing cycles associated with components that have - # their own billing frequency set. Only ISO8601 format is supported. + # Custom start date (ISO 8601 date, YYYY-MM-DD) for the component's first + # billing period. If omitted or null, billing aligns with the product + # schedule. If provided, date must be on or after the minimum allowed date + # for the subscription or component. # @return [Date] attr_accessor :initial_billing_at @@ -33,7 +35,9 @@ def self.optionals # An array for nullable fields def self.nullables - [] + %w[ + initial_billing_at + ] end def initialize(initial_billing_at: SKIP, additional_properties: {}) diff --git a/lib/advanced_billing/models/create_allocation.rb b/lib/advanced_billing/models/create_allocation.rb index 7de2b7f..74df733 100644 --- a/lib/advanced_billing/models/create_allocation.rb +++ b/lib/advanced_billing/models/create_allocation.rb @@ -90,9 +90,10 @@ class CreateAllocation < BaseModel # @return [Object] attr_accessor :price_point_id - # This attribute is particularly useful when you need to align billing - # events for different components on distinct schedules within a - # subscription. This only works for site with Multifrequency enabled. + # Billing schedule settings for component allocations or usages on + # multi-frequency subscriptions. Use this to start a component's billing + # period on a custom date instead of aligning with the product charge + # schedule. # @return [BillingSchedule] attr_accessor :billing_schedule diff --git a/lib/advanced_billing/models/create_invoice.rb b/lib/advanced_billing/models/create_invoice.rb index 552400b..b0c441d 100644 --- a/lib/advanced_billing/models/create_invoice.rb +++ b/lib/advanced_billing/models/create_invoice.rb @@ -13,7 +13,10 @@ class CreateInvoice < BaseModel # @return [Array[CreateInvoiceItem]] attr_accessor :line_items - # TODO: Write general description for this method + # Date on which the invoice will be issued (format YYYY-MM-DD). This date is + # interpreted and validated in your site's time zone. It must be today or a + # date in the past — future dates are not accepted. If omitted, defaults to + # today in your site's time zone. # @return [Date] attr_accessor :issue_date diff --git a/lib/advanced_billing/models/create_payment_profile.rb b/lib/advanced_billing/models/create_payment_profile.rb index f456831..c32693d 100644 --- a/lib/advanced_billing/models/create_payment_profile.rb +++ b/lib/advanced_billing/models/create_payment_profile.rb @@ -9,15 +9,18 @@ class CreatePaymentProfile < BaseModel SKIP = Object.new private_constant :SKIP - # Token received after sending billing information using chargify.js. + # Token received after sending billing information using Maxio.js (formerly + # Chargify.js). # @return [String] attr_accessor :chargify_token - # Token received after sending billing information using chargify.js. + # Token received after sending billing information using Maxio.js (formerly + # Chargify.js). # @return [Integer] attr_accessor :id - # Token received after sending billing information using chargify.js. + # Token received after sending billing information using Maxio.js (formerly + # Chargify.js). # @return [PaymentType] attr_accessor :payment_type @@ -112,12 +115,12 @@ class CreatePaymentProfile < BaseModel attr_accessor :customer_id # used by merchants that implemented BraintreeBlue javaScript libraries on - # their own. We recommend using Chargify.js instead. + # their own. We recommend using Maxio.js (formerly Chargify.js) instead. # @return [String] attr_accessor :paypal_email # used by merchants that implemented BraintreeBlue javaScript libraries on - # their own. We recommend using Chargify.js instead. + # their own. We recommend using Maxio.js (formerly Chargify.js) instead. # @return [String] attr_accessor :payment_method_nonce diff --git a/lib/advanced_billing/models/create_usage.rb b/lib/advanced_billing/models/create_usage.rb index 1abf9ff..a69dd9d 100644 --- a/lib/advanced_billing/models/create_usage.rb +++ b/lib/advanced_billing/models/create_usage.rb @@ -24,9 +24,10 @@ class CreateUsage < BaseModel # @return [String] attr_accessor :memo - # This attribute is particularly useful when you need to align billing - # events for different components on distinct schedules within a - # subscription. This only works for site with Multifrequency enabled. + # Billing schedule settings for component allocations or usages on + # multi-frequency subscriptions. Use this to start a component's billing + # period on a custom date instead of aligning with the product charge + # schedule. # @return [BillingSchedule] attr_accessor :billing_schedule diff --git a/lib/advanced_billing/models/credit_card_payment_profile.rb b/lib/advanced_billing/models/credit_card_payment_profile.rb index ed6f6ff..d857bb7 100644 --- a/lib/advanced_billing/models/credit_card_payment_profile.rb +++ b/lib/advanced_billing/models/credit_card_payment_profile.rb @@ -94,15 +94,15 @@ class CreditCardPaymentProfile < BaseModel # @return [TrueClass | FalseClass] attr_accessor :disabled - # Token received after sending billing information using chargify.js. This - # token will only be received if passed as a sole attribute of - # credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + # Token received after sending billing information using Maxio.js (formerly + # Chargify.js). This token will only be received if passed as a sole + # attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) # @return [String] attr_accessor :chargify_token - # Token received after sending billing information using chargify.js. This - # token will only be received if passed as a sole attribute of - # credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + # Token received after sending billing information using Maxio.js (formerly + # Chargify.js). This token will only be received if passed as a sole + # attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) # @return [Integer] attr_accessor :site_gateway_setting_id diff --git a/lib/advanced_billing/models/credit_note_line_item.rb b/lib/advanced_billing/models/credit_note_line_item.rb index 8420bb9..75c10c4 100644 --- a/lib/advanced_billing/models/credit_note_line_item.rb +++ b/lib/advanced_billing/models/credit_note_line_item.rb @@ -64,6 +64,16 @@ class CreditNoteLineItem < BaseModel # @return [String] attr_accessor :tax_amount + # Whether the unit price for this line item is tax-inclusive. + # When `true`, `unit_price` already includes tax and `tax_amount` represents + # the portion of the price attributable to tax. When `false`, any applicable + # tax is added on top of the price. + # The value is inherited from the source price point's `tax_included` + # setting. Custom or ad-hoc line items (which have no associated price + # point) always return `false`. + # @return [TrueClass | FalseClass] + attr_accessor :tax_included + # The non-canonical total amount for the line. # `subtotal_amount` is the canonical amount for a line. The invoice # `total_amount` is derived from the sum of the line `subtotal_amount`s and @@ -129,6 +139,7 @@ def self.names @_hash['subtotal_amount'] = 'subtotal_amount' @_hash['discount_amount'] = 'discount_amount' @_hash['tax_amount'] = 'tax_amount' + @_hash['tax_included'] = 'tax_included' @_hash['total_amount'] = 'total_amount' @_hash['tiered_unit_price'] = 'tiered_unit_price' @_hash['period_range_start'] = 'period_range_start' @@ -153,6 +164,7 @@ def self.optionals subtotal_amount discount_amount tax_amount + tax_included total_amount tiered_unit_price period_range_start @@ -177,10 +189,10 @@ def self.nullables def initialize(uid: SKIP, title: SKIP, description: SKIP, quantity: SKIP, unit_price: SKIP, subtotal_amount: SKIP, - discount_amount: SKIP, tax_amount: SKIP, total_amount: SKIP, - tiered_unit_price: SKIP, period_range_start: SKIP, - period_range_end: SKIP, product_id: SKIP, - product_version: SKIP, component_id: SKIP, + discount_amount: SKIP, tax_amount: SKIP, tax_included: SKIP, + total_amount: SKIP, tiered_unit_price: SKIP, + period_range_start: SKIP, period_range_end: SKIP, + product_id: SKIP, product_version: SKIP, component_id: SKIP, price_point_id: SKIP, billing_schedule_item_id: SKIP, custom_item: SKIP, additional_properties: {}) # Add additional model properties to the instance. @@ -196,6 +208,7 @@ def initialize(uid: SKIP, title: SKIP, description: SKIP, quantity: SKIP, @subtotal_amount = subtotal_amount unless subtotal_amount == SKIP @discount_amount = discount_amount unless discount_amount == SKIP @tax_amount = tax_amount unless tax_amount == SKIP + @tax_included = tax_included unless tax_included == SKIP @total_amount = total_amount unless total_amount == SKIP @tiered_unit_price = tiered_unit_price unless tiered_unit_price == SKIP @period_range_start = period_range_start unless period_range_start == SKIP @@ -223,6 +236,7 @@ def self.from_hash(hash) discount_amount = hash.key?('discount_amount') ? hash['discount_amount'] : SKIP tax_amount = hash.key?('tax_amount') ? hash['tax_amount'] : SKIP + tax_included = hash.key?('tax_included') ? hash['tax_included'] : SKIP total_amount = hash.key?('total_amount') ? hash['total_amount'] : SKIP tiered_unit_price = hash.key?('tiered_unit_price') ? hash['tiered_unit_price'] : SKIP @@ -252,6 +266,7 @@ def self.from_hash(hash) subtotal_amount: subtotal_amount, discount_amount: discount_amount, tax_amount: tax_amount, + tax_included: tax_included, total_amount: total_amount, tiered_unit_price: tiered_unit_price, period_range_start: period_range_start, @@ -280,13 +295,13 @@ def to_s class_name = self.class.name.split('::').last "<#{class_name} uid: #{@uid}, title: #{@title}, description: #{@description}, quantity:"\ " #{@quantity}, unit_price: #{@unit_price}, subtotal_amount: #{@subtotal_amount},"\ - " discount_amount: #{@discount_amount}, tax_amount: #{@tax_amount}, total_amount:"\ - " #{@total_amount}, tiered_unit_price: #{@tiered_unit_price}, period_range_start:"\ - " #{@period_range_start}, period_range_end: #{@period_range_end}, product_id:"\ - " #{@product_id}, product_version: #{@product_version}, component_id: #{@component_id},"\ - " price_point_id: #{@price_point_id}, billing_schedule_item_id:"\ - " #{@billing_schedule_item_id}, custom_item: #{@custom_item}, additional_properties:"\ - " #{get_additional_properties}>" + " discount_amount: #{@discount_amount}, tax_amount: #{@tax_amount}, tax_included:"\ + " #{@tax_included}, total_amount: #{@total_amount}, tiered_unit_price:"\ + " #{@tiered_unit_price}, period_range_start: #{@period_range_start}, period_range_end:"\ + " #{@period_range_end}, product_id: #{@product_id}, product_version: #{@product_version},"\ + " component_id: #{@component_id}, price_point_id: #{@price_point_id},"\ + " billing_schedule_item_id: #{@billing_schedule_item_id}, custom_item: #{@custom_item},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -295,12 +310,12 @@ def inspect "<#{class_name} uid: #{@uid.inspect}, title: #{@title.inspect}, description:"\ " #{@description.inspect}, quantity: #{@quantity.inspect}, unit_price:"\ " #{@unit_price.inspect}, subtotal_amount: #{@subtotal_amount.inspect}, discount_amount:"\ - " #{@discount_amount.inspect}, tax_amount: #{@tax_amount.inspect}, total_amount:"\ - " #{@total_amount.inspect}, tiered_unit_price: #{@tiered_unit_price.inspect},"\ - " period_range_start: #{@period_range_start.inspect}, period_range_end:"\ - " #{@period_range_end.inspect}, product_id: #{@product_id.inspect}, product_version:"\ - " #{@product_version.inspect}, component_id: #{@component_id.inspect}, price_point_id:"\ - " #{@price_point_id.inspect}, billing_schedule_item_id:"\ + " #{@discount_amount.inspect}, tax_amount: #{@tax_amount.inspect}, tax_included:"\ + " #{@tax_included.inspect}, total_amount: #{@total_amount.inspect}, tiered_unit_price:"\ + " #{@tiered_unit_price.inspect}, period_range_start: #{@period_range_start.inspect},"\ + " period_range_end: #{@period_range_end.inspect}, product_id: #{@product_id.inspect},"\ + " product_version: #{@product_version.inspect}, component_id: #{@component_id.inspect},"\ + " price_point_id: #{@price_point_id.inspect}, billing_schedule_item_id:"\ " #{@billing_schedule_item_id.inspect}, custom_item: #{@custom_item.inspect},"\ " additional_properties: #{get_additional_properties}>" end diff --git a/lib/advanced_billing/models/event_key.rb b/lib/advanced_billing/models/event_key.rb index d0d2527..42ca29b 100644 --- a/lib/advanced_billing/models/event_key.rb +++ b/lib/advanced_billing/models/event_key.rb @@ -106,6 +106,9 @@ class EventKey # TODO: Write general description for INVOICE_ISSUED INVOICE_ISSUED = 'invoice_issued'.freeze, + # TODO: Write general description for INVOICE_PENDING + INVOICE_PENDING = 'invoice_pending'.freeze, + # TODO: Write general description for PREPAID_SUBSCRIPTION_BALANCE_CHANGED PREPAID_SUBSCRIPTION_BALANCE_CHANGED = 'prepaid_subscription_balance_changed'.freeze, @@ -300,6 +303,7 @@ def self.from_value(value, default_value = PAYMENT_SUCCESS) when 'trial_end_notice' then TRIAL_END_NOTICE when 'dunning_step_reached' then DUNNING_STEP_REACHED when 'invoice_issued' then INVOICE_ISSUED + when 'invoice_pending' then INVOICE_PENDING when 'prepaid_subscription_balance_changed' then PREPAID_SUBSCRIPTION_BALANCE_CHANGED when 'subscription_group_signup_success' then SUBSCRIPTION_GROUP_SIGNUP_SUCCESS when 'subscription_group_signup_failure' then SUBSCRIPTION_GROUP_SIGNUP_FAILURE diff --git a/lib/advanced_billing/models/invoice_line_item.rb b/lib/advanced_billing/models/invoice_line_item.rb index 7fce066..7e72b40 100644 --- a/lib/advanced_billing/models/invoice_line_item.rb +++ b/lib/advanced_billing/models/invoice_line_item.rb @@ -64,6 +64,16 @@ class InvoiceLineItem < BaseModel # @return [String] attr_accessor :tax_amount + # Whether the unit price for this line item is tax-inclusive. + # When `true`, `unit_price` already includes tax and `tax_amount` represents + # the portion of the price attributable to tax. When `false`, any applicable + # tax is added on top of the price. + # The value is inherited from the source price point's `tax_included` + # setting. Custom or ad-hoc line items (which have no associated price + # point) always return `false`. + # @return [TrueClass | FalseClass] + attr_accessor :tax_included + # The non-canonical total amount for the line. # `subtotal_amount` is the canonical amount for a line. The invoice # `total_amount` is derived from the sum of the line `subtotal_amount`s and @@ -167,6 +177,7 @@ def self.names @_hash['subtotal_amount'] = 'subtotal_amount' @_hash['discount_amount'] = 'discount_amount' @_hash['tax_amount'] = 'tax_amount' + @_hash['tax_included'] = 'tax_included' @_hash['total_amount'] = 'total_amount' @_hash['tiered_unit_price'] = 'tiered_unit_price' @_hash['period_range_start'] = 'period_range_start' @@ -196,6 +207,7 @@ def self.optionals subtotal_amount discount_amount tax_amount + tax_included total_amount tiered_unit_price period_range_start @@ -229,10 +241,11 @@ def self.nullables def initialize(uid: SKIP, title: SKIP, description: SKIP, quantity: SKIP, unit_price: SKIP, subtotal_amount: SKIP, - discount_amount: SKIP, tax_amount: SKIP, total_amount: SKIP, - tiered_unit_price: SKIP, period_range_start: SKIP, - period_range_end: SKIP, transaction_id: SKIP, - product_id: SKIP, product_version: SKIP, component_id: SKIP, + discount_amount: SKIP, tax_amount: SKIP, tax_included: SKIP, + total_amount: SKIP, tiered_unit_price: SKIP, + period_range_start: SKIP, period_range_end: SKIP, + transaction_id: SKIP, product_id: SKIP, + product_version: SKIP, component_id: SKIP, price_point_id: SKIP, billing_schedule_item_id: SKIP, hide: SKIP, component_cost_data: SKIP, product_price_point_id: SKIP, custom_item: SKIP, kind: SKIP, @@ -250,6 +263,7 @@ def initialize(uid: SKIP, title: SKIP, description: SKIP, quantity: SKIP, @subtotal_amount = subtotal_amount unless subtotal_amount == SKIP @discount_amount = discount_amount unless discount_amount == SKIP @tax_amount = tax_amount unless tax_amount == SKIP + @tax_included = tax_included unless tax_included == SKIP @total_amount = total_amount unless total_amount == SKIP @tiered_unit_price = tiered_unit_price unless tiered_unit_price == SKIP @period_range_start = period_range_start unless period_range_start == SKIP @@ -282,6 +296,7 @@ def self.from_hash(hash) discount_amount = hash.key?('discount_amount') ? hash['discount_amount'] : SKIP tax_amount = hash.key?('tax_amount') ? hash['tax_amount'] : SKIP + tax_included = hash.key?('tax_included') ? hash['tax_included'] : SKIP total_amount = hash.key?('total_amount') ? hash['total_amount'] : SKIP tiered_unit_price = hash.key?('tiered_unit_price') ? hash['tiered_unit_price'] : SKIP @@ -320,6 +335,7 @@ def self.from_hash(hash) subtotal_amount: subtotal_amount, discount_amount: discount_amount, tax_amount: tax_amount, + tax_included: tax_included, total_amount: total_amount, tiered_unit_price: tiered_unit_price, period_range_start: period_range_start, @@ -353,13 +369,13 @@ def to_s class_name = self.class.name.split('::').last "<#{class_name} uid: #{@uid}, title: #{@title}, description: #{@description}, quantity:"\ " #{@quantity}, unit_price: #{@unit_price}, subtotal_amount: #{@subtotal_amount},"\ - " discount_amount: #{@discount_amount}, tax_amount: #{@tax_amount}, total_amount:"\ - " #{@total_amount}, tiered_unit_price: #{@tiered_unit_price}, period_range_start:"\ - " #{@period_range_start}, period_range_end: #{@period_range_end}, transaction_id:"\ - " #{@transaction_id}, product_id: #{@product_id}, product_version: #{@product_version},"\ - " component_id: #{@component_id}, price_point_id: #{@price_point_id},"\ - " billing_schedule_item_id: #{@billing_schedule_item_id}, hide: #{@hide},"\ - " component_cost_data: #{@component_cost_data}, product_price_point_id:"\ + " discount_amount: #{@discount_amount}, tax_amount: #{@tax_amount}, tax_included:"\ + " #{@tax_included}, total_amount: #{@total_amount}, tiered_unit_price:"\ + " #{@tiered_unit_price}, period_range_start: #{@period_range_start}, period_range_end:"\ + " #{@period_range_end}, transaction_id: #{@transaction_id}, product_id: #{@product_id},"\ + " product_version: #{@product_version}, component_id: #{@component_id}, price_point_id:"\ + " #{@price_point_id}, billing_schedule_item_id: #{@billing_schedule_item_id}, hide:"\ + " #{@hide}, component_cost_data: #{@component_cost_data}, product_price_point_id:"\ " #{@product_price_point_id}, custom_item: #{@custom_item}, kind: #{@kind},"\ " additional_properties: #{get_additional_properties}>" end @@ -370,14 +386,15 @@ def inspect "<#{class_name} uid: #{@uid.inspect}, title: #{@title.inspect}, description:"\ " #{@description.inspect}, quantity: #{@quantity.inspect}, unit_price:"\ " #{@unit_price.inspect}, subtotal_amount: #{@subtotal_amount.inspect}, discount_amount:"\ - " #{@discount_amount.inspect}, tax_amount: #{@tax_amount.inspect}, total_amount:"\ - " #{@total_amount.inspect}, tiered_unit_price: #{@tiered_unit_price.inspect},"\ - " period_range_start: #{@period_range_start.inspect}, period_range_end:"\ - " #{@period_range_end.inspect}, transaction_id: #{@transaction_id.inspect}, product_id:"\ - " #{@product_id.inspect}, product_version: #{@product_version.inspect}, component_id:"\ - " #{@component_id.inspect}, price_point_id: #{@price_point_id.inspect},"\ - " billing_schedule_item_id: #{@billing_schedule_item_id.inspect}, hide: #{@hide.inspect},"\ - " component_cost_data: #{@component_cost_data.inspect}, product_price_point_id:"\ + " #{@discount_amount.inspect}, tax_amount: #{@tax_amount.inspect}, tax_included:"\ + " #{@tax_included.inspect}, total_amount: #{@total_amount.inspect}, tiered_unit_price:"\ + " #{@tiered_unit_price.inspect}, period_range_start: #{@period_range_start.inspect},"\ + " period_range_end: #{@period_range_end.inspect}, transaction_id:"\ + " #{@transaction_id.inspect}, product_id: #{@product_id.inspect}, product_version:"\ + " #{@product_version.inspect}, component_id: #{@component_id.inspect}, price_point_id:"\ + " #{@price_point_id.inspect}, billing_schedule_item_id:"\ + " #{@billing_schedule_item_id.inspect}, hide: #{@hide.inspect}, component_cost_data:"\ + " #{@component_cost_data.inspect}, product_price_point_id:"\ " #{@product_price_point_id.inspect}, custom_item: #{@custom_item.inspect}, kind:"\ " #{@kind.inspect}, additional_properties: #{get_additional_properties}>" end diff --git a/lib/advanced_billing/models/payment_profile_attributes.rb b/lib/advanced_billing/models/payment_profile_attributes.rb index 3020435..eae26b6 100644 --- a/lib/advanced_billing/models/payment_profile_attributes.rb +++ b/lib/advanced_billing/models/payment_profile_attributes.rb @@ -9,20 +9,20 @@ class PaymentProfileAttributes < BaseModel SKIP = Object.new private_constant :SKIP - # (Optional) Token received after sending billing information using - # chargify.js. This token must be passed as a sole attribute of + # (Optional) Token received after sending billing information using Maxio.js + # (formerly Chargify.js). This token must be passed as a sole attribute of # `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) # @return [String] attr_accessor :chargify_token - # (Optional) Token received after sending billing information using - # chargify.js. This token must be passed as a sole attribute of + # (Optional) Token received after sending billing information using Maxio.js + # (formerly Chargify.js). This token must be passed as a sole attribute of # `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) # @return [Integer] attr_accessor :id - # (Optional) Token received after sending billing information using - # chargify.js. This token must be passed as a sole attribute of + # (Optional) Token received after sending billing information using Maxio.js + # (formerly Chargify.js). This token must be passed as a sole attribute of # `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) # @return [PaymentType] attr_accessor :payment_type diff --git a/lib/advanced_billing/models/webhook_subscription.rb b/lib/advanced_billing/models/webhook_subscription.rb index ac5796b..e988d4a 100644 --- a/lib/advanced_billing/models/webhook_subscription.rb +++ b/lib/advanced_billing/models/webhook_subscription.rb @@ -31,6 +31,9 @@ class WebhookSubscription # TODO: Write general description for INVOICE_ISSUED INVOICE_ISSUED = 'invoice_issued'.freeze, + # TODO: Write general description for INVOICE_PENDING + INVOICE_PENDING = 'invoice_pending'.freeze, + # TODO: Write general description for METERED_USAGE METERED_USAGE = 'metered_usage'.freeze, @@ -135,6 +138,7 @@ def self.from_value(value, default_value = BILLING_DATE_CHANGE) when 'expiring_card' then EXPIRING_CARD when 'expiration_date_change' then EXPIRATION_DATE_CHANGE when 'invoice_issued' then INVOICE_ISSUED + when 'invoice_pending' then INVOICE_PENDING when 'metered_usage' then METERED_USAGE when 'payment_failure' then PAYMENT_FAILURE when 'payment_success' then PAYMENT_SUCCESS diff --git a/lib/advanced_billing/utilities/union_type_lookup.rb b/lib/advanced_billing/utilities/union_type_lookup.rb index af8075b..7153bb6 100644 --- a/lib/advanced_billing/utilities/union_type_lookup.rb +++ b/lib/advanced_billing/utilities/union_type_lookup.rb @@ -221,17 +221,7 @@ def self.union_types ) ), - :AllocationPreviewItemQuantity => OneOf.new( - [ - LeafType.new(Integer), - LeafType.new(String) - ], - UnionTypeContext.new( - is_optional: true - ) - ), - - :AllocationPreviewItemPreviousQuantity => OneOf.new( + :AllocationQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -241,7 +231,7 @@ def self.union_types ) ), - :AllocationQuantity => OneOf.new( + :AllocationPreviousQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -251,7 +241,7 @@ def self.union_types ) ), - :AllocationPreviousQuantity => OneOf.new( + :AllocationPreviewItemQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -261,7 +251,7 @@ def self.union_types ) ), - :ComponentAllocationChangeAllocatedQuantity => OneOf.new( + :AllocationPreviewItemPreviousQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -306,37 +296,27 @@ def self.union_types ) ), - :CreateAllocationPricePointId => OneOf.new( + :ComponentAllocationChangeAllocatedQuantity => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( - is_optional: true, - is_nullable: true + is_optional: true ) ), - :CreateMultiInvoicePaymentAmount => OneOf.new( + :ComponentPricePointAssignmentPricePoint => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) - ] - ), - - :CustomerErrorResponseErrors => OneOf.new( - [ - LeafType.new(CustomerError), - LeafType.new(String, UnionTypeContext.new( - is_array: true - )) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :EBBComponentUnitPrice => OneOf.new( + :CouponPayloadPercentage => OneOf.new( [ LeafType.new(String), LeafType.new(Float) @@ -346,13 +326,14 @@ def self.union_types ) ), - :CouponPayloadPercentage => OneOf.new( + :CreateAllocationPricePointId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) + LeafType.new(Integer) ], UnionTypeContext.new( - is_optional: true + is_optional: true, + is_nullable: true ) ), @@ -363,6 +344,16 @@ def self.union_types ] ), + :CreateComponentPricePointsRequestPricePoints => AnyOf.new( + [ + LeafType.new(CreateComponentPricePoint), + LeafType.new(CreatePrepaidUsageComponentPricePoint) + ], + UnionTypeContext.new( + is_array: true + ) + ), + :CreateInvoiceCouponPercentage => OneOf.new( [ LeafType.new(String), @@ -393,81 +384,57 @@ def self.union_types ) ), - :CreateInvoicePaymentAmount => OneOf.new( + :CreateInvoiceItemQuantity => OneOf.new( [ - LeafType.new(String), - LeafType.new(Float) + LeafType.new(Float), + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :CreateMetafieldsRequestMetafields => OneOf.new( - [ - LeafType.new(CreateMetafield), - LeafType.new(CreateMetafield, UnionTypeContext.new( - is_array: true - )) - ] - ), - - :CreateOrUpdateSegmentPriceUnitPrice => OneOf.new( - [ - LeafType.new(String), - LeafType.new(Float) - ] - ), - - :CreateSegmentSegmentProperty1Value => OneOf.new( + :CreateInvoiceItemUnitPrice => OneOf.new( [ - LeafType.new(String), LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSegmentSegmentProperty2Value => OneOf.new( + :CreateInvoiceItemProductId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSegmentSegmentProperty3Value => OneOf.new( + :CreateInvoiceItemComponentId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSegmentSegmentProperty4Value => OneOf.new( + :CreateInvoiceItemPricePointId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :ComponentPricePointAssignmentPricePoint => OneOf.new( + :CreateInvoiceItemProductPricePointId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -477,90 +444,101 @@ def self.union_types ) ), - :CreateComponentPricePointsRequestPricePoints => AnyOf.new( + :CreateInvoicePaymentAmount => OneOf.new( [ - LeafType.new(CreateComponentPricePoint), - LeafType.new(CreatePrepaidUsageComponentPricePoint) + LeafType.new(String), + LeafType.new(Float) ], UnionTypeContext.new( - is_array: true + is_optional: true ) ), - :CreateInvoiceItemQuantity => OneOf.new( + :CreateMetafieldsRequestMetafields => OneOf.new( [ - LeafType.new(Float), - LeafType.new(String) - ], - UnionTypeContext.new( - is_optional: true - ) + LeafType.new(CreateMetafield), + LeafType.new(CreateMetafield, UnionTypeContext.new( + is_array: true + )) + ] ), - :CreateInvoiceItemUnitPrice => OneOf.new( + :CreateMultiInvoicePaymentAmount => OneOf.new( [ - LeafType.new(Float), - LeafType.new(String) - ], - UnionTypeContext.new( - is_optional: true - ) + LeafType.new(String), + LeafType.new(Float) + ] ), - :CreateInvoiceItemProductId => OneOf.new( + :CreateOrUpdateSegmentPriceUnitPrice => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float) + ] + ), + + :CreatePaymentProfileExpirationMonth => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemComponentId => OneOf.new( + :CreatePaymentProfileExpirationYear => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemPricePointId => OneOf.new( + :CreateSegmentSegmentProperty1Value => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float), + LeafType.new(Integer), + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemProductPricePointId => OneOf.new( + :CreateSegmentSegmentProperty2Value => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float), + LeafType.new(Integer), + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreatePaymentProfileExpirationMonth => OneOf.new( + :CreateSegmentSegmentProperty3Value => OneOf.new( [ + LeafType.new(String), + LeafType.new(Float), LeafType.new(Integer), - LeafType.new(String) + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreatePaymentProfileExpirationYear => OneOf.new( + :CreateSegmentSegmentProperty4Value => OneOf.new( [ + LeafType.new(String), + LeafType.new(Float), LeafType.new(Integer), - LeafType.new(String) + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true @@ -607,6 +585,18 @@ def self.union_types ) ), + :CustomerErrorResponseErrors => OneOf.new( + [ + LeafType.new(CustomerError), + LeafType.new(String, UnionTypeContext.new( + is_array: true + )) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + :DeductServiceCreditAmount => OneOf.new( [ LeafType.new(String), @@ -614,6 +604,16 @@ def self.union_types ] ), + :EBBComponentUnitPrice => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Float) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + :EventEventSpecificData => OneOf.new( [ LeafType.new(SubscriptionProductChange), @@ -670,6 +670,13 @@ def self.union_types ) ), + :OnOffComponentUnitPrice => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Float) + ] + ), + :PaymentProfileAttributesExpirationMonth => OneOf.new( [ LeafType.new(Integer), @@ -690,61 +697,106 @@ def self.union_types ) ), - :ReactivateSubscriptionRequestResume => OneOf.new( + :PaymentProfile => AnyOf.new( [ - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]), - LeafType.new(ResumeOptions) + LeafType.new(ApplePayPaymentProfile, UnionTypeContext.new( + discriminator_value: 'apple_pay', + discriminator: 'payment_type' + )), + LeafType.new(BankAccountPaymentProfile, UnionTypeContext.new( + discriminator_value: 'bank_account', + discriminator: 'payment_type' + )), + LeafType.new(CreditCardPaymentProfile, UnionTypeContext.new( + discriminator_value: 'credit_card', + discriminator: 'payment_type' + )), + LeafType.new(PaypalPaymentProfile, UnionTypeContext.new( + discriminator_value: 'paypal_account', + discriminator: 'payment_type' + )) + ] + ), + + :PrepaidUsageComponentUnitPrice => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Float) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionCustomPricePriceInCents => OneOf.new( + :PriceStartingQuantity => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) ] ), - :SubscriptionCustomPriceInterval => OneOf.new( + :PriceEndingQuantity => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true, + is_nullable: true + ) + ), + + :PriceUnitPrice => OneOf.new( + [ + LeafType.new(Float), + LeafType.new(String) ] ), - :SubscriptionCustomPriceTrialPriceInCents => OneOf.new( + :QuantityBasedComponentUnitPrice => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionCustomPriceTrialInterval => OneOf.new( + :ReactivateSubscriptionRequestResume => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]), + LeafType.new(ResumeOptions) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionCustomPriceInitialChargeInCents => OneOf.new( + :RefundConsolidatedInvoiceSegmentUids => OneOf.new( + [ + LeafType.new(String, UnionTypeContext.new( + is_array: true + )), + LeafType.new(String) + ] + ), + + :RefundInvoiceRequestRefund => AnyOf.new( + [ + LeafType.new(RefundInvoice), + LeafType.new(RefundConsolidatedInvoice) + ] + ), + + :RefundPrepaymentAmount => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) - ], - UnionTypeContext.new( - is_optional: true - ) + LeafType.new(Float) + ] ), - :SubscriptionCustomPriceExpirationInterval => OneOf.new( + :RenewalPreviewComponentComponentId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -754,7 +806,7 @@ def self.union_types ) ), - :SubscriptionGroupCreditCardFullNumber => OneOf.new( + :RenewalPreviewComponentPricePointId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -764,32 +816,31 @@ def self.union_types ) ), - :SubscriptionGroupCreditCardExpirationMonth => OneOf.new( + :ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem => OneOf.new( + [ + LeafType.new(ScheduledRenewalItemRequestBodyComponent), + LeafType.new(ScheduledRenewalItemRequestBodyProduct) + ] + ), + + :ScheduledRenewalProductPricePointPriceInCents => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) - ], - UnionTypeContext.new( - is_optional: true - ) + ] ), - :SubscriptionGroupCreditCardExpirationYear => OneOf.new( + :ScheduledRenewalProductPricePointInterval => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) - ], - UnionTypeContext.new( - is_optional: true - ) + ] ), - :RefundConsolidatedInvoiceSegmentUids => OneOf.new( + :ScheduledRenewalUpdateRequestRenewalConfigurationItem => OneOf.new( [ - LeafType.new(String, UnionTypeContext.new( - is_array: true - )), - LeafType.new(String) + LeafType.new(ScheduledRenewalItemRequestBodyComponent), + LeafType.new(ScheduledRenewalItemRequestBodyProduct) ] ), @@ -841,133 +892,89 @@ def self.union_types ) ), - :PaymentProfile => AnyOf.new( + :SubscriptionComponentAllocatedQuantity => OneOf.new( [ - LeafType.new(ApplePayPaymentProfile, UnionTypeContext.new( - discriminator_value: 'apple_pay', - discriminator: 'payment_type' - )), - LeafType.new(BankAccountPaymentProfile, UnionTypeContext.new( - discriminator_value: 'bank_account', - discriminator: 'payment_type' - )), - LeafType.new(CreditCardPaymentProfile, UnionTypeContext.new( - discriminator_value: 'credit_card', - discriminator: 'payment_type' - )), - LeafType.new(PaypalPaymentProfile, UnionTypeContext.new( - discriminator_value: 'paypal_account', - discriminator: 'payment_type' - )) - ] + LeafType.new(Integer), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) ), - :RefundPrepaymentAmount => OneOf.new( + :SubscriptionCustomPricePriceInCents => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) - ] - ), - - :ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem => OneOf.new( - [ - LeafType.new(ScheduledRenewalItemRequestBodyComponent), - LeafType.new(ScheduledRenewalItemRequestBodyProduct) + LeafType.new(Integer) ] ), - :ScheduledRenewalProductPricePointPriceInCents => OneOf.new( + :SubscriptionCustomPriceInterval => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) ] ), - :ScheduledRenewalProductPricePointInterval => OneOf.new( + :SubscriptionCustomPriceTrialPriceInCents => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) - ] - ), - - :SubscriptionComponentAllocatedQuantity => OneOf.new( - [ - LeafType.new(Integer), - LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionGroupCreateErrorResponseErrors => OneOf.new( - [ - LeafType.new(SubscriptionGroupMembersArrayError), - LeafType.new(SubscriptionGroupSingleError), - LeafType.new(String) - ] - ), - - :OnOffComponentUnitPrice => OneOf.new( + :SubscriptionCustomPriceTrialInterval => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) - ] + LeafType.new(Integer) + ], + UnionTypeContext.new( + is_optional: true + ) ), - :PrepaidUsageComponentUnitPrice => OneOf.new( + :SubscriptionCustomPriceInitialChargeInCents => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :PriceStartingQuantity => OneOf.new( - [ - LeafType.new(Integer), - LeafType.new(String) - ] - ), - - :PriceEndingQuantity => OneOf.new( + :SubscriptionCustomPriceExpirationInterval => OneOf.new( [ - LeafType.new(Integer), - LeafType.new(String) + LeafType.new(String), + LeafType.new(Integer) ], UnionTypeContext.new( - is_optional: true, - is_nullable: true + is_optional: true ) ), - :PriceUnitPrice => OneOf.new( + :SubscriptionGroupCreateErrorResponseErrors => OneOf.new( [ - LeafType.new(Float), + LeafType.new(SubscriptionGroupMembersArrayError), + LeafType.new(SubscriptionGroupSingleError), LeafType.new(String) ] ), - :QuantityBasedComponentUnitPrice => OneOf.new( + :SubscriptionGroupCreditCardFullNumber => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :RefundInvoiceRequestRefund => AnyOf.new( - [ - LeafType.new(RefundInvoice), - LeafType.new(RefundConsolidatedInvoice) - ] - ), - - :RenewalPreviewComponentComponentId => OneOf.new( + :SubscriptionGroupCreditCardExpirationMonth => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -977,7 +984,7 @@ def self.union_types ) ), - :RenewalPreviewComponentPricePointId => OneOf.new( + :SubscriptionGroupCreditCardExpirationYear => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -987,13 +994,6 @@ def self.union_types ) ), - :ScheduledRenewalUpdateRequestRenewalConfigurationItem => OneOf.new( - [ - LeafType.new(ScheduledRenewalItemRequestBodyComponent), - LeafType.new(ScheduledRenewalItemRequestBodyProduct) - ] - ), - :SubscriptionGroupSignupComponentComponentId => OneOf.new( [ LeafType.new(String), @@ -1034,19 +1034,21 @@ def self.union_types ) ), - :UpdatePriceEndingQuantity => OneOf.new( + :UpdateMetafieldsRequestMetafields => OneOf.new( [ - LeafType.new(Integer), - LeafType.new(String) + LeafType.new(UpdateMetafield), + LeafType.new(UpdateMetafield, UnionTypeContext.new( + is_array: true + )) ], UnionTypeContext.new( is_optional: true ) ), - :UpdatePriceUnitPrice => OneOf.new( + :UpdatePriceEndingQuantity => OneOf.new( [ - LeafType.new(Float), + LeafType.new(Integer), LeafType.new(String) ], UnionTypeContext.new( @@ -1054,9 +1056,9 @@ def self.union_types ) ), - :UpdatePriceStartingQuantity => OneOf.new( + :UpdatePriceUnitPrice => OneOf.new( [ - LeafType.new(Integer), + LeafType.new(Float), LeafType.new(String) ], UnionTypeContext.new( @@ -1064,12 +1066,10 @@ def self.union_types ) ), - :UpdateMetafieldsRequestMetafields => OneOf.new( + :UpdatePriceStartingQuantity => OneOf.new( [ - LeafType.new(UpdateMetafield), - LeafType.new(UpdateMetafield, UnionTypeContext.new( - is_array: true - )) + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( is_optional: true From be6fe1a517055904baac1f83cfc0b5325f7e4796 Mon Sep 17 00:00:00 2001 From: lucassus Date: Thu, 11 Jun 2026 13:22:03 +0000 Subject: [PATCH 3/9] Automated commit message --- doc/controllers/advance-invoice.md | 4 +- doc/controllers/api-exports.md | 18 +-- doc/controllers/billing-portal.md | 16 +-- doc/controllers/component-price-points.md | 18 +-- doc/controllers/components.md | 24 ++-- doc/controllers/coupons.md | 45 +++---- doc/controllers/custom-fields.md | 6 +- doc/controllers/customers.md | 12 +- .../events-based-billing-segments.md | 12 +- doc/controllers/events.md | 8 +- doc/controllers/insights.md | 6 +- doc/controllers/offers.md | 10 +- doc/controllers/payment-profiles.md | 12 +- doc/controllers/product-families.md | 4 +- doc/controllers/product-price-points.md | 6 +- doc/controllers/products.md | 6 +- doc/controllers/proforma-invoices.md | 24 ++-- doc/controllers/reason-codes.md | 14 +- doc/controllers/referral-codes.md | 2 +- doc/controllers/sales-commissions.md | 6 +- doc/models/chjs-tokenization-failure.md | 27 ++++ doc/models/chjs-tokenization-success.md | 28 ++++ .../containers/event-event-specific-data.md | 30 ++++- ...ayment-profile.md => payment-profile-2.md} | 2 +- .../create-or-update-endpoint-request.md | 2 +- doc/models/create-or-update-endpoint.md | 2 +- doc/models/create-subscription-request.md | 1 - doc/models/create-subscription.md | 3 +- doc/models/credit-note-line-item.md | 1 + doc/models/customer.md | 1 + doc/models/event-key.md | 2 + doc/models/event-response.md | 2 +- doc/models/event.md | 4 +- doc/models/invoice-line-item.md | 1 + doc/models/payment-profile-params.md | 27 ++++ doc/models/payment-profile.md | 27 ++++ doc/models/site.md | 3 + doc/models/webhook-subscription.md | 2 + lib/advanced_billing.rb | 4 + .../controllers/advance_invoice_controller.rb | 8 +- .../controllers/api_exports_controller.rb | 27 ++-- .../controllers/billing_portal_controller.rb | 20 +-- .../component_price_points_controller.rb | 31 ++--- .../controllers/components_controller.rb | 50 ++++---- .../controllers/coupons_controller.rb | 73 +++++------ .../controllers/custom_fields_controller.rb | 7 +- .../controllers/customers_controller.rb | 19 +-- ...vents_based_billing_segments_controller.rb | 25 ++-- .../controllers/events_controller.rb | 9 +- .../controllers/insights_controller.rb | 9 +- .../controllers/offers_controller.rb | 15 +-- .../payment_profiles_controller.rb | 20 +-- .../product_families_controller.rb | 4 +- .../product_price_points_controller.rb | 9 +- .../controllers/products_controller.rb | 6 +- .../proforma_invoices_controller.rb | 61 +++++---- .../controllers/reason_codes_controller.rb | 21 ++- .../controllers/referral_codes_controller.rb | 6 +- .../sales_commissions_controller.rb | 6 +- .../models/chjs_tokenization_failure.rb | 98 ++++++++++++++ .../models/chjs_tokenization_success.rb | 102 +++++++++++++++ .../models/create_subscription.rb | 6 +- .../models/credit_note_line_item.rb | 23 +++- lib/advanced_billing/models/customer.rb | 20 ++- lib/advanced_billing/models/event.rb | 2 + lib/advanced_billing/models/event_key.rb | 8 ++ .../models/invoice_line_item.rb | 24 +++- .../models/payment_profile.rb | 121 ++++++++++++++++++ .../models/payment_profile_params.rb | 103 +++++++++++++++ .../models/payment_profile_response.rb | 6 +- lib/advanced_billing/models/site.rb | 47 ++++++- .../models/webhook_subscription.rb | 8 ++ .../utilities/union_type_lookup.rb | 6 +- 73 files changed, 1037 insertions(+), 385 deletions(-) create mode 100644 doc/models/chjs-tokenization-failure.md create mode 100644 doc/models/chjs-tokenization-success.md rename doc/models/containers/{payment-profile.md => payment-profile-2.md} (98%) create mode 100644 doc/models/payment-profile-params.md create mode 100644 doc/models/payment-profile.md create mode 100644 lib/advanced_billing/models/chjs_tokenization_failure.rb create mode 100644 lib/advanced_billing/models/chjs_tokenization_success.rb create mode 100644 lib/advanced_billing/models/payment_profile.rb create mode 100644 lib/advanced_billing/models/payment_profile_params.rb diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index 0d55e4e..201c712 100644 --- a/doc/controllers/advance-invoice.md +++ b/doc/controllers/advance-invoice.md @@ -17,7 +17,7 @@ advance_invoice_controller = client.advance_invoice # Issue Advance Invoice -Generate an invoice in advance for a subscription's next renewal date. [See our docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility on generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided. +Generate an invoice in advance for a subscription's next renewal date. [See our docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility for generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided. A subscription may only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists will return an error. That said, regeneration of the invoice may be forced with the params `force: true`, which will void an advance invoice if one exists and generate a new one. If no advance invoice exists, a new one will be generated. We recommend using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it. @@ -70,7 +70,7 @@ puts result # Read Advance Invoice -Once an advance invoice has been generated for a subscription's upcoming renewal, it can be viewed through this endpoint. There can only be one advance invoice per subscription per billing cycle. +Returns the advance invoice generated for a subscription's upcoming renewal. There can only be one advance invoice per subscription per billing cycle. ```ruby def read_advance_invoice(subscription_id) diff --git a/doc/controllers/api-exports.md b/doc/controllers/api-exports.md index af8ea40..26f89c8 100644 --- a/doc/controllers/api-exports.md +++ b/doc/controllers/api-exports.md @@ -23,7 +23,7 @@ api_exports_controller = client.api_exports # List Exported Proforma Invoices -This API returns an array of exported proforma invoices for a provided `batch_id`. Pay close attention to pagination in order to control responses from the server. +Lists exported proforma invoices for a provided `batch_id`. Use pagination to control responses returned from the server. Example: `GET https://{subdomain}.chargify.com/api_exports/proforma_invoices/123/rows?per_page=10000&page=1`. @@ -71,7 +71,7 @@ puts result # List Exported Invoices -This API returns an array of exported invoices for a provided `batch_id`. Pay close attention to pagination in order to control responses from the server. +Lists exported invoices for a provided `batch_id`. Use pagination to control responses returned from the server. Example: `GET https://{subdomain}.chargify.com/api_exports/invoices/123/rows?per_page=10000&page=1`. @@ -119,7 +119,7 @@ puts result # List Exported Subscriptions -This API returns an array of exported subscriptions for a provided `batch_id`. Pay close attention to pagination in order to control responses from the server. +Lists exported subscriptions for a provided `batch_id`. Use pagination to control responses returned from the server. Example: `GET https://{subdomain}.chargify.com/api_exports/subscriptions/123/rows?per_page=200&page=1`. @@ -167,7 +167,7 @@ puts result # Export Proforma Invoices -This API creates a proforma invoices export and returns a batchjob object. +Creates a proforma invoices export and returns a batch job object. It is only available for Relationship Invoicing architecture. @@ -202,7 +202,7 @@ puts result # Export Invoices -This API creates an invoices export and returns a batchjob object. +Creates an invoices export and returns a batch job object. ```ruby def export_invoices @@ -235,7 +235,7 @@ puts result # Export Subscriptions -This API creates a subscriptions export and returns a batchjob object. +Creates a subscriptions export and returns a batch job object. ```ruby def export_subscriptions @@ -267,7 +267,7 @@ puts result # Read Proforma Invoices Export -This API returns a batchjob object for proforma invoices export. +Returns a batch job object for a proforma invoices export. ```ruby def read_proforma_invoices_export(batch_id) @@ -307,7 +307,7 @@ puts result # Read Invoices Export -This API returns a batchjob object for invoices export. +Returns a batch job object for an invoices export. ```ruby def read_invoices_export(batch_id) @@ -347,7 +347,7 @@ puts result # Read Subscriptions Export -This API returns a batchjob object for subscriptions export. +Returns a batch job object for a subscriptions export. ```ruby def read_subscriptions_export(batch_id) diff --git a/doc/controllers/billing-portal.md b/doc/controllers/billing-portal.md index ee06d63..8d9c8e8 100644 --- a/doc/controllers/billing-portal.md +++ b/doc/controllers/billing-portal.md @@ -18,11 +18,13 @@ billing_portal_controller = client.billing_portal # Enable Billing Portal for Customer +Enables Billing Portal access for a customer, with an option to send an invitation email at the same time. + ## Billing Portal Documentation Full documentation on how the Billing Portal operates within the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview). -This documentation is focused on how the to configure the Billing Portal Settings, as well as Subscriber Interaction and Merchant Management of the Billing Portal. +This documentation is focused on how to configure the Billing Portal Settings, as well as Subscriber Interaction and Merchant Management of the Billing Portal. You can use this endpoint to enable Billing Portal access for a Customer, with the option of sending the Customer an Invitation email at the same time. @@ -74,7 +76,7 @@ puts result # Read Billing Portal Link -This method will provide to the API user the exact URL required for a subscriber to access the Billing Portal. +Returns the exact URL required for a subscriber to access the Billing Portal. ## Rules for Management Link API @@ -136,15 +138,13 @@ puts result # Resend Billing Portal Invitation -You can resend a customer's Billing Portal invitation. - -If you attempt to resend an invitation 5 times within 30 minutes, you will receive a `422` response with `error` message in the body. +Resends a customer's Billing Portal invitation. -If you attempt to resend an invitation when the Billing Portal is already disabled for a Customer, you will receive a `422` error response. +If you attempt to resend an invitation 5 times within 30 minutes, you will receive a `422` response with an `error` message in the body. If you attempt to resend an invitation when the Billing Portal is already disabled for a Customer, you will receive a `422` error response. -If you attempt to resend an invitation when the Customer does not exist a Customer, you will receive a `404` error response. +If you attempt to resend an invitation when the Customer does not exist, you will receive a `404` error response. ## Limitations @@ -200,7 +200,7 @@ puts result # Revoke Billing Portal Access -You can revoke a customer's Billing Portal invitation. +Revokes a customer's Billing Portal invitation. If you attempt to revoke an invitation when the Billing Portal is already disabled for a Customer, you will receive a 422 error response. diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index 3fedd00..5c90b46 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -170,7 +170,7 @@ puts result # List Component Price Points -Use this endpoint to read current price points that are associated with a component. +Lists the price points associated with a component. You may specify the component by using either the numeric id or the `handle:gold` syntax. @@ -268,7 +268,7 @@ puts result # Bulk Create Component Price Points -Use this endpoint to create multiple component price points in one request. +Creates multiple component price points in one request. ```ruby def bulk_create_component_price_points(component_id, @@ -537,7 +537,7 @@ puts result # Update Component Price Point -When updating a price point, prices can be updated as well by creating new prices or editing / removing existing ones. +Updates a component price point and its associated prices. Passing in a price bracket without an `id` will attempt to create a new price. @@ -614,7 +614,7 @@ puts result # Read Component Price Point -Use this endpoint to retrieve details for a specific component price point. You can achieve this by using either the component price point ID or handle. +Returns details for a specific component price point. You can achieve this by using either the component price point ID or handle. ```ruby def read_component_price_point(component_id, @@ -657,7 +657,7 @@ puts result # Archive Component Price Point -A price point can be archived at any time. Subscriptions using a price point that has been archived will continue using it until they're moved to another price point. +Archives a component price point. Subscriptions using a price point that has been archived will continue using it until they're moved to another price point. ```ruby def archive_component_price_point(component_id, @@ -738,7 +738,7 @@ puts result # Unarchive Component Price Point -Use this endpoint to unarchive a component price point. +Unarchives a component price point. ```ruby def unarchive_component_price_point(component_id, @@ -813,7 +813,7 @@ puts result # Create Currency Prices -This endpoint allows you to create currency prices for a given currency that has been defined on the site level in your settings. +Creates currency prices for a given currency defined at the site level. When creating currency prices, they need to mirror the structure of your primary pricing. For each price level defined on the component price point, there should be a matching price level created in the given currency. @@ -894,7 +894,7 @@ puts result # Update Currency Prices -This endpoint allows you to update currency prices for a given currency that has been defined on the site level in your settings. +Updates currency prices for a given currency defined at the site level. Note: Currency Prices are not able to be updated for custom price points. @@ -971,7 +971,7 @@ puts result # List All Component Price Points -This method allows to retrieve a list of Components Price Points belonging to a Site. +Lists all component price points belonging to a site. ```ruby def list_all_component_price_points(options = {}) diff --git a/doc/controllers/components.md b/doc/controllers/components.md index dcc5e8b..8cd13e4 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -26,7 +26,7 @@ components_controller = client.components # Create Metered Component -This request will create a component definition of kind **metered_component** under the specified product family. Metered component can then be added and “allocated” for a subscription. +Creates a metered component definition under the specified product family. A metered component can then be added and “allocated” for a subscription. Metered components are used to bill for any type of unit that resets to 0 at the end of the billing period (think daily Google Ads clicks or monthly cell phone minutes). This is most commonly associated with usage-based billing and many other pricing schemes. @@ -143,9 +143,9 @@ puts result # Create Quantity Based Component -This request will create a component definition of kind **quantity_based_component** under the specified product family. Quantity Based component can then be added and “allocated” for a subscription. +Creates a Quantity Based component definition under the specified product family. A Quantity Based component can then be added and “allocated” for a subscription. -When defining Quantity Based component, You can choose one of 2 types: +When defining a Quantity Based component, you can choose one of 2 types: #### Recurring @@ -269,7 +269,7 @@ puts result # Create On Off Component -This request will create a component definition of kind **on_off_component** under the specified product family. On/Off component can then be added and “allocated” for a subscription. +Creates an On/Off component definition under the specified product family. An On/Off component can then be added and “allocated” for a subscription. On/off components are used for any flat fee, recurring add on (think $99/month for tech support or a flat add on shipping fee). @@ -370,7 +370,7 @@ puts result # Create Prepaid Usage Component -This request will create a component definition of kind **prepaid_usage_component** under the specified product family. Prepaid component can then be added and “allocated” for a subscription. +Creates a prepaid usage component definition under the specified product family. A prepaid component can then be added and “allocated” for a subscription. Prepaid components allow customers to pre-purchase units that can be used up over time on their subscription. In a sense, they are the mirror image of metered components; while metered components charge at the end of the period for the amount of units used, prepaid components are charged for at the time of purchase, and we subsequently keep track of the usage against the amount purchased. @@ -509,7 +509,7 @@ puts result # Create Event Based Component -This request will create a component definition of kind **event_based_component** under the specified product family. Event-based component can then be added and “allocated” for a subscription. +Creates an event-based component definition under the specified product family. An event-based component can then be added and “allocated” for a subscription. Event-based components are similar to other component types, in that you define the component parameters (such as name and taxability) and the pricing. A key difference for the event-based component is that it must be attached to a metric. This is because the metric provides the component with the actual quantity used in computing what and how much will be billed each period for each subscription. @@ -618,7 +618,7 @@ puts result # Find Component -This request will return information regarding a component having the handle you provide. You can identify your components with a handle so you don't have to save or reference the IDs we generate. +Returns information for a component matching the provided handle. You can identify your components with a handle so you don't have to save or reference the IDs we generate. ```ruby def find_component(handle) @@ -756,7 +756,7 @@ puts result # Update Product Family Component -This request will update a component from a specific product family. +Updates a component from a specific product family. You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. @@ -844,7 +844,7 @@ puts result # Archive Component -Sending a DELETE request to this endpoint will archive the component. All current subscribers will be unffected; their subscription/purchase will continue to be charged as usual. +Archives the component; all current subscribers will continue to be charged as usual. ```ruby def archive_component(product_family_id, @@ -917,7 +917,7 @@ puts result # List Components -This request will return a list of components for a site. +Lists components for a site. ```ruby def list_components(options = {}) @@ -1069,7 +1069,7 @@ puts result # Update Component -This request will update a component. +Updates a component. You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. @@ -1152,7 +1152,7 @@ puts result # List Components for Product Family -This request will return a list of components for a particular product family. +Lists components for a particular product family. ```ruby def list_components_for_product_family(options = {}) diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index 22b541c..769e65f 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -28,21 +28,16 @@ coupons_controller = client.coupons # Create Coupon -## Coupons Documentation - -Coupons can be administered in the Advanced Billing application or created via API. View our section on [creating coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creating-Editing-Deleting-Coupons) for more information. - -Additionally, for documentation on how to apply a coupon to a subscription within the Advanced Billing UI, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). - -## Create Coupon - -This request will create a coupon, based on the provided information. - -You can create either a flat amount coupon, by specyfing `amount_in_cents`, or percentage coupon by specyfing `percentage`. +Creates a coupon under the specified product family. +You can create either a flat amount coupon by specifying amount_in_cents, or a percentage coupon by specifying percentage You can restrict a coupon to only apply to specific products / components by optionally passing in `restricted_products` and/or `restricted_components` objects in the format: `{ "": boolean_value }` +Coupons can be administered in the Advanced Billing application or created via API. See [creating coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creating-Editing-Deleting-Coupons) for more information. + +See [Apply Coupons to Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions) for information on applying a coupon to a subscription in the Advanced Billing UI. + ```ruby def create_coupon(product_family_id, body: nil) @@ -110,7 +105,7 @@ puts result # List Coupons for Product Family -List coupons for a specific Product Family in a Site. +Lists coupons for a specific product family in a site. ```ruby def list_coupons_for_product_family(options = {}) @@ -259,7 +254,7 @@ puts result # Find Coupon -You can search for a coupon via the API with the find method. By passing a code parameter, the find will attempt to locate a coupon that matches that code. If no coupon is found, a 404 is returned. +Searches for a coupon by code, returning a 404 if no coupon is found. By passing a code parameter, the find will attempt to locate a coupon that matches that code. If you have more than one product family and if the coupon you are trying to find does not belong to the default product family in your site, then you will need to specify (either in the url or as a query string param) the product family id. @@ -299,7 +294,7 @@ puts result # Read Coupon -You can retrieve the Coupon via the API with the Show method. You must identify the Coupon in this call by the ID parameter that Advanced Billing assigns. +Returns a coupon by its Advanced Billing-assigned ID. You must identify the Coupon in this call by the ID parameter that Advanced Billing assigns. If instead you would like to find a Coupon using a Coupon code, see the Coupon Find method. When fetching a coupon, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. @@ -379,9 +374,7 @@ puts result # Update Coupon -## Update Coupon - -You can update a Coupon via the API with a PUT request to the resource endpoint. +Updates a coupon. You can restrict a coupon to only apply to specific products / components by optionally passing in hashes of `restricted_products` and/or `restricted_components` in the format: `{ "": boolean_value }` @@ -485,7 +478,7 @@ puts result # Archive Coupon -You can archive a Coupon via the API with the archive method. +Archives a coupon, making it unavailable for future use while remaining active on existing subscriptions. Archiving makes that Coupon unavailable for future use, but allows it to remain attached and functional on existing Subscriptions that are using it. The `archived_at` date and time will be assigned. @@ -557,7 +550,7 @@ puts result # List Coupons -You can retrieve a list of coupons. +Lists coupons for a site. ```ruby def list_coupons(options = {}) @@ -661,7 +654,7 @@ puts result # Read Coupon Usage -This request will provide details about the coupon usage as an array of data hashes, one per product. +Lists coupon usage details, one entry per product. ```ruby def read_coupon_usage(product_family_id, @@ -736,7 +729,7 @@ puts result # Validate Coupon -You can verify if a specific coupon code is valid using the `validate` method. This method is useful for validating coupon codes that are entered by a customer. If the coupon is found and is valid, the coupon will be returned with a 200 status code. +Verifies whether a specific coupon code is valid. This method is useful for validating coupon codes that are entered by a customer. If the coupon is found and is valid, the coupon will be returned with a 200 status code. If the coupon is invalid, the status code will be 404 and the response will say why it is invalid. If the coupon is valid, the status code will be 200 and the coupon will be returned. The following reasons for invalidity are supported: @@ -827,7 +820,7 @@ puts result # Create or Update Coupon Currency Prices -This endpoint allows you to create and/or update currency prices for an existing coupon. Multiple prices can be created or updated in a single request but each of the currencies must be defined on the site level already and the coupon must be an amount-based coupon, not percentage. +Creates and/or updates currency prices for an existing coupon. Multiple prices can be created or updated in a single request but each of the currencies must be defined on the site level already and the coupon must be an amount-based coupon, not percentage. Currency pricing for coupons must mirror the setup of the primary coupon pricing - if the primary coupon is percentage based, you will not be able to define pricing in non-primary currencies. @@ -887,6 +880,8 @@ puts result # Create Coupon Subcodes +Creates subcodes for an existing coupon. + ## Coupon Subcodes Intro Coupon Subcodes allow you to create a set of unique codes that allow you to expand the use of one coupon. @@ -985,7 +980,7 @@ puts result # List Coupon Subcodes -This request allows you to request the subcodes that are attached to a coupon. +Lists the subcodes attached to a coupon. ```ruby def list_coupon_subcodes(options = {}) @@ -1054,7 +1049,7 @@ puts result # Update Coupon Subcodes -You can update the subcodes for the given Coupon via the API with a PUT request to the resource endpoint. +Updates the subcodes for a coupon, replacing all existing subcodes with the new list. Send an array of new coupon subcodes. **Note**: All current subcodes for that Coupon will be deleted first, and replaced with the list of subcodes sent to this endpoint. @@ -1111,6 +1106,8 @@ puts result # Delete Coupon Subcode +Deletes a specific subcode from a coupon. + ## Example Given a coupon with an ID of 567, and a coupon subcode of 20OFF, the URL to `DELETE` this coupon subcode would be: diff --git a/doc/controllers/custom-fields.md b/doc/controllers/custom-fields.md index 8830621..660a44b 100644 --- a/doc/controllers/custom-fields.md +++ b/doc/controllers/custom-fields.md @@ -219,7 +219,7 @@ With this endpoint, you can: - Add new metadata to a dropdown or radio for a metafield that was created without metadata. -- Remove metadata for a dropdown or radio for a metafield. +- Remove metadata for a dropdown or radio for a metafield. > Note: Updates to metadata overwrite existing values. To remove one or more values, specify all metadata values except those you want to remove. @@ -442,7 +442,7 @@ Updates metadata and metafields on the Site and the customer or subscription spe If you update metadata on a subscription or customer with a metafield that does not already exist, the metafield is created with the metadata you specify and it is always added as a text field to the Site and to the subscription or customer you specify. You can update the input_type for the metafield with the Update Metafield endpoint. -Each site is limited to 100 unique metafields per resource. This means you can have 100 metafields for Subscription and another 100 for Customer. +Each site is limited to 100 unique metafields per resource. This means you can have 100 metafields for the Subscription resource and another 100 for the Customer resource. ```ruby def update_metadata(resource_type, @@ -541,7 +541,7 @@ custom_fields_controller.delete_metadata( # List Metadata for Resource Type -Lists metadata for a specified array of subscriptions or customers. +Lists metadata for a specified array of subscriptions or customers. ```ruby def list_metadata_for_resource_type(options = {}) diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index e23db8d..dff9ad5 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -21,7 +21,7 @@ customers_controller = client.customers # Create Customer -You may create a new Customer at any time, or you may create a Customer at the same time you create a Subscription. The only validation restriction is that you may only create one customer for a given reference value. +Creates a new customer; can also be created alongside a new subscription. The only validation restriction is that you may only create one customer for a given reference value. If provided, the `reference` value must be unique. It represents a unique identifier for the customer from your own app, i.e. the customer’s ID. This allows you to retrieve a given customer via a piece of shared information. Alternatively, you may choose to leave `reference` blank, and store Advanced Billing’s unique ID for the customer, which is in the `id` attribute. @@ -136,7 +136,7 @@ puts result # List Customers -This request will by default list all customers associated with your Site. +Lists all customers associated with your site, or filters results using the search parameter. ## Find Customer @@ -351,7 +351,7 @@ puts result # Update Customer -This method allows to update the Customer. +Updates the customer. ```ruby def update_customer(id, @@ -436,7 +436,7 @@ puts result # Delete Customer -This method allows you to delete the Customer. +Deletes the customer. ```ruby def delete_customer(id) @@ -469,7 +469,7 @@ customers_controller.delete_customer(id) # Read Customer by Reference -Use this method to return the customer object if you have the unique **Reference ID (Your App)** value handy. It will return a single match. +Returns a customer by their unique reference ID. It will return a single match. ```ruby def read_customer_by_reference(reference) @@ -503,7 +503,7 @@ puts result # List Customer Subscriptions -This method lists all subscriptions that belong to a customer. +Lists all subscriptions that belong to a customer. ```ruby def list_customer_subscriptions(customer_id) diff --git a/doc/controllers/events-based-billing-segments.md b/doc/controllers/events-based-billing-segments.md index 135d894..e6a8752 100644 --- a/doc/controllers/events-based-billing-segments.md +++ b/doc/controllers/events-based-billing-segments.md @@ -20,7 +20,7 @@ events_based_billing_segments_controller = client.events_based_billing_segments # Create Segment -This endpoint creates a new Segment for a Component with segmented Metric. It allows you to specify properties to bill upon and prices for each Segment. You can only pass as many "property_values" as the related Metric has segmenting properties defined. +Creates a new segment for a component with a segmented metric. It allows you to specify properties to bill upon and prices for each Segment. You can only pass as many "property_values" as the related Metric has segmenting properties defined. You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. @@ -92,7 +92,7 @@ puts result # List Segments for Price Point -This endpoint allows you to fetch Segments created for a given Price Point. They will be returned in the order of creation. +Lists segments created for a given price point, in order of creation. You can pass `page` and `per_page` parameters in order to access all of the segments. By default it will return `30` records. You can set `per_page` to `200` at most. @@ -149,7 +149,7 @@ puts result # Update Segment -This endpoint updates a single Segment for a Component with a segmented Metric. It allows you to update the pricing for the segment. +Updates a single segment for a component with a segmented metric. It allows you to update the pricing for the segment. You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. @@ -206,7 +206,7 @@ puts result # Delete Segment -This endpoint allows you to delete a Segment with specified ID. +Deletes a segment with the specified ID. You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. @@ -260,7 +260,7 @@ events_based_billing_segments_controller.delete_segment( # Bulk Create Segments -This endpoint allows you to create multiple segments in one request. The array of segments can contain up to `2000` records. +Creates multiple segments in one request. The array of segments can contain up to `2000` records. If any of the records contain an error the whole request would fail and none of the requested segments get created. The error response contains a message for only the one segment that failed validation, with the corresponding index in the array. @@ -314,7 +314,7 @@ puts result # Bulk Update Segments -This endpoint allows you to update multiple segments in one request. The array of segments can contain up to `1000` records. +Updates multiple segments in one request. The array of segments can contain up to `1000` records. If any of the records contain an error the whole request would fail and none of the requested segments get updated. The error response contains a message for only the one segment that failed validation, with the corresponding index in the array. diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 8fddf5c..1dead8c 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -17,11 +17,13 @@ events_controller = client.events # List Events +Lists events for a site. + ## Events Intro Advanced Billing Events include various activity that happens around a Site. This information is **especially** useful to track down issues that arise when subscriptions are not created due to errors. -Within the Advanced Billing UI, "Events" are referred to as "Site Activity". Full documentation on how to record view Events / Site Activty in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). +Within the Advanced Billing UI, "Events" are referred to as "Site Activity". Full documentation on how to view Events / Site Activity in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). ## List Events for a Site @@ -199,7 +201,7 @@ puts result # List Subscription Events -The following request will return a list of events for a subscription. +Lists events for a subscription. ## Event Key @@ -301,7 +303,7 @@ puts result # Read Events Count -Get a count of all the events for a given site by using this method. +Returns the total count of events for a given site. ```ruby def read_events_count(options = {}) diff --git a/doc/controllers/insights.md b/doc/controllers/insights.md index ad1f415..30f32ca 100644 --- a/doc/controllers/insights.md +++ b/doc/controllers/insights.md @@ -18,7 +18,7 @@ insights_controller = client.insights # Read Site Stats -The Stats API is a very basic view of some Site-level stats. This API call only answers with JSON responses. An XML version is not provided. +Returns basic site-level stats. This API call only answers with JSON responses. An XML version is not provided. ## Stats Documentation @@ -73,7 +73,7 @@ puts result **This endpoint is deprecated.** -This endpoint returns your site's current MRR, including plan and usage breakouts. +Returns your site's current MRR, including plan and usage breakouts. ```ruby def read_mrr(at_time: nil, @@ -129,7 +129,7 @@ puts result **This endpoint is deprecated.** -This endpoint returns your site's MRR movements. +Lists your site's MRR movements. ## Understanding MRR movements diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index a89784e..efab388 100644 --- a/doc/controllers/offers.md +++ b/doc/controllers/offers.md @@ -19,7 +19,7 @@ offers_controller = client.offers # Create Offer -Create an offer within your Advanced Billing site by sending a POST request. +Creates an offer within your Advanced Billing site. ## Documentation @@ -130,7 +130,7 @@ puts result # List Offers -This endpoint will list offers for a site. +Lists offers for a site. ```ruby def list_offers(options = {}) @@ -231,7 +231,7 @@ puts result # Read Offer -This method allows you to list a specific offer's attributes. This is different than list all offers for a site, as it requires an `offer_id`. +Returns a specific offer's attributes. This is different from listing all offers for a site, as it requires an `offer_id`. ```ruby def read_offer(offer_id) @@ -265,7 +265,7 @@ puts result # Archive Offer -Archive an existing offer. Please provide an `offer_id` in order to archive the correct item. +Archives an existing offer. Please provide an `offer_id` in order to archive the correct item. ```ruby def archive_offer(offer_id) @@ -298,7 +298,7 @@ offers_controller.archive_offer(offer_id) # Unarchive Offer -Unarchive a previously archived offer. Please provide an `offer_id` in order to un-archive the correct item. +Unarchives a previously archived offer. Please provide an `offer_id` in order to unarchive the correct item. ```ruby def unarchive_offer(offer_id) diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index 291c1d2..8f5e0ac 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -47,7 +47,7 @@ See the following articles to learn more about subscriptions and payments: + [Maxio.js with GoCardless - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QR09JVHWW0MCA7HVJV) + [Maxio.js with Stripe Direct Debit - minimal example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QQFKKN8Z7B7DZ9AJS5) + [Maxio.js with Stripe Direct Debit - full example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples#h_01K0PJ15QRECQQ4ECS3ZA55GY7) - + [CMaxio.js with Stripe BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) + + [Maxio.js with Stripe BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) + [Maxio.js with Stripe BECS Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-sepa-direct-debit-stripe-gateway) + [Full documentation on GoCardless](https://maxio.zendesk.com/hc/en-us/articles/24176159136909-GoCardless) + [Full documentation on Stripe SEPA Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) @@ -133,7 +133,7 @@ puts result # List Payment Profiles -This method will return all of the active `payment_profiles` for a Site, or for one Customer within a site. If no payment profiles are found, this endpoint will return an empty array, not a 404. +Returns all active payment profiles for a site, or for one customer within a site. If no payment profiles are found, this endpoint will return an empty array, not a 404. ```ruby def list_payment_profiles(options = {}) @@ -235,7 +235,7 @@ puts result # Read Payment Profile -Using the GET method you can retrieve a Payment Profile identified by its unique ID. +Returns a payment profile identified by its unique ID. Note that a different JSON object will be returned if the card method on file is a bank account. @@ -342,6 +342,8 @@ puts result # Update Payment Profile +Updates a payment profile. + ## Partial Card Updates In the event that you are using the Authorize.net, Stripe, Cybersource, Forte or Braintree Blue payment gateways, you can update just the billing and contact information for a payment method. Note the lack of credit-card related data contained in the JSON payload. @@ -539,7 +541,7 @@ payment_profiles_controller.delete_subscriptions_payment_profile( # Verify Bank Account -Submit the two small deposit amounts the customer received in their bank account in order to verify the bank account. (Stripe only) +Verifies a bank account. Submit the two small deposit amounts the customer received in their bank account to verify the bank account. (Stripe only) ```ruby def verify_bank_account(bank_account_id, @@ -662,7 +664,7 @@ payment_profiles_controller.delete_subscription_group_payment_profile( # Change Subscription Default Payment Profile -This will change the default payment profile on the subscription to the existing payment profile with the id specified. +Changes the default payment profile on the subscription to the existing payment profile with the specified ID. You must elect to change the existing payment profile to a new payment profile ID in order to receive a satisfactory response from this endpoint. diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index d46f80e..ef157d6 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -180,7 +180,7 @@ puts result # Create Product Family -Creates a Product Family within your Advanced Billing site. Create a Product Family to act as a container for your products, components and coupons. +Creates a Product Family within your Advanced Billing site. Create a Product Family to act as a container for your products, components, and coupons. Full documentation on how Product Families operate within the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Product-Families). @@ -241,7 +241,7 @@ puts result # List Product Families -Retrieve a list of Product Families for a site. +Returns a list of Product Families for a site. ```ruby def list_product_families(options = {}) diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index e526323..8dc2e28 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -268,7 +268,7 @@ puts result # Read Product Price Point -Use this endpoint to retrieve details for a specific product price point. You can achieve this by using either the product price point ID or handle. +Returns details for a specific product price point. You can achieve this by using either the product price point ID or handle. ```ruby def read_product_price_point(product_id, @@ -412,7 +412,7 @@ puts result # Unarchive Product Price Point -Use this endpoint to unarchive an archived product price point. +Unarchives an archived product price point. ```ruby def unarchive_product_price_point(product_id, @@ -850,7 +850,7 @@ puts result # List All Product Price Points -This method allows retrieval of a list of Products Price Points belonging to a Site. +Lists Product Price Points belonging to a site. ```ruby def list_all_product_price_points(options = {}) diff --git a/doc/controllers/products.md b/doc/controllers/products.md index b577e43..046993f 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -22,7 +22,7 @@ products_controller = client.products Creates a product in your Advanced Billing site. -See the following product docuemation for more information: +See the following product documentation for more information: + [Products Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) + [Changing a Subscription's Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations) @@ -309,7 +309,7 @@ puts result # Archive Product -Archives the product. All current subscribers will be unffected; their subscription/purchase will continue to be charged monthly. +Archives the product. All current subscribers will be unaffected; their subscription/purchase will continue to be charged monthly. This will restrict the option to chose the product for purchase via the Billing Portal, as well as disable Public Signup Pages for the product. @@ -496,7 +496,7 @@ puts result # List Products -This method allows to retrieve a list of Products belonging to a Site. +Lists products belonging to a site. ```ruby def list_products(options = {}) diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index ec8c3ab..5dd8bbc 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -24,7 +24,7 @@ proforma_invoices_controller = client.proforma_invoices # Create Consolidated Proforma Invoice -This endpoint will trigger the creation of a consolidated proforma invoice asynchronously. It will return a 201 with no message, or a 422 with any errors. To find and view the new consolidated proforma invoice, you may poll the subscription group listing for proforma invoices; only one consolidated proforma invoice may be created per group at a time. +Creates a consolidated proforma invoice asynchronously. It will return a 201 with no message, or a 422 with any errors. To find and view the new consolidated proforma invoice, you may poll the subscription group listing for proforma invoices; only one consolidated proforma invoice may be created per group at a time. If the information becomes outdated, simply void the old consolidated proforma invoice and generate a new one. @@ -69,7 +69,7 @@ proforma_invoices_controller.create_consolidated_proforma_invoice(uid) # List Subscription Group Proforma Invoices -Only proforma invoices with a `consolidation_level` of parent are returned. +Lists proforma invoices with a `consolidation_level` of parent for the subscription group. By default, proforma invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`. To include breakdowns, pass the specific field as a key in the query with a value set to true. @@ -125,7 +125,7 @@ puts result # Read Proforma Invoice -Use this endpoint to read the details of an existing proforma invoice. +Returns the details of an existing proforma invoice. ## Restrictions @@ -169,7 +169,7 @@ puts result # Create Proforma Invoice -This endpoint will create a proforma invoice and return it as a response. If the information becomes outdated, simply void the old proforma invoice and generate a new one. +Creates a proforma invoice and returns it as a response. If the information becomes outdated, simply void the old proforma invoice and generate a new one. If you would like to preview the next billing amounts without generating a full proforma invoice, use the renewal preview endpoint. @@ -215,7 +215,7 @@ puts result # List Proforma Invoices -By default, proforma invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. +Lists proforma invoices for a subscription. By default, results only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. ```ruby def list_proforma_invoices(options = {}) @@ -272,7 +272,7 @@ puts result # Deliver Proforma Invoice -Allows for proforma invoices to be programmatically delivered via email. Supports email +Delivers a proforma invoice programmatically via email. Supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. If `recipient_emails` is omitted, the system will fall back to the primary recipient derived from the invoice or @@ -335,7 +335,7 @@ puts result # Void Proforma Invoice -This endpoint will void a proforma invoice that has the status "draft". +Voids a proforma invoice that has the status "draft". ## Restrictions @@ -386,7 +386,7 @@ puts result # Preview Proforma Invoice -Return a preview of the data that will be included on a given subscription's proforma invoice if one were to be generated. It will have similar line items and totals as a renewal preview, but the response will be presented in the format of a proforma invoice. Consequently it will include additional information such as the name and addresses that will appear on the proforma invoice. +Returns a preview of the data that will be included on a given subscription's proforma invoice if one were to be generated. It will have similar line items and totals as a renewal preview, but the response will be presented in the format of a proforma invoice. Consequently it will include additional information such as the name and addresses that will appear on the proforma invoice. The preview endpoint is subject to all the same conditions as the proforma invoice endpoint. For example, previews are only available on the Relationship Invoicing architecture, and previews cannot be made for end-of-life subscriptions. @@ -433,9 +433,7 @@ puts result # Create Signup Proforma Invoice -This endpoint is only available for Relationship Invoicing sites. It cannot be used to create consolidated proforma invoices or preview prepaid subscriptions. - -Create a proforma invoice to preview costs before a subscription's signup. Like other proforma invoices, it can be emailed to the customer, voided, and publicly viewed on the chargifypay domain. +Creates a proforma invoice to preview costs before a subscription's signup. This endpoint is only available for Relationship Invoicing sites and cannot be used to create consolidated proforma invoices or preview prepaid subscriptions. Like other proforma invoices, it can be emailed to the customer, voided, and publicly viewed on the chargifypay domain. Pass a payload that resembles a subscription create or signup preview request. For example, you can specify components, coupons/a referral, offers, custom pricing, and an existing customer or payment profile to populate a shipping or billing address. @@ -489,9 +487,7 @@ puts result # Preview Signup Proforma Invoice -This endpoint is only available for Relationship Invoicing sites. It cannot be used to create consolidated proforma invoice previews or preview prepaid subscriptions. - -Create a signup preview in the format of a proforma invoice to preview costs before a subscription's signup. You have the option of optionally previewing the first renewal's costs as well. The proforma invoice preview will not be persisted. +Creates a signup preview in the format of a proforma invoice to preview costs before a subscription's signup. This endpoint is only available for Relationship Invoicing sites and cannot be used to create consolidated proforma invoice previews or preview prepaid subscriptions. You have the option of previewing the first renewal's costs as well. The proforma invoice preview will not be persisted. Pass a payload that resembles a subscription create or signup preview request. For example, you can specify components, coupons/a referral, offers, custom pricing, and an existing customer or payment profile to populate a shipping or billing address. diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index a1f0e02..231ca64 100644 --- a/doc/controllers/reason-codes.md +++ b/doc/controllers/reason-codes.md @@ -19,9 +19,11 @@ reason_codes_controller = client.reason_codes # Create Reason Code +Creates a reason code for a given site. + # Reason Codes Intro -ReasonCodes are a way to gain a high level view of why your customers are cancelling the subscription to your product or service. +Reason Codes are a way to gain a high-level view of why your customers are cancelling the subscription to your product or service. Add a set of churn reason codes to be displayed in-app and/or the Maxio Billing Portal. As your subscribers decide to cancel their subscription, learn why they decided to cancel. @@ -33,7 +35,7 @@ Full documentation on how Reason Codes operate within Advanced Billing can be lo ## Create Reason Code -This method gives a merchant the option to create a reason codes for a given Site. +This method gives a merchant the option to create reason codes for a given site. ```ruby def create_reason_code(body: nil) @@ -79,7 +81,7 @@ puts result # List Reason Codes -This method gives a merchant the option to retrieve a list of all of the current churn codes for a given site. +Lists all current churn codes for a given site. ```ruby def list_reason_codes(options = {}) @@ -163,7 +165,7 @@ puts result # Read Reason Code -This method gives a merchant the option to retrieve a list of a particular code for a given Site by providing the unique numerical ID of the code. +Returns a particular churn reason code for a given site by its unique ID. ```ruby def read_reason_code(reason_code_id) @@ -203,7 +205,7 @@ puts result # Update Reason Code -This method gives a merchant the option to update an existing reason code for a given site. +Updates an existing reason code for a given site. ```ruby def update_reason_code(reason_code_id, @@ -246,7 +248,7 @@ puts result # Delete Reason Code -This method gives a merchant the option to delete one reason code from the Churn Reason Codes. This code will be immediately removed. This action is not reversible. +Deletes a reason code from the Churn Reason Codes. This code will be immediately removed. This action is not reversible. ```ruby def delete_reason_code(reason_code_id) diff --git a/doc/controllers/referral-codes.md b/doc/controllers/referral-codes.md index e72533a..f358057 100644 --- a/doc/controllers/referral-codes.md +++ b/doc/controllers/referral-codes.md @@ -11,7 +11,7 @@ referral_codes_controller = client.referral_codes # Validate Referral Code -Use this method to determine if the referral code is valid and applicable within your Site. This method is useful for validating referral codes that are entered by a customer. +Validates whether a referral code is valid and applicable within your site. This method is useful for validating referral codes that are entered by a customer. ## Referrals Documentation diff --git a/doc/controllers/sales-commissions.md b/doc/controllers/sales-commissions.md index 74f067e..726ac7f 100644 --- a/doc/controllers/sales-commissions.md +++ b/doc/controllers/sales-commissions.md @@ -17,7 +17,7 @@ sales_commissions_controller = client.sales_commissions # List Sales Commission Settings -Endpoint returns subscriptions with associated sales reps +Lists subscriptions with associated sales reps. ## Modified Authentication Process @@ -102,7 +102,7 @@ puts result # List Sales Reps -Endpoint returns sales rep list with details +Returns a sales rep list with details. ## Modified Authentication Process @@ -236,7 +236,7 @@ puts result # Read Sales Rep -Endpoint returns sales rep and attached subscriptions details. +Returns a sales rep and attached subscription details. ## Modified Authentication Process diff --git a/doc/models/chjs-tokenization-failure.md b/doc/models/chjs-tokenization-failure.md new file mode 100644 index 0000000..008974d --- /dev/null +++ b/doc/models/chjs-tokenization-failure.md @@ -0,0 +1,27 @@ + +# Chjs Tokenization Failure + +## Structure + +`ChjsTokenizationFailure` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | `String` | Required | - | +| `payment_profile_params` | [`PaymentProfileParams`](../../doc/models/payment-profile-params.md) | Optional | PCI-safe cardholder fields only. Full card numbers, CVV, and billing address are never included. | + +## Example (as JSON) + +```json +{ + "errors": "errors2", + "payment_profile_params": { + "first_name": "first_name2", + "last_name": "last_name0", + "card_type": "card_type2" + } +} +``` + diff --git a/doc/models/chjs-tokenization-success.md b/doc/models/chjs-tokenization-success.md new file mode 100644 index 0000000..e1e32d1 --- /dev/null +++ b/doc/models/chjs-tokenization-success.md @@ -0,0 +1,28 @@ + +# Chjs Tokenization Success + +## Structure + +`ChjsTokenizationSuccess` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `payment_profile` | [`PaymentProfile`](../../doc/models/payment-profile.md) | Required | - | +| `gateway_customer_id` | `Integer` | Optional | - | + +## Example (as JSON) + +```json +{ + "payment_profile": { + "id": 44, + "vault_token": "vault_token6", + "gateway_handle": "gateway_handle4", + "customer_vault_token": "customer_vault_token2" + }, + "gateway_customer_id": 44 +} +``` + diff --git a/doc/models/containers/event-event-specific-data.md b/doc/models/containers/event-event-specific-data.md index c3faf72..7aa1138 100644 --- a/doc/models/containers/event-event-specific-data.md +++ b/doc/models/containers/event-event-specific-data.md @@ -3,7 +3,7 @@ ## Data Type -`SubscriptionProductChange | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | SubscriptionGroupSignupEventData | CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged | ItemPricePointChanged | CustomFieldValueChange` +`SubscriptionProductChange | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | SubscriptionGroupSignupEventData | CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged | ItemPricePointChanged | CustomFieldValueChange | ChjsTokenizationSuccess | ChjsTokenizationFailure` ## Cases @@ -27,6 +27,8 @@ | [`PaymentCollectionMethodChanged`](../../../doc/models/payment-collection-method-changed.md) | | [`ItemPricePointChanged`](../../../doc/models/item-price-point-changed.md) | | [`CustomFieldValueChange`](../../../doc/models/custom-field-value-change.md) | +| [`ChjsTokenizationSuccess`](../../../doc/models/chjs-tokenization-success.md) | +| [`ChjsTokenizationFailure`](../../../doc/models/chjs-tokenization-failure.md) | ## SubscriptionProductChange @@ -343,3 +345,29 @@ value = CustomFieldValueChange.new( ) ``` +## ChjsTokenizationSuccess + +### Initialization Code + +#### Example + +```ruby +value = ChjsTokenizationSuccess.new( + payment_profile: PaymentProfile.new( + id: 44 + ) +) +``` + +## ChjsTokenizationFailure + +### Initialization Code + +#### Example + +```ruby +value = ChjsTokenizationFailure.new( + errors: 'errors2' +) +``` + diff --git a/doc/models/containers/payment-profile.md b/doc/models/containers/payment-profile-2.md similarity index 98% rename from doc/models/containers/payment-profile.md rename to doc/models/containers/payment-profile-2.md index a6e1290..4f6eaf7 100644 --- a/doc/models/containers/payment-profile.md +++ b/doc/models/containers/payment-profile-2.md @@ -1,5 +1,5 @@ -# Payment-Profile +# Payment-Profile 2 ## Data Type diff --git a/doc/models/create-or-update-endpoint-request.md b/doc/models/create-or-update-endpoint-request.md index 1f5787c..787658e 100644 --- a/doc/models/create-or-update-endpoint-request.md +++ b/doc/models/create-or-update-endpoint-request.md @@ -20,7 +20,7 @@ Used to Create or Update Endpoint "endpoint": { "url": "url2", "webhook_subscriptions": [ - "dunning_step_reached" + "subscription_prepayment_account_balance_changed" ] } } diff --git a/doc/models/create-or-update-endpoint.md b/doc/models/create-or-update-endpoint.md index 51226a2..19b5d1c 100644 --- a/doc/models/create-or-update-endpoint.md +++ b/doc/models/create-or-update-endpoint.md @@ -20,7 +20,7 @@ Used to Create or Update Endpoint { "url": "url8", "webhook_subscriptions": [ - "subscription_prepayment_account_balance_changed" + "refund_success" ] } ``` diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index 117b150..3c5137b 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -23,7 +23,6 @@ }, "dunning_communication_delay_enabled": false, "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "skip_billing_manifest_taxes": false, "product_handle": "product_handle6", "product_id": 206, "product_price_point_handle": "product_price_point_handle2", diff --git a/doc/models/create-subscription.md b/doc/models/create-subscription.md index 1cce19e..125d47e 100644 --- a/doc/models/create-subscription.md +++ b/doc/models/create-subscription.md @@ -58,7 +58,7 @@ | `ach_agreement` | [`ACHAgreement`](../../doc/models/ach-agreement.md) | Optional | (Optional) If passed, the proof of the authorized ACH agreement terms will be persisted. | | `dunning_communication_delay_enabled` | `TrueClass \| FalseClass` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute.

**Default**: `false` | | `dunning_communication_delay_time_zone` | `String` | Optional | Time zone for the Dunning Communication Delay feature. | -| `skip_billing_manifest_taxes` | `TrueClass \| FalseClass` | Optional | Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests.

**Default**: `false` | +| `skip_billing_manifest_taxes` | `TrueClass \| FalseClass` | Optional | Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests. Defaults to `false` when not provided. | ## Example (as JSON) @@ -71,7 +71,6 @@ }, "dunning_communication_delay_enabled": false, "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "skip_billing_manifest_taxes": false, "product_handle": "product_handle6", "product_id": 212, "product_price_point_handle": "product_price_point_handle0", diff --git a/doc/models/credit-note-line-item.md b/doc/models/credit-note-line-item.md index e686479..2ebeb0b 100644 --- a/doc/models/credit-note-line-item.md +++ b/doc/models/credit-note-line-item.md @@ -28,6 +28,7 @@ | `price_point_id` | `Integer` | Optional | The price point ID of the component being credited. Will be `nil` for non-component credits. | | `billing_schedule_item_id` | `Integer` | Optional | - | | `custom_item` | `TrueClass \| FalseClass` | Optional | - | +| `prepaid_allocation_expires_at` | `Date` | Optional | The date a prepaid allocation is set to expire. Only present on line items representing prepaid component allocations. The format is `"YYYY-MM-DD"`. | ## Example (as JSON) diff --git a/doc/models/customer.md b/doc/models/customer.md index 7dfc202..b6c0565 100644 --- a/doc/models/customer.md +++ b/doc/models/customer.md @@ -39,6 +39,7 @@ | `salesforce_id` | `String` | Optional | The Salesforce ID for the customer | | `tax_exempt_reason` | `String` | Optional | The Tax Exemption Reason Code for the customer | | `default_auto_renewal_profile_id` | `Integer` | Optional | The default auto-renewal profile ID for the customer | +| `maxioid` | `String` | Optional | The Maxio-generated unique identifier for the customer. | ## Example (as JSON) diff --git a/doc/models/event-key.md b/doc/models/event-key.md index e95df01..a400739 100644 --- a/doc/models/event-key.md +++ b/doc/models/event-key.md @@ -86,6 +86,8 @@ | `CHARGEBACK_WON` | | `PAYMENT_COLLECTION_METHOD_CHANGED` | | `COMPONENT_BILLING_DATE_CHANGED` | +| `CHJS_TOKENIZATION_FAILURE` | +| `CHJS_TOKENIZATION_SUCCESS` | | `SUBSCRIPTION_TERM_RENEWAL_SCHEDULED` | | `SUBSCRIPTION_TERM_RENEWAL_PENDING` | | `SUBSCRIPTION_TERM_RENEWAL_ACTIVATED` | diff --git a/doc/models/event-response.md b/doc/models/event-response.md index f63a649..1c4163a 100644 --- a/doc/models/event-response.md +++ b/doc/models/event-response.md @@ -17,7 +17,7 @@ { "event": { "id": 242, - "key": "prepaid_subscription_balance_changed", + "key": "maxio_payments_direct_debit_payment_rejected", "message": "message0", "subscription_id": 96, "customer_id": 24, diff --git a/doc/models/event.md b/doc/models/event.md index 020ba52..2aa9494 100644 --- a/doc/models/event.md +++ b/doc/models/event.md @@ -15,14 +15,14 @@ | `subscription_id` | `Integer` | Required | - | | `customer_id` | `Integer` | Required | - | | `created_at` | `DateTime` | Required | - | -| `event_specific_data` | [Subscription Product Change](../../doc/models/subscription-product-change.md) \| [Subscription State Change](../../doc/models/subscription-state-change.md) \| [Payment Related Events](../../doc/models/payment-related-events.md) \| [Refund Success](../../doc/models/refund-success.md) \| [Component Allocation Change](../../doc/models/component-allocation-change.md) \| [Metered Usage](../../doc/models/metered-usage.md) \| [Prepaid Usage](../../doc/models/prepaid-usage.md) \| [Dunning Step Reached](../../doc/models/dunning-step-reached.md) \| [Invoice Issued](../../doc/models/invoice-issued.md) \| [Pending Cancellation Change](../../doc/models/pending-cancellation-change.md) \| [Prepaid Subscription Balance Changed](../../doc/models/prepaid-subscription-balance-changed.md) \| [Proforma Invoice Issued](../../doc/models/proforma-invoice-issued.md) \| [Subscription Group Signup Event Data](../../doc/models/subscription-group-signup-event-data.md) \| [Credit Account Balance Changed](../../doc/models/credit-account-balance-changed.md) \| [Prepayment Account Balance Changed](../../doc/models/prepayment-account-balance-changed.md) \| [Payment Collection Method Changed](../../doc/models/payment-collection-method-changed.md) \| [Item Price Point Changed](../../doc/models/item-price-point-changed.md) \| [Custom Field Value Change](../../doc/models/custom-field-value-change.md) \| nil | Required | This is a container for one-of cases. | +| `event_specific_data` | [Subscription Product Change](../../doc/models/subscription-product-change.md) \| [Subscription State Change](../../doc/models/subscription-state-change.md) \| [Payment Related Events](../../doc/models/payment-related-events.md) \| [Refund Success](../../doc/models/refund-success.md) \| [Component Allocation Change](../../doc/models/component-allocation-change.md) \| [Metered Usage](../../doc/models/metered-usage.md) \| [Prepaid Usage](../../doc/models/prepaid-usage.md) \| [Dunning Step Reached](../../doc/models/dunning-step-reached.md) \| [Invoice Issued](../../doc/models/invoice-issued.md) \| [Pending Cancellation Change](../../doc/models/pending-cancellation-change.md) \| [Prepaid Subscription Balance Changed](../../doc/models/prepaid-subscription-balance-changed.md) \| [Proforma Invoice Issued](../../doc/models/proforma-invoice-issued.md) \| [Subscription Group Signup Event Data](../../doc/models/subscription-group-signup-event-data.md) \| [Credit Account Balance Changed](../../doc/models/credit-account-balance-changed.md) \| [Prepayment Account Balance Changed](../../doc/models/prepayment-account-balance-changed.md) \| [Payment Collection Method Changed](../../doc/models/payment-collection-method-changed.md) \| [Item Price Point Changed](../../doc/models/item-price-point-changed.md) \| [Custom Field Value Change](../../doc/models/custom-field-value-change.md) \| [Chjs Tokenization Success](../../doc/models/chjs-tokenization-success.md) \| [Chjs Tokenization Failure](../../doc/models/chjs-tokenization-failure.md) \| nil | Required | This is a container for one-of cases. | ## Example (as JSON) ```json { "id": 40, - "key": "expiring_card", + "key": "subscription_group_signup_success", "message": "message8", "subscription_id": 150, "customer_id": 78, diff --git a/doc/models/invoice-line-item.md b/doc/models/invoice-line-item.md index b41d500..a153733 100644 --- a/doc/models/invoice-line-item.md +++ b/doc/models/invoice-line-item.md @@ -33,6 +33,7 @@ | `product_price_point_id` | `Integer` | Optional | The price point ID of the line item's product | | `custom_item` | `TrueClass \| FalseClass` | Optional | - | | `kind` | `String` | Optional | - | +| `prepaid_allocation_expires_at` | `Date` | Optional | The date a prepaid allocation is set to expire. Only present on line items representing prepaid component allocations. The format is `"YYYY-MM-DD"`. | ## Example (as JSON) diff --git a/doc/models/payment-profile-params.md b/doc/models/payment-profile-params.md new file mode 100644 index 0000000..1fe97b6 --- /dev/null +++ b/doc/models/payment-profile-params.md @@ -0,0 +1,27 @@ + +# Payment Profile Params + +PCI-safe cardholder fields only. Full card numbers, CVV, and billing address are never included. + +## Structure + +`PaymentProfileParams` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `first_name` | `String` | Optional | - | +| `last_name` | `String` | Optional | - | +| `card_type` | `String` | Optional | - | + +## Example (as JSON) + +```json +{ + "first_name": "first_name2", + "last_name": "last_name0", + "card_type": "card_type8" +} +``` + diff --git a/doc/models/payment-profile.md b/doc/models/payment-profile.md new file mode 100644 index 0000000..cd37b39 --- /dev/null +++ b/doc/models/payment-profile.md @@ -0,0 +1,27 @@ + +# Payment Profile + +## Structure + +`PaymentProfile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `Integer` | Required | - | +| `vault_token` | `String` | Optional | - | +| `gateway_handle` | `String` | Optional | - | +| `customer_vault_token` | `String` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 56, + "vault_token": "vault_token0", + "gateway_handle": "gateway_handle0", + "customer_vault_token": "customer_vault_token6" +} +``` + diff --git a/doc/models/site.md b/doc/models/site.md index 079ac20..2b1f82d 100644 --- a/doc/models/site.md +++ b/doc/models/site.md @@ -25,6 +25,9 @@ | `organization_address` | [`OrganizationAddress`](../../doc/models/organization-address.md) | Optional | - | | `tax_configuration` | [`TaxConfiguration`](../../doc/models/tax-configuration.md) | Optional | - | | `net_terms` | [`NetTerms`](../../doc/models/net-terms.md) | Optional | - | +| `multi_frequency_enabled` | `TrueClass \| FalseClass` | Optional | Whether the site has the multi-frequency billing feature enabled. Only present when relationship invoicing is active. | +| `auto_renewals_enabled` | `TrueClass \| FalseClass` | Optional | Whether the auto-renewals feature is enabled for this site. | +| `portal_enabled` | `TrueClass \| FalseClass` | Optional | Whether the Billing Portal is enabled for this site. | | `test` | `TrueClass \| FalseClass` | Optional | - | ## Example (as JSON) diff --git a/doc/models/webhook-subscription.md b/doc/models/webhook-subscription.md index 172e795..85990e5 100644 --- a/doc/models/webhook-subscription.md +++ b/doc/models/webhook-subscription.md @@ -11,6 +11,8 @@ | --- | | `BILLING_DATE_CHANGE` | | `COMPONENT_ALLOCATION_CHANGE` | +| `CHJS_TOKENIZATION_FAILURE` | +| `CHJS_TOKENIZATION_SUCCESS` | | `CUSTOMER_CREATE` | | `CUSTOMER_UPDATE` | | `DUNNING_STEP_REACHED` | diff --git a/lib/advanced_billing.rb b/lib/advanced_billing.rb index f78f9ed..fe5eab6 100644 --- a/lib/advanced_billing.rb +++ b/lib/advanced_billing.rb @@ -111,6 +111,8 @@ 'change_invoice_collection_method_event_data' require_relative 'advanced_billing/models/change_invoice_status_event_data' require_relative 'advanced_billing/models/chargify_ebb' +require_relative 'advanced_billing/models/chjs_tokenization_failure' +require_relative 'advanced_billing/models/chjs_tokenization_success' require_relative 'advanced_billing/models/clone_component_price_point' require_relative 'advanced_billing/models/clone_component_price_point_request' require_relative 'advanced_billing/models/component' @@ -359,6 +361,8 @@ require_relative 'advanced_billing/models/payment_profile_attributes' require_relative 'advanced_billing/models/payment_profile_response' require_relative 'advanced_billing/models/payment_related_events' +require_relative 'advanced_billing/models/payment_profile' +require_relative 'advanced_billing/models/payment_profile_params' require_relative 'advanced_billing/models/pending_cancellation_change' require_relative 'advanced_billing/models/portal_management_link' require_relative 'advanced_billing/models/prepaid_configuration' diff --git a/lib/advanced_billing/controllers/advance_invoice_controller.rb b/lib/advanced_billing/controllers/advance_invoice_controller.rb index dfa60cb..0bdc1a8 100644 --- a/lib/advanced_billing/controllers/advance_invoice_controller.rb +++ b/lib/advanced_billing/controllers/advance_invoice_controller.rb @@ -10,7 +10,7 @@ class AdvanceInvoiceController < BaseController # [See our # docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Inv # oice-In-Advance) for more information on advance invoices, including - # eligibility on generating one; for the most part, they function like any + # eligibility for generating one; for the most part, they function like any # other invoice, except they are issued early and have special behavior upon # being voided. # A subscription may only have one advance invoice per billing period. @@ -55,9 +55,9 @@ def issue_advance_invoice(subscription_id, .execute end - # Once an advance invoice has been generated for a subscription's upcoming - # renewal, it can be viewed through this endpoint. There can only be one - # advance invoice per subscription per billing cycle. + # Returns the advance invoice generated for a subscription's upcoming + # renewal. There can only be one advance invoice per subscription per + # billing cycle. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @return [Invoice] Response from the API call. diff --git a/lib/advanced_billing/controllers/api_exports_controller.rb b/lib/advanced_billing/controllers/api_exports_controller.rb index 24849fd..a34874f 100644 --- a/lib/advanced_billing/controllers/api_exports_controller.rb +++ b/lib/advanced_billing/controllers/api_exports_controller.rb @@ -6,9 +6,8 @@ module AdvancedBilling # APIExportsController class APIExportsController < BaseController - # This API returns an array of exported proforma invoices for a provided - # `batch_id`. Pay close attention to pagination in order to control - # responses from the server. + # Lists exported proforma invoices for a provided `batch_id`. Use pagination + # to control responses returned from the server. # Example: `GET # https://{subdomain}.chargify.com/api_exports/proforma_invoices/123/rows?pe # r_page=10000&page=1`. @@ -47,9 +46,8 @@ def list_exported_proforma_invoices(options = {}) .execute end - # This API returns an array of exported invoices for a provided `batch_id`. - # Pay close attention to pagination in order to control responses from the - # server. + # Lists exported invoices for a provided `batch_id`. Use pagination to + # control responses returned from the server. # Example: `GET # https://{subdomain}.chargify.com/api_exports/invoices/123/rows?per_page=10 # 000&page=1`. @@ -88,9 +86,8 @@ def list_exported_invoices(options = {}) .execute end - # This API returns an array of exported subscriptions for a provided - # `batch_id`. Pay close attention to pagination in order to control - # responses from the server. + # Lists exported subscriptions for a provided `batch_id`. Use pagination to + # control responses returned from the server. # Example: `GET # https://{subdomain}.chargify.com/api_exports/subscriptions/123/rows?per_pa # ge=200&page=1`. @@ -129,7 +126,7 @@ def list_exported_subscriptions(options = {}) .execute end - # This API creates a proforma invoices export and returns a batchjob object. + # Creates a proforma invoices export and returns a batch job object. # It is only available for Relationship Invoicing architecture. # @return [BatchJobResponse] Response from the API call. def export_proforma_invoices @@ -152,7 +149,7 @@ def export_proforma_invoices .execute end - # This API creates an invoices export and returns a batchjob object. + # Creates an invoices export and returns a batch job object. # @return [BatchJobResponse] Response from the API call. def export_invoices @api_call @@ -174,7 +171,7 @@ def export_invoices .execute end - # This API creates a subscriptions export and returns a batchjob object. + # Creates a subscriptions export and returns a batch job object. # @return [BatchJobResponse] Response from the API call. def export_subscriptions @api_call @@ -193,7 +190,7 @@ def export_subscriptions .execute end - # This API returns a batchjob object for proforma invoices export. + # Returns a batch job object for a proforma invoices export. # @param [String] batch_id Required parameter: Id of a Batch Job. # @return [BatchJobResponse] Response from the API call. def read_proforma_invoices_export(batch_id) @@ -215,7 +212,7 @@ def read_proforma_invoices_export(batch_id) .execute end - # This API returns a batchjob object for invoices export. + # Returns a batch job object for an invoices export. # @param [String] batch_id Required parameter: Id of a Batch Job. # @return [BatchJobResponse] Response from the API call. def read_invoices_export(batch_id) @@ -237,7 +234,7 @@ def read_invoices_export(batch_id) .execute end - # This API returns a batchjob object for subscriptions export. + # Returns a batch job object for a subscriptions export. # @param [String] batch_id Required parameter: Id of a Batch Job. # @return [BatchJobResponse] Response from the API call. def read_subscriptions_export(batch_id) diff --git a/lib/advanced_billing/controllers/billing_portal_controller.rb b/lib/advanced_billing/controllers/billing_portal_controller.rb index ffb93ce..7aca990 100644 --- a/lib/advanced_billing/controllers/billing_portal_controller.rb +++ b/lib/advanced_billing/controllers/billing_portal_controller.rb @@ -6,12 +6,14 @@ module AdvancedBilling # BillingPortalController class BillingPortalController < BaseController + # Enables Billing Portal access for a customer, with an option to send an + # invitation email at the same time. # ## Billing Portal Documentation # Full documentation on how the Billing Portal operates within the Advanced # Billing UI can be located # [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing- # Portal-Overview). - # This documentation is focused on how the to configure the Billing Portal + # This documentation is focused on how to configure the Billing Portal # Settings, as well as Subscriber Interaction and Merchant Management of the # Billing Portal. # You can use this endpoint to enable Billing Portal access for a Customer, @@ -60,8 +62,8 @@ def enable_billing_portal_for_customer(customer_id, .execute end - # This method will provide to the API user the exact URL required for a - # subscriber to access the Billing Portal. + # Returns the exact URL required for a subscriber to access the Billing + # Portal. # ## Rules for Management Link API # + When retrieving a management URL, multiple requests for the same # customer in a short period will return the **same** URL @@ -99,15 +101,13 @@ def read_billing_portal_link(customer_id) .execute end - # You can resend a customer's Billing Portal invitation. + # Resends a customer's Billing Portal invitation. # If you attempt to resend an invitation 5 times within 30 minutes, you will - # receive a `422` response with `error` message in the body. + # receive a `422` response with an `error` message in the body. # If you attempt to resend an invitation when the Billing Portal is already # disabled for a Customer, you will receive a `422` error response. - # If you attempt to resend an invitation when the Billing Portal is already - # disabled for a Customer, you will receive a `422` error response. - # If you attempt to resend an invitation when the Customer does not exist a - # Customer, you will receive a `404` error response. + # If you attempt to resend an invitation when the Customer does not exist, + # you will receive a `404` error response. # ## Limitations # This endpoint will only return a JSON response. # @param [Integer] customer_id Required parameter: The Chargify id of the @@ -136,7 +136,7 @@ def resend_billing_portal_invitation(customer_id) .execute end - # You can revoke a customer's Billing Portal invitation. + # Revokes a customer's Billing Portal invitation. # If you attempt to revoke an invitation when the Billing Portal is already # disabled for a Customer, you will receive a 422 error response. # ## Limitations diff --git a/lib/advanced_billing/controllers/component_price_points_controller.rb b/lib/advanced_billing/controllers/component_price_points_controller.rb index 8d5aa96..ce9629b 100644 --- a/lib/advanced_billing/controllers/component_price_points_controller.rb +++ b/lib/advanced_billing/controllers/component_price_points_controller.rb @@ -70,8 +70,7 @@ def create_component_price_point(component_id, .execute end - # Use this endpoint to read current price points that are associated with a - # component. + # Lists the price points associated with a component. # You may specify the component by using either the numeric id or the # `handle:gold` syntax. # When fetching a component's price points, if you have defined multiple @@ -120,8 +119,7 @@ def list_component_price_points(options = {}) .execute end - # Use this endpoint to create multiple component price points in one - # request. + # Creates multiple component price points in one request. # @param [String] component_id Required parameter: The Advanced Billing id # of the component for which you want to fetch price points. # @param [CreateComponentPricePointsRequest] body Optional parameter: TODO: @@ -211,8 +209,7 @@ def clone_component_price_point(component_id, .execute end - # When updating a price point, prices can be updated as well by creating new - # prices or editing / removing existing ones. + # Updates a component price point and its associated prices. # Passing in a price bracket without an `id` will attempt to create a new # price. # Including an `id` will update the corresponding price, and including the @@ -266,9 +263,8 @@ def update_component_price_point(component_id, .execute end - # Use this endpoint to retrieve details for a specific component price - # point. You can achieve this by using either the component price point ID - # or handle. + # Returns details for a specific component price point. You can achieve this + # by using either the component price point ID or handle. # @param [Integer | String] component_id Required parameter: The id or # handle of the component. When using the handle, it must be prefixed with # `handle:`. Example: `123` for an integer ID, or @@ -310,9 +306,9 @@ def read_component_price_point(component_id, .execute end - # A price point can be archived at any time. Subscriptions using a price - # point that has been archived will continue using it until they're moved to - # another price point. + # Archives a component price point. Subscriptions using a price point that + # has been archived will continue using it until they're moved to another + # price point. # @param [Integer | String] component_id Required parameter: The id or # handle of the component. When using the handle, it must be prefixed with # `handle:`. Example: `123` for an integer ID, or @@ -354,7 +350,7 @@ def archive_component_price_point(component_id, .execute end - # Use this endpoint to unarchive a component price point. + # Unarchives a component price point. # @param [Integer] component_id Required parameter: The Advanced Billing id # of the component to which the price point belongs # @param [Integer] price_point_id Required parameter: The Advanced Billing @@ -380,8 +376,7 @@ def unarchive_component_price_point(component_id, .execute end - # This endpoint allows you to create currency prices for a given currency - # that has been defined on the site level in your settings. + # Creates currency prices for a given currency defined at the site level. # When creating currency prices, they need to mirror the structure of your # primary pricing. For each price level defined on the component price # point, there should be a matching price level created in the given @@ -416,8 +411,7 @@ def create_currency_prices(price_point_id, .execute end - # This endpoint allows you to update currency prices for a given currency - # that has been defined on the site level in your settings. + # Updates currency prices for a given currency defined at the site level. # Note: Currency Prices are not able to be updated for custom price points. # @param [Integer] price_point_id Required parameter: The Advanced Billing # id of the price point @@ -448,8 +442,7 @@ def update_currency_prices(price_point_id, .execute end - # This method allows to retrieve a list of Components Price Points belonging - # to a Site. + # Lists all component price points belonging to a site. # @param [ListComponentsPricePointsInclude] include Optional parameter: # Allows including additional data in the response. Use in query: # `include=currency_prices`. diff --git a/lib/advanced_billing/controllers/components_controller.rb b/lib/advanced_billing/controllers/components_controller.rb index a825d2e..a7700ff 100644 --- a/lib/advanced_billing/controllers/components_controller.rb +++ b/lib/advanced_billing/controllers/components_controller.rb @@ -6,9 +6,8 @@ module AdvancedBilling # ComponentsController class ComponentsController < BaseController - # This request will create a component definition of kind - # **metered_component** under the specified product family. Metered - # component can then be added and “allocated” for a subscription. + # Creates a metered component definition under the specified product family. + # A metered component can then be added and “allocated” for a subscription. # Metered components are used to bill for any type of unit that resets to 0 # at the end of the billing period (think daily Google Ads clicks or monthly # cell phone minutes). This is most commonly associated with usage-based @@ -52,10 +51,10 @@ def create_metered_component(product_family_id, .execute end - # This request will create a component definition of kind - # **quantity_based_component** under the specified product family. Quantity - # Based component can then be added and “allocated” for a subscription. - # When defining Quantity Based component, You can choose one of 2 types: + # Creates a Quantity Based component definition under the specified product + # family. A Quantity Based component can then be added and “allocated” for a + # subscription. + # When defining a Quantity Based component, you can choose one of 2 types: # #### Recurring # Recurring quantity-based components are used to bill for the number of # some unit (think monthly software user licenses or the number of pairs of @@ -102,9 +101,8 @@ def create_quantity_based_component(product_family_id, .execute end - # This request will create a component definition of kind - # **on_off_component** under the specified product family. On/Off component - # can then be added and “allocated” for a subscription. + # Creates an On/Off component definition under the specified product family. + # An On/Off component can then be added and “allocated” for a subscription. # On/off components are used for any flat fee, recurring add on (think # $99/month for tech support or a flat add on shipping fee). # For more information on components, see our documentation @@ -142,9 +140,9 @@ def create_on_off_component(product_family_id, .execute end - # This request will create a component definition of kind - # **prepaid_usage_component** under the specified product family. Prepaid - # component can then be added and “allocated” for a subscription. + # Creates a prepaid usage component definition under the specified product + # family. A prepaid component can then be added and “allocated” for a + # subscription. # Prepaid components allow customers to pre-purchase units that can be used # up over time on their subscription. In a sense, they are the mirror image # of metered components; while metered components charge at the end of the @@ -186,9 +184,9 @@ def create_prepaid_usage_component(product_family_id, .execute end - # This request will create a component definition of kind - # **event_based_component** under the specified product family. Event-based - # component can then be added and “allocated” for a subscription. + # Creates an event-based component definition under the specified product + # family. An event-based component can then be added and “allocated” for a + # subscription. # Event-based components are similar to other component types, in that you # define the component parameters (such as name and taxability) and the # pricing. A key difference for the event-based component is that it must be @@ -233,9 +231,9 @@ def create_event_based_component(product_family_id, .execute end - # This request will return information regarding a component having the - # handle you provide. You can identify your components with a handle so you - # don't have to save or reference the IDs we generate. + # Returns information for a component matching the provided handle. You can + # identify your components with a handle so you don't have to save or + # reference the IDs we generate. # @param [String] handle Required parameter: The handle of the component to # find # @return [ComponentResponse] Response from the API call. @@ -283,7 +281,7 @@ def read_component(product_family_id, .execute end - # This request will update a component from a specific product family. + # Updates a component from a specific product family. # You may read the component by either the component's id or handle. When # using the handle, it must be prefixed with `handle:`. # @param [Integer] product_family_id Required parameter: The Advanced @@ -322,9 +320,8 @@ def update_product_family_component(product_family_id, .execute end - # Sending a DELETE request to this endpoint will archive the component. All - # current subscribers will be unffected; their subscription/purchase will - # continue to be charged as usual. + # Archives the component; all current subscribers will continue to be + # charged as usual. # @param [Integer] product_family_id Required parameter: The Advanced # Billing id of the product family to which the component belongs # @param [String] component_id Required parameter: Either the Advanced @@ -355,7 +352,7 @@ def archive_component(product_family_id, .execute end - # This request will return a list of components for a site. + # Lists components for a site. # @param [BasicDateField] date_field Optional parameter: The type of filter # you would like to apply to your search. # @param [String] start_date Optional parameter: The start date (format @@ -417,7 +414,7 @@ def list_components(options = {}) .execute end - # This request will update a component. + # Updates a component. # You may read the component by either the component's id or handle. When # using the handle, it must be prefixed with `handle:`. # @param [String] component_id Required parameter: The id or handle of the @@ -449,8 +446,7 @@ def update_component(component_id, .execute end - # This request will return a list of components for a particular product - # family. + # Lists components for a particular product family. # @param [Integer] product_family_id Required parameter: The Advanced # Billing id of the product family # @param [TrueClass | FalseClass] include_archived Optional parameter: diff --git a/lib/advanced_billing/controllers/coupons_controller.rb b/lib/advanced_billing/controllers/coupons_controller.rb index 9e897a4..072dbcb 100644 --- a/lib/advanced_billing/controllers/coupons_controller.rb +++ b/lib/advanced_billing/controllers/coupons_controller.rb @@ -6,23 +6,21 @@ module AdvancedBilling # CouponsController class CouponsController < BaseController - # ## Coupons Documentation - # Coupons can be administered in the Advanced Billing application or created - # via API. View our section on [creating - # coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creati - # ng-Editing-Deleting-Coupons) for more information. - # Additionally, for documentation on how to apply a coupon to a subscription - # within the Advanced Billing UI, see our documentation - # [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons- - # and-Subscriptions). - # ## Create Coupon - # This request will create a coupon, based on the provided information. - # You can create either a flat amount coupon, by specyfing - # `amount_in_cents`, or percentage coupon by specyfing `percentage`. + # Creates a coupon under the specified product family. + # You can create either a flat amount coupon by specifying amount_in_cents, + # or a percentage coupon by specifying percentage # You can restrict a coupon to only apply to specific products / components # by optionally passing in `restricted_products` and/or # `restricted_components` objects in the format: # `{ "": boolean_value }` + # Coupons can be administered in the Advanced Billing application or created + # via API. See [creating + # coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creati + # ng-Editing-Deleting-Coupons) for more information. + # See [Apply Coupons to + # Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101- + # Coupons-and-Subscriptions) for information on applying a coupon to a + # subscription in the Advanced Billing UI. # @param [Integer] product_family_id Required parameter: The Advanced # Billing id of the product family to which the coupon belongs # @param [CouponRequest] body Optional parameter: TODO: type description @@ -52,7 +50,7 @@ def create_coupon(product_family_id, .execute end - # List coupons for a specific Product Family in a Site. + # Lists coupons for a specific product family in a site. # @param [Integer] product_family_id Required parameter: The Advanced # Billing id of the product family to which the coupon belongs # @param [Integer] page Optional parameter: Result records are organized in @@ -96,9 +94,9 @@ def list_coupons_for_product_family(options = {}) .execute end - # You can search for a coupon via the API with the find method. By passing a - # code parameter, the find will attempt to locate a coupon that matches that - # code. If no coupon is found, a 404 is returned. + # Searches for a coupon by code, returning a 404 if no coupon is found. By + # passing a code parameter, the find will attempt to locate a coupon that + # matches that code. # If you have more than one product family and if the coupon you are trying # to find does not belong to the default product family in your site, then # you will need to specify (either in the url or as a query string param) @@ -129,9 +127,8 @@ def find_coupon(product_family_id: nil, .execute end - # You can retrieve the Coupon via the API with the Show method. You must - # identify the Coupon in this call by the ID parameter that Advanced Billing - # assigns. + # Returns a coupon by its Advanced Billing-assigned ID. You must identify + # the Coupon in this call by the ID parameter that Advanced Billing assigns. # If instead you would like to find a Coupon using a Coupon code, see the # Coupon Find method. # When fetching a coupon, if you have defined multiple currencies at the @@ -171,9 +168,7 @@ def read_coupon(product_family_id, .execute end - # ## Update Coupon - # You can update a Coupon via the API with a PUT request to the resource - # endpoint. + # Updates a coupon. # You can restrict a coupon to only apply to specific products / components # by optionally passing in hashes of `restricted_products` and/or # `restricted_components` in the format: @@ -213,7 +208,8 @@ def update_coupon(product_family_id, .execute end - # You can archive a Coupon via the API with the archive method. + # Archives a coupon, making it unavailable for future use while remaining + # active on existing subscriptions. # Archiving makes that Coupon unavailable for future use, but allows it to # remain attached and functional on existing Subscriptions that are using # it. @@ -243,7 +239,7 @@ def archive_coupon(product_family_id, .execute end - # You can retrieve a list of coupons. + # Lists coupons for a site. # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start @@ -282,8 +278,7 @@ def list_coupons(options = {}) .execute end - # This request will provide details about the coupon usage as an array of - # data hashes, one per product. + # Lists coupon usage details, one entry per product. # @param [Integer] product_family_id Required parameter: The Advanced # Billing id of the product family to which the coupon belongs. # @param [Integer] coupon_id Required parameter: The Advanced Billing id of @@ -310,10 +305,9 @@ def read_coupon_usage(product_family_id, .execute end - # You can verify if a specific coupon code is valid using the `validate` - # method. This method is useful for validating coupon codes that are entered - # by a customer. If the coupon is found and is valid, the coupon will be - # returned with a 200 status code. + # Verifies whether a specific coupon code is valid. This method is useful + # for validating coupon codes that are entered by a customer. If the coupon + # is found and is valid, the coupon will be returned with a 200 status code. # If the coupon is invalid, the status code will be 404 and the response # will say why it is invalid. If the coupon is valid, the status code will # be 200 and the coupon will be returned. The following reasons for @@ -360,10 +354,10 @@ def validate_coupon(code, .execute end - # This endpoint allows you to create and/or update currency prices for an - # existing coupon. Multiple prices can be created or updated in a single - # request but each of the currencies must be defined on the site level - # already and the coupon must be an amount-based coupon, not percentage. + # Creates and/or updates currency prices for an existing coupon. Multiple + # prices can be created or updated in a single request but each of the + # currencies must be defined on the site level already and the coupon must + # be an amount-based coupon, not percentage. # Currency pricing for coupons must mirror the setup of the primary coupon # pricing - if the primary coupon is percentage based, you will not be able # to define pricing in non-primary currencies. @@ -396,6 +390,7 @@ def create_or_update_coupon_currency_prices(coupon_id, .execute end + # Creates subcodes for an existing coupon. # ## Coupon Subcodes Intro # Coupon Subcodes allow you to create a set of unique codes that allow you # to expand the use of one coupon. @@ -459,8 +454,7 @@ def create_coupon_subcodes(coupon_id, .execute end - # This request allows you to request the subcodes that are attached to a - # coupon. + # Lists the subcodes attached to a coupon. # @param [Integer] coupon_id Required parameter: The Advanced Billing id of # the coupon # @param [Integer] page Optional parameter: Result records are organized in @@ -493,8 +487,8 @@ def list_coupon_subcodes(options = {}) .execute end - # You can update the subcodes for the given Coupon via the API with a PUT - # request to the resource endpoint. + # Updates the subcodes for a coupon, replacing all existing subcodes with + # the new list. # Send an array of new coupon subcodes. # **Note**: All current subcodes for that Coupon will be deleted first, and # replaced with the list of subcodes sent to this endpoint. @@ -527,6 +521,7 @@ def update_coupon_subcodes(coupon_id, .execute end + # Deletes a specific subcode from a coupon. # ## Example # Given a coupon with an ID of 567, and a coupon subcode of 20OFF, the URL # to `DELETE` this coupon subcode would be: diff --git a/lib/advanced_billing/controllers/custom_fields_controller.rb b/lib/advanced_billing/controllers/custom_fields_controller.rb index 33474bb..df123b7 100644 --- a/lib/advanced_billing/controllers/custom_fields_controller.rb +++ b/lib/advanced_billing/controllers/custom_fields_controller.rb @@ -123,7 +123,7 @@ def list_metafields(options = {}) # must specify all metadata values including the new value you want to add. # - Add new metadata to a dropdown or radio for a metafield that was created # without metadata. - # - Remove metadata for a dropdown or radio for a metafield. + # - Remove metadata for a dropdown or radio for a metafield. # >Note: Updates to metadata overwrite existing values. To remove one or # more values, specify all metadata values except those you want to remove. # - Add or update scope settings for a metafield. @@ -279,7 +279,8 @@ def list_metadata(options = {}) # subscription or customer you specify. You can update the input_type for # the metafield with the Update Metafield endpoint. # Each site is limited to 100 unique metafields per resource. This means you - # can have 100 metafields for Subscription and another 100 for Customer. + # can have 100 metafields for the Subscription resource and another 100 for + # the Customer resource. # @param [ResourceType] resource_type Required parameter: The resource type # to which the metafields belong. # @param [Integer] resource_id Required parameter: The Advanced Billing id @@ -353,7 +354,7 @@ def delete_metadata(resource_type, .execute end - # Lists metadata for a specified array of subscriptions or customers. + # Lists metadata for a specified array of subscriptions or customers. # @param [ResourceType] resource_type Required parameter: The resource type # to which the metafields belong. # @param [Integer] page Optional parameter: Result records are organized in diff --git a/lib/advanced_billing/controllers/customers_controller.rb b/lib/advanced_billing/controllers/customers_controller.rb index ea653c7..76b63ae 100644 --- a/lib/advanced_billing/controllers/customers_controller.rb +++ b/lib/advanced_billing/controllers/customers_controller.rb @@ -6,9 +6,9 @@ module AdvancedBilling # CustomersController class CustomersController < BaseController - # You may create a new Customer at any time, or you may create a Customer at - # the same time you create a Subscription. The only validation restriction - # is that you may only create one customer for a given reference value. + # Creates a new customer; can also be created alongside a new subscription. + # The only validation restriction is that you may only create one customer + # for a given reference value. # If provided, the `reference` value must be unique. It represents a unique # identifier for the customer from your own app, i.e. the customer’s ID. # This allows you to retrieve a given customer via a piece of shared @@ -64,7 +64,8 @@ def create_customer(body: nil) .execute end - # This request will by default list all customers associated with your Site. + # Lists all customers associated with your site, or filters results using + # the search parameter. # ## Find Customer # Use the search feature with the `q` query parameter to retrieve an array # of customers that matches the search query. @@ -158,7 +159,7 @@ def read_customer(id) .execute end - # This method allows to update the Customer. + # Updates the customer. # @param [Integer] id Required parameter: The Advanced Billing id of the # customer # @param [UpdateCustomerRequest] body Optional parameter: TODO: type @@ -191,7 +192,7 @@ def update_customer(id, .execute end - # This method allows you to delete the Customer. + # Deletes the customer. # @param [Integer] id Required parameter: The Advanced Billing id of the # customer # @return [void] Response from the API call. @@ -209,8 +210,8 @@ def delete_customer(id) .execute end - # Use this method to return the customer object if you have the unique - # **Reference ID (Your App)** value handy. It will return a single match. + # Returns a customer by their unique reference ID. It will return a single + # match. # @param [String] reference Required parameter: Customer reference # @return [CustomerResponse] Response from the API call. def read_customer_by_reference(reference) @@ -228,7 +229,7 @@ def read_customer_by_reference(reference) .execute end - # This method lists all subscriptions that belong to a customer. + # Lists all subscriptions that belong to a customer. # @param [Integer] customer_id Required parameter: The Chargify id of the # customer # @return [Array[SubscriptionResponse]] Response from the API call. diff --git a/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb b/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb index f8bd727..9bfe35d 100644 --- a/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +++ b/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb @@ -6,10 +6,10 @@ module AdvancedBilling # EventsBasedBillingSegmentsController class EventsBasedBillingSegmentsController < BaseController - # This endpoint creates a new Segment for a Component with segmented Metric. - # It allows you to specify properties to bill upon and prices for each - # Segment. You can only pass as many "property_values" as the related Metric - # has segmenting properties defined. + # Creates a new segment for a component with a segmented metric. It allows + # you to specify properties to bill upon and prices for each Segment. You + # can only pass as many "property_values" as the related Metric has + # segmenting properties defined. # You may specify component and/or price point by using either the numeric # ID or the `handle:gold` syntax. # @param [String] component_id Required parameter: ID or Handle for the @@ -50,8 +50,7 @@ def create_segment(component_id, .execute end - # This endpoint allows you to fetch Segments created for a given Price - # Point. They will be returned in the order of creation. + # Lists segments created for a given price point, in order of creation. # You can pass `page` and `per_page` parameters in order to access all of # the segments. By default it will return `30` records. You can set # `per_page` to `200` at most. @@ -105,8 +104,8 @@ def list_segments_for_price_point(options = {}) .execute end - # This endpoint updates a single Segment for a Component with a segmented - # Metric. It allows you to update the pricing for the segment. + # Updates a single segment for a component with a segmented metric. It + # allows you to update the pricing for the segment. # You may specify component and/or price point by using either the numeric # ID or the `handle:gold` syntax. # @param [String] component_id Required parameter: ID or Handle of the @@ -152,7 +151,7 @@ def update_segment(component_id, .execute end - # This endpoint allows you to delete a Segment with specified ID. + # Deletes a segment with the specified ID. # You may specify component and/or price point by using either the numeric # ID or the `handle:gold` syntax. # @param [String] component_id Required parameter: ID or Handle of the @@ -190,8 +189,8 @@ def delete_segment(component_id, .execute end - # This endpoint allows you to create multiple segments in one request. The - # array of segments can contain up to `2000` records. + # Creates multiple segments in one request. The array of segments can + # contain up to `2000` records. # If any of the records contain an error the whole request would fail and # none of the requested segments get created. The error response contains a # message for only the one segment that failed validation, with the @@ -236,8 +235,8 @@ def bulk_create_segments(component_id, .execute end - # This endpoint allows you to update multiple segments in one request. The - # array of segments can contain up to `1000` records. + # Updates multiple segments in one request. The array of segments can + # contain up to `1000` records. # If any of the records contain an error the whole request would fail and # none of the requested segments get updated. The error response contains a # message for only the one segment that failed validation, with the diff --git a/lib/advanced_billing/controllers/events_controller.rb b/lib/advanced_billing/controllers/events_controller.rb index d9eac70..ea53425 100644 --- a/lib/advanced_billing/controllers/events_controller.rb +++ b/lib/advanced_billing/controllers/events_controller.rb @@ -6,13 +6,14 @@ module AdvancedBilling # EventsController class EventsController < BaseController + # Lists events for a site. # ## Events Intro # Advanced Billing Events include various activity that happens around a # Site. This information is **especially** useful to track down issues that # arise when subscriptions are not created due to errors. # Within the Advanced Billing UI, "Events" are referred to as "Site - # Activity". Full documentation on how to record view Events / Site Activty - # in the Advanced Billing UI can be located + # Activity". Full documentation on how to view Events / Site Activity in + # the Advanced Billing UI can be located # [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Act # ivity). # ## List Events for a Site @@ -141,7 +142,7 @@ def list_events(options = {}) .execute end - # The following request will return a list of events for a subscription. + # Lists events for a subscription. # ## Event Key # The event type is identified by the key property. You can check supported # keys [here]($m/Event%20Key). @@ -199,7 +200,7 @@ def list_subscription_events(options = {}) .execute end - # Get a count of all the events for a given site by using this method. + # Returns the total count of events for a given site. # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start diff --git a/lib/advanced_billing/controllers/insights_controller.rb b/lib/advanced_billing/controllers/insights_controller.rb index 0b6ec31..19ace1f 100644 --- a/lib/advanced_billing/controllers/insights_controller.rb +++ b/lib/advanced_billing/controllers/insights_controller.rb @@ -6,8 +6,8 @@ module AdvancedBilling # InsightsController class InsightsController < BaseController - # The Stats API is a very basic view of some Site-level stats. This API call - # only answers with JSON responses. An XML version is not provided. + # Returns basic site-level stats. This API call only answers with JSON + # responses. An XML version is not provided. # ## Stats Documentation # There currently is not a complimentary matching set of documentation that # compliments this endpoint. However, each Site's dashboard will reflect the @@ -29,8 +29,7 @@ def read_site_stats .execute end - # This endpoint returns your site's current MRR, including plan and usage - # breakouts. + # Returns your site's current MRR, including plan and usage breakouts. # @param [DateTime] at_time Optional parameter: submit a timestamp in # ISO8601 format to request MRR for a historic time # @param [Integer] subscription_id Optional parameter: submit the id of a @@ -53,7 +52,7 @@ def read_mrr(at_time: nil, .execute end - # This endpoint returns your site's MRR movements. + # Lists your site's MRR movements. # ## Understanding MRR movements # This endpoint will aid in accessing your site's [MRR # Report](https://maxio.zendesk.com/hc/en-us/articles/24285894587021-MRR-Ana diff --git a/lib/advanced_billing/controllers/offers_controller.rb b/lib/advanced_billing/controllers/offers_controller.rb index 3a61f00..617b1f7 100644 --- a/lib/advanced_billing/controllers/offers_controller.rb +++ b/lib/advanced_billing/controllers/offers_controller.rb @@ -6,8 +6,7 @@ module AdvancedBilling # OffersController class OffersController < BaseController - # Create an offer within your Advanced Billing site by sending a POST - # request. + # Creates an offer within your Advanced Billing site. # ## Documentation # Offers allow you to package complicated combinations of products, # components and coupons into a convenient package which can then be @@ -46,7 +45,7 @@ def create_offer(body: nil) .execute end - # This endpoint will list offers for a site. + # Lists offers for a site. # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start @@ -81,8 +80,8 @@ def list_offers(options = {}) .execute end - # This method allows you to list a specific offer's attributes. This is - # different than list all offers for a site, as it requires an `offer_id`. + # Returns a specific offer's attributes. This is different from listing all + # offers for a site, as it requires an `offer_id`. # @param [Integer] offer_id Required parameter: The Chargify id of the # offer # @return [OfferResponse] Response from the API call. @@ -102,7 +101,7 @@ def read_offer(offer_id) .execute end - # Archive an existing offer. Please provide an `offer_id` in order to + # Archives an existing offer. Please provide an `offer_id` in order to # archive the correct item. # @param [Integer] offer_id Required parameter: The Chargify id of the # offer @@ -121,8 +120,8 @@ def archive_offer(offer_id) .execute end - # Unarchive a previously archived offer. Please provide an `offer_id` in - # order to un-archive the correct item. + # Unarchives a previously archived offer. Please provide an `offer_id` in + # order to unarchive the correct item. # @param [Integer] offer_id Required parameter: The Chargify id of the # offer # @return [void] Response from the API call. diff --git a/lib/advanced_billing/controllers/payment_profiles_controller.rb b/lib/advanced_billing/controllers/payment_profiles_controller.rb index 4a5b4e1..6ea6ac5 100644 --- a/lib/advanced_billing/controllers/payment_profiles_controller.rb +++ b/lib/advanced_billing/controllers/payment_profiles_controller.rb @@ -54,7 +54,7 @@ class PaymentProfilesController < BaseController # + [Maxio.js with Stripe Direct Debit - full # example](https://docs.maxio.com/hc/en-us/articles/38206331271693-Examples# # h_01K0PJ15QRECQQ4ECS3ZA55GY7) - # + [CMaxio.js with Stripe BECS Direct Debit - minimal + # + [Maxio.js with Stripe BECS Direct Debit - minimal # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN # DIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway # ) @@ -111,9 +111,9 @@ def create_payment_profile(body: nil) .execute end - # This method will return all of the active `payment_profiles` for a Site, - # or for one Customer within a site. If no payment profiles are found, this - # endpoint will return an empty array, not a 404. + # Returns all active payment profiles for a site, or for one customer within + # a site. If no payment profiles are found, this endpoint will return an + # empty array, not a 404. # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start @@ -145,8 +145,7 @@ def list_payment_profiles(options = {}) .execute end - # Using the GET method you can retrieve a Payment Profile identified by its - # unique ID. + # Returns a payment profile identified by its unique ID. # Note that a different JSON object will be returned if the card method on # file is a bank account. # ### Response for Bank Account @@ -202,6 +201,7 @@ def read_payment_profile(payment_profile_id) .execute end + # Updates a payment profile. # ## Partial Card Updates # In the event that you are using the Authorize.net, Stripe, Cybersource, # Forte or Braintree Blue payment gateways, you can update just the billing @@ -335,8 +335,8 @@ def delete_subscriptions_payment_profile(subscription_id, .execute end - # Submit the two small deposit amounts the customer received in their bank - # account in order to verify the bank account. (Stripe only) + # Verifies a bank account. Submit the two small deposit amounts the customer + # received in their bank account to verify the bank account. (Stripe only) # @param [Integer] bank_account_id Required parameter: Identifier of the # bank account in the system. # @param [BankAccountVerificationRequest] body Optional parameter: TODO: @@ -395,8 +395,8 @@ def delete_subscription_group_payment_profile(uid, .execute end - # This will change the default payment profile on the subscription to the - # existing payment profile with the id specified. + # Changes the default payment profile on the subscription to the existing + # payment profile with the specified ID. # You must elect to change the existing payment profile to a new payment # profile ID in order to receive a satisfactory response from this endpoint. # @param [Integer] subscription_id Required parameter: The Chargify id of diff --git a/lib/advanced_billing/controllers/product_families_controller.rb b/lib/advanced_billing/controllers/product_families_controller.rb index 34f689b..22e5cd0 100644 --- a/lib/advanced_billing/controllers/product_families_controller.rb +++ b/lib/advanced_billing/controllers/product_families_controller.rb @@ -82,7 +82,7 @@ def list_products_for_product_family(options = {}) end # Creates a Product Family within your Advanced Billing site. Create a - # Product Family to act as a container for your products, components and + # Product Family to act as a container for your products, components, and # coupons. # Full documentation on how Product Families operate within the Advanced # Billing UI can be located @@ -111,7 +111,7 @@ def create_product_family(body: nil) .execute end - # Retrieve a list of Product Families for a site. + # Returns a list of Product Families for a site. # @param [BasicDateField] date_field Optional parameter: The type of filter # you would like to apply to your search. Use in query: # `date_field=created_at`. diff --git a/lib/advanced_billing/controllers/product_price_points_controller.rb b/lib/advanced_billing/controllers/product_price_points_controller.rb index 49cccda..0e60ed7 100644 --- a/lib/advanced_billing/controllers/product_price_points_controller.rb +++ b/lib/advanced_billing/controllers/product_price_points_controller.rb @@ -141,8 +141,8 @@ def update_product_price_point(product_id, .execute end - # Use this endpoint to retrieve details for a specific product price point. - # You can achieve this by using either the product price point ID or handle. + # Returns details for a specific product price point. You can achieve this + # by using either the product price point ID or handle. # @param [Integer | String] product_id Required parameter: The id or handle # of the product. When using the handle, it must be prefixed with `handle:`. # Example: `123` for an integer ID, or `handle:example-product-handle` for a @@ -231,7 +231,7 @@ def archive_product_price_point(product_id, .execute end - # Use this endpoint to unarchive an archived product price point. + # Unarchives an archived product price point. # @param [Integer] product_id Required parameter: The Advanced Billing id of # the product to which the price point belongs # @param [Integer] price_point_id Required parameter: The Advanced Billing @@ -386,8 +386,7 @@ def update_product_currency_prices(product_price_point_id, .execute end - # This method allows retrieval of a list of Products Price Points belonging - # to a Site. + # Lists Product Price Points belonging to a site. # @param [SortingDirection] direction Optional parameter: Controls the order # in which results are returned. Use in query `direction=asc`. # @param [ListPricePointsFilter] filter Optional parameter: Filter to use diff --git a/lib/advanced_billing/controllers/products_controller.rb b/lib/advanced_billing/controllers/products_controller.rb index 22e540b..8f18721 100644 --- a/lib/advanced_billing/controllers/products_controller.rb +++ b/lib/advanced_billing/controllers/products_controller.rb @@ -7,7 +7,7 @@ module AdvancedBilling # ProductsController class ProductsController < BaseController # Creates a product in your Advanced Billing site. - # See the following product docuemation for more information: + # See the following product documentation for more information: # + [Products # Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645- # Products-Overview) @@ -100,7 +100,7 @@ def update_product(product_id, .execute end - # Archives the product. All current subscribers will be unffected; their + # Archives the product. All current subscribers will be unaffected; their # subscription/purchase will continue to be charged monthly. # This will restrict the option to chose the product for purchase via the # Billing Portal, as well as disable Public Signup Pages for the product. @@ -146,7 +146,7 @@ def read_product_by_handle(api_handle) .execute end - # This method allows to retrieve a list of Products belonging to a Site. + # Lists products belonging to a site. # @param [BasicDateField] date_field Optional parameter: The type of filter # you would like to apply to your search. Use in query: # `date_field=created_at`. diff --git a/lib/advanced_billing/controllers/proforma_invoices_controller.rb b/lib/advanced_billing/controllers/proforma_invoices_controller.rb index 59062ad..18452ef 100644 --- a/lib/advanced_billing/controllers/proforma_invoices_controller.rb +++ b/lib/advanced_billing/controllers/proforma_invoices_controller.rb @@ -6,11 +6,11 @@ module AdvancedBilling # ProformaInvoicesController class ProformaInvoicesController < BaseController - # This endpoint will trigger the creation of a consolidated proforma invoice - # asynchronously. It will return a 201 with no message, or a 422 with any - # errors. To find and view the new consolidated proforma invoice, you may - # poll the subscription group listing for proforma invoices; only one - # consolidated proforma invoice may be created per group at a time. + # Creates a consolidated proforma invoice asynchronously. It will return a + # 201 with no message, or a 422 with any errors. To find and view the new + # consolidated proforma invoice, you may poll the subscription group listing + # for proforma invoices; only one consolidated proforma invoice may be + # created per group at a time. # If the information becomes outdated, simply void the old consolidated # proforma invoice and generate a new one. # ## Restrictions @@ -38,8 +38,8 @@ def create_consolidated_proforma_invoice(uid) .execute end - # Only proforma invoices with a `consolidation_level` of parent are - # returned. + # Lists proforma invoices with a `consolidation_level` of parent for the + # subscription group. # By default, proforma invoices returned on the index will only include # totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, # `credits`, `payments`, `custom_fields`. To include breakdowns, pass the @@ -84,7 +84,7 @@ def list_subscription_group_proforma_invoices(options = {}) .execute end - # Use this endpoint to read the details of an existing proforma invoice. + # Returns the details of an existing proforma invoice. # ## Restrictions # Proforma invoices are only available on Relationship Invoicing sites. # @param [String] proforma_invoice_uid Required parameter: The uid of the @@ -109,9 +109,9 @@ def read_proforma_invoice(proforma_invoice_uid) .execute end - # This endpoint will create a proforma invoice and return it as a response. - # If the information becomes outdated, simply void the old proforma invoice - # and generate a new one. + # Creates a proforma invoice and returns it as a response. If the + # information becomes outdated, simply void the old proforma invoice and + # generate a new one. # If you would like to preview the next billing amounts without generating a # full proforma invoice, use the renewal preview endpoint. # ## Restrictions @@ -141,10 +141,10 @@ def create_proforma_invoice(subscription_id) .execute end - # By default, proforma invoices returned on the index will only include - # totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, - # `credits`, `payments`, or `custom_fields`. To include breakdowns, pass the - # specific field as a key in the query with a value set to `true`. + # Lists proforma invoices for a subscription. By default, results only + # include totals, not detailed breakdowns for `line_items`, `discounts`, + # `taxes`, `credits`, `payments`, or `custom_fields`. To include breakdowns, + # pass the specific field as a key in the query with a value set to `true`. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [String] start_date Optional parameter: The beginning date range @@ -208,8 +208,7 @@ def list_proforma_invoices(options = {}) .execute end - # Allows for proforma invoices to be programmatically delivered via email. - # Supports email + # Delivers a proforma invoice programmatically via email. Supports email # delivery to direct recipients, carbon-copy (cc) recipients, and blind # carbon-copy (bcc) recipients. # If `recipient_emails` is omitted, the system will fall back to the primary @@ -249,7 +248,7 @@ def deliver_proforma_invoice(proforma_invoice_uid, .execute end - # This endpoint will void a proforma invoice that has the status "draft". + # Voids a proforma invoice that has the status "draft". # ## Restrictions # Proforma invoices are only available on Relationship Invoicing sites. # Only proforma invoices that have the appropriate status may be reopened. @@ -290,7 +289,7 @@ def void_proforma_invoice(proforma_invoice_uid, .execute end - # Return a preview of the data that will be included on a given + # Returns a preview of the data that will be included on a given # subscription's proforma invoice if one were to be generated. It will have # similar line items and totals as a renewal preview, but the response will # be presented in the format of a proforma invoice. Consequently it will @@ -333,12 +332,11 @@ def preview_proforma_invoice(subscription_id) .execute end - # This endpoint is only available for Relationship Invoicing sites. It - # cannot be used to create consolidated proforma invoices or preview prepaid - # subscriptions. - # Create a proforma invoice to preview costs before a subscription's signup. - # Like other proforma invoices, it can be emailed to the customer, voided, - # and publicly viewed on the chargifypay domain. + # Creates a proforma invoice to preview costs before a subscription's + # signup. This endpoint is only available for Relationship Invoicing sites + # and cannot be used to create consolidated proforma invoices or preview + # prepaid subscriptions. Like other proforma invoices, it can be emailed to + # the customer, voided, and publicly viewed on the chargifypay domain. # Pass a payload that resembles a subscription create or signup preview # request. For example, you can specify components, coupons/a referral, # offers, custom pricing, and an existing customer or payment profile to @@ -374,13 +372,12 @@ def create_signup_proforma_invoice(body: nil) .execute end - # This endpoint is only available for Relationship Invoicing sites. It - # cannot be used to create consolidated proforma invoice previews or preview - # prepaid subscriptions. - # Create a signup preview in the format of a proforma invoice to preview - # costs before a subscription's signup. You have the option of optionally - # previewing the first renewal's costs as well. The proforma invoice preview - # will not be persisted. + # Creates a signup preview in the format of a proforma invoice to preview + # costs before a subscription's signup. This endpoint is only available for + # Relationship Invoicing sites and cannot be used to create consolidated + # proforma invoice previews or preview prepaid subscriptions. You have the + # option of previewing the first renewal's costs as well. The proforma + # invoice preview will not be persisted. # Pass a payload that resembles a subscription create or signup preview # request. For example, you can specify components, coupons/a referral, # offers, custom pricing, and an existing customer or payment profile to diff --git a/lib/advanced_billing/controllers/reason_codes_controller.rb b/lib/advanced_billing/controllers/reason_codes_controller.rb index 2404694..e26fdac 100644 --- a/lib/advanced_billing/controllers/reason_codes_controller.rb +++ b/lib/advanced_billing/controllers/reason_codes_controller.rb @@ -6,8 +6,9 @@ module AdvancedBilling # ReasonCodesController class ReasonCodesController < BaseController + # Creates a reason code for a given site. # # Reason Codes Intro - # ReasonCodes are a way to gain a high level view of why your customers are + # Reason Codes are a way to gain a high-level view of why your customers are # cancelling the subscription to your product or service. # Add a set of churn reason codes to be displayed in-app and/or the Maxio # Billing Portal. As your subscribers decide to cancel their subscription, @@ -19,8 +20,8 @@ class ReasonCodesController < BaseController # Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Re # ason-Codes) # ## Create Reason Code - # This method gives a merchant the option to create a reason codes for a - # given Site. + # This method gives a merchant the option to create reason codes for a given + # site. # @param [CreateReasonCodeRequest] body Optional parameter: TODO: type # description here # @return [ReasonCodeResponse] Response from the API call. @@ -44,8 +45,7 @@ def create_reason_code(body: nil) .execute end - # This method gives a merchant the option to retrieve a list of all of the - # current churn codes for a given site. + # Lists all current churn codes for a given site. # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start @@ -78,8 +78,7 @@ def list_reason_codes(options = {}) .execute end - # This method gives a merchant the option to retrieve a list of a particular - # code for a given Site by providing the unique numerical ID of the code. + # Returns a particular churn reason code for a given site by its unique ID. # @param [Integer] reason_code_id Required parameter: The Advanced Billing # id of the reason code # @return [ReasonCodeResponse] Response from the API call. @@ -102,8 +101,7 @@ def read_reason_code(reason_code_id) .execute end - # This method gives a merchant the option to update an existing reason code - # for a given site. + # Updates an existing reason code for a given site. # @param [Integer] reason_code_id Required parameter: The Advanced Billing # id of the reason code # @param [UpdateReasonCodeRequest] body Optional parameter: TODO: type @@ -136,9 +134,8 @@ def update_reason_code(reason_code_id, .execute end - # This method gives a merchant the option to delete one reason code from the - # Churn Reason Codes. This code will be immediately removed. This action is - # not reversible. + # Deletes a reason code from the Churn Reason Codes. This code will be + # immediately removed. This action is not reversible. # @param [Integer] reason_code_id Required parameter: The Advanced Billing # id of the reason code # @return [OkResponse] Response from the API call. diff --git a/lib/advanced_billing/controllers/referral_codes_controller.rb b/lib/advanced_billing/controllers/referral_codes_controller.rb index 18af077..6660815 100644 --- a/lib/advanced_billing/controllers/referral_codes_controller.rb +++ b/lib/advanced_billing/controllers/referral_codes_controller.rb @@ -6,9 +6,9 @@ module AdvancedBilling # ReferralCodesController class ReferralCodesController < BaseController - # Use this method to determine if the referral code is valid and applicable - # within your Site. This method is useful for validating referral codes that - # are entered by a customer. + # Validates whether a referral code is valid and applicable within your + # site. This method is useful for validating referral codes that are entered + # by a customer. # ## Referrals Documentation # Full documentation on how to use the referrals feature in the Advanced # Billing UI can be located diff --git a/lib/advanced_billing/controllers/sales_commissions_controller.rb b/lib/advanced_billing/controllers/sales_commissions_controller.rb index f2d2326..94b3fbd 100644 --- a/lib/advanced_billing/controllers/sales_commissions_controller.rb +++ b/lib/advanced_billing/controllers/sales_commissions_controller.rb @@ -6,7 +6,7 @@ module AdvancedBilling # SalesCommissionsController class SalesCommissionsController < BaseController - # Endpoint returns subscriptions with associated sales reps + # Lists subscriptions with associated sales reps. # ## Modified Authentication Process # The Sales Commission API differs from other Chargify API endpoints. This # resource is associated with the seller itself. Up to now all available @@ -63,7 +63,7 @@ def list_sales_commission_settings(options = {}) .execute end - # Endpoint returns sales rep list with details + # Returns a sales rep list with details. # ## Modified Authentication Process # The Sales Commission API differs from other Chargify API endpoints. This # resource is associated with the seller itself. Up to now all available @@ -120,7 +120,7 @@ def list_sales_reps(options = {}) .execute end - # Endpoint returns sales rep and attached subscriptions details. + # Returns a sales rep and attached subscription details. # ## Modified Authentication Process # The Sales Commission API differs from other Chargify API endpoints. This # resource is associated with the seller itself. Up to now all available diff --git a/lib/advanced_billing/models/chjs_tokenization_failure.rb b/lib/advanced_billing/models/chjs_tokenization_failure.rb new file mode 100644 index 0000000..a42d7d7 --- /dev/null +++ b/lib/advanced_billing/models/chjs_tokenization_failure.rb @@ -0,0 +1,98 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # ChjsTokenizationFailure Model. + class ChjsTokenizationFailure < BaseModel + SKIP = Object.new + private_constant :SKIP + + # TODO: Write general description for this method + # @return [String] + attr_accessor :errors + + # PCI-safe cardholder fields only. Full card numbers, CVV, and billing + # address are never included. + # @return [PaymentProfileParams] + attr_accessor :payment_profile_params + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['errors'] = 'errors' + @_hash['payment_profile_params'] = 'payment_profile_params' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + payment_profile_params + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(errors:, payment_profile_params: SKIP, + additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @errors = errors + @payment_profile_params = payment_profile_params unless payment_profile_params == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + errors = hash.key?('errors') ? hash['errors'] : nil + payment_profile_params = PaymentProfileParams.from_hash(hash['payment_profile_params']) if + hash['payment_profile_params'] + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + ChjsTokenizationFailure.new(errors: errors, + payment_profile_params: payment_profile_params, + additional_properties: additional_properties) + end + + # Validates an instance of the object from a given value. + # @param [ChjsTokenizationFailure | Hash] The value against the validation is performed. + def self.validate(value) + if value.instance_of? self + return APIHelper.valid_type?(value.errors, + ->(val) { val.instance_of? String }) + end + + return false unless value.instance_of? Hash + + APIHelper.valid_type?(value['errors'], + ->(val) { val.instance_of? String }) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} errors: #{@errors}, payment_profile_params: #{@payment_profile_params},"\ + " additional_properties: #{get_additional_properties}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} errors: #{@errors.inspect}, payment_profile_params:"\ + " #{@payment_profile_params.inspect}, additional_properties: #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/chjs_tokenization_success.rb b/lib/advanced_billing/models/chjs_tokenization_success.rb new file mode 100644 index 0000000..08fa3f5 --- /dev/null +++ b/lib/advanced_billing/models/chjs_tokenization_success.rb @@ -0,0 +1,102 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # ChjsTokenizationSuccess Model. + class ChjsTokenizationSuccess < BaseModel + SKIP = Object.new + private_constant :SKIP + + # TODO: Write general description for this method + # @return [PaymentProfile] + attr_accessor :payment_profile + + # TODO: Write general description for this method + # @return [Integer] + attr_accessor :gateway_customer_id + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['payment_profile'] = 'payment_profile' + @_hash['gateway_customer_id'] = 'gateway_customer_id' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + gateway_customer_id + ] + end + + # An array for nullable fields + def self.nullables + %w[ + gateway_customer_id + ] + end + + def initialize(payment_profile:, gateway_customer_id: SKIP, + additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @payment_profile = payment_profile + @gateway_customer_id = gateway_customer_id unless gateway_customer_id == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + payment_profile = PaymentProfile.from_hash(hash['payment_profile']) if + hash['payment_profile'] + gateway_customer_id = + hash.key?('gateway_customer_id') ? hash['gateway_customer_id'] : SKIP + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + ChjsTokenizationSuccess.new(payment_profile: payment_profile, + gateway_customer_id: gateway_customer_id, + additional_properties: additional_properties) + end + + # Validates an instance of the object from a given value. + # @param [ChjsTokenizationSuccess | Hash] The value against the validation is performed. + def self.validate(value) + if value.instance_of? self + return APIHelper.valid_type?(value.payment_profile, + ->(val) { PaymentProfile.validate(val) }, + is_model_hash: true) + end + + return false unless value.instance_of? Hash + + APIHelper.valid_type?(value['payment_profile'], + ->(val) { PaymentProfile.validate(val) }, + is_model_hash: true) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} payment_profile: #{@payment_profile}, gateway_customer_id:"\ + " #{@gateway_customer_id}, additional_properties: #{get_additional_properties}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} payment_profile: #{@payment_profile.inspect}, gateway_customer_id:"\ + " #{@gateway_customer_id.inspect}, additional_properties: #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/create_subscription.rb b/lib/advanced_billing/models/create_subscription.rb index 2b4fe7e..f08abd4 100644 --- a/lib/advanced_billing/models/create_subscription.rb +++ b/lib/advanced_billing/models/create_subscription.rb @@ -319,6 +319,7 @@ class CreateSubscription < BaseModel # Valid only for the Subscription Preview endpoint. When set to `true` it # skips calculating taxes for the current and next billing manifests. + # Defaults to `false` when not provided. # @return [TrueClass | FalseClass] attr_accessor :skip_billing_manifest_taxes @@ -472,8 +473,7 @@ def initialize(product_handle: SKIP, product_id: SKIP, agreement_acceptance: SKIP, ach_agreement: SKIP, dunning_communication_delay_enabled: false, dunning_communication_delay_time_zone: SKIP, - skip_billing_manifest_taxes: false, - additional_properties: {}) + skip_billing_manifest_taxes: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -675,7 +675,7 @@ def self.from_hash(hash) dunning_communication_delay_time_zone = hash.key?('dunning_communication_delay_time_zone') ? hash['dunning_communication_delay_time_zone'] : SKIP skip_billing_manifest_taxes = - hash['skip_billing_manifest_taxes'] ||= false + hash.key?('skip_billing_manifest_taxes') ? hash['skip_billing_manifest_taxes'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } diff --git a/lib/advanced_billing/models/credit_note_line_item.rb b/lib/advanced_billing/models/credit_note_line_item.rb index 75c10c4..d63d551 100644 --- a/lib/advanced_billing/models/credit_note_line_item.rb +++ b/lib/advanced_billing/models/credit_note_line_item.rb @@ -128,6 +128,11 @@ class CreditNoteLineItem < BaseModel # @return [TrueClass | FalseClass] attr_accessor :custom_item + # The date a prepaid allocation is set to expire. Only present on line items + # representing prepaid component allocations. The format is `"YYYY-MM-DD"`. + # @return [Date] + attr_accessor :prepaid_allocation_expires_at + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -150,6 +155,8 @@ def self.names @_hash['price_point_id'] = 'price_point_id' @_hash['billing_schedule_item_id'] = 'billing_schedule_item_id' @_hash['custom_item'] = 'custom_item' + @_hash['prepaid_allocation_expires_at'] = + 'prepaid_allocation_expires_at' @_hash end @@ -175,6 +182,7 @@ def self.optionals price_point_id billing_schedule_item_id custom_item + prepaid_allocation_expires_at ] end @@ -184,6 +192,7 @@ def self.nullables component_id price_point_id billing_schedule_item_id + prepaid_allocation_expires_at ] end @@ -194,7 +203,8 @@ def initialize(uid: SKIP, title: SKIP, description: SKIP, quantity: SKIP, period_range_start: SKIP, period_range_end: SKIP, product_id: SKIP, product_version: SKIP, component_id: SKIP, price_point_id: SKIP, billing_schedule_item_id: SKIP, - custom_item: SKIP, additional_properties: {}) + custom_item: SKIP, prepaid_allocation_expires_at: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -219,6 +229,10 @@ def initialize(uid: SKIP, title: SKIP, description: SKIP, quantity: SKIP, @price_point_id = price_point_id unless price_point_id == SKIP @billing_schedule_item_id = billing_schedule_item_id unless billing_schedule_item_id == SKIP @custom_item = custom_item unless custom_item == SKIP + unless prepaid_allocation_expires_at == SKIP + @prepaid_allocation_expires_at = + prepaid_allocation_expires_at + end end # Creates an instance of the object from a hash. @@ -253,6 +267,8 @@ def self.from_hash(hash) billing_schedule_item_id = hash.key?('billing_schedule_item_id') ? hash['billing_schedule_item_id'] : SKIP custom_item = hash.key?('custom_item') ? hash['custom_item'] : SKIP + prepaid_allocation_expires_at = + hash.key?('prepaid_allocation_expires_at') ? hash['prepaid_allocation_expires_at'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -277,6 +293,7 @@ def self.from_hash(hash) price_point_id: price_point_id, billing_schedule_item_id: billing_schedule_item_id, custom_item: custom_item, + prepaid_allocation_expires_at: prepaid_allocation_expires_at, additional_properties: additional_properties) end @@ -301,7 +318,8 @@ def to_s " #{@period_range_end}, product_id: #{@product_id}, product_version: #{@product_version},"\ " component_id: #{@component_id}, price_point_id: #{@price_point_id},"\ " billing_schedule_item_id: #{@billing_schedule_item_id}, custom_item: #{@custom_item},"\ - " additional_properties: #{get_additional_properties}>" + " prepaid_allocation_expires_at: #{@prepaid_allocation_expires_at}, additional_properties:"\ + " #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -317,6 +335,7 @@ def inspect " product_version: #{@product_version.inspect}, component_id: #{@component_id.inspect},"\ " price_point_id: #{@price_point_id.inspect}, billing_schedule_item_id:"\ " #{@billing_schedule_item_id.inspect}, custom_item: #{@custom_item.inspect},"\ + " prepaid_allocation_expires_at: #{@prepaid_allocation_expires_at.inspect},"\ " additional_properties: #{get_additional_properties}>" end end diff --git a/lib/advanced_billing/models/customer.rb b/lib/advanced_billing/models/customer.rb index 445034f..dbac2ff 100644 --- a/lib/advanced_billing/models/customer.rb +++ b/lib/advanced_billing/models/customer.rb @@ -140,6 +140,10 @@ class Customer < BaseModel # @return [Integer] attr_accessor :default_auto_renewal_profile_id + # The Maxio-generated unique identifier for the customer. + # @return [String] + attr_accessor :maxioid + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -176,6 +180,7 @@ def self.names @_hash['tax_exempt_reason'] = 'tax_exempt_reason' @_hash['default_auto_renewal_profile_id'] = 'default_auto_renewal_profile_id' + @_hash['maxioid'] = 'maxioid' @_hash end @@ -212,6 +217,7 @@ def self.optionals salesforce_id tax_exempt_reason default_auto_renewal_profile_id + maxioid ] end @@ -241,6 +247,7 @@ def self.nullables salesforce_id tax_exempt_reason default_auto_renewal_profile_id + maxioid ] end @@ -255,7 +262,7 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, vat_number: SKIP, parent_id: SKIP, locale: SKIP, default_subscription_group_uid: SKIP, salesforce_id: SKIP, tax_exempt_reason: SKIP, - default_auto_renewal_profile_id: SKIP, + default_auto_renewal_profile_id: SKIP, maxioid: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| @@ -307,6 +314,7 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, @default_auto_renewal_profile_id = default_auto_renewal_profile_id end + @maxioid = maxioid unless maxioid == SKIP end # Creates an instance of the object from a hash. @@ -367,6 +375,7 @@ def self.from_hash(hash) hash.key?('tax_exempt_reason') ? hash['tax_exempt_reason'] : SKIP default_auto_renewal_profile_id = hash.key?('default_auto_renewal_profile_id') ? hash['default_auto_renewal_profile_id'] : SKIP + maxioid = hash.key?('maxioid') ? hash['maxioid'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -402,6 +411,7 @@ def self.from_hash(hash) salesforce_id: salesforce_id, tax_exempt_reason: tax_exempt_reason, default_auto_renewal_profile_id: default_auto_renewal_profile_id, + maxioid: maxioid, additional_properties: additional_properties) end @@ -449,8 +459,8 @@ def to_s " #{@tax_exempt}, vat_number: #{@vat_number}, parent_id: #{@parent_id}, locale: #{@locale},"\ " default_subscription_group_uid: #{@default_subscription_group_uid}, salesforce_id:"\ " #{@salesforce_id}, tax_exempt_reason: #{@tax_exempt_reason},"\ - " default_auto_renewal_profile_id: #{@default_auto_renewal_profile_id},"\ - " additional_properties: #{get_additional_properties}>" + " default_auto_renewal_profile_id: #{@default_auto_renewal_profile_id}, maxioid:"\ + " #{@maxioid}, additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -471,8 +481,8 @@ def inspect " #{@locale.inspect}, default_subscription_group_uid:"\ " #{@default_subscription_group_uid.inspect}, salesforce_id: #{@salesforce_id.inspect},"\ " tax_exempt_reason: #{@tax_exempt_reason.inspect}, default_auto_renewal_profile_id:"\ - " #{@default_auto_renewal_profile_id.inspect}, additional_properties:"\ - " #{get_additional_properties}>" + " #{@default_auto_renewal_profile_id.inspect}, maxioid: #{@maxioid.inspect},"\ + " additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/event.rb b/lib/advanced_billing/models/event.rb index 6f45b0a..2ef8b0f 100644 --- a/lib/advanced_billing/models/event.rb +++ b/lib/advanced_billing/models/event.rb @@ -61,6 +61,8 @@ class Event < BaseModel # CreditAccountBalanceChanged # * `item_price_point_changed` - ItemPricePointChanged # * `custom_field_value_change` - CustomFieldValueChange + # * `chjs_tokenization_success` - ChjsTokenizationSuccess + # * `chjs_tokenization_failure` - ChjsTokenizationFailure # * The rest, that is `delayed_signup_creation_failure`, # `billing_date_change`, `expiration_date_change`, `expiring_card`, # `customer_update`, `customer_create`, `customer_delete`, diff --git a/lib/advanced_billing/models/event_key.rb b/lib/advanced_billing/models/event_key.rb index 42ca29b..ce123c6 100644 --- a/lib/advanced_billing/models/event_key.rb +++ b/lib/advanced_billing/models/event_key.rb @@ -245,6 +245,12 @@ class EventKey # TODO: Write general description for COMPONENT_BILLING_DATE_CHANGED COMPONENT_BILLING_DATE_CHANGED = 'component_billing_date_changed'.freeze, + # TODO: Write general description for CHJS_TOKENIZATION_FAILURE + CHJS_TOKENIZATION_FAILURE = 'chjs_tokenization_failure'.freeze, + + # TODO: Write general description for CHJS_TOKENIZATION_SUCCESS + CHJS_TOKENIZATION_SUCCESS = 'chjs_tokenization_success'.freeze, + # TODO: Write general description for SUBSCRIPTION_TERM_RENEWAL_SCHEDULED SUBSCRIPTION_TERM_RENEWAL_SCHEDULED = 'subscription_term_renewal_scheduled'.freeze, @@ -347,6 +353,8 @@ def self.from_value(value, default_value = PAYMENT_SUCCESS) when 'chargeback_won' then CHARGEBACK_WON when 'payment_collection_method_changed' then PAYMENT_COLLECTION_METHOD_CHANGED when 'component_billing_date_changed' then COMPONENT_BILLING_DATE_CHANGED + when 'chjs_tokenization_failure' then CHJS_TOKENIZATION_FAILURE + when 'chjs_tokenization_success' then CHJS_TOKENIZATION_SUCCESS when 'subscription_term_renewal_scheduled' then SUBSCRIPTION_TERM_RENEWAL_SCHEDULED when 'subscription_term_renewal_pending' then SUBSCRIPTION_TERM_RENEWAL_PENDING when 'subscription_term_renewal_activated' then SUBSCRIPTION_TERM_RENEWAL_ACTIVATED diff --git a/lib/advanced_billing/models/invoice_line_item.rb b/lib/advanced_billing/models/invoice_line_item.rb index 7e72b40..2990e73 100644 --- a/lib/advanced_billing/models/invoice_line_item.rb +++ b/lib/advanced_billing/models/invoice_line_item.rb @@ -166,6 +166,11 @@ class InvoiceLineItem < BaseModel # @return [String] attr_accessor :kind + # The date a prepaid allocation is set to expire. Only present on line items + # representing prepaid component allocations. The format is `"YYYY-MM-DD"`. + # @return [Date] + attr_accessor :prepaid_allocation_expires_at + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -193,6 +198,8 @@ def self.names @_hash['product_price_point_id'] = 'product_price_point_id' @_hash['custom_item'] = 'custom_item' @_hash['kind'] = 'kind' + @_hash['prepaid_allocation_expires_at'] = + 'prepaid_allocation_expires_at' @_hash end @@ -223,6 +230,7 @@ def self.optionals product_price_point_id custom_item kind + prepaid_allocation_expires_at ] end @@ -236,6 +244,7 @@ def self.nullables billing_schedule_item_id component_cost_data product_price_point_id + prepaid_allocation_expires_at ] end @@ -249,6 +258,7 @@ def initialize(uid: SKIP, title: SKIP, description: SKIP, quantity: SKIP, price_point_id: SKIP, billing_schedule_item_id: SKIP, hide: SKIP, component_cost_data: SKIP, product_price_point_id: SKIP, custom_item: SKIP, kind: SKIP, + prepaid_allocation_expires_at: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| @@ -279,6 +289,10 @@ def initialize(uid: SKIP, title: SKIP, description: SKIP, quantity: SKIP, @product_price_point_id = product_price_point_id unless product_price_point_id == SKIP @custom_item = custom_item unless custom_item == SKIP @kind = kind unless kind == SKIP + unless prepaid_allocation_expires_at == SKIP + @prepaid_allocation_expires_at = + prepaid_allocation_expires_at + end end # Creates an instance of the object from a hash. @@ -322,6 +336,8 @@ def self.from_hash(hash) hash.key?('product_price_point_id') ? hash['product_price_point_id'] : SKIP custom_item = hash.key?('custom_item') ? hash['custom_item'] : SKIP kind = hash.key?('kind') ? hash['kind'] : SKIP + prepaid_allocation_expires_at = + hash.key?('prepaid_allocation_expires_at') ? hash['prepaid_allocation_expires_at'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -351,6 +367,7 @@ def self.from_hash(hash) product_price_point_id: product_price_point_id, custom_item: custom_item, kind: kind, + prepaid_allocation_expires_at: prepaid_allocation_expires_at, additional_properties: additional_properties) end @@ -377,7 +394,8 @@ def to_s " #{@price_point_id}, billing_schedule_item_id: #{@billing_schedule_item_id}, hide:"\ " #{@hide}, component_cost_data: #{@component_cost_data}, product_price_point_id:"\ " #{@product_price_point_id}, custom_item: #{@custom_item}, kind: #{@kind},"\ - " additional_properties: #{get_additional_properties}>" + " prepaid_allocation_expires_at: #{@prepaid_allocation_expires_at}, additional_properties:"\ + " #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -396,7 +414,9 @@ def inspect " #{@billing_schedule_item_id.inspect}, hide: #{@hide.inspect}, component_cost_data:"\ " #{@component_cost_data.inspect}, product_price_point_id:"\ " #{@product_price_point_id.inspect}, custom_item: #{@custom_item.inspect}, kind:"\ - " #{@kind.inspect}, additional_properties: #{get_additional_properties}>" + " #{@kind.inspect}, prepaid_allocation_expires_at:"\ + " #{@prepaid_allocation_expires_at.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/payment_profile.rb b/lib/advanced_billing/models/payment_profile.rb new file mode 100644 index 0000000..b3791f3 --- /dev/null +++ b/lib/advanced_billing/models/payment_profile.rb @@ -0,0 +1,121 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # PaymentProfile Model. + class PaymentProfile < BaseModel + SKIP = Object.new + private_constant :SKIP + + # TODO: Write general description for this method + # @return [Integer] + attr_accessor :id + + # TODO: Write general description for this method + # @return [String] + attr_accessor :vault_token + + # TODO: Write general description for this method + # @return [String] + attr_accessor :gateway_handle + + # TODO: Write general description for this method + # @return [String] + attr_accessor :customer_vault_token + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['id'] = 'id' + @_hash['vault_token'] = 'vault_token' + @_hash['gateway_handle'] = 'gateway_handle' + @_hash['customer_vault_token'] = 'customer_vault_token' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + vault_token + gateway_handle + customer_vault_token + ] + end + + # An array for nullable fields + def self.nullables + %w[ + gateway_handle + customer_vault_token + ] + end + + def initialize(id:, vault_token: SKIP, gateway_handle: SKIP, + customer_vault_token: SKIP, additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @id = id + @vault_token = vault_token unless vault_token == SKIP + @gateway_handle = gateway_handle unless gateway_handle == SKIP + @customer_vault_token = customer_vault_token unless customer_vault_token == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + id = hash.key?('id') ? hash['id'] : nil + vault_token = hash.key?('vault_token') ? hash['vault_token'] : SKIP + gateway_handle = + hash.key?('gateway_handle') ? hash['gateway_handle'] : SKIP + customer_vault_token = + hash.key?('customer_vault_token') ? hash['customer_vault_token'] : SKIP + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + PaymentProfile.new(id: id, + vault_token: vault_token, + gateway_handle: gateway_handle, + customer_vault_token: customer_vault_token, + additional_properties: additional_properties) + end + + # Validates an instance of the object from a given value. + # @param [PaymentProfile | Hash] The value against the validation is performed. + def self.validate(value) + if value.instance_of? self + return APIHelper.valid_type?(value.id, + ->(val) { val.instance_of? Integer }) + end + + return false unless value.instance_of? Hash + + APIHelper.valid_type?(value['id'], + ->(val) { val.instance_of? Integer }) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id}, vault_token: #{@vault_token}, gateway_handle:"\ + " #{@gateway_handle}, customer_vault_token: #{@customer_vault_token}, additional_properties:"\ + " #{get_additional_properties}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id.inspect}, vault_token: #{@vault_token.inspect}, gateway_handle:"\ + " #{@gateway_handle.inspect}, customer_vault_token: #{@customer_vault_token.inspect},"\ + " additional_properties: #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/payment_profile_params.rb b/lib/advanced_billing/models/payment_profile_params.rb new file mode 100644 index 0000000..b6f2797 --- /dev/null +++ b/lib/advanced_billing/models/payment_profile_params.rb @@ -0,0 +1,103 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # PCI-safe cardholder fields only. Full card numbers, CVV, and billing address + # are never included. + class PaymentProfileParams < BaseModel + SKIP = Object.new + private_constant :SKIP + + # TODO: Write general description for this method + # @return [String] + attr_accessor :first_name + + # TODO: Write general description for this method + # @return [String] + attr_accessor :last_name + + # TODO: Write general description for this method + # @return [String] + attr_accessor :card_type + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['first_name'] = 'first_name' + @_hash['last_name'] = 'last_name' + @_hash['card_type'] = 'card_type' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + first_name + last_name + card_type + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(first_name: SKIP, last_name: SKIP, card_type: SKIP, + additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @first_name = first_name unless first_name == SKIP + @last_name = last_name unless last_name == SKIP + @card_type = card_type unless card_type == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + first_name = hash.key?('first_name') ? hash['first_name'] : SKIP + last_name = hash.key?('last_name') ? hash['last_name'] : SKIP + card_type = hash.key?('card_type') ? hash['card_type'] : SKIP + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + PaymentProfileParams.new(first_name: first_name, + last_name: last_name, + card_type: card_type, + additional_properties: additional_properties) + end + + # Validates an instance of the object from a given value. + # @param [PaymentProfileParams | Hash] The value against the validation is performed. + def self.validate(value) + return true if value.instance_of? self + + return false unless value.instance_of? Hash + + true + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} first_name: #{@first_name}, last_name: #{@last_name}, card_type:"\ + " #{@card_type}, additional_properties: #{get_additional_properties}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} first_name: #{@first_name.inspect}, last_name: #{@last_name.inspect},"\ + " card_type: #{@card_type.inspect}, additional_properties: #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/payment_profile_response.rb b/lib/advanced_billing/models/payment_profile_response.rb index 4859524..3e31c66 100644 --- a/lib/advanced_billing/models/payment_profile_response.rb +++ b/lib/advanced_billing/models/payment_profile_response.rb @@ -45,7 +45,7 @@ def self.from_hash(hash) # Extract variables from the hash. payment_profile = hash.key?('payment_profile') ? APIHelper.deserialize_union_type( - UnionTypeLookUp.get(:PaymentProfile), hash['payment_profile'] + UnionTypeLookUp.get(:PaymentProfile2), hash['payment_profile'] ) : nil # Clean out expected properties from Hash. @@ -60,13 +60,13 @@ def self.from_hash(hash) # @param [PaymentProfileResponse | Hash] The value against the validation is performed. def self.validate(value) if value.instance_of? self - return UnionTypeLookUp.get(:PaymentProfile) + return UnionTypeLookUp.get(:PaymentProfile2) .validate(value.payment_profile) end return false unless value.instance_of? Hash - UnionTypeLookUp.get(:PaymentProfile) + UnionTypeLookUp.get(:PaymentProfile2) .validate(value['payment_profile']) end diff --git a/lib/advanced_billing/models/site.rb b/lib/advanced_billing/models/site.rb index c61fde5..c631199 100644 --- a/lib/advanced_billing/models/site.rb +++ b/lib/advanced_billing/models/site.rb @@ -73,7 +73,20 @@ class Site < BaseModel # @return [NetTerms] attr_accessor :net_terms - # TODO: Write general description for this method + # Whether the site has the multi-frequency billing feature enabled. Only + # present when relationship invoicing is active. + # @return [TrueClass | FalseClass] + attr_accessor :multi_frequency_enabled + + # Whether the auto-renewals feature is enabled for this site. + # @return [TrueClass | FalseClass] + attr_accessor :auto_renewals_enabled + + # Whether the Billing Portal is enabled for this site. + # @return [TrueClass | FalseClass] + attr_accessor :portal_enabled + + # Whether the Billing Portal is enabled for this site. # @return [TrueClass | FalseClass] attr_accessor :test @@ -99,6 +112,9 @@ def self.names @_hash['organization_address'] = 'organization_address' @_hash['tax_configuration'] = 'tax_configuration' @_hash['net_terms'] = 'net_terms' + @_hash['multi_frequency_enabled'] = 'multi_frequency_enabled' + @_hash['auto_renewals_enabled'] = 'auto_renewals_enabled' + @_hash['portal_enabled'] = 'portal_enabled' @_hash['test'] = 'test' @_hash end @@ -122,6 +138,9 @@ def self.optionals organization_address tax_configuration net_terms + multi_frequency_enabled + auto_renewals_enabled + portal_enabled test ] end @@ -139,7 +158,9 @@ def initialize(id: SKIP, name: SKIP, subdomain: SKIP, currency: SKIP, whopays_default_payer: SKIP, allocation_settings: SKIP, default_payment_collection_method: SKIP, organization_address: SKIP, tax_configuration: SKIP, - net_terms: SKIP, test: SKIP, additional_properties: {}) + net_terms: SKIP, multi_frequency_enabled: SKIP, + auto_renewals_enabled: SKIP, portal_enabled: SKIP, + test: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -173,6 +194,9 @@ def initialize(id: SKIP, name: SKIP, subdomain: SKIP, currency: SKIP, @organization_address = organization_address unless organization_address == SKIP @tax_configuration = tax_configuration unless tax_configuration == SKIP @net_terms = net_terms unless net_terms == SKIP + @multi_frequency_enabled = multi_frequency_enabled unless multi_frequency_enabled == SKIP + @auto_renewals_enabled = auto_renewals_enabled unless auto_renewals_enabled == SKIP + @portal_enabled = portal_enabled unless portal_enabled == SKIP @test = test unless test == SKIP end @@ -207,6 +231,12 @@ def self.from_hash(hash) tax_configuration = TaxConfiguration.from_hash(hash['tax_configuration']) if hash['tax_configuration'] net_terms = NetTerms.from_hash(hash['net_terms']) if hash['net_terms'] + multi_frequency_enabled = + hash.key?('multi_frequency_enabled') ? hash['multi_frequency_enabled'] : SKIP + auto_renewals_enabled = + hash.key?('auto_renewals_enabled') ? hash['auto_renewals_enabled'] : SKIP + portal_enabled = + hash.key?('portal_enabled') ? hash['portal_enabled'] : SKIP test = hash.key?('test') ? hash['test'] : SKIP # Clean out expected properties from Hash. @@ -229,6 +259,9 @@ def self.from_hash(hash) organization_address: organization_address, tax_configuration: tax_configuration, net_terms: net_terms, + multi_frequency_enabled: multi_frequency_enabled, + auto_renewals_enabled: auto_renewals_enabled, + portal_enabled: portal_enabled, test: test, additional_properties: additional_properties) end @@ -245,7 +278,9 @@ def to_s " whopays_default_payer: #{@whopays_default_payer}, allocation_settings:"\ " #{@allocation_settings}, default_payment_collection_method:"\ " #{@default_payment_collection_method}, organization_address: #{@organization_address},"\ - " tax_configuration: #{@tax_configuration}, net_terms: #{@net_terms}, test: #{@test},"\ + " tax_configuration: #{@tax_configuration}, net_terms: #{@net_terms},"\ + " multi_frequency_enabled: #{@multi_frequency_enabled}, auto_renewals_enabled:"\ + " #{@auto_renewals_enabled}, portal_enabled: #{@portal_enabled}, test: #{@test},"\ " additional_properties: #{get_additional_properties}>" end @@ -263,8 +298,10 @@ def inspect " #{@allocation_settings.inspect}, default_payment_collection_method:"\ " #{@default_payment_collection_method.inspect}, organization_address:"\ " #{@organization_address.inspect}, tax_configuration: #{@tax_configuration.inspect},"\ - " net_terms: #{@net_terms.inspect}, test: #{@test.inspect}, additional_properties:"\ - " #{get_additional_properties}>" + " net_terms: #{@net_terms.inspect}, multi_frequency_enabled:"\ + " #{@multi_frequency_enabled.inspect}, auto_renewals_enabled:"\ + " #{@auto_renewals_enabled.inspect}, portal_enabled: #{@portal_enabled.inspect}, test:"\ + " #{@test.inspect}, additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/webhook_subscription.rb b/lib/advanced_billing/models/webhook_subscription.rb index e988d4a..7b79899 100644 --- a/lib/advanced_billing/models/webhook_subscription.rb +++ b/lib/advanced_billing/models/webhook_subscription.rb @@ -13,6 +13,12 @@ class WebhookSubscription # TODO: Write general description for COMPONENT_ALLOCATION_CHANGE COMPONENT_ALLOCATION_CHANGE = 'component_allocation_change'.freeze, + # TODO: Write general description for CHJS_TOKENIZATION_FAILURE + CHJS_TOKENIZATION_FAILURE = 'chjs_tokenization_failure'.freeze, + + # TODO: Write general description for CHJS_TOKENIZATION_SUCCESS + CHJS_TOKENIZATION_SUCCESS = 'chjs_tokenization_success'.freeze, + # TODO: Write general description for CUSTOMER_CREATE CUSTOMER_CREATE = 'customer_create'.freeze, @@ -132,6 +138,8 @@ def self.from_value(value, default_value = BILLING_DATE_CHANGE) case str.downcase when 'billing_date_change' then BILLING_DATE_CHANGE when 'component_allocation_change' then COMPONENT_ALLOCATION_CHANGE + when 'chjs_tokenization_failure' then CHJS_TOKENIZATION_FAILURE + when 'chjs_tokenization_success' then CHJS_TOKENIZATION_SUCCESS when 'customer_create' then CUSTOMER_CREATE when 'customer_update' then CUSTOMER_UPDATE when 'dunning_step_reached' then DUNNING_STEP_REACHED diff --git a/lib/advanced_billing/utilities/union_type_lookup.rb b/lib/advanced_billing/utilities/union_type_lookup.rb index 7153bb6..835f1bb 100644 --- a/lib/advanced_billing/utilities/union_type_lookup.rb +++ b/lib/advanced_billing/utilities/union_type_lookup.rb @@ -633,7 +633,9 @@ def self.union_types LeafType.new(PrepaymentAccountBalanceChanged), LeafType.new(PaymentCollectionMethodChanged), LeafType.new(ItemPricePointChanged), - LeafType.new(CustomFieldValueChange) + LeafType.new(CustomFieldValueChange), + LeafType.new(ChjsTokenizationSuccess), + LeafType.new(ChjsTokenizationFailure) ], UnionTypeContext.new( is_nullable: true @@ -697,7 +699,7 @@ def self.union_types ) ), - :PaymentProfile => AnyOf.new( + :PaymentProfile2 => AnyOf.new( [ LeafType.new(ApplePayPaymentProfile, UnionTypeContext.new( discriminator_value: 'apple_pay', From 8ea84758213ac81f6ca6c9f690bda08133450478 Mon Sep 17 00:00:00 2001 From: lucassus Date: Thu, 11 Jun 2026 17:55:37 +0000 Subject: [PATCH 4/9] Automated commit message --- doc/models/chjs-tokenization-success.md | 2 +- .../containers/event-event-specific-data.md | 2 +- .../{payment-profile-2.md => payment-profile.md} | 2 +- ...t-profile.md => tokenized-payment-profile.md} | 12 ++++++------ lib/advanced_billing.rb | 2 +- .../models/chjs_tokenization_success.rb | 8 ++++---- .../models/payment_profile_response.rb | 6 +++--- ...t_profile.rb => tokenized_payment_profile.rb} | 16 ++++++++-------- .../utilities/union_type_lookup.rb | 2 +- 9 files changed, 26 insertions(+), 26 deletions(-) rename doc/models/containers/{payment-profile-2.md => payment-profile.md} (98%) rename doc/models/{payment-profile.md => tokenized-payment-profile.md} (62%) rename lib/advanced_billing/models/{payment_profile.rb => tokenized_payment_profile.rb} (87%) diff --git a/doc/models/chjs-tokenization-success.md b/doc/models/chjs-tokenization-success.md index e1e32d1..a098c0d 100644 --- a/doc/models/chjs-tokenization-success.md +++ b/doc/models/chjs-tokenization-success.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `payment_profile` | [`PaymentProfile`](../../doc/models/payment-profile.md) | Required | - | +| `payment_profile` | [`TokenizedPaymentProfile`](../../doc/models/tokenized-payment-profile.md) | Required | - | | `gateway_customer_id` | `Integer` | Optional | - | ## Example (as JSON) diff --git a/doc/models/containers/event-event-specific-data.md b/doc/models/containers/event-event-specific-data.md index 7aa1138..485d469 100644 --- a/doc/models/containers/event-event-specific-data.md +++ b/doc/models/containers/event-event-specific-data.md @@ -353,7 +353,7 @@ value = CustomFieldValueChange.new( ```ruby value = ChjsTokenizationSuccess.new( - payment_profile: PaymentProfile.new( + payment_profile: TokenizedPaymentProfile.new( id: 44 ) ) diff --git a/doc/models/containers/payment-profile-2.md b/doc/models/containers/payment-profile.md similarity index 98% rename from doc/models/containers/payment-profile-2.md rename to doc/models/containers/payment-profile.md index 4f6eaf7..a6e1290 100644 --- a/doc/models/containers/payment-profile-2.md +++ b/doc/models/containers/payment-profile.md @@ -1,5 +1,5 @@ -# Payment-Profile 2 +# Payment-Profile ## Data Type diff --git a/doc/models/payment-profile.md b/doc/models/tokenized-payment-profile.md similarity index 62% rename from doc/models/payment-profile.md rename to doc/models/tokenized-payment-profile.md index cd37b39..b030464 100644 --- a/doc/models/payment-profile.md +++ b/doc/models/tokenized-payment-profile.md @@ -1,9 +1,9 @@ -# Payment Profile +# Tokenized Payment Profile ## Structure -`PaymentProfile` +`TokenizedPaymentProfile` ## Fields @@ -18,10 +18,10 @@ ```json { - "id": 56, - "vault_token": "vault_token0", - "gateway_handle": "gateway_handle0", - "customer_vault_token": "customer_vault_token6" + "id": 72, + "vault_token": "vault_token2", + "gateway_handle": "gateway_handle8", + "customer_vault_token": "customer_vault_token8" } ``` diff --git a/lib/advanced_billing.rb b/lib/advanced_billing.rb index fe5eab6..d89c52b 100644 --- a/lib/advanced_billing.rb +++ b/lib/advanced_billing.rb @@ -361,7 +361,6 @@ require_relative 'advanced_billing/models/payment_profile_attributes' require_relative 'advanced_billing/models/payment_profile_response' require_relative 'advanced_billing/models/payment_related_events' -require_relative 'advanced_billing/models/payment_profile' require_relative 'advanced_billing/models/payment_profile_params' require_relative 'advanced_billing/models/pending_cancellation_change' require_relative 'advanced_billing/models/portal_management_link' @@ -526,6 +525,7 @@ require_relative 'advanced_billing/models/subscription_response' require_relative 'advanced_billing/models/subscription_state_change' require_relative 'advanced_billing/models/tax_configuration' +require_relative 'advanced_billing/models/tokenized_payment_profile' require_relative 'advanced_billing/models/too_many_management_link_requests' require_relative 'advanced_billing/models/update_allocation_expiration_date' require_relative 'advanced_billing/models/update_component' diff --git a/lib/advanced_billing/models/chjs_tokenization_success.rb b/lib/advanced_billing/models/chjs_tokenization_success.rb index 08fa3f5..88c79ba 100644 --- a/lib/advanced_billing/models/chjs_tokenization_success.rb +++ b/lib/advanced_billing/models/chjs_tokenization_success.rb @@ -10,7 +10,7 @@ class ChjsTokenizationSuccess < BaseModel private_constant :SKIP # TODO: Write general description for this method - # @return [PaymentProfile] + # @return [TokenizedPaymentProfile] attr_accessor :payment_profile # TODO: Write general description for this method @@ -55,7 +55,7 @@ def self.from_hash(hash) return nil unless hash # Extract variables from the hash. - payment_profile = PaymentProfile.from_hash(hash['payment_profile']) if + payment_profile = TokenizedPaymentProfile.from_hash(hash['payment_profile']) if hash['payment_profile'] gateway_customer_id = hash.key?('gateway_customer_id') ? hash['gateway_customer_id'] : SKIP @@ -74,14 +74,14 @@ def self.from_hash(hash) def self.validate(value) if value.instance_of? self return APIHelper.valid_type?(value.payment_profile, - ->(val) { PaymentProfile.validate(val) }, + ->(val) { TokenizedPaymentProfile.validate(val) }, is_model_hash: true) end return false unless value.instance_of? Hash APIHelper.valid_type?(value['payment_profile'], - ->(val) { PaymentProfile.validate(val) }, + ->(val) { TokenizedPaymentProfile.validate(val) }, is_model_hash: true) end diff --git a/lib/advanced_billing/models/payment_profile_response.rb b/lib/advanced_billing/models/payment_profile_response.rb index 3e31c66..4859524 100644 --- a/lib/advanced_billing/models/payment_profile_response.rb +++ b/lib/advanced_billing/models/payment_profile_response.rb @@ -45,7 +45,7 @@ def self.from_hash(hash) # Extract variables from the hash. payment_profile = hash.key?('payment_profile') ? APIHelper.deserialize_union_type( - UnionTypeLookUp.get(:PaymentProfile2), hash['payment_profile'] + UnionTypeLookUp.get(:PaymentProfile), hash['payment_profile'] ) : nil # Clean out expected properties from Hash. @@ -60,13 +60,13 @@ def self.from_hash(hash) # @param [PaymentProfileResponse | Hash] The value against the validation is performed. def self.validate(value) if value.instance_of? self - return UnionTypeLookUp.get(:PaymentProfile2) + return UnionTypeLookUp.get(:PaymentProfile) .validate(value.payment_profile) end return false unless value.instance_of? Hash - UnionTypeLookUp.get(:PaymentProfile2) + UnionTypeLookUp.get(:PaymentProfile) .validate(value['payment_profile']) end diff --git a/lib/advanced_billing/models/payment_profile.rb b/lib/advanced_billing/models/tokenized_payment_profile.rb similarity index 87% rename from lib/advanced_billing/models/payment_profile.rb rename to lib/advanced_billing/models/tokenized_payment_profile.rb index b3791f3..ba59acf 100644 --- a/lib/advanced_billing/models/payment_profile.rb +++ b/lib/advanced_billing/models/tokenized_payment_profile.rb @@ -4,8 +4,8 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # PaymentProfile Model. - class PaymentProfile < BaseModel + # TokenizedPaymentProfile Model. + class TokenizedPaymentProfile < BaseModel SKIP = Object.new private_constant :SKIP @@ -81,15 +81,15 @@ def self.from_hash(hash) additional_properties = hash.reject { |k, _| names.value?(k) } # Create object from extracted values. - PaymentProfile.new(id: id, - vault_token: vault_token, - gateway_handle: gateway_handle, - customer_vault_token: customer_vault_token, - additional_properties: additional_properties) + TokenizedPaymentProfile.new(id: id, + vault_token: vault_token, + gateway_handle: gateway_handle, + customer_vault_token: customer_vault_token, + additional_properties: additional_properties) end # Validates an instance of the object from a given value. - # @param [PaymentProfile | Hash] The value against the validation is performed. + # @param [TokenizedPaymentProfile | Hash] The value against the validation is performed. def self.validate(value) if value.instance_of? self return APIHelper.valid_type?(value.id, diff --git a/lib/advanced_billing/utilities/union_type_lookup.rb b/lib/advanced_billing/utilities/union_type_lookup.rb index 835f1bb..b4b8710 100644 --- a/lib/advanced_billing/utilities/union_type_lookup.rb +++ b/lib/advanced_billing/utilities/union_type_lookup.rb @@ -699,7 +699,7 @@ def self.union_types ) ), - :PaymentProfile2 => AnyOf.new( + :PaymentProfile => AnyOf.new( [ LeafType.new(ApplePayPaymentProfile, UnionTypeContext.new( discriminator_value: 'apple_pay', From 4309b2a5bcf74b1690196c214373f874b7b6eb28 Mon Sep 17 00:00:00 2001 From: lucassus Date: Fri, 12 Jun 2026 14:00:29 +0000 Subject: [PATCH 5/9] Automated commit message --- .../utilities/union_type_lookup.rb | 462 +++++++++--------- 1 file changed, 231 insertions(+), 231 deletions(-) diff --git a/lib/advanced_billing/utilities/union_type_lookup.rb b/lib/advanced_billing/utilities/union_type_lookup.rb index ee60c9f..b4b8710 100644 --- a/lib/advanced_billing/utilities/union_type_lookup.rb +++ b/lib/advanced_billing/utilities/union_type_lookup.rb @@ -221,17 +221,7 @@ def self.union_types ) ), - :AllocationPreviewItemQuantity => OneOf.new( - [ - LeafType.new(Integer), - LeafType.new(String) - ], - UnionTypeContext.new( - is_optional: true - ) - ), - - :AllocationPreviewItemPreviousQuantity => OneOf.new( + :AllocationQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -241,7 +231,7 @@ def self.union_types ) ), - :AllocationQuantity => OneOf.new( + :AllocationPreviousQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -251,7 +241,7 @@ def self.union_types ) ), - :AllocationPreviousQuantity => OneOf.new( + :AllocationPreviewItemQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -261,7 +251,7 @@ def self.union_types ) ), - :ComponentAllocationChangeAllocatedQuantity => OneOf.new( + :AllocationPreviewItemPreviousQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -306,37 +296,27 @@ def self.union_types ) ), - :CreateAllocationPricePointId => OneOf.new( + :ComponentAllocationChangeAllocatedQuantity => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( - is_optional: true, - is_nullable: true + is_optional: true ) ), - :CreateMultiInvoicePaymentAmount => OneOf.new( + :ComponentPricePointAssignmentPricePoint => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) - ] - ), - - :CustomerErrorResponseErrors => OneOf.new( - [ - LeafType.new(CustomerError), - LeafType.new(String, UnionTypeContext.new( - is_array: true - )) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :EBBComponentUnitPrice => OneOf.new( + :CouponPayloadPercentage => OneOf.new( [ LeafType.new(String), LeafType.new(Float) @@ -346,13 +326,14 @@ def self.union_types ) ), - :CouponPayloadPercentage => OneOf.new( + :CreateAllocationPricePointId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) + LeafType.new(Integer) ], UnionTypeContext.new( - is_optional: true + is_optional: true, + is_nullable: true ) ), @@ -363,6 +344,16 @@ def self.union_types ] ), + :CreateComponentPricePointsRequestPricePoints => AnyOf.new( + [ + LeafType.new(CreateComponentPricePoint), + LeafType.new(CreatePrepaidUsageComponentPricePoint) + ], + UnionTypeContext.new( + is_array: true + ) + ), + :CreateInvoiceCouponPercentage => OneOf.new( [ LeafType.new(String), @@ -393,81 +384,57 @@ def self.union_types ) ), - :CreateInvoicePaymentAmount => OneOf.new( + :CreateInvoiceItemQuantity => OneOf.new( [ - LeafType.new(String), - LeafType.new(Float) + LeafType.new(Float), + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :CreateMetafieldsRequestMetafields => OneOf.new( - [ - LeafType.new(CreateMetafield), - LeafType.new(CreateMetafield, UnionTypeContext.new( - is_array: true - )) - ] - ), - - :CreateOrUpdateSegmentPriceUnitPrice => OneOf.new( - [ - LeafType.new(String), - LeafType.new(Float) - ] - ), - - :CreateSegmentSegmentProperty1Value => OneOf.new( + :CreateInvoiceItemUnitPrice => OneOf.new( [ - LeafType.new(String), LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSegmentSegmentProperty2Value => OneOf.new( + :CreateInvoiceItemProductId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSegmentSegmentProperty3Value => OneOf.new( + :CreateInvoiceItemComponentId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSegmentSegmentProperty4Value => OneOf.new( + :CreateInvoiceItemPricePointId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :ComponentPricePointAssignmentPricePoint => OneOf.new( + :CreateInvoiceItemProductPricePointId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -477,90 +444,101 @@ def self.union_types ) ), - :CreateComponentPricePointsRequestPricePoints => AnyOf.new( + :CreateInvoicePaymentAmount => OneOf.new( [ - LeafType.new(CreateComponentPricePoint), - LeafType.new(CreatePrepaidUsageComponentPricePoint) + LeafType.new(String), + LeafType.new(Float) ], UnionTypeContext.new( - is_array: true + is_optional: true ) ), - :CreateInvoiceItemQuantity => OneOf.new( + :CreateMetafieldsRequestMetafields => OneOf.new( [ - LeafType.new(Float), - LeafType.new(String) - ], - UnionTypeContext.new( - is_optional: true - ) + LeafType.new(CreateMetafield), + LeafType.new(CreateMetafield, UnionTypeContext.new( + is_array: true + )) + ] ), - :CreateInvoiceItemUnitPrice => OneOf.new( + :CreateMultiInvoicePaymentAmount => OneOf.new( [ - LeafType.new(Float), - LeafType.new(String) - ], - UnionTypeContext.new( - is_optional: true - ) + LeafType.new(String), + LeafType.new(Float) + ] ), - :CreateInvoiceItemProductId => OneOf.new( + :CreateOrUpdateSegmentPriceUnitPrice => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float) + ] + ), + + :CreatePaymentProfileExpirationMonth => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemComponentId => OneOf.new( + :CreatePaymentProfileExpirationYear => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemPricePointId => OneOf.new( + :CreateSegmentSegmentProperty1Value => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float), + LeafType.new(Integer), + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemProductPricePointId => OneOf.new( + :CreateSegmentSegmentProperty2Value => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float), + LeafType.new(Integer), + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreatePaymentProfileExpirationMonth => OneOf.new( + :CreateSegmentSegmentProperty3Value => OneOf.new( [ + LeafType.new(String), + LeafType.new(Float), LeafType.new(Integer), - LeafType.new(String) + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreatePaymentProfileExpirationYear => OneOf.new( + :CreateSegmentSegmentProperty4Value => OneOf.new( [ + LeafType.new(String), + LeafType.new(Float), LeafType.new(Integer), - LeafType.new(String) + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true @@ -607,6 +585,18 @@ def self.union_types ) ), + :CustomerErrorResponseErrors => OneOf.new( + [ + LeafType.new(CustomerError), + LeafType.new(String, UnionTypeContext.new( + is_array: true + )) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + :DeductServiceCreditAmount => OneOf.new( [ LeafType.new(String), @@ -614,6 +604,16 @@ def self.union_types ] ), + :EBBComponentUnitPrice => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Float) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + :EventEventSpecificData => OneOf.new( [ LeafType.new(SubscriptionProductChange), @@ -672,6 +672,13 @@ def self.union_types ) ), + :OnOffComponentUnitPrice => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Float) + ] + ), + :PaymentProfileAttributesExpirationMonth => OneOf.new( [ LeafType.new(Integer), @@ -692,61 +699,106 @@ def self.union_types ) ), - :ReactivateSubscriptionRequestResume => OneOf.new( + :PaymentProfile => AnyOf.new( [ - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]), - LeafType.new(ResumeOptions) + LeafType.new(ApplePayPaymentProfile, UnionTypeContext.new( + discriminator_value: 'apple_pay', + discriminator: 'payment_type' + )), + LeafType.new(BankAccountPaymentProfile, UnionTypeContext.new( + discriminator_value: 'bank_account', + discriminator: 'payment_type' + )), + LeafType.new(CreditCardPaymentProfile, UnionTypeContext.new( + discriminator_value: 'credit_card', + discriminator: 'payment_type' + )), + LeafType.new(PaypalPaymentProfile, UnionTypeContext.new( + discriminator_value: 'paypal_account', + discriminator: 'payment_type' + )) + ] + ), + + :PrepaidUsageComponentUnitPrice => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Float) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionCustomPricePriceInCents => OneOf.new( + :PriceStartingQuantity => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) ] ), - :SubscriptionCustomPriceInterval => OneOf.new( + :PriceEndingQuantity => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true, + is_nullable: true + ) + ), + + :PriceUnitPrice => OneOf.new( + [ + LeafType.new(Float), + LeafType.new(String) ] ), - :SubscriptionCustomPriceTrialPriceInCents => OneOf.new( + :QuantityBasedComponentUnitPrice => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionCustomPriceTrialInterval => OneOf.new( + :ReactivateSubscriptionRequestResume => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]), + LeafType.new(ResumeOptions) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionCustomPriceInitialChargeInCents => OneOf.new( + :RefundConsolidatedInvoiceSegmentUids => OneOf.new( + [ + LeafType.new(String, UnionTypeContext.new( + is_array: true + )), + LeafType.new(String) + ] + ), + + :RefundInvoiceRequestRefund => AnyOf.new( + [ + LeafType.new(RefundInvoice), + LeafType.new(RefundConsolidatedInvoice) + ] + ), + + :RefundPrepaymentAmount => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) - ], - UnionTypeContext.new( - is_optional: true - ) + LeafType.new(Float) + ] ), - :SubscriptionCustomPriceExpirationInterval => OneOf.new( + :RenewalPreviewComponentComponentId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -756,7 +808,7 @@ def self.union_types ) ), - :SubscriptionGroupCreditCardFullNumber => OneOf.new( + :RenewalPreviewComponentPricePointId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -766,32 +818,31 @@ def self.union_types ) ), - :SubscriptionGroupCreditCardExpirationMonth => OneOf.new( + :ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem => OneOf.new( + [ + LeafType.new(ScheduledRenewalItemRequestBodyComponent), + LeafType.new(ScheduledRenewalItemRequestBodyProduct) + ] + ), + + :ScheduledRenewalProductPricePointPriceInCents => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) - ], - UnionTypeContext.new( - is_optional: true - ) + ] ), - :SubscriptionGroupCreditCardExpirationYear => OneOf.new( + :ScheduledRenewalProductPricePointInterval => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) - ], - UnionTypeContext.new( - is_optional: true - ) + ] ), - :RefundConsolidatedInvoiceSegmentUids => OneOf.new( + :ScheduledRenewalUpdateRequestRenewalConfigurationItem => OneOf.new( [ - LeafType.new(String, UnionTypeContext.new( - is_array: true - )), - LeafType.new(String) + LeafType.new(ScheduledRenewalItemRequestBodyComponent), + LeafType.new(ScheduledRenewalItemRequestBodyProduct) ] ), @@ -843,133 +894,89 @@ def self.union_types ) ), - :PaymentProfile => AnyOf.new( + :SubscriptionComponentAllocatedQuantity => OneOf.new( [ - LeafType.new(ApplePayPaymentProfile, UnionTypeContext.new( - discriminator_value: 'apple_pay', - discriminator: 'payment_type' - )), - LeafType.new(BankAccountPaymentProfile, UnionTypeContext.new( - discriminator_value: 'bank_account', - discriminator: 'payment_type' - )), - LeafType.new(CreditCardPaymentProfile, UnionTypeContext.new( - discriminator_value: 'credit_card', - discriminator: 'payment_type' - )), - LeafType.new(PaypalPaymentProfile, UnionTypeContext.new( - discriminator_value: 'paypal_account', - discriminator: 'payment_type' - )) - ] + LeafType.new(Integer), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) ), - :RefundPrepaymentAmount => OneOf.new( + :SubscriptionCustomPricePriceInCents => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) - ] - ), - - :ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem => OneOf.new( - [ - LeafType.new(ScheduledRenewalItemRequestBodyComponent), - LeafType.new(ScheduledRenewalItemRequestBodyProduct) + LeafType.new(Integer) ] ), - :ScheduledRenewalProductPricePointPriceInCents => OneOf.new( + :SubscriptionCustomPriceInterval => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) ] ), - :ScheduledRenewalProductPricePointInterval => OneOf.new( + :SubscriptionCustomPriceTrialPriceInCents => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) - ] - ), - - :SubscriptionComponentAllocatedQuantity => OneOf.new( - [ - LeafType.new(Integer), - LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionGroupCreateErrorResponseErrors => OneOf.new( - [ - LeafType.new(SubscriptionGroupMembersArrayError), - LeafType.new(SubscriptionGroupSingleError), - LeafType.new(String) - ] - ), - - :OnOffComponentUnitPrice => OneOf.new( + :SubscriptionCustomPriceTrialInterval => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) - ] + LeafType.new(Integer) + ], + UnionTypeContext.new( + is_optional: true + ) ), - :PrepaidUsageComponentUnitPrice => OneOf.new( + :SubscriptionCustomPriceInitialChargeInCents => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :PriceStartingQuantity => OneOf.new( - [ - LeafType.new(Integer), - LeafType.new(String) - ] - ), - - :PriceEndingQuantity => OneOf.new( + :SubscriptionCustomPriceExpirationInterval => OneOf.new( [ - LeafType.new(Integer), - LeafType.new(String) + LeafType.new(String), + LeafType.new(Integer) ], UnionTypeContext.new( - is_optional: true, - is_nullable: true + is_optional: true ) ), - :PriceUnitPrice => OneOf.new( + :SubscriptionGroupCreateErrorResponseErrors => OneOf.new( [ - LeafType.new(Float), + LeafType.new(SubscriptionGroupMembersArrayError), + LeafType.new(SubscriptionGroupSingleError), LeafType.new(String) ] ), - :QuantityBasedComponentUnitPrice => OneOf.new( + :SubscriptionGroupCreditCardFullNumber => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :RefundInvoiceRequestRefund => AnyOf.new( - [ - LeafType.new(RefundInvoice), - LeafType.new(RefundConsolidatedInvoice) - ] - ), - - :RenewalPreviewComponentComponentId => OneOf.new( + :SubscriptionGroupCreditCardExpirationMonth => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -979,7 +986,7 @@ def self.union_types ) ), - :RenewalPreviewComponentPricePointId => OneOf.new( + :SubscriptionGroupCreditCardExpirationYear => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -989,13 +996,6 @@ def self.union_types ) ), - :ScheduledRenewalUpdateRequestRenewalConfigurationItem => OneOf.new( - [ - LeafType.new(ScheduledRenewalItemRequestBodyComponent), - LeafType.new(ScheduledRenewalItemRequestBodyProduct) - ] - ), - :SubscriptionGroupSignupComponentComponentId => OneOf.new( [ LeafType.new(String), @@ -1036,19 +1036,21 @@ def self.union_types ) ), - :UpdatePriceEndingQuantity => OneOf.new( + :UpdateMetafieldsRequestMetafields => OneOf.new( [ - LeafType.new(Integer), - LeafType.new(String) + LeafType.new(UpdateMetafield), + LeafType.new(UpdateMetafield, UnionTypeContext.new( + is_array: true + )) ], UnionTypeContext.new( is_optional: true ) ), - :UpdatePriceUnitPrice => OneOf.new( + :UpdatePriceEndingQuantity => OneOf.new( [ - LeafType.new(Float), + LeafType.new(Integer), LeafType.new(String) ], UnionTypeContext.new( @@ -1056,9 +1058,9 @@ def self.union_types ) ), - :UpdatePriceStartingQuantity => OneOf.new( + :UpdatePriceUnitPrice => OneOf.new( [ - LeafType.new(Integer), + LeafType.new(Float), LeafType.new(String) ], UnionTypeContext.new( @@ -1066,12 +1068,10 @@ def self.union_types ) ), - :UpdateMetafieldsRequestMetafields => OneOf.new( + :UpdatePriceStartingQuantity => OneOf.new( [ - LeafType.new(UpdateMetafield), - LeafType.new(UpdateMetafield, UnionTypeContext.new( - is_array: true - )) + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( is_optional: true From 9484b9490a711a43a0a917637eb8f530dcb6c81a Mon Sep 17 00:00:00 2001 From: lucassus Date: Tue, 11 Aug 2026 20:52:04 +0000 Subject: [PATCH 6/9] Automated commit message --- .rubocop.yml | 4 + README.md | 96 ++--- advanced_billing.gemspec | 2 +- doc/controllers/advance-invoice.md | 4 +- doc/controllers/billing-portal.md | 2 +- doc/controllers/component-price-points.md | 6 +- doc/controllers/components.md | 28 +- doc/controllers/coupons.md | 20 +- doc/controllers/customers.md | 10 +- doc/controllers/events.md | 60 ++- doc/controllers/insights.md | 8 +- doc/controllers/invoices.md | 207 +++++++-- doc/controllers/payment-profiles.md | 8 +- doc/controllers/product-families.md | 13 +- doc/controllers/product-price-points.md | 4 +- doc/controllers/products.md | 2 + doc/controllers/proforma-invoices.md | 26 +- doc/controllers/sales-commissions.md | 8 +- doc/controllers/sites.md | 4 +- doc/controllers/subscription-components.md | 12 +- doc/controllers/subscription-groups.md | 6 +- doc/controllers/subscription-renewals.md | 6 +- doc/controllers/subscription-status.md | 4 +- doc/controllers/subscriptions.md | 89 +++- doc/controllers/webhooks.md | 10 +- doc/models/account-balance.md | 16 +- doc/models/account-balances.md | 64 +-- doc/models/ach-agreement.md | 18 +- doc/models/activate-event-based-component.md | 56 +-- doc/models/activate-subscription-request.md | 12 +- doc/models/add-coupons-request.md | 14 +- doc/models/add-subscription-to-a-group.md | 32 +- doc/models/address-change.md | 38 +- doc/models/agreement-acceptance.md | 20 +- doc/models/all-vaults.md | 6 + doc/models/allocate-components.md | 46 +- doc/models/allocation-expiration-date.md | 10 +- doc/models/allocation-preview-direction.md | 6 + doc/models/allocation-preview-item.md | 20 +- .../allocation-preview-line-item-kind.md | 6 + doc/models/allocation-preview-line-item.md | 24 +- doc/models/allocation-preview-response.md | 24 +- doc/models/allocation-preview.md | 20 +- doc/models/allocation-response.md | 24 +- doc/models/allocation-settings.md | 16 +- doc/models/allocation.md | 30 +- doc/models/apple-pay-payment-profile.md | 24 +- doc/models/apple-pay-vault.md | 6 + doc/models/applied-credit-note-data.md | 12 +- doc/models/apply-credit-note-event-data.md | 52 +-- doc/models/apply-credit-note-event.md | 86 ++-- doc/models/apply-debit-note-event-data.md | 22 +- doc/models/apply-debit-note-event.md | 54 +-- doc/models/apply-payment-event-data.md | 36 +- doc/models/apply-payment-event.md | 68 +-- doc/models/attribute-error.md | 17 +- doc/models/auto-invite.md | 6 + doc/models/auto-resume.md | 10 +- doc/models/available-actions.md | 18 +- doc/models/backport-invoice-event.md | 60 +-- doc/models/bank-account-attributes.md | 24 +- doc/models/bank-account-holder-type.md | 6 + doc/models/bank-account-payment-profile.md | 33 +- doc/models/bank-account-response.md | 28 +- doc/models/bank-account-type.md | 6 + doc/models/bank-account-vault.md | 6 + .../bank-account-verification-request.md | 18 +- doc/models/bank-account-verification.md | 12 +- doc/models/base-refund-error.md | 27 +- doc/models/base-string-error.md | 13 +- doc/models/basic-date-field.md | 4 +- doc/models/batch-job-response.md | 24 +- doc/models/batch-job.md | 20 +- doc/models/billing-manifest-item.md | 20 +- doc/models/billing-manifest-line-item-kind.md | 6 + doc/models/billing-manifest.md | 62 +-- doc/models/billing-schedule.md | 10 +- doc/models/breakouts.md | 18 +- .../bulk-components-price-point-assignment.md | 20 +- ...ulk-create-product-price-points-request.md | 36 +- ...lk-create-product-price-points-response.md | 26 +- doc/models/bulk-create-segments.md | 106 +++-- doc/models/bulk-update-segments-item.md | 26 +- doc/models/bulk-update-segments.md | 90 ++-- doc/models/calendar-billing.md | 14 +- .../cancel-grouped-subscriptions-request.md | 10 +- doc/models/cancellation-method.md | 6 + doc/models/cancellation-options.md | 20 +- doc/models/cancellation-request.md | 24 +- doc/models/card-type.md | 6 + .../change-chargeback-status-event-data.md | 10 +- doc/models/change-chargeback-status-event.md | 44 +- ...ge-invoice-collection-method-event-data.md | 12 +- .../change-invoice-collection-method-event.md | 46 +- .../change-invoice-status-event-data.md | 20 +- doc/models/change-invoice-status-event.md | 52 +-- doc/models/chargeback-status.md | 6 + doc/models/chargify-ebb.md | 20 +- doc/models/chjs-tokenization-failure.md | 22 +- doc/models/chjs-tokenization-success.md | 24 +- doc/models/cleanup-scope.md | 6 + .../clone-component-price-point-request.md | 18 +- doc/models/clone-component-price-point.md | 12 +- doc/models/collection-method-1.md | 21 + doc/models/collection-method.md | 6 + doc/models/component-allocation-change.md | 24 +- .../component-allocation-error-exception.md | 33 +- doc/models/component-allocation-error-item.md | 18 +- doc/models/component-cost-data-rate-tier.md | 20 +- doc/models/component-cost-data.md | 20 +- doc/models/component-currency-price.md | 20 +- .../component-currency-prices-response.md | 26 +- doc/models/component-custom-price.md | 36 +- doc/models/component-kind.md | 6 + .../component-price-point-assignment.md | 12 +- ...t-price-point-currency-overage-response.md | 24 +- .../component-price-point-error-exception.md | 25 +- .../component-price-point-error-item.md | 16 +- doc/models/component-price-point-item.md | 20 +- doc/models/component-price-point-response.md | 24 +- doc/models/component-price-point.md | 22 +- doc/models/component-price-points-response.md | 52 +-- doc/models/component-price.md | 20 +- doc/models/component-response.md | 26 +- doc/models/component.md | 33 +- doc/models/compounding-strategy.md | 6 + doc/models/consolidated-invoice.md | 33 +- ...ate-subscription-component-unit-balance.md | 34 ++ .../containers/event-event-specific-data.md | 22 +- ...-one-time-token-request-payment-profile.md | 69 +++ .../list-subscriptions-input-product.md | 34 ++ .../metered-usage-new-unit-balance.md | 34 ++ .../prepaid-usage-new-overage-unit-balance.md | 34 ++ .../prepaid-usage-new-unit-balance.md | 34 ++ .../subscription-component-unit-balance.md | 34 ++ .../update-invoice-item-component-id.md | 34 ++ .../update-invoice-item-price-point-id.md | 34 ++ .../update-invoice-item-product-id.md | 34 ++ ...ate-invoice-item-product-price-point-id.md | 34 ++ .../update-invoice-item-quantity.md | 34 ++ .../update-invoice-item-unit-price.md | 34 ++ doc/models/contract.md | 28 +- doc/models/count-response.md | 10 +- doc/models/coupon-currency-request.md | 20 +- doc/models/coupon-currency-response.md | 48 +-- doc/models/coupon-currency.md | 18 +- doc/models/coupon-payload.md | 22 +- doc/models/coupon-request.md | 38 +- doc/models/coupon-response.md | 24 +- doc/models/coupon-restriction.md | 20 +- doc/models/coupon-subcodes-response.md | 26 +- doc/models/coupon-subcodes.md | 16 +- doc/models/coupon-usage.md | 26 +- doc/models/coupon.md | 20 +- doc/models/create-allocation-request.md | 26 +- doc/models/create-allocation.md | 24 +- .../create-component-price-point-request.md | 40 +- doc/models/create-component-price-point.md | 38 +- .../create-component-price-points-request.md | 110 ++--- doc/models/create-credit-note-event.md | 52 +-- doc/models/create-currency-price.md | 16 +- doc/models/create-currency-prices-request.md | 22 +- doc/models/create-customer-request.md | 30 +- doc/models/create-customer.md | 30 +- doc/models/create-debit-note-event.md | 52 +-- doc/models/create-ebb-component.md | 58 +-- doc/models/create-invoice-address.md | 20 +- doc/models/create-invoice-coupon.md | 20 +- doc/models/create-invoice-item.md | 20 +- .../create-invoice-payment-application.md | 12 +- doc/models/create-invoice-payment-request.md | 26 +- doc/models/create-invoice-payment.md | 20 +- doc/models/create-invoice-request.md | 68 +-- doc/models/create-invoice-status.md | 4 +- doc/models/create-invoice.md | 49 ++- doc/models/create-metadata-request.md | 20 +- doc/models/create-metadata.md | 12 +- doc/models/create-metafield.md | 36 +- doc/models/create-metafields-request.md | 38 +- doc/models/create-metered-component.md | 100 ++--- .../create-multi-invoice-payment-request.md | 34 +- doc/models/create-multi-invoice-payment.md | 30 +- doc/models/create-offer-component.md | 16 +- doc/models/create-offer-request.md | 50 +-- doc/models/create-offer.md | 46 +- doc/models/create-on-off-component.md | 28 +- .../create-or-update-endpoint-request.md | 22 +- doc/models/create-or-update-endpoint.md | 16 +- .../create-or-update-product-request.md | 34 +- doc/models/create-or-update-product.md | 41 +- doc/models/create-or-update-segment-price.md | 16 +- doc/models/create-payment-profile-request.md | 26 +- doc/models/create-payment-profile.md | 40 +- doc/models/create-payment.md | 18 +- doc/models/create-prepaid-component.md | 60 +-- ...ate-prepaid-usage-component-price-point.md | 64 +-- doc/models/create-prepayment-method.md | 8 +- doc/models/create-prepayment-request.md | 24 +- doc/models/create-prepayment-response.md | 24 +- doc/models/create-prepayment.md | 20 +- doc/models/create-product-currency-price.md | 16 +- .../create-product-currency-prices-request.md | 22 +- doc/models/create-product-family-request.md | 21 +- doc/models/create-product-family.md | 16 +- .../create-product-price-point-request.md | 34 +- doc/models/create-product-price-point.md | 38 +- doc/models/create-quantity-based-component.md | 50 +-- doc/models/create-reason-code-request.md | 20 +- doc/models/create-reason-code.md | 16 +- doc/models/create-segment-request.md | 56 +-- doc/models/create-segment.md | 52 +-- .../create-signup-proforma-preview-include.md | 4 +- doc/models/create-subscription-component.md | 20 +- .../create-subscription-group-request.md | 16 +- doc/models/create-subscription-group.md | 14 +- doc/models/create-subscription-request.md | 54 +-- doc/models/create-subscription.md | 55 +-- doc/models/create-usage-request.md | 64 +-- doc/models/create-usage.md | 60 +-- doc/models/created-prepayment.md | 20 +- doc/models/credit-account-balance-changed.md | 20 +- doc/models/credit-card-attributes.md | 16 +- doc/models/credit-card-payment-profile.md | 56 +-- doc/models/credit-card-vault.md | 6 + doc/models/credit-note-application.md | 20 +- doc/models/credit-note-line-item.md | 20 +- doc/models/credit-note-status.md | 6 + doc/models/credit-note.md | 32 +- doc/models/credit-scheme-request.md | 10 +- doc/models/credit-scheme.md | 6 + doc/models/credit-type.md | 6 + doc/models/currency-overage-prices.md | 22 +- doc/models/currency-price-role.md | 6 + doc/models/currency-price.md | 20 +- doc/models/currency-prices-response.md | 26 +- doc/models/custom-field-owner.md | 6 + doc/models/custom-field-value-change.md | 24 +- doc/models/customer-attributes.md | 49 +-- doc/models/customer-change.md | 178 ++++---- .../customer-changes-preview-response.md | 182 ++++---- doc/models/customer-custom-fields-change.md | 42 +- .../customer-error-response-exception.md | 16 +- doc/models/customer-error.md | 10 +- doc/models/customer-payer-change.md | 34 +- doc/models/customer-response.md | 24 +- doc/models/customer.md | 36 +- doc/models/debit-note-role.md | 6 + doc/models/debit-note-status.md | 6 + doc/models/debit-note.md | 24 +- doc/models/deduct-service-credit-request.md | 18 +- doc/models/deduct-service-credit.md | 12 +- doc/models/delayed-cancellation-response.md | 10 +- .../delete-subscription-group-response.md | 12 +- .../deliver-proforma-invoice-request.md | 25 +- doc/models/direction.md | 6 + doc/models/discount-type.md | 6 + doc/models/downgrade-credit-credit-type.md | 6 + doc/models/dunner-data.md | 22 +- doc/models/dunning-step-data.md | 26 +- doc/models/dunning-step-reached.md | 66 +-- doc/models/ebb-component.md | 75 ++-- doc/models/ebb-event.md | 32 +- doc/models/enable-webhooks-request.md | 10 +- doc/models/enable-webhooks-response.md | 10 +- doc/models/endpoint-response.md | 26 +- doc/models/endpoint.md | 23 +- .../error-array-map-response-exception.md | 19 +- doc/models/error-list-response-exception.md | 18 +- .../error-string-map-response-exception.md | 17 +- doc/models/errors.md | 24 +- ...-billing-list-segments-errors-exception.md | 25 +- .../event-based-billing-segment-error.md | 22 +- ...-based-billing-segment-errors-exception.md | 27 +- .../event-based-billing-segment-exception.md | 21 +- doc/models/event-key.md | 7 + doc/models/event-response.md | 46 +- doc/models/event.md | 46 +- doc/models/expiration-interval-unit.md | 6 + doc/models/failed-payment-action.md | 8 +- doc/models/failed-payment-event-data.md | 20 +- doc/models/failed-payment-event.md | 52 +-- doc/models/first-charge-type.md | 6 + .../full-subscription-group-response.md | 26 +- ...time-token-bank-account-payment-profile.md | 64 +++ .../get-one-time-token-payment-profile.md | 52 +-- doc/models/get-one-time-token-request.md | 60 +-- doc/models/group-billing.md | 16 +- doc/models/group-settings.md | 32 +- doc/models/group-status.md | 20 + doc/models/group-target-type.md | 6 + doc/models/group-target.md | 14 +- doc/models/group-type.md | 6 + doc/models/historic-usage.md | 16 +- doc/models/include-not-null.md | 4 +- doc/models/include-null-or-not-null.md | 4 +- doc/models/include-option.md | 6 + doc/models/interval-unit.md | 6 + doc/models/invoice-address.md | 20 +- doc/models/invoice-avatax-details.md | 20 +- doc/models/invoice-balance-item.md | 16 +- doc/models/invoice-consolidation-level.md | 8 +- doc/models/invoice-credit.md | 20 +- doc/models/invoice-custom-field.md | 20 +- doc/models/invoice-customer.md | 20 +- doc/models/invoice-date-field.md | 4 +- doc/models/invoice-debit.md | 20 +- doc/models/invoice-discount-breakout.md | 16 +- doc/models/invoice-discount-source-type.md | 6 + doc/models/invoice-discount-type.md | 6 + doc/models/invoice-discount.md | 20 +- doc/models/invoice-display-settings.md | 12 +- doc/models/invoice-event-payment-method.md | 6 + doc/models/invoice-event-type.md | 6 + doc/models/invoice-issued.md | 54 +-- .../invoice-line-item-component-cost-data.md | 40 +- doc/models/invoice-line-item-event-data.md | 20 +- .../invoice-line-item-pricing-detail.md | 12 +- doc/models/invoice-line-item.md | 30 +- doc/models/invoice-payer-change.md | 18 +- doc/models/invoice-payer.md | 20 +- doc/models/invoice-payment-application.md | 16 +- doc/models/invoice-payment-method-type.md | 6 + doc/models/invoice-payment-method.md | 20 +- doc/models/invoice-payment-type.md | 6 + doc/models/invoice-payment.md | 32 +- doc/models/invoice-pre-payment.md | 16 +- doc/models/invoice-previous-balance.md | 34 +- doc/models/invoice-refund.md | 20 +- doc/models/invoice-response.md | 32 +- doc/models/invoice-role.md | 6 + doc/models/invoice-seller.md | 30 +- doc/models/invoice-sort-field.md | 4 +- doc/models/invoice-status.md | 6 + doc/models/invoice-tax-breakout.md | 18 +- doc/models/invoice-tax-component-breakout.md | 20 +- doc/models/invoice-tax.md | 20 +- doc/models/invoice.md | 39 +- doc/models/issue-advance-invoice-request.md | 10 +- doc/models/issue-invoice-event-data.md | 20 +- doc/models/issue-invoice-event.md | 52 +-- doc/models/issue-invoice-request.md | 12 +- doc/models/issue-service-credit-request.md | 18 +- doc/models/issue-service-credit.md | 12 +- doc/models/item-category.md | 4 +- doc/models/item-price-point-changed.md | 38 +- doc/models/item-price-point-data.md | 16 +- doc/models/line-item-kind.md | 6 + doc/models/line-item-transaction-type.md | 6 + doc/models/list-components-filter.md | 12 +- .../list-components-price-points-include.md | 4 +- .../list-components-price-points-response.md | 26 +- doc/models/list-coupons-filter.md | 30 +- doc/models/list-credit-notes-response.md | 26 +- doc/models/list-events-date-field.md | 4 +- doc/models/list-invoice-events-response.md | 88 ++-- doc/models/list-invoices-response.md | 34 +- doc/models/list-metafields-response.md | 72 +++- doc/models/list-mrr-filter.md | 10 +- doc/models/list-mrr-response-result.md | 20 +- doc/models/list-mrr-response.md | 24 +- doc/models/list-offers-response.md | 47 +-- doc/models/list-prepayment-date-field.md | 4 +- doc/models/list-prepayments-filter.md | 16 +- doc/models/list-price-points-filter.md | 32 +- .../list-product-price-points-response.md | 26 +- doc/models/list-products-filter.md | 18 +- doc/models/list-products-include.md | 4 +- .../list-products-price-points-include.md | 4 +- doc/models/list-proforma-invoices-meta.md | 18 +- doc/models/list-proforma-invoices-response.md | 66 +-- doc/models/list-public-keys-meta.md | 18 +- doc/models/list-public-keys-response.md | 44 +- doc/models/list-sale-rep-item.md | 50 +-- doc/models/list-segments-filter.md | 18 +- doc/models/list-segments-response.md | 26 +- doc/models/list-service-credits-response.md | 33 +- .../list-subscription-components-filter.md | 16 +- ...subscription-components-for-site-filter.md | 36 +- .../list-subscription-components-include.md | 4 +- .../list-subscription-components-response.md | 26 +- .../list-subscription-components-sort.md | 4 +- ...ist-subscription-group-prepayment-item.md} | 22 +- ...-subscription-group-prepayment-response.md | 30 +- .../list-subscription-group-prepayment.md | 28 +- doc/models/list-subscription-groups-item.md | 24 +- doc/models/list-subscription-groups-meta.md | 12 +- .../list-subscription-groups-response.md | 57 ++- doc/models/metadata.md | 20 +- doc/models/metafield-input.md | 8 +- doc/models/metafield-scope.md | 20 +- doc/models/metafield.md | 34 +- doc/models/metered-component.md | 83 ++-- doc/models/metered-usage.md | 24 +- doc/models/movement-line-item.md | 20 +- doc/models/movement.md | 20 +- doc/models/mrr-movement.md | 18 +- doc/models/mrr-response.md | 34 +- doc/models/mrr.md | 30 +- doc/models/multi-invoice-payment-response.md | 52 +-- doc/models/multi-invoice-payment.md | 28 +- doc/models/nested-subscription-group.md | 18 +- doc/models/net-terms.md | 20 +- doc/models/offer-discount.md | 16 +- doc/models/offer-item.md | 20 +- doc/models/offer-response.md | 24 +- doc/models/offer-signup-page.md | 20 +- doc/models/offer.md | 20 +- doc/models/ok-response.md | 10 +- doc/models/on-off-component.md | 33 +- doc/models/organization-address.md | 20 +- doc/models/origin-invoice.md | 12 +- doc/models/overage-pricing.md | 34 +- doc/models/override-subscription-request.md | 24 +- doc/models/override-subscription.md | 20 +- doc/models/paginated-metadata.md | 55 +-- doc/models/paid-invoice.md | 18 +- doc/models/pause-request.md | 16 +- doc/models/pay-pal-vault.md | 6 + doc/models/payer-attributes.md | 28 +- doc/models/payer-error.md | 29 +- .../payment-collection-method-changed.md | 12 +- doc/models/payment-for-allocation.md | 18 +- doc/models/payment-method-apple-pay.md | 10 +- doc/models/payment-method-bank-account.md | 16 +- doc/models/payment-method-credit-card.md | 20 +- doc/models/payment-method-external.md | 18 +- doc/models/payment-method-paypal.md | 12 +- doc/models/payment-profile-attributes.md | 42 +- doc/models/payment-profile-params.md | 16 +- doc/models/payment-profile-response.md | 26 +- doc/models/payment-related-events.md | 12 +- doc/models/payment-type.md | 6 + doc/models/paypal-payment-profile.md | 22 +- doc/models/pending-cancellation-change.md | 12 +- doc/models/portal-management-link.md | 20 +- doc/models/prepaid-configuration-response.md | 24 +- doc/models/prepaid-configuration.md | 20 +- .../prepaid-product-price-point-filter.md | 10 +- .../prepaid-subscription-balance-changed.md | 18 +- doc/models/prepaid-usage-allocation-detail.md | 16 +- doc/models/prepaid-usage-component.md | 70 ++-- doc/models/prepaid-usage.md | 44 +- .../prepayment-account-balance-changed.md | 18 +- doc/models/prepayment-method.md | 6 + doc/models/prepayment-response.md | 34 +- doc/models/prepayment.md | 30 +- doc/models/prepayments-response.md | 72 ++-- doc/models/preview-allocations-request.md | 34 +- doc/models/price-point-type.md | 6 + doc/models/price.md | 16 +- doc/models/pricing-scheme.md | 6 + doc/models/product-family-response.md | 24 +- doc/models/product-family.md | 19 +- ...ct-price-point-error-response-exception.md | 34 +- doc/models/product-price-point-errors.md | 38 +- doc/models/product-price-point-response.md | 24 +- doc/models/product-price-point.md | 26 +- doc/models/product-response.md | 24 +- doc/models/product.md | 33 +- ...ma-bad-request-error-response-exception.md | 21 +- doc/models/proforma-error.md | 20 +- doc/models/proforma-invoice-credit.md | 18 +- .../proforma-invoice-discount-source-type.md | 6 + doc/models/proforma-invoice-discount.md | 20 +- doc/models/proforma-invoice-issued.md | 46 +- doc/models/proforma-invoice-payment.md | 18 +- doc/models/proforma-invoice-role.md | 8 +- doc/models/proforma-invoice-status.md | 6 + .../proforma-invoice-tax-source-type.md | 6 + doc/models/proforma-invoice-tax.md | 20 +- doc/models/proforma-invoice.md | 24 +- doc/models/proration.md | 10 +- doc/models/public-key.md | 16 +- doc/models/public-signup-page.md | 20 +- doc/models/q-scope.md | 25 ++ doc/models/quantity-based-component.md | 52 ++- .../reactivate-subscription-group-request.md | 12 +- .../reactivate-subscription-group-response.md | 25 +- doc/models/reactivate-subscription-request.md | 26 +- doc/models/reactivation-billing.md | 14 +- doc/models/reactivation-charge.md | 8 +- doc/models/reason-code-response.md | 24 +- doc/models/reason-code.md | 20 +- doc/models/record-payment-request.md | 22 +- doc/models/record-payment-response.md | 46 +- doc/models/recurring-scheme.md | 6 + doc/models/referral-code.md | 18 +- doc/models/referral-validation-response.md | 22 +- doc/models/refund-consolidated-invoice.md | 27 +- doc/models/refund-invoice-event-data.md | 42 +- doc/models/refund-invoice-event.md | 72 ++-- doc/models/refund-invoice-request.md | 26 +- doc/models/refund-invoice.md | 26 +- ...epayment-base-errors-response-exception.md | 23 +- .../refund-prepayment-base-refund-error.md | 21 +- doc/models/refund-prepayment-request.md | 22 +- doc/models/refund-prepayment.md | 18 +- doc/models/refund-success.md | 16 +- doc/models/register.md | 18 +- doc/models/remove-payment-event-data.md | 28 +- doc/models/remove-payment-event.md | 60 +-- doc/models/renewal-preview-component.md | 16 +- doc/models/renewal-preview-line-item.md | 20 +- doc/models/renewal-preview-request.md | 41 +- doc/models/renewal-preview-response.md | 24 +- doc/models/renewal-preview.md | 20 +- doc/models/replay-webhooks-request.md | 16 +- doc/models/replay-webhooks-response.md | 10 +- doc/models/resent-invitation.md | 22 +- doc/models/resource-type.md | 6 + doc/models/restriction-type.md | 6 + doc/models/resume-options.md | 12 +- doc/models/resumption-charge.md | 6 + doc/models/revoked-invitation.md | 16 +- doc/models/sale-rep-item-mrr.md | 16 +- doc/models/sale-rep-settings.md | 20 +- doc/models/sale-rep-subscription.md | 20 +- doc/models/sale-rep.md | 48 +-- ...cheduled-renewal-component-custom-price.md | 28 +- ...uled-renewal-configuration-item-request.md | 54 +-- ...led-renewal-configuration-item-response.md | 24 +- .../scheduled-renewal-configuration-item.md | 20 +- ...uled-renewal-configuration-request-body.md | 20 +- ...scheduled-renewal-configuration-request.md | 24 +- ...cheduled-renewal-configuration-response.md | 24 +- doc/models/scheduled-renewal-configuration.md | 20 +- ...heduled-renewal-configurations-response.md | 47 +-- ...led-renewal-item-request-body-component.md | 52 +-- ...duled-renewal-item-request-body-product.md | 40 +- .../scheduled-renewal-lock-in-request.md | 10 +- .../scheduled-renewal-product-price-point.md | 28 +- .../scheduled-renewal-update-request.md | 54 +-- doc/models/segment-price.md | 20 +- doc/models/segment-response.md | 24 +- doc/models/segment.md | 20 +- doc/models/send-email.md | 12 +- doc/models/send-invoice-request.md | 36 +- doc/models/service-credit-1.md | 20 +- doc/models/service-credit-response.md | 24 +- doc/models/service-credit-type.md | 6 + doc/models/service-credit.md | 20 +- .../signup-proforma-preview-response.md | 42 +- doc/models/signup-proforma-preview.md | 38 +- doc/models/single-error-response-exception.md | 14 +- .../single-string-error-response-exception.md | 14 +- doc/models/site-response.md | 24 +- doc/models/site-statistics.md | 20 +- doc/models/site-summary.md | 32 +- doc/models/site.md | 20 +- doc/models/sorting-direction.md | 6 + doc/models/status.md | 6 + ...subscription-add-coupon-error-exception.md | 28 +- ...on-component-allocation-error-exception.md | 19 +- ...ription-component-allocation-error-item.md | 12 +- doc/models/subscription-component-response.md | 24 +- .../subscription-component-subscription.md | 14 +- doc/models/subscription-component.md | 26 +- doc/models/subscription-custom-price.md | 28 +- doc/models/subscription-date-field.md | 6 + doc/models/subscription-filter.md | 24 +- doc/models/subscription-group-balances.md | 50 +-- doc/models/subscription-group-bank-account.md | 24 +- ...bscription-group-component-custom-price.md | 73 ++-- ...n-group-create-error-response-exception.md | 18 +- doc/models/subscription-group-credit-card.md | 22 +- doc/models/subscription-group-customer.md | 20 +- doc/models/subscription-group-include.md | 6 + doc/models/subscription-group-item.md | 20 +- .../subscription-group-members-array-error.md | 12 +- .../subscription-group-payment-profile.md | 18 +- .../subscription-group-prepayment-method.md | 6 + .../subscription-group-prepayment-request.md | 22 +- .../subscription-group-prepayment-response.md | 20 +- doc/models/subscription-group-prepayment.md | 18 +- doc/models/subscription-group-response.md | 34 +- .../subscription-group-signup-component.md | 130 +++--- ...n-group-signup-error-response-exception.md | 63 +-- doc/models/subscription-group-signup-error.md | 92 ++-- .../subscription-group-signup-event-data.md | 50 +-- .../subscription-group-signup-failure-data.md | 32 +- doc/models/subscription-group-signup-item.md | 34 +- .../subscription-group-signup-request.md | 60 +-- .../subscription-group-signup-response.md | 26 +- doc/models/subscription-group-signup.md | 56 +-- doc/models/subscription-group-single-error.md | 10 +- .../subscription-group-subscription-error.md | 35 +- ...n-group-update-error-response-exception.md | 19 +- doc/models/subscription-group-update-error.md | 18 +- doc/models/subscription-group.md | 35 +- .../subscription-groups-list-include.md | 6 + doc/models/subscription-include.md | 6 + doc/models/subscription-included-coupon.md | 24 +- doc/models/subscription-list-date-field.md | 4 +- doc/models/subscription-list-include.md | 10 + .../subscription-migration-preview-options.md | 22 +- .../subscription-migration-preview-request.md | 26 +- ...subscription-migration-preview-response.md | 22 +- doc/models/subscription-migration-preview.md | 18 +- doc/models/subscription-mrr-breakout.md | 12 +- doc/models/subscription-mrr-response.md | 28 +- doc/models/subscription-mrr.md | 22 +- doc/models/subscription-note-response.md | 24 +- doc/models/subscription-note.md | 20 +- doc/models/subscription-preview-response.md | 96 ++--- doc/models/subscription-preview.md | 92 ++-- .../subscription-product-change-scheduled.md | 29 ++ doc/models/subscription-product-change.md | 12 +- .../subscription-product-migration-request.md | 26 +- doc/models/subscription-product-migration.md | 22 +- doc/models/subscription-purge-type.md | 6 + ...cription-remove-coupon-errors-exception.md | 16 +- .../subscription-response-error-exception.md | 20 +- doc/models/subscription-response.md | 24 +- doc/models/subscription-sort.md | 6 + doc/models/subscription-state-change.md | 12 +- doc/models/subscription-state-filter.md | 11 + doc/models/subscription-state.md | 6 + doc/models/subscription.md | 84 ++-- ...scriptions-mrr-error-response-exception.md | 18 +- doc/models/tax-configuration-kind.md | 6 + doc/models/tax-configuration.md | 16 +- doc/models/tax-destination-address.md | 6 + doc/models/tokenized-payment-profile.md | 18 +- ...anagement-link-requests-error-exception.md | 17 +- .../too-many-management-link-requests.md | 12 +- doc/models/trial-type.md | 8 +- .../update-allocation-expiration-date.md | 16 +- .../update-component-price-point-request.md | 24 +- doc/models/update-component-price-point.md | 20 +- doc/models/update-component-request.md | 26 +- doc/models/update-component.md | 27 +- doc/models/update-coupon-currency.md | 12 +- doc/models/update-currency-price.md | 12 +- doc/models/update-currency-prices-request.md | 20 +- doc/models/update-customer-request.md | 24 +- doc/models/update-customer.md | 26 +- doc/models/update-invoice-item.md | 40 ++ doc/models/update-invoice-request.md | 51 +++ doc/models/update-invoice.md | 50 +++ doc/models/update-metadata-request.md | 20 +- doc/models/update-metadata.md | 16 +- doc/models/update-metafield.md | 37 +- doc/models/update-metafields-request.md | 38 +- doc/models/update-payment-profile-request.md | 24 +- doc/models/update-payment-profile.md | 38 +- doc/models/update-price.md | 20 +- .../update-product-price-point-request.md | 18 +- doc/models/update-product-price-point.md | 12 +- doc/models/update-reason-code-request.md | 20 +- doc/models/update-reason-code.md | 16 +- doc/models/update-segment-request.md | 48 +-- doc/models/update-segment.md | 29 +- doc/models/update-subscription-component.md | 50 +-- .../update-subscription-group-request.md | 14 +- doc/models/update-subscription-group.md | 17 +- .../update-subscription-note-request.md | 18 +- doc/models/update-subscription-note.md | 12 +- doc/models/update-subscription-request.md | 36 +- doc/models/update-subscription.md | 39 +- doc/models/upgrade-charge-credit-type.md | 6 + .../upsert-prepaid-configuration-request.md | 22 +- doc/models/upsert-prepaid-configuration.md | 18 +- doc/models/usage-response.md | 24 +- doc/models/usage.md | 20 +- doc/models/void-invoice-event-data.md | 34 +- doc/models/void-invoice-event.md | 66 +-- doc/models/void-invoice-request.md | 16 +- doc/models/void-invoice.md | 10 +- doc/models/void-remainder-event-data.md | 30 +- doc/models/void-remainder-event.md | 62 +-- doc/models/webhook-order.md | 6 + doc/models/webhook-response.md | 24 +- doc/models/webhook-status.md | 6 + doc/models/webhook-subscription.md | 7 + doc/models/webhook.md | 22 +- lib/advanced_billing.rb | 13 +- .../controllers/advance_invoice_controller.rb | 6 +- .../controllers/base_controller.rb | 2 +- .../controllers/billing_portal_controller.rb | 2 +- .../component_price_points_controller.rb | 8 +- .../controllers/components_controller.rb | 46 +- .../controllers/coupons_controller.rb | 53 +-- .../controllers/customers_controller.rb | 6 + .../controllers/events_controller.rb | 62 ++- .../controllers/insights_controller.rb | 12 +- .../controllers/invoices_controller.rb | 221 +++++++--- .../payment_profiles_controller.rb | 20 +- .../product_families_controller.rb | 4 +- .../product_price_points_controller.rb | 28 +- .../controllers/products_controller.rb | 5 + .../proforma_invoices_controller.rb | 36 +- .../sales_commissions_controller.rb | 8 +- .../controllers/sites_controller.rb | 4 +- .../subscription_components_controller.rb | 18 +- .../subscription_groups_controller.rb | 10 +- .../subscription_renewals_controller.rb | 14 +- .../controllers/subscriptions_controller.rb | 155 ++++++- .../controllers/webhooks_controller.rb | 2 +- .../models/account_balances.rb | 4 +- .../models/activate_subscription_request.rb | 8 +- .../models/agreement_acceptance.rb | 10 +- .../models/allocate_components.rb | 2 +- lib/advanced_billing/models/allocation.rb | 16 +- .../models/allocation_preview_item.rb | 2 +- .../models/allocation_preview_line_item.rb | 2 +- .../models/apple_pay_payment_profile.rb | 2 +- .../models/apply_credit_note_event_data.rb | 2 +- .../models/bank_account_attributes.rb | 8 +- .../models/bank_account_payment_profile.rb | 42 +- .../models/calendar_billing.rb | 2 +- .../models/cancellation_options.rb | 2 +- lib/advanced_billing/models/chargify_ebb.rb | 4 +- .../models/collection_method1.rb | 40 ++ lib/advanced_billing/models/component.rb | 31 +- .../models/component_custom_price.rb | 6 +- .../models/component_price_point.rb | 6 +- .../models/component_price_point_item.rb | 2 +- lib/advanced_billing/models/coupon_payload.rb | 6 +- lib/advanced_billing/models/coupon_request.rb | 4 +- lib/advanced_billing/models/coupon_usage.rb | 8 +- .../models/create_allocation.rb | 4 +- .../models/create_component_price_point.rb | 2 +- .../models/create_customer.rb | 44 +- lib/advanced_billing/models/create_invoice.rb | 10 +- .../models/create_invoice_item.rb | 4 +- .../models/create_or_update_endpoint.rb | 2 +- .../create_or_update_endpoint_request.rb | 4 +- .../models/create_or_update_product.rb | 31 +- .../models/create_or_update_segment_price.rb | 2 +- .../models/create_payment_profile.rb | 30 +- ...ate_prepaid_usage_component_price_point.rb | 8 +- .../models/create_prepayment.rb | 4 +- .../models/create_prepayment_method.rb | 2 +- .../models/create_product_family.rb | 17 +- .../models/create_product_price_point.rb | 10 +- .../models/create_subscription.rb | 56 ++- .../models/create_subscription_component.rb | 6 +- .../models/credit_card_payment_profile.rb | 9 +- lib/advanced_billing/models/credit_note.rb | 12 +- .../models/credit_note_line_item.rb | 2 +- .../models/currency_overage_prices.rb | 6 +- lib/advanced_billing/models/customer.rb | 64 ++- .../models/customer_attributes.rb | 66 +-- lib/advanced_billing/models/debit_note.rb | 8 +- lib/advanced_billing/models/ebb_component.rb | 36 +- lib/advanced_billing/models/event.rb | 2 + lib/advanced_billing/models/event_key.rb | 5 + .../models/failed_payment_action.rb | 2 +- ...time_token_bank_account_payment_profile.rb | 393 ++++++++++++++++++ .../get_one_time_token_payment_profile.rb | 78 ++++ .../models/get_one_time_token_request.rb | 21 +- lib/advanced_billing/models/group_billing.rb | 2 +- lib/advanced_billing/models/group_settings.rb | 2 +- lib/advanced_billing/models/group_status.rb | 36 ++ lib/advanced_billing/models/group_target.rb | 4 +- lib/advanced_billing/models/historic_usage.rb | 4 +- lib/advanced_billing/models/invoice.rb | 46 +- .../models/invoice_consolidation_level.rb | 2 +- .../models/invoice_customer.rb | 2 +- .../models/invoice_line_item.rb | 14 +- .../models/issue_invoice_event_data.rb | 2 +- .../models/issue_invoice_request.rb | 2 +- .../list_subscription_group_prepayment.rb | 4 +- ...ist_subscription_group_prepayment_item.rb} | 24 +- .../models/metered_component.rb | 32 +- lib/advanced_billing/models/metered_usage.rb | 15 +- lib/advanced_billing/models/offer_item.rb | 2 +- .../models/on_off_component.rb | 29 +- lib/advanced_billing/models/pause_request.rb | 2 +- .../models/payment_profile_attributes.rb | 33 +- lib/advanced_billing/models/prepaid_usage.rb | 30 +- .../models/prepaid_usage_component.rb | 32 +- lib/advanced_billing/models/price.rb | 2 +- lib/advanced_billing/models/product.rb | 42 +- lib/advanced_billing/models/product_family.rb | 32 +- .../models/product_price_point.rb | 14 +- .../models/proforma_invoice.rb | 48 +-- .../models/proforma_invoice_role.rb | 2 +- .../models/public_signup_page.rb | 4 +- lib/advanced_billing/models/q_scope.rb | 56 +++ .../models/quantity_based_component.rb | 38 +- .../models/reactivate_subscription_request.rb | 2 +- .../models/reactivation_billing.rb | 9 +- .../models/reactivation_charge.rb | 8 +- .../models/refund_consolidated_invoice.rb | 2 +- lib/advanced_billing/models/refund_invoice.rb | 6 +- .../models/refund_invoice_event_data.rb | 4 +- lib/advanced_billing/models/register.rb | 2 +- .../models/renewal_preview_request.rb | 2 +- ...cheduled_renewal_component_custom_price.rb | 2 +- ...led_renewal_item_request_body_component.rb | 2 +- ...duled_renewal_item_request_body_product.rb | 2 +- .../scheduled_renewal_product_price_point.rb | 2 +- .../models/service_credit1.rb | 2 +- lib/advanced_billing/models/subscription.rb | 44 +- .../models/subscription_component.rb | 26 +- .../subscription_component_subscription.rb | 4 +- .../models/subscription_custom_price.rb | 2 +- .../models/subscription_group_bank_account.rb | 8 +- .../models/subscription_group_signup_item.rb | 6 +- .../models/subscription_list_include.rb | 26 +- .../subscription_product_change_scheduled.rb | 162 ++++++++ .../models/subscription_state_filter.rb | 21 + lib/advanced_billing/models/trial_type.rb | 2 +- .../models/update_component.rb | 24 +- .../models/update_component_price_point.rb | 2 +- .../models/update_customer.rb | 49 ++- lib/advanced_billing/models/update_invoice.rb | 185 +++++++++ .../models/update_invoice_item.rb | 242 +++++++++++ .../models/update_invoice_request.rb | 71 ++++ .../models/update_payment_profile.rb | 20 +- lib/advanced_billing/models/update_price.rb | 6 +- .../models/update_subscription.rb | 64 ++- lib/advanced_billing/models/webhook.rb | 7 +- .../models/webhook_subscription.rb | 5 + .../utilities/union_type_lookup.rb | 119 ++++++ 816 files changed, 12222 insertions(+), 8642 deletions(-) create mode 100644 doc/models/collection-method-1.md create mode 100644 doc/models/containers/create-subscription-component-unit-balance.md create mode 100644 doc/models/containers/get-one-time-token-request-payment-profile.md create mode 100644 doc/models/containers/list-subscriptions-input-product.md create mode 100644 doc/models/containers/metered-usage-new-unit-balance.md create mode 100644 doc/models/containers/prepaid-usage-new-overage-unit-balance.md create mode 100644 doc/models/containers/prepaid-usage-new-unit-balance.md create mode 100644 doc/models/containers/subscription-component-unit-balance.md create mode 100644 doc/models/containers/update-invoice-item-component-id.md create mode 100644 doc/models/containers/update-invoice-item-price-point-id.md create mode 100644 doc/models/containers/update-invoice-item-product-id.md create mode 100644 doc/models/containers/update-invoice-item-product-price-point-id.md create mode 100644 doc/models/containers/update-invoice-item-quantity.md create mode 100644 doc/models/containers/update-invoice-item-unit-price.md create mode 100644 doc/models/get-one-time-token-bank-account-payment-profile.md create mode 100644 doc/models/group-status.md rename doc/models/{list-subcription-group-prepayment-item.md => list-subscription-group-prepayment-item.md} (63%) create mode 100644 doc/models/q-scope.md create mode 100644 doc/models/subscription-product-change-scheduled.md create mode 100644 doc/models/update-invoice-item.md create mode 100644 doc/models/update-invoice-request.md create mode 100644 doc/models/update-invoice.md create mode 100644 lib/advanced_billing/models/collection_method1.rb create mode 100644 lib/advanced_billing/models/get_one_time_token_bank_account_payment_profile.rb create mode 100644 lib/advanced_billing/models/group_status.rb rename lib/advanced_billing/models/{list_subcription_group_prepayment_item.rb => list_subscription_group_prepayment_item.rb} (86%) create mode 100644 lib/advanced_billing/models/q_scope.rb create mode 100644 lib/advanced_billing/models/subscription_product_change_scheduled.rb create mode 100644 lib/advanced_billing/models/update_invoice.rb create mode 100644 lib/advanced_billing/models/update_invoice_item.rb create mode 100644 lib/advanced_billing/models/update_invoice_request.rb diff --git a/.rubocop.yml b/.rubocop.yml index b563c46..7e659c7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -21,6 +21,10 @@ Metrics/PerceivedComplexity: Layout/EndOfLine: Enabled: false + +Layout/EmptyLines: + Enabled: false + Lint/UnderscorePrefixedVariableName: Enabled: false diff --git a/README.md b/README.md index ce65978..cee7e1d 100644 --- a/README.md +++ b/README.md @@ -29,16 +29,16 @@ curl -u :x -H Accept:application/json -H Content-Type:application/json Install the gem from the command line: ```bash -gem install maxio-advanced-billing-sdk -v 9.1.0 +gem install maxio-advanced-billing-sdk -v 10.0.0 ``` Or add the gem to your Gemfile and run `bundle`: ```ruby -gem 'maxio-advanced-billing-sdk', '9.1.0' +gem 'maxio-advanced-billing-sdk', '10.0.0' ``` -For additional gem details, see the [RubyGems page for the maxio-advanced-billing-sdk gem](https://rubygems.org/gems/maxio-advanced-billing-sdk/versions/9.1.0). +For additional gem details, see the [RubyGems page for the maxio-advanced-billing-sdk gem](https://rubygems.org/gems/maxio-advanced-billing-sdk/versions/10.0.0). ## IRB Console Usage @@ -77,14 +77,14 @@ ruby bin/console ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/client.md) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | | site | `String` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | -| environment | [`Environment`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/README.md#environments) | The API environment.
**Default: `Environment.US`** | +| environment | [`Environment`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/README.md#environments) | The API environment.
**Default: `Environment.US`** | | connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests | | adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests | | timeout | `Float` | The value to use for connection timeout.
**Default: 120** | @@ -94,8 +94,8 @@ The following parameters are configurable for the API Client: | retry_statuses | `Array` | A list of HTTP statuses to retry.
**Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | | retry_methods | `Array` | A list of HTTP methods to retry.
**Default: %i[get put]** | | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. | -| proxy_settings | [`ProxySettings`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | -| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | +| proxy_settings | [`ProxySettings`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | +| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | The API client can be initialized as follows: @@ -125,7 +125,7 @@ include AdvancedBilling client = Client.from_env ``` -See the [`Environment-Based Client Initialization`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/environment-based-client-initialization.md) section for details. +See the [`Environment-Based Client Initialization`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/environment-based-client-initialization.md) section for details. ## Environments @@ -142,58 +142,58 @@ The SDK can be configured to use a different environment for making API calls. A This API uses the following authentication schemes. -* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/auth/basic-authentication.md) +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/auth/basic-authentication.md) ## List of APIs -* [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/api-exports.md) -* [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/advance-invoice.md) -* [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/billing-portal.md) -* [Component Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/component-price-points.md) -* [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/custom-fields.md) -* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/events-based-billing-segments.md) -* [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/payment-profiles.md) -* [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/product-families.md) -* [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/product-price-points.md) -* [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/proforma-invoices.md) -* [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/reason-codes.md) -* [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/referral-codes.md) -* [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/sales-commissions.md) -* [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-components.md) -* [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-groups.md) -* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-group-invoice-account.md) -* [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-group-status.md) -* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-invoice-account.md) -* [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-notes.md) -* [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-products.md) -* [Subscription Renewals](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-renewals.md) -* [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-status.md) -* [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/coupons.md) -* [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/components.md) -* [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/customers.md) -* [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/events.md) -* [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/insights.md) -* [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/invoices.md) -* [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/offers.md) -* [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/products.md) -* [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/sites.md) -* [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscriptions.md) -* [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/webhooks.md) +* [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/api-exports.md) +* [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/advance-invoice.md) +* [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/billing-portal.md) +* [Component Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/component-price-points.md) +* [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/custom-fields.md) +* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/events-based-billing-segments.md) +* [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/payment-profiles.md) +* [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/product-families.md) +* [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/product-price-points.md) +* [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/proforma-invoices.md) +* [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/reason-codes.md) +* [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/referral-codes.md) +* [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/sales-commissions.md) +* [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-components.md) +* [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-groups.md) +* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-group-invoice-account.md) +* [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-group-status.md) +* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-invoice-account.md) +* [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-notes.md) +* [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-products.md) +* [Subscription Renewals](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-renewals.md) +* [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-status.md) +* [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/coupons.md) +* [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/components.md) +* [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/customers.md) +* [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/events.md) +* [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/insights.md) +* [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/invoices.md) +* [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/offers.md) +* [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/products.md) +* [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/sites.md) +* [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscriptions.md) +* [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/webhooks.md) ## SDK Infrastructure ### Configuration -* [ProxySettings](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/proxy-settings.md) -* [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/environment-based-client-initialization.md) +* [ProxySettings](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/proxy-settings.md) +* [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/environment-based-client-initialization.md) ### HTTP -* [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/http-response.md) -* [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/http-request.md) +* [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/http-response.md) +* [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/http-request.md) ### Utilities -* [ApiHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/api-helper.md) -* [DateTimeHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/date-time-helper.md) +* [ApiHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/api-helper.md) +* [DateTimeHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/date-time-helper.md) diff --git a/advanced_billing.gemspec b/advanced_billing.gemspec index 7376f42..f0c5088 100644 --- a/advanced_billing.gemspec +++ b/advanced_billing.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'maxio-advanced-billing-sdk' - s.version = '9.1.0' + s.version = '10.0.0' s.summary = 'SDK for Maxio Advanced Billing' s.description = "Ultimate billing and pricing flexibility for B2B SaaS.\nMaxio integrates directly into your product, so you can seamlessly manage your product catalog, bill customers, and collect payments." s.authors = ['Maxio SDK'] diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index 201c712..fb90bb3 100644 --- a/doc/controllers/advance-invoice.md +++ b/doc/controllers/advance-invoice.md @@ -17,7 +17,7 @@ advance_invoice_controller = client.advance_invoice # Issue Advance Invoice -Generate an invoice in advance for a subscription's next renewal date. [See our docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility for generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided. +Issues an invoice in advance for a subscription's next renewal date. [See our docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility for generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided. A subscription may only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists will return an error. That said, regeneration of the invoice may be forced with the params `force: true`, which will void an advance invoice if one exists and generate a new one. If no advance invoice exists, a new one will be generated. We recommend using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it. @@ -110,7 +110,7 @@ puts result # Void Advance Invoice -Void a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. +Voids a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. A `reason` is required in order to void, and the invoice must have an open status. Voiding will cause any prepayments and credits that were applied to the invoice to be returned to the subscription. For a full overview of the impact of voiding, [see our help docs](../../doc/models/invoice.md). ```ruby diff --git a/doc/controllers/billing-portal.md b/doc/controllers/billing-portal.md index 8d9c8e8..746af4b 100644 --- a/doc/controllers/billing-portal.md +++ b/doc/controllers/billing-portal.md @@ -84,7 +84,7 @@ Returns the exact URL required for a subscriber to access the Billing Portal. + We will not generate a new URL for 15 days + You must cache and remember this URL if you are going to need it again within 15 days + Only request a new URL after the `new_link_available_at` date -+ You are limited to 15 requests for the same URL. If you make more than 15 requests before `new_link_available_at`, you will be blocked from further Management URL requests (with a response code `429`) ++ You are limited to 15 requests for the same URL. If you make more than 15 requests before `new_link_available_at`, you will be blocked from further Management URL requests (with a response code `429`). ```ruby def read_billing_portal_link(customer_id) diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index 5c90b46..00ca6aa 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -174,8 +174,6 @@ Lists the price points associated with a component. You may specify the component by using either the numeric id or the `handle:gold` syntax. -When fetching a component's price points, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. - If the price point is set to `use_site_exchange_rate: true`, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. ```ruby @@ -191,7 +189,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `component_id` | `Integer` | Template, Required | The Advanced Billing id of the component | -| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | Include an array of currency price data | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | Include an array of currency price data. | | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `filter_type` | [`Array[PricePointType]`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | @@ -632,7 +630,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `component_id` | Integer \| String | Template, Required | This is a container for one-of cases. | | `price_point_id` | Integer \| String | Template, Required | This is a container for one-of cases. | -| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | Include an array of currency price data | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | Include an array of currency price data. | ## Response Type diff --git a/doc/controllers/components.md b/doc/controllers/components.md index 8cd13e4..7bfbb67 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -32,8 +32,14 @@ Metered components are used to bill for any type of unit that resets to 0 at the Note that this is different from recurring quantity-based components, which DO NOT reset to zero at the start of every billing period. If you want to bill for a quantity of something that does not change unless you change it, then you want quantity components, instead. +#### Hybrid Pricing + +A `volume`, `tiered`, or `stairstep` metered component can combine its primary pricing with a secondary pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item instead of two. This does not apply to metered components configured for event-based billing (metric, meter, or formula). See [Hybrid Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and configuration details. + For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ruby def create_metered_component(product_family_id, body: nil) @@ -157,8 +163,14 @@ One-time quantity-based components are used to create ad hoc usage charges that The allocated quantity for one-time quantity-based components immediately gets reset back to zero after the allocation is made. +#### Hybrid Pricing + +A `volume`, `tiered`, or `stairstep` component can combine its primary pricing with a secondary pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item instead of two. See [Hybrid Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and configuration details. + For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ruby def create_quantity_based_component(product_family_id, body: nil) @@ -275,6 +287,8 @@ On/off components are used for any flat fee, recurring add on (think $99/month f For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ruby def create_on_off_component(product_family_id, body: nil) @@ -376,6 +390,8 @@ Prepaid components allow customers to pre-purchase units that can be used up ove For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ruby def create_prepaid_usage_component(product_family_id, body: nil) @@ -517,6 +533,8 @@ So, instead of reporting usage directly for each component (as you would with me For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ruby def create_event_based_component(product_family_id, body: nil) @@ -760,6 +778,8 @@ Updates a component from a specific product family. You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ruby def update_product_family_component(product_family_id, component_id, @@ -935,8 +955,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `start_date` | `String` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `end_date` | `String` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | | `start_datetime` | `String` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | -| `end_datetime` | `String` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional | -| `include_archived` | `TrueClass \| FalseClass` | Query, Optional | Include archived items | +| `end_datetime` | `String` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | +| `include_archived` | `TrueClass \| FalseClass` | Query, Optional | Include archived items. | | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `filter` | [`ListComponentsFilter`](../../doc/models/list-components-filter.md) | Query, Optional | Filter to use for List Components operations | @@ -1073,6 +1093,8 @@ Updates a component. You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ruby def update_component(component_id, body: nil) @@ -1173,7 +1195,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `filter` | [`ListComponentsFilter`](../../doc/models/list-components-filter.md) | Query, Optional | Filter to use for List Components operations | | `date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=created_at`. | | `end_date` | `String` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | -| `end_datetime` | `String` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional. | +| `end_datetime` | `String` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | | `start_date` | `String` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `start_datetime` | `String` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index 769e65f..8767410 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -30,11 +30,7 @@ coupons_controller = client.coupons Creates a coupon under the specified product family. -You can create either a flat amount coupon by specifying amount_in_cents, or a percentage coupon by specifying percentage -You can restrict a coupon to only apply to specific products / components by optionally passing in `restricted_products` and/or `restricted_components` objects in the format: -`{ "": boolean_value }` - -Coupons can be administered in the Advanced Billing application or created via API. See [creating coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creating-Editing-Deleting-Coupons) for more information. +You can create either a flat amount coupon, by specifying `amount_in_cents`, or percentage coupon by specifying `percentage`. See [Apply Coupons to Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions) for information on applying a coupon to a subscription in the Advanced Billing UI. @@ -123,7 +119,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `30`

**Constraints**: `<= 200` | | `filter` | [`ListCouponsFilter`](../../doc/models/list-coupons-filter.md) | Query, Optional | Filter to use for List Coupons operations | -| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. Use in query `currency_prices=true`. | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. Use in query `currency_prices=true`. | ## Response Type @@ -274,7 +270,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `product_family_id` | `Integer` | Query, Optional | The Advanced Billing id of the product family to which the coupon belongs | | `code` | `String` | Query, Optional | The code of the coupon | -| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. | ## Response Type @@ -297,8 +293,6 @@ puts result Returns a coupon by its Advanced Billing-assigned ID. You must identify the Coupon in this call by the ID parameter that Advanced Billing assigns. If instead you would like to find a Coupon using a Coupon code, see the Coupon Find method. -When fetching a coupon, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. - If the coupon is set to `use_site_exchange_rate: true`, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. ```ruby @@ -317,7 +311,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `product_family_id` | `Integer` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs | | `coupon_id` | `Integer` | Template, Required | The Advanced Billing id of the coupon | -| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. | ## Response Type @@ -567,7 +561,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `30`

**Constraints**: `<= 200` | | `filter` | [`ListCouponsFilter`](../../doc/models/list-coupons-filter.md) | Query, Optional | Filter to use for List Coupons operations | -| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. Use in query `currency_prices=true`. | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. Use in query `currency_prices=true`. | ## Response Type @@ -921,7 +915,7 @@ This request allows you to create specific subcodes underneath an existing coupo _ to %5F . to %2E -So, if the coupon subcode is `20%OFF`, the URL to delete this coupon subcode would be: `https://.chargify.com/coupons/567/codes/20%25OFF.` +So, if the coupon subcode is `20%OFF`, the URL to delete this coupon subcode would be: `https://.chargify.com/coupons/567/codes/20%25OFF.`. ```ruby def create_coupon_subcodes(coupon_id, @@ -1129,7 +1123,7 @@ Note: If you are using any of the allowed special characters (“%”, “@”, ## Percent Encoding Example -Or if the coupon subcode is 20%OFF, the URL to delete this coupon subcode would be: @https://.chargify.com/coupons/567/codes/20%25OFF. +Or if the coupon subcode is 20%OFF, the URL to delete this coupon subcode would be: @https://.chargify.com/coupons/567/codes/20%25OFF.. ```ruby def delete_coupon_subcode(coupon_id, diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index dff9ad5..0f04524 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -120,6 +120,7 @@ puts result "portal_invite_last_sent_at": null, "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "vat_number": null, "parent_id": null, "locale": "en-US" @@ -219,7 +220,8 @@ puts result "portal_customer_created_at": "2016-10-04T15:22:29-04:00", "portal_invite_last_sent_at": "2016-10-04T15:22:30-04:00", "portal_invite_last_accepted_at": null, - "tax_exempt": false + "tax_exempt": false, + "surcharging": false } }, { @@ -245,6 +247,7 @@ puts result "portal_invite_last_sent_at": "2016-10-13T16:52:54-04:00", "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": true, "parent_id": 123 } }, @@ -271,6 +274,7 @@ puts result "portal_invite_last_sent_at": "2016-10-19T10:49:19-04:00", "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "parent_id": null } } @@ -339,6 +343,7 @@ puts result "portal_invite_last_sent_at": null, "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "vat_number": null, "parent_id": null, "locale": "es-MX", @@ -421,6 +426,7 @@ puts result "portal_invite_last_sent_at": null, "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "vat_number": "012345678" } } @@ -505,6 +511,8 @@ puts result Lists all subscriptions that belong to a customer. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, subscriptions no longer require an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. + ```ruby def list_customer_subscriptions(customer_id) ``` diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 1dead8c..93bb000 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -23,7 +23,21 @@ Lists events for a site. Advanced Billing Events include various activity that happens around a Site. This information is **especially** useful to track down issues that arise when subscriptions are not created due to errors. -Within the Advanced Billing UI, "Events" are referred to as "Site Activity". Full documentation on how to view Events / Site Activity in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). +Within the Advanced Billing UI, "Events" are referred to as "Site Activity". See the [Site Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity) article in the product documentation for details on how to record view Events / Site Activty in the Advanced Billing UI. + +If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + +Event name changes: + +- subscription_product_change → subscription_plan_change +- component_allocation_change → allocation_change +- component_billing_date_change → product_billing_date_change + +Message updates: + +- “Plan changed on Subscription from previous plan to new plan” +- “Successful payment for allocation changes to Product on Subscription” +- “Failed payment for allocation changes to Product on Subscription” ## List Events for a Site @@ -59,7 +73,7 @@ Here’s an example event for the `subscription_product_change` event: "event": { "id": 351, "key": "subscription_product_change", - "message": "Product changed on Marky Mark's subscription from 'Basic' to 'Pro'", + "message": "Product changed on Mark Alan's subscription from 'Basic' to 'Pro'", "subscription_id": 205, "event_specific_data": { "new_product_id": 3, @@ -77,7 +91,7 @@ Here’s an example event for the `subscription_state_change` event: "event": { "id": 353, "key": "subscription_state_change", - "message": "State changed on Marky Mark's subscription to Pro from trialing to active", + "message": "State changed on Mark Alan's subscription to Pro from trialing to active", "subscription_id": 205, "event_specific_data": { "new_subscription_state": "active", @@ -102,8 +116,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | -| `since_id` | `Integer` | Query, Optional | Returns events with an id greater than or equal to the one specified | -| `max_id` | `Integer` | Query, Optional | Returns events with an id less than or equal to the one specified | +| `since_id` | `Integer` | Query, Optional | Returns events with an id greater than or equal to the one specified. | +| `max_id` | `Integer` | Query, Optional | Returns events with an id less than or equal to the one specified. | | `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `Direction::DESC` | | `filter` | [`Array[EventKey]`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | | `date_field` | [`ListEventsDateField`](../../doc/models/list-events-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | @@ -207,6 +221,20 @@ Lists events for a subscription. The event type is identified by the key property. You can check supported keys [here](../../doc/models/event-key.md). +If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + +Event name changes: + +- subscription_product_change → subscription_plan_change +- component_allocation_change → allocation_change +- component_billing_date_change → product_billing_date_change + +Message updates: + +- “Successful payment for allocation changes to Product on Subscription” +- “Failed payment for allocation changes to Product on Subscription” +- “Plan changed on Subscription from previous plan to new plan” + ## Event Specific Data Different event types may include additional data in `event_specific_data` property. @@ -228,8 +256,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription. | | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | -| `since_id` | `Integer` | Query, Optional | Returns events with an id greater than or equal to the one specified | -| `max_id` | `Integer` | Query, Optional | Returns events with an id less than or equal to the one specified | +| `since_id` | `Integer` | Query, Optional | Returns events with an id greater than or equal to the one specified. | +| `max_id` | `Integer` | Query, Optional | Returns events with an id less than or equal to the one specified. | | `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `Direction::DESC` | | `filter` | [`Array[EventKey]`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | @@ -305,6 +333,20 @@ puts result Returns the total count of events for a given site. +If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + +Event name changes: + +- subscription_product_change → subscription_plan_change +- component_allocation_change → allocation_change +- component_billing_date_change → product_billing_date_change + +Message updates: + +- “Successful payment for allocation changes to Product on Subscription” +- “Failed payment for allocation changes to Product on Subscription” +- “Plan changed on Subscription from previous plan to new plan” + ```ruby def read_events_count(options = {}) ``` @@ -319,8 +361,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | -| `since_id` | `Integer` | Query, Optional | Returns events with an id greater than or equal to the one specified | -| `max_id` | `Integer` | Query, Optional | Returns events with an id less than or equal to the one specified | +| `since_id` | `Integer` | Query, Optional | Returns events with an id greater than or equal to the one specified. | +| `max_id` | `Integer` | Query, Optional | Returns events with an id less than or equal to the one specified. | | `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `Direction::DESC` | | `filter` | [`Array[EventKey]`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | diff --git a/doc/controllers/insights.md b/doc/controllers/insights.md index 30f32ca..2c5a16d 100644 --- a/doc/controllers/insights.md +++ b/doc/controllers/insights.md @@ -88,8 +88,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `at_time` | `DateTime` | Query, Optional | submit a timestamp in ISO8601 format to request MRR for a historic time | -| `subscription_id` | `Integer` | Query, Optional | submit the id of a subscription in order to limit results | +| `at_time` | `DateTime` | Query, Optional | submit a timestamp in ISO8601 format to request MRR for a historic time. | +| `subscription_id` | `Integer` | Query, Optional | submit the id of a subscription in order to limit results. | ## Response Type @@ -166,7 +166,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `Integer` | Query, Optional | optionally filter results by subscription | +| `subscription_id` | `Integer` | Query, Optional | (Optional) Filter results by subscription. | | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 50; any per_page value over 50 will be changed to 50.
Use in query `per_page=20`.

**Default**: `10`

**Constraints**: `<= 50` | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | @@ -246,7 +246,7 @@ puts result **This endpoint is deprecated.** -This endpoint returns your site's current MRR, including plan and usage breakouts split per subscription. +Lists your site's current MRR, including plan and usage breakouts split per subscription. ```ruby def list_mrr_per_subscription(options = {}) diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index d2f76a2..a5148bd 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -23,6 +23,8 @@ invoices_controller = client.invoices * [Void Invoice](../../doc/controllers/invoices.md#void-invoice) * [List Consolidated Invoice Segments](../../doc/controllers/invoices.md#list-consolidated-invoice-segments) * [Create Invoice](../../doc/controllers/invoices.md#create-invoice) +* [Update Invoice](../../doc/controllers/invoices.md#update-invoice) +* [Delete Invoice](../../doc/controllers/invoices.md#delete-invoice) * [Send Invoice](../../doc/controllers/invoices.md#send-invoice) * [Preview Customer Information Changes](../../doc/controllers/invoices.md#preview-customer-information-changes) * [Update Customer Information](../../doc/controllers/invoices.md#update-customer-information) @@ -31,7 +33,7 @@ invoices_controller = client.invoices # Refund Invoice -Refund an invoice, segment, or consolidated invoice. +Refunds an invoice, segment, or consolidated invoice. ## Partial Refund for Consolidated Invoice @@ -93,7 +95,7 @@ puts result # List Invoices -By default, invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`, or `refunds`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. +Lists invoices for a site. By default, invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`, or `refunds`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. ```ruby def list_invoices(options = {}) @@ -116,13 +118,13 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.

**Default**: `Direction::DESC` | -| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data

**Default**: `false` | -| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data

**Default**: `false` | -| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data

**Default**: `false` | -| `credits` | `TrueClass \| FalseClass` | Query, Optional | Include credits data

**Default**: `false` | -| `payments` | `TrueClass \| FalseClass` | Query, Optional | Include payments data

**Default**: `false` | -| `custom_fields` | `TrueClass \| FalseClass` | Query, Optional | Include custom fields data

**Default**: `false` | -| `refunds` | `TrueClass \| FalseClass` | Query, Optional | Include refunds data

**Default**: `false` | +| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data.

**Default**: `false` | +| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data.

**Default**: `false` | +| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data.

**Default**: `false` | +| `credits` | `TrueClass \| FalseClass` | Query, Optional | Include credits data.

**Default**: `false` | +| `payments` | `TrueClass \| FalseClass` | Query, Optional | Include payments data.

**Default**: `false` | +| `custom_fields` | `TrueClass \| FalseClass` | Query, Optional | Include custom fields data.

**Default**: `false` | +| `refunds` | `TrueClass \| FalseClass` | Query, Optional | Include refunds data.

**Default**: `false` | | `date_field` | [`InvoiceDateField`](../../doc/models/invoice-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=issue_date`.

**Default**: `InvoiceDateField::DUE_DATE` | | `start_datetime` | `String` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Allowed to be used only along with date_field set to created_at or updated_at. | | `end_datetime` | `String` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Allowed to be used only along with date_field set to created_at or updated_at. | @@ -448,7 +450,7 @@ puts result # Read Invoice -Use this endpoint to retrieve the details for an invoice. +Returns the details for an invoice. ## PDF Invoice retrieval @@ -605,7 +607,7 @@ puts result # List Invoice Events -This endpoint returns a list of invoice events. Each event contains event "data" (such as an applied payment) as well as a snapshot of the `invoice` at the time of event completion. +Lists invoice events for a site. Each event contains event "data" (such as an applied payment) as well as a snapshot of the `invoice` at the time of event completion. Exposed event types are: @@ -1112,7 +1114,7 @@ puts result # Record Payment for Multiple Invoices -This API call should be used when you want to record an external payment against multiple invoices. +Records an external payment against multiple invoices. To apply a payment to multiple invoices, at minimum, specify the `amount` and `applications` (i.e., `invoice_uid` and `amount`) details. @@ -1218,7 +1220,7 @@ puts result # List Credit Notes -Credit Notes are like inverse invoices. They reduce the amount a customer owes. +Lists credit notes for a site. Credit Notes are like inverse invoices. They reduce the amount a customer owes. By default, the credit notes returned by this endpoint will exclude the arrays of `line_items`, `discounts`, `taxes`, `applications`, or `refunds`. To include these arrays, pass the specific field as a key in the query with a value set to `true`. @@ -1237,11 +1239,11 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `subscription_id` | `Integer` | Query, Optional | The subscription's Advanced Billing id | | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | -| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data

**Default**: `false` | -| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data

**Default**: `false` | -| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data

**Default**: `false` | -| `refunds` | `TrueClass \| FalseClass` | Query, Optional | Include refunds data

**Default**: `false` | -| `applications` | `TrueClass \| FalseClass` | Query, Optional | Include applications data

**Default**: `false` | +| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data.

**Default**: `false` | +| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data.

**Default**: `false` | +| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data.

**Default**: `false` | +| `refunds` | `TrueClass \| FalseClass` | Query, Optional | Include refunds data.

**Default**: `false` | +| `applications` | `TrueClass \| FalseClass` | Query, Optional | Include applications data.

**Default**: `false` | ## Response Type @@ -1576,7 +1578,7 @@ puts result # Read Credit Note -Use this endpoint to retrieve the details for a credit note. +Returns the details for a credit note. ```ruby def read_credit_note(uid) @@ -1925,7 +1927,7 @@ puts result # Record Payment for Subscription -Record an external payment made against a subscription that will pay partially or in full one or more invoices. +Records an external payment made against a subscription that will pay partially or in full one or more invoices. Payment will be applied starting with the oldest open invoice and then next oldest, and so on until the amount of the payment is fully consumed. @@ -2007,7 +2009,7 @@ puts result # Reopen Invoice -This endpoint allows you to reopen any invoice with the "canceled" status. Invoices enter "canceled" status if they were open at the time the subscription was canceled (whether through dunning or an intentional cancellation). +Reopens any invoice with the "canceled" status. Invoices enter "canceled" status if they were open at the time the subscription was canceled (whether through dunning or an intentional cancellation). Invoices with "canceled" status are no longer considered to be due. Once reopened, they are considered due for payment. Payment may then be captured in one of the following ways: @@ -2059,7 +2061,7 @@ puts result # Void Invoice -This endpoint allows you to void any invoice with the "open" or "canceled" status. It will also allow voiding of an invoice with the "pending" status if it is not a consolidated invoice. +Voids any invoice with the "open" or "canceled" status. It will also allow voiding of an invoice with the "pending" status if it is not a consolidated invoice. ```ruby def void_invoice(uid, @@ -2111,7 +2113,7 @@ puts result # List Consolidated Invoice Segments -Invoice segments returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. +Lists segments for a consolidated invoice. Invoice segments returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. ```ruby def list_consolidated_invoice_segments(options = {}) @@ -2426,7 +2428,7 @@ puts result # Create Invoice -This endpoint will allow you to create an ad hoc invoice. +Creates an ad hoc invoice. ### Basic Behavior @@ -2785,9 +2787,158 @@ puts result | 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | +# Update Invoice + +Updates an ad hoc invoice while it is in the `draft` state. + +**Important: only invoices with the `adhoc` role and `draft` status can be updated.** Any other invoice — issued, or with a different role (e.g. `renewal`, `signup`) — cannot be updated through this endpoint and the request returns a `422` error. If the invoice does not belong to the provided subscription, a `404` error is returned. + +Only the attributes submitted in the request are changed — omitted attributes keep their current values. + +### Line Items + +The `line_items` array describes changes to the invoice's line items. Line items not referenced in the array remain unchanged. + +#### Adding a line item + +A line item without a `uid` is added to the invoice. The same line item types and options as on invoice creation are supported (custom items, `product_id`, `component_id`, price points, period date ranges, taxes). + +#### Updating a line item + +A line item with the `uid` of an existing line item updates that line item with the submitted attributes. Amounts and taxes are recalculated. + +#### Removing a line item + +A line item with a `uid` and `"_destroy": true` is removed from the invoice. Other line items remain unchanged. + +Referencing a `uid` which does not exist on the invoice returns a `422` error. + +### Coupons + +When the `coupons` key is present, the submitted coupons replace all discounts currently applied to the invoice. Send an empty array to remove all discounts. Coupon options are the same as on invoice creation. + +### Invoice Options + +#### Issue Date and Net Terms + +The `issue_date` parameter can be sent to change the invoice's issue date. Only today or dates in the past are accepted. The date is interpreted and validated in your site's time zone, using the `YYYY-MM-DD` format. The `net_terms` parameter indicates the number of days after the issue date on which the invoice is due. The due date is recalculated whenever the issue date or net terms change. + +#### Addresses + +The seller, shipping and billing addresses can be sent to replace the addresses on the invoice. Each address requires to send a `first_name` at a minimum in order to work. Taxes are recalculated after an address change. + +#### Memo and Payment Instructions + +A custom memo can be sent with the `memo` parameter. Likewise, custom payment instructions can be sent with the `payment_instructions` parameter. + +```ruby +def update_invoice(subscription_id, + uid, + body: nil) +``` + +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription. | +| `uid` | `String` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | +| `body` | [`UpdateInvoiceRequest`](../../doc/models/update-invoice-request.md) | Body, Optional | Request payload for updating a draft ad hoc invoice. | + +## Response Type + +**200**: OK + +[`InvoiceResponse`](../../doc/models/invoice-response.md) + +## Example Usage + +```ruby +subscription_id = 222 + +uid = 'uid0' + +body = UpdateInvoiceRequest.new( + invoice: UpdateInvoice.new( + net_terms: 30, + memo: 'Updated memo' + ) +) + +result = invoices_controller.update_invoice( + subscription_id, + uid, + body: body +) +puts result +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | + + +# Delete Invoice + +Deletes an ad hoc invoice while it is in the `draft` state. + +**Important: only invoices with the `adhoc` role and `draft` status can be deleted.** Any other invoice — issued, or with a different role (e.g. `renewal`, `signup`) — cannot be deleted through this endpoint and the request returns a `422` error. Issued invoices should be voided instead. If the invoice does not belong to the provided subscription, a `404` error is returned. + +A successful deletion returns a `204 No Content` response and the invoice is permanently removed. + +```ruby +def delete_invoice(subscription_id, + uid) +``` + +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription. | +| `uid` | `String` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | + +## Response Type + +**204**: No Content + +`void` + +## Example Usage + +```ruby +subscription_id = 222 + +uid = 'uid0' + +invoices_controller.delete_invoice( + subscription_id, + uid +) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + # Send Invoice -This endpoint allows for invoices to be programmatically delivered via email. This endpoint supports the delivery of both ad-hoc and automatically generated invoices. Additionally, this endpoint supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. +Sends an invoice to the customer via email. This endpoint supports the delivery of both ad-hoc and automatically generated invoices. Additionally, this endpoint supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. **File Attachments**: You can attach files to invoice emails using `attachment_urls[]` parameter by providing URLs to the files you want to attach. When using attachments, the request must use `multipart/form-data` content type. Max 10 files, 10MB per file. @@ -2849,7 +3000,7 @@ invoices_controller.send_invoice( # Preview Customer Information Changes -Customer information may change after an invoice is issued, which may lead to a mismatch between customer information that is present on an open invoice and actual customer information. This endpoint allows you to preview these differences, if any. +Previews the effect of customer information changes on an open invoice. Customer information may change after an invoice is issued, which may lead to a mismatch between customer information that is present on an open invoice and actual customer information. This endpoint allows you to preview these differences, if any. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. @@ -2945,7 +3096,7 @@ puts result # Update Customer Information -This endpoint updates customer information on an open invoice and returns the updated invoice. If you would like to preview changes that will be applied, use the `/invoices/{uid}/customer_information/preview.json` endpoint first. +Updates customer information on an open invoice and returns the updated invoice. If you would like to preview changes that will be applied, use the `/invoices/{uid}/customer_information/preview.json` endpoint first. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. @@ -3176,7 +3327,7 @@ puts result # Issue Invoice -This endpoint allows you to issue an invoice that is in "pending" or "draft" status. For example, you can issue an invoice that was created when allocating new quantity on a component and using "accrue charges" option. +Issues an invoice that is in "pending" or "draft" status. For example, you can issue an invoice that was created when allocating new quantity on a component and using "accrue charges" option. You cannot issue a pending child invoice that was created for a member subscription in a group. diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index 8f5e0ac..a4b728a 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -133,7 +133,7 @@ puts result # List Payment Profiles -Returns all active payment profiles for a site, or for one customer within a site. If no payment profiles are found, this endpoint will return an empty array, not a 404. +Lists all active payment profiles for a site, or for one customer within a site. If no payment profiles are found, this endpoint will return an empty array, not a 404. ```ruby def list_payment_profiles(options = {}) @@ -743,7 +743,7 @@ puts result # Change Subscription Group Default Payment Profile -This will change the default payment profile on the subscription group to the existing payment profile with the id specified. +Changes the default payment profile on the subscription group to the existing payment profile with the specified ID. You must elect to change the existing payment profile to a new payment profile ID in order to receive a satisfactory response from this endpoint. @@ -823,7 +823,7 @@ puts result # Read One Time Token -One Time Tokens aka Advanced Billing Tokens house the credit card or ACH (Authorize.Net or Stripe only) data for a customer. +Returns the one-time token data, including credit card or ACH details, associated with the provided token ID. One Time Tokens aka Advanced Billing Tokens house the credit card or ACH (Authorize.Net or Stripe only) data for a customer. You can use One Time Tokens while creating a subscription or payment profile instead of passing all bank account or credit card data directly to a given API endpoint. @@ -867,7 +867,7 @@ puts result # Send Request Update Payment Email -You can send a "request payment update" email to the customer associated with the subscription. +Sends a "request payment update" email to the customer associated with the subscription. If you attempt to send a "request payment update" email more than five times within a 30-minute period, you will receive a `422` response with an error message in the body. This error message will indicate that the request has been rejected due to excessive attempts, and will provide instructions on how to resubmit the request. diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index ef157d6..6cee36a 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -41,7 +41,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `end_date` | `Date` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | | `start_datetime` | `DateTime` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | | `end_datetime` | `DateTime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | -| `include_archived` | `TrueClass \| FalseClass` | Query, Optional | Include archived products | +| `include_archived` | `TrueClass \| FalseClass` | Query, Optional | Include archived products. | | `include` | [`ListProductsInclude`](../../doc/models/list-products-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=prepaid_product_price_point`. | ## Response Type @@ -210,7 +210,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) body = CreateProductFamilyRequest.new( product_family: CreateProductFamily.new( name: 'Acme Projects', - description: 'Amazing project management tool' + description: 'Amazing project management tool', + surcharging: false ) ) @@ -227,7 +228,8 @@ puts result "name": "Acme Projects", "description": "Amazing project management tool", "handle": "acme-projects", - "accounting_code": null + "accounting_code": null, + "surcharging": false } } ``` @@ -241,7 +243,7 @@ puts result # List Product Families -Returns a list of Product Families for a site. +Lists Product Families for a site. ```ruby def list_product_families(options = {}) @@ -289,6 +291,7 @@ puts result "description": null, "handle": "acme-projects", "accounting_code": null, + "surcharging": false, "created_at": "2013-02-20T15:05:51-07:00", "updated_at": "2013-02-20T15:05:51-07:00", "archived_at": null @@ -301,6 +304,7 @@ puts result "description": "Another family.", "handle": "bat-family", "accounting_code": null, + "surcharging": true, "created_at": "2014-04-16T12:41:13-06:00", "updated_at": "2014-04-16T12:41:13-06:00", "archived_at": "2024-11-05T09:30:00-07:00" @@ -355,6 +359,7 @@ puts result "description": "", "handle": "billing-plans", "accounting_code": null, + "surcharging": false, "archived_at": null } } diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index 8dc2e28..314417e 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -132,7 +132,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `product_id` | Integer \| String | Template, Required | This is a container for one-of cases. | | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.

**Default**: `10`

**Constraints**: `<= 200` | -| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | When fetching a product's price points, if you have defined multiple currencies at the site level, you can optionally pass the ?currency_prices=true query param to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass ?currency_prices=true to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | | `filter_type` | [`Array[PricePointType]`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | | `archived` | `TrueClass \| FalseClass` | Query, Optional | Set to include archived price points in the response. | @@ -286,7 +286,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `product_id` | Integer \| String | Template, Required | This is a container for one-of cases. | | `price_point_id` | Integer \| String | Template, Required | This is a container for one-of cases. | -| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | When fetching a product's price points, if you have defined multiple currencies at the site level, you can optionally pass the ?currency_prices=true query param to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass ?currency_prices=true to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | ## Response Type diff --git a/doc/controllers/products.md b/doc/controllers/products.md index 046993f..20955f4 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -22,6 +22,8 @@ products_controller = client.products Creates a product in your Advanced Billing site. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, the `auto_create_signup_page` parameter is not supported. If `auto_create_signup_page` is included (with any value) an error is returned. + See the following product documentation for more information: + [Products Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 5dd8bbc..926f074 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -86,12 +86,12 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `uid` | `String` | Template, Required | The uid of the subscription group | -| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data

**Default**: `false` | -| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data

**Default**: `false` | -| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data

**Default**: `false` | -| `credits` | `TrueClass \| FalseClass` | Query, Optional | Include credits data

**Default**: `false` | -| `payments` | `TrueClass \| FalseClass` | Query, Optional | Include payments data

**Default**: `false` | -| `custom_fields` | `TrueClass \| FalseClass` | Query, Optional | Include custom fields data

**Default**: `false` | +| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data.

**Default**: `false` | +| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data.

**Default**: `false` | +| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data.

**Default**: `false` | +| `credits` | `TrueClass \| FalseClass` | Query, Optional | Include credits data.

**Default**: `false` | +| `payments` | `TrueClass \| FalseClass` | Query, Optional | Include payments data.

**Default**: `false` | +| `custom_fields` | `TrueClass \| FalseClass` | Query, Optional | Include custom fields data.

**Default**: `false` | ## Response Type @@ -236,12 +236,12 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.

**Default**: `Direction::DESC` | -| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data

**Default**: `false` | -| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data

**Default**: `false` | -| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data

**Default**: `false` | -| `credits` | `TrueClass \| FalseClass` | Query, Optional | Include credits data

**Default**: `false` | -| `payments` | `TrueClass \| FalseClass` | Query, Optional | Include payments data

**Default**: `false` | -| `custom_fields` | `TrueClass \| FalseClass` | Query, Optional | Include custom fields data

**Default**: `false` | +| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data.

**Default**: `false` | +| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data.

**Default**: `false` | +| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data.

**Default**: `false` | +| `credits` | `TrueClass \| FalseClass` | Query, Optional | Include credits data.

**Default**: `false` | +| `payments` | `TrueClass \| FalseClass` | Query, Optional | Include payments data.

**Default**: `false` | +| `custom_fields` | `TrueClass \| FalseClass` | Query, Optional | Include custom fields data.

**Default**: `false` | ## Response Type @@ -386,7 +386,7 @@ puts result # Preview Proforma Invoice -Returns a preview of the data that will be included on a given subscription's proforma invoice if one were to be generated. It will have similar line items and totals as a renewal preview, but the response will be presented in the format of a proforma invoice. Consequently it will include additional information such as the name and addresses that will appear on the proforma invoice. +Previews the data that will be included on a given subscription's proforma invoice if one were to be generated. It will have similar line items and totals as a renewal preview, but the response will be presented in the format of a proforma invoice. Consequently it will include additional information such as the name and addresses that will appear on the proforma invoice. The preview endpoint is subject to all the same conditions as the proforma invoice endpoint. For example, previews are only available on the Relationship Invoicing architecture, and previews cannot be made for end-of-life subscriptions. diff --git a/doc/controllers/sales-commissions.md b/doc/controllers/sales-commissions.md index 726ac7f..b5df8a1 100644 --- a/doc/controllers/sales-commissions.md +++ b/doc/controllers/sales-commissions.md @@ -25,7 +25,7 @@ The Sales Commission API differs from other Chargify API endpoints. This resourc Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` +> Note: The request is at seller level, it means `<>` variable will be replaced by `app`. ```ruby def list_sales_commission_settings(options = {}) @@ -102,7 +102,7 @@ puts result # List Sales Reps -Returns a sales rep list with details. +Lists sales reps with details. ## Modified Authentication Process @@ -110,7 +110,7 @@ The Sales Commission API differs from other Chargify API endpoints. This resourc Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` +> Note: The request is at seller level, it means `<>` variable will be replaced by `app`. ```ruby def list_sales_reps(options = {}) @@ -244,7 +244,7 @@ The Sales Commission API differs from other Chargify API endpoints. This resourc Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` +> Note: The request is at seller level, it means `<>` variable will be replaced by `app`. ```ruby def read_sales_rep(seller_id, diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index d4402cb..03db5e7 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -32,7 +32,7 @@ If the site has RI enabled then you will see more settings like: "whopays_default_payer": "self" You can read more about these settings here: -[Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays) +[Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays). ```ruby def read_site @@ -144,7 +144,7 @@ sites_controller.clear_site(cleanup_scope: cleanup_scope) # List Chargify Js Public Keys -Returns public keys used for Maxio.js (formerly Chargify.js). +Lists public keys used for Maxio.js (formerly Chargify.js). ```ruby def list_chargify_js_public_keys(options = {}) diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index d458089..0a64e28 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -561,7 +561,7 @@ puts result # List Allocations -Returns the 50 most recent Allocations, ordered by most recent first. +Lists the 50 most recent Allocations, ordered by most recent first. ## On/Off Components @@ -1220,7 +1220,7 @@ puts result # List Usages -Returns a list of usages associated with a subscription for a particular metered component. This will display the previously recorded components for a subscription. +Lists usages associated with a subscription for a particular metered component. This will display the previously recorded components for a subscription. This endpoint is not compatible with quantity-based components. @@ -1250,8 +1250,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `subscription_id_or_reference` | Integer \| String | Template, Required | This is a container for one-of cases. | | `component_id` | Integer \| String | Template, Required | This is a container for one-of cases. | -| `since_id` | `Integer` | Query, Optional | Returns usages with an id greater than or equal to the one specified | -| `max_id` | `Integer` | Query, Optional | Returns usages with an id less than or equal to the one specified | +| `since_id` | `Integer` | Query, Optional | Returns usages with an id greater than or equal to the one specified. | +| `max_id` | `Integer` | Query, Optional | Returns usages with an id less than or equal to the one specified. | | `since_date` | `Date` | Query, Optional | Returns usages with a created_at date greater than or equal to midnight (12:00 AM) on the date specified. | | `until_date` | `Date` | Query, Optional | Returns usages with a created_at date less than or equal to midnight (12:00 AM) on the date specified. | | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | @@ -1459,7 +1459,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `api_handle` | `String` | Template, Required | Identifies the Stream for which the event should be published. | -| `store_uid` | `String` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. | +| `store_uid` | `String` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. This applies to Legacy Metering sites only — it has no effect on Maxio Metering sites. | | `body` | [`EBBEvent`](../../doc/models/ebb-event.md) | Body, Optional | - | ## Server @@ -1514,7 +1514,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `api_handle` | `String` | Template, Required | Identifies the Stream for which the events should be published. | -| `store_uid` | `String` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. | +| `store_uid` | `String` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. This applies to Legacy Metering sites only — it has no effect on Maxio Metering sites. | | `body` | [`Array[EBBEvent]`](../../doc/models/ebb-event.md) | Body, Optional | - | ## Server diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index 2c4bf8f..83a4c40 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -162,7 +162,7 @@ puts result # List Subscription Groups -Returns an array of subscription groups for the site. The response is paginated and will return a `meta` key with pagination information. +Lists subscription groups for the site. The response is paginated and will return a `meta` key with pagination information. #### Account Balance Information @@ -545,7 +545,7 @@ puts result # Add Subscription to Group -For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to add existing subscriptions to subscription groups. +Adds an existing subscription to a subscription group. For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to add existing subscriptions to subscription groups. Passing `group` parameters with a `target` containing a `type` and optional `id` is all that's needed. When the `target` parameter specifies a `"customer"` or `"subscription"` that is already part of a hierarchy, the subscription will become a member of the customer's subscription group. If the target customer or subscription is not part of a subscription group, a new group will be created and the subscription will become part of the group with the specified target customer set as the responsible payer for the group's subscriptions. @@ -633,7 +633,7 @@ puts result # Remove Subscription from Group -For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to remove an existing subscription from a subscription group. +Removes an existing subscription from a subscription group. For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to remove an existing subscription from a subscription group. ```ruby def remove_subscription_from_group(subscription_id) diff --git a/doc/controllers/subscription-renewals.md b/doc/controllers/subscription-renewals.md index 20b5d3e..73fd4da 100644 --- a/doc/controllers/subscription-renewals.md +++ b/doc/controllers/subscription-renewals.md @@ -574,7 +574,7 @@ puts result # Unpublish Scheduled Renewal Configuration -Returns a scheduled renewal configuration to an editable state. +Restores a scheduled renewal configuration to an editable state. ```ruby def unpublish_scheduled_renewal_configuration(subscription_id, @@ -738,6 +738,8 @@ puts result Adds product and component line items to the scheduled renewal. +If your site has list vs sales pricing enabled, accepts renewal_configuration_item.custom_price.list_price_point_id, validates and persists it; omitted value follows existing/default behavior; with list vs sales pricing disabled, parameter is ignored (no validation/behavioral impact). This functionality is supported in the API, but is not currently supported in SDKs. + ```ruby def create_scheduled_renewal_configuration_item(subscription_id, scheduled_renewals_configuration_id, @@ -826,6 +828,8 @@ puts result Updates an existing configuration item’s pricing and quantity. +If you site has list vs sales pricing enabled, accepts renewal_configuration_item.custom_price.list_price_point_id, validates and persists it; omitted value follows existing/default behavior; with list vs sales pricing disabled, parameter is ignored (no validation/behavioral impact). This functionality is supported in the API, but is not currently supported in SDKs. + ```ruby def update_scheduled_renewal_configuration_item(subscription_id, scheduled_renewals_configuration_id, diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index 149fb71..2c3f946 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -557,7 +557,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription. | -| `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | +| `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows you to pause a Subscription. | ## Response Type @@ -723,7 +723,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription. | -| `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | +| `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows you to pause a Subscription. | ## Response Type diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index 663af6c..a0f0f2b 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -34,6 +34,48 @@ Identify an existing customer with `customer_id` or `customer_reference`. Option Select an option from the **Request Examples** drop-down on the right side of the portal to see examples of common scenarios for creating subscriptions. +## List vs Sales Pricing + +When a subscription uses custom pricing as the sales price, you can optionally provide a list price for any item. If omitted, the list price defaults to the sales price. The difference between the list price and sales price is used to calculate implicit discounts, which appear on Invoices and in reporting. List price can also support revenue allocations in [Advanced Revenue](https://docs.maxio.com/hc/en-us/articles/24177001342861-Create-and-Configure-RevenueBooks). + +If your site has list pricing enabled, the API accepts `custom_price.list_price_point_id` for custom pricing, validates and persists it, and returns list price metadata in subscription responses. If list pricing is disabled, this input is ignored and related response fields are omitted. + +When list pricing is enabled: + +- Subscription → Product `product_price_point_list_price_point_id` (integer) +- `product_price_point_list_price_point_handle` (string) +- Subscription Components (when components are included in the response, such as with subscriptions built from components or component serialization paths) `component_id` (integer) +- `price_point_id` (integer) +- `list_price_point_id` (integer) + +When list pricing is disabled: + +- Subscription → Product `product_price_point_list_price_point_id`: omitted +- `product_price_point_list_price_point_handle`: omitted +- Subscription Components `list_price_point_id`: omitted + +This functionality is supported in the API, but is not currently supported in SDKs. + +## Subscriptions can now work independently from the catalog + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, you can create subscriptions without a `product_id` or `product_handle` using POST /subscriptions, building them entirely from components. + +A valid subscription must include at least one active component with: + +- a positive `allocated_quantity`, +- a positive `unit_balance`, or +- 'enabled: true' (for on/off components) +- a configured metered component + +`component_id` can be provided as a numeric ID or in handle: format. If `trial_interval` and `trial_interval_unit` are included, they are applied at creation. + +In the response, product and product price point fields are null, and component details are returned instead. + +This functionality is supported in the API, but is not currently supported in SDKs. + +## Payment information + +Payment information may be required to create a subscription, depending on the options for the Product being subscribed. See [product options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-Products) for more information. See the [Payments Profile](../../doc/controllers/payment-profiles.md#create-payment-profile) endpoint for details on payment parameters. See the [Subscription Signups](page:introduction/basic-concepts/subscription-signup) article for more information on working with subscriptions in Advanced Billing. ## Payment information @@ -246,7 +288,9 @@ puts result # List Subscriptions -Returns an array of subscriptions from a Site. Pay close attention to query string filters and pagination in order to control responses from the server. +Lists subscriptions for a site. Use the query string filters and pagination to control responses from the server. + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. ## Search for a subscription @@ -270,19 +314,28 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | | `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | +| `sort` | [`SubscriptionSort`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort

**Default**: `SubscriptionSort::SIGNUP_DATE` | +| `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | | `state` | [`SubscriptionStateFilter`](../../doc/models/subscription-state-filter.md) | Query, Optional | The current state of the subscription | -| `product` | `Integer` | Query, Optional | The product id of the subscription. (Note that the product handle cannot be used.) | -| `product_price_point_id` | `Integer` | Query, Optional | The ID of the product price point. If supplied, product is required | +| `product` | Integer \| String \| nil | Query, Optional | This is a container for one-of cases. | +| `q` | `String` | Query, Optional | Search string. | +| `q_scope` | [`QScope`](../../doc/models/q-scope.md) | Query, Optional | Scope of fields used by the q search. | +| `customer_id` | `Integer` | Query, Optional | The Advanced Billing id of the customer. | +| `product_price_point_id` | `Integer` | Query, Optional | The ID of the product price point. If supplied, product is required. | | `coupon` | `Integer` | Query, Optional | The numeric id of the coupon currently applied to the subscription. (This can be found in the URL when editing a coupon. Note that the coupon code cannot be used.) | | `coupon_code` | `String` | Query, Optional | The coupon code currently applied to the subscription | +| `collection_method` | [`CollectionMethod1`](../../doc/models/collection-method-1.md) | Query, Optional | The collection method for the subscription. | +| `branding_theme_id` | `Integer` | Query, Optional | Filter subscriptions by the ID of an assigned Branding Theme. Branding Themes is a beta feature. See [Understand Branding Themes](https://docs.maxio.com/hc/en-us/articles/43796895662093-Understand-Branding-Themes#understand-branding-themes-0-0) for more information. | | `date_field` | [`SubscriptionDateField`](../../doc/models/subscription-date-field.md) | Query, Optional | The type of filter you'd like to apply to your search. Allowed Values: , current_period_ends_at, current_period_starts_at, created_at, activated_at, canceled_at, expires_at, trial_started_at, trial_ended_at, updated_at | | `start_date` | `Date` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. Use in query `start_date=2022-07-01`. | | `end_date` | `Date` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `end_date=2022-08-01`. | | `start_datetime` | `DateTime` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns subscriptions with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `start_datetime=2022-07-01 09:00:05`. | | `end_datetime` | `DateTime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns subscriptions with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `end_datetime=2022-08-01 10:00:05`. | | `metadata` | `Hash[String, String]` | Query, Optional | The value of the metadata field specified in the parameter. Use in query `metadata[my-field]=value&metadata[other-field]=another_value`. | -| `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | -| `sort` | [`SubscriptionSort`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort

**Default**: `SubscriptionSort::SIGNUP_DATE` | +| `group_status` | [`GroupStatus`](../../doc/models/group-status.md) | Query, Optional | Filter by whether a subscription is in a group. | +| `dunning_exemption` | `TrueClass \| FalseClass` | Query, Optional | Filter by dunning exemption status. | +| `payment_gateways` | `String` | Query, Optional | Comma-separated payment gateway identifiers. | +| `currencies` | `String` | Query, Optional | Comma-separated currency codes. | | `include` | [`Array[SubscriptionListInclude]`](../../doc/models/subscription-list-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include[]=self_service_page_token`. | ## Response Type @@ -297,10 +350,6 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) collect = { 'page' => 1, 'per_page' => 50, - 'start_date' => Date.iso8601('2022-07-01'), - 'end_date' => Date.iso8601('2022-08-01'), - 'start_datetime' => DateTimeHelper.from_rfc3339('2022-07-01 09:00:05'), - 'end_datetime' => DateTimeHelper.from_rfc3339('2022-08-01 10:00:05'), 'sort' => SubscriptionSort::SIGNUP_DATE, 'include' => [ SubscriptionListInclude::SELF_SERVICE_PAGE_TOKEN @@ -362,7 +411,9 @@ The server response will not return data under the key/value pair of `next_billi For a subscription using Calendar Billing, setting the next billing date is a bit different. Send the `snap_day` attribute to change the calendar billing date for **a subscription using a product eligible for calendar billing**. -> Note: If you change the product associated with a subscription that contains a `snap_day` and immediately `READ/GET` the subscription data, it will still contain original `snap_day`. The `snap_day` will reset to null on the next billing cycle. This is because a product change is instantaneous and only affects the product associated with a subscription. +> Note: If you change the product associated with a subscription that contains a `snap_day` and immediately READ/GET the subscription data, it will still contain the original `snap_day`. The `snap_day` will be reset to `null` on the next billing cycle. This is because a product change is instantaneous and only affects the product associated with a subscription. + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, `product`, `product_price_point_id`, and `product_price_point_type` are returned as `null`. ```ruby def update_subscription(subscription_id, @@ -526,6 +577,8 @@ puts result Retrieves subscription details. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. + ## Self-Service Page token Self-Service Page token for the subscription is not returned by default. If this information is desired, the include[]=self_service_page_token parameter must be provided with the request. @@ -959,6 +1012,22 @@ A subscription will not be created by utilizing this endpoint; it is meant to se For more information, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). +## Subscriptions can now work independently from the catalog + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, you can create subscriptions without a `product_id` or `product_handle` using POST /subscriptions, building them entirely from components. + +A valid subscription must include at least one active component with: + +- a positive `allocated_quantity`, +- a positive `unit_balance`, or +- 'enabled: true' (for on/off components) + +`component_id` can be provided as a numeric ID or in handle: format. If `trial_interval` and `trial_interval_unit` are included, they are applied at creation. + +In the response, product and product price point fields are null, and component details are returned instead. + +This functionality is supported in the API, but is not currently supported in SDKs. + ## Taxable Subscriptions This endpoint will preview taxes applicable to a purchase. In order for taxes to be previewed, the following conditions must be met: diff --git a/doc/controllers/webhooks.md b/doc/controllers/webhooks.md index 2028cd6..ce8a560 100644 --- a/doc/controllers/webhooks.md +++ b/doc/controllers/webhooks.md @@ -75,7 +75,7 @@ puts result "last_sent_at": "2016-11-08T16:43:54-05:00", "last_sent_url": "http://requestb.in/11u45x71", "successful": false, - "body": "id=141765032&event=statement_settled&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][balance_in_cents]=0&payload[customer][id]=14585695&payload[customer][first_name]=Pookie&payload[customer][last_name]=Test&payload[customer][reference]=&payload[customer][organization]=&payload[customer][address]=&payload[customer][address_2]=&payload[customer][city]=&payload[customer][state]=&payload[customer][zip]=&payload[customer][country]=&payload[customer][email]=pookie999%40example.com&payload[customer][phone]=&payload[statement][closed_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][id]=80168049&payload[statement][opened_at]=2016-11-07%2016%3A22%3A15%20-0500&payload[statement][settled_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][subscription_id]=15100141&payload[statement][updated_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][starting_balance_in_cents]=0&payload[statement][ending_balance_in_cents]=0&payload[statement][total_in_cents]=6400&payload[statement][memo]=We%20thank%20you%20for%20your%20continued%20business!&payload[statement][events][0][id]=346956565&payload[statement][events][0][key]=renewal_success&payload[statement][events][0][message]=Successful%20renewal%20for%20Pookie%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][1][id]=346956579&payload[statement][events][1][key]=payment_success&payload[statement][events][1][message]=Successful%20payment%20of%20%2464.00%20for%20Pookie%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][2][id]=347299359&payload[statement][events][2][key]=renewal_success&payload[statement][events][2][message]=Successful%20renewal%20for%20Pookie%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][transactions][0][id]=161537343&payload[statement][transactions][0][subscription_id]=15100141&payload[statement][transactions][0][type]=Charge&payload[statement][transactions][0][kind]=baseline&payload[statement][transactions][0][transaction_type]=charge&payload[statement][transactions][0][success]=true&payload[statement][transactions][0][amount_in_cents]=1000&payload[statement][transactions][0][memo]=%2410%20Basic%20Plan%20(11%2F08%2F2016%20-%2011%2F09%2F2016)&payload[statement][transactions][0][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][0][starting_balance_in_cents]=0&payload[statement][transactions][0][ending_balance_in_cents]=1000&payload[statement][transactions][0][gateway_used]=&payload[statement][transactions][0][gateway_transaction_id]=&payload[statement][transactions][0][gateway_order_id]=&payload[statement][transactions][0][payment_id]=161537369&payload[statement][transactions][0][product_id]=3792003&payload[statement][transactions][0][tax_id]=&payload[statement][transactions][0][component_id]=&payload[statement][transactions][0][statement_id]=80168049&payload[statement][transactions][0][customer_id]=14585695&payload[statement][transactions][0][original_amount_in_cents]=&payload[statement][transactions][0][discount_amount_in_cents]=&payload[statement][transactions][0][taxable_amount_in_cents]=&payload[statement][transactions][1][id]=161537344&payload[statement][transactions][1][subscription_id]=15100141&payload[statement][transactions][1][type]=Charge&payload[statement][transactions][1][kind]=quantity_based_component&payload[statement][transactions][1][transaction_type]=charge&payload[statement][transactions][1][success]=true&payload[statement][transactions][1][amount_in_cents]=5400&payload[statement][transactions][1][memo]=Timesheet%20Users%3A%2018%20Timesheet%20Users&payload[statement][transactions][1][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][1][starting_balance_in_cents]=1000&payload[statement][transactions][1][ending_balance_in_cents]=6400&payload[statement][transactions][1][gateway_used]=&payload[statement][transactions][1][gateway_transaction_id]=&payload[statement][transactions][1][gateway_order_id]=&payload[statement][transactions][1][payment_id]=161537369&payload[statement][transactions][1][product_id]=3792003&payload[statement][transactions][1][tax_id]=&payload[statement][transactions][1][component_id]=277221&payload[statement][transactions][1][statement_id]=80168049&payload[statement][transactions][1][customer_id]=14585695&payload[statement][transactions][1][original_amount_in_cents]=&payload[statement][transactions][1][discount_amount_in_cents]=&payload[statement][transactions][1][taxable_amount_in_cents]=&payload[statement][transactions][2][id]=161537369&payload[statement][transactions][2][subscription_id]=15100141&payload[statement][transactions][2][type]=Payment&payload[statement][transactions][2][kind]=&payload[statement][transactions][2][transaction_type]=payment&payload[statement][transactions][2][success]=true&payload[statement][transactions][2][amount_in_cents]=6400&payload[statement][transactions][2][memo]=Pookie%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[statement][transactions][2][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][transactions][2][starting_balance_in_cents]=6400&payload[statement][transactions][2][ending_balance_in_cents]=0&payload[statement][transactions][2][gateway_used]=bogus&payload[statement][transactions][2][gateway_transaction_id]=53433&payload[statement][transactions][2][gateway_order_id]=&payload[statement][transactions][2][payment_id]=&payload[statement][transactions][2][product_id]=3792003&payload[statement][transactions][2][tax_id]=&payload[statement][transactions][2][component_id]=&payload[statement][transactions][2][statement_id]=80168049&payload[statement][transactions][2][customer_id]=14585695&payload[statement][transactions][2][card_number]=XXXX-XXXX-XXXX-1&payload[statement][transactions][2][card_expiration]=10%2F2020&payload[statement][transactions][2][card_type]=bogus&payload[statement][transactions][2][refunded_amount_in_cents]=0&payload[product][id]=3792003&payload[product][name]=%2410%20Basic%20Plan&payload[product_family][id]=527890&payload[product_family][name]=Acme%20Projects&payload[payment_profile][id]=10102821&payload[payment_profile][first_name]=Pookie&payload[payment_profile][last_name]=Test&payload[payment_profile][billing_address]=&payload[payment_profile][billing_address_2]=&payload[payment_profile][billing_city]=&payload[payment_profile][billing_country]=&payload[payment_profile][billing_state]=&payload[payment_profile][billing_zip]=&payload[event_id]=347299384", + "body": "id=141765032&event=statement_settled&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][balance_in_cents]=0&payload[customer][id]=14585695&payload[customer][first_name]=Alan&payload[customer][last_name]=Test&payload[customer][reference]=&payload[customer][organization]=&payload[customer][address]=&payload[customer][address_2]=&payload[customer][city]=&payload[customer][state]=&payload[customer][zip]=&payload[customer][country]=&payload[customer][email]=alan999%40example.com&payload[customer][phone]=&payload[statement][closed_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][id]=80168049&payload[statement][opened_at]=2016-11-07%2016%3A22%3A15%20-0500&payload[statement][settled_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][subscription_id]=15100141&payload[statement][updated_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][starting_balance_in_cents]=0&payload[statement][ending_balance_in_cents]=0&payload[statement][total_in_cents]=6400&payload[statement][memo]=We%20thank%20you%20for%20your%20continued%20business!&payload[statement][events][0][id]=346956565&payload[statement][events][0][key]=renewal_success&payload[statement][events][0][message]=Successful%20renewal%20for%20Alan%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][1][id]=346956579&payload[statement][events][1][key]=payment_success&payload[statement][events][1][message]=Successful%20payment%20of%20%2464.00%20for%20Alan%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][2][id]=347299359&payload[statement][events][2][key]=renewal_success&payload[statement][events][2][message]=Successful%20renewal%20for%20Alan%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][transactions][0][id]=161537343&payload[statement][transactions][0][subscription_id]=15100141&payload[statement][transactions][0][type]=Charge&payload[statement][transactions][0][kind]=baseline&payload[statement][transactions][0][transaction_type]=charge&payload[statement][transactions][0][success]=true&payload[statement][transactions][0][amount_in_cents]=1000&payload[statement][transactions][0][memo]=%2410%20Basic%20Plan%20(11%2F08%2F2016%20-%2011%2F09%2F2016)&payload[statement][transactions][0][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][0][starting_balance_in_cents]=0&payload[statement][transactions][0][ending_balance_in_cents]=1000&payload[statement][transactions][0][gateway_used]=&payload[statement][transactions][0][gateway_transaction_id]=&payload[statement][transactions][0][gateway_order_id]=&payload[statement][transactions][0][payment_id]=161537369&payload[statement][transactions][0][product_id]=3792003&payload[statement][transactions][0][tax_id]=&payload[statement][transactions][0][component_id]=&payload[statement][transactions][0][statement_id]=80168049&payload[statement][transactions][0][customer_id]=14585695&payload[statement][transactions][0][original_amount_in_cents]=&payload[statement][transactions][0][discount_amount_in_cents]=&payload[statement][transactions][0][taxable_amount_in_cents]=&payload[statement][transactions][1][id]=161537344&payload[statement][transactions][1][subscription_id]=15100141&payload[statement][transactions][1][type]=Charge&payload[statement][transactions][1][kind]=quantity_based_component&payload[statement][transactions][1][transaction_type]=charge&payload[statement][transactions][1][success]=true&payload[statement][transactions][1][amount_in_cents]=5400&payload[statement][transactions][1][memo]=Timesheet%20Users%3A%2018%20Timesheet%20Users&payload[statement][transactions][1][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][1][starting_balance_in_cents]=1000&payload[statement][transactions][1][ending_balance_in_cents]=6400&payload[statement][transactions][1][gateway_used]=&payload[statement][transactions][1][gateway_transaction_id]=&payload[statement][transactions][1][gateway_order_id]=&payload[statement][transactions][1][payment_id]=161537369&payload[statement][transactions][1][product_id]=3792003&payload[statement][transactions][1][tax_id]=&payload[statement][transactions][1][component_id]=277221&payload[statement][transactions][1][statement_id]=80168049&payload[statement][transactions][1][customer_id]=14585695&payload[statement][transactions][1][original_amount_in_cents]=&payload[statement][transactions][1][discount_amount_in_cents]=&payload[statement][transactions][1][taxable_amount_in_cents]=&payload[statement][transactions][2][id]=161537369&payload[statement][transactions][2][subscription_id]=15100141&payload[statement][transactions][2][type]=Payment&payload[statement][transactions][2][kind]=&payload[statement][transactions][2][transaction_type]=payment&payload[statement][transactions][2][success]=true&payload[statement][transactions][2][amount_in_cents]=6400&payload[statement][transactions][2][memo]=Alan%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[statement][transactions][2][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][transactions][2][starting_balance_in_cents]=6400&payload[statement][transactions][2][ending_balance_in_cents]=0&payload[statement][transactions][2][gateway_used]=bogus&payload[statement][transactions][2][gateway_transaction_id]=53433&payload[statement][transactions][2][gateway_order_id]=&payload[statement][transactions][2][payment_id]=&payload[statement][transactions][2][product_id]=3792003&payload[statement][transactions][2][tax_id]=&payload[statement][transactions][2][component_id]=&payload[statement][transactions][2][statement_id]=80168049&payload[statement][transactions][2][customer_id]=14585695&payload[statement][transactions][2][card_number]=XXXX-XXXX-XXXX-1&payload[statement][transactions][2][card_expiration]=10%2F2020&payload[statement][transactions][2][card_type]=bogus&payload[statement][transactions][2][refunded_amount_in_cents]=0&payload[product][id]=3792003&payload[product][name]=%2410%20Basic%20Plan&payload[product_family][id]=527890&payload[product_family][name]=Acme%20Projects&payload[payment_profile][id]=10102821&payload[payment_profile][first_name]=Alan&payload[payment_profile][last_name]=Test&payload[payment_profile][billing_address]=&payload[payment_profile][billing_address_2]=&payload[payment_profile][billing_city]=&payload[payment_profile][billing_country]=&payload[payment_profile][billing_state]=&payload[payment_profile][billing_zip]=&payload[event_id]=347299384", "signature": "7c606ec4628ce75ec46e284097ce163a", "signature_hmac_sha_256": "40f25e83dd324508bb2149e3e525821922fb210535ebfbfa81e7ab951996b41d" } @@ -91,7 +91,7 @@ puts result "last_sent_at": "2016-11-08T16:43:54-05:00", "last_sent_url": "http://requestb.in/11u45x71", "successful": false, - "body": "id=141765008&event=payment_success&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][trial_started_at]=&payload[subscription][trial_ended_at]=&payload[subscription][activated_at]=2016-11-04%2017%3A06%3A43%20-0400&payload[subscription][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][updated_at]=2016-11-08%2016%3A22%3A22%20-0500&payload[subscription][expires_at]=&payload[subscription][balance_in_cents]=0&payload[subscription][current_period_ends_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][next_assessment_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][canceled_at]=&payload[subscription][cancellation_message]=&payload[subscription][next_product_id]=&payload[subscription][cancel_at_end_of_period]=false&payload[subscription][payment_collection_method]=automatic&payload[subscription][snap_day]=&payload[subscription][cancellation_method]=&payload[subscription][current_period_started_at]=2016-11-08%2016%3A06%3A42%20-0500&payload[subscription][previous_state]=active&payload[subscription][signup_payment_id]=161034048&payload[subscription][signup_revenue]=64.00&payload[subscription][delayed_cancel_at]=&payload[subscription][coupon_code]=&payload[subscription][total_revenue_in_cents]=32000&payload[subscription][product_price_in_cents]=1000&payload[subscription][product_version_number]=7&payload[subscription][payment_type]=credit_card&payload[subscription][referral_code]=pggn84&payload[subscription][coupon_use_count]=&payload[subscription][coupon_uses_allowed]=&payload[subscription][customer][id]=14585695&payload[subscription][customer][first_name]=Test&payload[subscription][customer][last_name]=Test&payload[subscription][customer][organization]=&payload[subscription][customer][email]=pookie999%40example.com&payload[subscription][customer][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][customer][updated_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][reference]=&payload[subscription][customer][address]=&payload[subscription][customer][address_2]=&payload[subscription][customer][city]=&payload[subscription][customer][state]=&payload[subscription][customer][zip]=&payload[subscription][customer][country]=&payload[subscription][customer][phone]=&payload[subscription][customer][portal_invite_last_sent_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][portal_invite_last_accepted_at]=&payload[subscription][customer][verified]=false&payload[subscription][customer][portal_customer_created_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][cc_emails]=&payload[subscription][product][id]=3792003&payload[subscription][product][name]=%2410%20Basic%20Plan&payload[subscription][product][handle]=basic&payload[subscription][product][description]=lorem%20ipsum&payload[subscription][product][accounting_code]=basic&payload[subscription][product][request_credit_card]=false&payload[subscription][product][expiration_interval]=&payload[subscription][product][expiration_interval_unit]=never&payload[subscription][product][created_at]=2016-03-24%2013%3A38%3A39%20-0400&payload[subscription][product][updated_at]=2016-11-03%2013%3A03%3A05%20-0400&payload[subscription][product][price_in_cents]=1000&payload[subscription][product][interval]=1&payload[subscription][product][interval_unit]=day&payload[subscription][product][initial_charge_in_cents]=&payload[subscription][product][trial_price_in_cents]=&payload[subscription][product][trial_interval]=&payload[subscription][product][trial_interval_unit]=month&payload[subscription][product][archived_at]=&payload[subscription][product][require_credit_card]=false&payload[subscription][product][return_params]=&payload[subscription][product][taxable]=false&payload[subscription][product][update_return_url]=&payload[subscription][product][initial_charge_after_trial]=false&payload[subscription][product][version_number]=7&payload[subscription][product][update_return_params]=&payload[subscription][product][product_family][id]=527890&payload[subscription][product][product_family][name]=Acme%20Projects&payload[subscription][product][product_family][description]=&payload[subscription][product][product_family][handle]=billing-plans&payload[subscription][product][product_family][accounting_code]=&payload[subscription][product][public_signup_pages][id]=281054&payload[subscription][product][public_signup_pages][return_url]=http%3A%2F%2Fwww.example.com%3Fsuccessfulsignup&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fkqvmfrbgd89q%2Fbasic&payload[subscription][product][public_signup_pages][id]=281240&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fdkffht5dxfd8%2Fbasic&payload[subscription][product][public_signup_pages][id]=282694&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fjwffwgdd95s8%2Fbasic&payload[subscription][credit_card][id]=10102821&payload[subscription][credit_card][first_name]=Pookie&payload[subscription][credit_card][last_name]=Test&payload[subscription][credit_card][masked_card_number]=XXXX-XXXX-XXXX-1&payload[subscription][credit_card][card_type]=bogus&payload[subscription][credit_card][expiration_month]=10&payload[subscription][credit_card][expiration_year]=2020&payload[subscription][credit_card][customer_id]=14585695&payload[subscription][credit_card][current_vault]=bogus&payload[subscription][credit_card][vault_token]=1&payload[subscription][credit_card][billing_address]=&payload[subscription][credit_card][billing_city]=&payload[subscription][credit_card][billing_state]=&payload[subscription][credit_card][billing_zip]=&payload[subscription][credit_card][billing_country]=&payload[subscription][credit_card][customer_vault_token]=&payload[subscription][credit_card][billing_address_2]=&payload[subscription][credit_card][payment_type]=credit_card&payload[subscription][credit_card][site_gateway_setting_id]=&payload[subscription][credit_card][gateway_handle]=&payload[transaction][id]=161537369&payload[transaction][subscription_id]=15100141&payload[transaction][type]=Payment&payload[transaction][kind]=&payload[transaction][transaction_type]=payment&payload[transaction][success]=true&payload[transaction][amount_in_cents]=6400&payload[transaction][memo]=Pookie%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[transaction][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[transaction][starting_balance_in_cents]=6400&payload[transaction][ending_balance_in_cents]=0&payload[transaction][gateway_used]=bogus&payload[transaction][gateway_transaction_id]=53433&payload[transaction][gateway_response_code]=&payload[transaction][gateway_order_id]=&payload[transaction][payment_id]=&payload[transaction][product_id]=3792003&payload[transaction][tax_id]=&payload[transaction][component_id]=&payload[transaction][statement_id]=80168049&payload[transaction][customer_id]=14585695&payload[transaction][card_number]=XXXX-XXXX-XXXX-1&payload[transaction][card_expiration]=10%2F2020&payload[transaction][card_type]=bogus&payload[transaction][refunded_amount_in_cents]=0&payload[transaction][invoice_id]=&payload[event_id]=347299364", + "body": "id=141765008&event=payment_success&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][trial_started_at]=&payload[subscription][trial_ended_at]=&payload[subscription][activated_at]=2016-11-04%2017%3A06%3A43%20-0400&payload[subscription][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][updated_at]=2016-11-08%2016%3A22%3A22%20-0500&payload[subscription][expires_at]=&payload[subscription][balance_in_cents]=0&payload[subscription][current_period_ends_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][next_assessment_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][canceled_at]=&payload[subscription][cancellation_message]=&payload[subscription][next_product_id]=&payload[subscription][cancel_at_end_of_period]=false&payload[subscription][payment_collection_method]=automatic&payload[subscription][snap_day]=&payload[subscription][cancellation_method]=&payload[subscription][current_period_started_at]=2016-11-08%2016%3A06%3A42%20-0500&payload[subscription][previous_state]=active&payload[subscription][signup_payment_id]=161034048&payload[subscription][signup_revenue]=64.00&payload[subscription][delayed_cancel_at]=&payload[subscription][coupon_code]=&payload[subscription][total_revenue_in_cents]=32000&payload[subscription][product_price_in_cents]=1000&payload[subscription][product_version_number]=7&payload[subscription][payment_type]=credit_card&payload[subscription][referral_code]=pggn84&payload[subscription][coupon_use_count]=&payload[subscription][coupon_uses_allowed]=&payload[subscription][customer][id]=14585695&payload[subscription][customer][first_name]=Test&payload[subscription][customer][last_name]=Test&payload[subscription][customer][organization]=&payload[subscription][customer][email]=alan999%40example.com&payload[subscription][customer][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][customer][updated_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][reference]=&payload[subscription][customer][address]=&payload[subscription][customer][address_2]=&payload[subscription][customer][city]=&payload[subscription][customer][state]=&payload[subscription][customer][zip]=&payload[subscription][customer][country]=&payload[subscription][customer][phone]=&payload[subscription][customer][portal_invite_last_sent_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][portal_invite_last_accepted_at]=&payload[subscription][customer][verified]=false&payload[subscription][customer][portal_customer_created_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][cc_emails]=&payload[subscription][product][id]=3792003&payload[subscription][product][name]=%2410%20Basic%20Plan&payload[subscription][product][handle]=basic&payload[subscription][product][description]=lorem%20ipsum&payload[subscription][product][accounting_code]=basic&payload[subscription][product][request_credit_card]=false&payload[subscription][product][expiration_interval]=&payload[subscription][product][expiration_interval_unit]=never&payload[subscription][product][created_at]=2016-03-24%2013%3A38%3A39%20-0400&payload[subscription][product][updated_at]=2016-11-03%2013%3A03%3A05%20-0400&payload[subscription][product][price_in_cents]=1000&payload[subscription][product][interval]=1&payload[subscription][product][interval_unit]=day&payload[subscription][product][initial_charge_in_cents]=&payload[subscription][product][trial_price_in_cents]=&payload[subscription][product][trial_interval]=&payload[subscription][product][trial_interval_unit]=month&payload[subscription][product][archived_at]=&payload[subscription][product][require_credit_card]=false&payload[subscription][product][return_params]=&payload[subscription][product][taxable]=false&payload[subscription][product][update_return_url]=&payload[subscription][product][initial_charge_after_trial]=false&payload[subscription][product][version_number]=7&payload[subscription][product][update_return_params]=&payload[subscription][product][product_family][id]=527890&payload[subscription][product][product_family][name]=Acme%20Projects&payload[subscription][product][product_family][description]=&payload[subscription][product][product_family][handle]=billing-plans&payload[subscription][product][product_family][accounting_code]=&payload[subscription][product][public_signup_pages][id]=281054&payload[subscription][product][public_signup_pages][return_url]=http%3A%2F%2Fwww.example.com%3Fsuccessfulsignup&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fkqvmfrbgd89q%2Fbasic&payload[subscription][product][public_signup_pages][id]=281240&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fdkffht5dxfd8%2Fbasic&payload[subscription][product][public_signup_pages][id]=282694&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fjwffwgdd95s8%2Fbasic&payload[subscription][credit_card][id]=10102821&payload[subscription][credit_card][first_name]=Alan&payload[subscription][credit_card][last_name]=Test&payload[subscription][credit_card][masked_card_number]=XXXX-XXXX-XXXX-1&payload[subscription][credit_card][card_type]=bogus&payload[subscription][credit_card][expiration_month]=10&payload[subscription][credit_card][expiration_year]=2020&payload[subscription][credit_card][customer_id]=14585695&payload[subscription][credit_card][current_vault]=bogus&payload[subscription][credit_card][vault_token]=1&payload[subscription][credit_card][billing_address]=&payload[subscription][credit_card][billing_city]=&payload[subscription][credit_card][billing_state]=&payload[subscription][credit_card][billing_zip]=&payload[subscription][credit_card][billing_country]=&payload[subscription][credit_card][customer_vault_token]=&payload[subscription][credit_card][billing_address_2]=&payload[subscription][credit_card][payment_type]=credit_card&payload[subscription][credit_card][site_gateway_setting_id]=&payload[subscription][credit_card][gateway_handle]=&payload[transaction][id]=161537369&payload[transaction][subscription_id]=15100141&payload[transaction][type]=Payment&payload[transaction][kind]=&payload[transaction][transaction_type]=payment&payload[transaction][success]=true&payload[transaction][amount_in_cents]=6400&payload[transaction][memo]=Alan%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[transaction][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[transaction][starting_balance_in_cents]=6400&payload[transaction][ending_balance_in_cents]=0&payload[transaction][gateway_used]=bogus&payload[transaction][gateway_transaction_id]=53433&payload[transaction][gateway_response_code]=&payload[transaction][gateway_order_id]=&payload[transaction][payment_id]=&payload[transaction][product_id]=3792003&payload[transaction][tax_id]=&payload[transaction][component_id]=&payload[transaction][statement_id]=80168049&payload[transaction][customer_id]=14585695&payload[transaction][card_number]=XXXX-XXXX-XXXX-1&payload[transaction][card_expiration]=10%2F2020&payload[transaction][card_type]=bogus&payload[transaction][refunded_amount_in_cents]=0&payload[transaction][invoice_id]=&payload[event_id]=347299364", "signature": "fbcf2f6be579f9658cff90c4373e0ca2", "signature_hmac_sha_256": "db96654f5456c5460062feb944ac8bb1418f9d181ae04a8ed982fe9ffdca8de1" } @@ -208,7 +208,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`CreateOrUpdateEndpointRequest`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint | +| `body` | [`CreateOrUpdateEndpointRequest`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint. | ## Response Type @@ -261,7 +261,7 @@ puts result # List Endpoints -Returns created endpoints for a site. +Lists endpoints configured for a site. ```ruby def list_endpoints @@ -336,7 +336,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `endpoint_id` | `Integer` | Template, Required | The Advanced Billing id for the endpoint that should be updated | -| `body` | [`CreateOrUpdateEndpointRequest`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint | +| `body` | [`CreateOrUpdateEndpointRequest`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint. | ## Response Type diff --git a/doc/models/account-balance.md b/doc/models/account-balance.md index bbb6e72..4841e00 100644 --- a/doc/models/account-balance.md +++ b/doc/models/account-balance.md @@ -13,13 +13,13 @@ | `automatic_balance_in_cents` | `Integer` | Optional | The automatic balance in cents. | | `remittance_balance_in_cents` | `Integer` | Optional | The remittance balance in cents. | -## Example (as JSON) - -```json -{ - "balance_in_cents": 16, - "automatic_balance_in_cents": 226, - "remittance_balance_in_cents": 62 -} +## Example + +```ruby +account_balance = AccountBalance.new( + balance_in_cents: 166, + automatic_balance_in_cents: 76, + remittance_balance_in_cents: 212 +) ``` diff --git a/doc/models/account-balances.md b/doc/models/account-balances.md index 4075078..f2be7a6 100644 --- a/doc/models/account-balances.md +++ b/doc/models/account-balances.md @@ -9,41 +9,41 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `open_invoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's open, payable invoices. | -| `pending_invoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's pending, payable invoices. | +| `open_invoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's open, payable invoices. | +| `pending_invoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's pending, payable invoices. | | `pending_discounts` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Pending Discount account. | | `service_credits` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Service Credit account. | | `prepayments` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Prepayment account. | -## Example (as JSON) - -```json -{ - "open_invoices": { - "balance_in_cents": 40, - "automatic_balance_in_cents": 202, - "remittance_balance_in_cents": 170 - }, - "pending_invoices": { - "balance_in_cents": 0, - "automatic_balance_in_cents": 242, - "remittance_balance_in_cents": 46 - }, - "pending_discounts": { - "balance_in_cents": 88, - "automatic_balance_in_cents": 154, - "remittance_balance_in_cents": 134 - }, - "service_credits": { - "balance_in_cents": 84, - "automatic_balance_in_cents": 70, - "remittance_balance_in_cents": 38 - }, - "prepayments": { - "balance_in_cents": 192, - "automatic_balance_in_cents": 178, - "remittance_balance_in_cents": 146 - } -} +## Example + +```ruby +account_balances = AccountBalances.new( + open_invoices: AccountBalance.new( + balance_in_cents: 40, + automatic_balance_in_cents: 202, + remittance_balance_in_cents: 170 + ), + pending_invoices: AccountBalance.new( + balance_in_cents: 0, + automatic_balance_in_cents: 242, + remittance_balance_in_cents: 46 + ), + pending_discounts: AccountBalance.new( + balance_in_cents: 88, + automatic_balance_in_cents: 154, + remittance_balance_in_cents: 134 + ), + service_credits: AccountBalance.new( + balance_in_cents: 84, + automatic_balance_in_cents: 70, + remittance_balance_in_cents: 38 + ), + prepayments: AccountBalance.new( + balance_in_cents: 192, + automatic_balance_in_cents: 178, + remittance_balance_in_cents: 146 + ) +) ``` diff --git a/doc/models/ach-agreement.md b/doc/models/ach-agreement.md index 78d049c..f60cb2d 100644 --- a/doc/models/ach-agreement.md +++ b/doc/models/ach-agreement.md @@ -16,14 +16,14 @@ | `authorizer_last_name` | `String` | Optional | (Required when providing ACH agreement params) The last name of the person authorizing the ACH agreement. | | `ip_address` | `String` | Optional | (Required when providing ACH agreement params) The IP address of the person authorizing the ACH agreement. | -## Example (as JSON) - -```json -{ - "agreement_terms": "agreement_terms4", - "authorizer_first_name": "authorizer_first_name2", - "authorizer_last_name": "authorizer_last_name2", - "ip_address": "ip_address2" -} +## Example + +```ruby +ach_agreement = ACHAgreement.new( + agreement_terms: 'agreement_terms0', + authorizer_first_name: 'authorizer_first_name6', + authorizer_last_name: 'authorizer_last_name8', + ip_address: 'ip_address8' +) ``` diff --git a/doc/models/activate-event-based-component.md b/doc/models/activate-event-based-component.md index 37ee98f..16291de 100644 --- a/doc/models/activate-event-based-component.md +++ b/doc/models/activate-event-based-component.md @@ -13,33 +13,33 @@ | `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | | `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) - -```json -{ - "price_point_id": 44, - "billing_schedule": { - "initial_billing_at": "2016-03-13" - }, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} +## Example + +```ruby +activate_event_based_component = ActivateEventBasedComponent.new( + price_point_id: 166, + billing_schedule: BillingSchedule.new( + initial_billing_at: Date.iso8601('2016-03-13') + ), + custom_price: ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 66, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 174 + ) +) ``` diff --git a/doc/models/activate-subscription-request.md b/doc/models/activate-subscription-request.md index bd1ba90..51f62bc 100644 --- a/doc/models/activate-subscription-request.md +++ b/doc/models/activate-subscription-request.md @@ -9,13 +9,13 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `revert_on_failure` | `TrueClass \| FalseClass` | Optional | You may choose how to handle the activation failure. `true` means do not change the subscription’s state and billing period. `false` means to continue through with the activation and enter an end of life state. If this parameter is omitted or `null` is passed it will default to value set in the site settings (default: `true`) | +| `revert_on_failure` | `TrueClass \| FalseClass` | Optional | You may choose how to handle the activation failure. `true` means do not change the subscription’s state and billing period. `false` means to continue through with the activation and enter an end-of-life state. If this parameter is omitted or `null` is passed it will default to the value set in the site settings (default: `true`). | -## Example (as JSON) +## Example -```json -{ - "revert_on_failure": false -} +```ruby +activate_subscription_request = ActivateSubscriptionRequest.new( + revert_on_failure: false +) ``` diff --git a/doc/models/add-coupons-request.md b/doc/models/add-coupons-request.md index bee9a51..29688d3 100644 --- a/doc/models/add-coupons-request.md +++ b/doc/models/add-coupons-request.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `codes` | `Array[String]` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "codes": [ - "codes0", - "codes1" +```ruby +add_coupons_request = AddCouponsRequest.new( + codes: [ + 'codes6', + 'codes7' ] -} +) ``` diff --git a/doc/models/add-subscription-to-a-group.md b/doc/models/add-subscription-to-a-group.md index aa4cda2..4db58d7 100644 --- a/doc/models/add-subscription-to-a-group.md +++ b/doc/models/add-subscription-to-a-group.md @@ -11,21 +11,21 @@ | --- | --- | --- | --- | | `group` | [`GroupSettings`](../../doc/models/group-settings.md) | Optional | - | -## Example (as JSON) - -```json -{ - "group": { - "target": { - "type": "parent", - "id": 236 - }, - "billing": { - "accrue": false, - "align_date": false, - "prorate": false - } - } -} +## Example + +```ruby +add_subscription_to_a_group = AddSubscriptionToAGroup.new( + group: GroupSettings.new( + target: GroupTarget.new( + type: GroupTargetType::PARENT, + id: 236 + ), + billing: GroupBilling.new( + accrue: false, + align_date: false, + prorate: false + ) + ) +) ``` diff --git a/doc/models/address-change.md b/doc/models/address-change.md index 81b4da7..a04e4b3 100644 --- a/doc/models/address-change.md +++ b/doc/models/address-change.md @@ -12,24 +12,24 @@ | `before` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Required | - | | `after` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Required | - | -## Example (as JSON) - -```json -{ - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } -} +## Example + +```ruby +address_change = AddressChange.new( + before: InvoiceAddress.new( + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4' + ), + after: InvoiceAddress.new( + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4' + ) +) ``` diff --git a/doc/models/agreement-acceptance.md b/doc/models/agreement-acceptance.md index d4bb235..c1a2b2c 100644 --- a/doc/models/agreement-acceptance.md +++ b/doc/models/agreement-acceptance.md @@ -12,21 +12,21 @@ Required when creating a subscription with Maxio Payments. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `ip_address` | `String` | Optional | Required when providing agreement acceptance params. | -| `terms_url` | `String` | Optional | Required when creating a subscription with Maxio Payments. Either terms_url or provacy_policy_url required when providing agreement_acceptance params. | +| `terms_url` | `String` | Optional | Required when creating a subscription with Maxio Payments. Either terms_url or privacy_policy_url is required when providing agreement_acceptance params. | | `privacy_policy_url` | `String` | Optional | - | | `return_refund_policy_url` | `String` | Optional | - | | `delivery_policy_url` | `String` | Optional | - | | `secure_checkout_policy_url` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "ip_address": "ip_address2", - "terms_url": "terms_url0", - "privacy_policy_url": "privacy_policy_url0", - "return_refund_policy_url": "return_refund_policy_url4", - "delivery_policy_url": "delivery_policy_url8" -} +```ruby +agreement_acceptance = AgreementAcceptance.new( + ip_address: 'ip_address8', + terms_url: 'terms_url6', + privacy_policy_url: 'privacy_policy_url4', + return_refund_policy_url: 'return_refund_policy_url0', + delivery_policy_url: 'delivery_policy_url4' +) ``` diff --git a/doc/models/all-vaults.md b/doc/models/all-vaults.md index 5e5e19d..9a67c57 100644 --- a/doc/models/all-vaults.md +++ b/doc/models/all-vaults.md @@ -46,3 +46,9 @@ The vault that stores the payment profile with the provided `vault_token`. Use ` | `UNIPAAS` | | `WIRECARD` | +## Example + +```ruby +all_vaults = AllVaults::STRIPE_CONNECT +``` + diff --git a/doc/models/allocate-components.md b/doc/models/allocate-components.md index 0cbfc61..546c0e5 100644 --- a/doc/models/allocate-components.md +++ b/doc/models/allocate-components.md @@ -15,35 +15,27 @@ | `accrue_charge` | `TrueClass \| FalseClass` | Optional | - | | `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | -| `payment_collection_method` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription | +| `payment_collection_method` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription. | | `initiate_dunning` | `TrueClass \| FalseClass` | Optional | If true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. | -## Example (as JSON) - -```json -{ - "proration_upgrade_scheme": "proration_upgrade_scheme2", - "proration_downgrade_scheme": "proration_downgrade_scheme0", - "allocations": [ - { - "quantity": 26.48, - "decimal_quantity": "decimal_quantity8", - "previous_quantity": 55.5, - "decimal_previous_quantity": "decimal_previous_quantity2", - "component_id": 242, - "memo": "memo6" - }, - { - "quantity": 26.48, - "decimal_quantity": "decimal_quantity8", - "previous_quantity": 55.5, - "decimal_previous_quantity": "decimal_previous_quantity2", - "component_id": 242, - "memo": "memo6" - } +## Example + +```ruby +allocate_components = AllocateComponents.new( + proration_upgrade_scheme: 'proration_upgrade_scheme2', + proration_downgrade_scheme: 'proration_downgrade_scheme0', + allocations: [ + CreateAllocation.new( + quantity: 26.48, + decimal_quantity: 'decimal_quantity8', + previous_quantity: 55.5, + decimal_previous_quantity: 'decimal_previous_quantity2', + component_id: 242, + memo: 'memo6' + ) ], - "accrue_charge": false, - "upgrade_charge": "full" -} + accrue_charge: false, + upgrade_charge: CreditType::PRORATED +) ``` diff --git a/doc/models/allocation-expiration-date.md b/doc/models/allocation-expiration-date.md index 48f93d0..f19343f 100644 --- a/doc/models/allocation-expiration-date.md +++ b/doc/models/allocation-expiration-date.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `expires_at` | `DateTime` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "expires_at": "2016-03-13T12:52:32.123Z" -} +```ruby +allocation_expiration_date = AllocationExpirationDate.new( + expires_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/allocation-preview-direction.md b/doc/models/allocation-preview-direction.md index 2e12443..4bf6526 100644 --- a/doc/models/allocation-preview-direction.md +++ b/doc/models/allocation-preview-direction.md @@ -12,3 +12,9 @@ | `UPGRADE` | | `DOWNGRADE` | +## Example + +```ruby +allocation_preview_direction = AllocationPreviewDirection::UPGRADE +``` + diff --git a/doc/models/allocation-preview-item.md b/doc/models/allocation-preview-item.md index 348e562..807ac9f 100644 --- a/doc/models/allocation-preview-item.md +++ b/doc/models/allocation-preview-item.md @@ -21,22 +21,22 @@ | `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `price_point_id` | `Integer` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | | `previous_price_point_id` | `Integer` | Optional | - | | `price_point_handle` | `String` | Optional | - | | `price_point_name` | `String` | Optional | - | | `component_handle` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "component_id": 54, - "subscription_id": 54, - "quantity": 78, - "previous_quantity": 192, - "memo": "memo6" -} +```ruby +allocation_preview_item = AllocationPreviewItem.new( + component_id: 78, + subscription_id: 78, + quantity: 102, + previous_quantity: 168, + memo: 'memo6' +) ``` diff --git a/doc/models/allocation-preview-line-item-kind.md b/doc/models/allocation-preview-line-item-kind.md index cc67eef..2bc9ac6 100644 --- a/doc/models/allocation-preview-line-item-kind.md +++ b/doc/models/allocation-preview-line-item-kind.md @@ -16,3 +16,9 @@ A handle for the line item kind for allocation preview | `COUPON` | | `TAX` | +## Example + +```ruby +allocation_preview_line_item_kind = AllocationPreviewLineItemKind::COUPON +``` + diff --git a/doc/models/allocation-preview-line-item.md b/doc/models/allocation-preview-line-item.md index 0d91d2c..21f25fb 100644 --- a/doc/models/allocation-preview-line-item.md +++ b/doc/models/allocation-preview-line-item.md @@ -17,17 +17,17 @@ | `taxable_amount_in_cents` | `Integer` | Optional | - | | `component_id` | `Integer` | Optional | - | | `component_handle` | `String` | Optional | - | -| `direction` | [`AllocationPreviewDirection`](../../doc/models/allocation-preview-direction.md) | Optional | Visible when using Fine-grained Component Control | - -## Example (as JSON) - -```json -{ - "transaction_type": "credit", - "kind": "quantity_based_component", - "amount_in_cents": 24, - "memo": "memo6", - "discount_amount_in_cents": 172 -} +| `direction` | [`AllocationPreviewDirection`](../../doc/models/allocation-preview-direction.md) | Optional | Visible when using Fine-grained Component Control. | + +## Example + +```ruby +allocation_preview_line_item = AllocationPreviewLineItem.new( + transaction_type: LineItemTransactionType::CHARGE, + kind: AllocationPreviewLineItemKind::COUPON, + amount_in_cents: 58, + memo: 'memo8', + discount_amount_in_cents: 138 +) ``` diff --git a/doc/models/allocation-preview-response.md b/doc/models/allocation-preview-response.md index fd9d810..80b4981 100644 --- a/doc/models/allocation-preview-response.md +++ b/doc/models/allocation-preview-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `allocation_preview` | [`AllocationPreview`](../../doc/models/allocation-preview.md) | Required | - | -## Example (as JSON) - -```json -{ - "allocation_preview": { - "start_date": "2016-03-13T12:52:32.123Z", - "end_date": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 240, - "total_tax_in_cents": 108, - "total_discount_in_cents": 142 - } -} +## Example + +```ruby +allocation_preview_response = AllocationPreviewResponse.new( + allocation_preview: AllocationPreview.new( + start_date: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + end_date: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + subtotal_in_cents: 240, + total_tax_in_cents: 108, + total_discount_in_cents: 142 + ) +) ``` diff --git a/doc/models/allocation-preview.md b/doc/models/allocation-preview.md index 978182c..1f865fc 100644 --- a/doc/models/allocation-preview.md +++ b/doc/models/allocation-preview.md @@ -23,15 +23,15 @@ | `period_type` | `String` | Optional | - | | `existing_balance_in_cents` | `Integer` | Optional | An integer representing the amount of the subscription's current balance | -## Example (as JSON) - -```json -{ - "start_date": "2016-03-13T12:52:32.123Z", - "end_date": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 4, - "total_tax_in_cents": 128, - "total_discount_in_cents": 122 -} +## Example + +```ruby +allocation_preview = AllocationPreview.new( + start_date: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + end_date: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + subtotal_in_cents: 240, + total_tax_in_cents: 108, + total_discount_in_cents: 142 +) ``` diff --git a/doc/models/allocation-response.md b/doc/models/allocation-response.md index 59d3e1a..d5fc137 100644 --- a/doc/models/allocation-response.md +++ b/doc/models/allocation-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `allocation` | [`Allocation`](../../doc/models/allocation.md) | Optional | - | -## Example (as JSON) - -```json -{ - "allocation": { - "allocation_id": 238, - "component_id": 8, - "component_handle": "component_handle8", - "subscription_id": 8, - "quantity": 32 - } -} +## Example + +```ruby +allocation_response = AllocationResponse.new( + allocation: Allocation.new( + allocation_id: 238, + component_id: 8, + component_handle: 'component_handle8', + subscription_id: 8, + quantity: 32 + ) +) ``` diff --git a/doc/models/allocation-settings.md b/doc/models/allocation-settings.md index d056e34..04eae61 100644 --- a/doc/models/allocation-settings.md +++ b/doc/models/allocation-settings.md @@ -13,13 +13,13 @@ | `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `accrue_charge` | `String` | Optional | Either "true" or "false". | -## Example (as JSON) - -```json -{ - "upgrade_charge": "none", - "downgrade_credit": "prorated", - "accrue_charge": "accrue_charge0" -} +## Example + +```ruby +allocation_settings = AllocationSettings.new( + upgrade_charge: CreditType::PRORATED, + downgrade_credit: CreditType::PRORATED, + accrue_charge: 'accrue_charge0' +) ``` diff --git a/doc/models/allocation.md b/doc/models/allocation.md index 8f16086..88c9709 100644 --- a/doc/models/allocation.md +++ b/doc/models/allocation.md @@ -9,21 +9,21 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `allocation_id` | `Integer` | Optional | The allocation unique id | -| `component_id` | `Integer` | Optional | The integer component ID for the allocation. This references a component that you have created in your Product setup | -| `component_handle` | `String` | Optional | The handle of the component. This references a component that you have created in your Product setup | -| `subscription_id` | `Integer` | Optional | The integer subscription ID for the allocation. This references a unique subscription in your Site | +| `allocation_id` | `Integer` | Optional | The allocation unique ID | +| `component_id` | `Integer` | Optional | The integer component ID for the allocation. This references a component that you have created in your Product setup. | +| `component_handle` | `String` | Optional | The handle of the component. This references a component that you have created in your Product setup. | +| `subscription_id` | `Integer` | Optional | The integer subscription ID for the allocation. This references a unique subscription in your Site. | | `quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `previous_quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `memo` | `String` | Optional | The memo passed when the allocation was created | -| `timestamp` | `DateTime` | Optional | The time that the allocation was recorded, in format and UTC timezone, i.e. 2012-11-20T22:00:37Z | +| `timestamp` | `DateTime` | Optional | The time that the allocation was recorded, in ISO 8601 format and UTC timezone, e.g., 2012-11-20T22:00:37Z | | `created_at` | `DateTime` | Optional | Timestamp indicating when this allocation was created | | `proration_upgrade_scheme` | `String` | Optional | The scheme used if the proration was an upgrade. This is only present when the allocation was created mid-period. | | `proration_downgrade_scheme` | `String` | Optional | The scheme used if the proration was a downgrade. This is only present when the allocation was created mid-period. | | `price_point_id` | `Integer` | Optional | - | | `price_point_name` | `String` | Optional | - | | `price_point_handle` | `String` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | | `previous_price_point_id` | `Integer` | Optional | - | | `accrue_charge` | `TrueClass \| FalseClass` | Optional | If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately. | @@ -35,15 +35,15 @@ | `used_quantity` | `Integer` | Optional | - | | `charge_id` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "allocation_id": 102, - "component_id": 144, - "component_handle": "component_handle0", - "subscription_id": 144, - "quantity": 168 -} +```ruby +allocation = Allocation.new( + allocation_id: 238, + component_id: 8, + component_handle: 'component_handle8', + subscription_id: 8, + quantity: 32 +) ``` diff --git a/doc/models/apple-pay-payment-profile.md b/doc/models/apple-pay-payment-profile.md index 0d374a4..a278937 100644 --- a/doc/models/apple-pay-payment-profile.md +++ b/doc/models/apple-pay-payment-profile.md @@ -12,7 +12,7 @@ | `id` | `Integer` | Optional | The Chargify-assigned ID of the Apple Pay payment profile. | | `first_name` | `String` | Optional | The first name of the Apple Pay account holder | | `last_name` | `String` | Optional | The last name of the Apple Pay account holder | -| `customer_id` | `Integer` | Optional | The Chargify-assigned id for the customer record to which the Apple Pay account belongs | +| `customer_id` | `Integer` | Optional | The Chargify-assigned ID for the customer record to which the Apple Pay account belongs | | `current_vault` | [`ApplePayVault`](../../doc/models/apple-pay-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. | | `vault_token` | `String` | Optional | The “token” provided by your vault storage for an already stored payment profile | | `billing_address` | `String` | Optional | The current billing street address for the Apple Pay account | @@ -28,16 +28,16 @@ | `created_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was created | | `updated_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was last updated | -## Example (as JSON) - -```json -{ - "payment_type": "apple_pay", - "id": 60, - "first_name": "first_name2", - "last_name": "last_name0", - "customer_id": 98, - "current_vault": "braintree_blue" -} +## Example + +```ruby +apple_pay_payment_profile = ApplePayPaymentProfile.new( + payment_type: PaymentType::APPLE_PAY, + id: 188, + first_name: 'first_name2', + last_name: 'last_name0', + customer_id: 226, + current_vault: ApplePayVault::BRAINTREE_BLUE +) ``` diff --git a/doc/models/apple-pay-vault.md b/doc/models/apple-pay-vault.md index 9e66d7b..c4ad208 100644 --- a/doc/models/apple-pay-vault.md +++ b/doc/models/apple-pay-vault.md @@ -13,3 +13,9 @@ The vault that stores the payment profile with the provided vault_token. | --- | | `BRAINTREE_BLUE` | +## Example + +```ruby +apple_pay_vault = ApplePayVault::BRAINTREE_BLUE +``` + diff --git a/doc/models/applied-credit-note-data.md b/doc/models/applied-credit-note-data.md index c9c3d3d..bf7e2cc 100644 --- a/doc/models/applied-credit-note-data.md +++ b/doc/models/applied-credit-note-data.md @@ -12,12 +12,12 @@ | `uid` | `String` | Optional | The UID of the credit note | | `number` | `String` | Optional | The number of the credit note | -## Example (as JSON) +## Example -```json -{ - "uid": "uid2", - "number": "number0" -} +```ruby +applied_credit_note_data = AppliedCreditNoteData.new( + uid: 'uid2', + number: 'number0' +) ``` diff --git a/doc/models/apply-credit-note-event-data.md b/doc/models/apply-credit-note-event-data.md index 446c647..d020e32 100644 --- a/doc/models/apply-credit-note-event-data.md +++ b/doc/models/apply-credit-note-event-data.md @@ -19,32 +19,36 @@ Example schema for an `apply_credit_note` event | `transaction_time` | `DateTime` | Optional | The time the credit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | | `memo` | `String` | Optional | The credit note memo. | | `role` | `String` | Optional | The role of the credit note (e.g. 'general') | -| `consolidated_invoice` | `TrueClass \| FalseClass` | Optional | Shows whether it was applied to consolidated invoice or not | +| `consolidated_invoice` | `TrueClass \| FalseClass` | Optional | Shows whether it was applied to consolidated invoice or not. | | `applied_credit_notes` | [`Array[AppliedCreditNoteData]`](../../doc/models/applied-credit-note-data.md) | Optional | List of credit notes applied to children invoices (if consolidated invoice) | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "credit_note_number": "credit_note_number4", - "credit_note_uid": "credit_note_uid4", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo6", - "role": "role4", - "consolidated_invoice": false, - "applied_credit_notes": [ - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - } +## Example + +```ruby +apply_credit_note_event_data = ApplyCreditNoteEventData.new( + uid: 'uid8', + credit_note_number: 'credit_note_number8', + credit_note_uid: 'credit_note_uid8', + original_amount: 'original_amount2', + applied_amount: 'applied_amount0', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + memo: 'memo2', + role: 'role8', + consolidated_invoice: false, + applied_credit_notes: [ + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ), + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ), + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ) ] -} +) ``` diff --git a/doc/models/apply-credit-note-event.md b/doc/models/apply-credit-note-event.md index 2b9a650..05eca48 100644 --- a/doc/models/apply-credit-note-event.md +++ b/doc/models/apply-credit-note-event.md @@ -15,49 +15,49 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::APPLY_CREDIT_NOTE` | | `event_data` | [`ApplyCreditNoteEventData`](../../doc/models/apply-credit-note-event-data.md) | Required | Example schema for an `apply_credit_note` event | -## Example (as JSON) - -```json -{ - "id": 214, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "apply_credit_note", - "event_data": { - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo0", - "role": "role0", - "consolidated_invoice": false, - "applied_credit_notes": [ - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - } +## Example + +```ruby +apply_credit_note_event = ApplyCreditNoteEvent.new( + id: 56, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::APPLY_CREDIT_NOTE, + event_data: ApplyCreditNoteEventData.new( + uid: 'uid6', + credit_note_number: 'credit_note_number0', + credit_note_uid: 'credit_note_uid0', + original_amount: 'original_amount0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + memo: 'memo0', + role: 'role0', + consolidated_invoice: false, + applied_credit_notes: [ + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ), + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ), + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ) ] - } -} + ) +) ``` diff --git a/doc/models/apply-debit-note-event-data.md b/doc/models/apply-debit-note-event-data.md index 9d00afa..6b8fd59 100644 --- a/doc/models/apply-debit-note-event-data.md +++ b/doc/models/apply-debit-note-event-data.md @@ -18,16 +18,16 @@ Example schema for an `apply_debit_note` event | `memo` | `String` | Optional | The debit note memo. | | `transaction_time` | `DateTime` | Optional | The time the debit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | -## Example (as JSON) - -```json -{ - "debit_note_number": "debit_note_number0", - "debit_note_uid": "debit_note_uid6", - "original_amount": "original_amount4", - "applied_amount": "applied_amount8", - "memo": "memo4", - "transaction_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +apply_debit_note_event_data = ApplyDebitNoteEventData.new( + debit_note_number: 'debit_note_number2', + debit_note_uid: 'debit_note_uid8', + original_amount: 'original_amount6', + applied_amount: 'applied_amount6', + memo: 'memo6', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/apply-debit-note-event.md b/doc/models/apply-debit-note-event.md index fa5c13b..36d89c3 100644 --- a/doc/models/apply-debit-note-event.md +++ b/doc/models/apply-debit-note-event.md @@ -15,32 +15,32 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::APPLY_DEBIT_NOTE` | | `event_data` | [`ApplyDebitNoteEventData`](../../doc/models/apply-debit-note-event-data.md) | Required | Example schema for an `apply_debit_note` event | -## Example (as JSON) - -```json -{ - "id": 164, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "apply_debit_note", - "event_data": { - "debit_note_number": "debit_note_number6", - "debit_note_uid": "debit_note_uid2", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "memo": "memo0", - "transaction_time": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +apply_debit_note_event = ApplyDebitNoteEvent.new( + id: 216, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::APPLY_DEBIT_NOTE, + event_data: ApplyDebitNoteEventData.new( + debit_note_number: 'debit_note_number6', + debit_note_uid: 'debit_note_uid2', + original_amount: 'original_amount0', + applied_amount: 'applied_amount2', + memo: 'memo0', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/apply-payment-event-data.md b/doc/models/apply-payment-event-data.md index c86f574..250d2b3 100644 --- a/doc/models/apply-payment-event-data.md +++ b/doc/models/apply-payment-event-data.md @@ -23,23 +23,23 @@ Example schema for an `apply_payment` event | `prepayment` | `TrueClass \| FalseClass` | Optional | - | | `external` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "consolidation_level": "child", - "memo": "memo8", - "original_amount": "original_amount8", - "applied_amount": "applied_amount4", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" - }, - "transaction_id": 196, - "parent_invoice_number": 174, - "remaining_prepayment_amount": "remaining_prepayment_amount6", - "prepayment": false, - "external": false -} +## Example + +```ruby +apply_payment_event_data = ApplyPaymentEventData.new( + consolidation_level: InvoiceConsolidationLevel::PARENT, + memo: 'memo2', + original_amount: 'original_amount2', + applied_amount: 'applied_amount0', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + payment_method: PaymentMethodApplePay.new( + type: InvoiceEventPaymentMethod::APPLE_PAY + ), + transaction_id: 112, + parent_invoice_number: 2, + remaining_prepayment_amount: 'remaining_prepayment_amount2', + prepayment: false, + external: false +) ``` diff --git a/doc/models/apply-payment-event.md b/doc/models/apply-payment-event.md index cf02377..d589a7a 100644 --- a/doc/models/apply-payment-event.md +++ b/doc/models/apply-payment-event.md @@ -15,39 +15,39 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::APPLY_PAYMENT` | | `event_data` | [`ApplyPaymentEventData`](../../doc/models/apply-payment-event-data.md) | Required | Example schema for an `apply_payment` event | -## Example (as JSON) - -```json -{ - "id": 234, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "apply_payment", - "event_data": { - "consolidation_level": "child", - "memo": "memo0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" - }, - "transaction_id": 78, - "parent_invoice_number": 36, - "remaining_prepayment_amount": "remaining_prepayment_amount6", - "prepayment": false, - "external": false - } -} +## Example + +```ruby +apply_payment_event = ApplyPaymentEvent.new( + id: 244, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::APPLY_PAYMENT, + event_data: ApplyPaymentEventData.new( + consolidation_level: InvoiceConsolidationLevel::CHILD, + memo: 'memo0', + original_amount: 'original_amount0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + payment_method: PaymentMethodApplePay.new( + type: InvoiceEventPaymentMethod::APPLE_PAY + ), + transaction_id: 78, + parent_invoice_number: 36, + remaining_prepayment_amount: 'remaining_prepayment_amount6', + prepayment: false, + external: false + ) +) ``` diff --git a/doc/models/attribute-error.md b/doc/models/attribute-error.md index fb0f364..21f0ec8 100644 --- a/doc/models/attribute-error.md +++ b/doc/models/attribute-error.md @@ -11,14 +11,15 @@ | --- | --- | --- | --- | | `attribute` | `Array[String]` | Required | - | -## Example (as JSON) - -```json -{ - "attribute": [ - "attribute6", - "attribute7" +## Example + +```ruby +attribute_error = AttributeError.new( + attribute: [ + 'attribute6', + 'attribute5', + 'attribute4' ] -} +) ``` diff --git a/doc/models/auto-invite.md b/doc/models/auto-invite.md index c467ad1..014fd51 100644 --- a/doc/models/auto-invite.md +++ b/doc/models/auto-invite.md @@ -12,3 +12,9 @@ | `NO` | Do not send the invitation email. | | `YES` | Automatically send the invitation email. | +## Example + +```ruby +auto_invite = AutoInvite::NO +``` + diff --git a/doc/models/auto-resume.md b/doc/models/auto-resume.md index 87f9cdf..5078faa 100644 --- a/doc/models/auto-resume.md +++ b/doc/models/auto-resume.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `automatically_resume_at` | `DateTime` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "automatically_resume_at": "2016-03-13T12:52:32.123Z" -} +```ruby +auto_resume = AutoResume.new( + automatically_resume_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/available-actions.md b/doc/models/available-actions.md index 29da049..94657f7 100644 --- a/doc/models/available-actions.md +++ b/doc/models/available-actions.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `send_email` | [`SendEmail`](../../doc/models/send-email.md) | Optional | - | -## Example (as JSON) - -```json -{ - "send_email": { - "can_execute": false, - "url": "url0" - } -} +## Example + +```ruby +available_actions = AvailableActions.new( + send_email: SendEmail.new( + can_execute: false, + url: 'url0' + ) +) ``` diff --git a/doc/models/backport-invoice-event.md b/doc/models/backport-invoice-event.md index bf38b70..cd3f75d 100644 --- a/doc/models/backport-invoice-event.md +++ b/doc/models/backport-invoice-event.md @@ -15,35 +15,35 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::BACKPORT_INVOICE` | | `event_data` | [`Invoice`](../../doc/models/invoice.md) | Required | Example schema for an `backport_invoice` event | -## Example (as JSON) - -```json -{ - "id": 78, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "backport_invoice", - "event_data": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 206, - "uid": "uid6", - "site_id": 132, - "customer_id": 244, - "subscription_id": 60 - } -} +## Example + +```ruby +backport_invoice_event = BackportInvoiceEvent.new( + id: 236, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::BACKPORT_INVOICE, + event_data: Invoice.new( + id: 206, + uid: 'uid6', + site_id: 132, + customer_id: 244, + subscription_id: 60, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ) +) ``` diff --git a/doc/models/bank-account-attributes.md b/doc/models/bank-account-attributes.md index 658f5ae..d635a43 100644 --- a/doc/models/bank-account-attributes.md +++ b/doc/models/bank-account-attributes.md @@ -11,26 +11,26 @@ | --- | --- | --- | --- | | `chargify_token` | `String` | Optional | - | | `bank_name` | `String` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | -| `bank_routing_number` | `String` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | +| `bank_routing_number` | `String` | Optional | (Required when creating a subscription with ACH; optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API. | | `bank_account_number` | `String` | Optional | (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number | | `bank_account_type` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | -| `bank_branch_code` | `String` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | -| `bank_iban` | `String` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | +| `bank_branch_code` | `String` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided. | +| `bank_iban` | `String` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided. | | `bank_account_holder_type` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Optional | - | | `current_vault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | | `vault_token` | `String` | Optional | - | | `customer_vault_token` | `String` | Optional | (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | -## Example (as JSON) +## Example -```json -{ - "chargify_token": "chargify_token0", - "bank_name": "bank_name2", - "bank_routing_number": "bank_routing_number8", - "bank_account_number": "bank_account_number4", - "bank_account_type": "checking" -} +```ruby +bank_account_attributes = BankAccountAttributes.new( + chargify_token: 'chargify_token6', + bank_name: 'bank_name6', + bank_routing_number: 'bank_routing_number4', + bank_account_number: 'bank_account_number0', + bank_account_type: BankAccountType::CHECKING +) ``` diff --git a/doc/models/bank-account-holder-type.md b/doc/models/bank-account-holder-type.md index 129dc3b..96c3cb0 100644 --- a/doc/models/bank-account-holder-type.md +++ b/doc/models/bank-account-holder-type.md @@ -14,3 +14,9 @@ Defaults to personal | `PERSONAL` | | `BUSINESS` | +## Example + +```ruby +bank_account_holder_type = BankAccountHolderType::PERSONAL +``` + diff --git a/doc/models/bank-account-payment-profile.md b/doc/models/bank-account-payment-profile.md index 68a15e4..c3171ad 100644 --- a/doc/models/bank-account-payment-profile.md +++ b/doc/models/bank-account-payment-profile.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `Integer` | Optional | The Chargify-assigned ID of the stored bank account. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer | +| `id` | `Integer` | Optional | The Chargify-assigned ID of the stored bank account. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer. | | `first_name` | `String` | Optional | The first name of the bank account holder | | `last_name` | `String` | Optional | The last name of the bank account holder | -| `customer_id` | `Integer` | Optional | The Chargify-assigned id for the customer record to which the bank account belongs | +| `customer_id` | `Integer` | Optional | The Chargify-assigned ID for the customer record to which the bank account belongs | | `current_vault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | | `vault_token` | `String` | Optional | The "token" provided by your vault storage for an already stored payment profile | | `billing_address` | `String` | Optional | The current billing street address for the bank account | @@ -23,28 +23,27 @@ | `customer_vault_token` | `String` | Optional | (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token. | | `billing_address_2` | `String` | Optional | The current billing street address, second line, for the bank account | | `bank_name` | `String` | Optional | The bank where the account resides | -| `masked_bank_routing_number` | `String` | Optional | A string representation of the stored bank routing number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account | -| `masked_bank_account_number` | `String` | Optional | A string representation of the stored bank account number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111') | +| `masked_bank_routing_number` | `String` | Optional | A string representation of the stored bank routing number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account. | | `bank_account_type` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | | `bank_account_holder_type` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType::BANK_ACCOUNT` | -| `verified` | `TrueClass \| FalseClass` | Optional | denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account

**Default**: `false` | +| `verified` | `TrueClass \| FalseClass` | Optional | Denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account.

**Default**: `false` | | `site_gateway_setting_id` | `Integer` | Optional | - | | `gateway_handle` | `String` | Optional | - | | `created_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was created | | `updated_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was last updated | -## Example (as JSON) - -```json -{ - "payment_type": "bank_account", - "verified": false, - "id": 188, - "first_name": "first_name6", - "last_name": "last_name4", - "customer_id": 226, - "current_vault": "authorizenet" -} +## Example + +```ruby +bank_account_payment_profile = BankAccountPaymentProfile.new( + payment_type: PaymentType::BANK_ACCOUNT, + id: 8, + first_name: 'first_name2', + last_name: 'last_name0', + customer_id: 46, + current_vault: BankAccountVault::GOCARDLESS, + verified: false +) ``` diff --git a/doc/models/bank-account-response.md b/doc/models/bank-account-response.md index 6b72b30..2ff9e92 100644 --- a/doc/models/bank-account-response.md +++ b/doc/models/bank-account-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `payment_profile` | [`BankAccountPaymentProfile`](../../doc/models/bank-account-payment-profile.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "payment_type": "bank_account", - "verified": false, - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "customer_id": 82, - "current_vault": "authorizenet" - } -} +## Example + +```ruby +bank_account_response = BankAccountResponse.new( + payment_profile: BankAccountPaymentProfile.new( + payment_type: PaymentType::BANK_ACCOUNT, + id: 44, + first_name: 'first_name4', + last_name: 'last_name2', + customer_id: 82, + current_vault: BankAccountVault::AUTHORIZENET, + verified: false + ) +) ``` diff --git a/doc/models/bank-account-type.md b/doc/models/bank-account-type.md index 86a4b63..9c66d63 100644 --- a/doc/models/bank-account-type.md +++ b/doc/models/bank-account-type.md @@ -14,3 +14,9 @@ Defaults to checking | `CHECKING` | | `SAVINGS` | +## Example + +```ruby +bank_account_type = BankAccountType::CHECKING +``` + diff --git a/doc/models/bank-account-vault.md b/doc/models/bank-account-vault.md index 9ff1b83..fce9bce 100644 --- a/doc/models/bank-account-vault.md +++ b/doc/models/bank-account-vault.md @@ -20,3 +20,9 @@ The vault that stores the payment profile with the provided vault_token. Use `bo | `MAXP` | | `STRIPE_CONNECT` | +## Example + +```ruby +bank_account_vault = BankAccountVault::BOGUS +``` + diff --git a/doc/models/bank-account-verification-request.md b/doc/models/bank-account-verification-request.md index dca0300..98260ab 100644 --- a/doc/models/bank-account-verification-request.md +++ b/doc/models/bank-account-verification-request.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `bank_account_verification` | [`BankAccountVerification`](../../doc/models/bank-account-verification.md) | Required | - | -## Example (as JSON) - -```json -{ - "bank_account_verification": { - "deposit_1_in_cents": 244, - "deposit_2_in_cents": 6 - } -} +## Example + +```ruby +bank_account_verification_request = BankAccountVerificationRequest.new( + bank_account_verification: BankAccountVerification.new( + deposit_1_in_cents: 244, + deposit_2_in_cents: 6 + ) +) ``` diff --git a/doc/models/bank-account-verification.md b/doc/models/bank-account-verification.md index e9d7af1..f7f9409 100644 --- a/doc/models/bank-account-verification.md +++ b/doc/models/bank-account-verification.md @@ -12,12 +12,12 @@ | `deposit_1_in_cents` | `Integer` | Optional | - | | `deposit_2_in_cents` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "deposit_1_in_cents": 142, - "deposit_2_in_cents": 132 -} +```ruby +bank_account_verification = BankAccountVerification.new( + deposit_1_in_cents: 244, + deposit_2_in_cents: 6 +) ``` diff --git a/doc/models/base-refund-error.md b/doc/models/base-refund-error.md index 1520cb1..e43b8b4 100644 --- a/doc/models/base-refund-error.md +++ b/doc/models/base-refund-error.md @@ -11,24 +11,15 @@ | --- | --- | --- | --- | | `base` | `Array[Object]` | Optional | - | -## Example (as JSON) - -```json -{ - "base": [ - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - } +## Example + +```ruby +base_refund_error = BaseRefundError.new( + base: [ + { 'key1' => 'val1', 'key2' => 'val2' }, + { 'key1' => 'val1', 'key2' => 'val2' }, + { 'key1' => 'val1', 'key2' => 'val2' } ] -} +) ``` diff --git a/doc/models/base-string-error.md b/doc/models/base-string-error.md index dd5c105..2e83529 100644 --- a/doc/models/base-string-error.md +++ b/doc/models/base-string-error.md @@ -13,13 +13,14 @@ The error is base if it is not directly associated with a single attribute. | --- | --- | --- | --- | | `base` | `Array[String]` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "base": [ - "base3" +```ruby +base_string_error = BaseStringError.new( + base: [ + 'base3', + 'base4' ] -} +) ``` diff --git a/doc/models/basic-date-field.md b/doc/models/basic-date-field.md index 8bb9591..8ce27e4 100644 --- a/doc/models/basic-date-field.md +++ b/doc/models/basic-date-field.md @@ -16,7 +16,7 @@ Allows to filter by `created_at` or `updated_at`. ## Example -``` -updated_at +```ruby +basic_date_field = BasicDateField::UPDATED_AT ``` diff --git a/doc/models/batch-job-response.md b/doc/models/batch-job-response.md index 575293f..2f02eb8 100644 --- a/doc/models/batch-job-response.md +++ b/doc/models/batch-job-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `batchjob` | [`BatchJob`](../../doc/models/batch-job.md) | Required | - | -## Example (as JSON) - -```json -{ - "batchjob": { - "id": 54, - "finished_at": "2016-03-13T12:52:32.123Z", - "row_count": 62, - "created_at": "2016-03-13T12:52:32.123Z", - "completed": "completed4" - } -} +## Example + +```ruby +batch_job_response = BatchJobResponse.new( + batchjob: BatchJob.new( + id: 54, + finished_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + row_count: 62, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + completed: 'completed4' + ) +) ``` diff --git a/doc/models/batch-job.md b/doc/models/batch-job.md index 21b6e7a..5968472 100644 --- a/doc/models/batch-job.md +++ b/doc/models/batch-job.md @@ -15,15 +15,15 @@ | `created_at` | `DateTime` | Optional | - | | `completed` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 246, - "finished_at": "2016-03-13T12:52:32.123Z", - "row_count": 254, - "created_at": "2016-03-13T12:52:32.123Z", - "completed": "completed0" -} +## Example + +```ruby +batch_job = BatchJob.new( + id: 240, + finished_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + row_count: 248, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + completed: 'completed2' +) ``` diff --git a/doc/models/billing-manifest-item.md b/doc/models/billing-manifest-item.md index 6eb0d2d..377a657 100644 --- a/doc/models/billing-manifest-item.md +++ b/doc/models/billing-manifest-item.md @@ -24,15 +24,15 @@ | `period_range_start` | `String` | Optional | - | | `period_range_end` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_type": "info_transaction", - "kind": "baseline", - "amount_in_cents": 216, - "memo": "memo4", - "discount_amount_in_cents": 236 -} +## Example + +```ruby +billing_manifest_item = BillingManifestItem.new( + transaction_type: LineItemTransactionType::PAYMENT_AUTHORIZATION, + kind: BillingManifestLineItemKind::BASELINE, + amount_in_cents: 152, + memo: 'memo0', + discount_amount_in_cents: 92 +) ``` diff --git a/doc/models/billing-manifest-line-item-kind.md b/doc/models/billing-manifest-line-item-kind.md index 1f99b4e..53d2f31 100644 --- a/doc/models/billing-manifest-line-item-kind.md +++ b/doc/models/billing-manifest-line-item-kind.md @@ -18,3 +18,9 @@ A handle for the billing manifest line item kind | `COMPONENT` | | `TAX` | +## Example + +```ruby +billing_manifest_line_item_kind = BillingManifestLineItemKind::COMPONENT +``` + diff --git a/doc/models/billing-manifest.md b/doc/models/billing-manifest.md index 6c19761..1e625be 100644 --- a/doc/models/billing-manifest.md +++ b/doc/models/billing-manifest.md @@ -19,37 +19,37 @@ | `period_type` | `String` | Optional | - | | `existing_balance_in_cents` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } +## Example + +```ruby +billing_manifest = BillingManifest.new( + line_items: [ + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ), + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ), + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ) ], - "total_in_cents": 192, - "total_discount_in_cents": 178, - "total_tax_in_cents": 172, - "subtotal_in_cents": 48 -} + total_in_cents: 6, + total_discount_in_cents: 8, + total_tax_in_cents: 242, + subtotal_in_cents: 118 +) ``` diff --git a/doc/models/billing-schedule.md b/doc/models/billing-schedule.md index d6cef77..96a5c73 100644 --- a/doc/models/billing-schedule.md +++ b/doc/models/billing-schedule.md @@ -13,11 +13,11 @@ Billing schedule settings for component allocations or usages on multi-frequency | --- | --- | --- | --- | | `initial_billing_at` | `Date` | Optional | Custom start date (ISO 8601 date, YYYY-MM-DD) for the component's first billing period. If omitted or null, billing aligns with the product schedule. If provided, date must be on or after the minimum allowed date for the subscription or component. | -## Example (as JSON) +## Example -```json -{ - "initial_billing_at": "2026-01-01" -} +```ruby +billing_schedule = BillingSchedule.new( + initial_billing_at: Date.iso8601('2026-01-01') +) ``` diff --git a/doc/models/breakouts.md b/doc/models/breakouts.md index 9a0d60a..5c6261e 100644 --- a/doc/models/breakouts.md +++ b/doc/models/breakouts.md @@ -14,14 +14,14 @@ | `usage_amount_in_cents` | `Integer` | Optional | - | | `usage_amount_formatted` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "plan_amount_in_cents": 68, - "plan_amount_formatted": "plan_amount_formatted2", - "usage_amount_in_cents": 176, - "usage_amount_formatted": "usage_amount_formatted0" -} +## Example + +```ruby +breakouts = Breakouts.new( + plan_amount_in_cents: 254, + plan_amount_formatted: 'plan_amount_formatted0', + usage_amount_in_cents: 106, + usage_amount_formatted: 'usage_amount_formatted8' +) ``` diff --git a/doc/models/bulk-components-price-point-assignment.md b/doc/models/bulk-components-price-point-assignment.md index b205868..b2e7b9f 100644 --- a/doc/models/bulk-components-price-point-assignment.md +++ b/doc/models/bulk-components-price-point-assignment.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `components` | [`Array[ComponentPricePointAssignment]`](../../doc/models/component-price-point-assignment.md) | Optional | - | -## Example (as JSON) - -```json -{ - "components": [ - { - "component_id": 108, - "price_point": "String5" - } +## Example + +```ruby +bulk_components_price_point_assignment = BulkComponentsPricePointAssignment.new( + components: [ + ComponentPricePointAssignment.new( + component_id: 108, + price_point: 'String5' + ) ] -} +) ``` diff --git a/doc/models/bulk-create-product-price-points-request.md b/doc/models/bulk-create-product-price-points-request.md index efad1a8..5cfc5c5 100644 --- a/doc/models/bulk-create-product-price-points-request.md +++ b/doc/models/bulk-create-product-price-points-request.md @@ -11,24 +11,24 @@ | --- | --- | --- | --- | | `price_points` | [`Array[CreateProductPricePoint]`](../../doc/models/create-product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "name": "name2", - "price_in_cents": 108, - "interval": 92, - "interval_unit": "day", - "use_site_exchange_rate": true, - "handle": "handle8", - "trial_price_in_cents": 196, - "trial_interval": 250, - "trial_interval_unit": "day", - "trial_type": "no_obligation" - } +## Example + +```ruby +bulk_create_product_price_points_request = BulkCreateProductPricePointsRequest.new( + price_points: [ + CreateProductPricePoint.new( + name: 'name2', + price_in_cents: 108, + interval: 92, + interval_unit: IntervalUnit::DAY, + handle: 'handle8', + trial_price_in_cents: 196, + trial_interval: 250, + trial_interval_unit: IntervalUnit::DAY, + trial_type: TrialType::NO_OBLIGATION, + use_site_exchange_rate: true + ) ] -} +) ``` diff --git a/doc/models/bulk-create-product-price-points-response.md b/doc/models/bulk-create-product-price-points-response.md index e143c62..b63a4d8 100644 --- a/doc/models/bulk-create-product-price-points-response.md +++ b/doc/models/bulk-create-product-price-points-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `price_points` | [`Array[ProductPricePoint]`](../../doc/models/product-price-point.md) | Optional | - | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "id": 40, - "name": "name2", - "handle": "handle8", - "price_in_cents": 108, - "interval": 92 - } +## Example + +```ruby +bulk_create_product_price_points_response = BulkCreateProductPricePointsResponse.new( + price_points: [ + ProductPricePoint.new( + id: 40, + name: 'name2', + handle: 'handle8', + price_in_cents: 108, + interval: 92 + ) ] -} +) ``` diff --git a/doc/models/bulk-create-segments.md b/doc/models/bulk-create-segments.md index 3e4e7e0..d1b7981 100644 --- a/doc/models/bulk-create-segments.md +++ b/doc/models/bulk-create-segments.md @@ -11,36 +11,84 @@ | --- | --- | --- | --- | | `segments` | [`Array[CreateSegment]`](../../doc/models/create-segment.md) | Optional | **Constraints**: *Maximum Items*: `2000` | -## Example (as JSON) - -```json -{ - "segments": [ - { - "segment_property_1_value": "String3", - "segment_property_2_value": "String5", - "segment_property_3_value": "String3", - "segment_property_4_value": "String7", - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +## Example + +```ruby +bulk_create_segments = BulkCreateSegments.new( + segments: [ + CreateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + segment_property_1_value: 'String3', + segment_property_2_value: 'String5', + segment_property_3_value: 'String3', + segment_property_4_value: 'String7', + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) + ] + ), + CreateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + segment_property_1_value: 'String3', + segment_property_2_value: 'String5', + segment_property_3_value: 'String3', + segment_property_4_value: 'String7', + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) + ] + ), + CreateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + segment_property_1_value: 'String3', + segment_property_2_value: 'String5', + segment_property_3_value: 'String3', + segment_property_4_value: 'String7', + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] - } + ) ] -} +) ``` diff --git a/doc/models/bulk-update-segments-item.md b/doc/models/bulk-update-segments-item.md index 495e8a6..ce944cb 100644 --- a/doc/models/bulk-update-segments-item.md +++ b/doc/models/bulk-update-segments-item.md @@ -13,19 +13,19 @@ | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array[CreateOrUpdateSegmentPrice]`](../../doc/models/create-or-update-segment-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "id": 180, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +## Example + +```ruby +bulk_update_segments_item = BulkUpdateSegmentsItem.new( + id: 156, + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] -} +) ``` diff --git a/doc/models/bulk-update-segments.md b/doc/models/bulk-update-segments.md index 7d1a90f..006dad3 100644 --- a/doc/models/bulk-update-segments.md +++ b/doc/models/bulk-update-segments.md @@ -11,54 +11,54 @@ | --- | --- | --- | --- | | `segments` | [`Array[BulkUpdateSegmentsItem]`](../../doc/models/bulk-update-segments-item.md) | Optional | **Constraints**: *Maximum Items*: `1000` | -## Example (as JSON) +## Example -```json -{ - "segments": [ - { - "id": 50, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +```ruby +bulk_update_segments = BulkUpdateSegments.new( + segments: [ + BulkUpdateSegmentsItem.new( + id: 50, + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] - }, - { - "id": 50, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } + ), + BulkUpdateSegmentsItem.new( + id: 50, + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] - } + ) ] -} +) ``` diff --git a/doc/models/calendar-billing.md b/doc/models/calendar-billing.md index 8b8ff4b..ee081f1 100644 --- a/doc/models/calendar-billing.md +++ b/doc/models/calendar-billing.md @@ -1,7 +1,7 @@ # Calendar Billing -(Optional). Cannot be used when also specifying next_billing_at +(Optional). Cannot be used when also specifying next_billing_at. ## Structure @@ -14,12 +14,12 @@ | `snap_day` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `calendar_billing_first_charge` | [`FirstChargeType`](../../doc/models/first-charge-type.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "snap_day": 210, - "calendar_billing_first_charge": "prorated" -} +```ruby +calendar_billing = CalendarBilling.new( + snap_day: 170, + calendar_billing_first_charge: FirstChargeType::PRORATED +) ``` diff --git a/doc/models/cancel-grouped-subscriptions-request.md b/doc/models/cancel-grouped-subscriptions-request.md index 95564e1..4394988 100644 --- a/doc/models/cancel-grouped-subscriptions-request.md +++ b/doc/models/cancel-grouped-subscriptions-request.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `charge_unbilled_usage` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "charge_unbilled_usage": false -} +```ruby +cancel_grouped_subscriptions_request = CancelGroupedSubscriptionsRequest.new( + charge_unbilled_usage: false +) ``` diff --git a/doc/models/cancellation-method.md b/doc/models/cancellation-method.md index b0b7765..37cf30e 100644 --- a/doc/models/cancellation-method.md +++ b/doc/models/cancellation-method.md @@ -18,3 +18,9 @@ The process used to cancel the subscription, if the subscription has been cancel | `UNKNOWN` | | `IMPORTED` | +## Example + +```ruby +cancellation_method = CancellationMethod::UNKNOWN +``` + diff --git a/doc/models/cancellation-options.md b/doc/models/cancellation-options.md index 264b144..b19d1d7 100644 --- a/doc/models/cancellation-options.md +++ b/doc/models/cancellation-options.md @@ -12,18 +12,18 @@ | `cancellation_message` | `String` | Optional | An indication as to why the subscription is being canceled. For your internal use. | | `reason_code` | `String` | Optional | The reason code associated with the cancellation. Use the [List Reason Codes](../../doc/controllers/reason-codes.md#list-reason-codes) endpoint to retrieve the reason codes associated with your site. | | `cancel_at_end_of_period` | `TrueClass \| FalseClass` | Optional | When true, the subscription is cancelled at the current period end instead of immediately. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | -| `scheduled_cancellation_at` | `DateTime` | Optional | Schedules the cancellation on the provided date. This is option is not applicable for prepaid subscriptions. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | +| `scheduled_cancellation_at` | `DateTime` | Optional | Schedules the cancellation on the provided date. This option is not applicable for prepaid subscriptions. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | | `refund_prepayment_account_balance` | `TrueClass \| FalseClass` | Optional | Applies to prepaid subscriptions. When true, which is the default, the remaining prepaid balance is refunded as part of cancellation processing. When false, prepaid balance is not refunded as part of cancellation processing. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | -## Example (as JSON) +## Example -```json -{ - "cancellation_message": "cancellation_message0", - "reason_code": "reason_code6", - "cancel_at_end_of_period": false, - "scheduled_cancellation_at": "2016-03-13T12:52:32.123Z", - "refund_prepayment_account_balance": false -} +```ruby +cancellation_options = CancellationOptions.new( + cancellation_message: 'cancellation_message0', + reason_code: 'reason_code6', + cancel_at_end_of_period: false, + scheduled_cancellation_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refund_prepayment_account_balance: false +) ``` diff --git a/doc/models/cancellation-request.md b/doc/models/cancellation-request.md index 7b22904..9b449a2 100644 --- a/doc/models/cancellation-request.md +++ b/doc/models/cancellation-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `subscription` | [`CancellationOptions`](../../doc/models/cancellation-options.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription": { - "cancellation_message": "cancellation_message2", - "reason_code": "reason_code8", - "cancel_at_end_of_period": false, - "scheduled_cancellation_at": "2016-03-13T12:52:32.123Z", - "refund_prepayment_account_balance": false - } -} +## Example + +```ruby +cancellation_request = CancellationRequest.new( + subscription: CancellationOptions.new( + cancellation_message: 'cancellation_message2', + reason_code: 'reason_code8', + cancel_at_end_of_period: false, + scheduled_cancellation_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refund_prepayment_account_balance: false + ) +) ``` diff --git a/doc/models/card-type.md b/doc/models/card-type.md index 4b00c0c..2fa08e9 100644 --- a/doc/models/card-type.md +++ b/doc/models/card-type.md @@ -48,3 +48,9 @@ The type of card used. | `SOLO` | | `LASER` | +## Example + +```ruby +card_type = CardType::BOGUS +``` + diff --git a/doc/models/change-chargeback-status-event-data.md b/doc/models/change-chargeback-status-event-data.md index 825e9df..ced8465 100644 --- a/doc/models/change-chargeback-status-event-data.md +++ b/doc/models/change-chargeback-status-event-data.md @@ -13,11 +13,11 @@ Example schema for an `change_chargeback_status` event | --- | --- | --- | --- | | `chargeback_status` | [`ChargebackStatus`](../../doc/models/chargeback-status.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "chargeback_status": "open" -} +```ruby +change_chargeback_status_event_data = ChangeChargebackStatusEventData.new( + chargeback_status: ChargebackStatus::OPEN +) ``` diff --git a/doc/models/change-chargeback-status-event.md b/doc/models/change-chargeback-status-event.md index bd5a2b3..d9cd455 100644 --- a/doc/models/change-chargeback-status-event.md +++ b/doc/models/change-chargeback-status-event.md @@ -15,27 +15,27 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::CHANGE_CHARGEBACK_STATUS` | | `event_data` | [`ChangeChargebackStatusEventData`](../../doc/models/change-chargeback-status-event-data.md) | Required | Example schema for an `change_chargeback_status` event | -## Example (as JSON) - -```json -{ - "id": 214, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "change_chargeback_status", - "event_data": { - "chargeback_status": "won" - } -} +## Example + +```ruby +change_chargeback_status_event = ChangeChargebackStatusEvent.new( + id: 114, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CHANGE_CHARGEBACK_STATUS, + event_data: ChangeChargebackStatusEventData.new( + chargeback_status: ChargebackStatus::WON + ) +) ``` diff --git a/doc/models/change-invoice-collection-method-event-data.md b/doc/models/change-invoice-collection-method-event-data.md index 2609c9e..013b864 100644 --- a/doc/models/change-invoice-collection-method-event-data.md +++ b/doc/models/change-invoice-collection-method-event-data.md @@ -14,12 +14,12 @@ Example schema for an `change_invoice_collection_method` event | `from_collection_method` | `String` | Required | The previous collection method of the invoice. | | `to_collection_method` | `String` | Required | The new collection method of the invoice. | -## Example (as JSON) +## Example -```json -{ - "from_collection_method": "from_collection_method4", - "to_collection_method": "to_collection_method2" -} +```ruby +change_invoice_collection_method_event_data = ChangeInvoiceCollectionMethodEventData.new( + from_collection_method: 'from_collection_method2', + to_collection_method: 'to_collection_method0' +) ``` diff --git a/doc/models/change-invoice-collection-method-event.md b/doc/models/change-invoice-collection-method-event.md index 2e9c6e5..7167402 100644 --- a/doc/models/change-invoice-collection-method-event.md +++ b/doc/models/change-invoice-collection-method-event.md @@ -15,28 +15,28 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::CHANGE_INVOICE_COLLECTION_METHOD` | | `event_data` | [`ChangeInvoiceCollectionMethodEventData`](../../doc/models/change-invoice-collection-method-event-data.md) | Required | Example schema for an `change_invoice_collection_method` event | -## Example (as JSON) - -```json -{ - "id": 246, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "change_invoice_collection_method", - "event_data": { - "from_collection_method": "from_collection_method4", - "to_collection_method": "to_collection_method8" - } -} +## Example + +```ruby +change_invoice_collection_method_event = ChangeInvoiceCollectionMethodEvent.new( + id: 216, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CHANGE_INVOICE_COLLECTION_METHOD, + event_data: ChangeInvoiceCollectionMethodEventData.new( + from_collection_method: 'from_collection_method4', + to_collection_method: 'to_collection_method8' + ) +) ``` diff --git a/doc/models/change-invoice-status-event-data.md b/doc/models/change-invoice-status-event-data.md index 21b8bff..326cdba 100644 --- a/doc/models/change-invoice-status-event-data.md +++ b/doc/models/change-invoice-status-event-data.md @@ -17,15 +17,15 @@ Example schema for an `change_invoice_status` event | `to_status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The updated status of the invoice after changes have been made. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | | `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | - | -## Example (as JSON) - -```json -{ - "gateway_trans_id": "gateway_trans_id2", - "amount": "amount2", - "from_status": "draft", - "to_status": "pending", - "consolidation_level": "none" -} +## Example + +```ruby +change_invoice_status_event_data = ChangeInvoiceStatusEventData.new( + from_status: InvoiceStatus::VOIDED, + to_status: InvoiceStatus::DRAFT, + gateway_trans_id: 'gateway_trans_id6', + amount: 'amount4', + consolidation_level: InvoiceConsolidationLevel::NONE +) ``` diff --git a/doc/models/change-invoice-status-event.md b/doc/models/change-invoice-status-event.md index 5556ebf..dc9e275 100644 --- a/doc/models/change-invoice-status-event.md +++ b/doc/models/change-invoice-status-event.md @@ -15,31 +15,31 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::CHANGE_INVOICE_STATUS` | | `event_data` | [`ChangeInvoiceStatusEventData`](../../doc/models/change-invoice-status-event-data.md) | Required | Example schema for an `change_invoice_status` event | -## Example (as JSON) - -```json -{ - "id": 92, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "change_invoice_status", - "event_data": { - "gateway_trans_id": "gateway_trans_id2", - "amount": "amount8", - "from_status": "open", - "to_status": "pending", - "consolidation_level": "child" - } -} +## Example + +```ruby +change_invoice_status_event = ChangeInvoiceStatusEvent.new( + id: 36, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CHANGE_INVOICE_STATUS, + event_data: ChangeInvoiceStatusEventData.new( + from_status: InvoiceStatus::OPEN, + to_status: InvoiceStatus::PENDING, + gateway_trans_id: 'gateway_trans_id2', + amount: 'amount8', + consolidation_level: InvoiceConsolidationLevel::CHILD + ) +) ``` diff --git a/doc/models/chargeback-status.md b/doc/models/chargeback-status.md index 5541f26..5c05bc6 100644 --- a/doc/models/chargeback-status.md +++ b/doc/models/chargeback-status.md @@ -16,3 +16,9 @@ The current chargeback status. | `WON` | | `CLOSED` | +## Example + +```ruby +chargeback_status = ChargebackStatus::OPEN +``` + diff --git a/doc/models/chargify-ebb.md b/doc/models/chargify-ebb.md index 606deee..bfd0846 100644 --- a/doc/models/chargify-ebb.md +++ b/doc/models/chargify-ebb.md @@ -16,15 +16,15 @@ | `subscription_id` | `Integer` | Optional | Id of Maxio Advanced Billing Subscription which is connected to this event.
Provide `subscription_id` if you configured `chargify.subscription_id` as Subscription Identifier in your Event Stream. | | `subscription_reference` | `String` | Optional | Reference of Maxio Advanced Billing Subscription which is connected to this event.
Provide `subscription_reference` if you configured `chargify.subscription_reference` as Subscription Identifier in your Event Stream. | -## Example (as JSON) - -```json -{ - "timestamp": "2016-03-13T12:52:32.123Z", - "id": "id4", - "created_at": "2016-03-13T12:52:32.123Z", - "uniqueness_token": "uniqueness_token0", - "subscription_id": 200 -} +## Example + +```ruby +chargify_ebb = ChargifyEBB.new( + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + id: 'id4', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + uniqueness_token: 'uniqueness_token0', + subscription_id: 30 +) ``` diff --git a/doc/models/chjs-tokenization-failure.md b/doc/models/chjs-tokenization-failure.md index 008974d..14f72c2 100644 --- a/doc/models/chjs-tokenization-failure.md +++ b/doc/models/chjs-tokenization-failure.md @@ -12,16 +12,16 @@ | `errors` | `String` | Required | - | | `payment_profile_params` | [`PaymentProfileParams`](../../doc/models/payment-profile-params.md) | Optional | PCI-safe cardholder fields only. Full card numbers, CVV, and billing address are never included. | -## Example (as JSON) - -```json -{ - "errors": "errors2", - "payment_profile_params": { - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "card_type2" - } -} +## Example + +```ruby +chjs_tokenization_failure = ChjsTokenizationFailure.new( + errors: 'errors4', + payment_profile_params: PaymentProfileParams.new( + first_name: 'first_name2', + last_name: 'last_name0', + card_type: 'card_type2' + ) +) ``` diff --git a/doc/models/chjs-tokenization-success.md b/doc/models/chjs-tokenization-success.md index a098c0d..9e9315d 100644 --- a/doc/models/chjs-tokenization-success.md +++ b/doc/models/chjs-tokenization-success.md @@ -12,17 +12,17 @@ | `payment_profile` | [`TokenizedPaymentProfile`](../../doc/models/tokenized-payment-profile.md) | Required | - | | `gateway_customer_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "id": 44, - "vault_token": "vault_token6", - "gateway_handle": "gateway_handle4", - "customer_vault_token": "customer_vault_token2" - }, - "gateway_customer_id": 44 -} +## Example + +```ruby +chjs_tokenization_success = ChjsTokenizationSuccess.new( + payment_profile: TokenizedPaymentProfile.new( + id: 44, + vault_token: 'vault_token6', + gateway_handle: 'gateway_handle4', + customer_vault_token: 'customer_vault_token2' + ), + gateway_customer_id: 106 +) ``` diff --git a/doc/models/cleanup-scope.md b/doc/models/cleanup-scope.md index 234cc07..6d91b44 100644 --- a/doc/models/cleanup-scope.md +++ b/doc/models/cleanup-scope.md @@ -14,3 +14,9 @@ all: Will clear all products, customers, and related subscriptions from the site | `ALL` | | `CUSTOMERS` | +## Example + +```ruby +cleanup_scope = CleanupScope::ALL +``` + diff --git a/doc/models/clone-component-price-point-request.md b/doc/models/clone-component-price-point-request.md index 25aa3ae..aba0105 100644 --- a/doc/models/clone-component-price-point-request.md +++ b/doc/models/clone-component-price-point-request.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `price_point` | [`CloneComponentPricePoint`](../../doc/models/clone-component-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "handle": "handle6" - } -} +## Example + +```ruby +clone_component_price_point_request = CloneComponentPricePointRequest.new( + price_point: CloneComponentPricePoint.new( + name: 'name0', + handle: 'handle6' + ) +) ``` diff --git a/doc/models/clone-component-price-point.md b/doc/models/clone-component-price-point.md index ad540de..9f3f28c 100644 --- a/doc/models/clone-component-price-point.md +++ b/doc/models/clone-component-price-point.md @@ -12,12 +12,12 @@ | `name` | `String` | Required | - | | `handle` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name2", - "handle": "handle8" -} +```ruby +clone_component_price_point = CloneComponentPricePoint.new( + name: 'name2', + handle: 'handle8' +) ``` diff --git a/doc/models/collection-method-1.md b/doc/models/collection-method-1.md new file mode 100644 index 0000000..f037487 --- /dev/null +++ b/doc/models/collection-method-1.md @@ -0,0 +1,21 @@ + +# Collection Method 1 + +## Enumeration + +`CollectionMethod1` + +## Fields + +| Name | +| --- | +| `AUTOMATIC` | +| `REMITTANCE` | +| `PREPAID` | + +## Example + +```ruby +collection_method1 = CollectionMethod1::REMITTANCE +``` + diff --git a/doc/models/collection-method.md b/doc/models/collection-method.md index 50b7215..cdfcdde 100644 --- a/doc/models/collection-method.md +++ b/doc/models/collection-method.md @@ -16,3 +16,9 @@ The type of payment collection to be used in the subscription. For legacy Statem | `PREPAID` | | `INVOICE` | +## Example + +```ruby +collection_method = CollectionMethod::PREPAID +``` + diff --git a/doc/models/component-allocation-change.md b/doc/models/component-allocation-change.md index c1389ed..485a51b 100644 --- a/doc/models/component-allocation-change.md +++ b/doc/models/component-allocation-change.md @@ -17,17 +17,17 @@ | `allocation_id` | `Integer` | Required | - | | `allocated_quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "previous_allocation": 94, - "new_allocation": 102, - "component_id": 88, - "component_handle": "component_handle8", - "memo": "memo2", - "allocation_id": 158, - "allocated_quantity": 104 -} +## Example + +```ruby +component_allocation_change = ComponentAllocationChange.new( + previous_allocation: 124, + new_allocation: 72, + component_id: 118, + component_handle: 'component_handle0', + memo: 'memo4', + allocation_id: 128, + allocated_quantity: 134 +) ``` diff --git a/doc/models/component-allocation-error-exception.md b/doc/models/component-allocation-error-exception.md index a7de628..4ab9e98 100644 --- a/doc/models/component-allocation-error-exception.md +++ b/doc/models/component-allocation-error-exception.md @@ -11,30 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`Array[ComponentAllocationErrorItem]`](../../doc/models/component-allocation-error-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": [ - { - "component_id": 236, - "message": "message0", - "kind": "kind8", - "on": "on0" - }, - { - "component_id": 236, - "message": "message0", - "kind": "kind8", - "on": "on0" - }, - { - "component_id": 236, - "message": "message0", - "kind": "kind8", - "on": "on0" - } - ] -} +## Example + +```ruby +begin + # make the API call +rescue ComponentAllocationErrorException => e + puts "Caught ComponentAllocationErrorException: #{e.message}" +end ``` diff --git a/doc/models/component-allocation-error-item.md b/doc/models/component-allocation-error-item.md index 760c79a..d20375d 100644 --- a/doc/models/component-allocation-error-item.md +++ b/doc/models/component-allocation-error-item.md @@ -14,14 +14,14 @@ | `kind` | `String` | Optional | - | | `on` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "component_id": 188, - "message": "message0", - "kind": "kind8", - "on": "on0" -} +## Example + +```ruby +component_allocation_error_item = ComponentAllocationErrorItem.new( + component_id: 238, + message: 'message8', + kind: 'kind6', + on: 'on8' +) ``` diff --git a/doc/models/component-cost-data-rate-tier.md b/doc/models/component-cost-data-rate-tier.md index 1a72354..bb53a29 100644 --- a/doc/models/component-cost-data-rate-tier.md +++ b/doc/models/component-cost-data-rate-tier.md @@ -15,15 +15,15 @@ | `unit_price` | `String` | Optional | - | | `amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "starting_quantity": 132, - "ending_quantity": 106, - "quantity": "quantity0", - "unit_price": "unit_price2", - "amount": "amount6" -} +## Example + +```ruby +component_cost_data_rate_tier = ComponentCostDataRateTier.new( + starting_quantity: 216, + ending_quantity: 190, + quantity: 'quantity0', + unit_price: 'unit_price2', + amount: 'amount6' +) ``` diff --git a/doc/models/component-cost-data.md b/doc/models/component-cost-data.md index 0f6b880..91ab032 100644 --- a/doc/models/component-cost-data.md +++ b/doc/models/component-cost-data.md @@ -17,15 +17,15 @@ | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `tiers` | [`Array[ComponentCostDataRateTier]`](../../doc/models/component-cost-data-rate-tier.md) | Optional | - | -## Example (as JSON) - -```json -{ - "component_code_id": 16, - "price_point_id": 186, - "product_id": 250, - "quantity": "quantity8", - "amount": "amount4" -} +## Example + +```ruby +component_cost_data = ComponentCostData.new( + component_code_id: 36, + price_point_id: 50, + product_id: 242, + quantity: 'quantity4', + amount: 'amount0' +) ``` diff --git a/doc/models/component-currency-price.md b/doc/models/component-currency-price.md index 6a41b18..f18dbf8 100644 --- a/doc/models/component-currency-price.md +++ b/doc/models/component-currency-price.md @@ -16,15 +16,15 @@ | `price_id` | `Integer` | Optional | - | | `price_point_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 4, - "currency": "currency8", - "price": "price4", - "formatted_price": "formatted_price6", - "price_id": 162 -} +## Example + +```ruby +component_currency_price = ComponentCurrencyPrice.new( + id: 170, + currency: 'currency2', + price: 'price4', + formatted_price: 'formatted_price6', + price_id: 252 +) ``` diff --git a/doc/models/component-currency-prices-response.md b/doc/models/component-currency-prices-response.md index 4f1686b..a2beffd 100644 --- a/doc/models/component-currency-prices-response.md +++ b/doc/models/component-currency-prices-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[ComponentCurrencyPrice]`](../../doc/models/component-currency-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "currency": "currency8", - "price": "price4", - "formatted_price": "formatted_price6", - "price_id": 116 - } +## Example + +```ruby +component_currency_prices_response = ComponentCurrencyPricesResponse.new( + currency_prices: [ + ComponentCurrencyPrice.new( + id: 50, + currency: 'currency8', + price: 'price4', + formatted_price: 'formatted_price6', + price_id: 116 + ) ] -} +) ``` diff --git a/doc/models/component-custom-price.md b/doc/models/component-custom-price.md index ec990ed..f0d0a3e 100644 --- a/doc/models/component-custom-price.md +++ b/doc/models/component-custom-price.md @@ -12,10 +12,10 @@ Create or update custom pricing unique to the subscription. Used in place of `pr | Name | Type | Tags | Description | | --- | --- | --- | --- | | `tax_included` | `TrueClass \| FalseClass` | Optional | Whether or not the price point includes tax | -| `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | Omit for On/Off components | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | Omit for On/Off components. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | -| `list_price_point_id` | `Integer` | Optional | Optional id of the price point to use for list price calculations when
overriding the customer price. | +| `list_price_point_id` | `Integer` | Optional | (Optional) Id of the price point to use for list price calculations when
overriding the customer price. | | `use_default_list_price` | `TrueClass \| FalseClass` | Optional | When true, list price calculations will continue to use the default price point even when a `custom_price` is supplied. | | `prices` | [`Array[Price]`](../../doc/models/price.md) | Required | On/off components only need one price bracket starting at 1. | | `renew_prepaid_allocation` | `TrueClass \| FalseClass` | Optional | Applicable only to prepaid usage components. Controls whether the allocated quantity renews each period. | @@ -23,22 +23,22 @@ Create or update custom pricing unique to the subscription. Used in place of `pr | `expiration_interval` | `Integer` | Optional | Applicable only when rollover is enabled. Number of `expiration_interval_unit`s after which rollover amounts expire. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | Applicable only when rollover is enabled. Interval unit for rollover expiration (month or day). | -## Example (as JSON) +## Example -```json -{ - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +```ruby +component_custom_price = ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 162, - "interval_unit": "day", - "list_price_point_id": 146 -} + tax_included: false, + pricing_scheme: PricingScheme::PER_UNIT, + interval: 136, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 104 +) ``` diff --git a/doc/models/component-kind.md b/doc/models/component-kind.md index f8b65b7..0ff3008 100644 --- a/doc/models/component-kind.md +++ b/doc/models/component-kind.md @@ -17,3 +17,9 @@ A handle for the component type | `PREPAID_USAGE_COMPONENT` | | `EVENT_BASED_COMPONENT` | +## Example + +```ruby +component_kind = ComponentKind::ON_OFF_COMPONENT +``` + diff --git a/doc/models/component-price-point-assignment.md b/doc/models/component-price-point-assignment.md index f6bc0e3..a8c809a 100644 --- a/doc/models/component-price-point-assignment.md +++ b/doc/models/component-price-point-assignment.md @@ -12,12 +12,12 @@ | `component_id` | `Integer` | Optional | - | | `price_point` | String \| Integer \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) +## Example -```json -{ - "component_id": 114, - "price_point": "String9" -} +```ruby +component_price_point_assignment = ComponentPricePointAssignment.new( + component_id: 122, + price_point: 'String5' +) ``` diff --git a/doc/models/component-price-point-currency-overage-response.md b/doc/models/component-price-point-currency-overage-response.md index 0721f1f..f83cc8e 100644 --- a/doc/models/component-price-point-currency-overage-response.md +++ b/doc/models/component-price-point-currency-overage-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `price_point` | [`CurrencyOveragePrices`](../../doc/models/currency-overage-prices.md) | Required | Extends a component price point with currency overage prices. | -## Example (as JSON) - -```json -{ - "price_point": { - "id": 248, - "type": "default", - "default": false, - "name": "name0", - "pricing_scheme": "per_unit" - } -} +## Example + +```ruby +component_price_point_currency_overage_response = ComponentPricePointCurrencyOverageResponse.new( + price_point: CurrencyOveragePrices.new( + id: 248, + type: PricePointType::DEFAULT, + default: false, + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT + ) +) ``` diff --git a/doc/models/component-price-point-error-exception.md b/doc/models/component-price-point-error-exception.md index 87f0a0c..55ccd01 100644 --- a/doc/models/component-price-point-error-exception.md +++ b/doc/models/component-price-point-error-exception.md @@ -11,22 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`Array[ComponentPricePointErrorItem]`](../../doc/models/component-price-point-error-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": [ - { - "component_id": 236, - "message": "message0", - "price_point": 122 - }, - { - "component_id": 236, - "message": "message0", - "price_point": 122 - } - ] -} +## Example + +```ruby +begin + # make the API call +rescue ComponentPricePointErrorException => e + puts "Caught ComponentPricePointErrorException: #{e.message}" +end ``` diff --git a/doc/models/component-price-point-error-item.md b/doc/models/component-price-point-error-item.md index 8420284..4858bb9 100644 --- a/doc/models/component-price-point-error-item.md +++ b/doc/models/component-price-point-error-item.md @@ -13,13 +13,13 @@ | `message` | `String` | Optional | - | | `price_point` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "component_id": 206, - "message": "message4", - "price_point": 152 -} +## Example + +```ruby +component_price_point_error_item = ComponentPricePointErrorItem.new( + component_id: 152, + message: 'message0', + price_point: 50 +) ``` diff --git a/doc/models/component-price-point-item.md b/doc/models/component-price-point-item.md index ee68f4e..a77d48d 100644 --- a/doc/models/component-price-point-item.md +++ b/doc/models/component-price-point-item.md @@ -12,19 +12,19 @@ | `name` | `String` | Optional | - | | `handle` | `String` | Optional | - | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | | `prices` | [`Array[Price]`](../../doc/models/price.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name6", - "handle": "handle2", - "pricing_scheme": "per_unit", - "interval": 196, - "interval_unit": "day" -} +```ruby +component_price_point_item = ComponentPricePointItem.new( + name: 'name6', + handle: 'handle2', + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 50, + interval_unit: IntervalUnit::DAY +) ``` diff --git a/doc/models/component-price-point-response.md b/doc/models/component-price-point-response.md index 19dc28a..b7c62da 100644 --- a/doc/models/component-price-point-response.md +++ b/doc/models/component-price-point-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `price_point` | [`ComponentPricePoint`](../../doc/models/component-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "id": 248, - "type": "default", - "default": false, - "name": "name0", - "pricing_scheme": "per_unit" - } -} +## Example + +```ruby +component_price_point_response = ComponentPricePointResponse.new( + price_point: ComponentPricePoint.new( + id: 248, + type: PricePointType::DEFAULT, + default: false, + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT + ) +) ``` diff --git a/doc/models/component-price-point.md b/doc/models/component-price-point.md index 452cf4c..5454990 100644 --- a/doc/models/component-price-point.md +++ b/doc/models/component-price-point.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | | `id` | `Integer` | Optional | - | | `type` | [`PricePointType`](../../doc/models/price-point-type.md) | Optional | Price point type. We expose the following types:

1. **default**: a price point that is marked as a default price for a certain product.
2. **custom**: a custom price point.
3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one. | -| `default` | `TrueClass \| FalseClass` | Optional | Note: Refer to type attribute instead | +| `default` | `TrueClass \| FalseClass` | Optional | Note: Refer to type attribute instead. | | `name` | `String` | Optional | - | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `component_id` | `Integer` | Optional | - | @@ -23,7 +23,7 @@ | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Defaults to true during creation. | | `subscription_id` | `Integer` | Optional | (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for. | | `tax_included` | `TrueClass \| FalseClass` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | | `currency_prices` | [`Array[ComponentCurrencyPrice]`](../../doc/models/component-currency-price.md) | Optional | An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. The clone endpoint always returns currency prices if they are present. | | `overage_prices` | [`Array[ComponentPrice]`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | @@ -33,15 +33,15 @@ | `expiration_interval` | `Integer` | Optional | Applicable only to prepaid usage components where rollover_prepaid_remainder is true. The number of `expiration_interval_unit`s after which rollover amounts should expire. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | Applicable only to prepaid usage components where rollover_prepaid_remainder is true. A string representing the expiration interval unit for this component, either month or day. | -## Example (as JSON) +## Example -```json -{ - "id": 190, - "type": "custom", - "default": false, - "name": "name2", - "pricing_scheme": "stairstep" -} +```ruby +component_price_point = ComponentPricePoint.new( + id: 160, + type: PricePointType::CATALOG, + default: false, + name: 'name8', + pricing_scheme: PricingScheme::PER_UNIT +) ``` diff --git a/doc/models/component-price-points-response.md b/doc/models/component-price-points-response.md index 679b8d9..83b422d 100644 --- a/doc/models/component-price-points-response.md +++ b/doc/models/component-price-points-response.md @@ -12,32 +12,32 @@ | `price_points` | [`Array[ComponentPricePoint]`](../../doc/models/component-price-point.md) | Optional | - | | `meta` | [`ListPublicKeysMeta`](../../doc/models/list-public-keys-meta.md) | Optional | - | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "id": 40, - "type": "default", - "default": false, - "name": "name2", - "pricing_scheme": "per_unit" - }, - { - "id": 40, - "type": "default", - "default": false, - "name": "name2", - "pricing_scheme": "per_unit" - } +## Example + +```ruby +component_price_points_response = ComponentPricePointsResponse.new( + price_points: [ + ComponentPricePoint.new( + id: 40, + type: PricePointType::DEFAULT, + default: false, + name: 'name2', + pricing_scheme: PricingScheme::PER_UNIT + ), + ComponentPricePoint.new( + id: 40, + type: PricePointType::DEFAULT, + default: false, + name: 'name2', + pricing_scheme: PricingScheme::PER_UNIT + ) ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "per_page": 152 - } -} + meta: ListPublicKeysMeta.new( + total_count: 150, + current_page: 126, + total_pages: 138, + per_page: 152 + ) +) ``` diff --git a/doc/models/component-price.md b/doc/models/component-price.md index 519f04d..f3204d2 100644 --- a/doc/models/component-price.md +++ b/doc/models/component-price.md @@ -18,15 +18,15 @@ | `formatted_unit_price` | `String` | Optional | - | | `segment_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 234, - "component_id": 88, - "starting_quantity": 104, - "ending_quantity": 78, - "unit_price": "unit_price0" -} +## Example + +```ruby +component_price = ComponentPrice.new( + id: 38, + component_id: 148, + starting_quantity: 44, + ending_quantity: 18, + unit_price: 'unit_price8' +) ``` diff --git a/doc/models/component-response.md b/doc/models/component-response.md index c322ada..88cd1bb 100644 --- a/doc/models/component-response.md +++ b/doc/models/component-response.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `component` | [`Component`](../../doc/models/component.md) | Required | - | -## Example (as JSON) - -```json -{ - "component": { - "item_category": "Business Software", - "id": 80, - "name": "name8", - "handle": "handle4", - "pricing_scheme": "per_unit", - "unit_name": "unit_name0" - } -} +## Example + +```ruby +component_response = ComponentResponse.new( + component: Component.new( + id: 80, + name: 'name8', + handle: 'handle4', + pricing_scheme: PricingScheme::PER_UNIT, + unit_name: 'unit_name0', + item_category: ItemCategory::ENUM_BUSINESS_SOFTWARE + ) +) ``` diff --git a/doc/models/component.md b/doc/models/component.md index 8e3edf3..351fe2d 100644 --- a/doc/models/component.md +++ b/doc/models/component.md @@ -10,15 +10,15 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `id` | `Integer` | Optional | The unique ID assigned to the component by Chargify. This ID can be used to fetch the component from the API. | -| `name` | `String` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | +| `name` | `String` | Optional | The name of the Component, suitable for display on statements. e.g., Text Messages. | | `handle` | `String` | Optional | The component API handle | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | - | -| `unit_name` | `String` | Optional | The name of the unit that the component’s usage is measured in. i.e. message | +| `unit_name` | `String` | Optional | The name of the unit that the component’s usage is measured in. e.g., message | | `unit_price` | `String` | Optional | The amount the customer will be charged per unit. This field is only populated for ‘per_unit’ pricing schemes, otherwise it may be null. | | `product_family_id` | `Integer` | Optional | The id of the Product Family to which the Component belongs | | `product_family_name` | `String` | Optional | The name of the Product Family to which the Component belongs | | `product_family_handle` | `String` | Optional | The handle of the Product Family to which the Component belongs | -| `price_per_unit_in_cents` | `Integer` | Optional | deprecated - use unit_price instead | +| `price_per_unit_in_cents` | `Integer` | Optional | deprecated - use unit_price instead. | | `kind` | [`ComponentKind`](../../doc/models/component-kind.md) | Optional | A handle for the component type | | `archived` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is archived or not. | | `description` | `String` | Optional | The description of the component. | @@ -42,19 +42,20 @@ | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | - | | `accounting_code` | `String` | Optional | E.g. Internal ID or SKU Number | | `event_based_billing_metric_id` | `Integer` | Optional | (Only for Event Based Components) This is an ID of a metric attached to the component. This metric is used to bill upon collected events. | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component’s default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | - -## Example (as JSON) - -```json -{ - "item_category": "Business Software", - "id": 24, - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "unit_name": "unit_name4" -} +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | + +## Example + +```ruby +component = Component.new( + id: 80, + name: 'name8', + handle: 'handle4', + pricing_scheme: PricingScheme::PER_UNIT, + unit_name: 'unit_name0', + item_category: ItemCategory::ENUM_BUSINESS_SOFTWARE +) ``` diff --git a/doc/models/compounding-strategy.md b/doc/models/compounding-strategy.md index ec68b1f..5396081 100644 --- a/doc/models/compounding-strategy.md +++ b/doc/models/compounding-strategy.md @@ -14,3 +14,9 @@ Applicable only to stackable coupons. For `compound`, Percentage-based discounts | `COMPOUND` | | `FULLPRICE` | +## Example + +```ruby +compounding_strategy = CompoundingStrategy::COMPOUND +``` + diff --git a/doc/models/consolidated-invoice.md b/doc/models/consolidated-invoice.md index ef02b81..2de5433 100644 --- a/doc/models/consolidated-invoice.md +++ b/doc/models/consolidated-invoice.md @@ -11,26 +11,19 @@ | --- | --- | --- | --- | | `invoices` | [`Array[Invoice]`](../../doc/models/invoice.md) | Optional | - | -## Example (as JSON) - -```json -{ - "invoices": [ - { - "id": 196, - "uid": "uid6", - "site_id": 122, - "customer_id": 234, - "subscription_id": 50 - }, - { - "id": 196, - "uid": "uid6", - "site_id": 122, - "customer_id": 234, - "subscription_id": 50 - } +## Example + +```ruby +consolidated_invoice = ConsolidatedInvoice.new( + invoices: [ + Invoice.new( + id: 196, + uid: 'uid6', + site_id: 122, + customer_id: 234, + subscription_id: 50 + ) ] -} +) ``` diff --git a/doc/models/containers/create-subscription-component-unit-balance.md b/doc/models/containers/create-subscription-component-unit-balance.md new file mode 100644 index 0000000..fc42f40 --- /dev/null +++ b/doc/models/containers/create-subscription-component-unit-balance.md @@ -0,0 +1,34 @@ + +# Create Subscription Component Unit Balance + +## Data Type + +`Integer | String` + +## Cases + +| Type | +| --- | +| `Integer` | +| `String` | + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/event-event-specific-data.md b/doc/models/containers/event-event-specific-data.md index 485d469..cba5e91 100644 --- a/doc/models/containers/event-event-specific-data.md +++ b/doc/models/containers/event-event-specific-data.md @@ -3,13 +3,14 @@ ## Data Type -`SubscriptionProductChange | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | SubscriptionGroupSignupEventData | CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged | ItemPricePointChanged | CustomFieldValueChange | ChjsTokenizationSuccess | ChjsTokenizationFailure` +`SubscriptionProductChange | SubscriptionProductChangeScheduled | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | SubscriptionGroupSignupEventData | CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged | ItemPricePointChanged | CustomFieldValueChange | ChjsTokenizationSuccess | ChjsTokenizationFailure` ## Cases | Type | | --- | | [`SubscriptionProductChange`](../../../doc/models/subscription-product-change.md) | +| [`SubscriptionProductChangeScheduled`](../../../doc/models/subscription-product-change-scheduled.md) | | [`SubscriptionStateChange`](../../../doc/models/subscription-state-change.md) | | [`PaymentRelatedEvents`](../../../doc/models/payment-related-events.md) | | [`RefundSuccess`](../../../doc/models/refund-success.md) | @@ -43,6 +44,19 @@ value = SubscriptionProductChange.new( ) ``` +## SubscriptionProductChangeScheduled + +### Initialization Code + +#### Example + +```ruby +value = SubscriptionProductChangeScheduled.new( + previous_product_id: 62, + new_product_id: 52 +) +``` + ## SubscriptionStateChange ### Initialization Code @@ -109,7 +123,7 @@ value = ComponentAllocationChange.new( ```ruby value = MeteredUsage.new( previous_unit_balance: 'previous_unit_balance6', - new_unit_balance: 80, + new_unit_balance: 2, usage_quantity: 42, component_id: 4, component_handle: 'component_handle8', @@ -127,8 +141,8 @@ value = MeteredUsage.new( value = PrepaidUsage.new( previous_unit_balance: 'previous_unit_balance0', previous_overage_unit_balance: 'previous_overage_unit_balance4', - new_unit_balance: 252, - new_overage_unit_balance: 224, + new_unit_balance: 174, + new_overage_unit_balance: 146, usage_quantity: 214, overage_usage_quantity: 106, component_id: 176, diff --git a/doc/models/containers/get-one-time-token-request-payment-profile.md b/doc/models/containers/get-one-time-token-request-payment-profile.md new file mode 100644 index 0000000..a6ef82e --- /dev/null +++ b/doc/models/containers/get-one-time-token-request-payment-profile.md @@ -0,0 +1,69 @@ + +# Get One Time Token Request Payment Profile + +## Data Type + +`GetOneTimeTokenPaymentProfile | GetOneTimeTokenBankAccountPaymentProfile` + +## Cases + +| Type | +| --- | +| [`GetOneTimeTokenPaymentProfile`](../../../doc/models/get-one-time-token-payment-profile.md) | +| [`GetOneTimeTokenBankAccountPaymentProfile`](../../../doc/models/get-one-time-token-bank-account-payment-profile.md) | + +## GetOneTimeTokenPaymentProfile + +### Initialization Code + +#### Example + +```ruby +value = GetOneTimeTokenPaymentProfile.new( + first_name: 'first_name2', + last_name: 'last_name0', + masked_card_number: 'masked_card_number0', + card_type: CardType::ROUTEX, + expiration_month: 187.78, + expiration_year: 164.44, + current_vault: CreditCardVault::BRAINTREE_BLUE, + vault_token: 'vault_token4', + billing_address: 'billing_address4', + billing_city: 'billing_city0', + billing_country: 'billing_country6', + billing_state: 'billing_state6', + billing_zip: 'billing_zip0', + payment_type: 'payment_type2', + disabled: false, + site_gateway_setting_id: 232 +) +``` + +## GetOneTimeTokenBankAccountPaymentProfile + +### Initialization Code + +#### Example + +```ruby +value = GetOneTimeTokenBankAccountPaymentProfile.new( + first_name: 'first_name8', + last_name: 'last_name6', + current_vault: BankAccountVault::MAXP, + vault_token: 'vault_token0', + billing_address: 'billing_address0', + billing_city: 'billing_city4', + billing_country: 'billing_country2', + billing_state: 'billing_state8', + billing_zip: 'billing_zip6', + bank_name: 'bank_name6', + masked_bank_routing_number: 'masked_bank_routing_number6', + masked_bank_account_number: 'masked_bank_account_number0', + bank_account_type: BankAccountType::CHECKING, + bank_account_holder_type: BankAccountHolderType::PERSONAL, + payment_type: 'payment_type2', + disabled: false, + site_gateway_setting_id: 254 +) +``` + diff --git a/doc/models/containers/list-subscriptions-input-product.md b/doc/models/containers/list-subscriptions-input-product.md new file mode 100644 index 0000000..a253a5b --- /dev/null +++ b/doc/models/containers/list-subscriptions-input-product.md @@ -0,0 +1,34 @@ + +# List Subscriptions Input Product + +## Data Type + +`Integer | String` + +## Cases + +| Type | +| --- | +| `Integer` | +| `String` | + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/metered-usage-new-unit-balance.md b/doc/models/containers/metered-usage-new-unit-balance.md new file mode 100644 index 0000000..6ff79dd --- /dev/null +++ b/doc/models/containers/metered-usage-new-unit-balance.md @@ -0,0 +1,34 @@ + +# Metered Usage New Unit Balance + +## Data Type + +`Integer | String` + +## Cases + +| Type | +| --- | +| `Integer` | +| `String` | + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/prepaid-usage-new-overage-unit-balance.md b/doc/models/containers/prepaid-usage-new-overage-unit-balance.md new file mode 100644 index 0000000..481246a --- /dev/null +++ b/doc/models/containers/prepaid-usage-new-overage-unit-balance.md @@ -0,0 +1,34 @@ + +# Prepaid Usage New Overage Unit Balance + +## Data Type + +`Integer | String` + +## Cases + +| Type | +| --- | +| `Integer` | +| `String` | + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/prepaid-usage-new-unit-balance.md b/doc/models/containers/prepaid-usage-new-unit-balance.md new file mode 100644 index 0000000..5589f01 --- /dev/null +++ b/doc/models/containers/prepaid-usage-new-unit-balance.md @@ -0,0 +1,34 @@ + +# Prepaid Usage New Unit Balance + +## Data Type + +`Integer | String` + +## Cases + +| Type | +| --- | +| `Integer` | +| `String` | + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/subscription-component-unit-balance.md b/doc/models/containers/subscription-component-unit-balance.md new file mode 100644 index 0000000..15b722f --- /dev/null +++ b/doc/models/containers/subscription-component-unit-balance.md @@ -0,0 +1,34 @@ + +# Subscription Component Unit Balance + +## Data Type + +`Integer | String` + +## Cases + +| Type | +| --- | +| `Integer` | +| `String` | + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/update-invoice-item-component-id.md b/doc/models/containers/update-invoice-item-component-id.md new file mode 100644 index 0000000..a67b233 --- /dev/null +++ b/doc/models/containers/update-invoice-item-component-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Component Id + +## Data Type + +`String | Integer` + +## Cases + +| Type | +| --- | +| `String` | +| `Integer` | + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/update-invoice-item-price-point-id.md b/doc/models/containers/update-invoice-item-price-point-id.md new file mode 100644 index 0000000..c9682be --- /dev/null +++ b/doc/models/containers/update-invoice-item-price-point-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Price Point Id + +## Data Type + +`String | Integer` + +## Cases + +| Type | +| --- | +| `String` | +| `Integer` | + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/update-invoice-item-product-id.md b/doc/models/containers/update-invoice-item-product-id.md new file mode 100644 index 0000000..07ebf9e --- /dev/null +++ b/doc/models/containers/update-invoice-item-product-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Product Id + +## Data Type + +`String | Integer` + +## Cases + +| Type | +| --- | +| `String` | +| `Integer` | + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/update-invoice-item-product-price-point-id.md b/doc/models/containers/update-invoice-item-product-price-point-id.md new file mode 100644 index 0000000..789e8cd --- /dev/null +++ b/doc/models/containers/update-invoice-item-product-price-point-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Product Price Point Id + +## Data Type + +`String | Integer` + +## Cases + +| Type | +| --- | +| `String` | +| `Integer` | + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/update-invoice-item-quantity.md b/doc/models/containers/update-invoice-item-quantity.md new file mode 100644 index 0000000..915d6ab --- /dev/null +++ b/doc/models/containers/update-invoice-item-quantity.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Quantity + +## Data Type + +`Float | String` + +## Cases + +| Type | +| --- | +| `Float` | +| `String` | + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/update-invoice-item-unit-price.md b/doc/models/containers/update-invoice-item-unit-price.md new file mode 100644 index 0000000..186db08 --- /dev/null +++ b/doc/models/containers/update-invoice-item-unit-price.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Unit Price + +## Data Type + +`Float | String` + +## Cases + +| Type | +| --- | +| `Float` | +| `String` | + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/contract.md b/doc/models/contract.md index 6e12ab3..5be3319 100644 --- a/doc/models/contract.md +++ b/doc/models/contract.md @@ -16,19 +16,19 @@ Contract linked to the scheduled renewal configuration. | `number` | `String` | Optional | - | | `register` | [`Register`](../../doc/models/register.md) | Optional | - | -## Example (as JSON) - -```json -{ - "id": 136, - "maxio_id": "maxio_id8", - "number": "number6", - "register": { - "id": 54, - "maxio_id": "maxio_id4", - "name": "name2", - "currency_code": "currency_code2" - } -} +## Example + +```ruby +contract = Contract.new( + id: 112, + maxio_id: 'maxio_id6', + number: 'number2', + register: Register.new( + id: 54, + maxio_id: 'maxio_id4', + name: 'name2', + currency_code: 'currency_code2' + ) +) ``` diff --git a/doc/models/count-response.md b/doc/models/count-response.md index 8c84da5..1bc25ed 100644 --- a/doc/models/count-response.md +++ b/doc/models/count-response.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `count` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "count": 60 -} +```ruby +count_response = CountResponse.new( + count: 174 +) ``` diff --git a/doc/models/coupon-currency-request.md b/doc/models/coupon-currency-request.md index d7ec786..c20627d 100644 --- a/doc/models/coupon-currency-request.md +++ b/doc/models/coupon-currency-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[UpdateCouponCurrency]`](../../doc/models/update-coupon-currency.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 78 - } +## Example + +```ruby +coupon_currency_request = CouponCurrencyRequest.new( + currency_prices: [ + UpdateCouponCurrency.new( + currency: 'currency8', + price: 78 + ) ] -} +) ``` diff --git a/doc/models/coupon-currency-response.md b/doc/models/coupon-currency-response.md index cceaffc..87fa923 100644 --- a/doc/models/coupon-currency-response.md +++ b/doc/models/coupon-currency-response.md @@ -11,30 +11,30 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[CouponCurrency]`](../../doc/models/coupon-currency.md) | Optional | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "coupon_id": 224 - }, - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "coupon_id": 224 - }, - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "coupon_id": 224 - } +## Example + +```ruby +coupon_currency_response = CouponCurrencyResponse.new( + currency_prices: [ + CouponCurrency.new( + id: 50, + currency: 'currency8', + price: 233.74, + coupon_id: 224 + ), + CouponCurrency.new( + id: 50, + currency: 'currency8', + price: 233.74, + coupon_id: 224 + ), + CouponCurrency.new( + id: 50, + currency: 'currency8', + price: 233.74, + coupon_id: 224 + ) ] -} +) ``` diff --git a/doc/models/coupon-currency.md b/doc/models/coupon-currency.md index f4712bd..940ff7c 100644 --- a/doc/models/coupon-currency.md +++ b/doc/models/coupon-currency.md @@ -14,14 +14,14 @@ | `price` | `Float` | Optional | - | | `coupon_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 228, - "currency": "currency8", - "price": 169.96, - "coupon_id": 210 -} +## Example + +```ruby +coupon_currency = CouponCurrency.new( + id: 52, + currency: 'currency8', + price: 136.44, + coupon_id: 222 +) ``` diff --git a/doc/models/coupon-payload.md b/doc/models/coupon-payload.md index 63e5910..4d6270d 100644 --- a/doc/models/coupon-payload.md +++ b/doc/models/coupon-payload.md @@ -10,10 +10,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `name` | `String` | Optional | Required when creating a new coupon. This name is not displayed to customers and is limited to 255 characters. | -| `code` | `String` | Optional | Required when creating a new coupon. The code is limited to 255 characters. May contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.” | +| `code` | `String` | Optional | Required when creating a new coupon. The code is limited to 255 characters. May contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.”. | | `description` | `String` | Optional | Required when creating a new coupon. A description of the coupon that can be displayed to customers in transactions and on statements. The description is limited to 255 characters. | | `percentage` | String \| Float \| nil | Optional | This is a container for one-of cases. | -| `amount_in_cents` | `Integer` | Optional | Required when creating a new flat amount coupon. Can't be used together with percentage. Flat USD discount | +| `amount_in_cents` | `Integer` | Optional | Required when creating a new flat amount coupon. Can't be used together with percentage. Flat USD discount. | | `allow_negative_balance` | `TrueClass \| FalseClass` | Optional | If set to true, discount is not limited (credits will carry forward to next billing). Can't be used together with restrictions. | | `recurring` | `TrueClass \| FalseClass` | Optional | - | | `end_date` | `Date` | Optional | After the end of the given day, this coupon code will be invalid for new signups. Recurring discounts started before this date will continue to recur even after this date. | @@ -24,15 +24,15 @@ | `apply_on_cancel_at_end_of_period` | `TrueClass \| FalseClass` | Optional | - | | `apply_on_subscription_expiration` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name8", - "code": "code6", - "description": "description8", - "percentage": "String7", - "amount_in_cents": 110 -} +```ruby +coupon_payload = CouponPayload.new( + name: 'name8', + code: 'code6', + description: 'description2', + percentage: 'String7', + amount_in_cents: 136 +) ``` diff --git a/doc/models/coupon-request.md b/doc/models/coupon-request.md index 4ba4855..5d5b78a 100644 --- a/doc/models/coupon-request.md +++ b/doc/models/coupon-request.md @@ -10,26 +10,26 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `coupon` | [`CouponPayload`](../../doc/models/coupon-payload.md) | Optional | - | -| `restricted_products` | `Hash[String, TrueClass \| FalseClass]` | Optional | An object where the keys are product IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the product | -| `restricted_components` | `Hash[String, TrueClass \| FalseClass]` | Optional | An object where the keys are component IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the component | - -## Example (as JSON) - -```json -{ - "coupon": { - "name": "name4", - "code": "code2", - "description": "description6", - "percentage": "String3", - "amount_in_cents": 230 +| `restricted_products` | `Hash[String, TrueClass \| FalseClass]` | Optional | An object where the keys are product IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the product. | +| `restricted_components` | `Hash[String, TrueClass \| FalseClass]` | Optional | An object where the keys are component IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the component. | + +## Example + +```ruby +coupon_request = CouponRequest.new( + coupon: CouponPayload.new( + name: 'name4', + code: 'code2', + description: 'description6', + percentage: 'String3', + amount_in_cents: 230 + ), + restricted_products: { + 'key0': true }, - "restricted_products": { - "key0": true - }, - "restricted_components": { - "key0": true + restricted_components: { + 'key0': true } -} +) ``` diff --git a/doc/models/coupon-response.md b/doc/models/coupon-response.md index 7c5ad38..6d750c2 100644 --- a/doc/models/coupon-response.md +++ b/doc/models/coupon-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `coupon` | [`Coupon`](../../doc/models/coupon.md) | Optional | - | -## Example (as JSON) - -```json -{ - "coupon": { - "id": 196, - "name": "name4", - "code": "code2", - "description": "description6", - "amount": 97.66 - } -} +## Example + +```ruby +coupon_response = CouponResponse.new( + coupon: Coupon.new( + id: 196, + name: 'name4', + code: 'code2', + description: 'description6', + amount: 97.66 + ) +) ``` diff --git a/doc/models/coupon-restriction.md b/doc/models/coupon-restriction.md index d28a66b..d1f5514 100644 --- a/doc/models/coupon-restriction.md +++ b/doc/models/coupon-restriction.md @@ -15,15 +15,15 @@ | `name` | `String` | Optional | - | | `handle` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 180, - "item_type": "Component", - "item_id": 184, - "name": "name4", - "handle": "handle0" -} +## Example + +```ruby +coupon_restriction = CouponRestriction.new( + id: 190, + item_type: RestrictionType::COMPONENT, + item_id: 82, + name: 'name2', + handle: 'handle8' +) ``` diff --git a/doc/models/coupon-subcodes-response.md b/doc/models/coupon-subcodes-response.md index 4705334..6c542f6 100644 --- a/doc/models/coupon-subcodes-response.md +++ b/doc/models/coupon-subcodes-response.md @@ -13,23 +13,21 @@ | `duplicate_codes` | `Array[String]` | Optional | - | | `invalid_codes` | `Array[String]` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "created_codes": [ - "created_codes1", - "created_codes2" +```ruby +coupon_subcodes_response = CouponSubcodesResponse.new( + created_codes: [ + 'created_codes7', + 'created_codes8' ], - "duplicate_codes": [ - "duplicate_codes8", - "duplicate_codes7" + duplicate_codes: [ + 'duplicate_codes0', + 'duplicate_codes1' ], - "invalid_codes": [ - "invalid_codes0", - "invalid_codes9", - "invalid_codes8" + invalid_codes: [ + 'invalid_codes4' ] -} +) ``` diff --git a/doc/models/coupon-subcodes.md b/doc/models/coupon-subcodes.md index 2935c36..1fe46a6 100644 --- a/doc/models/coupon-subcodes.md +++ b/doc/models/coupon-subcodes.md @@ -11,13 +11,15 @@ | --- | --- | --- | --- | | `codes` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "codes": [ - "codes8" +## Example + +```ruby +coupon_subcodes = CouponSubcodes.new( + codes: [ + 'codes0', + 'codes1', + 'codes2' ] -} +) ``` diff --git a/doc/models/coupon-usage.md b/doc/models/coupon-usage.md index 31a5ef5..f87b1c1 100644 --- a/doc/models/coupon-usage.md +++ b/doc/models/coupon-usage.md @@ -14,18 +14,18 @@ | `signups` | `Integer` | Optional | Number of times the coupon has been applied | | `savings` | `Integer` | Optional | Dollar amount of customer savings as a result of the coupon. | | `savings_in_cents` | `Integer` | Optional | Dollar amount of customer savings as a result of the coupon. | -| `revenue` | `Integer` | Optional | Total revenue of the all subscriptions that have received a discount from this coupon. | -| `revenue_in_cents` | `Integer` | Optional | Total revenue of the all subscriptions that have received a discount from this coupon. | - -## Example (as JSON) - -```json -{ - "id": 14, - "name": "name0", - "signups": 34, - "savings": 52, - "savings_in_cents": 138 -} +| `revenue` | `Integer` | Optional | Total revenue of all subscriptions that have received a discount from this coupon. | +| `revenue_in_cents` | `Integer` | Optional | Total revenue of all subscriptions that have received a discount from this coupon. | + +## Example + +```ruby +coupon_usage = CouponUsage.new( + id: 76, + name: 'name8', + signups: 96, + savings: 114, + savings_in_cents: 200 +) ``` diff --git a/doc/models/coupon.md b/doc/models/coupon.md index 655c6eb..03c3c22 100644 --- a/doc/models/coupon.md +++ b/doc/models/coupon.md @@ -41,15 +41,15 @@ | `coupon_restrictions` | [`Array[CouponRestriction]`](../../doc/models/coupon-restriction.md) | Optional | - | | `currency_prices` | [`Array[CouponCurrency]`](../../doc/models/coupon-currency.md) | Optional | Returned in read, find, and list endpoints if the query parameter is provided. | -## Example (as JSON) - -```json -{ - "id": 22, - "name": "name2", - "code": "code0", - "description": "description2", - "amount": 62.64 -} +## Example + +```ruby +coupon = Coupon.new( + id: 196, + name: 'name4', + code: 'code2', + description: 'description6', + amount: 97.66 +) ``` diff --git a/doc/models/create-allocation-request.md b/doc/models/create-allocation-request.md index e94dd76..6159c44 100644 --- a/doc/models/create-allocation-request.md +++ b/doc/models/create-allocation-request.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `allocation` | [`CreateAllocation`](../../doc/models/create-allocation.md) | Required | - | -## Example (as JSON) - -```json -{ - "allocation": { - "quantity": 228.94, - "decimal_quantity": "decimal_quantity6", - "previous_quantity": 254.04, - "decimal_previous_quantity": "decimal_previous_quantity8", - "component_id": 8, - "memo": "memo2" - } -} +## Example + +```ruby +create_allocation_request = CreateAllocationRequest.new( + allocation: CreateAllocation.new( + quantity: 228.94, + decimal_quantity: 'decimal_quantity6', + previous_quantity: 254.04, + decimal_previous_quantity: 'decimal_previous_quantity8', + component_id: 8, + memo: 'memo2' + ) +) ``` diff --git a/doc/models/create-allocation.md b/doc/models/create-allocation.md index 8c093e5..da5f529 100644 --- a/doc/models/create-allocation.md +++ b/doc/models/create-allocation.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `quantity` | `Float` | Required | The allocated quantity to which to set the line-items allocated quantity. By default, this is an integer. If decimal allocations are enabled for the component, it will be a decimal number. For On/Off components, use 1for on and 0 for off. | +| `quantity` | `Float` | Required | The allocated quantity to which to set the line-items allocated quantity. By default, this is an integer. If decimal allocations are enabled for the component, it will be a decimal number. For On/Off components, use 1 for on and 0 for off. | | `decimal_quantity` | `String` | Optional | Decimal representation of the allocated quantity. Only valid when decimal
allocations are enabled for the component. | | `previous_quantity` | `Float` | Optional | The quantity that was in effect before this allocation. Responses always
include this value; it may be supplied on preview requests to ensure the
expected change is evaluated. | | `decimal_previous_quantity` | `String` | Optional | Decimal representation of `previous_quantity`. Only valid when decimal
allocations are enabled for the component. | @@ -25,16 +25,16 @@ | `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | | `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) - -```json -{ - "quantity": 8.06, - "decimal_quantity": "decimal_quantity4", - "previous_quantity": 218.92, - "decimal_previous_quantity": "decimal_previous_quantity0", - "component_id": 192, - "memo": "memo4" -} +## Example + +```ruby +create_allocation = CreateAllocation.new( + quantity: 176.5, + decimal_quantity: 'decimal_quantity0', + previous_quantity: 50.48, + decimal_previous_quantity: 'decimal_previous_quantity4', + component_id: 140, + memo: 'memo8' +) ``` diff --git a/doc/models/create-component-price-point-request.md b/doc/models/create-component-price-point-request.md index 2ffd871..bf9e6d7 100644 --- a/doc/models/create-component-price-point-request.md +++ b/doc/models/create-component-price-point-request.md @@ -11,26 +11,26 @@ | --- | --- | --- | --- | | `price_point` | [Create Component Price Point](../../doc/models/create-component-price-point.md) \| [Create Prepaid Usage Component Price Point](../../doc/models/create-prepaid-usage-component-price-point.md) | Required | This is a container for any-of cases. | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +create_component_price_point_request = CreateComponentPricePointRequest.new( + price_point: CreateComponentPricePoint.new( + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "use_site_exchange_rate": true, - "handle": "handle6", - "tax_included": false, - "interval": 24, - "interval_unit": "day" - } -} + handle: 'handle6', + use_site_exchange_rate: true, + tax_included: false, + interval: 24, + interval_unit: IntervalUnit::DAY + ) +) ``` diff --git a/doc/models/create-component-price-point.md b/doc/models/create-component-price-point.md index 2c77591..26b855e 100644 --- a/doc/models/create-component-price-point.md +++ b/doc/models/create-component-price-point.md @@ -15,27 +15,27 @@ | `prices` | [`Array[Price]`](../../doc/models/price.md) | Required | - | | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Setting not supported when creating price points in bulk.

**Default**: `true` | | `tax_included` | `TrueClass \| FalseClass` | Optional | Whether or not the price point includes tax. Setting not supported when creating price points in bulk. | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this price point, either month or day. This property is only available for sites with Multifrequency enabled. | -## Example (as JSON) - -```json -{ - "name": "name0", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +create_component_price_point = CreateComponentPricePoint.new( + name: 'name4', + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "use_site_exchange_rate": true, - "handle": "handle6", - "tax_included": false, - "interval": 24, - "interval_unit": "day" -} + handle: 'handle0', + use_site_exchange_rate: true, + tax_included: false, + interval: 70, + interval_unit: IntervalUnit::DAY +) ``` diff --git a/doc/models/create-component-price-points-request.md b/doc/models/create-component-price-points-request.md index f8c2a75..828bd2f 100644 --- a/doc/models/create-component-price-points-request.md +++ b/doc/models/create-component-price-points-request.md @@ -11,64 +11,64 @@ | --- | --- | --- | --- | | `price_points` | Array[[Create Component Price Point](../../doc/models/create-component-price-point.md) \| [Create Prepaid Usage Component Price Point](../../doc/models/create-prepaid-usage-component-price-point.md)] | Required | This is Array of a container for any-of cases. | -## Example (as JSON) +## Example -```json -{ - "price_points": [ - { - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +```ruby +create_component_price_points_request = CreateComponentPricePointsRequest.new( + price_points: [ + CreateComponentPricePoint.new( + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "use_site_exchange_rate": false, - "tax_included": false, - "interval": 24, - "interval_unit": "day" - }, - { - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } + handle: 'handle6', + use_site_exchange_rate: false, + tax_included: false, + interval: 24, + interval_unit: IntervalUnit::DAY + ), + CreateComponentPricePoint.new( + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "use_site_exchange_rate": false, - "tax_included": false, - "interval": 24, - "interval_unit": "day" - } + handle: 'handle6', + use_site_exchange_rate: false, + tax_included: false, + interval: 24, + interval_unit: IntervalUnit::DAY + ) ] -} +) ``` diff --git a/doc/models/create-credit-note-event.md b/doc/models/create-credit-note-event.md index a90f332..2857d0b 100644 --- a/doc/models/create-credit-note-event.md +++ b/doc/models/create-credit-note-event.md @@ -15,31 +15,31 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::CREATE_CREDIT_NOTE` | | `event_data` | [`CreditNote`](../../doc/models/credit-note.md) | Required | Example schema for an `create_credit_note` event | -## Example (as JSON) - -```json -{ - "id": 28, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "create_credit_note", - "event_data": { - "uid": "uid6", - "site_id": 132, - "customer_id": 244, - "subscription_id": 60, - "number": "number6" - } -} +## Example + +```ruby +create_credit_note_event = CreateCreditNoteEvent.new( + id: 166, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CREATE_CREDIT_NOTE, + event_data: CreditNote.new( + uid: 'uid6', + site_id: 132, + customer_id: 244, + subscription_id: 60, + number: 'number6' + ) +) ``` diff --git a/doc/models/create-currency-price.md b/doc/models/create-currency-price.md index 92e579c..bf167f7 100644 --- a/doc/models/create-currency-price.md +++ b/doc/models/create-currency-price.md @@ -13,13 +13,13 @@ | `price` | `Float` | Optional | Price for the price level in this currency | | `price_id` | `Integer` | Optional | ID of the price that this corresponds with | -## Example (as JSON) - -```json -{ - "currency": "currency2", - "price": 10.4, - "price_id": 54 -} +## Example + +```ruby +create_currency_price = CreateCurrencyPrice.new( + currency: 'currency8', + price: 24.44, + price_id: 178 +) ``` diff --git a/doc/models/create-currency-prices-request.md b/doc/models/create-currency-prices-request.md index adce7a1..857a54b 100644 --- a/doc/models/create-currency-prices-request.md +++ b/doc/models/create-currency-prices-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[CreateCurrencyPrice]`](../../doc/models/create-currency-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 233.74, - "price_id": 116 - } +## Example + +```ruby +create_currency_prices_request = CreateCurrencyPricesRequest.new( + currency_prices: [ + CreateCurrencyPrice.new( + currency: 'currency8', + price: 233.74, + price_id: 116 + ) ] -} +) ``` diff --git a/doc/models/create-customer-request.md b/doc/models/create-customer-request.md index c1f23bf..b906cef 100644 --- a/doc/models/create-customer-request.md +++ b/doc/models/create-customer-request.md @@ -11,20 +11,20 @@ | --- | --- | --- | --- | | `customer` | [`CreateCustomer`](../../doc/models/create-customer.md) | Required | - | -## Example (as JSON) - -```json -{ - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6", - "reference": "reference4", - "address": "address6", - "address_2": "address_24" - } -} +## Example + +```ruby +create_customer_request = CreateCustomerRequest.new( + customer: CreateCustomer.new( + first_name: 'first_name0', + last_name: 'last_name8', + email: 'email6', + cc_emails: 'cc_emails0', + organization: 'organization6', + reference: 'reference4', + address: 'address6', + address_2: 'address_24' + ) +) ``` diff --git a/doc/models/create-customer.md b/doc/models/create-customer.md index 7392b31..bb304f7 100644 --- a/doc/models/create-customer.md +++ b/doc/models/create-customer.md @@ -25,22 +25,24 @@ | `locale` | `String` | Optional | Set a specific language on a customer record. | | `vat_number` | `String` | Optional | - | | `tax_exempt` | `TrueClass \| FalseClass` | Optional | - | +| `surcharging` | `TrueClass \| FalseClass` | Optional | Whether surcharging is enabled for the customer. Defaults to `true` when omitted. Only applied on sites where surcharging control is enabled. | | `tax_exempt_reason` | `String` | Optional | - | | `parent_id` | `Integer` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | | `salesforce_id` | `String` | Optional | The Salesforce ID of the customer | - -## Example (as JSON) - -```json -{ - "first_name": "first_name8", - "last_name": "last_name6", - "email": "email8", - "cc_emails": "cc_emails8", - "organization": "organization2", - "reference": "reference4", - "address": "address4", - "address_2": "address_22" -} +| `branding_theme_id` | `Integer` | Optional | The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. | + +## Example + +```ruby +create_customer = CreateCustomer.new( + first_name: 'first_name0', + last_name: 'last_name8', + email: 'email6', + cc_emails: 'cc_emails0', + organization: 'organization6', + reference: 'reference4', + address: 'address6', + address_2: 'address_24' +) ``` diff --git a/doc/models/create-debit-note-event.md b/doc/models/create-debit-note-event.md index 64b81fc..8e4d61d 100644 --- a/doc/models/create-debit-note-event.md +++ b/doc/models/create-debit-note-event.md @@ -15,31 +15,31 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::CREATE_DEBIT_NOTE` | | `event_data` | [`DebitNote`](../../doc/models/debit-note.md) | Required | Example schema for an `create_debit_note` event | -## Example (as JSON) - -```json -{ - "id": 98, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "create_debit_note", - "event_data": { - "uid": "uid6", - "site_id": 132, - "customer_id": 244, - "subscription_id": 60, - "number": 64 - } -} +## Example + +```ruby +create_debit_note_event = CreateDebitNoteEvent.new( + id: 246, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CREATE_DEBIT_NOTE, + event_data: DebitNote.new( + uid: 'uid6', + site_id: 132, + customer_id: 244, + subscription_id: 60, + number: 64 + ) +) ``` diff --git a/doc/models/create-ebb-component.md b/doc/models/create-ebb-component.md index 83797bc..48a5096 100644 --- a/doc/models/create-ebb-component.md +++ b/doc/models/create-ebb-component.md @@ -11,35 +11,35 @@ | --- | --- | --- | --- | | `event_based_component` | [`EBBComponent`](../../doc/models/ebb-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "event_based_component": { - "name": "name8", - "unit_name": "unit_name0", - "description": "description8", - "handle": "handle4", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +create_ebb_component = CreateEBBComponent.new( + event_based_component: EBBComponent.new( + name: 'name8', + unit_name: 'unit_name0', + pricing_scheme: PricingScheme::STAIRSTEP, + event_based_billing_metric_id: 68, + description: 'description8', + handle: 'handle4', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } - ], - "event_based_billing_metric_id": 68 - } -} + price_points: [ + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ) + ] + ) +) ``` diff --git a/doc/models/create-invoice-address.md b/doc/models/create-invoice-address.md index b2dba20..c83b1ad 100644 --- a/doc/models/create-invoice-address.md +++ b/doc/models/create-invoice-address.md @@ -21,15 +21,15 @@ Overrides the default address. | `zip` | `String` | Optional | - | | `country` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name4", - "last_name": "last_name2", - "phone": "phone6", - "address": "address0", - "address_2": "address_28" -} +## Example + +```ruby +create_invoice_address = CreateInvoiceAddress.new( + first_name: 'first_name8', + last_name: 'last_name6', + phone: 'phone2', + address: 'address4', + address_2: 'address_22' +) ``` diff --git a/doc/models/create-invoice-coupon.md b/doc/models/create-invoice-coupon.md index a2b4220..beef7e8 100644 --- a/doc/models/create-invoice-coupon.md +++ b/doc/models/create-invoice-coupon.md @@ -17,15 +17,15 @@ | `product_family_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `compounding_strategy` | [`CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | Applicable only to stackable coupons. For `compound`, Percentage-based discounts will be calculated against the remaining price, after prior discounts have been calculated. For `full-price`, Percentage-based discounts will always be calculated against the original item price, before other discounts are applied. | -## Example (as JSON) - -```json -{ - "percentage": 50.0, - "code": "code4", - "subcode": "subcode8", - "amount": "String9", - "description": "description4" -} +## Example + +```ruby +create_invoice_coupon = CreateInvoiceCoupon.new( + code: 'code6', + subcode: 'subcode6', + percentage: 50, + amount: 'String1', + description: 'description8' +) ``` diff --git a/doc/models/create-invoice-item.md b/doc/models/create-invoice-item.md index bcb0dcb..ed18035 100644 --- a/doc/models/create-invoice-item.md +++ b/doc/models/create-invoice-item.md @@ -22,15 +22,15 @@ | `product_price_point_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `description` | `String` | Optional | **Constraints**: *Maximum Length*: `255` | -## Example (as JSON) - -```json -{ - "title": "title2", - "quantity": 154.86, - "unit_price": 138.08, - "taxable": false, - "tax_code": "tax_code4" -} +## Example + +```ruby +create_invoice_item = CreateInvoiceItem.new( + title: 'title2', + quantity: 163.26, + unit_price: 146.48, + taxable: false, + tax_code: 'tax_code4' +) ``` diff --git a/doc/models/create-invoice-payment-application.md b/doc/models/create-invoice-payment-application.md index 6ffdf49..482a51f 100644 --- a/doc/models/create-invoice-payment-application.md +++ b/doc/models/create-invoice-payment-application.md @@ -12,12 +12,12 @@ | `invoice_uid` | `String` | Required | Unique identifier for the invoice. It has the prefix "inv_" followed by alphanumeric characters. | | `amount` | `String` | Required | Dollar amount of the invoice payment (eg. "10.50" => $10.50). | -## Example (as JSON) +## Example -```json -{ - "invoice_uid": "invoice_uid4", - "amount": "amount6" -} +```ruby +create_invoice_payment_application = CreateInvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + amount: 'amount0' +) ``` diff --git a/doc/models/create-invoice-payment-request.md b/doc/models/create-invoice-payment-request.md index 9d168b1..28fd646 100644 --- a/doc/models/create-invoice-payment-request.md +++ b/doc/models/create-invoice-payment-request.md @@ -12,18 +12,18 @@ | `payment` | [`CreateInvoicePayment`](../../doc/models/create-invoice-payment.md) | Required | - | | `type` | [`InvoicePaymentType`](../../doc/models/invoice-payment-type.md) | Optional | The type of payment to be applied to an Invoice. Defaults to external. | -## Example (as JSON) - -```json -{ - "payment": { - "amount": "String9", - "memo": "memo0", - "method": "ach", - "details": "details6", - "payment_profile_id": 42 - }, - "type": "external" -} +## Example + +```ruby +create_invoice_payment_request = CreateInvoicePaymentRequest.new( + payment: CreateInvoicePayment.new( + amount: 'String9', + memo: 'memo0', + method: InvoicePaymentMethodType::ACH, + details: 'details6', + payment_profile_id: 42 + ), + type: InvoicePaymentType::SERVICE_CREDIT +) ``` diff --git a/doc/models/create-invoice-payment.md b/doc/models/create-invoice-payment.md index d12c68c..1c1fa47 100644 --- a/doc/models/create-invoice-payment.md +++ b/doc/models/create-invoice-payment.md @@ -16,15 +16,15 @@ | `payment_profile_id` | `Integer` | Optional | The ID of the payment profile to be used for the payment. | | `received_on` | `Date` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
`external` payments. | -## Example (as JSON) - -```json -{ - "amount": "String9", - "memo": "memo0", - "method": "cash", - "details": "details6", - "payment_profile_id": 122 -} +## Example + +```ruby +create_invoice_payment = CreateInvoicePayment.new( + amount: 'String7', + memo: 'memo8', + method: InvoicePaymentMethodType::CREDIT_CARD, + details: 'details4', + payment_profile_id: 210 +) ``` diff --git a/doc/models/create-invoice-request.md b/doc/models/create-invoice-request.md index a74b507..80c1497 100644 --- a/doc/models/create-invoice-request.md +++ b/doc/models/create-invoice-request.md @@ -11,40 +11,40 @@ | --- | --- | --- | --- | | `invoice` | [`CreateInvoice`](../../doc/models/create-invoice.md) | Required | - | -## Example (as JSON) - -```json -{ - "invoice": { - "issue_date": "2024-01-01", - "status": "draft", - "line_items": [ - { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" - }, - { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" - }, - { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" - } +## Example + +```ruby +create_invoice_request = CreateInvoiceRequest.new( + invoice: CreateInvoice.new( + line_items: [ + CreateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ), + CreateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ), + CreateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ) ], - "net_terms": 144, - "payment_instructions": "payment_instructions6", - "memo": "memo0" - } -} + issue_date: Date.iso8601('2024-01-01'), + net_terms: 144, + payment_instructions: 'payment_instructions6', + memo: 'memo0', + status: CreateInvoiceStatus::DRAFT + ) +) ``` diff --git a/doc/models/create-invoice-status.md b/doc/models/create-invoice-status.md index 73171a8..834dc5a 100644 --- a/doc/models/create-invoice-status.md +++ b/doc/models/create-invoice-status.md @@ -14,7 +14,7 @@ ## Example -``` -draft +```ruby +create_invoice_status = CreateInvoiceStatus::DRAFT ``` diff --git a/doc/models/create-invoice.md b/doc/models/create-invoice.md index 457d3cc..e0700cc 100644 --- a/doc/models/create-invoice.md +++ b/doc/models/create-invoice.md @@ -14,30 +14,37 @@ | `net_terms` | `Integer` | Optional | By default, invoices will be created with a due date matching the date of invoice creation. If a different due date is desired, the net_terms parameter can be sent indicating the number of days in advance the due date should be. | | `payment_instructions` | `String` | Optional | - | | `memo` | `String` | Optional | A custom memo can be sent to override the site's default. | -| `seller_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the defaults for the site | -| `billing_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | -| `shipping_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | +| `seller_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the defaults for the site. | +| `billing_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer. | +| `shipping_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer. | | `coupons` | [`Array[CreateInvoiceCoupon]`](../../doc/models/create-invoice-coupon.md) | Optional | - | | `status` | [`CreateInvoiceStatus`](../../doc/models/create-invoice-status.md) | Optional | **Default**: `CreateInvoiceStatus::OPEN` | -## Example (as JSON) - -```json -{ - "issue_date": "2024-01-01", - "status": "draft", - "line_items": [ - { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" - } +## Example + +```ruby +create_invoice = CreateInvoice.new( + line_items: [ + CreateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ), + CreateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ) ], - "net_terms": 18, - "payment_instructions": "payment_instructions0", - "memo": "memo6" -} + issue_date: Date.iso8601('2024-01-01'), + net_terms: 100, + payment_instructions: 'payment_instructions4', + memo: 'memo0', + status: CreateInvoiceStatus::DRAFT +) ``` diff --git a/doc/models/create-metadata-request.md b/doc/models/create-metadata-request.md index 1a3b437..6897e7b 100644 --- a/doc/models/create-metadata-request.md +++ b/doc/models/create-metadata-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `metadata` | [`Array[CreateMetadata]`](../../doc/models/create-metadata.md) | Required | - | -## Example (as JSON) - -```json -{ - "metadata": [ - { - "name": "name6", - "value": "value8" - } +## Example + +```ruby +create_metadata_request = CreateMetadataRequest.new( + metadata: [ + CreateMetadata.new( + name: 'name6', + value: 'value8' + ) ] -} +) ``` diff --git a/doc/models/create-metadata.md b/doc/models/create-metadata.md index a744574..345d783 100644 --- a/doc/models/create-metadata.md +++ b/doc/models/create-metadata.md @@ -12,12 +12,12 @@ | `name` | `String` | Optional | - | | `value` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name4", - "value": "value6" -} +```ruby +create_metadata = CreateMetadata.new( + name: 'name2', + value: 'value4' +) ``` diff --git a/doc/models/create-metafield.md b/doc/models/create-metafield.md index 6689b54..7c48180 100644 --- a/doc/models/create-metafield.md +++ b/doc/models/create-metafield.md @@ -11,26 +11,26 @@ | --- | --- | --- | --- | | `name` | `String` | Optional | - | | `scope` | [`MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | -| `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | +| `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | | `enum` | `Array[String]` | Optional | Only applicable when input_type is radio or dropdown. Empty strings will not be submitted. | -## Example (as JSON) - -```json -{ - "name": "my_field", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0", - "public_edit": "0" - }, - "input_type": "text", - "enum": [ - "string" +## Example + +```ruby +create_metafield = CreateMetafield.new( + name: 'my_field', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE, + public_edit: IncludeOption::EXCLUDE + ), + input_type: MetafieldInput::TEXT, + enum: [ + 'string' ] -} +) ``` diff --git a/doc/models/create-metafields-request.md b/doc/models/create-metafields-request.md index 75fb57c..8e360c7 100644 --- a/doc/models/create-metafields-request.md +++ b/doc/models/create-metafields-request.md @@ -11,25 +11,25 @@ | --- | --- | --- | --- | | `metafields` | [Create Metafield](../../doc/models/create-metafield.md) \| Array[[Create Metafield](../../doc/models/create-metafield.md)] | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "metafields": { - "name": "my_field", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0", - "public_edit": "0" - }, - "input_type": "text", - "enum": [ - "string" +## Example + +```ruby +create_metafields_request = CreateMetafieldsRequest.new( + metafields: CreateMetafield.new( + name: 'my_field', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE, + public_edit: IncludeOption::EXCLUDE + ), + input_type: MetafieldInput::TEXT, + enum: [ + 'string' ] - } -} + ) +) ``` diff --git a/doc/models/create-metered-component.md b/doc/models/create-metered-component.md index 0a56ac9..6653e5f 100644 --- a/doc/models/create-metered-component.md +++ b/doc/models/create-metered-component.md @@ -11,58 +11,58 @@ | --- | --- | --- | --- | | `metered_component` | [`MeteredComponent`](../../doc/models/metered-component.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "metered_component": { - "name": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +```ruby +create_metered_component = CreateMeteredComponent.new( + metered_component: MeteredComponent.new( + name: 'name0', + unit_name: 'unit_name2', + pricing_scheme: PricingScheme::STAIRSTEP, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - }, - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - }, - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } + price_points: [ + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ), + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ), + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ) ] - } -} + ) +) ``` diff --git a/doc/models/create-multi-invoice-payment-request.md b/doc/models/create-multi-invoice-payment-request.md index 7388e47..8c8aed6 100644 --- a/doc/models/create-multi-invoice-payment-request.md +++ b/doc/models/create-multi-invoice-payment-request.md @@ -11,23 +11,23 @@ | --- | --- | --- | --- | | `payment` | [`CreateMultiInvoicePayment`](../../doc/models/create-multi-invoice-payment.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment": { - "amount": "String9", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "amount": "amount0" - } +## Example + +```ruby +create_multi_invoice_payment_request = CreateMultiInvoicePaymentRequest.new( + payment: CreateMultiInvoicePayment.new( + amount: 'String9', + applications: [ + CreateInvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + amount: 'amount0' + ) ], - "memo": "memo0", - "details": "details6", - "method": "ach", - "received_on": "received_on8" - } -} + memo: 'memo0', + details: 'details6', + method: InvoicePaymentMethodType::ACH, + received_on: 'received_on8' + ) +) ``` diff --git a/doc/models/create-multi-invoice-payment.md b/doc/models/create-multi-invoice-payment.md index 62ab0c6..e9871a4 100644 --- a/doc/models/create-multi-invoice-payment.md +++ b/doc/models/create-multi-invoice-payment.md @@ -16,21 +16,21 @@ | `received_on` | `String` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. | | `applications` | [`Array[CreateInvoicePaymentApplication]`](../../doc/models/create-invoice-payment-application.md) | Required | - | -## Example (as JSON) - -```json -{ - "amount": "String7", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "amount": "amount0" - } +## Example + +```ruby +create_multi_invoice_payment = CreateMultiInvoicePayment.new( + amount: 'String5', + applications: [ + CreateInvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + amount: 'amount0' + ) ], - "memo": "memo8", - "details": "details4", - "method": "credit_card", - "received_on": "received_on6" -} + memo: 'memo6', + details: 'details2', + method: InvoicePaymentMethodType::ACH, + received_on: 'received_on4' +) ``` diff --git a/doc/models/create-offer-component.md b/doc/models/create-offer-component.md index 1a11b92..3aa3c87 100644 --- a/doc/models/create-offer-component.md +++ b/doc/models/create-offer-component.md @@ -13,13 +13,13 @@ | `price_point_id` | `Integer` | Optional | - | | `starting_quantity` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "component_id": 242, - "price_point_id": 10, - "starting_quantity": 50 -} +## Example + +```ruby +create_offer_component = CreateOfferComponent.new( + component_id: 206, + price_point_id: 230, + starting_quantity: 242 +) ``` diff --git a/doc/models/create-offer-request.md b/doc/models/create-offer-request.md index add3399..a358117 100644 --- a/doc/models/create-offer-request.md +++ b/doc/models/create-offer-request.md @@ -11,32 +11,32 @@ | --- | --- | --- | --- | | `offer` | [`CreateOffer`](../../doc/models/create-offer.md) | Required | - | -## Example (as JSON) - -```json -{ - "offer": { - "name": "name4", - "handle": "handle0", - "description": "description6", - "product_id": 30, - "product_price_point_id": 150, - "components": [ - { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 - }, - { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 - } +## Example + +```ruby +create_offer_request = CreateOfferRequest.new( + offer: CreateOffer.new( + name: 'name4', + handle: 'handle0', + product_id: 30, + description: 'description6', + product_price_point_id: 150, + components: [ + CreateOfferComponent.new( + component_id: 108, + price_point_id: 124, + starting_quantity: 84 + ), + CreateOfferComponent.new( + component_id: 108, + price_point_id: 124, + starting_quantity: 84 + ) ], - "coupons": [ - "coupons6" + coupons: [ + 'coupons6' ] - } -} + ) +) ``` diff --git a/doc/models/create-offer.md b/doc/models/create-offer.md index e654e7c..3a8cda3 100644 --- a/doc/models/create-offer.md +++ b/doc/models/create-offer.md @@ -17,30 +17,30 @@ | `components` | [`Array[CreateOfferComponent]`](../../doc/models/create-offer-component.md) | Optional | - | | `coupons` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "description": "description4", - "product_id": 208, - "product_price_point_id": 132, - "components": [ - { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 - }, - { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 - } +## Example + +```ruby +create_offer = CreateOffer.new( + name: 'name2', + handle: 'handle8', + product_id: 8, + description: 'description2', + product_price_point_id: 188, + components: [ + CreateOfferComponent.new( + component_id: 108, + price_point_id: 124, + starting_quantity: 84 + ), + CreateOfferComponent.new( + component_id: 108, + price_point_id: 124, + starting_quantity: 84 + ) ], - "coupons": [ - "coupons4" + coupons: [ + 'coupons8' ] -} +) ``` diff --git a/doc/models/create-on-off-component.md b/doc/models/create-on-off-component.md index a87d8fc..d8d05fd 100644 --- a/doc/models/create-on-off-component.md +++ b/doc/models/create-on-off-component.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `on_off_component` | [`OnOffComponent`](../../doc/models/on-off-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "on_off_component": { - "name": "name6", - "description": "description6", - "handle": "handle2", - "taxable": false, - "upgrade_charge": "full", - "downgrade_credit": "full", - "unit_price": "String5" - } -} +## Example + +```ruby +create_on_off_component = CreateOnOffComponent.new( + on_off_component: OnOffComponent.new( + name: 'name6', + unit_price: 'String5', + description: 'description6', + handle: 'handle2', + taxable: false, + upgrade_charge: CreditType::FULL, + downgrade_credit: CreditType::FULL + ) +) ``` diff --git a/doc/models/create-or-update-endpoint-request.md b/doc/models/create-or-update-endpoint-request.md index 787658e..811ee4a 100644 --- a/doc/models/create-or-update-endpoint-request.md +++ b/doc/models/create-or-update-endpoint-request.md @@ -1,7 +1,7 @@ # Create or Update Endpoint Request -Used to Create or Update Endpoint +Used to Create or Update Endpoint. ## Structure @@ -11,18 +11,18 @@ Used to Create or Update Endpoint | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `endpoint` | [`CreateOrUpdateEndpoint`](../../doc/models/create-or-update-endpoint.md) | Required | Used to Create or Update Endpoint | +| `endpoint` | [`CreateOrUpdateEndpoint`](../../doc/models/create-or-update-endpoint.md) | Required | Used to Create or Update Endpoint. | -## Example (as JSON) +## Example -```json -{ - "endpoint": { - "url": "url2", - "webhook_subscriptions": [ - "subscription_prepayment_account_balance_changed" +```ruby +create_or_update_endpoint_request = CreateOrUpdateEndpointRequest.new( + endpoint: CreateOrUpdateEndpoint.new( + url: 'url2', + webhook_subscriptions: [ + WebhookSubscription::STATEMENT_CLOSED ] - } -} + ) +) ``` diff --git a/doc/models/create-or-update-endpoint.md b/doc/models/create-or-update-endpoint.md index 19b5d1c..98beb43 100644 --- a/doc/models/create-or-update-endpoint.md +++ b/doc/models/create-or-update-endpoint.md @@ -1,7 +1,7 @@ # Create or Update Endpoint -Used to Create or Update Endpoint +Used to Create or Update Endpoint. ## Structure @@ -14,14 +14,14 @@ Used to Create or Update Endpoint | `url` | `String` | Required | - | | `webhook_subscriptions` | [`Array[WebhookSubscription]`](../../doc/models/webhook-subscription.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "url": "url8", - "webhook_subscriptions": [ - "refund_success" +```ruby +create_or_update_endpoint = CreateOrUpdateEndpoint.new( + url: 'url2', + webhook_subscriptions: [ + WebhookSubscription::EXPIRATION_DATE_CHANGE ] -} +) ``` diff --git a/doc/models/create-or-update-product-request.md b/doc/models/create-or-update-product-request.md index 27bf13a..45e1feb 100644 --- a/doc/models/create-or-update-product-request.md +++ b/doc/models/create-or-update-product-request.md @@ -11,22 +11,22 @@ | --- | --- | --- | --- | | `product` | [`CreateOrUpdateProduct`](../../doc/models/create-or-update-product.md) | Required | - | -## Example (as JSON) - -```json -{ - "product": { - "name": "name0", - "handle": "handle6", - "description": "description0", - "accounting_code": "accounting_code6", - "require_credit_card": false, - "price_in_cents": 54, - "interval": 186, - "interval_unit": "day", - "trial_price_in_cents": 34, - "trial_interval": 88 - } -} +## Example + +```ruby +create_or_update_product_request = CreateOrUpdateProductRequest.new( + product: CreateOrUpdateProduct.new( + name: 'name0', + description: 'description0', + price_in_cents: 54, + interval: 186, + interval_unit: IntervalUnit::DAY, + handle: 'handle6', + accounting_code: 'accounting_code6', + require_credit_card: false, + trial_price_in_cents: 34, + trial_interval: 88 + ) +) ``` diff --git a/doc/models/create-or-update-product.md b/doc/models/create-or-update-product.md index a47d1b6..ce52460 100644 --- a/doc/models/create-or-update-product.md +++ b/doc/models/create-or-update-product.md @@ -15,31 +15,32 @@ | `accounting_code` | `String` | Optional | E.g. Internal ID or SKU Number | | `require_credit_card` | `TrueClass \| FalseClass` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, read this attribute from under the signup page. | | `price_in_cents` | `Integer` | Required | The product price, in integer cents | -| `interval` | `Integer` | Required | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days | +| `interval` | `Integer` | Required | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product, either month or day | | `trial_price_in_cents` | `Integer` | Optional | The product trial price, in integer cents | -| `trial_interval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product trial would last 30 days. | +| `trial_interval` | `Integer` | Optional | The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product trial would last 30 days. | | `trial_interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | -| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | -| `expiration_interval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product would expire after 30 days. | +| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | +| `expiration_interval` | `Integer` | Optional | The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product would expire after 30 days. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product, either month, day or never | | `auto_create_signup_page` | `TrueClass \| FalseClass` | Optional | - | | `tax_code` | `String` | Optional | A string representing the tax code related to the product type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | - -## Example (as JSON) - -```json -{ - "name": "name8", - "handle": "handle4", - "description": "description8", - "accounting_code": "accounting_code4", - "require_credit_card": false, - "price_in_cents": 190, - "interval": 174, - "interval_unit": "day", - "trial_price_in_cents": 22, - "trial_interval": 76 -} +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this product instead of the default derived from item_category. | + +## Example + +```ruby +create_or_update_product = CreateOrUpdateProduct.new( + name: 'name0', + description: 'description0', + price_in_cents: 48, + interval: 64, + interval_unit: IntervalUnit::DAY, + handle: 'handle6', + accounting_code: 'accounting_code6', + require_credit_card: false, + trial_price_in_cents: 216, + trial_interval: 162 +) ``` diff --git a/doc/models/create-or-update-segment-price.md b/doc/models/create-or-update-segment-price.md index 492bcad..fb832a5 100644 --- a/doc/models/create-or-update-segment-price.md +++ b/doc/models/create-or-update-segment-price.md @@ -13,13 +13,13 @@ | `ending_quantity` | `Integer` | Optional | - | | `unit_price` | String \| Float | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "starting_quantity": 78, - "ending_quantity": 52, - "unit_price": "String7" -} +## Example + +```ruby +create_or_update_segment_price = CreateOrUpdateSegmentPrice.new( + unit_price: 'String7', + starting_quantity: 94, + ending_quantity: 188 +) ``` diff --git a/doc/models/create-payment-profile-request.md b/doc/models/create-payment-profile-request.md index 5cbd684..aa4b96a 100644 --- a/doc/models/create-payment-profile-request.md +++ b/doc/models/create-payment-profile-request.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `payment_profile` | [`CreatePaymentProfile`](../../doc/models/create-payment-profile.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "chargify_token": "tok_9g6hw85pnpt6knmskpwp4ttt", - "full_number": "5424000000000015", - "id": 44, - "payment_type": "credit_card", - "first_name": "first_name4", - "last_name": "last_name2" - } -} +## Example + +```ruby +create_payment_profile_request = CreatePaymentProfileRequest.new( + payment_profile: CreatePaymentProfile.new( + chargify_token: 'tok_9g6hw85pnpt6knmskpwp4ttt', + id: 44, + payment_type: PaymentType::CREDIT_CARD, + first_name: 'first_name4', + last_name: 'last_name2', + full_number: '5424000000000015' + ) +) ``` diff --git a/doc/models/create-payment-profile.md b/doc/models/create-payment-profile.md index fae2203..a10d078 100644 --- a/doc/models/create-payment-profile.md +++ b/doc/models/create-payment-profile.md @@ -19,12 +19,12 @@ | `card_type` | [`CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | | `expiration_month` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `expiration_year` | Integer \| String \| nil | Optional | This is a container for one-of cases. | -| `billing_address` | `String` | Optional | The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | -| `billing_address_2` | `String` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | -| `billing_city` | `String` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | -| `billing_state` | `String` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `billing_country` | `String` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | -| `billing_zip` | `String` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | +| `billing_address` | `String` | Optional | The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. | +| `billing_address_2` | `String` | Optional | Second line of the customer’s billing address e.g., Apt. 100 | +| `billing_city` | `String` | Optional | The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. | +| `billing_state` | `String` | Optional | The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | +| `billing_country` | `String` | Optional | “The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time.” | +| `billing_zip` | `String` | Optional | The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. | | `current_vault` | [`AllVaults`](../../doc/models/all-vaults.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | | `vault_token` | `String` | Optional | The “token” provided by your vault storage for an already stored payment profile | | `customer_vault_token` | `String` | Optional | (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | @@ -34,24 +34,24 @@ | `gateway_handle` | `String` | Optional | This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. | | `cvv` | `String` | Optional | The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | | `bank_name` | `String` | Optional | (Required when creating with ACH or GoCardless, optional with Stripe Direct Debit). The name of the bank where the customerʼs account resides | -| `bank_iban` | `String` | Optional | (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided | -| `bank_routing_number` | `String` | Optional | (Required when creating with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | +| `bank_iban` | `String` | Optional | (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided. | +| `bank_routing_number` | `String` | Optional | (Required when creating with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API. | | `bank_account_number` | `String` | Optional | (Required when creating with ACH, GoCardless, Stripe BECS or BACS Direct Debit, and bank_iban is blank) The customerʼs bank account number | -| `bank_branch_code` | `String` | Optional | (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided | +| `bank_branch_code` | `String` | Optional | (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided. | | `bank_account_type` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | | `bank_account_holder_type` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | | `last_four` | `String` | Optional | (Optional) Used for creating subscription with payment profile imported using vault_token, for proper display in Advanced Billing UI | -## Example (as JSON) - -```json -{ - "chargify_token": "tok_9g6hw85pnpt6knmskpwp4ttt", - "full_number": "5424000000000015", - "id": 76, - "payment_type": "credit_card", - "first_name": "first_name8", - "last_name": "last_name6" -} +## Example + +```ruby +create_payment_profile = CreatePaymentProfile.new( + chargify_token: 'tok_9g6hw85pnpt6knmskpwp4ttt', + id: 32, + payment_type: PaymentType::CREDIT_CARD, + first_name: 'first_name4', + last_name: 'last_name2', + full_number: '5424000000000015' +) ``` diff --git a/doc/models/create-payment.md b/doc/models/create-payment.md index cac6b91..6a485f0 100644 --- a/doc/models/create-payment.md +++ b/doc/models/create-payment.md @@ -14,14 +14,14 @@ | `payment_details` | `String` | Required | - | | `payment_method` | [`InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Required | The type of payment method used. Defaults to other. | -## Example (as JSON) - -```json -{ - "amount": "amount6", - "memo": "memo8", - "payment_details": "payment_details4", - "payment_method": "cash" -} +## Example + +```ruby +create_payment = CreatePayment.new( + amount: 'amount0', + memo: 'memo2', + payment_details: 'payment_details8', + payment_method: InvoicePaymentMethodType::ACH +) ``` diff --git a/doc/models/create-prepaid-component.md b/doc/models/create-prepaid-component.md index 402f80e..8361011 100644 --- a/doc/models/create-prepaid-component.md +++ b/doc/models/create-prepaid-component.md @@ -11,36 +11,36 @@ | --- | --- | --- | --- | | `prepaid_usage_component` | [`PrepaidUsageComponent`](../../doc/models/prepaid-usage-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepaid_usage_component": { - "name": "name2", - "unit_name": "unit_name4", - "description": "description2", - "handle": "handle8", - "taxable": false, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "upgrade_charge": "full", - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +create_prepaid_component = CreatePrepaidComponent.new( + prepaid_usage_component: PrepaidUsageComponent.new( + name: 'name2', + unit_name: 'unit_name4', + pricing_scheme: PricingScheme::PER_UNIT, + overage_pricing: OveragePricing.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ] - } - } -} + ), + description: 'description2', + handle: 'handle8', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + upgrade_charge: CreditType::FULL + ) +) ``` diff --git a/doc/models/create-prepaid-usage-component-price-point.md b/doc/models/create-prepaid-usage-component-price-point.md index 62d1e9d..4086f6a 100644 --- a/doc/models/create-prepaid-usage-component-price-point.md +++ b/doc/models/create-prepaid-usage-component-price-point.md @@ -15,39 +15,39 @@ | `prices` | [`Array[Price]`](../../doc/models/price.md) | Required | - | | `overage_pricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Required | - | | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site.

**Default**: `true` | -| `rollover_prepaid_remainder` | `TrueClass \| FalseClass` | Optional | (only for prepaid usage components) Boolean which controls whether or not remaining units should be rolled over to the next period | -| `renew_prepaid_allocation` | `TrueClass \| FalseClass` | Optional | (only for prepaid usage components) Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | -| `expiration_interval` | `Float` | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire | -| `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) A string representing the expiration interval unit for this component, either month or day | - -## Example (as JSON) - -```json -{ - "name": "name0", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +| `rollover_prepaid_remainder` | `TrueClass \| FalseClass` | Optional | (only for prepaid usage components) Boolean which controls whether or not remaining units should be rolled over to the next period. | +| `renew_prepaid_allocation` | `TrueClass \| FalseClass` | Optional | (only for prepaid usage components) Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period. | +| `expiration_interval` | `Float` | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire. | +| `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) A string representing the expiration interval unit for this component, either month or day. | + +## Example + +```ruby +create_prepaid_usage_component_price_point = CreatePrepaidUsageComponentPricePoint.new( + name: 'name6', + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } + overage_pricing: OveragePricing.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ] - }, - "use_site_exchange_rate": true, - "handle": "handle6", - "rollover_prepaid_remainder": false, - "renew_prepaid_allocation": false, - "expiration_interval": 101.18 -} + ), + handle: 'handle2', + use_site_exchange_rate: true, + rollover_prepaid_remainder: false, + renew_prepaid_allocation: false, + expiration_interval: 117.54 +) ``` diff --git a/doc/models/create-prepayment-method.md b/doc/models/create-prepayment-method.md index 2b0a9c0..c48c1f0 100644 --- a/doc/models/create-prepayment-method.md +++ b/doc/models/create-prepayment-method.md @@ -1,7 +1,7 @@ # Create Prepayment Method -:- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. +When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. ## Enumeration @@ -20,3 +20,9 @@ | `CREDIT_CARD_ON_FILE` | | `OTHER` | +## Example + +```ruby +create_prepayment_method = CreatePrepaymentMethod::PAYPAL_ACCOUNT +``` + diff --git a/doc/models/create-prepayment-request.md b/doc/models/create-prepayment-request.md index 661cec6..c748b64 100644 --- a/doc/models/create-prepayment-request.md +++ b/doc/models/create-prepayment-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `prepayment` | [`CreatePrepayment`](../../doc/models/create-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayment": { - "amount": 11.6, - "details": "details8", - "memo": "memo2", - "method": "money_order", - "payment_profile_id": 240 - } -} +## Example + +```ruby +create_prepayment_request = CreatePrepaymentRequest.new( + prepayment: CreatePrepayment.new( + amount: 11.6, + details: 'details8', + memo: 'memo2', + method: CreatePrepaymentMethod::MONEY_ORDER, + payment_profile_id: 240 + ) +) ``` diff --git a/doc/models/create-prepayment-response.md b/doc/models/create-prepayment-response.md index 7945637..828409d 100644 --- a/doc/models/create-prepayment-response.md +++ b/doc/models/create-prepayment-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `prepayment` | [`CreatedPrepayment`](../../doc/models/created-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayment": { - "id": 38, - "subscription_id": 148, - "amount_in_cents": 124, - "memo": "memo2", - "created_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +create_prepayment_response = CreatePrepaymentResponse.new( + prepayment: CreatedPrepayment.new( + id: 38, + subscription_id: 148, + amount_in_cents: 124, + memo: 'memo2', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/create-prepayment.md b/doc/models/create-prepayment.md index dd9685d..7bea541 100644 --- a/doc/models/create-prepayment.md +++ b/doc/models/create-prepayment.md @@ -12,18 +12,18 @@ | `amount` | `Float` | Required | - | | `details` | `String` | Required | - | | `memo` | `String` | Required | - | -| `method` | [`CreatePrepaymentMethod`](../../doc/models/create-prepayment-method.md) | Required | :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. | +| `method` | [`CreatePrepaymentMethod`](../../doc/models/create-prepayment-method.md) | Required | When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. | | `payment_profile_id` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "amount": 23.92, - "details": "details6", - "memo": "memo0", - "method": "credit_card_on_file", - "payment_profile_id": 240 -} +```ruby +create_prepayment = CreatePrepayment.new( + amount: 14.84, + details: 'details2', + memo: 'memo6', + method: CreatePrepaymentMethod::MONEY_ORDER, + payment_profile_id: 204 +) ``` diff --git a/doc/models/create-product-currency-price.md b/doc/models/create-product-currency-price.md index 0eeb41c..44ad393 100644 --- a/doc/models/create-product-currency-price.md +++ b/doc/models/create-product-currency-price.md @@ -13,13 +13,13 @@ | `price` | `Integer` | Required | Price for the given role. | | `role` | [`CurrencyPriceRole`](../../doc/models/currency-price-role.md) | Required | Role for the price. | -## Example (as JSON) - -```json -{ - "currency": "currency0", - "price": 222, - "role": "baseline" -} +## Example + +```ruby +create_product_currency_price = CreateProductCurrencyPrice.new( + currency: 'currency6', + price: 34, + role: CurrencyPriceRole::BASELINE +) ``` diff --git a/doc/models/create-product-currency-prices-request.md b/doc/models/create-product-currency-prices-request.md index 86f5278..da64a94 100644 --- a/doc/models/create-product-currency-prices-request.md +++ b/doc/models/create-product-currency-prices-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[CreateProductCurrencyPrice]`](../../doc/models/create-product-currency-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 78, - "role": "initial" - } +## Example + +```ruby +create_product_currency_prices_request = CreateProductCurrencyPricesRequest.new( + currency_prices: [ + CreateProductCurrencyPrice.new( + currency: 'currency8', + price: 78, + role: CurrencyPriceRole::INITIAL + ) ] -} +) ``` diff --git a/doc/models/create-product-family-request.md b/doc/models/create-product-family-request.md index 60d87a2..603eb81 100644 --- a/doc/models/create-product-family-request.md +++ b/doc/models/create-product-family-request.md @@ -11,15 +11,16 @@ | --- | --- | --- | --- | | `product_family` | [`CreateProductFamily`](../../doc/models/create-product-family.md) | Required | - | -## Example (as JSON) - -```json -{ - "product_family": { - "name": "name0", - "handle": "handle6", - "description": "description0" - } -} +## Example + +```ruby +create_product_family_request = CreateProductFamilyRequest.new( + product_family: CreateProductFamily.new( + name: 'name0', + handle: 'handle6', + description: 'description0', + surcharging: false + ) +) ``` diff --git a/doc/models/create-product-family.md b/doc/models/create-product-family.md index eb13f6d..aab4af2 100644 --- a/doc/models/create-product-family.md +++ b/doc/models/create-product-family.md @@ -12,14 +12,16 @@ | `name` | `String` | Required | - | | `handle` | `String` | Optional | - | | `description` | `String` | Optional | - | +| `surcharging` | `TrueClass \| FalseClass` | Optional | Whether surcharging applies to this product family. Defaults to `true` when omitted. Only applied on sites where surcharging is enabled. | -## Example (as JSON) +## Example -```json -{ - "name": "name6", - "handle": "handle2", - "description": "description6" -} +```ruby +create_product_family = CreateProductFamily.new( + name: 'name6', + handle: 'handle2', + description: 'description4', + surcharging: false +) ``` diff --git a/doc/models/create-product-price-point-request.md b/doc/models/create-product-price-point-request.md index d0d7347..9231c12 100644 --- a/doc/models/create-product-price-point-request.md +++ b/doc/models/create-product-price-point-request.md @@ -11,22 +11,22 @@ | --- | --- | --- | --- | | `price_point` | [`CreateProductPricePoint`](../../doc/models/create-product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "price_in_cents": 196, - "interval": 44, - "interval_unit": "day", - "use_site_exchange_rate": true, - "handle": "handle6", - "trial_price_in_cents": 108, - "trial_interval": 202, - "trial_interval_unit": "day", - "trial_type": "no_obligation" - } -} +## Example + +```ruby +create_product_price_point_request = CreateProductPricePointRequest.new( + price_point: CreateProductPricePoint.new( + name: 'name0', + price_in_cents: 196, + interval: 44, + interval_unit: IntervalUnit::DAY, + handle: 'handle6', + trial_price_in_cents: 108, + trial_interval: 202, + trial_interval_unit: IntervalUnit::DAY, + trial_type: TrialType::NO_OBLIGATION, + use_site_exchange_rate: true + ) +) ``` diff --git a/doc/models/create-product-price-point.md b/doc/models/create-product-price-point.md index 07bb487..1ac33fe 100644 --- a/doc/models/create-product-price-point.md +++ b/doc/models/create-product-price-point.md @@ -12,32 +12,32 @@ | `name` | `String` | Required | The product price point name | | `handle` | `String` | Optional | The product price point API handle | | `price_in_cents` | `Integer` | Required | The product price point price, in integer cents | -| `interval` | `Integer` | Required | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days | +| `interval` | `Integer` | Required | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product price point, either month or day | | `trial_price_in_cents` | `Integer` | Optional | The product price point trial price, in integer cents | -| `trial_interval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | +| `trial_interval` | `Integer` | Optional | The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | | `trial_interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | -| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | +| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | | `initial_charge_in_cents` | `Integer` | Optional | The product price point initial charge, in integer cents | | `initial_charge_after_trial` | `TrueClass \| FalseClass` | Optional | - | -| `expiration_interval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | +| `expiration_interval` | `Integer` | Optional | The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month, day or never | | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined.

**Default**: `true` | -## Example (as JSON) - -```json -{ - "name": "name6", - "price_in_cents": 216, - "interval": 200, - "interval_unit": "day", - "use_site_exchange_rate": true, - "handle": "handle2", - "trial_price_in_cents": 48, - "trial_interval": 102, - "trial_interval_unit": "day", - "trial_type": "no_obligation" -} +## Example + +```ruby +create_product_price_point = CreateProductPricePoint.new( + name: 'name4', + price_in_cents: 42, + interval: 198, + interval_unit: IntervalUnit::DAY, + handle: 'handle0', + trial_price_in_cents: 210, + trial_interval: 100, + trial_interval_unit: IntervalUnit::DAY, + trial_type: TrialType::NO_OBLIGATION, + use_site_exchange_rate: true +) ``` diff --git a/doc/models/create-quantity-based-component.md b/doc/models/create-quantity-based-component.md index 6206ad0..f276ae8 100644 --- a/doc/models/create-quantity-based-component.md +++ b/doc/models/create-quantity-based-component.md @@ -11,31 +11,31 @@ | --- | --- | --- | --- | | `quantity_based_component` | [`QuantityBasedComponent`](../../doc/models/quantity-based-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "quantity_based_component": { - "name": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +create_quantity_based_component = CreateQuantityBasedComponent.new( + quantity_based_component: QuantityBasedComponent.new( + name: 'name0', + unit_name: 'unit_name2', + pricing_scheme: PricingScheme::STAIRSTEP, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "upgrade_charge": "prorated" - } -} + upgrade_charge: CreditType::PRORATED + ) +) ``` diff --git a/doc/models/create-reason-code-request.md b/doc/models/create-reason-code-request.md index fcd21fd..4988208 100644 --- a/doc/models/create-reason-code-request.md +++ b/doc/models/create-reason-code-request.md @@ -11,15 +11,15 @@ | --- | --- | --- | --- | | `reason_code` | [`CreateReasonCode`](../../doc/models/create-reason-code.md) | Required | - | -## Example (as JSON) - -```json -{ - "reason_code": { - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```ruby +create_reason_code_request = CreateReasonCodeRequest.new( + reason_code: CreateReasonCode.new( + code: 'code4', + description: 'description6', + position: 14 + ) +) ``` diff --git a/doc/models/create-reason-code.md b/doc/models/create-reason-code.md index 9ab63c1..427c822 100644 --- a/doc/models/create-reason-code.md +++ b/doc/models/create-reason-code.md @@ -13,13 +13,13 @@ | `description` | `String` | Required | The friendly summary of what the code signifies | | `position` | `Integer` | Optional | The order that code appears in lists | -## Example (as JSON) - -```json -{ - "code": "code4", - "description": "description6", - "position": 86 -} +## Example + +```ruby +create_reason_code = CreateReasonCode.new( + code: 'code6', + description: 'description8', + position: 252 +) ``` diff --git a/doc/models/create-segment-request.md b/doc/models/create-segment-request.md index d41bef0..5380991 100644 --- a/doc/models/create-segment-request.md +++ b/doc/models/create-segment-request.md @@ -11,34 +11,34 @@ | --- | --- | --- | --- | | `segment` | [`CreateSegment`](../../doc/models/create-segment.md) | Required | - | -## Example (as JSON) - -```json -{ - "segment": { - "segment_property_1_value": "String1", - "segment_property_2_value": "String3", - "segment_property_3_value": "String1", - "segment_property_4_value": "String5", - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +## Example + +```ruby +create_segment_request = CreateSegmentRequest.new( + segment: CreateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + segment_property_1_value: 'String1', + segment_property_2_value: 'String3', + segment_property_3_value: 'String1', + segment_property_4_value: 'String5', + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] - } -} + ) +) ``` diff --git a/doc/models/create-segment.md b/doc/models/create-segment.md index 2828f6c..7b255a5 100644 --- a/doc/models/create-segment.md +++ b/doc/models/create-segment.md @@ -16,32 +16,32 @@ | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array[CreateOrUpdateSegmentPrice]`](../../doc/models/create-or-update-segment-price.md) | Optional | - | -## Example (as JSON) - -```json -{ - "segment_property_1_value": "String9", - "segment_property_2_value": "String1", - "segment_property_3_value": "String3", - "segment_property_4_value": "String3", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +## Example + +```ruby +create_segment = CreateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + segment_property_1_value: 'String3', + segment_property_2_value: 'String5', + segment_property_3_value: 'String3', + segment_property_4_value: 'String7', + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] -} +) ``` diff --git a/doc/models/create-signup-proforma-preview-include.md b/doc/models/create-signup-proforma-preview-include.md index e652ba4..d6dffa0 100644 --- a/doc/models/create-signup-proforma-preview-include.md +++ b/doc/models/create-signup-proforma-preview-include.md @@ -13,7 +13,7 @@ ## Example -``` -next_proforma_invoice +```ruby +create_signup_proforma_preview_include = CreateSignupProformaPreviewInclude::NEXT_PROFORMA_INVOICE ``` diff --git a/doc/models/create-subscription-component.md b/doc/models/create-subscription-component.md index 619279f..edf4760 100644 --- a/doc/models/create-subscription-component.md +++ b/doc/models/create-subscription-component.md @@ -11,21 +11,21 @@ | --- | --- | --- | --- | | `component_id` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `enabled` | `TrueClass \| FalseClass` | Optional | Used for on/off components only. | -| `unit_balance` | `Integer` | Optional | Used for metered and events based components. | +| `unit_balance` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `allocated_quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `quantity` | `Integer` | Optional | Deprecated. Use `allocated_quantity` instead. | | `price_point_id` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) +## Example -```json -{ - "component_id": 8, - "enabled": false, - "unit_balance": 144, - "allocated_quantity": 102, - "quantity": 188 -} +```ruby +create_subscription_component = CreateSubscriptionComponent.new( + component_id: 66, + enabled: false, + unit_balance: 124, + allocated_quantity: 160, + quantity: 246 +) ``` diff --git a/doc/models/create-subscription-group-request.md b/doc/models/create-subscription-group-request.md index b681298..27bafc0 100644 --- a/doc/models/create-subscription-group-request.md +++ b/doc/models/create-subscription-group-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `subscription_group` | [`CreateSubscriptionGroup`](../../doc/models/create-subscription-group.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_group": { - "subscription_id": 36, - "member_ids": [ +```ruby +create_subscription_group_request = CreateSubscriptionGroupRequest.new( + subscription_group: CreateSubscriptionGroup.new( + subscription_id: 36, + member_ids: [ 164, 165 ] - } -} + ) +) ``` diff --git a/doc/models/create-subscription-group.md b/doc/models/create-subscription-group.md index c23657d..ee6e0c3 100644 --- a/doc/models/create-subscription-group.md +++ b/doc/models/create-subscription-group.md @@ -12,14 +12,14 @@ | `subscription_id` | `Integer` | Required | - | | `member_ids` | `Array[Integer]` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "subscription_id": 38, - "member_ids": [ - 162 +```ruby +create_subscription_group = CreateSubscriptionGroup.new( + subscription_id: 130, + member_ids: [ + 230 ] -} +) ``` diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index 3c5137b..9150367 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -11,33 +11,33 @@ | --- | --- | --- | --- | | `subscription` | [`CreateSubscription`](../../doc/models/create-subscription.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription": { - "defer_signup": false, - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" +## Example + +```ruby +create_subscription_request = CreateSubscriptionRequest.new( + subscription: CreateSubscription.new( + product_handle: 'product_handle6', + product_id: 206, + product_price_point_handle: 'product_price_point_handle2', + product_price_point_id: 130, + custom_price: SubscriptionCustomPrice.new( + price_in_cents: 'String3', + interval: 'String3', + interval_unit: IntervalUnit::DAY, + name: 'name4', + handle: 'handle0', + trial_price_in_cents: 'String3', + trial_interval: 'String5', + trial_interval_unit: IntervalUnit::DAY + ), + defer_signup: false, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' }, - "dunning_communication_delay_enabled": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "product_handle": "product_handle6", - "product_id": 206, - "product_price_point_handle": "product_price_point_handle2", - "product_price_point_id": 130, - "custom_price": { - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "trial_price_in_cents": "String3", - "trial_interval": "String5", - "trial_interval_unit": "day" - } - } -} + dunning_communication_delay_enabled: false, + dunning_communication_delay_time_zone: '"Eastern Time (US & Canada)"' + ) +) ``` diff --git a/doc/models/create-subscription.md b/doc/models/create-subscription.md index 125d47e..e502eeb 100644 --- a/doc/models/create-subscription.md +++ b/doc/models/create-subscription.md @@ -20,19 +20,20 @@ | `receives_invoice_emails` | `String` | Optional | (Optional) Default: True - Whether or not this subscription is set to receive emails related to this subscription. | | `net_terms` | `String` | Optional | (Optional) Default: null The number of days after renewal (on invoice billing) that a subscription is due. A value between 0 (due immediately) and 180. | | `customer_id` | `Integer` | Optional | The ID of an existing customer within Chargify. Required, unless a `customer_reference` or a set of `customer_attributes` is given. | +| `branding_theme_id` | `Integer` | Optional | The ID of the Branding Theme to assign to this subscription. When set, this subscription-level Branding Theme is used instead of the customer's default Branding Theme for subscription-related documents and communications that use subscription theming. Pass null or an empty value to clear the subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. Not returned in the response. | | `next_billing_at` | `DateTime` | Optional | (Optional) Set this attribute to a future date/time to sync imported subscriptions to your existing renewal schedule. See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format). If you provide a next_billing_at timestamp that is in the future, no trial or initial charges will be applied when you create the subscription. In fact, no payment will be captured at all. The first payment will be captured, according to the prices defined by the product, near the time specified by next_billing_at. If you do not provide a value for next_billing_at, any trial and/or initial charges will be assessed and charged at the time of subscription creation. If the card cannot be successfully charged, the subscription will not be created. See further notes in the section on Importing Subscriptions. | | `initial_billing_at` | `DateTime` | Optional | (Optional) Set this attribute to a future date/time to create a subscription in the Awaiting Signup state, rather than Active or Trialing. You can omit the initial_billing_at date to activate the subscription immediately. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed. etc. When the initial_billing_at date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time Formats. | -| `defer_signup` | `TrueClass \| FalseClass` | Optional | (Optional) Set this attribute to true to create the subscription in the Awaiting Signup Date state. Use this when you want to create a subscription that has an unknown first billing date. When the first billing date is known, update a subscription and set the `initial_billing_at` date. The subscription moves to the Awaiting Signup state with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information.

**Default**: `false` | +| `defer_signup` | `TrueClass \| FalseClass` | Optional | (Optional) Set this attribute to true to create the subscription in the Awaiting Signup Date state. Use this when you want to create a subscription that has an unknown first billing date. When the first billing date is known, update a subscription and set the `initial_billing_at` date. The subscription moves to the Awaiting Signup state with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information.

**Default**: `false` | | `stored_credential_transaction_id` | `Integer` | Optional | For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal. | | `sales_rep_id` | `Integer` | Optional | - | -| `payment_profile_id` | `Integer` | Optional | The Payment Profile ID of an existing card or bank account, which belongs to an existing customer to use for payment for this subscription. If the card, bank account, or customer does not exist already, or if you want to use a new (unstored) card or bank account for the subscription, use `payment_profile_attributes` instead to create a new payment profile along with the subscription. (This value is available on an existing subscription via the API as `credit_card` > id or `bank_account` > id) | +| `payment_profile_id` | `Integer` | Optional | The Payment Profile ID of an existing card or bank account, which belongs to an existing customer to use for payment for this subscription. If the card, bank account, or customer does not exist already, or if you want to use a new (unstored) card or bank account for the subscription, use `payment_profile_attributes` instead to create a new payment profile along with the subscription. (This value is available on an existing subscription via the API as `credit_card` > id or `bank_account` > id.) | | `reference` | `String` | Optional | The reference value (provided by your app) for the subscription itself. | | `customer_attributes` | [`CustomerAttributes`](../../doc/models/customer-attributes.md) | Optional | - | | `payment_profile_attributes` | [`PaymentProfileAttributes`](../../doc/models/payment-profile-attributes.md) | Optional | alias to credit_card_attributes | | `credit_card_attributes` | [`PaymentProfileAttributes`](../../doc/models/payment-profile-attributes.md) | Optional | Credit Card data to create a new Subscription. Interchangeable with `payment_profile_attributes` property. | | `bank_account_attributes` | [`BankAccountAttributes`](../../doc/models/bank-account-attributes.md) | Optional | - | | `components` | [`Array[CreateSubscriptionComponent]`](../../doc/models/create-subscription-component.md) | Optional | (Optional) An array of component ids and quantities to be added to the subscription. See [Components](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview) for more information. | -| `calendar_billing` | [`CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at | +| `calendar_billing` | [`CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at. | | `metafields` | `Hash[String, String]` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | | `customer_reference` | `String` | Optional | The reference value (provided by your app) of an existing customer within Chargify. Required, unless a `customer_id` or a set of `customer_attributes` is given. | | `group` | [`GroupSettings`](../../doc/models/group-settings.md) | Optional | - | @@ -60,31 +61,31 @@ | `dunning_communication_delay_time_zone` | `String` | Optional | Time zone for the Dunning Communication Delay feature. | | `skip_billing_manifest_taxes` | `TrueClass \| FalseClass` | Optional | Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests. Defaults to `false` when not provided. | -## Example (as JSON) +## Example -```json -{ - "defer_signup": false, - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" +```ruby +create_subscription = CreateSubscription.new( + product_handle: 'product_handle0', + product_id: 60, + product_price_point_handle: 'product_price_point_handle6', + product_price_point_id: 240, + custom_price: SubscriptionCustomPrice.new( + price_in_cents: 'String3', + interval: 'String3', + interval_unit: IntervalUnit::DAY, + name: 'name4', + handle: 'handle0', + trial_price_in_cents: 'String3', + trial_interval: 'String5', + trial_interval_unit: IntervalUnit::DAY + ), + defer_signup: false, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' }, - "dunning_communication_delay_enabled": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "product_handle": "product_handle6", - "product_id": 212, - "product_price_point_handle": "product_price_point_handle0", - "product_price_point_id": 136, - "custom_price": { - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "trial_price_in_cents": "String3", - "trial_interval": "String5", - "trial_interval_unit": "day" - } -} + dunning_communication_delay_enabled: false, + dunning_communication_delay_time_zone: '"Eastern Time (US & Canada)"' +) ``` diff --git a/doc/models/create-usage-request.md b/doc/models/create-usage-request.md index 1a754cb..b06321f 100644 --- a/doc/models/create-usage-request.md +++ b/doc/models/create-usage-request.md @@ -11,37 +11,37 @@ | --- | --- | --- | --- | | `usage` | [`CreateUsage`](../../doc/models/create-usage.md) | Required | - | -## Example (as JSON) - -```json -{ - "usage": { - "quantity": 162.34, - "price_point_id": "price_point_id0", - "memo": "memo2", - "billing_schedule": { - "initial_billing_at": "2016-03-13" - }, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } - } -} +## Example + +```ruby +create_usage_request = CreateUsageRequest.new( + usage: CreateUsage.new( + quantity: 162.34, + price_point_id: 'price_point_id0', + memo: 'memo2', + billing_schedule: BillingSchedule.new( + initial_billing_at: Date.iso8601('2016-03-13') + ), + custom_price: ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 66, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 174 + ) + ) +) ``` diff --git a/doc/models/create-usage.md b/doc/models/create-usage.md index 6dad891..a6d447f 100644 --- a/doc/models/create-usage.md +++ b/doc/models/create-usage.md @@ -15,35 +15,35 @@ | `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | | `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) - -```json -{ - "quantity": 23.44, - "price_point_id": "price_point_id0", - "memo": "memo2", - "billing_schedule": { - "initial_billing_at": "2016-03-13" - }, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} +## Example + +```ruby +create_usage = CreateUsage.new( + quantity: 244.02, + price_point_id: 'price_point_id8', + memo: 'memo0', + billing_schedule: BillingSchedule.new( + initial_billing_at: Date.iso8601('2016-03-13') + ), + custom_price: ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 66, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 174 + ) +) ``` diff --git a/doc/models/created-prepayment.md b/doc/models/created-prepayment.md index fc798e3..9ed57e9 100644 --- a/doc/models/created-prepayment.md +++ b/doc/models/created-prepayment.md @@ -17,15 +17,15 @@ | `starting_balance_in_cents` | `Integer` | Optional | **Constraints**: `>= 0` | | `ending_balance_in_cents` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 110, - "subscription_id": 220, - "amount_in_cents": 196, - "memo": "memo6", - "created_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +created_prepayment = CreatedPrepayment.new( + id: 228, + subscription_id: 82, + amount_in_cents: 198, + memo: 'memo6', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/credit-account-balance-changed.md b/doc/models/credit-account-balance-changed.md index d9bfd09..9a1312c 100644 --- a/doc/models/credit-account-balance-changed.md +++ b/doc/models/credit-account-balance-changed.md @@ -15,15 +15,15 @@ | `currency_code` | `String` | Required | - | | `at_time` | `DateTime` | Required | - | -## Example (as JSON) - -```json -{ - "reason": "reason8", - "service_credit_account_balance_in_cents": 10, - "service_credit_balance_change_in_cents": 116, - "currency_code": "currency_code8", - "at_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +credit_account_balance_changed = CreditAccountBalanceChanged.new( + reason: 'reason8', + service_credit_account_balance_in_cents: 64, + service_credit_balance_change_in_cents: 190, + currency_code: 'currency_code8', + at_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/credit-card-attributes.md b/doc/models/credit-card-attributes.md index 93322fb..bb36311 100644 --- a/doc/models/credit-card-attributes.md +++ b/doc/models/credit-card-attributes.md @@ -13,13 +13,13 @@ | `expiration_month` | `String` | Optional | - | | `expiration_year` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "full_number": "full_number0", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year0" -} +## Example + +```ruby +credit_card_attributes = CreditCardAttributes.new( + full_number: 'full_number2', + expiration_month: 'expiration_month6', + expiration_year: 'expiration_year2' +) ``` diff --git a/doc/models/credit-card-payment-profile.md b/doc/models/credit-card-payment-profile.md index 893b2e2..80aef02 100644 --- a/doc/models/credit-card-payment-profile.md +++ b/doc/models/credit-card-payment-profile.md @@ -12,10 +12,10 @@ | `id` | `Integer` | Optional | The Chargify-assigned ID of the stored card. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer. | | `first_name` | `String` | Optional | The first name of the card holder. | | `last_name` | `String` | Optional | The last name of the card holder. | -| `masked_card_number` | `String` | Optional | A string representation of the credit card number with all but the last 4 digits masked with X’s (i.e. ‘XXXX-XXXX-XXXX-1234’). | +| `masked_card_number` | `String` | Optional | A string representation of the credit card number with all but the last 4 digits masked with X’s (e.g., ‘XXXX-XXXX-XXXX-1234’). | | `card_type` | [`CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | | `expiration_month` | `Integer` | Optional | An integer representing the expiration month of the card(1 – 12). | -| `expiration_year` | `Integer` | Optional | An integer representing the 4-digit expiration year of the card(i.e. ‘2012’). | +| `expiration_year` | `Integer` | Optional | An integer representing the 4-digit expiration year of the card(e.g., ‘2012’). | | `customer_id` | `Integer` | Optional | The Chargify-assigned id for the customer record to which the card belongs. | | `current_vault` | [`CreditCardVault`](../../doc/models/credit-card-vault.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | | `vault_token` | `String` | Optional | The “token” provided by your vault storage for an already stored payment profile. | @@ -28,36 +28,36 @@ | `billing_address_2` | `String` | Optional | The current billing street address, second line, for the card. | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType::CREDIT_CARD` | | `disabled` | `TrueClass \| FalseClass` | Optional | - | -| `chargify_token` | `String` | Optional | Token received after sending billing information using Maxio.js (formerly Chargify.js). This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | +| `chargify_token` | `String` | Optional | Token received after sending billing information using Maxio.js (formerly Chargify.js). This token will only be received if passed as a sole attribute of credit_card_attributes (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). | | `site_gateway_setting_id` | `Integer` | Optional | - | | `gateway_handle` | `String` | Optional | An identifier of connected gateway. | | `created_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was created | | `updated_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was last updated | -## Example (as JSON) - -```json -{ - "id": 10088716, - "first_name": "Test", - "last_name": "Subscription", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2022, - "customer_id": 14543792, - "current_vault": "bogus", - "vault_token": "1", - "billing_address": "123 Montana Way", - "billing_city": "Billings", - "billing_state": "MT", - "billing_zip": "59101", - "billing_country": "US", - "customer_vault_token": null, - "billing_address_2": "", - "payment_type": "credit_card", - "site_gateway_setting_id": 1, - "gateway_handle": null -} +## Example + +```ruby +credit_card_payment_profile = CreditCardPaymentProfile.new( + payment_type: PaymentType::CREDIT_CARD, + id: 10088716, + first_name: 'Test', + last_name: 'Subscription', + masked_card_number: 'XXXX-XXXX-XXXX-1', + card_type: CardType::BOGUS, + expiration_month: 1, + expiration_year: 2022, + customer_id: 14543792, + current_vault: CreditCardVault::BOGUS, + vault_token: '1', + billing_address: '123 Montana Way', + billing_city: 'Billings', + billing_state: 'MT', + billing_zip: '59101', + billing_country: 'US', + customer_vault_token: 'customer_vault_token2', + billing_address_2: '', + site_gateway_setting_id: 1, + gateway_handle: 'gateway_handle8' +) ``` diff --git a/doc/models/credit-card-vault.md b/doc/models/credit-card-vault.md index 64f7914..556a2e7 100644 --- a/doc/models/credit-card-vault.md +++ b/doc/models/credit-card-vault.md @@ -45,3 +45,9 @@ The vault that stores the payment profile with the provided `vault_token`. Use ` | `UNIPAAS` | | `WIRECARD` | +## Example + +```ruby +credit_card_vault = CreditCardVault::BRAINTREE1 +``` + diff --git a/doc/models/credit-note-application.md b/doc/models/credit-note-application.md index af17966..308e489 100644 --- a/doc/models/credit-note-application.md +++ b/doc/models/credit-note-application.md @@ -15,15 +15,15 @@ | `memo` | `String` | Optional | - | | `applied_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "transaction_time": "2016-03-13T12:52:32.123Z", - "invoice_uid": "invoice_uid0", - "memo": "memo4", - "applied_amount": "applied_amount8" -} +## Example + +```ruby +credit_note_application = CreditNoteApplication.new( + uid: 'uid0', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice_uid: 'invoice_uid0', + memo: 'memo4', + applied_amount: 'applied_amount2' +) ``` diff --git a/doc/models/credit-note-line-item.md b/doc/models/credit-note-line-item.md index 2ebeb0b..98006d8 100644 --- a/doc/models/credit-note-line-item.md +++ b/doc/models/credit-note-line-item.md @@ -13,7 +13,7 @@ | `title` | `String` | Optional | A short descriptor for the credit given by this line. | | `description` | `String` | Optional | Detailed description for the credit given by this line. May include proration details in plain text.

Note: this string may contain line breaks that are hints for the best display format on the credit note. | | `quantity` | `String` | Optional | The quantity or count of units credited by the line item.

This is a decimal number represented as a string. (See "About Decimal Numbers".) | -| `unit_price` | `String` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e. not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | +| `unit_price` | `String` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e., not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | | `subtotal_amount` | `String` | Optional | The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount). | | `discount_amount` | `String` | Optional | The approximate discount of just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total discount among many lines. Several lines may have been summed prior to applying the discount to arrive at `discount_amount` for the invoice - backing that out to the discount on a single line may introduce rounding or precision errors. | | `tax_amount` | `String` | Optional | The approximate tax of just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | @@ -30,15 +30,15 @@ | `custom_item` | `TrueClass \| FalseClass` | Optional | - | | `prepaid_allocation_expires_at` | `Date` | Optional | The date a prepaid allocation is set to expire. Only present on line items representing prepaid component allocations. The format is `"YYYY-MM-DD"`. | -## Example (as JSON) +## Example -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description6", - "quantity": "quantity0", - "unit_price": "unit_price2" -} +```ruby +credit_note_line_item = CreditNoteLineItem.new( + uid: 'uid2', + title: 'title8', + description: 'description2', + quantity: 'quantity8', + unit_price: 'unit_price0' +) ``` diff --git a/doc/models/credit-note-status.md b/doc/models/credit-note-status.md index 1b4271a..cf3d0d2 100644 --- a/doc/models/credit-note-status.md +++ b/doc/models/credit-note-status.md @@ -14,3 +14,9 @@ Current status of the credit note. | `OPEN` | | `APPLIED` | +## Example + +```ruby +credit_note_status = CreditNoteStatus::OPEN +``` + diff --git a/doc/models/credit-note.md b/doc/models/credit-note.md index a9a5dc0..3d0b430 100644 --- a/doc/models/credit-note.md +++ b/doc/models/credit-note.md @@ -21,13 +21,13 @@ | `currency` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. | | `memo` | `String` | Optional | The memo printed on credit note, which is a description of the reason for the credit. | | `seller` | [`InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the credit note. | -| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the credited subscription. | +| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient of the credited subscription. | | `billing_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The billing address of the credit subscription. | | `shipping_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The shipping address of the credited subscription. | | `subtotal_amount` | `String` | Optional | Subtotal of the credit note, which is the sum of all line items before discounts or taxes. Note that this is a positive amount representing the credit back to the customer. | -| `discount_amount` | `String` | Optional | Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e. a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). | -| `tax_amount` | `String` | Optional | Total tax of the credit note. Note that this is a positive amount representing a previously taxex amount being credited back to the customer (i.e. a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). | -| `total_amount` | `String` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' | +| `discount_amount` | `String` | Optional | Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e., a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). | +| `tax_amount` | `String` | Optional | Total tax of the credit note. Note that this is a positive amount representing a previously taxed amount being credited back to the customer (i.e., a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). | +| `total_amount` | `String` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`. | | `applied_amount` | `String` | Optional | The amount of the credit note that has already been applied to invoices. | | `remaining_amount` | `String` | Optional | The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`. | | `line_items` | [`Array[CreditNoteLineItem]`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the credit note. | @@ -35,17 +35,17 @@ | `taxes` | [`Array[InvoiceTax]`](../../doc/models/invoice-tax.md) | Optional | - | | `applications` | [`Array[CreditNoteApplication]`](../../doc/models/credit-note-application.md) | Optional | - | | `refunds` | [`Array[InvoiceRefund]`](../../doc/models/invoice-refund.md) | Optional | - | -| `origin_invoices` | [`Array[OriginInvoice]`](../../doc/models/origin-invoice.md) | Optional | An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices) | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "site_id": 218, - "customer_id": 74, - "subscription_id": 146, - "number": "number0" -} +| `origin_invoices` | [`Array[OriginInvoice]`](../../doc/models/origin-invoice.md) | Optional | An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices). | + +## Example + +```ruby +credit_note = CreditNote.new( + uid: 'uid0', + site_id: 68, + customer_id: 180, + subscription_id: 252, + number: 'number8' +) ``` diff --git a/doc/models/credit-scheme-request.md b/doc/models/credit-scheme-request.md index 168c934..7417adf 100644 --- a/doc/models/credit-scheme-request.md +++ b/doc/models/credit-scheme-request.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `credit_scheme` | [`CreditScheme`](../../doc/models/credit-scheme.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "credit_scheme": "credit" -} +```ruby +credit_scheme_request = CreditSchemeRequest.new( + credit_scheme: CreditScheme::REFUND +) ``` diff --git a/doc/models/credit-scheme.md b/doc/models/credit-scheme.md index fdf3956..ca717e3 100644 --- a/doc/models/credit-scheme.md +++ b/doc/models/credit-scheme.md @@ -13,3 +13,9 @@ | `CREDIT` | | `REFUND` | +## Example + +```ruby +credit_scheme = CreditScheme::NONE +``` + diff --git a/doc/models/credit-type.md b/doc/models/credit-type.md index f7d2a09..b57693c 100644 --- a/doc/models/credit-type.md +++ b/doc/models/credit-type.md @@ -15,3 +15,9 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `PRORATED` | | `NONE` | +## Example + +```ruby +credit_type = CreditType::NONE +``` + diff --git a/doc/models/currency-overage-prices.md b/doc/models/currency-overage-prices.md index 695688b..6f2dfdf 100644 --- a/doc/models/currency-overage-prices.md +++ b/doc/models/currency-overage-prices.md @@ -13,7 +13,7 @@ Extends a component price point with currency overage prices. | --- | --- | --- | --- | | `id` | `Integer` | Optional | - | | `type` | [`PricePointType`](../../doc/models/price-point-type.md) | Optional | Price point type. We expose the following types:

1. **default**: a price point that is marked as a default price for a certain product.
2. **custom**: a custom price point.
3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one. | -| `default` | `TrueClass \| FalseClass` | Optional | Note: Refer to type attribute instead | +| `default` | `TrueClass \| FalseClass` | Optional | Note: Refer to type attribute instead. | | `name` | `String` | Optional | - | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `component_id` | `Integer` | Optional | - | @@ -25,7 +25,7 @@ Extends a component price point with currency overage prices. | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Defaults to true during creation. | | `subscription_id` | `Integer` | Optional | (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for. | | `tax_included` | `TrueClass \| FalseClass` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | | `currency_prices` | [`Array[ComponentCurrencyPrice]`](../../doc/models/component-currency-price.md) | Optional | An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. The clone endpoint always returns currency prices if they are present. | | `overage_prices` | [`Array[ComponentPrice]`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | @@ -36,15 +36,15 @@ Extends a component price point with currency overage prices. | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | Applicable only to prepaid usage components where rollover_prepaid_remainder is true. A string representing the expiration interval unit for this component, either month or day. | | `currency_overage_prices` | [`Array[ComponentCurrencyPrice]`](../../doc/models/component-currency-price.md) | Optional | Applicable only to prepaid usage components. An array of currency pricing data for overage prices. | -## Example (as JSON) +## Example -```json -{ - "id": 50, - "type": "catalog", - "default": false, - "name": "name8", - "pricing_scheme": "stairstep" -} +```ruby +currency_overage_prices = CurrencyOveragePrices.new( + id: 26, + type: PricePointType::CATALOG, + default: false, + name: 'name8', + pricing_scheme: PricingScheme::STAIRSTEP +) ``` diff --git a/doc/models/currency-price-role.md b/doc/models/currency-price-role.md index 32d7847..fa423fe 100644 --- a/doc/models/currency-price-role.md +++ b/doc/models/currency-price-role.md @@ -15,3 +15,9 @@ Role for the price. | `TRIAL` | | `INITIAL` | +## Example + +```ruby +currency_price_role = CurrencyPriceRole::TRIAL +``` + diff --git a/doc/models/currency-price.md b/doc/models/currency-price.md index e5da364..37f52ac 100644 --- a/doc/models/currency-price.md +++ b/doc/models/currency-price.md @@ -18,15 +18,15 @@ | `product_price_point_id` | `Integer` | Optional | - | | `role` | [`CurrencyPriceRole`](../../doc/models/currency-price-role.md) | Optional | Role for the price. | -## Example (as JSON) - -```json -{ - "id": 88, - "currency": "currency6", - "price": 41.36, - "formatted_price": "formatted_price4", - "price_id": 178 -} +## Example + +```ruby +currency_price = CurrencyPrice.new( + id: 254, + currency: 'currency6', + price: 247.06, + formatted_price: 'formatted_price4', + price_id: 168 +) ``` diff --git a/doc/models/currency-prices-response.md b/doc/models/currency-prices-response.md index b0566a0..90e329c 100644 --- a/doc/models/currency-prices-response.md +++ b/doc/models/currency-prices-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[CurrencyPrice]`](../../doc/models/currency-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "formatted_price": "formatted_price6", - "price_id": 116 - } +## Example + +```ruby +currency_prices_response = CurrencyPricesResponse.new( + currency_prices: [ + CurrencyPrice.new( + id: 50, + currency: 'currency8', + price: 233.74, + formatted_price: 'formatted_price6', + price_id: 116 + ) ] -} +) ``` diff --git a/doc/models/custom-field-owner.md b/doc/models/custom-field-owner.md index 77c2f82..9f75881 100644 --- a/doc/models/custom-field-owner.md +++ b/doc/models/custom-field-owner.md @@ -12,3 +12,9 @@ | `CUSTOMER` | | `SUBSCRIPTION` | +## Example + +```ruby +custom_field_owner = CustomFieldOwner::CUSTOMER +``` + diff --git a/doc/models/custom-field-value-change.md b/doc/models/custom-field-value-change.md index af60194..f019d1e 100644 --- a/doc/models/custom-field-value-change.md +++ b/doc/models/custom-field-value-change.md @@ -17,17 +17,17 @@ | `resource_type` | `String` | Required | - | | `resource_id` | `Integer` | Required | - | -## Example (as JSON) - -```json -{ - "event_type": "event_type2", - "metafield_name": "metafield_name6", - "metafield_id": 78, - "old_value": "old_value2", - "new_value": "new_value8", - "resource_type": "resource_type2", - "resource_id": 74 -} +## Example + +```ruby +custom_field_value_change = CustomFieldValueChange.new( + event_type: 'event_type0', + metafield_name: 'metafield_name4', + metafield_id: 176, + old_value: 'old_value4', + new_value: 'new_value0', + resource_type: 'resource_type4', + resource_id: 232 +) ``` diff --git a/doc/models/customer-attributes.md b/doc/models/customer-attributes.md index 3dc4a6f..c0f47b5 100644 --- a/doc/models/customer-attributes.md +++ b/doc/models/customer-attributes.md @@ -12,37 +12,38 @@ | `first_name` | `String` | Optional | The first name of the customer. Required when creating a customer via attributes. | | `last_name` | `String` | Optional | The last name of the customer. Required when creating a customer via attributes. | | `email` | `String` | Optional | The email address of the customer. Required when creating a customer via attributes. | -| `cc_emails` | `String` | Optional | A list of emails that should be cc’d on all customer communications. Optional. | -| `organization` | `String` | Optional | The organization/company of the customer. Optional. | -| `reference` | `String` | Optional | A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. Optional. | -| `address` | `String` | Optional | (Optional) The customer’s shipping street address (i.e. “123 Main St.”). | -| `address_2` | `String` | Optional | (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” | -| `city` | `String` | Optional | (Optional) The customer’s shipping address city (i.e. “Boston”). | -| `state` | `String` | Optional | (Optional) The customer’s shipping address state (i.e. “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `zip` | `String` | Optional | (Optional) The customer’s shipping address zip code (i.e. “12345”). | -| `country` | `String` | Optional | (Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). | +| `cc_emails` | `String` | Optional | (Optional) A list of emails that should be cc’d on all customer communications. | +| `organization` | `String` | Optional | (Optional) The organization/company of the customer. | +| `reference` | `String` | Optional | (Optional) A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. | +| `address` | `String` | Optional | (Optional) The customer’s shipping street address (e.g., “123 Main St.”). | +| `address_2` | `String` | Optional | (Optional) Second line of the customer’s shipping address e.g., “Apt. 100” | +| `city` | `String` | Optional | (Optional) The customer’s shipping address city (e.g., “Boston”). | +| `state` | `String` | Optional | “(Optional) The customer’s shipping address state (e.g., “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes.” | +| `zip` | `String` | Optional | (Optional) The customer’s shipping address zip code (e.g., “12345”). | +| `country` | `String` | Optional | “(Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”).” | | `phone` | `String` | Optional | (Optional) The phone number of the customer. | | `verified` | `TrueClass \| FalseClass` | Optional | - | | `tax_exempt` | `TrueClass \| FalseClass` | Optional | (Optional) The tax_exempt status of the customer. Acceptable values are true or 1 for true and false or 0 for false. | -| `vat_number` | `String` | Optional | (Optional) Supplying the VAT number allows EU customer’s to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase. | +| `surcharging` | `TrueClass \| FalseClass` | Optional | (Optional) Whether surcharging is enabled for the customer. Defaults to `true` when omitted. Only applied on sites where surcharging control is enabled. | +| `vat_number` | `String` | Optional | (Optional) Supplying the VAT number allows EU customers to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase. | | `metafields` | `Hash[String, String]` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | | `parent_id` | `Integer` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | | `salesforce_id` | `String` | Optional | (Optional) The Salesforce ID of the customer. | | `default_auto_renewal_profile_id` | `Integer` | Optional | (Optional) The default auto-renewal profile ID for the customer | -## Example (as JSON) - -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "first_name": "first_name4", - "last_name": "last_name2", - "email": "email2", - "cc_emails": "cc_emails6", - "organization": "organization8" -} +## Example + +```ruby +customer_attributes = CustomerAttributes.new( + first_name: 'first_name2', + last_name: 'last_name0', + email: 'email4', + cc_emails: 'cc_emails8', + organization: 'organization4', + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' + } +) ``` diff --git a/doc/models/customer-change.md b/doc/models/customer-change.md index 60737e7..b96abfd 100644 --- a/doc/models/customer-change.md +++ b/doc/models/customer-change.md @@ -14,97 +14,97 @@ | `billing_address` | [`AddressChange`](../../doc/models/address-change.md) | Optional | - | | `custom_fields` | [`CustomerCustomFieldsChange`](../../doc/models/customer-custom-fields-change.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "payer": { - "before": { - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" - }, - "after": { - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" - } - }, - "shipping_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } - }, - "billing_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } - }, - "custom_fields": { - "before": [ - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - }, - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - } +```ruby +customer_change = CustomerChange.new( + payer: CustomerPayerChange.new( + before: InvoicePayerChange.new( + first_name: 'first_name0', + last_name: 'last_name8', + organization: 'organization4', + email: 'email6' + ), + after: InvoicePayerChange.new( + first_name: 'first_name2', + last_name: 'last_name0', + organization: 'organization4', + email: 'email4' + ) + ), + shipping_address: AddressChange.new( + before: InvoiceAddress.new( + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4' + ), + after: InvoiceAddress.new( + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4' + ) + ), + billing_address: AddressChange.new( + before: InvoiceAddress.new( + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4' + ), + after: InvoiceAddress.new( + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4' + ) + ), + custom_fields: CustomerCustomFieldsChange.new( + before: [ + InvoiceCustomField.new( + owner_id: 26, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name0', + value: 'value2', + metadatum_id: 26 + ), + InvoiceCustomField.new( + owner_id: 26, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name0', + value: 'value2', + metadatum_id: 26 + ) ], - "after": [ - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - } + after: [ + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ), + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ), + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ) ] - } -} + ) +) ``` diff --git a/doc/models/customer-changes-preview-response.md b/doc/models/customer-changes-preview-response.md index f96e12f..7029344 100644 --- a/doc/models/customer-changes-preview-response.md +++ b/doc/models/customer-changes-preview-response.md @@ -11,99 +11,99 @@ | --- | --- | --- | --- | | `changes` | [`CustomerChange`](../../doc/models/customer-change.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "changes": { - "payer": { - "before": { - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" - }, - "after": { - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" - } - }, - "shipping_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } - }, - "billing_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } - }, - "custom_fields": { - "before": [ - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - }, - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - } +```ruby +customer_changes_preview_response = CustomerChangesPreviewResponse.new( + changes: CustomerChange.new( + payer: CustomerPayerChange.new( + before: InvoicePayerChange.new( + first_name: 'first_name0', + last_name: 'last_name8', + organization: 'organization4', + email: 'email6' + ), + after: InvoicePayerChange.new( + first_name: 'first_name2', + last_name: 'last_name0', + organization: 'organization4', + email: 'email4' + ) + ), + shipping_address: AddressChange.new( + before: InvoiceAddress.new( + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4' + ), + after: InvoiceAddress.new( + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4' + ) + ), + billing_address: AddressChange.new( + before: InvoiceAddress.new( + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4' + ), + after: InvoiceAddress.new( + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4' + ) + ), + custom_fields: CustomerCustomFieldsChange.new( + before: [ + InvoiceCustomField.new( + owner_id: 26, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name0', + value: 'value2', + metadatum_id: 26 + ), + InvoiceCustomField.new( + owner_id: 26, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name0', + value: 'value2', + metadatum_id: 26 + ) ], - "after": [ - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - } + after: [ + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ), + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ), + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ) ] - } - } -} + ) + ) +) ``` diff --git a/doc/models/customer-custom-fields-change.md b/doc/models/customer-custom-fields-change.md index b3cd876..a444a9f 100644 --- a/doc/models/customer-custom-fields-change.md +++ b/doc/models/customer-custom-fields-change.md @@ -12,28 +12,28 @@ | `before` | [`Array[InvoiceCustomField]`](../../doc/models/invoice-custom-field.md) | Required | - | | `after` | [`Array[InvoiceCustomField]`](../../doc/models/invoice-custom-field.md) | Required | - | -## Example (as JSON) - -```json -{ - "before": [ - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - } +## Example + +```ruby +customer_custom_fields_change = CustomerCustomFieldsChange.new( + before: [ + InvoiceCustomField.new( + owner_id: 26, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name0', + value: 'value2', + metadatum_id: 26 + ) ], - "after": [ - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - } + after: [ + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ) ] -} +) ``` diff --git a/doc/models/customer-error-response-exception.md b/doc/models/customer-error-response-exception.md index fbeb6b2..d56e2fc 100644 --- a/doc/models/customer-error-response-exception.md +++ b/doc/models/customer-error-response-exception.md @@ -11,13 +11,13 @@ | --- | --- | --- | --- | | `errors` | [Customer Error](../../doc/models/customer-error.md) \| Array[String] \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "errors": { - "customer": "customer8" - } -} +## Example + +```ruby +begin + # make the API call +rescue CustomerErrorResponseException => e + puts "Caught CustomerErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/customer-error.md b/doc/models/customer-error.md index f6c7db3..ae99928 100644 --- a/doc/models/customer-error.md +++ b/doc/models/customer-error.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `customer` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "customer": "customer8" -} +```ruby +customer_error = CustomerError.new( + customer: 'customer8' +) ``` diff --git a/doc/models/customer-payer-change.md b/doc/models/customer-payer-change.md index e7d2ba8..f6dc521 100644 --- a/doc/models/customer-payer-change.md +++ b/doc/models/customer-payer-change.md @@ -12,22 +12,22 @@ | `before` | [`InvoicePayerChange`](../../doc/models/invoice-payer-change.md) | Required | - | | `after` | [`InvoicePayerChange`](../../doc/models/invoice-payer-change.md) | Required | - | -## Example (as JSON) - -```json -{ - "before": { - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" - }, - "after": { - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" - } -} +## Example + +```ruby +customer_payer_change = CustomerPayerChange.new( + before: InvoicePayerChange.new( + first_name: 'first_name0', + last_name: 'last_name8', + organization: 'organization4', + email: 'email6' + ), + after: InvoicePayerChange.new( + first_name: 'first_name2', + last_name: 'last_name0', + organization: 'organization4', + email: 'email4' + ) +) ``` diff --git a/doc/models/customer-response.md b/doc/models/customer-response.md index 244270e..1865e6b 100644 --- a/doc/models/customer-response.md +++ b/doc/models/customer-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `customer` | [`Customer`](../../doc/models/customer.md) | Required | - | -## Example (as JSON) - -```json -{ - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} +## Example + +```ruby +customer_response = CustomerResponse.new( + customer: Customer.new( + first_name: 'first_name0', + last_name: 'last_name8', + email: 'email6', + cc_emails: 'cc_emails0', + organization: 'organization6' + ) +) ``` diff --git a/doc/models/customer.md b/doc/models/customer.md index b6c0565..759c9dd 100644 --- a/doc/models/customer.md +++ b/doc/models/customer.md @@ -12,18 +12,18 @@ | `first_name` | `String` | Optional | The first name of the customer | | `last_name` | `String` | Optional | The last name of the customer | | `email` | `String` | Optional | The email address of the customer | -| `cc_emails` | `String` | Optional | A comma-separated list of emails that should be cc’d on all customer communications (i.e. “joe@example.com, sue@example.com”) | +| `cc_emails` | `String` | Optional | “A comma-separated list of emails that should be cc’d on all customer communications (e.g., “joe@example.com, sue@example.com”)” | | `organization` | `String` | Optional | The organization of the customer. If no value, `null` or empty string is provided, `organization` will be populated with the customer's first and last name, separated with a space. | | `reference` | `String` | Optional | The unique identifier used within your own application for this customer | | `id` | `Integer` | Optional | The customer ID in Chargify | | `created_at` | `DateTime` | Optional | The timestamp in which the customer object was created in Chargify | | `updated_at` | `DateTime` | Optional | The timestamp in which the customer object was last edited | -| `address` | `String` | Optional | The customer’s shipping street address (i.e. “123 Main St.”) | -| `address_2` | `String` | Optional | Second line of the customer’s shipping address i.e. “Apt. 100” | -| `city` | `String` | Optional | The customer’s shipping address city (i.e. “Boston”) | -| `state` | `String` | Optional | The customer’s shipping address state (i.e. “MA”) | +| `address` | `String` | Optional | The customer’s shipping street address (e.g., “123 Main St.”) | +| `address_2` | `String` | Optional | Second line of the customer’s shipping address e.g., “Apt. 100” | +| `city` | `String` | Optional | The customer’s shipping address city (e.g., “Boston”) | +| `state` | `String` | Optional | The customer’s shipping address state (e.g., “MA”) | | `state_name` | `String` | Optional | The customer's full name of state | -| `zip` | `String` | Optional | The customer’s shipping address zip code (i.e. “12345”) | +| `zip` | `String` | Optional | The customer’s shipping address zip code (e.g., “12345”) | | `country` | `String` | Optional | The customer shipping address country | | `country_name` | `String` | Optional | The customer's full name of country | | `phone` | `String` | Optional | The phone number of the customer | @@ -32,6 +32,7 @@ | `portal_invite_last_sent_at` | `DateTime` | Optional | The timestamp of when the Billing Portal invite was last sent at | | `portal_invite_last_accepted_at` | `DateTime` | Optional | The timestamp of when the Billing Portal invite was last accepted | | `tax_exempt` | `TrueClass \| FalseClass` | Optional | The tax exempt status for the customer. Acceptable values are true or 1 for true and false or 0 for false. | +| `surcharging` | `TrueClass \| FalseClass` | Optional | Whether surcharging is enabled for the customer. Only included on sites where surcharging control is enabled. | | `vat_number` | `String` | Optional | The VAT business identification number for the customer. This number is used to determine VAT tax opt out rules. It is not validated when added or updated on a customer record. Instead, it is validated via VIES before calculating taxes. Only valid business identification numbers will allow for VAT opt out. | | `parent_id` | `Integer` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | | `locale` | `String` | Optional | The locale for the customer to identify language-region | @@ -40,16 +41,17 @@ | `tax_exempt_reason` | `String` | Optional | The Tax Exemption Reason Code for the customer | | `default_auto_renewal_profile_id` | `Integer` | Optional | The default auto-renewal profile ID for the customer | | `maxioid` | `String` | Optional | The Maxio-generated unique identifier for the customer. | - -## Example (as JSON) - -```json -{ - "first_name": "first_name8", - "last_name": "last_name6", - "email": "email8", - "cc_emails": "cc_emails2", - "organization": "organization8" -} +| `branding_theme_id` | `Integer` | Optional | The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. | + +## Example + +```ruby +customer = Customer.new( + first_name: 'first_name0', + last_name: 'last_name8', + email: 'email6', + cc_emails: 'cc_emails0', + organization: 'organization6' +) ``` diff --git a/doc/models/debit-note-role.md b/doc/models/debit-note-role.md index 9c261a9..6d34aed 100644 --- a/doc/models/debit-note-role.md +++ b/doc/models/debit-note-role.md @@ -14,3 +14,9 @@ The role of the debit note. | `CHARGEBACK` | | `REFUND` | +## Example + +```ruby +debit_note_role = DebitNoteRole::CHARGEBACK +``` + diff --git a/doc/models/debit-note-status.md b/doc/models/debit-note-status.md index 48eb3cb..741dfc4 100644 --- a/doc/models/debit-note-status.md +++ b/doc/models/debit-note-status.md @@ -16,3 +16,9 @@ Current status of the debit note. | `BANISHED` | | `PAID` | +## Example + +```ruby +debit_note_status = DebitNoteStatus::BANISHED +``` + diff --git a/doc/models/debit-note.md b/doc/models/debit-note.md index ae4276d..a8a06ed 100644 --- a/doc/models/debit-note.md +++ b/doc/models/debit-note.md @@ -13,10 +13,10 @@ | `site_id` | `Integer` | Optional | ID of the site to which the debit note belongs. | | `customer_id` | `Integer` | Optional | ID of the customer to which the debit note belongs. | | `subscription_id` | `Integer` | Optional | ID of the subscription that generated the debit note. | -| `number` | `Integer` | Optional | A unique, identifier that appears on the debit note and in places it is referenced. | +| `number` | `Integer` | Optional | A unique identifier that appears on the debit note and in places it is referenced. | | `sequence_number` | `Integer` | Optional | A monotonically increasing number assigned to debit notes as they are created. | | `origin_credit_note_uid` | `String` | Optional | Unique identifier for the connected credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters.

While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike. | -| `origin_credit_note_number` | `String` | Optional | A unique, identifying string of the connected credit note. | +| `origin_credit_note_number` | `String` | Optional | A unique identifying string of the connected credit note. | | `issue_date` | `Date` | Optional | Date the document was issued to the customer. This is the date that the document was made available for payment.

The format is "YYYY-MM-DD". | | `applied_date` | `Date` | Optional | Debit notes are applied to invoices to offset invoiced amounts - they adjust the amount due. This field is the date the debit note document became fully applied to the invoice.

The format is "YYYY-MM-DD". | | `due_date` | `Date` | Optional | Date the document is due for payment. The format is "YYYY-MM-DD". | @@ -25,7 +25,7 @@ | `role` | [`DebitNoteRole`](../../doc/models/debit-note-role.md) | Optional | The role of the debit note. | | `currency` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. | | `seller` | [`InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the debit note. | -| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the debited subscription. | +| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is the owner or recipient of the debited subscription. | | `billing_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The billing address of the debited subscription. | | `shipping_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The shipping address of the debited subscription. | | `line_items` | [`Array[CreditNoteLineItem]`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the debit note. | @@ -33,15 +33,15 @@ | `taxes` | [`Array[InvoiceTax]`](../../doc/models/invoice-tax.md) | Optional | - | | `refunds` | [`Array[InvoiceRefund]`](../../doc/models/invoice-refund.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "uid": "uid2", - "site_id": 112, - "customer_id": 224, - "subscription_id": 40, - "number": 172 -} +```ruby +debit_note = DebitNote.new( + uid: 'uid4', + site_id: 94, + customer_id: 206, + subscription_id: 22, + number: 154 +) ``` diff --git a/doc/models/deduct-service-credit-request.md b/doc/models/deduct-service-credit-request.md index 4f93ce7..61ce47a 100644 --- a/doc/models/deduct-service-credit-request.md +++ b/doc/models/deduct-service-credit-request.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `deduction` | [`DeductServiceCredit`](../../doc/models/deduct-service-credit.md) | Required | - | -## Example (as JSON) - -```json -{ - "deduction": { - "amount": "String9", - "memo": "memo0" - } -} +## Example + +```ruby +deduct_service_credit_request = DeductServiceCreditRequest.new( + deduction: DeductServiceCredit.new( + amount: 'String9', + memo: 'memo0' + ) +) ``` diff --git a/doc/models/deduct-service-credit.md b/doc/models/deduct-service-credit.md index abb9850..0d2d028 100644 --- a/doc/models/deduct-service-credit.md +++ b/doc/models/deduct-service-credit.md @@ -12,12 +12,12 @@ | `amount` | String \| Float | Required | This is a container for one-of cases. | | `memo` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "amount": "String1", - "memo": "memo2" -} +```ruby +deduct_service_credit = DeductServiceCredit.new( + amount: 'String3', + memo: 'memo4' +) ``` diff --git a/doc/models/delayed-cancellation-response.md b/doc/models/delayed-cancellation-response.md index b743225..5b05a9b 100644 --- a/doc/models/delayed-cancellation-response.md +++ b/doc/models/delayed-cancellation-response.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `message` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "message": "message8" -} +```ruby +delayed_cancellation_response = DelayedCancellationResponse.new( + message: 'message0' +) ``` diff --git a/doc/models/delete-subscription-group-response.md b/doc/models/delete-subscription-group-response.md index 5502575..548e390 100644 --- a/doc/models/delete-subscription-group-response.md +++ b/doc/models/delete-subscription-group-response.md @@ -12,12 +12,12 @@ | `uid` | `String` | Optional | - | | `deleted` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "uid": "uid4", - "deleted": false -} +```ruby +delete_subscription_group_response = DeleteSubscriptionGroupResponse.new( + uid: 'uid8', + deleted: false +) ``` diff --git a/doc/models/deliver-proforma-invoice-request.md b/doc/models/deliver-proforma-invoice-request.md index 5254624..2d973f3 100644 --- a/doc/models/deliver-proforma-invoice-request.md +++ b/doc/models/deliver-proforma-invoice-request.md @@ -13,21 +13,22 @@ | `cc_recipient_emails` | `Array[String]` | Optional | - | | `bcc_recipient_emails` | `Array[String]` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "recipient_emails": [ - "recipient_emails9" +```ruby +deliver_proforma_invoice_request = DeliverProformaInvoiceRequest.new( + recipient_emails: [ + 'recipient_emails9', + 'recipient_emails0' ], - "cc_recipient_emails": [ - "cc_recipient_emails8" + cc_recipient_emails: [ + 'cc_recipient_emails2', + 'cc_recipient_emails3', + 'cc_recipient_emails4' ], - "bcc_recipient_emails": [ - "bcc_recipient_emails2", - "bcc_recipient_emails3", - "bcc_recipient_emails4" + bcc_recipient_emails: [ + 'bcc_recipient_emails8' ] -} +) ``` diff --git a/doc/models/direction.md b/doc/models/direction.md index ef6c29d..040e7ba 100644 --- a/doc/models/direction.md +++ b/doc/models/direction.md @@ -12,3 +12,9 @@ | `ASC` | | `DESC` | +## Example + +```ruby +direction = Direction::ASC +``` + diff --git a/doc/models/discount-type.md b/doc/models/discount-type.md index 77357ec..bd20f23 100644 --- a/doc/models/discount-type.md +++ b/doc/models/discount-type.md @@ -12,3 +12,9 @@ | `AMOUNT` | | `PERCENT` | +## Example + +```ruby +discount_type = DiscountType::AMOUNT +``` + diff --git a/doc/models/downgrade-credit-credit-type.md b/doc/models/downgrade-credit-credit-type.md index 50858a3..4706e34 100644 --- a/doc/models/downgrade-credit-credit-type.md +++ b/doc/models/downgrade-credit-credit-type.md @@ -21,3 +21,9 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `PRORATED` | | `NONE` | +## Example + +```ruby +downgrade_credit_credit_type = DowngradeCreditCreditType::NONE +``` + diff --git a/doc/models/dunner-data.md b/doc/models/dunner-data.md index 3a5ad98..7b42865 100644 --- a/doc/models/dunner-data.md +++ b/doc/models/dunner-data.md @@ -16,16 +16,16 @@ | `attempts` | `Integer` | Required | - | | `last_attempted_at` | `DateTime` | Required | - | -## Example (as JSON) - -```json -{ - "state": "state4", - "subscription_id": 126, - "revenue_at_risk_in_cents": 30, - "created_at": "2016-03-13T12:52:32.123Z", - "attempts": 110, - "last_attempted_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +dunner_data = DunnerData.new( + state: 'state2', + subscription_id: 216, + revenue_at_risk_in_cents: 120, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + attempts: 20, + last_attempted_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/dunning-step-data.md b/doc/models/dunning-step-data.md index fb1eb85..a144416 100644 --- a/doc/models/dunning-step-data.md +++ b/doc/models/dunning-step-data.md @@ -18,18 +18,18 @@ | `send_sms` | `TrueClass \| FalseClass` | Required | - | | `sms_body` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "day_threshold": 88, - "action": "action4", - "email_body": "email_body4", - "email_subject": "email_subject4", - "send_email": false, - "send_bcc_email": false, - "send_sms": false, - "sms_body": "sms_body0" -} +## Example + +```ruby +dunning_step_data = DunningStepData.new( + day_threshold: 90, + action: 'action0', + send_email: false, + send_bcc_email: false, + send_sms: false, + email_body: 'email_body0', + email_subject: 'email_subject0', + sms_body: 'sms_body4' +) ``` diff --git a/doc/models/dunning-step-reached.md b/doc/models/dunning-step-reached.md index de8dcc0..c5de54f 100644 --- a/doc/models/dunning-step-reached.md +++ b/doc/models/dunning-step-reached.md @@ -13,38 +13,38 @@ | `current_step` | [`DunningStepData`](../../doc/models/dunning-step-data.md) | Required | - | | `next_step` | [`DunningStepData`](../../doc/models/dunning-step-data.md) | Required | - | -## Example (as JSON) - -```json -{ - "dunner": { - "state": "state8", - "subscription_id": 194, - "revenue_at_risk_in_cents": 98, - "created_at": "2016-03-13T12:52:32.123Z", - "attempts": 42, - "last_attempted_at": "2016-03-13T12:52:32.123Z" - }, - "current_step": { - "day_threshold": 198, - "action": "action4", - "email_body": "email_body4", - "email_subject": "email_subject6", - "send_email": false, - "send_bcc_email": false, - "send_sms": false, - "sms_body": "sms_body0" - }, - "next_step": { - "day_threshold": 30, - "action": "action4", - "email_body": "email_body4", - "email_subject": "email_subject4", - "send_email": false, - "send_bcc_email": false, - "send_sms": false, - "sms_body": "sms_body0" - } -} +## Example + +```ruby +dunning_step_reached = DunningStepReached.new( + dunner: DunnerData.new( + state: 'state8', + subscription_id: 194, + revenue_at_risk_in_cents: 98, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + attempts: 42, + last_attempted_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ), + current_step: DunningStepData.new( + day_threshold: 198, + action: 'action4', + send_email: false, + send_bcc_email: false, + send_sms: false, + email_body: 'email_body4', + email_subject: 'email_subject6', + sms_body: 'sms_body0' + ), + next_step: DunningStepData.new( + day_threshold: 30, + action: 'action4', + send_email: false, + send_bcc_email: false, + send_sms: false, + email_body: 'email_body4', + email_subject: 'email_subject4', + sms_body: 'sms_body0' + ) +) ``` diff --git a/doc/models/ebb-component.md b/doc/models/ebb-component.md index be0ec12..91df522 100644 --- a/doc/models/ebb-component.md +++ b/doc/models/ebb-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `unit_name` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | +| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, i.e., "Minutes". | +| `unit_name` | `String` | Required | “The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e., “message”, which may then be shown as “5 messages” on a subscription’s component line-item” | | `description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is taxable or not. | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array[Price]`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | @@ -21,36 +21,49 @@ | `tax_code` | `String` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | | `hide_date_range_on_invoice` | `TrueClass \| FalseClass` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | | `event_based_billing_metric_id` | `Integer` | Required | The ID of an event based billing metric that will be attached to this component. | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. i.e., an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | -## Example (as JSON) - -```json -{ - "name": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } +## Example + +```ruby +ebb_component = EBBComponent.new( + name: 'name0', + unit_name: 'unit_name2', + pricing_scheme: PricingScheme::PER_UNIT, + event_based_billing_metric_id: 250, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "event_based_billing_metric_id": 190 -} + price_points: [ + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ), + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ) + ] +) ``` diff --git a/doc/models/ebb-event.md b/doc/models/ebb-event.md index 35f3d05..ee616f8 100644 --- a/doc/models/ebb-event.md +++ b/doc/models/ebb-event.md @@ -11,28 +11,14 @@ | --- | --- | --- | --- | | `chargify` | [`ChargifyEBB`](../../doc/models/chargify-ebb.md) | Optional | - | -## Example (as JSON) - -```json -{ - "chargify": { - "subscription_id": 1, - "timestamp": "2020-02-27T17:45:50-05:00", - "id": "id6", - "created_at": "2016-03-13T12:52:32.123Z", - "uniqueness_token": "uniqueness_token2" - }, - "messages": 150, - "country": "US", - "customer": { - "name": "John", - "lastName": "Doe", - "address": { - "street": "Maple Street", - "zip": 4888, - "state": "MA" - } - } -} +## Example + +```ruby +ebb_event = EBBEvent.new( + chargify: ChargifyEBB.new( + timestamp: DateTimeHelper.from_rfc3339('2020-02-27T17:45:50-05:00'), + subscription_id: 1 + ) +) ``` diff --git a/doc/models/enable-webhooks-request.md b/doc/models/enable-webhooks-request.md index 07d16a9..973a191 100644 --- a/doc/models/enable-webhooks-request.md +++ b/doc/models/enable-webhooks-request.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `webhooks_enabled` | `TrueClass \| FalseClass` | Required | - | -## Example (as JSON) +## Example -```json -{ - "webhooks_enabled": false -} +```ruby +enable_webhooks_request = EnableWebhooksRequest.new( + webhooks_enabled: false +) ``` diff --git a/doc/models/enable-webhooks-response.md b/doc/models/enable-webhooks-response.md index 1c8f9f1..329bf2c 100644 --- a/doc/models/enable-webhooks-response.md +++ b/doc/models/enable-webhooks-response.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `webhooks_enabled` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "webhooks_enabled": false -} +```ruby +enable_webhooks_response = EnableWebhooksResponse.new( + webhooks_enabled: false +) ``` diff --git a/doc/models/endpoint-response.md b/doc/models/endpoint-response.md index 3bd269a..69154e1 100644 --- a/doc/models/endpoint-response.md +++ b/doc/models/endpoint-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `endpoint` | [`Endpoint`](../../doc/models/endpoint.md) | Optional | - | -## Example (as JSON) - -```json -{ - "endpoint": { - "id": 202, - "url": "url2", - "site_id": 128, - "status": "status0", - "webhook_subscriptions": [ - "webhook_subscriptions4" +## Example + +```ruby +endpoint_response = EndpointResponse.new( + endpoint: Endpoint.new( + id: 202, + url: 'url2', + site_id: 128, + status: 'status0', + webhook_subscriptions: [ + 'webhook_subscriptions4' ] - } -} + ) +) ``` diff --git a/doc/models/endpoint.md b/doc/models/endpoint.md index d315d91..451f37d 100644 --- a/doc/models/endpoint.md +++ b/doc/models/endpoint.md @@ -15,18 +15,17 @@ | `status` | `String` | Optional | - | | `webhook_subscriptions` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 196, - "url": "url2", - "site_id": 122, - "status": "status0", - "webhook_subscriptions": [ - "webhook_subscriptions4", - "webhook_subscriptions3" +## Example + +```ruby +endpoint = Endpoint.new( + id: 202, + url: 'url2', + site_id: 128, + status: 'status0', + webhook_subscriptions: [ + 'webhook_subscriptions4' ] -} +) ``` diff --git a/doc/models/error-array-map-response-exception.md b/doc/models/error-array-map-response-exception.md index 4565374..d51d3b7 100644 --- a/doc/models/error-array-map-response-exception.md +++ b/doc/models/error-array-map-response-exception.md @@ -11,16 +11,13 @@ | --- | --- | --- | --- | | `errors` | `Hash[String, Object]` | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "key0": { - "key1": "val1", - "key2": "val2" - } - } -} +## Example + +```ruby +begin + # make the API call +rescue ErrorArrayMapResponseException => e + puts "Caught ErrorArrayMapResponseException: #{e.message}" +end ``` diff --git a/doc/models/error-list-response-exception.md b/doc/models/error-list-response-exception.md index 77bc073..242109c 100644 --- a/doc/models/error-list-response-exception.md +++ b/doc/models/error-list-response-exception.md @@ -13,15 +13,13 @@ Error which contains list of messages. | --- | --- | --- | --- | | `errors` | `Array[String]` | Required | - | -## Example (as JSON) - -```json -{ - "errors": [ - "errors5", - "errors6", - "errors7" - ] -} +## Example + +```ruby +begin + # make the API call +rescue ErrorListResponseException => e + puts "Caught ErrorListResponseException: #{e.message}" +end ``` diff --git a/doc/models/error-string-map-response-exception.md b/doc/models/error-string-map-response-exception.md index 5efb47a..e09618d 100644 --- a/doc/models/error-string-map-response-exception.md +++ b/doc/models/error-string-map-response-exception.md @@ -11,14 +11,13 @@ | --- | --- | --- | --- | | `errors` | `Hash[String, String]` | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "key0": "errors3", - "key1": "errors4" - } -} +## Example + +```ruby +begin + # make the API call +rescue ErrorStringMapResponseException => e + puts "Caught ErrorStringMapResponseException: #{e.message}" +end ``` diff --git a/doc/models/errors.md b/doc/models/errors.md index 2e5bc56..1bdeb01 100644 --- a/doc/models/errors.md +++ b/doc/models/errors.md @@ -12,18 +12,20 @@ | `per_page` | `Array[String]` | Optional | - | | `price_point` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "per_page": [ - "per_page7", - "per_page8" +## Example + +```ruby +errors = Errors.new( + per_page: [ + 'per_page1', + 'per_page2', + 'per_page3' ], - "price_point": [ - "price_point6", - "price_point7" + price_point: [ + 'price_point0', + 'price_point9', + 'price_point8' ] -} +) ``` diff --git a/doc/models/event-based-billing-list-segments-errors-exception.md b/doc/models/event-based-billing-list-segments-errors-exception.md index 278212c..a634e0f 100644 --- a/doc/models/event-based-billing-list-segments-errors-exception.md +++ b/doc/models/event-based-billing-list-segments-errors-exception.md @@ -11,22 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`Errors`](../../doc/models/errors.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "per_page": [ - "per_page1", - "per_page2", - "per_page3" - ], - "price_point": [ - "price_point0", - "price_point9", - "price_point8" - ] - } -} +## Example + +```ruby +begin + # make the API call +rescue EventBasedBillingListSegmentsErrorsException => e + puts "Caught EventBasedBillingListSegmentsErrorsException: #{e.message}" +end ``` diff --git a/doc/models/event-based-billing-segment-error.md b/doc/models/event-based-billing-segment-error.md index d933665..f7f8082 100644 --- a/doc/models/event-based-billing-segment-error.md +++ b/doc/models/event-based-billing-segment-error.md @@ -11,20 +11,14 @@ | --- | --- | --- | --- | | `segments` | `Hash[String, Object]` | Required | The key of the object would be a number (an index in the request array) where the error occurred. In the value object, the key represents the field and the value is an array with error messages. In most cases, this object would contain just one key. | -## Example (as JSON) - -```json -{ - "segments": { - "key0": { - "key1": "val1", - "key2": "val2" - }, - "key1": { - "key1": "val1", - "key2": "val2" - } +## Example + +```ruby +event_based_billing_segment_error = EventBasedBillingSegmentError.new( + segments: { + 'key0': JSON.parse('{"key1":"val1","key2":"val2"}'), + 'key1': JSON.parse('{"key1":"val1","key2":"val2"}') } -} +) ``` diff --git a/doc/models/event-based-billing-segment-errors-exception.md b/doc/models/event-based-billing-segment-errors-exception.md index a75709b..1a1c24a 100644 --- a/doc/models/event-based-billing-segment-errors-exception.md +++ b/doc/models/event-based-billing-segment-errors-exception.md @@ -11,24 +11,13 @@ | --- | --- | --- | --- | | `errors` | `Hash[String, Object]` | Optional | The key of the object would be a number (an index in the request array) where the error occurred. In the value object, the key represents the field and the value is an array with error messages. In most cases, this object would contain just one key. | -## Example (as JSON) - -```json -{ - "errors": { - "key0": { - "key1": "val1", - "key2": "val2" - }, - "key1": { - "key1": "val1", - "key2": "val2" - }, - "key2": { - "key1": "val1", - "key2": "val2" - } - } -} +## Example + +```ruby +begin + # make the API call +rescue EventBasedBillingSegmentErrorsException => e + puts "Caught EventBasedBillingSegmentErrorsException: #{e.message}" +end ``` diff --git a/doc/models/event-based-billing-segment-exception.md b/doc/models/event-based-billing-segment-exception.md index 7616750..3c4a6e9 100644 --- a/doc/models/event-based-billing-segment-exception.md +++ b/doc/models/event-based-billing-segment-exception.md @@ -11,18 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`EventBasedBillingSegmentError`](../../doc/models/event-based-billing-segment-error.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "segments": { - "key0": { - "key1": "val1", - "key2": "val2" - } - } - } -} +## Example + +```ruby +begin + # make the API call +rescue EventBasedBillingSegmentException => e + puts "Caught EventBasedBillingSegmentException: #{e.message}" +end ``` diff --git a/doc/models/event-key.md b/doc/models/event-key.md index a400739..2e1aa83 100644 --- a/doc/models/event-key.md +++ b/doc/models/event-key.md @@ -21,6 +21,7 @@ | `RENEWAL_FAILURE` | | `SUBSCRIPTION_STATE_CHANGE` | | `SUBSCRIPTION_PRODUCT_CHANGE` | +| `SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED` | | `PENDING_CANCELLATION_CHANGE` | | `EXPIRING_CARD` | | `CUSTOMER_UPDATE` | @@ -93,3 +94,9 @@ | `SUBSCRIPTION_TERM_RENEWAL_ACTIVATED` | | `SUBSCRIPTION_TERM_RENEWAL_REMOVED` | +## Example + +```ruby +event_key = EventKey::INVOICE_IN_COLLECTIONS_CANCELED +``` + diff --git a/doc/models/event-response.md b/doc/models/event-response.md index 1c4163a..af38276 100644 --- a/doc/models/event-response.md +++ b/doc/models/event-response.md @@ -11,34 +11,22 @@ | --- | --- | --- | --- | | `event` | [`Event`](../../doc/models/event.md) | Required | - | -## Example (as JSON) - -```json -{ - "event": { - "id": 242, - "key": "maxio_payments_direct_debit_payment_rejected", - "message": "message0", - "subscription_id": 96, - "customer_id": 24, - "created_at": "2016-03-13T12:52:32.123Z", - "event_specific_data": { - "previous_unit_balance": null, - "previous_overage_unit_balance": null, - "new_unit_balance": null, - "new_overage_unit_balance": null, - "usage_quantity": null, - "overage_usage_quantity": null, - "component_id": null, - "component_handle": null, - "memo": null, - "allocation_details": [ - null - ], - "previous_product_id": 126, - "new_product_id": 12 - } - } -} +## Example + +```ruby +event_response = EventResponse.new( + event: Event.new( + id: 242, + key: EventKey::SUBSCRIPTION_REMOVED_FROM_GROUP, + message: 'message0', + subscription_id: 96, + customer_id: 24, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + event_specific_data: SubscriptionProductChange.new( + previous_product_id: 126, + new_product_id: 12 + ) + ) +) ``` diff --git a/doc/models/event.md b/doc/models/event.md index 2aa9494..1840c58 100644 --- a/doc/models/event.md +++ b/doc/models/event.md @@ -15,34 +15,22 @@ | `subscription_id` | `Integer` | Required | - | | `customer_id` | `Integer` | Required | - | | `created_at` | `DateTime` | Required | - | -| `event_specific_data` | [Subscription Product Change](../../doc/models/subscription-product-change.md) \| [Subscription State Change](../../doc/models/subscription-state-change.md) \| [Payment Related Events](../../doc/models/payment-related-events.md) \| [Refund Success](../../doc/models/refund-success.md) \| [Component Allocation Change](../../doc/models/component-allocation-change.md) \| [Metered Usage](../../doc/models/metered-usage.md) \| [Prepaid Usage](../../doc/models/prepaid-usage.md) \| [Dunning Step Reached](../../doc/models/dunning-step-reached.md) \| [Invoice Issued](../../doc/models/invoice-issued.md) \| [Pending Cancellation Change](../../doc/models/pending-cancellation-change.md) \| [Prepaid Subscription Balance Changed](../../doc/models/prepaid-subscription-balance-changed.md) \| [Proforma Invoice Issued](../../doc/models/proforma-invoice-issued.md) \| [Subscription Group Signup Event Data](../../doc/models/subscription-group-signup-event-data.md) \| [Credit Account Balance Changed](../../doc/models/credit-account-balance-changed.md) \| [Prepayment Account Balance Changed](../../doc/models/prepayment-account-balance-changed.md) \| [Payment Collection Method Changed](../../doc/models/payment-collection-method-changed.md) \| [Item Price Point Changed](../../doc/models/item-price-point-changed.md) \| [Custom Field Value Change](../../doc/models/custom-field-value-change.md) \| [Chjs Tokenization Success](../../doc/models/chjs-tokenization-success.md) \| [Chjs Tokenization Failure](../../doc/models/chjs-tokenization-failure.md) \| nil | Required | This is a container for one-of cases. | - -## Example (as JSON) - -```json -{ - "id": 40, - "key": "subscription_group_signup_success", - "message": "message8", - "subscription_id": 150, - "customer_id": 78, - "created_at": "2016-03-13T12:52:32.123Z", - "event_specific_data": { - "previous_unit_balance": null, - "previous_overage_unit_balance": null, - "new_unit_balance": null, - "new_overage_unit_balance": null, - "usage_quantity": null, - "overage_usage_quantity": null, - "component_id": null, - "component_handle": null, - "memo": null, - "allocation_details": [ - null - ], - "previous_product_id": 126, - "new_product_id": 12 - } -} +| `event_specific_data` | [Subscription Product Change](../../doc/models/subscription-product-change.md) \| [Subscription Product Change Scheduled](../../doc/models/subscription-product-change-scheduled.md) \| [Subscription State Change](../../doc/models/subscription-state-change.md) \| [Payment Related Events](../../doc/models/payment-related-events.md) \| [Refund Success](../../doc/models/refund-success.md) \| [Component Allocation Change](../../doc/models/component-allocation-change.md) \| [Metered Usage](../../doc/models/metered-usage.md) \| [Prepaid Usage](../../doc/models/prepaid-usage.md) \| [Dunning Step Reached](../../doc/models/dunning-step-reached.md) \| [Invoice Issued](../../doc/models/invoice-issued.md) \| [Pending Cancellation Change](../../doc/models/pending-cancellation-change.md) \| [Prepaid Subscription Balance Changed](../../doc/models/prepaid-subscription-balance-changed.md) \| [Proforma Invoice Issued](../../doc/models/proforma-invoice-issued.md) \| [Subscription Group Signup Event Data](../../doc/models/subscription-group-signup-event-data.md) \| [Credit Account Balance Changed](../../doc/models/credit-account-balance-changed.md) \| [Prepayment Account Balance Changed](../../doc/models/prepayment-account-balance-changed.md) \| [Payment Collection Method Changed](../../doc/models/payment-collection-method-changed.md) \| [Item Price Point Changed](../../doc/models/item-price-point-changed.md) \| [Custom Field Value Change](../../doc/models/custom-field-value-change.md) \| [Chjs Tokenization Success](../../doc/models/chjs-tokenization-success.md) \| [Chjs Tokenization Failure](../../doc/models/chjs-tokenization-failure.md) \| nil | Required | This is a container for one-of cases. | + +## Example + +```ruby +event = Event.new( + id: 242, + key: EventKey::SUBSCRIPTION_REMOVED_FROM_GROUP, + message: 'message0', + subscription_id: 96, + customer_id: 24, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + event_specific_data: SubscriptionProductChange.new( + previous_product_id: 126, + new_product_id: 12 + ) +) ``` diff --git a/doc/models/expiration-interval-unit.md b/doc/models/expiration-interval-unit.md index d6b75be..7dc4b51 100644 --- a/doc/models/expiration-interval-unit.md +++ b/doc/models/expiration-interval-unit.md @@ -13,3 +13,9 @@ | `MONTH` | | `NEVER` | +## Example + +```ruby +expiration_interval_unit = ExpirationIntervalUnit::NEVER +``` + diff --git a/doc/models/failed-payment-action.md b/doc/models/failed-payment-action.md index 4d48d02..992ccd4 100644 --- a/doc/models/failed-payment-action.md +++ b/doc/models/failed-payment-action.md @@ -5,7 +5,7 @@ Action taken when payment for an invoice fails: - `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option. - `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history. -- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings). +- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings). ## Enumeration @@ -19,3 +19,9 @@ Action taken when payment for an invoice fails: | `ROLLBACK_TO_PENDING` | | `INITIATE_DUNNING` | +## Example + +```ruby +failed_payment_action = FailedPaymentAction::ROLLBACK_TO_PENDING +``` + diff --git a/doc/models/failed-payment-event-data.md b/doc/models/failed-payment-event-data.md index f920342..cbce64c 100644 --- a/doc/models/failed-payment-event-data.md +++ b/doc/models/failed-payment-event-data.md @@ -17,15 +17,15 @@ Example schema for an `failed_payment` event | `payment_method` | [`InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Required | - | | `transaction_id` | `Integer` | Required | The transaction ID of the failed payment. | -## Example (as JSON) - -```json -{ - "amount_in_cents": 128, - "applied_amount": 154, - "memo": "memo2", - "payment_method": "credit_card", - "transaction_id": 170 -} +## Example + +```ruby +failed_payment_event_data = FailedPaymentEventData.new( + amount_in_cents: 46, + applied_amount: 20, + payment_method: InvoicePaymentMethodType::CASH, + transaction_id: 252, + memo: 'memo2' +) ``` diff --git a/doc/models/failed-payment-event.md b/doc/models/failed-payment-event.md index f5f3987..93126a7 100644 --- a/doc/models/failed-payment-event.md +++ b/doc/models/failed-payment-event.md @@ -15,31 +15,31 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::FAILED_PAYMENT` | | `event_data` | [`FailedPaymentEventData`](../../doc/models/failed-payment-event-data.md) | Required | Example schema for an `failed_payment` event | -## Example (as JSON) - -```json -{ - "id": 120, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "failed_payment", - "event_data": { - "amount_in_cents": 220, - "applied_amount": 194, - "memo": "memo0", - "payment_method": "cash", - "transaction_id": 78 - } -} +## Example + +```ruby +failed_payment_event = FailedPaymentEvent.new( + id: 140, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::FAILED_PAYMENT, + event_data: FailedPaymentEventData.new( + amount_in_cents: 220, + applied_amount: 194, + payment_method: InvoicePaymentMethodType::CASH, + transaction_id: 78, + memo: 'memo0' + ) +) ``` diff --git a/doc/models/first-charge-type.md b/doc/models/first-charge-type.md index 9fa953d..e189ac2 100644 --- a/doc/models/first-charge-type.md +++ b/doc/models/first-charge-type.md @@ -13,3 +13,9 @@ | `IMMEDIATE` | | `DELAYED` | +## Example + +```ruby +first_charge_type = FirstChargeType::IMMEDIATE +``` + diff --git a/doc/models/full-subscription-group-response.md b/doc/models/full-subscription-group-response.md index 777869a..89be1a9 100644 --- a/doc/models/full-subscription-group-response.md +++ b/doc/models/full-subscription-group-response.md @@ -22,19 +22,19 @@ | `customer` | [`SubscriptionGroupCustomer`](../../doc/models/subscription-group-customer.md) | Optional | - | | `account_balances` | [`SubscriptionGroupBalances`](../../doc/models/subscription-group-balances.md) | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "scheme": 90, - "customer_id": 110, - "payment_profile_id": 18, - "subscription_ids": [ - 220, - 221, - 222 +## Example + +```ruby +full_subscription_group_response = FullSubscriptionGroupResponse.new( + uid: 'uid8', + scheme: 72, + customer_id: 92, + payment_profile_id: 0, + subscription_ids: [ + 202, + 203, + 204 ] -} +) ``` diff --git a/doc/models/get-one-time-token-bank-account-payment-profile.md b/doc/models/get-one-time-token-bank-account-payment-profile.md new file mode 100644 index 0000000..734fb56 --- /dev/null +++ b/doc/models/get-one-time-token-bank-account-payment-profile.md @@ -0,0 +1,64 @@ + +# Get One Time Token Bank Account Payment Profile + +## Structure + +`GetOneTimeTokenBankAccountPaymentProfile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Optional | - | +| `first_name` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `last_name` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `customer_id` | `String` | Optional | - | +| `current_vault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Required | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | +| `vault_token` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_address` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_address_2` | `String` | Optional | - | +| `billing_city` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_country` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_state` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_zip` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `bank_name` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `masked_bank_routing_number` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `masked_bank_account_number` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `bank_account_type` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Required | Defaults to checking | +| `bank_account_holder_type` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Required | Defaults to personal | +| `payment_type` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `disabled` | `TrueClass \| FalseClass` | Required | - | +| `site_gateway_setting_id` | `Integer` | Required | - | +| `customer_vault_token` | `String` | Optional | - | +| `gateway_handle` | `String` | Optional | - | +| `verified` | `TrueClass \| FalseClass` | Optional | - | + +## Example + +```ruby +get_one_time_token_bank_account_payment_profile = GetOneTimeTokenBankAccountPaymentProfile.new( + first_name: 'first_name6', + last_name: 'last_name4', + current_vault: BankAccountVault::AUTHORIZENET, + vault_token: 'vault_token8', + billing_address: 'billing_address8', + billing_city: 'billing_city4', + billing_country: 'billing_country0', + billing_state: 'billing_state0', + billing_zip: 'billing_zip4', + bank_name: 'bank_name8', + masked_bank_routing_number: 'masked_bank_routing_number8', + masked_bank_account_number: 'masked_bank_account_number8', + bank_account_type: BankAccountType::CHECKING, + bank_account_holder_type: BankAccountHolderType::PERSONAL, + payment_type: 'payment_type4', + disabled: false, + site_gateway_setting_id: 128, + id: 'id6', + customer_id: 'customer_id4', + billing_address_2: 'billing_address_28', + customer_vault_token: 'customer_vault_token4', + gateway_handle: 'gateway_handle8' +) +``` + diff --git a/doc/models/get-one-time-token-payment-profile.md b/doc/models/get-one-time-token-payment-profile.md index 26d7164..9a2502f 100644 --- a/doc/models/get-one-time-token-payment-profile.md +++ b/doc/models/get-one-time-token-payment-profile.md @@ -31,31 +31,31 @@ | `customer_vault_token` | `String` | Optional | - | | `gateway_handle` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": "id2", - "first_name": "first_name2", - "last_name": "last_name0", - "masked_card_number": "masked_card_number0", - "card_type": "routex", - "expiration_month": 187.78, - "expiration_year": 164.44, - "customer_id": "customer_id0", - "current_vault": "braintree_blue", - "vault_token": "vault_token4", - "billing_address": "billing_address4", - "billing_address_2": "billing_address_24", - "billing_city": "billing_city0", - "billing_country": "billing_country6", - "billing_state": "billing_state6", - "billing_zip": "billing_zip0", - "payment_type": "payment_type2", - "disabled": false, - "site_gateway_setting_id": 232, - "customer_vault_token": "customer_vault_token0", - "gateway_handle": "gateway_handle4" -} +## Example + +```ruby +get_one_time_token_payment_profile = GetOneTimeTokenPaymentProfile.new( + first_name: 'first_name0', + last_name: 'last_name8', + masked_card_number: 'masked_card_number8', + card_type: CardType::VISA, + expiration_month: 114.46, + expiration_year: 91.12, + current_vault: CreditCardVault::ADYEN, + vault_token: 'vault_token2', + billing_address: 'billing_address2', + billing_city: 'billing_city8', + billing_country: 'billing_country4', + billing_state: 'billing_state4', + billing_zip: 'billing_zip8', + payment_type: 'payment_type0', + disabled: false, + site_gateway_setting_id: 68, + id: 'id0', + customer_id: 'customer_id8', + billing_address_2: 'billing_address_22', + customer_vault_token: 'customer_vault_token8', + gateway_handle: 'gateway_handle2' +) ``` diff --git a/doc/models/get-one-time-token-request.md b/doc/models/get-one-time-token-request.md index 034f140..a4e5658 100644 --- a/doc/models/get-one-time-token-request.md +++ b/doc/models/get-one-time-token-request.md @@ -9,35 +9,35 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `payment_profile` | [`GetOneTimeTokenPaymentProfile`](../../doc/models/get-one-time-token-payment-profile.md) | Required | - | - -## Example (as JSON) - -```json -{ - "payment_profile": { - "id": "id4", - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2", - "card_type": "bogus", - "expiration_month": 133.5, - "expiration_year": 156.84, - "customer_id": "customer_id2", - "current_vault": "stripe", - "vault_token": "vault_token6", - "billing_address": "billing_address4", - "billing_address_2": "billing_address_26", - "billing_city": "billing_city8", - "billing_country": "billing_country2", - "billing_state": "billing_state2", - "billing_zip": "billing_zip2", - "payment_type": "payment_type6", - "disabled": false, - "site_gateway_setting_id": 104, - "customer_vault_token": "customer_vault_token2", - "gateway_handle": "gateway_handle4" - } -} +| `payment_profile` | [Get One Time Token Payment Profile](../../doc/models/get-one-time-token-payment-profile.md) \| [Get One Time Token Bank Account Payment Profile](../../doc/models/get-one-time-token-bank-account-payment-profile.md) | Required | This is a container for any-of cases. | + +## Example + +```ruby +get_one_time_token_request = GetOneTimeTokenRequest.new( + payment_profile: GetOneTimeTokenPaymentProfile.new( + first_name: 'first_name2', + last_name: 'last_name0', + masked_card_number: 'masked_card_number0', + card_type: CardType::ROUTEX, + expiration_month: 187.78, + expiration_year: 164.44, + current_vault: CreditCardVault::BRAINTREE_BLUE, + vault_token: 'vault_token4', + billing_address: 'billing_address4', + billing_city: 'billing_city0', + billing_country: 'billing_country6', + billing_state: 'billing_state6', + billing_zip: 'billing_zip0', + payment_type: 'payment_type2', + disabled: false, + site_gateway_setting_id: 232, + id: 'id2', + customer_id: 'customer_id0', + billing_address_2: 'billing_address_24', + customer_vault_token: 'customer_vault_token0', + gateway_handle: 'gateway_handle4' + ) +) ``` diff --git a/doc/models/group-billing.md b/doc/models/group-billing.md index 26a4da1..874999a 100644 --- a/doc/models/group-billing.md +++ b/doc/models/group-billing.md @@ -1,7 +1,7 @@ # Group Billing -Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. +(Optional) Attributes related to billing date and accrual. Note: Only applicable for new subscriptions. ## Structure @@ -15,13 +15,13 @@ Optional attributes related to billing date and accrual. Note: Only applicable f | `align_date` | `TrueClass \| FalseClass` | Optional | A flag indicating whether or not to align the billing date of the new subscription with the billing date of the primary subscription of the hierarchy's default subscription group. Required to be true if prorate is also true.

**Default**: `false` | | `prorate` | `TrueClass \| FalseClass` | Optional | A flag indicating whether or not to prorate billing of the new subscription for the current period. A value of true is ignored unless align_date is also true.

**Default**: `false` | -## Example (as JSON) +## Example -```json -{ - "accrue": false, - "align_date": false, - "prorate": false -} +```ruby +group_billing = GroupBilling.new( + accrue: false, + align_date: false, + prorate: false +) ``` diff --git a/doc/models/group-settings.md b/doc/models/group-settings.md index b547e21..0d341ff 100644 --- a/doc/models/group-settings.md +++ b/doc/models/group-settings.md @@ -10,21 +10,21 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `target` | [`GroupTarget`](../../doc/models/group-target.md) | Required | Attributes of the target customer who will be the responsible payer of the created subscription. Required. | -| `billing` | [`GroupBilling`](../../doc/models/group-billing.md) | Optional | Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. | - -## Example (as JSON) - -```json -{ - "target": { - "type": "parent", - "id": 236 - }, - "billing": { - "accrue": false, - "align_date": false, - "prorate": false - } -} +| `billing` | [`GroupBilling`](../../doc/models/group-billing.md) | Optional | (Optional) Attributes related to billing date and accrual. Note: Only applicable for new subscriptions. | + +## Example + +```ruby +group_settings = GroupSettings.new( + target: GroupTarget.new( + type: GroupTargetType::PARENT, + id: 236 + ), + billing: GroupBilling.new( + accrue: false, + align_date: false, + prorate: false + ) +) ``` diff --git a/doc/models/group-status.md b/doc/models/group-status.md new file mode 100644 index 0000000..930d686 --- /dev/null +++ b/doc/models/group-status.md @@ -0,0 +1,20 @@ + +# Group Status + +## Enumeration + +`GroupStatus` + +## Fields + +| Name | +| --- | +| `UNGROUPED` | +| `GROUPED` | + +## Example + +```ruby +group_status = GroupStatus::UNGROUPED +``` + diff --git a/doc/models/group-target-type.md b/doc/models/group-target-type.md index dec1d51..2b4c56d 100644 --- a/doc/models/group-target-type.md +++ b/doc/models/group-target-type.md @@ -17,3 +17,9 @@ The type of object indicated by the id attribute. | `PARENT` | | `ELDEST` | +## Example + +```ruby +group_target_type = GroupTargetType::ELDEST +``` + diff --git a/doc/models/group-target.md b/doc/models/group-target.md index b02b72d..fc0a965 100644 --- a/doc/models/group-target.md +++ b/doc/models/group-target.md @@ -12,14 +12,14 @@ Attributes of the target customer who will be the responsible payer of the creat | Name | Type | Tags | Description | | --- | --- | --- | --- | | `type` | [`GroupTargetType`](../../doc/models/group-target-type.md) | Required | The type of object indicated by the id attribute. | -| `id` | `Integer` | Optional | The id of the target customer or subscription to group the existing subscription with. Ignored and should not be included if type is "self" , "parent", or "eldest" | +| `id` | `Integer` | Optional | The id of the target customer or subscription to group the existing subscription with. Ignored and should not be included if type is "self", "parent", or "eldest". | -## Example (as JSON) +## Example -```json -{ - "type": "self", - "id": 134 -} +```ruby +group_target = GroupTarget.new( + type: GroupTargetType::ENUM_SELF, + id: 50 +) ``` diff --git a/doc/models/group-type.md b/doc/models/group-type.md index bc9c31b..cd65ce4 100644 --- a/doc/models/group-type.md +++ b/doc/models/group-type.md @@ -12,3 +12,9 @@ | `SINGLE_CUSTOMER` | | `MULTIPLE_CUSTOMERS` | +## Example + +```ruby +group_type = GroupType::SINGLE_CUSTOMER +``` + diff --git a/doc/models/historic-usage.md b/doc/models/historic-usage.md index 833233b..89482b1 100644 --- a/doc/models/historic-usage.md +++ b/doc/models/historic-usage.md @@ -1,7 +1,7 @@ # Historic Usage -Optional for Event Based Components. If the `include=historic_usages` query param is provided, the last ten billing periods will be returned. +(Optional) For Event Based Components. If the `include=historic_usages` query param is provided, the last ten billing periods will be returned. ## Structure @@ -15,13 +15,13 @@ Optional for Event Based Components. If the `include=historic_usages` query para | `billing_period_starts_at` | `DateTime` | Optional | Start date of billing period | | `billing_period_ends_at` | `DateTime` | Optional | End date of billing period | -## Example (as JSON) +## Example -```json -{ - "total_usage_quantity": 26.6, - "billing_period_starts_at": "2016-03-13T12:52:32.123Z", - "billing_period_ends_at": "2016-03-13T12:52:32.123Z" -} +```ruby +historic_usage = HistoricUsage.new( + total_usage_quantity: 247.74, + billing_period_starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + billing_period_ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/include-not-null.md b/doc/models/include-not-null.md index 694ffcf..f10a04f 100644 --- a/doc/models/include-not-null.md +++ b/doc/models/include-not-null.md @@ -15,7 +15,7 @@ Passed as a parameter to list methods to return only non null values. ## Example -``` -not_null +```ruby +include_not_null = IncludeNotNull::NOT_NULL ``` diff --git a/doc/models/include-null-or-not-null.md b/doc/models/include-null-or-not-null.md index 5ca912d..9f50423 100644 --- a/doc/models/include-null-or-not-null.md +++ b/doc/models/include-null-or-not-null.md @@ -16,7 +16,7 @@ Allows to filter by `not_null` or `null`. ## Example -``` -not_null +```ruby +include_null_or_not_null = IncludeNullOrNotNull::NOT_NULL ``` diff --git a/doc/models/include-option.md b/doc/models/include-option.md index 0ad125f..c6f9c80 100644 --- a/doc/models/include-option.md +++ b/doc/models/include-option.md @@ -12,3 +12,9 @@ | `EXCLUDE` | | `INCLUDE` | +## Example + +```ruby +include_option = IncludeOption::EXCLUDE +``` + diff --git a/doc/models/interval-unit.md b/doc/models/interval-unit.md index 7e4cab3..572ccfd 100644 --- a/doc/models/interval-unit.md +++ b/doc/models/interval-unit.md @@ -12,3 +12,9 @@ | `DAY` | | `MONTH` | +## Example + +```ruby +interval_unit = IntervalUnit::DAY +``` + diff --git a/doc/models/invoice-address.md b/doc/models/invoice-address.md index d78f2d7..936434b 100644 --- a/doc/models/invoice-address.md +++ b/doc/models/invoice-address.md @@ -16,15 +16,15 @@ | `zip` | `String` | Optional | - | | `country` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" -} +## Example + +```ruby +invoice_address = InvoiceAddress.new( + street: 'street8', + line2: 'line22', + city: 'city8', + state: 'state4', + zip: 'zip2' +) ``` diff --git a/doc/models/invoice-avatax-details.md b/doc/models/invoice-avatax-details.md index 9da4f1e..a7965cf 100644 --- a/doc/models/invoice-avatax-details.md +++ b/doc/models/invoice-avatax-details.md @@ -15,15 +15,15 @@ | `commit_date` | `DateTime` | Optional | - | | `modify_date` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 112, - "status": "status2", - "document_code": "document_code0", - "commit_date": "2016-03-13T12:52:32.123Z", - "modify_date": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +invoice_avatax_details = InvoiceAvataxDetails.new( + id: 18, + status: 'status2', + document_code: 'document_code0', + commit_date: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + modify_date: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/invoice-balance-item.md b/doc/models/invoice-balance-item.md index 02496fd..f709ffe 100644 --- a/doc/models/invoice-balance-item.md +++ b/doc/models/invoice-balance-item.md @@ -13,13 +13,13 @@ | `number` | `String` | Optional | - | | `outstanding_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "number": "number6", - "outstanding_amount": "outstanding_amount6" -} +## Example + +```ruby +invoice_balance_item = InvoiceBalanceItem.new( + uid: 'uid4', + number: 'number2', + outstanding_amount: 'outstanding_amount0' +) ``` diff --git a/doc/models/invoice-consolidation-level.md b/doc/models/invoice-consolidation-level.md index 8b4786e..b52e5b9 100644 --- a/doc/models/invoice-consolidation-level.md +++ b/doc/models/invoice-consolidation-level.md @@ -1,7 +1,7 @@ # Invoice Consolidation Level -Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: +Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: * "none": A normal invoice with no consolidation. * "child": An invoice segment which has been combined into a consolidated invoice. @@ -23,3 +23,9 @@ See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/ | `CHILD` | | `PARENT` | +## Example + +```ruby +invoice_consolidation_level = InvoiceConsolidationLevel::NONE +``` + diff --git a/doc/models/invoice-credit.md b/doc/models/invoice-credit.md index 11f68de..ea1746a 100644 --- a/doc/models/invoice-credit.md +++ b/doc/models/invoice-credit.md @@ -17,15 +17,15 @@ | `original_amount` | `String` | Optional | - | | `applied_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo0" -} +## Example + +```ruby +invoice_credit = InvoiceCredit.new( + uid: 'uid8', + credit_note_number: 'credit_note_number8', + credit_note_uid: 'credit_note_uid2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + memo: 'memo2' +) ``` diff --git a/doc/models/invoice-custom-field.md b/doc/models/invoice-custom-field.md index a1e8e76..1ecc728 100644 --- a/doc/models/invoice-custom-field.md +++ b/doc/models/invoice-custom-field.md @@ -15,15 +15,15 @@ | `value` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | | `metadatum_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "owner_id": 142, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 142 -} +## Example + +```ruby +invoice_custom_field = InvoiceCustomField.new( + owner_id: 238, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name4', + value: 'value6', + metadatum_id: 238 +) ``` diff --git a/doc/models/invoice-customer.md b/doc/models/invoice-customer.md index 68081c3..fe98e78 100644 --- a/doc/models/invoice-customer.md +++ b/doc/models/invoice-customer.md @@ -1,7 +1,7 @@ # Invoice Customer -Information about the customer who is owner or recipient the invoiced subscription. +Information about the customer who is owner or recipient of the invoiced subscription. ## Structure @@ -19,15 +19,15 @@ Information about the customer who is owner or recipient the invoiced subscripti | `vat_number` | `String` | Optional | - | | `reference` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "chargify_id": 236, - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" -} +```ruby +invoice_customer = InvoiceCustomer.new( + chargify_id: 52, + first_name: 'first_name0', + last_name: 'last_name8', + organization: 'organization4', + email: 'email6' +) ``` diff --git a/doc/models/invoice-date-field.md b/doc/models/invoice-date-field.md index 05d7f5f..27c9a40 100644 --- a/doc/models/invoice-date-field.md +++ b/doc/models/invoice-date-field.md @@ -17,7 +17,7 @@ ## Example -``` -issue_date +```ruby +invoice_date_field = InvoiceDateField::DUE_DATE ``` diff --git a/doc/models/invoice-debit.md b/doc/models/invoice-debit.md index ad15ce3..5476075 100644 --- a/doc/models/invoice-debit.md +++ b/doc/models/invoice-debit.md @@ -18,15 +18,15 @@ | `original_amount` | `String` | Optional | - | | `applied_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "debit_note_number": "debit_note_number2", - "debit_note_uid": "debit_note_uid8", - "role": "chargeback", - "transaction_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +invoice_debit = InvoiceDebit.new( + uid: 'uid2', + debit_note_number: 'debit_note_number2', + debit_note_uid: 'debit_note_uid2', + role: DebitNoteRole::CHARGEBACK, + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/invoice-discount-breakout.md b/doc/models/invoice-discount-breakout.md index c9f8da3..3d0ffde 100644 --- a/doc/models/invoice-discount-breakout.md +++ b/doc/models/invoice-discount-breakout.md @@ -13,13 +13,13 @@ | `eligible_amount` | `String` | Optional | - | | `discount_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "eligible_amount": "eligible_amount0", - "discount_amount": "discount_amount8" -} +## Example + +```ruby +invoice_discount_breakout = InvoiceDiscountBreakout.new( + uid: 'uid2', + eligible_amount: 'eligible_amount4', + discount_amount: 'discount_amount6' +) ``` diff --git a/doc/models/invoice-discount-source-type.md b/doc/models/invoice-discount-source-type.md index 7218f6c..85eb707 100644 --- a/doc/models/invoice-discount-source-type.md +++ b/doc/models/invoice-discount-source-type.md @@ -13,3 +13,9 @@ | `REFERRAL` | | `ENUM_AD_HOC_COUPON` | +## Example + +```ruby +invoice_discount_source_type = InvoiceDiscountSourceType::ENUM_AD_HOC_COUPON +``` + diff --git a/doc/models/invoice-discount-type.md b/doc/models/invoice-discount-type.md index 3e5355b..6cc7aab 100644 --- a/doc/models/invoice-discount-type.md +++ b/doc/models/invoice-discount-type.md @@ -13,3 +13,9 @@ | `FLAT_AMOUNT` | | `ROLLOVER` | +## Example + +```ruby +invoice_discount_type = InvoiceDiscountType::ROLLOVER +``` + diff --git a/doc/models/invoice-discount.md b/doc/models/invoice-discount.md index a7c394f..333c12b 100644 --- a/doc/models/invoice-discount.md +++ b/doc/models/invoice-discount.md @@ -22,15 +22,15 @@ | `transaction_id` | `Integer` | Optional | - | | `line_item_breakouts` | [`Array[InvoiceDiscountBreakout]`](../../doc/models/invoice-discount-breakout.md) | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "title": "title4", - "description": "description0", - "code": "code8", - "source_type": "Coupon" -} +## Example + +```ruby +invoice_discount = InvoiceDiscount.new( + uid: 'uid2', + title: 'title2', + description: 'description8', + code: 'code0', + source_type: InvoiceDiscountSourceType::REFERRAL +) ``` diff --git a/doc/models/invoice-display-settings.md b/doc/models/invoice-display-settings.md index c9732ba..1c4e7e9 100644 --- a/doc/models/invoice-display-settings.md +++ b/doc/models/invoice-display-settings.md @@ -12,12 +12,12 @@ | `hide_zero_subtotal_lines` | `TrueClass \| FalseClass` | Optional | - | | `include_discounts_on_lines` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "hide_zero_subtotal_lines": false, - "include_discounts_on_lines": false -} +```ruby +invoice_display_settings = InvoiceDisplaySettings.new( + hide_zero_subtotal_lines: false, + include_discounts_on_lines: false +) ``` diff --git a/doc/models/invoice-event-payment-method.md b/doc/models/invoice-event-payment-method.md index 8df097e..701da61 100644 --- a/doc/models/invoice-event-payment-method.md +++ b/doc/models/invoice-event-payment-method.md @@ -15,3 +15,9 @@ | `EXTERNAL` | | `PAYPAL_ACCOUNT` | +## Example + +```ruby +invoice_event_payment_method = InvoiceEventPaymentMethod::BANK_ACCOUNT +``` + diff --git a/doc/models/invoice-event-type.md b/doc/models/invoice-event-type.md index c6c0992..988bdca 100644 --- a/doc/models/invoice-event-type.md +++ b/doc/models/invoice-event-type.md @@ -27,3 +27,9 @@ Invoice Event Type | `FAILED_PAYMENT` | | `CHANGE_CHARGEBACK_STATUS` | +## Example + +```ruby +invoice_event_type = InvoiceEventType::REMOVE_PAYMENT +``` + diff --git a/doc/models/invoice-issued.md b/doc/models/invoice-issued.md index 2093937..ec0d9e3 100644 --- a/doc/models/invoice-issued.md +++ b/doc/models/invoice-issued.md @@ -25,33 +25,33 @@ | `consolidation_level` | `String` | Required | - | | `line_items` | [`Array[InvoiceLineItemEventData]`](../../doc/models/invoice-line-item-event-data.md) | Required | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "number": "number8", - "role": "role2", - "due_date": "2016-03-13", - "issue_date": "issue_date0", - "paid_date": "paid_date6", - "due_amount": "due_amount6", - "paid_amount": "paid_amount4", - "tax_amount": "tax_amount2", - "refund_amount": "refund_amount0", - "total_amount": "total_amount0", - "status_amount": "status_amount4", - "product_name": "product_name0", - "consolidation_level": "consolidation_level4", - "line_items": [ - { - "uid": "uid8", - "title": "title4", - "description": "description8", - "quantity": 102, - "quantity_delta": 204 - } +## Example + +```ruby +invoice_issued = InvoiceIssued.new( + uid: 'uid0', + number: 'number8', + role: 'role4', + due_date: Date.iso8601('2016-03-13'), + issue_date: 'issue_date6', + paid_date: 'paid_date0', + due_amount: 'due_amount2', + paid_amount: 'paid_amount2', + tax_amount: 'tax_amount4', + refund_amount: 'refund_amount6', + total_amount: 'total_amount6', + status_amount: 'status_amount0', + product_name: 'product_name6', + consolidation_level: 'consolidation_level2', + line_items: [ + InvoiceLineItemEventData.new( + uid: 'uid8', + title: 'title4', + description: 'description8', + quantity: 102, + quantity_delta: 204 + ) ] -} +) ``` diff --git a/doc/models/invoice-line-item-component-cost-data.md b/doc/models/invoice-line-item-component-cost-data.md index 3e27089..c377fa3 100644 --- a/doc/models/invoice-line-item-component-cost-data.md +++ b/doc/models/invoice-line-item-component-cost-data.md @@ -11,33 +11,19 @@ | --- | --- | --- | --- | | `rates` | [`Array[ComponentCostData]`](../../doc/models/component-cost-data.md) | Optional | - | -## Example (as JSON) - -```json -{ - "rates": [ - { - "component_code_id": 116, - "price_point_id": 226, - "product_id": 94, - "quantity": "quantity0", - "amount": "amount6" - }, - { - "component_code_id": 116, - "price_point_id": 226, - "product_id": 94, - "quantity": "quantity0", - "amount": "amount6" - }, - { - "component_code_id": 116, - "price_point_id": 226, - "product_id": 94, - "quantity": "quantity0", - "amount": "amount6" - } +## Example + +```ruby +invoice_line_item_component_cost_data = InvoiceLineItemComponentCostData.new( + rates: [ + ComponentCostData.new( + component_code_id: 116, + price_point_id: 226, + product_id: 94, + quantity: 'quantity0', + amount: 'amount6' + ) ] -} +) ``` diff --git a/doc/models/invoice-line-item-event-data.md b/doc/models/invoice-line-item-event-data.md index 53e381e..e81c7c1 100644 --- a/doc/models/invoice-line-item-event-data.md +++ b/doc/models/invoice-line-item-event-data.md @@ -30,15 +30,15 @@ | `billing_schedule_item_id` | `Integer` | Optional | - | | `custom_item` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description6", - "quantity": 40, - "quantity_delta": 114 -} +## Example + +```ruby +invoice_line_item_event_data = InvoiceLineItemEventData.new( + uid: 'uid0', + title: 'title6', + description: 'description0', + quantity: 188, + quantity_delta: 34 +) ``` diff --git a/doc/models/invoice-line-item-pricing-detail.md b/doc/models/invoice-line-item-pricing-detail.md index 348fa7e..1dc3c85 100644 --- a/doc/models/invoice-line-item-pricing-detail.md +++ b/doc/models/invoice-line-item-pricing-detail.md @@ -12,12 +12,12 @@ | `label` | `String` | Optional | - | | `amount` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "label": "label0", - "amount": "amount2" -} +```ruby +invoice_line_item_pricing_detail = InvoiceLineItemPricingDetail.new( + label: 'label0', + amount: 'amount2' +) ``` diff --git a/doc/models/invoice-line-item.md b/doc/models/invoice-line-item.md index a153733..1ae89bf 100644 --- a/doc/models/invoice-line-item.md +++ b/doc/models/invoice-line-item.md @@ -9,19 +9,19 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `uid` | `String` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | +| `uid` | `String` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | | `title` | `String` | Optional | A short descriptor for the charge or item represented by this line. | -| `description` | `String` | Optional | Detailed description for the charge or item represented by this line. May include proration details in plain text.

Note: this string may contain line breaks that are hints for the best display format on the invoice. | +| `description` | `String` | Optional | Detailed description for the charge or item represented by this line. May include proration details in plain text.

Note: this string may contain line breaks that are hints for the best display format on the invoice. | | `quantity` | `String` | Optional | The quantity or count of units billed by the line item.

This is a decimal number represented as a string. (See "About Decimal Numbers".) | -| `unit_price` | `String` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e. not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | +| `unit_price` | `String` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e., not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | | `subtotal_amount` | `String` | Optional | The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount). | | `discount_amount` | `String` | Optional | The approximate discount applied to just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total discount among many lines. Several lines may have been summed prior to applying the discount to arrive at `discount_amount` for the invoice - backing that out to the discount on a single line may introduce rounding or precision errors. | | `tax_amount` | `String` | Optional | The approximate tax applied to just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | | `tax_included` | `TrueClass \| FalseClass` | Optional | Whether the unit price for this line item is tax-inclusive.

When `true`, `unit_price` already includes tax and `tax_amount` represents the portion of the price attributable to tax. When `false`, any applicable tax is added on top of the price.

The value is inherited from the source price point's `tax_included` setting. Custom or ad-hoc line items (which have no associated price point) always return `false`. | -| `total_amount` | `String` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | +| `total_amount` | `String` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | | `tiered_unit_price` | `TrueClass \| FalseClass` | Optional | When `true`, indicates that the actual pricing scheme for the line was tiered, so the `unit_price` shown is the blended average for all units. | -| `period_range_start` | `Date` | Optional | Start date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the billing date, and the end date will be in the future.
* For periodic charges paid in arrears (e.g. metered charges), this date will be the date of the previous billing, and the end date will be the current billing date.
* For non-periodic charges, this date and the end date will match. | -| `period_range_end` | `Date` | Optional | End date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the next (future) billing date.
* For periodic charges paid in arrears (e.g. metered charges), this date will be the date of the current billing date.
* For non-periodic charges, this date and the start date will match. | +| `period_range_start` | `Date` | Optional | Start date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the billing date, and the end date will be in the future.
* For periodic charges paid in arrears (e.g., metered charges), this date will be the date of the previous billing, and the end date will be the current billing date.
* For non-periodic charges, this date and the end date will match. | +| `period_range_end` | `Date` | Optional | End date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the next (future) billing date.
* For periodic charges paid in arrears (e.g., metered charges), this date will be the date of the current billing date.
* For non-periodic charges, this date and the start date will match. | | `transaction_id` | `Integer` | Optional | - | | `product_id` | `Integer` | Optional | The ID of the product subscribed when the charge was made.

This may be set even for component charges, so true product-only (non-component) charges will also have a nil `component_id`. | | `product_version` | `Integer` | Optional | The version of the product subscribed when the charge was made. | @@ -35,15 +35,15 @@ | `kind` | `String` | Optional | - | | `prepaid_allocation_expires_at` | `Date` | Optional | The date a prepaid allocation is set to expire. Only present on line items representing prepaid component allocations. The format is `"YYYY-MM-DD"`. | -## Example (as JSON) +## Example -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description4", - "quantity": "quantity0", - "unit_price": "unit_price2" -} +```ruby +invoice_line_item = InvoiceLineItem.new( + uid: 'uid4', + title: 'title0', + description: 'description4', + quantity: 'quantity0', + unit_price: 'unit_price2' +) ``` diff --git a/doc/models/invoice-payer-change.md b/doc/models/invoice-payer-change.md index 35d4ae7..4bcfd36 100644 --- a/doc/models/invoice-payer-change.md +++ b/doc/models/invoice-payer-change.md @@ -14,14 +14,14 @@ | `organization` | `String` | Optional | - | | `email` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" -} +## Example + +```ruby +invoice_payer_change = InvoicePayerChange.new( + first_name: 'first_name0', + last_name: 'last_name8', + organization: 'organization4', + email: 'email6' +) ``` diff --git a/doc/models/invoice-payer.md b/doc/models/invoice-payer.md index a99f2b8..f7a5d78 100644 --- a/doc/models/invoice-payer.md +++ b/doc/models/invoice-payer.md @@ -16,15 +16,15 @@ | `email` | `String` | Optional | - | | `vat_number` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "chargify_id": 46, - "first_name": "first_name4", - "last_name": "last_name2", - "organization": "organization8", - "email": "email2" -} +## Example + +```ruby +invoice_payer = InvoicePayer.new( + chargify_id: 108, + first_name: 'first_name2', + last_name: 'last_name0', + organization: 'organization4', + email: 'email4' +) ``` diff --git a/doc/models/invoice-payment-application.md b/doc/models/invoice-payment-application.md index e1ec2c5..753c304 100644 --- a/doc/models/invoice-payment-application.md +++ b/doc/models/invoice-payment-application.md @@ -13,13 +13,13 @@ | `application_uid` | `String` | Optional | Unique identifier for the payment. It has the prefix "pmt_" followed by alphanumeric characters. | | `applied_amount` | `String` | Optional | Dollar amount of the paid invoice. | -## Example (as JSON) - -```json -{ - "invoice_uid": "invoice_uid2", - "application_uid": "application_uid4", - "applied_amount": "applied_amount6" -} +## Example + +```ruby +invoice_payment_application = InvoicePaymentApplication.new( + invoice_uid: 'invoice_uid4', + application_uid: 'application_uid8', + applied_amount: 'applied_amount4' +) ``` diff --git a/doc/models/invoice-payment-method-type.md b/doc/models/invoice-payment-method-type.md index a920712..64223df 100644 --- a/doc/models/invoice-payment-method-type.md +++ b/doc/models/invoice-payment-method-type.md @@ -18,3 +18,9 @@ The type of payment method used. Defaults to other. | `ACH` | | `OTHER` | +## Example + +```ruby +invoice_payment_method_type = InvoicePaymentMethodType::CREDIT_CARD +``` + diff --git a/doc/models/invoice-payment-method.md b/doc/models/invoice-payment-method.md index 11c3a75..8e2b47d 100644 --- a/doc/models/invoice-payment-method.md +++ b/doc/models/invoice-payment-method.md @@ -18,15 +18,15 @@ | `last_four` | `String` | Optional | - | | `masked_card_number` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "details": "details8", - "kind": "kind6", - "memo": "memo2", - "type": "type8", - "card_brand": "card_brand8" -} +## Example + +```ruby +invoice_payment_method = InvoicePaymentMethod.new( + details: 'details2', + kind: 'kind0', + memo: 'memo6', + type: 'type2', + card_brand: 'card_brand4' +) ``` diff --git a/doc/models/invoice-payment-type.md b/doc/models/invoice-payment-type.md index 8283fc2..1a13110 100644 --- a/doc/models/invoice-payment-type.md +++ b/doc/models/invoice-payment-type.md @@ -16,3 +16,9 @@ The type of payment to be applied to an Invoice. Defaults to external. | `SERVICE_CREDIT` | | `PAYMENT` | +## Example + +```ruby +invoice_payment_type = InvoicePaymentType::EXTERNAL +``` + diff --git a/doc/models/invoice-payment.md b/doc/models/invoice-payment.md index 2806a98..0e69cbf 100644 --- a/doc/models/invoice-payment.md +++ b/doc/models/invoice-payment.md @@ -22,21 +22,21 @@ | `received_on` | `Date` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
`external` payments. | | `uid` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo6", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6", - "payment_method": { - "details": "details0", - "kind": "kind8", - "memo": "memo4", - "type": "type0", - "card_brand": "card_brand6" - } -} +## Example + +```ruby +invoice_payment = InvoicePayment.new( + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + memo: 'memo4', + original_amount: 'original_amount4', + applied_amount: 'applied_amount8', + payment_method: InvoicePaymentMethod.new( + details: 'details0', + kind: 'kind8', + memo: 'memo4', + type: 'type0', + card_brand: 'card_brand6' + ) +) ``` diff --git a/doc/models/invoice-pre-payment.md b/doc/models/invoice-pre-payment.md index a4c7799..b524d85 100644 --- a/doc/models/invoice-pre-payment.md +++ b/doc/models/invoice-pre-payment.md @@ -13,13 +13,13 @@ | `amount_in_cents` | `Integer` | Optional | The amount in cents of the prepayment that was created as a result of this payment. | | `ending_balance_in_cents` | `Integer` | Optional | The total balance of the prepayment account for this subscription including any prior prepayments | -## Example (as JSON) - -```json -{ - "subscription_id": 180, - "amount_in_cents": 100, - "ending_balance_in_cents": 60 -} +## Example + +```ruby +invoice_pre_payment = InvoicePrePayment.new( + subscription_id: 40, + amount_in_cents: 240, + ending_balance_in_cents: 56 +) ``` diff --git a/doc/models/invoice-previous-balance.md b/doc/models/invoice-previous-balance.md index 3bdd43d..11d1b10 100644 --- a/doc/models/invoice-previous-balance.md +++ b/doc/models/invoice-previous-balance.md @@ -12,18 +12,28 @@ | `captured_at` | `DateTime` | Optional | - | | `invoices` | [`Array[InvoiceBalanceItem]`](../../doc/models/invoice-balance-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "captured_at": "2016-03-13T12:52:32.123Z", - "invoices": [ - { - "uid": "uid6", - "number": "number6", - "outstanding_amount": "outstanding_amount8" - } +## Example + +```ruby +invoice_previous_balance = InvoicePreviousBalance.new( + captured_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoices: [ + InvoiceBalanceItem.new( + uid: 'uid6', + number: 'number6', + outstanding_amount: 'outstanding_amount8' + ), + InvoiceBalanceItem.new( + uid: 'uid6', + number: 'number6', + outstanding_amount: 'outstanding_amount8' + ), + InvoiceBalanceItem.new( + uid: 'uid6', + number: 'number6', + outstanding_amount: 'outstanding_amount8' + ) ] -} +) ``` diff --git a/doc/models/invoice-refund.md b/doc/models/invoice-refund.md index 6c6ca4a..be812cb 100644 --- a/doc/models/invoice-refund.md +++ b/doc/models/invoice-refund.md @@ -19,15 +19,15 @@ | `gateway_handle` | `String` | Optional | - | | `ach_late_reject` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_id": 172, - "payment_id": 42, - "memo": "memo6", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6" -} +## Example + +```ruby +invoice_refund = InvoiceRefund.new( + transaction_id: 0, + payment_id: 126, + memo: 'memo0', + original_amount: 'original_amount0', + applied_amount: 'applied_amount2' +) ``` diff --git a/doc/models/invoice-response.md b/doc/models/invoice-response.md index 1f4ba04..11c5a68 100644 --- a/doc/models/invoice-response.md +++ b/doc/models/invoice-response.md @@ -11,21 +11,21 @@ | --- | --- | --- | --- | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -## Example (as JSON) - -```json -{ - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - } -} +## Example + +```ruby +invoice_response = InvoiceResponse.new( + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ) +) ``` diff --git a/doc/models/invoice-role.md b/doc/models/invoice-role.md index 2f75a78..404c37e 100644 --- a/doc/models/invoice-role.md +++ b/doc/models/invoice-role.md @@ -20,3 +20,9 @@ | `BACKPORT` | | `BACKPORTBALANCERECONCILIATION` | +## Example + +```ruby +invoice_role = InvoiceRole::RENEWAL +``` + diff --git a/doc/models/invoice-seller.md b/doc/models/invoice-seller.md index 638387e..93b57c9 100644 --- a/doc/models/invoice-seller.md +++ b/doc/models/invoice-seller.md @@ -16,20 +16,20 @@ Information about the seller (merchant) listed on the masthead of the invoice. | `phone` | `String` | Optional | - | | `logo_url` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "name": "name0", - "address": { - "street": "street6", - "line2": "line20", - "city": "city6", - "state": "state2", - "zip": "zip0" - }, - "phone": "phone0", - "logo_url": "logo_url0" -} +## Example + +```ruby +invoice_seller = InvoiceSeller.new( + name: 'name2', + address: InvoiceAddress.new( + street: 'street6', + line2: 'line20', + city: 'city6', + state: 'state2', + zip: 'zip0' + ), + phone: 'phone2', + logo_url: 'logo_url2' +) ``` diff --git a/doc/models/invoice-sort-field.md b/doc/models/invoice-sort-field.md index 83fcdee..a1e3d82 100644 --- a/doc/models/invoice-sort-field.md +++ b/doc/models/invoice-sort-field.md @@ -20,7 +20,7 @@ ## Example -``` -total_amount +```ruby +invoice_sort_field = InvoiceSortField::DUE_AMOUNT ``` diff --git a/doc/models/invoice-status.md b/doc/models/invoice-status.md index 87ba076..124c20b 100644 --- a/doc/models/invoice-status.md +++ b/doc/models/invoice-status.md @@ -19,3 +19,9 @@ The current status of the invoice. See [Invoice Statuses](https://maxio.zendesk. | `CANCELED` | | `PROCESSING` | +## Example + +```ruby +invoice_status = InvoiceStatus::PROCESSING +``` + diff --git a/doc/models/invoice-tax-breakout.md b/doc/models/invoice-tax-breakout.md index 1d814f8..db86c02 100644 --- a/doc/models/invoice-tax-breakout.md +++ b/doc/models/invoice-tax-breakout.md @@ -14,14 +14,14 @@ | `tax_amount` | `String` | Optional | - | | `tax_exempt_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "taxable_amount": "taxable_amount6", - "tax_amount": "tax_amount6", - "tax_exempt_amount": "tax_exempt_amount2" -} +## Example + +```ruby +invoice_tax_breakout = InvoiceTaxBreakout.new( + uid: 'uid2', + taxable_amount: 'taxable_amount6', + tax_amount: 'tax_amount4', + tax_exempt_amount: 'tax_exempt_amount2' +) ``` diff --git a/doc/models/invoice-tax-component-breakout.md b/doc/models/invoice-tax-component-breakout.md index 37a2cc3..a00525b 100644 --- a/doc/models/invoice-tax-component-breakout.md +++ b/doc/models/invoice-tax-component-breakout.md @@ -24,15 +24,15 @@ | `state_assigned_no` | `String` | Optional | - | | `tax_sub_type` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "tax_rule_id": 226, - "percentage": "percentage0", - "country_code": "country_code8", - "subdivision_code": "subdivision_code6", - "tax_amount": "tax_amount4" -} +## Example + +```ruby +invoice_tax_component_breakout = InvoiceTaxComponentBreakout.new( + tax_rule_id: 4, + percentage: 'percentage0', + country_code: 'country_code2', + subdivision_code: 'subdivision_code4', + tax_amount: 'tax_amount6' +) ``` diff --git a/doc/models/invoice-tax.md b/doc/models/invoice-tax.md index 95e5f36..102e3fb 100644 --- a/doc/models/invoice-tax.md +++ b/doc/models/invoice-tax.md @@ -24,15 +24,15 @@ | `type` | `String` | Optional | - | | `tax_exempt_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "title": "title6", - "description": "description2", - "source_type": "Tax", - "source_id": 164 -} +## Example + +```ruby +invoice_tax = InvoiceTax.new( + uid: 'uid0', + title: 'title4', + description: 'description0', + source_type: ProformaInvoiceTaxSourceType::TAX, + source_id: 216 +) ``` diff --git a/doc/models/invoice.md b/doc/models/invoice.md index 793c247..190d11a 100644 --- a/doc/models/invoice.md +++ b/doc/models/invoice.md @@ -15,11 +15,11 @@ | `customer_id` | `Integer` | Optional | ID of the customer to which the invoice belongs. | | `subscription_id` | `Integer` | Optional | ID of the subscription that generated the invoice. | | `number` | `String` | Optional | A unique, identifying string that appears on the invoice and in places the invoice is referenced.

While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike. | -| `sequence_number` | `Integer` | Optional | A monotonically increasing number assigned to invoices as they are created. This number is unique within a site and can be used to sort and order invoices. | +| `sequence_number` | `Integer` | Optional | A monotonically increasing number assigned to invoices as they are created. This number is unique within a site and can be used to sort and order invoices. | | `transaction_time` | `DateTime` | Optional | - | | `created_at` | `DateTime` | Optional | - | | `updated_at` | `DateTime` | Optional | - | -| `issue_date` | `Date` | Optional | Date the invoice was issued to the customer. This is the date that the invoice was made available for payment.

The format is `"YYYY-MM-DD"`. | +| `issue_date` | `Date` | Optional | Date the invoice was issued to the customer. This is the date that the invoice was made available for payment.

The format is `"YYYY-MM-DD"`. | | `due_date` | `Date` | Optional | Date the invoice is due.

The format is `"YYYY-MM-DD"`. | | `paid_date` | `Date` | Optional | Date the invoice became fully paid.

If partial payments are applied to the invoice, this date will not be present until payment has been made in full.

The format is `"YYYY-MM-DD"`. | | `status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The current status of the invoice. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | @@ -28,7 +28,7 @@ | `collection_method` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | | `payment_instructions` | `String` | Optional | A message that is printed on the invoice when it is marked for remittance collection. It is intended to describe to the customer how they may make payment, and is configured by the merchant. | | `currency` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | -| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | +| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | | `parent_invoice_uid` | `String` | Optional | For invoices with `consolidation_level` of `child`, this specifies the UID of the parent (consolidated) invoice. | | `subscription_group_id` | `Integer` | Optional | - | | `parent_invoice_number` | `Integer` | Optional | For invoices with `consolidation_level` of `child`, this specifies the number of the parent (consolidated) invoice. | @@ -36,17 +36,17 @@ | `product_name` | `String` | Optional | The name of the product subscribed when the invoice was generated. | | `product_family_name` | `String` | Optional | The name of the product family subscribed when the invoice was generated. | | `seller` | [`InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | -| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | +| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient of the invoiced subscription. | | `payer` | [`InvoicePayer`](../../doc/models/invoice-payer.md) | Optional | - | | `recipient_emails` | `Array[String]` | Optional | **Constraints**: *Maximum Items*: `5` | | `net_terms` | `Integer` | Optional | - | -| `memo` | `String` | Optional | The memo printed on invoices of any collection type. This message is in control of the merchant. | +| `memo` | `String` | Optional | The memo printed on invoices of any collection type. This message is in control of the merchant. | | `billing_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The invoice billing address. | | `shipping_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The invoice shipping address. | | `subtotal_amount` | `String` | Optional | Subtotal of the invoice, which is the sum of all line items before discounts or taxes. | | `discount_amount` | `String` | Optional | Total discount applied to the invoice. | | `tax_amount` | `String` | Optional | Total tax on the invoice. | -| `total_amount` | `String` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | +| `total_amount` | `String` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`. | | `credit_amount` | `String` | Optional | The amount of credit (from credit notes) applied to this invoice.

Credits offset the amount due from the customer. | | `debit_amount` | `String` | Optional | - | | `refund_amount` | `String` | Optional | - | @@ -65,20 +65,21 @@ | `public_url` | `String` | Optional | The public URL of the invoice | | `previous_balance_data` | [`InvoicePreviousBalance`](../../doc/models/invoice-previous-balance.md) | Optional | - | | `public_url_expires_on` | `Date` | Optional | The format is `"YYYY-MM-DD"`. | +| `branding_theme_id` | `Integer` | Optional | The ID of the Branding Theme associated with this invoice. This value represents the Branding Theme used for invoice theming, such as themed invoice rendering. Available only when Branding Themes are enabled for the site. | -## Example (as JSON) +## Example -```json -{ - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 252, - "uid": "uid0", - "site_id": 178, - "customer_id": 34, - "subscription_id": 106 -} +```ruby +invoice = Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') +) ``` diff --git a/doc/models/issue-advance-invoice-request.md b/doc/models/issue-advance-invoice-request.md index 55fef0b..ff022e4 100644 --- a/doc/models/issue-advance-invoice-request.md +++ b/doc/models/issue-advance-invoice-request.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `force` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "force": false -} +```ruby +issue_advance_invoice_request = IssueAdvanceInvoiceRequest.new( + force: false +) ``` diff --git a/doc/models/issue-invoice-event-data.md b/doc/models/issue-invoice-event-data.md index a709b7d..d696bc0 100644 --- a/doc/models/issue-invoice-event-data.md +++ b/doc/models/issue-invoice-event-data.md @@ -11,21 +11,21 @@ Example schema for an `issue_invoice` event | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Required | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | +| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Required | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | | `from_status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The status of the invoice before event occurrence. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | | `to_status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The status of the invoice after event occurrence. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | | `due_amount` | `String` | Required | Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. | | `total_amount` | `String` | Required | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | -## Example (as JSON) +## Example -```json -{ - "consolidation_level": "none", - "from_status": "voided", - "to_status": "draft", - "due_amount": "due_amount6", - "total_amount": "total_amount0" -} +```ruby +issue_invoice_event_data = IssueInvoiceEventData.new( + consolidation_level: InvoiceConsolidationLevel::PARENT, + from_status: InvoiceStatus::DRAFT, + to_status: InvoiceStatus::VOIDED, + due_amount: 'due_amount6', + total_amount: 'total_amount0' +) ``` diff --git a/doc/models/issue-invoice-event.md b/doc/models/issue-invoice-event.md index 51ac435..7689ca9 100644 --- a/doc/models/issue-invoice-event.md +++ b/doc/models/issue-invoice-event.md @@ -15,31 +15,31 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::ISSUE_INVOICE` | | `event_data` | [`IssueInvoiceEventData`](../../doc/models/issue-invoice-event-data.md) | Required | Example schema for an `issue_invoice` event | -## Example (as JSON) - -```json -{ - "id": 130, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "issue_invoice", - "event_data": { - "consolidation_level": "child", - "from_status": "open", - "to_status": "pending", - "due_amount": "due_amount8", - "total_amount": "total_amount2" - } -} +## Example + +```ruby +issue_invoice_event = IssueInvoiceEvent.new( + id: 238, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::ISSUE_INVOICE, + event_data: IssueInvoiceEventData.new( + consolidation_level: InvoiceConsolidationLevel::CHILD, + from_status: InvoiceStatus::OPEN, + to_status: InvoiceStatus::PENDING, + due_amount: 'due_amount8', + total_amount: 'total_amount2' + ) +) ``` diff --git a/doc/models/issue-invoice-request.md b/doc/models/issue-invoice-request.md index 504783c..b0cfb4b 100644 --- a/doc/models/issue-invoice-request.md +++ b/doc/models/issue-invoice-request.md @@ -9,13 +9,13 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `on_failed_payment` | [`FailedPaymentAction`](../../doc/models/failed-payment-action.md) | Optional | Action taken when payment for an invoice fails:

- `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option.
- `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history.
- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings).

**Default**: `FailedPaymentAction::LEAVE_OPEN_INVOICE` | +| `on_failed_payment` | [`FailedPaymentAction`](../../doc/models/failed-payment-action.md) | Optional | Action taken when payment for an invoice fails:

- `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option.
- `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history.
- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings).

**Default**: `FailedPaymentAction::LEAVE_OPEN_INVOICE` | -## Example (as JSON) +## Example -```json -{ - "on_failed_payment": "leave_open_invoice" -} +```ruby +issue_invoice_request = IssueInvoiceRequest.new( + on_failed_payment: FailedPaymentAction::LEAVE_OPEN_INVOICE +) ``` diff --git a/doc/models/issue-service-credit-request.md b/doc/models/issue-service-credit-request.md index bf725d8..68ef156 100644 --- a/doc/models/issue-service-credit-request.md +++ b/doc/models/issue-service-credit-request.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `service_credit` | [`IssueServiceCredit`](../../doc/models/issue-service-credit.md) | Required | - | -## Example (as JSON) - -```json -{ - "service_credit": { - "amount": 31.42, - "memo": "memo0" - } -} +## Example + +```ruby +issue_service_credit_request = IssueServiceCreditRequest.new( + service_credit: IssueServiceCredit.new( + amount: 31.42, + memo: 'memo0' + ) +) ``` diff --git a/doc/models/issue-service-credit.md b/doc/models/issue-service-credit.md index efb8855..a9c58d7 100644 --- a/doc/models/issue-service-credit.md +++ b/doc/models/issue-service-credit.md @@ -12,12 +12,12 @@ | `amount` | Float \| String | Required | This is a container for one-of cases. | | `memo` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "amount": 5.82, - "memo": "memo4" -} +```ruby +issue_service_credit = IssueServiceCredit.new( + amount: 216.68, + memo: 'memo6' +) ``` diff --git a/doc/models/item-category.md b/doc/models/item-category.md index 8a73b8c..e1c8d3f 100644 --- a/doc/models/item-category.md +++ b/doc/models/item-category.md @@ -19,7 +19,7 @@ One of the following: Business Software, Consumer Software, Digital Services, Ph ## Example -``` -Business Software +```ruby +item_category = ItemCategory::ENUM_CONSUMER_SOFTWARE ``` diff --git a/doc/models/item-price-point-changed.md b/doc/models/item-price-point-changed.md index f717c5d..8efd17e 100644 --- a/doc/models/item-price-point-changed.md +++ b/doc/models/item-price-point-changed.md @@ -16,24 +16,24 @@ | `previous_price_point` | [`ItemPricePointData`](../../doc/models/item-price-point-data.md) | Required | - | | `current_price_point` | [`ItemPricePointData`](../../doc/models/item-price-point-data.md) | Required | - | -## Example (as JSON) - -```json -{ - "item_id": 66, - "item_type": "item_type6", - "item_handle": "item_handle4", - "item_name": "item_name8", - "previous_price_point": { - "id": 216, - "handle": "handle6", - "name": "name0" - }, - "current_price_point": { - "id": 218, - "handle": "handle6", - "name": "name0" - } -} +## Example + +```ruby +item_price_point_changed = ItemPricePointChanged.new( + item_id: 66, + item_type: 'item_type2', + item_handle: 'item_handle0', + item_name: 'item_name4', + previous_price_point: ItemPricePointData.new( + id: 216, + handle: 'handle6', + name: 'name0' + ), + current_price_point: ItemPricePointData.new( + id: 218, + handle: 'handle6', + name: 'name0' + ) +) ``` diff --git a/doc/models/item-price-point-data.md b/doc/models/item-price-point-data.md index 5ff77fc..1e4979c 100644 --- a/doc/models/item-price-point-data.md +++ b/doc/models/item-price-point-data.md @@ -13,13 +13,13 @@ | `handle` | `String` | Optional | - | | `name` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 192, - "handle": "handle6", - "name": "name0" -} +## Example + +```ruby +item_price_point_data = ItemPricePointData.new( + id: 180, + handle: 'handle2', + name: 'name6' +) ``` diff --git a/doc/models/line-item-kind.md b/doc/models/line-item-kind.md index 380d29e..806973f 100644 --- a/doc/models/line-item-kind.md +++ b/doc/models/line-item-kind.md @@ -22,3 +22,9 @@ A handle for the line item kind | `COUPON` | | `TAX` | +## Example + +```ruby +line_item_kind = LineItemKind::COUPON +``` + diff --git a/doc/models/line-item-transaction-type.md b/doc/models/line-item-transaction-type.md index f5847f6..f6ed230 100644 --- a/doc/models/line-item-transaction-type.md +++ b/doc/models/line-item-transaction-type.md @@ -19,3 +19,9 @@ A handle for the line item transaction type | `INFO_TRANSACTION` | | `PAYMENT_AUTHORIZATION` | +## Example + +```ruby +line_item_transaction_type = LineItemTransactionType::REFUND +``` + diff --git a/doc/models/list-components-filter.md b/doc/models/list-components-filter.md index 3330abb..36148cf 100644 --- a/doc/models/list-components-filter.md +++ b/doc/models/list-components-filter.md @@ -12,16 +12,16 @@ | `ids` | `Array[Integer]` | Optional | Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Allows fetching components with matching use_site_exchange_rate based on provided value (refers to default price point). Use in query `filter[use_site_exchange_rate]=true`. | -## Example (as JSON) +## Example -```json -{ - "ids": [ +```ruby +list_components_filter = ListComponentsFilter.new( + ids: [ 1, 2, 3 ], - "use_site_exchange_rate": false -} + use_site_exchange_rate: false +) ``` diff --git a/doc/models/list-components-price-points-include.md b/doc/models/list-components-price-points-include.md index 31cc7ea..08004a1 100644 --- a/doc/models/list-components-price-points-include.md +++ b/doc/models/list-components-price-points-include.md @@ -13,7 +13,7 @@ ## Example -``` -currency_prices +```ruby +list_components_price_points_include = ListComponentsPricePointsInclude::CURRENCY_PRICES ``` diff --git a/doc/models/list-components-price-points-response.md b/doc/models/list-components-price-points-response.md index bc6ff17..cac844e 100644 --- a/doc/models/list-components-price-points-response.md +++ b/doc/models/list-components-price-points-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `price_points` | [`Array[ComponentPricePoint]`](../../doc/models/component-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "id": 40, - "type": "default", - "default": false, - "name": "name2", - "pricing_scheme": "per_unit" - } +## Example + +```ruby +list_components_price_points_response = ListComponentsPricePointsResponse.new( + price_points: [ + ComponentPricePoint.new( + id: 40, + type: PricePointType::DEFAULT, + default: false, + name: 'name2', + pricing_scheme: PricingScheme::PER_UNIT + ) ] -} +) ``` diff --git a/doc/models/list-coupons-filter.md b/doc/models/list-coupons-filter.md index acfaba1..d2915f1 100644 --- a/doc/models/list-coupons-filter.md +++ b/doc/models/list-coupons-filter.md @@ -19,24 +19,24 @@ | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | If true, restricts the list to coupons whose pricing is recalculated from the site’s current exchange rates, so their currency_prices array contains on-the-fly conversions rather than stored price records. If false, restricts the list to coupons that have manually defined amounts for each currency, ensuring the response includes the saved currency_prices entries instead of exchange-rate-derived values. Use in query `filter[use_site_exchange_rate]=true`. | | `include_archived` | `TrueClass \| FalseClass` | Optional | Controls returning archived coupons. | -## Example (as JSON) - -```json -{ - "start_date": "2011-12-17", - "end_date": "2011-12-15", - "start_datetime": "12/19/2011 09:15:30", - "end_datetime": "06/07/2019 17:20:06", - "ids": [ +## Example + +```ruby +list_coupons_filter = ListCouponsFilter.new( + date_field: BasicDateField::UPDATED_AT, + start_date: Date.iso8601('2011-12-17'), + end_date: Date.iso8601('2011-12-15'), + start_datetime: DateTimeHelper.from_rfc3339('2011-12-19T09:15:30+00:00'), + end_datetime: DateTimeHelper.from_rfc3339('2019-06-07T17:20:06Z'), + ids: [ 1, 2, 3 ], - "codes": [ - "free", - "free_trial" - ], - "date_field": "updated_at" -} + codes: [ + 'free', + 'free_trial' + ] +) ``` diff --git a/doc/models/list-credit-notes-response.md b/doc/models/list-credit-notes-response.md index 70d7cfa..6b3aca7 100644 --- a/doc/models/list-credit-notes-response.md +++ b/doc/models/list-credit-notes-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `credit_notes` | [`Array[CreditNote]`](../../doc/models/credit-note.md) | Required | - | -## Example (as JSON) - -```json -{ - "credit_notes": [ - { - "uid": "uid2", - "site_id": 112, - "customer_id": 224, - "subscription_id": 40, - "number": "number0" - } +## Example + +```ruby +list_credit_notes_response = ListCreditNotesResponse.new( + credit_notes: [ + CreditNote.new( + uid: 'uid2', + site_id: 112, + customer_id: 224, + subscription_id: 40, + number: 'number0' + ) ] -} +) ``` diff --git a/doc/models/list-events-date-field.md b/doc/models/list-events-date-field.md index 7ac6c5f..39bb4b8 100644 --- a/doc/models/list-events-date-field.md +++ b/doc/models/list-events-date-field.md @@ -13,7 +13,7 @@ ## Example -``` -created_at +```ruby +list_events_date_field = ListEventsDateField::CREATED_AT ``` diff --git a/doc/models/list-invoice-events-response.md b/doc/models/list-invoice-events-response.md index 6bc71aa..1e6115d 100644 --- a/doc/models/list-invoice-events-response.md +++ b/doc/models/list-invoice-events-response.md @@ -14,52 +14,52 @@ | `per_page` | `Integer` | Optional | - | | `total_pages` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "events": [ - { - "event_type": "apply_credit_note", - "id": 214, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_data": { - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo0", - "role": "role0", - "consolidated_invoice": false, - "applied_credit_notes": [ - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - } +```ruby +list_invoice_events_response = ListInvoiceEventsResponse.new( + events: [ + ApplyCreditNoteEvent.new( + id: 214, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20 + ), + event_type: InvoiceEventType::APPLY_CREDIT_NOTE, + event_data: ApplyCreditNoteEventData.new( + uid: 'uid6', + credit_note_number: 'credit_note_number0', + credit_note_uid: 'credit_note_uid0', + original_amount: 'original_amount0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + memo: 'memo0', + role: 'role0', + consolidated_invoice: false, + applied_credit_notes: [ + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ), + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ), + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ) ] - } - } + ) + ) ], - "page": 184, - "per_page": 96, - "total_pages": 194 -} + page: 76, + per_page: 244, + total_pages: 46 +) ``` diff --git a/doc/models/list-invoices-response.md b/doc/models/list-invoices-response.md index 2076f92..dc0239d 100644 --- a/doc/models/list-invoices-response.md +++ b/doc/models/list-invoices-response.md @@ -11,23 +11,23 @@ | --- | --- | --- | --- | | `invoices` | [`Array[Invoice]`](../../doc/models/invoice.md) | Required | - | -## Example (as JSON) - -```json -{ - "invoices": [ - { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 196, - "uid": "uid6", - "site_id": 122, - "customer_id": 234, - "subscription_id": 50 - } +## Example + +```ruby +list_invoices_response = ListInvoicesResponse.new( + invoices: [ + Invoice.new( + id: 196, + uid: 'uid6', + site_id: 122, + customer_id: 234, + subscription_id: 50, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ) ] -} +) ``` diff --git a/doc/models/list-metafields-response.md b/doc/models/list-metafields-response.md index 36e89e7..57aa612 100644 --- a/doc/models/list-metafields-response.md +++ b/doc/models/list-metafields-response.md @@ -15,29 +15,55 @@ | `per_page` | `Integer` | Optional | - | | `metafields` | [`Array[Metafield]`](../../doc/models/metafield.md) | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 210, - "current_page": 186, - "total_pages": 198, - "per_page": 92, - "metafields": [ - { - "id": 22, - "name": "name2", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" - }, - "data_count": 10, - "input_type": "balance_tracker" - } +## Example + +```ruby +list_metafields_response = ListMetafieldsResponse.new( + total_count: 70, + current_page: 46, + total_pages: 58, + per_page: 232, + metafields: [ + Metafield.new( + id: 22, + name: 'name2', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE + ), + data_count: 10, + input_type: MetafieldInput::BALANCE_TRACKER + ), + Metafield.new( + id: 22, + name: 'name2', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE + ), + data_count: 10, + input_type: MetafieldInput::BALANCE_TRACKER + ), + Metafield.new( + id: 22, + name: 'name2', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE + ), + data_count: 10, + input_type: MetafieldInput::BALANCE_TRACKER + ) ] -} +) ``` diff --git a/doc/models/list-mrr-filter.md b/doc/models/list-mrr-filter.md index 308b2ba..3009ff2 100644 --- a/doc/models/list-mrr-filter.md +++ b/doc/models/list-mrr-filter.md @@ -11,15 +11,15 @@ | --- | --- | --- | --- | | `subscription_ids` | `Array[Integer]` | Optional | Submit ids in order to limit results. Use in query: `filter[subscription_ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | -## Example (as JSON) +## Example -```json -{ - "subscription_ids": [ +```ruby +list_mrr_filter = ListMrrFilter.new( + subscription_ids: [ 1, 2, 3 ] -} +) ``` diff --git a/doc/models/list-mrr-response-result.md b/doc/models/list-mrr-response-result.md index 76cfd53..71ddec8 100644 --- a/doc/models/list-mrr-response-result.md +++ b/doc/models/list-mrr-response-result.md @@ -17,15 +17,15 @@ | `currency_symbol` | `String` | Optional | - | | `movements` | [`Array[Movement]`](../../doc/models/movement.md) | Optional | - | -## Example (as JSON) - -```json -{ - "page": 150, - "per_page": 238, - "total_pages": 16, - "total_entries": 112, - "currency": "currency8" -} +## Example + +```ruby +list_mrr_response_result = ListMRRResponseResult.new( + page: 170, + per_page: 82, + total_pages: 208, + total_entries: 48, + currency: 'currency6' +) ``` diff --git a/doc/models/list-mrr-response.md b/doc/models/list-mrr-response.md index dc0cbd6..f155400 100644 --- a/doc/models/list-mrr-response.md +++ b/doc/models/list-mrr-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `mrr` | [`ListMRRResponseResult`](../../doc/models/list-mrr-response-result.md) | Required | - | -## Example (as JSON) - -```json -{ - "mrr": { - "page": 30, - "per_page": 198, - "total_pages": 92, - "total_entries": 188, - "currency": "currency4" - } -} +## Example + +```ruby +list_mrr_response = ListMRRResponse.new( + mrr: ListMRRResponseResult.new( + page: 30, + per_page: 198, + total_pages: 92, + total_entries: 188, + currency: 'currency4' + ) +) ``` diff --git a/doc/models/list-offers-response.md b/doc/models/list-offers-response.md index d89cc07..461f695 100644 --- a/doc/models/list-offers-response.md +++ b/doc/models/list-offers-response.md @@ -11,33 +11,26 @@ | --- | --- | --- | --- | | `offers` | [`Array[Offer]`](../../doc/models/offer.md) | Optional | - | -## Example (as JSON) - -```json -{ - "offers": [ - { - "id": 12, - "site_id": 194, - "product_family_id": 16, - "product_id": 210, - "product_price_point_id": 134 - }, - { - "id": 12, - "site_id": 194, - "product_family_id": 16, - "product_id": 210, - "product_price_point_id": 134 - }, - { - "id": 12, - "site_id": 194, - "product_family_id": 16, - "product_id": 210, - "product_price_point_id": 134 - } +## Example + +```ruby +list_offers_response = ListOffersResponse.new( + offers: [ + Offer.new( + id: 12, + site_id: 194, + product_family_id: 16, + product_id: 210, + product_price_point_id: 134 + ), + Offer.new( + id: 12, + site_id: 194, + product_family_id: 16, + product_id: 210, + product_price_point_id: 134 + ) ] -} +) ``` diff --git a/doc/models/list-prepayment-date-field.md b/doc/models/list-prepayment-date-field.md index fb729cd..0e70edb 100644 --- a/doc/models/list-prepayment-date-field.md +++ b/doc/models/list-prepayment-date-field.md @@ -14,7 +14,7 @@ ## Example -``` -created_at +```ruby +list_prepayment_date_field = ListPrepaymentDateField::CREATED_AT ``` diff --git a/doc/models/list-prepayments-filter.md b/doc/models/list-prepayments-filter.md index c47d40b..473b5d7 100644 --- a/doc/models/list-prepayments-filter.md +++ b/doc/models/list-prepayments-filter.md @@ -13,13 +13,13 @@ | `start_date` | `Date` | Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns prepayments with a timestamp at or after midnight (12:00:00 AM) in your site's time zone on the date specified. Use in query: `filter[start_date]=2011-12-15`. | | `end_date` | `Date` | Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns prepayments with a timestamp up to and including 11:59:59PM in your site's time zone on the date specified. Use in query: `filter[end_date]=2011-12-15`. | -## Example (as JSON) - -```json -{ - "date_field": "created_at", - "start_date": "2024-01-01", - "end_date": "2024-01-31" -} +## Example + +```ruby +list_prepayments_filter = ListPrepaymentsFilter.new( + date_field: ListPrepaymentDateField::CREATED_AT, + start_date: Date.iso8601('2024-01-01'), + end_date: Date.iso8601('2024-01-31') +) ``` diff --git a/doc/models/list-price-points-filter.md b/doc/models/list-price-points-filter.md index 4cf6e61..3c1184e 100644 --- a/doc/models/list-price-points-filter.md +++ b/doc/models/list-price-points-filter.md @@ -18,25 +18,25 @@ | `ids` | `Array[Integer]` | Optional | Allows fetching price points with matching id based on provided values. Use in query: `filter[ids]=1,2,3`. | | `archived_at` | [`IncludeNullOrNotNull`](../../doc/models/include-null-or-not-null.md) | Optional | Allows fetching price points only if archived_at is present or not. Use in query: `filter[archived_at]=not_null`. | -## Example (as JSON) - -```json -{ - "start_date": "2011-12-17", - "end_date": "2011-12-15", - "start_datetime": "12/19/2011 09:15:30", - "end_datetime": "06/07/2019 17:20:06", - "type": [ - "catalog", - "default", - "custom" +## Example + +```ruby +list_price_points_filter = ListPricePointsFilter.new( + date_field: BasicDateField::UPDATED_AT, + start_date: Date.iso8601('2011-12-17'), + end_date: Date.iso8601('2011-12-15'), + start_datetime: DateTimeHelper.from_rfc3339('2011-12-19T09:15:30+00:00'), + end_datetime: DateTimeHelper.from_rfc3339('2019-06-07T17:20:06Z'), + type: [ + PricePointType::CATALOG, + PricePointType::DEFAULT, + PricePointType::CUSTOM ], - "ids": [ + ids: [ 1, 2, 3 - ], - "date_field": "updated_at" -} + ] +) ``` diff --git a/doc/models/list-product-price-points-response.md b/doc/models/list-product-price-points-response.md index 52ce014..45cdf0d 100644 --- a/doc/models/list-product-price-points-response.md +++ b/doc/models/list-product-price-points-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `price_points` | [`Array[ProductPricePoint]`](../../doc/models/product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "id": 40, - "name": "name2", - "handle": "handle8", - "price_in_cents": 108, - "interval": 92 - } +## Example + +```ruby +list_product_price_points_response = ListProductPricePointsResponse.new( + price_points: [ + ProductPricePoint.new( + id: 40, + name: 'name2', + handle: 'handle8', + price_in_cents: 108, + interval: 92 + ) ] -} +) ``` diff --git a/doc/models/list-products-filter.md b/doc/models/list-products-filter.md index 7f93d23..f80f0e3 100644 --- a/doc/models/list-products-filter.md +++ b/doc/models/list-products-filter.md @@ -13,19 +13,19 @@ | `prepaid_product_price_point` | [`PrepaidProductPricePointFilter`](../../doc/models/prepaid-product-price-point-filter.md) | Optional | Allows fetching products only if a prepaid product price point is present or not. To use this filter you also have to include the following param in the request `include=prepaid_product_price_point`. Use in query `filter[prepaid_product_price_point][product_price_point_id]=not_null`. | | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Allows fetching products with matching use_site_exchange_rate based on provided value (refers to default price point). Use in query `filter[use_site_exchange_rate]=true`. | -## Example (as JSON) +## Example -```json -{ - "ids": [ +```ruby +list_products_filter = ListProductsFilter.new( + ids: [ 1, 2, 3 ], - "prepaid_product_price_point": { - "product_price_point_id": "product_price_point_id2" - }, - "use_site_exchange_rate": false -} + prepaid_product_price_point: PrepaidProductPricePointFilter.new( + product_price_point_id: 'product_price_point_id2' + ), + use_site_exchange_rate: false +) ``` diff --git a/doc/models/list-products-include.md b/doc/models/list-products-include.md index f284733..0a64275 100644 --- a/doc/models/list-products-include.md +++ b/doc/models/list-products-include.md @@ -13,7 +13,7 @@ ## Example -``` -prepaid_product_price_point +```ruby +list_products_include = ListProductsInclude::PREPAID_PRODUCT_PRICE_POINT ``` diff --git a/doc/models/list-products-price-points-include.md b/doc/models/list-products-price-points-include.md index 99e4023..bdebfd7 100644 --- a/doc/models/list-products-price-points-include.md +++ b/doc/models/list-products-price-points-include.md @@ -13,7 +13,7 @@ ## Example -``` -currency_prices +```ruby +list_products_price_points_include = ListProductsPricePointsInclude::CURRENCY_PRICES ``` diff --git a/doc/models/list-proforma-invoices-meta.md b/doc/models/list-proforma-invoices-meta.md index 0dd08f6..5578211 100644 --- a/doc/models/list-proforma-invoices-meta.md +++ b/doc/models/list-proforma-invoices-meta.md @@ -14,14 +14,14 @@ | `total_pages` | `Integer` | Optional | - | | `status_code` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 226, - "current_page": 202, - "total_pages": 214, - "status_code": 244 -} +## Example + +```ruby +list_proforma_invoices_meta = ListProformaInvoicesMeta.new( + total_count: 84, + current_page: 60, + total_pages: 72, + status_code: 102 +) ``` diff --git a/doc/models/list-proforma-invoices-response.md b/doc/models/list-proforma-invoices-response.md index 8c55bb8..7994f65 100644 --- a/doc/models/list-proforma-invoices-response.md +++ b/doc/models/list-proforma-invoices-response.md @@ -12,39 +12,39 @@ | `proforma_invoices` | [`Array[ProformaInvoice]`](../../doc/models/proforma-invoice.md) | Optional | - | | `meta` | [`ListProformaInvoicesMeta`](../../doc/models/list-proforma-invoices-meta.md) | Optional | - | -## Example (as JSON) - -```json -{ - "proforma_invoices": [ - { - "uid": "uid0", - "site_id": 140, - "customer_id": 252, - "subscription_id": 68, - "number": 56 - }, - { - "uid": "uid0", - "site_id": 140, - "customer_id": 252, - "subscription_id": 68, - "number": 56 - }, - { - "uid": "uid0", - "site_id": 140, - "customer_id": 252, - "subscription_id": 68, - "number": 56 - } +## Example + +```ruby +list_proforma_invoices_response = ListProformaInvoicesResponse.new( + proforma_invoices: [ + ProformaInvoice.new( + uid: 'uid0', + site_id: 140, + customer_id: 252, + subscription_id: 68, + number: 56 + ), + ProformaInvoice.new( + uid: 'uid0', + site_id: 140, + customer_id: 252, + subscription_id: 68, + number: 56 + ), + ProformaInvoice.new( + uid: 'uid0', + site_id: 140, + customer_id: 252, + subscription_id: 68, + number: 56 + ) ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "status_code": 168 - } -} + meta: ListProformaInvoicesMeta.new( + total_count: 150, + current_page: 126, + total_pages: 138, + status_code: 168 + ) +) ``` diff --git a/doc/models/list-public-keys-meta.md b/doc/models/list-public-keys-meta.md index f7b15c4..06d5bb0 100644 --- a/doc/models/list-public-keys-meta.md +++ b/doc/models/list-public-keys-meta.md @@ -14,14 +14,14 @@ | `total_pages` | `Integer` | Optional | - | | `per_page` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 22, - "current_page": 254, - "total_pages": 10, - "per_page": 24 -} +## Example + +```ruby +list_public_keys_meta = ListPublicKeysMeta.new( + total_count: 240, + current_page: 216, + total_pages: 228, + per_page: 62 +) ``` diff --git a/doc/models/list-public-keys-response.md b/doc/models/list-public-keys-response.md index 2764b33..3c81a1a 100644 --- a/doc/models/list-public-keys-response.md +++ b/doc/models/list-public-keys-response.md @@ -12,28 +12,28 @@ | `chargify_js_keys` | [`Array[PublicKey]`](../../doc/models/public-key.md) | Optional | - | | `meta` | [`ListPublicKeysMeta`](../../doc/models/list-public-keys-meta.md) | Optional | - | -## Example (as JSON) - -```json -{ - "chargify_js_keys": [ - { - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "2016-03-13T12:52:32.123Z" - }, - { - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "2016-03-13T12:52:32.123Z" - } +## Example + +```ruby +list_public_keys_response = ListPublicKeysResponse.new( + chargify_js_keys: [ + PublicKey.new( + public_key: 'public_key8', + requires_security_token: false, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ), + PublicKey.new( + public_key: 'public_key8', + requires_security_token: false, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "per_page": 152 - } -} + meta: ListPublicKeysMeta.new( + total_count: 150, + current_page: 126, + total_pages: 138, + per_page: 152 + ) +) ``` diff --git a/doc/models/list-sale-rep-item.md b/doc/models/list-sale-rep-item.md index 6ead230..1a817e5 100644 --- a/doc/models/list-sale-rep-item.md +++ b/doc/models/list-sale-rep-item.md @@ -15,31 +15,31 @@ | `mrr_data` | [`Hash[String, SaleRepItemMrr]`](../../doc/models/sale-rep-item-mrr.md) | Optional | - | | `test_mode` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "mrr_data": { - "november_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" - }, - "december_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" - }, - "january_2020": { - "mrr": "$400.00", - "usage": "$0.00", - "recurring": "$400.00" - } +## Example + +```ruby +list_sale_rep_item = ListSaleRepItem.new( + id: 124, + full_name: 'full_name8', + subscriptions_count: 56, + mrr_data: { + 'november_2019': SaleRepItemMrr.new( + mrr: '$0.00', + usage: '$0.00', + recurring: '$0.00' + ), + 'december_2019': SaleRepItemMrr.new( + mrr: '$0.00', + usage: '$0.00', + recurring: '$0.00' + ), + 'january_2020': SaleRepItemMrr.new( + mrr: '$400.00', + usage: '$0.00', + recurring: '$400.00' + ) }, - "id": 26, - "full_name": "full_name8", - "subscriptions_count": 154, - "test_mode": false -} + test_mode: false +) ``` diff --git a/doc/models/list-segments-filter.md b/doc/models/list-segments-filter.md index 74afb01..b37d9d1 100644 --- a/doc/models/list-segments-filter.md +++ b/doc/models/list-segments-filter.md @@ -14,14 +14,14 @@ | `segment_property_3_value` | `String` | Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_3` on attached Metric. If empty string is passed, this filter would be rejected. | | `segment_property_4_value` | `String` | Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_4` on attached Metric. If empty string is passed, this filter would be rejected. | -## Example (as JSON) - -```json -{ - "segment_property_1_value": "EU", - "segment_property_2_value": "segment_property_2_value4", - "segment_property_3_value": "segment_property_3_value2", - "segment_property_4_value": "segment_property_4_value6" -} +## Example + +```ruby +list_segments_filter = ListSegmentsFilter.new( + segment_property_1_value: 'EU', + segment_property_2_value: 'segment_property_2_value4', + segment_property_3_value: 'segment_property_3_value8', + segment_property_4_value: 'segment_property_4_value6' +) ``` diff --git a/doc/models/list-segments-response.md b/doc/models/list-segments-response.md index a1e5fd6..8ff9580 100644 --- a/doc/models/list-segments-response.md +++ b/doc/models/list-segments-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `segments` | [`Array[Segment]`](../../doc/models/segment.md) | Optional | - | -## Example (as JSON) - -```json -{ - "segments": [ - { - "id": 50, - "component_id": 160, - "price_point_id": 184, - "event_based_billing_metric_id": 244, - "pricing_scheme": "stairstep" - } +## Example + +```ruby +list_segments_response = ListSegmentsResponse.new( + segments: [ + Segment.new( + id: 50, + component_id: 160, + price_point_id: 184, + event_based_billing_metric_id: 244, + pricing_scheme: PricingScheme::STAIRSTEP + ) ] -} +) ``` diff --git a/doc/models/list-service-credits-response.md b/doc/models/list-service-credits-response.md index 1e21dd7..fdfa3ce 100644 --- a/doc/models/list-service-credits-response.md +++ b/doc/models/list-service-credits-response.md @@ -11,26 +11,19 @@ | --- | --- | --- | --- | | `service_credits` | [`Array[ServiceCredit1]`](../../doc/models/service-credit-1.md) | Optional | - | -## Example (as JSON) - -```json -{ - "service_credits": [ - { - "id": 224, - "amount_in_cents": 54, - "ending_balance_in_cents": 94, - "entry_type": "Credit", - "memo": "memo2" - }, - { - "id": 224, - "amount_in_cents": 54, - "ending_balance_in_cents": 94, - "entry_type": "Credit", - "memo": "memo2" - } +## Example + +```ruby +list_service_credits_response = ListServiceCreditsResponse.new( + service_credits: [ + ServiceCredit1.new( + id: 224, + amount_in_cents: 54, + ending_balance_in_cents: 94, + entry_type: ServiceCreditType::CREDIT, + memo: 'memo2' + ) ] -} +) ``` diff --git a/doc/models/list-subscription-components-filter.md b/doc/models/list-subscription-components-filter.md index 41ee066..5c66107 100644 --- a/doc/models/list-subscription-components-filter.md +++ b/doc/models/list-subscription-components-filter.md @@ -12,15 +12,15 @@ | `currencies` | `Array[String]` | Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=EUR,USD`.

**Constraints**: *Minimum Items*: `1` | | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | -## Example (as JSON) +## Example -```json -{ - "currencies": [ - "EUR", - "USD" +```ruby +list_subscription_components_filter = ListSubscriptionComponentsFilter.new( + currencies: [ + 'EUR', + 'USD' ], - "use_site_exchange_rate": false -} + use_site_exchange_rate: false +) ``` diff --git a/doc/models/list-subscription-components-for-site-filter.md b/doc/models/list-subscription-components-for-site-filter.md index 44a6a3a..e81f4bf 100644 --- a/doc/models/list-subscription-components-for-site-filter.md +++ b/doc/models/list-subscription-components-for-site-filter.md @@ -13,26 +13,26 @@ | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | | `subscription` | [`SubscriptionFilter`](../../doc/models/subscription-filter.md) | Optional | Nested filter used for List Subscription Components For Site Filter | -## Example (as JSON) +## Example -```json -{ - "currencies": [ - "EUR", - "USD" +```ruby +list_subscription_components_for_site_filter = ListSubscriptionComponentsForSiteFilter.new( + currencies: [ + 'EUR', + 'USD' ], - "use_site_exchange_rate": false, - "subscription": { - "states": [ - "active", - "canceled", - "expired" + use_site_exchange_rate: false, + subscription: SubscriptionFilter.new( + states: [ + SubscriptionStateFilter::TRIALING, + SubscriptionStateFilter::UNPAID, + SubscriptionStateFilter::ACTIVE ], - "date_field": "updated_at", - "start_date": "2016-03-13", - "end_date": "2016-03-13", - "start_datetime": "2016-03-13T12:52:32.123Z" - } -} + date_field: SubscriptionListDateField::UPDATED_AT, + start_date: Date.iso8601('2016-03-13'), + end_date: Date.iso8601('2016-03-13'), + start_datetime: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/list-subscription-components-include.md b/doc/models/list-subscription-components-include.md index 4bb14dd..c69aed9 100644 --- a/doc/models/list-subscription-components-include.md +++ b/doc/models/list-subscription-components-include.md @@ -14,7 +14,7 @@ ## Example -``` -subscription +```ruby +list_subscription_components_include = ListSubscriptionComponentsInclude::SUBSCRIPTION ``` diff --git a/doc/models/list-subscription-components-response.md b/doc/models/list-subscription-components-response.md index 4974b23..0783b12 100644 --- a/doc/models/list-subscription-components-response.md +++ b/doc/models/list-subscription-components-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `subscriptions_components` | [`Array[SubscriptionComponent]`](../../doc/models/subscription-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscriptions_components": [ - { - "id": 138, - "name": "name2", - "kind": "metered_component", - "unit_name": "unit_name4", - "enabled": false - } +## Example + +```ruby +list_subscription_components_response = ListSubscriptionComponentsResponse.new( + subscriptions_components: [ + SubscriptionComponent.new( + id: 138, + name: 'name2', + kind: ComponentKind::METERED_COMPONENT, + unit_name: 'unit_name4', + enabled: false + ) ] -} +) ``` diff --git a/doc/models/list-subscription-components-sort.md b/doc/models/list-subscription-components-sort.md index 03af5d1..bb66357 100644 --- a/doc/models/list-subscription-components-sort.md +++ b/doc/models/list-subscription-components-sort.md @@ -14,7 +14,7 @@ ## Example -``` -updated_at +```ruby +list_subscription_components_sort = ListSubscriptionComponentsSort::ID ``` diff --git a/doc/models/list-subcription-group-prepayment-item.md b/doc/models/list-subscription-group-prepayment-item.md similarity index 63% rename from doc/models/list-subcription-group-prepayment-item.md rename to doc/models/list-subscription-group-prepayment-item.md index 5a4bfb0..37ff8c7 100644 --- a/doc/models/list-subcription-group-prepayment-item.md +++ b/doc/models/list-subscription-group-prepayment-item.md @@ -1,9 +1,9 @@ -# List Subcription Group Prepayment Item +# List Subscription Group Prepayment Item ## Structure -`ListSubcriptionGroupPrepaymentItem` +`ListSubscriptionGroupPrepaymentItem` ## Fields @@ -19,15 +19,15 @@ | `payment_type` | [`PrepaymentMethod`](../../doc/models/prepayment-method.md) | Optional | - | | `created_at` | `DateTime` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "id": 254, - "subscription_group_uid": "subscription_group_uid6", - "amount_in_cents": 172, - "remaining_amount_in_cents": 142, - "details": "details2" -} +```ruby +list_subscription_group_prepayment_item = ListSubscriptionGroupPrepaymentItem.new( + id: 96, + subscription_group_uid: 'subscription_group_uid6', + amount_in_cents: 74, + remaining_amount_in_cents: 240, + details: 'details2' +) ``` diff --git a/doc/models/list-subscription-group-prepayment-response.md b/doc/models/list-subscription-group-prepayment-response.md index b1d942d..bbf6f4d 100644 --- a/doc/models/list-subscription-group-prepayment-response.md +++ b/doc/models/list-subscription-group-prepayment-response.md @@ -11,21 +11,21 @@ | --- | --- | --- | --- | | `prepayments` | [`Array[ListSubscriptionGroupPrepayment]`](../../doc/models/list-subscription-group-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayments": [ - { - "prepayment": { - "id": 38, - "subscription_group_uid": "subscription_group_uid2", - "amount_in_cents": 124, - "remaining_amount_in_cents": 182, - "details": "details8" - } - } +## Example + +```ruby +list_subscription_group_prepayment_response = ListSubscriptionGroupPrepaymentResponse.new( + prepayments: [ + ListSubscriptionGroupPrepayment.new( + prepayment: ListSubscriptionGroupPrepaymentItem.new( + id: 38, + subscription_group_uid: 'subscription_group_uid2', + amount_in_cents: 124, + remaining_amount_in_cents: 182, + details: 'details8' + ) + ) ] -} +) ``` diff --git a/doc/models/list-subscription-group-prepayment.md b/doc/models/list-subscription-group-prepayment.md index efcb478..1552076 100644 --- a/doc/models/list-subscription-group-prepayment.md +++ b/doc/models/list-subscription-group-prepayment.md @@ -9,19 +9,19 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `prepayment` | [`ListSubcriptionGroupPrepaymentItem`](../../doc/models/list-subcription-group-prepayment-item.md) | Required | - | - -## Example (as JSON) - -```json -{ - "prepayment": { - "id": 38, - "subscription_group_uid": "subscription_group_uid2", - "amount_in_cents": 124, - "remaining_amount_in_cents": 182, - "details": "details8" - } -} +| `prepayment` | [`ListSubscriptionGroupPrepaymentItem`](../../doc/models/list-subscription-group-prepayment-item.md) | Required | - | + +## Example + +```ruby +list_subscription_group_prepayment = ListSubscriptionGroupPrepayment.new( + prepayment: ListSubscriptionGroupPrepaymentItem.new( + id: 38, + subscription_group_uid: 'subscription_group_uid2', + amount_in_cents: 124, + remaining_amount_in_cents: 182, + details: 'details8' + ) +) ``` diff --git a/doc/models/list-subscription-groups-item.md b/doc/models/list-subscription-groups-item.md index 7d38ee3..f2a2ed1 100644 --- a/doc/models/list-subscription-groups-item.md +++ b/doc/models/list-subscription-groups-item.md @@ -21,17 +21,19 @@ | `account_balances` | [`SubscriptionGroupBalances`](../../doc/models/subscription-group-balances.md) | Optional | - | | `group_type` | [`GroupType`](../../doc/models/group-type.md) | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "scheme": 124, - "customer_id": 144, - "payment_profile_id": 52, - "subscription_ids": [ - 254 +## Example + +```ruby +list_subscription_groups_item = ListSubscriptionGroupsItem.new( + uid: 'uid0', + scheme: 62, + customer_id: 82, + payment_profile_id: 246, + subscription_ids: [ + 192, + 193, + 194 ] -} +) ``` diff --git a/doc/models/list-subscription-groups-meta.md b/doc/models/list-subscription-groups-meta.md index c575c24..847446f 100644 --- a/doc/models/list-subscription-groups-meta.md +++ b/doc/models/list-subscription-groups-meta.md @@ -12,12 +12,12 @@ | `current_page` | `Integer` | Optional | - | | `total_count` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "current_page": 14, - "total_count": 38 -} +```ruby +list_subscription_groups_meta = ListSubscriptionGroupsMeta.new( + current_page: 110, + total_count: 134 +) ``` diff --git a/doc/models/list-subscription-groups-response.md b/doc/models/list-subscription-groups-response.md index 55f3159..e59a4f8 100644 --- a/doc/models/list-subscription-groups-response.md +++ b/doc/models/list-subscription-groups-response.md @@ -12,43 +12,34 @@ | `subscription_groups` | [`Array[ListSubscriptionGroupsItem]`](../../doc/models/list-subscription-groups-item.md) | Optional | - | | `meta` | [`ListSubscriptionGroupsMeta`](../../doc/models/list-subscription-groups-meta.md) | Optional | - | -## Example (as JSON) - -```json -{ - "subscription_groups": [ - { - "uid": "uid2", - "scheme": 166, - "customer_id": 186, - "payment_profile_id": 162, - "subscription_ids": [ +## Example + +```ruby +list_subscription_groups_response = ListSubscriptionGroupsResponse.new( + subscription_groups: [ + ListSubscriptionGroupsItem.new( + uid: 'uid2', + scheme: 166, + customer_id: 186, + payment_profile_id: 162, + subscription_ids: [ 40 ] - }, - { - "uid": "uid2", - "scheme": 166, - "customer_id": 186, - "payment_profile_id": 162, - "subscription_ids": [ + ), + ListSubscriptionGroupsItem.new( + uid: 'uid2', + scheme: 166, + customer_id: 186, + payment_profile_id: 162, + subscription_ids: [ 40 ] - }, - { - "uid": "uid2", - "scheme": 166, - "customer_id": 186, - "payment_profile_id": 162, - "subscription_ids": [ - 40 - ] - } + ) ], - "meta": { - "current_page": 126, - "total_count": 150 - } -} + meta: ListSubscriptionGroupsMeta.new( + current_page: 126, + total_count: 150 + ) +) ``` diff --git a/doc/models/metadata.md b/doc/models/metadata.md index fd53873..133f3e4 100644 --- a/doc/models/metadata.md +++ b/doc/models/metadata.md @@ -16,15 +16,15 @@ | `deleted_at` | `DateTime` | Optional | - | | `metafield_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 12, - "value": "value0", - "resource_id": 96, - "name": "name8", - "deleted_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +metadata = Metadata.new( + id: 50, + value: 'value8', + resource_id: 134, + name: 'name6', + deleted_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/metafield-input.md b/doc/models/metafield-input.md index 75443bd..0a4f7b3 100644 --- a/doc/models/metafield-input.md +++ b/doc/models/metafield-input.md @@ -1,7 +1,7 @@ # Metafield Input -Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. +Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. ## Enumeration @@ -16,3 +16,9 @@ Indicates the type of metafield. A text metafield allows any string value. Dropd | `RADIO` | | `DROPDOWN` | +## Example + +```ruby +metafield_input = MetafieldInput::RADIO +``` + diff --git a/doc/models/metafield-scope.md b/doc/models/metafield-scope.md index 3c2ca83..f5e8fac 100644 --- a/doc/models/metafield-scope.md +++ b/doc/models/metafield-scope.md @@ -19,15 +19,15 @@ Warning: When updating a metafield's scope attribute, all scope attributes must | `public_edit` | [`IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields used in [Embeddable Components](page:development-tools/embeddable-components/overview) from being editable by your ecosystem. | | `hosted` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" -} +## Example + +```ruby +metafield_scope = MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE +) ``` diff --git a/doc/models/metafield.md b/doc/models/metafield.md index 7b74131..62dd162 100644 --- a/doc/models/metafield.md +++ b/doc/models/metafield.md @@ -13,24 +13,24 @@ | `name` | `String` | Optional | - | | `scope` | [`MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | | `data_count` | `Integer` | Optional | The amount of subscriptions this metafield has been applied to in Advanced Billing. | -| `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | +| `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | | `enum` | String \| Array[String] \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "id": 52, - "name": "name8", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" - }, - "data_count": 216, - "input_type": "radio" -} +## Example + +```ruby +metafield = Metafield.new( + id: 242, + name: 'name4', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE + ), + data_count: 26, + input_type: MetafieldInput::BALANCE_TRACKER +) ``` diff --git a/doc/models/metered-component.md b/doc/models/metered-component.md index e89c965..68e0152 100644 --- a/doc/models/metered-component.md +++ b/doc/models/metered-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `unit_name` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | +| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | +| `unit_name` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 messages” on a subscription’s component line-item | | `description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is taxable or not. | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array[Price]`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | @@ -23,35 +23,60 @@ | `display_on_hosted_page` | `TrueClass \| FalseClass` | Optional | - | | `allow_fractional_quantities` | `TrueClass \| FalseClass` | Optional | - | | `public_signup_page_ids` | `Array[Integer]` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | -## Example (as JSON) - -```json -{ - "name": "name4", - "unit_name": "unit_name6", - "description": "description6", - "handle": "handle0", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +metered_component = MeteredComponent.new( + name: 'name0', + unit_name: 'unit_name2', + pricing_scheme: PricingScheme::STAIRSTEP, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } + price_points: [ + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ), + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ), + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ) ] -} +) ``` diff --git a/doc/models/metered-usage.md b/doc/models/metered-usage.md index 1da62e1..153c7a9 100644 --- a/doc/models/metered-usage.md +++ b/doc/models/metered-usage.md @@ -10,22 +10,22 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `previous_unit_balance` | `String` | Required | **Constraints**: *Minimum Length*: `1` | -| `new_unit_balance` | `Integer` | Required | - | +| `new_unit_balance` | Integer \| String | Required | This is a container for one-of cases. | | `usage_quantity` | `Integer` | Required | - | | `component_id` | `Integer` | Required | - | | `component_handle` | `String` | Required | - | | `memo` | `String` | Required | - | -## Example (as JSON) - -```json -{ - "previous_unit_balance": "previous_unit_balance6", - "new_unit_balance": 80, - "usage_quantity": 42, - "component_id": 4, - "component_handle": "component_handle8", - "memo": "memo2" -} +## Example + +```ruby +metered_usage = MeteredUsage.new( + previous_unit_balance: 'previous_unit_balance2', + new_unit_balance: 244, + usage_quantity: 28, + component_id: 246, + component_handle: 'component_handle2', + memo: 'memo6' +) ``` diff --git a/doc/models/movement-line-item.md b/doc/models/movement-line-item.md index 341656d..a7d05ae 100644 --- a/doc/models/movement-line-item.md +++ b/doc/models/movement-line-item.md @@ -19,15 +19,15 @@ | `prev_quantity` | `Integer` | Optional | - | | `recurring` | `TrueClass \| FalseClass` | Optional | When `true`, the line item's MRR value will contribute to the `plan` breakout. When `false`, the line item contributes to the `usage` breakout. | -## Example (as JSON) - -```json -{ - "product_id": 156, - "component_id": 68, - "price_point_id": 164, - "name": "name6", - "mrr": 154 -} +## Example + +```ruby +movement_line_item = MovementLineItem.new( + product_id: 60, + component_id: 228, + price_point_id: 4, + name: 'name0', + mrr: 250 +) ``` diff --git a/doc/models/movement.md b/doc/models/movement.md index 5c7956e..8508e94 100644 --- a/doc/models/movement.md +++ b/doc/models/movement.md @@ -19,15 +19,15 @@ | `subscription_id` | `Integer` | Optional | - | | `subscriber_name` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "timestamp": "2016-03-13T12:52:32.123Z", - "amount_in_cents": 174, - "amount_formatted": "amount_formatted4", - "description": "description2", - "category": "category0" -} +## Example + +```ruby +movement = Movement.new( + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + amount_in_cents: 34, + amount_formatted: 'amount_formatted6', + description: 'description4', + category: 'category2' +) ``` diff --git a/doc/models/mrr-movement.md b/doc/models/mrr-movement.md index ef67268..1f36627 100644 --- a/doc/models/mrr-movement.md +++ b/doc/models/mrr-movement.md @@ -14,14 +14,14 @@ | `subscriber_delta` | `Integer` | Optional | - | | `lead_delta` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "amount": 210, - "category": "category0", - "subscriber_delta": 170, - "lead_delta": 198 -} +## Example + +```ruby +mrr_movement = MRRMovement.new( + amount: 74, + category: 'category0', + subscriber_delta: 34, + lead_delta: 62 +) ``` diff --git a/doc/models/mrr-response.md b/doc/models/mrr-response.md index ff4f7dd..7ae9568 100644 --- a/doc/models/mrr-response.md +++ b/doc/models/mrr-response.md @@ -11,22 +11,22 @@ | --- | --- | --- | --- | | `mrr` | [`MRR`](../../doc/models/mrr.md) | Required | - | -## Example (as JSON) - -```json -{ - "mrr": { - "amount_in_cents": 198, - "amount_formatted": "amount_formatted6", - "currency": "currency4", - "currency_symbol": "currency_symbol2", - "breakouts": { - "plan_amount_in_cents": 254, - "plan_amount_formatted": "plan_amount_formatted0", - "usage_amount_in_cents": 106, - "usage_amount_formatted": "usage_amount_formatted8" - } - } -} +## Example + +```ruby +mrr_response = MRRResponse.new( + mrr: MRR.new( + amount_in_cents: 198, + amount_formatted: 'amount_formatted6', + currency: 'currency4', + currency_symbol: 'currency_symbol2', + breakouts: Breakouts.new( + plan_amount_in_cents: 254, + plan_amount_formatted: 'plan_amount_formatted0', + usage_amount_in_cents: 106, + usage_amount_formatted: 'usage_amount_formatted8' + ) + ) +) ``` diff --git a/doc/models/mrr.md b/doc/models/mrr.md index df28aa8..2841842 100644 --- a/doc/models/mrr.md +++ b/doc/models/mrr.md @@ -16,20 +16,20 @@ | `breakouts` | [`Breakouts`](../../doc/models/breakouts.md) | Optional | - | | `at_time` | `DateTime` | Optional | ISO8601 timestamp | -## Example (as JSON) - -```json -{ - "amount_in_cents": 208, - "amount_formatted": "amount_formatted2", - "currency": "currency0", - "currency_symbol": "currency_symbol8", - "breakouts": { - "plan_amount_in_cents": 254, - "plan_amount_formatted": "plan_amount_formatted0", - "usage_amount_in_cents": 106, - "usage_amount_formatted": "usage_amount_formatted8" - } -} +## Example + +```ruby +mrr = MRR.new( + amount_in_cents: 198, + amount_formatted: 'amount_formatted6', + currency: 'currency4', + currency_symbol: 'currency_symbol2', + breakouts: Breakouts.new( + plan_amount_in_cents: 254, + plan_amount_formatted: 'plan_amount_formatted0', + usage_amount_in_cents: 106, + usage_amount_formatted: 'usage_amount_formatted8' + ) +) ``` diff --git a/doc/models/multi-invoice-payment-response.md b/doc/models/multi-invoice-payment-response.md index 6d917ff..db0cd92 100644 --- a/doc/models/multi-invoice-payment-response.md +++ b/doc/models/multi-invoice-payment-response.md @@ -11,32 +11,32 @@ | --- | --- | --- | --- | | `payment` | [`MultiInvoicePayment`](../../doc/models/multi-invoice-payment.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment": { - "transaction_id": 224, - "total_amount": "total_amount2", - "currency_code": "currency_code2", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" - }, - { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" - }, - { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" - } +## Example + +```ruby +multi_invoice_payment_response = MultiInvoicePaymentResponse.new( + payment: MultiInvoicePayment.new( + transaction_id: 224, + total_amount: 'total_amount2', + currency_code: 'currency_code2', + applications: [ + InvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + application_uid: 'application_uid8', + applied_amount: 'applied_amount0' + ), + InvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + application_uid: 'application_uid8', + applied_amount: 'applied_amount0' + ), + InvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + application_uid: 'application_uid8', + applied_amount: 'applied_amount0' + ) ] - } -} + ) +) ``` diff --git a/doc/models/multi-invoice-payment.md b/doc/models/multi-invoice-payment.md index 489a2ae..1d7277d 100644 --- a/doc/models/multi-invoice-payment.md +++ b/doc/models/multi-invoice-payment.md @@ -14,20 +14,20 @@ | `currency_code` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | | `applications` | [`Array[InvoicePaymentApplication]`](../../doc/models/invoice-payment-application.md) | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_id": 144, - "total_amount": "total_amount2", - "currency_code": "currency_code2", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" - } +## Example + +```ruby +multi_invoice_payment = MultiInvoicePayment.new( + transaction_id: 238, + total_amount: 'total_amount0', + currency_code: 'currency_code0', + applications: [ + InvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + application_uid: 'application_uid8', + applied_amount: 'applied_amount0' + ) ] -} +) ``` diff --git a/doc/models/nested-subscription-group.md b/doc/models/nested-subscription-group.md index 05c4d2f..9524abf 100644 --- a/doc/models/nested-subscription-group.md +++ b/doc/models/nested-subscription-group.md @@ -14,14 +14,14 @@ | `primary_subscription_id` | `Integer` | Optional | The subscription ID of the primary within the group. Applicable to scheme 1. | | `primary` | `TrueClass \| FalseClass` | Optional | A boolean indicating whether the subscription is the primary in the group. Applicable to scheme 1. | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "scheme": 62, - "primary_subscription_id": 10, - "primary": false -} +## Example + +```ruby +nested_subscription_group = NestedSubscriptionGroup.new( + uid: 'uid2', + scheme: 254, + primary_subscription_id: 202, + primary: false +) ``` diff --git a/doc/models/net-terms.md b/doc/models/net-terms.md index 81d3767..a5a6e3a 100644 --- a/doc/models/net-terms.md +++ b/doc/models/net-terms.md @@ -15,15 +15,15 @@ | `net_terms_on_remittance_signups_enabled` | `TrueClass \| FalseClass` | Optional | **Default**: `false` | | `custom_net_terms_enabled` | `TrueClass \| FalseClass` | Optional | **Default**: `false` | -## Example (as JSON) - -```json -{ - "default_net_terms": 0, - "automatic_net_terms": 0, - "remittance_net_terms": 0, - "net_terms_on_remittance_signups_enabled": false, - "custom_net_terms_enabled": false -} +## Example + +```ruby +net_terms = NetTerms.new( + default_net_terms: 0, + automatic_net_terms: 0, + remittance_net_terms: 0, + net_terms_on_remittance_signups_enabled: false, + custom_net_terms_enabled: false +) ``` diff --git a/doc/models/offer-discount.md b/doc/models/offer-discount.md index 5b99e8f..b892aa2 100644 --- a/doc/models/offer-discount.md +++ b/doc/models/offer-discount.md @@ -13,13 +13,13 @@ | `coupon_id` | `Integer` | Optional | - | | `coupon_name` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "coupon_code": "coupon_code8", - "coupon_id": 86, - "coupon_name": "coupon_name4" -} +## Example + +```ruby +offer_discount = OfferDiscount.new( + coupon_code: 'coupon_code4', + coupon_id: 106, + coupon_name: 'coupon_name6' +) ``` diff --git a/doc/models/offer-item.md b/doc/models/offer-item.md index 10c52bd..73b1c48 100644 --- a/doc/models/offer-item.md +++ b/doc/models/offer-item.md @@ -17,18 +17,18 @@ | `component_name` | `String` | Optional | - | | `price_point_name` | `String` | Optional | - | | `currency_prices` | [`Array[CurrencyPrice]`](../../doc/models/currency-price.md) | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | -## Example (as JSON) +## Example -```json -{ - "component_id": 216, - "price_point_id": 16, - "starting_quantity": "starting_quantity0", - "editable": false, - "component_unit_price": "component_unit_price8" -} +```ruby +offer_item = OfferItem.new( + component_id: 216, + price_point_id: 16, + starting_quantity: 'starting_quantity0', + editable: false, + component_unit_price: 'component_unit_price8' +) ``` diff --git a/doc/models/offer-response.md b/doc/models/offer-response.md index fc01f44..44dd711 100644 --- a/doc/models/offer-response.md +++ b/doc/models/offer-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `offer` | [`Offer`](../../doc/models/offer.md) | Optional | - | -## Example (as JSON) - -```json -{ - "offer": { - "id": 28, - "site_id": 210, - "product_family_id": 224, - "product_id": 30, - "product_price_point_id": 150 - } -} +## Example + +```ruby +offer_response = OfferResponse.new( + offer: Offer.new( + id: 28, + site_id: 210, + product_family_id: 224, + product_id: 30, + product_price_point_id: 150 + ) +) ``` diff --git a/doc/models/offer-signup-page.md b/doc/models/offer-signup-page.md index ce27c3d..cb7c85f 100644 --- a/doc/models/offer-signup-page.md +++ b/doc/models/offer-signup-page.md @@ -16,15 +16,15 @@ | `return_params` | `String` | Optional | - | | `url` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 50, - "nickname": "nickname8", - "enabled": false, - "return_url": "return_url2", - "return_params": "return_params0" -} +## Example + +```ruby +offer_signup_page = OfferSignupPage.new( + id: 78, + nickname: 'nickname0', + enabled: false, + return_url: 'return_url0', + return_params: 'return_params2' +) ``` diff --git a/doc/models/offer.md b/doc/models/offer.md index d0834e1..6a835cd 100644 --- a/doc/models/offer.md +++ b/doc/models/offer.md @@ -29,15 +29,15 @@ | `product_price_in_cents` | `Integer` | Optional | - | | `offer_signup_pages` | [`Array[OfferSignupPage]`](../../doc/models/offer-signup-page.md) | Optional | - | -## Example (as JSON) - -```json -{ - "id": 154, - "site_id": 80, - "product_family_id": 158, - "product_id": 96, - "product_price_point_id": 20 -} +## Example + +```ruby +offer = Offer.new( + id: 28, + site_id: 210, + product_family_id: 224, + product_id: 30, + product_price_point_id: 150 +) ``` diff --git a/doc/models/ok-response.md b/doc/models/ok-response.md index a0b7ef0..4277fdc 100644 --- a/doc/models/ok-response.md +++ b/doc/models/ok-response.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `ok` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "ok": "ok4" -} +```ruby +ok_response = OkResponse.new( + ok: 'ok8' +) ``` diff --git a/doc/models/on-off-component.md b/doc/models/on-off-component.md index b83794a..d9312c8 100644 --- a/doc/models/on-off-component.md +++ b/doc/models/on-off-component.md @@ -9,9 +9,9 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | +| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | | `description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is taxable or not. | | `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | @@ -22,20 +22,21 @@ | `display_on_hosted_page` | `TrueClass \| FalseClass` | Optional | - | | `allow_fractional_quantities` | `TrueClass \| FalseClass` | Optional | - | | `public_signup_page_ids` | `Array[Integer]` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | - -## Example (as JSON) - -```json -{ - "name": "name2", - "description": "description2", - "handle": "handle8", - "taxable": false, - "upgrade_charge": "prorated", - "downgrade_credit": "prorated", - "unit_price": "String1" -} +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | + +## Example + +```ruby +on_off_component = OnOffComponent.new( + name: 'name6', + unit_price: 'String5', + description: 'description6', + handle: 'handle2', + taxable: false, + upgrade_charge: CreditType::FULL, + downgrade_credit: CreditType::FULL +) ``` diff --git a/doc/models/organization-address.md b/doc/models/organization-address.md index d949b2e..3fe3e90 100644 --- a/doc/models/organization-address.md +++ b/doc/models/organization-address.md @@ -18,15 +18,15 @@ | `name` | `String` | Optional | - | | `phone` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "street": "street4", - "line2": "line28", - "city": "city4", - "state": "state0", - "zip": "zip2" -} +## Example + +```ruby +organization_address = OrganizationAddress.new( + street: 'street6', + line2: 'line20', + city: 'city6', + state: 'state2', + zip: 'zip0' +) ``` diff --git a/doc/models/origin-invoice.md b/doc/models/origin-invoice.md index b47e4ba..ac92ec6 100644 --- a/doc/models/origin-invoice.md +++ b/doc/models/origin-invoice.md @@ -12,12 +12,12 @@ | `uid` | `String` | Optional | The UID of the invoice serving as an origin invoice. | | `number` | `String` | Optional | The number of the invoice serving as an origin invoice. | -## Example (as JSON) +## Example -```json -{ - "uid": "uid0", - "number": "number8" -} +```ruby +origin_invoice = OriginInvoice.new( + uid: 'uid8', + number: 'number4' +) ``` diff --git a/doc/models/overage-pricing.md b/doc/models/overage-pricing.md index 1222509..a055514 100644 --- a/doc/models/overage-pricing.md +++ b/doc/models/overage-pricing.md @@ -12,28 +12,18 @@ | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array[Price]`](../../doc/models/price.md) | Optional | - | -## Example (as JSON) - -```json -{ - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +overage_pricing = OveragePricing.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ] -} +) ``` diff --git a/doc/models/override-subscription-request.md b/doc/models/override-subscription-request.md index 7666cf0..5a0522b 100644 --- a/doc/models/override-subscription-request.md +++ b/doc/models/override-subscription-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `subscription` | [`OverrideSubscription`](../../doc/models/override-subscription.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription": { - "activated_at": "2016-03-13T12:52:32.123Z", - "canceled_at": "2016-03-13T12:52:32.123Z", - "cancellation_message": "cancellation_message2", - "expires_at": "2016-03-13T12:52:32.123Z", - "current_period_starts_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +override_subscription_request = OverrideSubscriptionRequest.new( + subscription: OverrideSubscription.new( + activated_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + canceled_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + cancellation_message: 'cancellation_message2', + expires_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + current_period_starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/override-subscription.md b/doc/models/override-subscription.md index 7259de2..1b1ec72 100644 --- a/doc/models/override-subscription.md +++ b/doc/models/override-subscription.md @@ -15,15 +15,15 @@ | `expires_at` | `DateTime` | Optional | Can be used to record an external expiration date. Chargify sets this field automatically when a subscription expires (ceases billing) after a prescribed amount of time. Only ISO8601 format is supported. This field is not supported when Multi-frequency is enabled for the Site. To change the Term End of a Subscription, use the Update Subscription endpoint. | | `current_period_starts_at` | `DateTime` | Optional | Can only be used when a subscription is unbilled, which happens when a future initial billing date is passed at subscription creation. The value passed must be before the current date and time. Allows you to set when the period started so mid period component allocations have the correct proration. Only ISO8601 format is supported. | -## Example (as JSON) - -```json -{ - "activated_at": "2016-03-13T12:52:32.123Z", - "canceled_at": "2016-03-13T12:52:32.123Z", - "cancellation_message": "cancellation_message4", - "expires_at": "2016-03-13T12:52:32.123Z", - "current_period_starts_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +override_subscription = OverrideSubscription.new( + activated_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + canceled_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + cancellation_message: 'cancellation_message2', + expires_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + current_period_starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/paginated-metadata.md b/doc/models/paginated-metadata.md index a982a0c..e647594 100644 --- a/doc/models/paginated-metadata.md +++ b/doc/models/paginated-metadata.md @@ -15,30 +15,37 @@ | `per_page` | `Integer` | Optional | - | | `metadata` | [`Array[Metadata]`](../../doc/models/metadata.md) | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 26, - "current_page": 2, - "total_pages": 14, - "per_page": 20, - "metadata": [ - { - "id": 50, - "value": "value8", - "resource_id": 134, - "name": "name6", - "deleted_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": 50, - "value": "value8", - "resource_id": 134, - "name": "name6", - "deleted_at": "2016-03-13T12:52:32.123Z" - } +## Example + +```ruby +paginated_metadata = PaginatedMetadata.new( + total_count: 144, + current_page: 120, + total_pages: 132, + per_page: 158, + metadata: [ + Metadata.new( + id: 50, + value: 'value8', + resource_id: 134, + name: 'name6', + deleted_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ), + Metadata.new( + id: 50, + value: 'value8', + resource_id: 134, + name: 'name6', + deleted_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ), + Metadata.new( + id: 50, + value: 'value8', + resource_id: 134, + name: 'name6', + deleted_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) ] -} +) ``` diff --git a/doc/models/paid-invoice.md b/doc/models/paid-invoice.md index 022fb1e..08a53ea 100644 --- a/doc/models/paid-invoice.md +++ b/doc/models/paid-invoice.md @@ -14,14 +14,14 @@ | `due_amount` | `String` | Optional | The remaining due amount on the invoice | | `paid_amount` | `String` | Optional | The total amount paid on this invoice (including any prior payments) | -## Example (as JSON) - -```json -{ - "invoice_id": "invoice_id6", - "status": "open", - "due_amount": "due_amount8", - "paid_amount": "paid_amount8" -} +## Example + +```ruby +paid_invoice = PaidInvoice.new( + invoice_id: 'invoice_id6', + status: InvoiceStatus::PAID, + due_amount: 'due_amount6', + paid_amount: 'paid_amount4' +) ``` diff --git a/doc/models/pause-request.md b/doc/models/pause-request.md index 01abe5f..db687cc 100644 --- a/doc/models/pause-request.md +++ b/doc/models/pause-request.md @@ -1,7 +1,7 @@ # Pause Request -Allows to pause a Subscription +Allows you to pause a Subscription. ## Structure @@ -13,13 +13,13 @@ Allows to pause a Subscription | --- | --- | --- | --- | | `hold` | [`AutoResume`](../../doc/models/auto-resume.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "hold": { - "automatically_resume_at": "2016-03-13T12:52:32.123Z" - } -} +```ruby +pause_request = PauseRequest.new( + hold: AutoResume.new( + automatically_resume_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/pay-pal-vault.md b/doc/models/pay-pal-vault.md index 00445c6..7533c92 100644 --- a/doc/models/pay-pal-vault.md +++ b/doc/models/pay-pal-vault.md @@ -16,3 +16,9 @@ The vault that stores the payment profile with the provided vault_token. | `MODUSLINK` | | `PAYPAL_COMPLETE` | +## Example + +```ruby +pay_pal_vault = PayPalVault::MODUSLINK +``` + diff --git a/doc/models/payer-attributes.md b/doc/models/payer-attributes.md index 7019edf..c6c2c3a 100644 --- a/doc/models/payer-attributes.md +++ b/doc/models/payer-attributes.md @@ -28,19 +28,19 @@ | `tax_exempt_reason` | `String` | Optional | - | | `metafields` | `Hash[String, String]` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | -## Example (as JSON) - -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "first_name": "first_name4", - "last_name": "last_name2", - "email": "email2", - "cc_emails": "cc_emails4", - "organization": "organization8" -} +## Example + +```ruby +payer_attributes = PayerAttributes.new( + first_name: 'first_name2', + last_name: 'last_name0', + email: 'email4', + cc_emails: 'cc_emails2', + organization: 'organization6', + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' + } +) ``` diff --git a/doc/models/payer-error.md b/doc/models/payer-error.md index d963da3..71bd9d2 100644 --- a/doc/models/payer-error.md +++ b/doc/models/payer-error.md @@ -13,22 +13,23 @@ | `first_name` | `Array[String]` | Optional | - | | `email` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "last_name": [ - "last_name1", - "last_name2", - "last_name3" +## Example + +```ruby +payer_error = PayerError.new( + last_name: [ + 'last_name9' ], - "first_name": [ - "first_name4", - "first_name5" + first_name: [ + 'first_name2', + 'first_name3', + 'first_name4' ], - "email": [ - "email4" + email: [ + 'email4', + 'email3', + 'email2' ] -} +) ``` diff --git a/doc/models/payment-collection-method-changed.md b/doc/models/payment-collection-method-changed.md index 73a20d3..8aced04 100644 --- a/doc/models/payment-collection-method-changed.md +++ b/doc/models/payment-collection-method-changed.md @@ -12,12 +12,12 @@ | `previous_value` | `String` | Required | - | | `current_value` | `String` | Required | - | -## Example (as JSON) +## Example -```json -{ - "previous_value": "previous_value4", - "current_value": "current_value2" -} +```ruby +payment_collection_method_changed = PaymentCollectionMethodChanged.new( + previous_value: 'previous_value2', + current_value: 'current_value0' +) ``` diff --git a/doc/models/payment-for-allocation.md b/doc/models/payment-for-allocation.md index ff0c3a1..722acb1 100644 --- a/doc/models/payment-for-allocation.md +++ b/doc/models/payment-for-allocation.md @@ -16,14 +16,14 @@ Information for captured payment, if applicable | `success` | `TrueClass \| FalseClass` | Optional | - | | `memo` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 72, - "amount_in_cents": 158, - "success": false, - "memo": "memo6" -} +## Example + +```ruby +payment_for_allocation = PaymentForAllocation.new( + id: 232, + amount_in_cents: 194, + success: false, + memo: 'memo6' +) ``` diff --git a/doc/models/payment-method-apple-pay.md b/doc/models/payment-method-apple-pay.md index a7bd902..5f08af8 100644 --- a/doc/models/payment-method-apple-pay.md +++ b/doc/models/payment-method-apple-pay.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "type": "apple_pay" -} +```ruby +payment_method_apple_pay = PaymentMethodApplePay.new( + type: InvoiceEventPaymentMethod::APPLE_PAY +) ``` diff --git a/doc/models/payment-method-bank-account.md b/doc/models/payment-method-bank-account.md index 76efc5a..651b19b 100644 --- a/doc/models/payment-method-bank-account.md +++ b/doc/models/payment-method-bank-account.md @@ -13,13 +13,13 @@ | `masked_routing_number` | `String` | Required | - | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "masked_account_number": "masked_account_number2", - "masked_routing_number": "masked_routing_number2", - "type": "bank_account" -} +## Example + +```ruby +payment_method_bank_account = PaymentMethodBankAccount.new( + masked_account_number: 'masked_account_number6', + masked_routing_number: 'masked_routing_number6', + type: InvoiceEventPaymentMethod::BANK_ACCOUNT +) ``` diff --git a/doc/models/payment-method-credit-card.md b/doc/models/payment-method-credit-card.md index ef07011..7c231e3 100644 --- a/doc/models/payment-method-credit-card.md +++ b/doc/models/payment-method-credit-card.md @@ -15,15 +15,15 @@ | `masked_card_number` | `String` | Required | - | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "card_brand": "card_brand4", - "masked_card_number": "masked_card_number0", - "type": "credit_card", - "card_expiration": "card_expiration2", - "last_four": "last_four4" -} +## Example + +```ruby +payment_method_credit_card = PaymentMethodCreditCard.new( + card_brand: 'card_brand2', + masked_card_number: 'masked_card_number2', + type: InvoiceEventPaymentMethod::CREDIT_CARD, + card_expiration: 'card_expiration0', + last_four: 'last_four8' +) ``` diff --git a/doc/models/payment-method-external.md b/doc/models/payment-method-external.md index 58e1922..9f9683a 100644 --- a/doc/models/payment-method-external.md +++ b/doc/models/payment-method-external.md @@ -14,14 +14,14 @@ | `memo` | `String` | Required | - | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "details": "details4", - "kind": "kind2", - "memo": "memo8", - "type": "external" -} +## Example + +```ruby +payment_method_external = PaymentMethodExternal.new( + details: 'details8', + kind: 'kind6', + memo: 'memo2', + type: InvoiceEventPaymentMethod::EXTERNAL +) ``` diff --git a/doc/models/payment-method-paypal.md b/doc/models/payment-method-paypal.md index f31e23a..bcff776 100644 --- a/doc/models/payment-method-paypal.md +++ b/doc/models/payment-method-paypal.md @@ -12,12 +12,12 @@ | `email` | `String` | Required | - | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "email": "email2", - "type": "paypal_account" -} +```ruby +payment_method_paypal = PaymentMethodPaypal.new( + email: 'email6', + type: InvoiceEventPaymentMethod::PAYPAL_ACCOUNT +) ``` diff --git a/doc/models/payment-profile-attributes.md b/doc/models/payment-profile-attributes.md index d352438..68a4eb4 100644 --- a/doc/models/payment-profile-attributes.md +++ b/doc/models/payment-profile-attributes.md @@ -11,22 +11,22 @@ alias to credit_card_attributes | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `chargify_token` | `String` | Optional | (Optional) Token received after sending billing information using Maxio.js (formerly Chargify.js). This token must be passed as a sole attribute of `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | +| `chargify_token` | `String` | Optional | (Optional) Token received after sending billing information using Maxio.js (formerly Chargify.js). This token must be passed as a sole attribute of `payment_profile_attributes` (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). | | `id` | `Integer` | Optional | - | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Optional | - | | `first_name` | `String` | Optional | (Optional) First name on card or bank account. If omitted, the first_name from customer attributes will be used. | | `last_name` | `String` | Optional | (Optional) Last name on card or bank account. If omitted, the last_name from customer attributes will be used. | | `masked_card_number` | `String` | Optional | - | -| `full_number` | `String` | Optional | The full credit card number (string representation, i.e. 5424000000000015) | -| `card_type` | [`CardType`](../../doc/models/card-type.md) | Optional | (Optional, used only for Subscription Import) If you know the card type (i.e. Visa, MC, etc) you may supply it here so that we may display the card type in the UI. | +| `full_number` | `String` | Optional | The full credit card number (string representation, e.g., 5424000000000015) | +| `card_type` | [`CardType`](../../doc/models/card-type.md) | Optional | (Optional, used only for Subscription Import) If you know the card type (e.g., Visa, MC, etc.) you may supply it here so that we may display the card type in the UI. | | `expiration_month` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `expiration_year` | Integer \| String \| nil | Optional | This is a container for one-of cases. | -| `billing_address` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | -| `billing_address_2` | `String` | Optional | (Optional) Second line of the customer’s billing address i.e. Apt. 100 | -| `billing_city` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | -| `billing_state` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `billing_country` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | -| `billing_zip` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | +| `billing_address` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. | +| `billing_address_2` | `String` | Optional | (Optional) Second line of the customer’s billing address, e.g., Apt. 100 | +| `billing_city` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. | +| `billing_state` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | +| `billing_country` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | +| `billing_zip` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. | | `current_vault` | [`AllVaults`](../../doc/models/all-vaults.md) | Optional | (Optional, used only for Subscription Import) The vault that stores the payment profile with the provided vault_token. | | `vault_token` | `String` | Optional | (Optional, used only for Subscription Import) The “token” provided by your vault storage for an already stored payment profile | | `customer_vault_token` | `String` | Optional | (Optional, used only for Subscription Import) (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | @@ -35,17 +35,17 @@ alias to credit_card_attributes | `payment_method_nonce` | `String` | Optional | (Required for Square unless importing with vault_token and customer_vault_token) The nonce generated by the Square Javascript library (SqPaymentForm) | | `gateway_handle` | `String` | Optional | (Optional) This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. | | `cvv` | `String` | Optional | (Optional, may be required by your gateway settings) The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | -| `last_four` | `String` | Optional | (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (i.e. XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net. | - -## Example (as JSON) - -```json -{ - "chargify_token": "chargify_token8", - "id": 80, - "payment_type": "credit_card", - "first_name": "first_name0", - "last_name": "last_name8" -} +| `last_four` | `String` | Optional | (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (e.g., XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net. | + +## Example + +```ruby +payment_profile_attributes = PaymentProfileAttributes.new( + chargify_token: 'chargify_token4', + id: 102, + payment_type: PaymentType::PAYPAL_ACCOUNT, + first_name: 'first_name6', + last_name: 'last_name4' +) ``` diff --git a/doc/models/payment-profile-params.md b/doc/models/payment-profile-params.md index 1fe97b6..f935fba 100644 --- a/doc/models/payment-profile-params.md +++ b/doc/models/payment-profile-params.md @@ -15,13 +15,13 @@ PCI-safe cardholder fields only. Full card numbers, CVV, and billing address are | `last_name` | `String` | Optional | - | | `card_type` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "card_type8" -} +## Example + +```ruby +payment_profile_params = PaymentProfileParams.new( + first_name: 'first_name2', + last_name: 'last_name0', + card_type: 'card_type2' +) ``` diff --git a/doc/models/payment-profile-response.md b/doc/models/payment-profile-response.md index 8a552ce..2a81b9c 100644 --- a/doc/models/payment-profile-response.md +++ b/doc/models/payment-profile-response.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `payment_profile` | [ApplePay Payment Profile](../../doc/models/apple-pay-payment-profile.md) \| [Bank Account Payment Profile](../../doc/models/bank-account-payment-profile.md) \| [Credit Card Payment Profile](../../doc/models/credit-card-payment-profile.md) \| [Paypal Payment Profile](../../doc/models/paypal-payment-profile.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "payment_type": "apple_pay", - "id": 60, - "first_name": "first_name2", - "last_name": "last_name0", - "customer_id": 98, - "current_vault": "braintree_blue" - } -} +## Example + +```ruby +payment_profile_response = PaymentProfileResponse.new( + payment_profile: ApplePayPaymentProfile.new( + payment_type: PaymentType::APPLE_PAY, + id: 60, + first_name: 'first_name2', + last_name: 'last_name0', + customer_id: 98, + current_vault: ApplePayVault::BRAINTREE_BLUE + ) +) ``` diff --git a/doc/models/payment-related-events.md b/doc/models/payment-related-events.md index c4060b3..fb432bb 100644 --- a/doc/models/payment-related-events.md +++ b/doc/models/payment-related-events.md @@ -12,12 +12,12 @@ | `product_id` | `Integer` | Required | - | | `account_transaction_id` | `Integer` | Required | - | -## Example (as JSON) +## Example -```json -{ - "product_id": 42, - "account_transaction_id": 58 -} +```ruby +payment_related_events = PaymentRelatedEvents.new( + product_id: 208, + account_transaction_id: 52 +) ``` diff --git a/doc/models/payment-type.md b/doc/models/payment-type.md index 44b7cba..5b1d283 100644 --- a/doc/models/payment-type.md +++ b/doc/models/payment-type.md @@ -14,3 +14,9 @@ | `PAYPAL_ACCOUNT` | | `APPLE_PAY` | +## Example + +```ruby +payment_type = PaymentType::CREDIT_CARD +``` + diff --git a/doc/models/paypal-payment-profile.md b/doc/models/paypal-payment-profile.md index d9d0abd..7db7ea0 100644 --- a/doc/models/paypal-payment-profile.md +++ b/doc/models/paypal-payment-profile.md @@ -29,16 +29,16 @@ | `created_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was created | | `updated_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was last updated | -## Example (as JSON) - -```json -{ - "payment_type": "paypal_account", - "id": 10, - "first_name": "first_name0", - "last_name": "last_name8", - "customer_id": 48, - "current_vault": "moduslink" -} +## Example + +```ruby +paypal_payment_profile = PaypalPaymentProfile.new( + payment_type: PaymentType::PAYPAL_ACCOUNT, + id: 182, + first_name: 'first_name4', + last_name: 'last_name2', + customer_id: 220, + current_vault: PayPalVault::MODUSLINK +) ``` diff --git a/doc/models/pending-cancellation-change.md b/doc/models/pending-cancellation-change.md index 125ccf5..b40c18d 100644 --- a/doc/models/pending-cancellation-change.md +++ b/doc/models/pending-cancellation-change.md @@ -12,12 +12,12 @@ | `cancellation_state` | `String` | Required | - | | `cancels_at` | `DateTime` | Required | - | -## Example (as JSON) +## Example -```json -{ - "cancellation_state": "cancellation_state8", - "cancels_at": "2016-03-13T12:52:32.123Z" -} +```ruby +pending_cancellation_change = PendingCancellationChange.new( + cancellation_state: 'cancellation_state2', + cancels_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/portal-management-link.md b/doc/models/portal-management-link.md index 656e506..42650ac 100644 --- a/doc/models/portal-management-link.md +++ b/doc/models/portal-management-link.md @@ -16,15 +16,15 @@ | `expires_at` | `DateTime` | Optional | - | | `last_invite_sent_at` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "url": "url0", - "fetch_count": 222, - "created_at": "2016-03-13T12:52:32.123Z", - "new_link_available_at": "2016-03-13T12:52:32.123Z", - "expires_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +portal_management_link = PortalManagementLink.new( + url: 'url0', + fetch_count: 46, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + new_link_available_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + expires_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/prepaid-configuration-response.md b/doc/models/prepaid-configuration-response.md index 708062b..9e635d7 100644 --- a/doc/models/prepaid-configuration-response.md +++ b/doc/models/prepaid-configuration-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `prepaid_configuration` | [`PrepaidConfiguration`](../../doc/models/prepaid-configuration.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepaid_configuration": { - "id": 142, - "initial_funding_amount_in_cents": 74, - "replenish_to_amount_in_cents": 76, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 20 - } -} +## Example + +```ruby +prepaid_configuration_response = PrepaidConfigurationResponse.new( + prepaid_configuration: PrepaidConfiguration.new( + id: 142, + initial_funding_amount_in_cents: 74, + replenish_to_amount_in_cents: 76, + auto_replenish: false, + replenish_threshold_amount_in_cents: 20 + ) +) ``` diff --git a/doc/models/prepaid-configuration.md b/doc/models/prepaid-configuration.md index 6bab807..0ea9eae 100644 --- a/doc/models/prepaid-configuration.md +++ b/doc/models/prepaid-configuration.md @@ -15,15 +15,15 @@ | `auto_replenish` | `TrueClass \| FalseClass` | Optional | - | | `replenish_threshold_amount_in_cents` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 156, - "initial_funding_amount_in_cents": 88, - "replenish_to_amount_in_cents": 166, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 222 -} +## Example + +```ruby +prepaid_configuration = PrepaidConfiguration.new( + id: 142, + initial_funding_amount_in_cents: 74, + replenish_to_amount_in_cents: 76, + auto_replenish: false, + replenish_threshold_amount_in_cents: 20 +) ``` diff --git a/doc/models/prepaid-product-price-point-filter.md b/doc/models/prepaid-product-price-point-filter.md index 41f04c9..7307281 100644 --- a/doc/models/prepaid-product-price-point-filter.md +++ b/doc/models/prepaid-product-price-point-filter.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `product_price_point_id` | `String` | Required, Constant | Passed as a parameter to list methods to return only non null values.

**Value**: `'not_null'` | -## Example (as JSON) +## Example -```json -{ - "product_price_point_id": "not_null" -} +```ruby +prepaid_product_price_point_filter = PrepaidProductPricePointFilter.new( + product_price_point_id: 'not_null' +) ``` diff --git a/doc/models/prepaid-subscription-balance-changed.md b/doc/models/prepaid-subscription-balance-changed.md index 222c9b3..083fda1 100644 --- a/doc/models/prepaid-subscription-balance-changed.md +++ b/doc/models/prepaid-subscription-balance-changed.md @@ -14,14 +14,14 @@ | `prepayment_account_balance_in_cents` | `Integer` | Required | - | | `current_usage_amount_in_cents` | `Integer` | Required | - | -## Example (as JSON) - -```json -{ - "reason": "reason8", - "current_account_balance_in_cents": 250, - "prepayment_account_balance_in_cents": 44, - "current_usage_amount_in_cents": 242 -} +## Example + +```ruby +prepaid_subscription_balance_changed = PrepaidSubscriptionBalanceChanged.new( + reason: 'reason4', + current_account_balance_in_cents: 24, + prepayment_account_balance_in_cents: 242, + current_usage_amount_in_cents: 16 +) ``` diff --git a/doc/models/prepaid-usage-allocation-detail.md b/doc/models/prepaid-usage-allocation-detail.md index 15eaa4f..3986a34 100644 --- a/doc/models/prepaid-usage-allocation-detail.md +++ b/doc/models/prepaid-usage-allocation-detail.md @@ -13,13 +13,13 @@ | `charge_id` | `Integer` | Optional | - | | `usage_quantity` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "allocation_id": 72, - "charge_id": 30, - "usage_quantity": 212 -} +## Example + +```ruby +prepaid_usage_allocation_detail = PrepaidUsageAllocationDetail.new( + allocation_id: 18, + charge_id: 84, + usage_quantity: 10 +) ``` diff --git a/doc/models/prepaid-usage-component.md b/doc/models/prepaid-usage-component.md index 57cd75b..ac75dbc 100644 --- a/doc/models/prepaid-usage-component.md +++ b/doc/models/prepaid-usage-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `unit_name` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | +| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | +| `unit_name` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 messages” on a subscription’s component line-item | | `description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is taxable or not. | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array[Price]`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | @@ -23,47 +23,43 @@ | `tax_code` | `String` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | | `hide_date_range_on_invoice` | `TrueClass \| FalseClass` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | | `overage_pricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Required | - | -| `rollover_prepaid_remainder` | `TrueClass \| FalseClass` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period | -| `renew_prepaid_allocation` | `TrueClass \| FalseClass` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | +| `rollover_prepaid_remainder` | `TrueClass \| FalseClass` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period. | +| `renew_prepaid_allocation` | `TrueClass \| FalseClass` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period. | | `expiration_interval` | `Float` | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | - | | `display_on_hosted_page` | `TrueClass \| FalseClass` | Optional | - | | `allow_fractional_quantities` | `TrueClass \| FalseClass` | Optional | - | | `public_signup_page_ids` | `Array[Integer]` | Optional | - | +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | -## Example (as JSON) +## Example -```json -{ - "name": "name2", - "unit_name": "unit_name4", - "description": "description8", - "handle": "handle8", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "upgrade_charge": "prorated", - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +```ruby +prepaid_usage_component = PrepaidUsageComponent.new( + name: 'name2', + unit_name: 'unit_name4', + pricing_scheme: PricingScheme::PER_UNIT, + overage_pricing: OveragePricing.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ] - } -} + ), + description: 'description2', + handle: 'handle8', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + upgrade_charge: CreditType::FULL +) ``` diff --git a/doc/models/prepaid-usage.md b/doc/models/prepaid-usage.md index f3af4fd..7181867 100644 --- a/doc/models/prepaid-usage.md +++ b/doc/models/prepaid-usage.md @@ -11,8 +11,8 @@ | --- | --- | --- | --- | | `previous_unit_balance` | `String` | Required | **Constraints**: *Minimum Length*: `1` | | `previous_overage_unit_balance` | `String` | Required | **Constraints**: *Minimum Length*: `1` | -| `new_unit_balance` | `Integer` | Required | - | -| `new_overage_unit_balance` | `Integer` | Required | - | +| `new_unit_balance` | Integer \| String | Required | This is a container for one-of cases. | +| `new_overage_unit_balance` | Integer \| String | Required | This is a container for one-of cases. | | `usage_quantity` | `Integer` | Required | - | | `overage_usage_quantity` | `Integer` | Required | - | | `component_id` | `Integer` | Required | - | @@ -20,26 +20,26 @@ | `memo` | `String` | Required | - | | `allocation_details` | [`Array[PrepaidUsageAllocationDetail]`](../../doc/models/prepaid-usage-allocation-detail.md) | Required | - | -## Example (as JSON) - -```json -{ - "previous_unit_balance": "previous_unit_balance0", - "previous_overage_unit_balance": "previous_overage_unit_balance4", - "new_unit_balance": 252, - "new_overage_unit_balance": 224, - "usage_quantity": 214, - "overage_usage_quantity": 106, - "component_id": 176, - "component_handle": "component_handle4", - "memo": "memo8", - "allocation_details": [ - { - "allocation_id": 18, - "charge_id": 84, - "usage_quantity": 10 - } +## Example + +```ruby +prepaid_usage = PrepaidUsage.new( + previous_unit_balance: 'previous_unit_balance2', + previous_overage_unit_balance: 'previous_overage_unit_balance2', + new_unit_balance: 180, + new_overage_unit_balance: 204, + usage_quantity: 220, + overage_usage_quantity: 144, + component_id: 182, + component_handle: 'component_handle2', + memo: 'memo6', + allocation_details: [ + PrepaidUsageAllocationDetail.new( + allocation_id: 18, + charge_id: 84, + usage_quantity: 10 + ) ] -} +) ``` diff --git a/doc/models/prepayment-account-balance-changed.md b/doc/models/prepayment-account-balance-changed.md index 52c2e30..a129a35 100644 --- a/doc/models/prepayment-account-balance-changed.md +++ b/doc/models/prepayment-account-balance-changed.md @@ -14,14 +14,14 @@ | `prepayment_balance_change_in_cents` | `Integer` | Required | - | | `currency_code` | `String` | Required | - | -## Example (as JSON) - -```json -{ - "reason": "reason4", - "prepayment_account_balance_in_cents": 182, - "prepayment_balance_change_in_cents": 206, - "currency_code": "currency_code4" -} +## Example + +```ruby +prepayment_account_balance_changed = PrepaymentAccountBalanceChanged.new( + reason: 'reason8', + prepayment_account_balance_in_cents: 6, + prepayment_balance_change_in_cents: 18, + currency_code: 'currency_code2' +) ``` diff --git a/doc/models/prepayment-method.md b/doc/models/prepayment-method.md index adbddd8..e58fe8d 100644 --- a/doc/models/prepayment-method.md +++ b/doc/models/prepayment-method.md @@ -17,3 +17,9 @@ | `CREDIT_CARD` | | `OTHER` | +## Example + +```ruby +prepayment_method = PrepaymentMethod::CASH +``` + diff --git a/doc/models/prepayment-response.md b/doc/models/prepayment-response.md index f0b045a..89c5b8f 100644 --- a/doc/models/prepayment-response.md +++ b/doc/models/prepayment-response.md @@ -11,22 +11,22 @@ | --- | --- | --- | --- | | `prepayment` | [`Prepayment`](../../doc/models/prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayment": { - "id": 38, - "subscription_id": 148, - "amount_in_cents": 124, - "remaining_amount_in_cents": 182, - "refunded_amount_in_cents": 132, - "details": "details8", - "external": false, - "memo": "memo2", - "payment_type": "credit_card", - "created_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +prepayment_response = PrepaymentResponse.new( + prepayment: Prepayment.new( + id: 38, + subscription_id: 148, + amount_in_cents: 124, + remaining_amount_in_cents: 182, + external: false, + memo: 'memo2', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refunded_amount_in_cents: 132, + details: 'details8', + payment_type: PrepaymentMethod::CREDIT_CARD + ) +) ``` diff --git a/doc/models/prepayment.md b/doc/models/prepayment.md index 570ecb5..1f86ec2 100644 --- a/doc/models/prepayment.md +++ b/doc/models/prepayment.md @@ -20,20 +20,20 @@ | `payment_type` | [`PrepaymentMethod`](../../doc/models/prepayment-method.md) | Optional | The payment type of the prepayment. | | `created_at` | `DateTime` | Required | - | -## Example (as JSON) - -```json -{ - "id": 50, - "subscription_id": 160, - "amount_in_cents": 120, - "remaining_amount_in_cents": 194, - "refunded_amount_in_cents": 144, - "details": "details4", - "external": false, - "memo": "memo8", - "payment_type": "cash", - "created_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +prepayment = Prepayment.new( + id: 38, + subscription_id: 148, + amount_in_cents: 124, + remaining_amount_in_cents: 182, + external: false, + memo: 'memo2', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refunded_amount_in_cents: 132, + details: 'details8', + payment_type: PrepaymentMethod::CREDIT_CARD +) ``` diff --git a/doc/models/prepayments-response.md b/doc/models/prepayments-response.md index ca4ad48..37cab90 100644 --- a/doc/models/prepayments-response.md +++ b/doc/models/prepayments-response.md @@ -11,36 +11,48 @@ | --- | --- | --- | --- | | `prepayments` | [`Array[Prepayment]`](../../doc/models/prepayment.md) | Optional | **Constraints**: *Unique Items Required* | -## Example (as JSON) - -```json -{ - "prepayments": [ - { - "id": 76, - "subscription_id": 186, - "amount_in_cents": 94, - "remaining_amount_in_cents": 220, - "refunded_amount_in_cents": 170, - "details": "details6", - "external": false, - "memo": "memo0", - "payment_type": "cash", - "created_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": 76, - "subscription_id": 186, - "amount_in_cents": 94, - "remaining_amount_in_cents": 220, - "refunded_amount_in_cents": 170, - "details": "details6", - "external": false, - "memo": "memo0", - "payment_type": "cash", - "created_at": "2016-03-13T12:52:32.123Z" - } +## Example + +```ruby +prepayments_response = PrepaymentsResponse.new( + prepayments: [ + Prepayment.new( + id: 76, + subscription_id: 186, + amount_in_cents: 94, + remaining_amount_in_cents: 220, + external: false, + memo: 'memo0', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refunded_amount_in_cents: 170, + details: 'details6', + payment_type: PrepaymentMethod::CASH + ), + Prepayment.new( + id: 76, + subscription_id: 186, + amount_in_cents: 94, + remaining_amount_in_cents: 220, + external: false, + memo: 'memo0', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refunded_amount_in_cents: 170, + details: 'details6', + payment_type: PrepaymentMethod::CASH + ), + Prepayment.new( + id: 76, + subscription_id: 186, + amount_in_cents: 94, + remaining_amount_in_cents: 220, + external: false, + memo: 'memo0', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refunded_amount_in_cents: 170, + details: 'details6', + payment_type: PrepaymentMethod::CASH + ) ] -} +) ``` diff --git a/doc/models/preview-allocations-request.md b/doc/models/preview-allocations-request.md index 3aec22f..0fc4623 100644 --- a/doc/models/preview-allocations-request.md +++ b/doc/models/preview-allocations-request.md @@ -14,23 +14,23 @@ | `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | | `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | -## Example (as JSON) - -```json -{ - "allocations": [ - { - "quantity": 26.48, - "decimal_quantity": "decimal_quantity8", - "previous_quantity": 55.5, - "decimal_previous_quantity": "decimal_previous_quantity2", - "component_id": 242, - "memo": "memo6" - } +## Example + +```ruby +preview_allocations_request = PreviewAllocationsRequest.new( + allocations: [ + CreateAllocation.new( + quantity: 26.48, + decimal_quantity: 'decimal_quantity8', + previous_quantity: 55.5, + decimal_previous_quantity: 'decimal_previous_quantity2', + component_id: 242, + memo: 'memo6' + ) ], - "effective_proration_date": "2023-12-01", - "upgrade_charge": "none", - "downgrade_credit": "prorated" -} + effective_proration_date: Date.iso8601('2023-12-01'), + upgrade_charge: CreditType::FULL, + downgrade_credit: CreditType::FULL +) ``` diff --git a/doc/models/price-point-type.md b/doc/models/price-point-type.md index c6155a3..54dafd9 100644 --- a/doc/models/price-point-type.md +++ b/doc/models/price-point-type.md @@ -19,3 +19,9 @@ Price point type. We expose the following types: | `DEFAULT` | | `CUSTOM` | +## Example + +```ruby +price_point_type = PricePointType::CUSTOM +``` + diff --git a/doc/models/price.md b/doc/models/price.md index 5a1133b..2e266b3 100644 --- a/doc/models/price.md +++ b/doc/models/price.md @@ -13,13 +13,13 @@ | `ending_quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `unit_price` | Float \| String | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "starting_quantity": 40, - "ending_quantity": 14, - "unit_price": 125.12 -} +## Example + +```ruby +price = Price.new( + starting_quantity: 132, + unit_price: 70.44, + ending_quantity: 6 +) ``` diff --git a/doc/models/pricing-scheme.md b/doc/models/pricing-scheme.md index 6be09a7..e09f910 100644 --- a/doc/models/pricing-scheme.md +++ b/doc/models/pricing-scheme.md @@ -16,3 +16,9 @@ The identifier for the pricing scheme. See [Product Components](https://help.cha | `PER_UNIT` | | `TIERED` | +## Example + +```ruby +pricing_scheme = PricingScheme::PER_UNIT +``` + diff --git a/doc/models/product-family-response.md b/doc/models/product-family-response.md index e90f043..5192b3d 100644 --- a/doc/models/product-family-response.md +++ b/doc/models/product-family-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `product_family` | [`ProductFamily`](../../doc/models/product-family.md) | Optional | - | -## Example (as JSON) - -```json -{ - "product_family": { - "id": 14, - "name": "name0", - "handle": "handle6", - "accounting_code": "accounting_code6", - "description": "description0" - } -} +## Example + +```ruby +product_family_response = ProductFamilyResponse.new( + product_family: ProductFamily.new( + id: 14, + name: 'name0', + handle: 'handle6', + accounting_code: 'accounting_code6', + description: 'description0' + ) +) ``` diff --git a/doc/models/product-family.md b/doc/models/product-family.md index e04a0b0..9afa284 100644 --- a/doc/models/product-family.md +++ b/doc/models/product-family.md @@ -14,19 +14,20 @@ | `handle` | `String` | Optional | - | | `accounting_code` | `String` | Optional | - | | `description` | `String` | Optional | - | +| `surcharging` | `TrueClass \| FalseClass` | Optional | Whether surcharging applies to this product family. Only included on sites where surcharging is enabled. | | `created_at` | `DateTime` | Optional | - | | `updated_at` | `DateTime` | Optional | - | | `archived_at` | `DateTime` | Optional | Timestamp indicating when this product family was archived. `null` if the product family is not archived. | -## Example (as JSON) +## Example -```json -{ - "id": 194, - "name": "name2", - "handle": "handle8", - "accounting_code": "accounting_code8", - "description": "description8" -} +```ruby +product_family = ProductFamily.new( + id: 14, + name: 'name0', + handle: 'handle6', + accounting_code: 'accounting_code6', + description: 'description0' +) ``` diff --git a/doc/models/product-price-point-error-response-exception.md b/doc/models/product-price-point-error-response-exception.md index e7a5745..9ef6c75 100644 --- a/doc/models/product-price-point-error-response-exception.md +++ b/doc/models/product-price-point-error-response-exception.md @@ -11,31 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`ProductPricePointErrors`](../../doc/models/product-price-point-errors.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "price_point": "can't be blank", - "interval": [ - "Recurring Interval: cannot be blank.", - "Recurring Interval: must be greater than or equal to 1." - ], - "interval_unit": [ - "Interval unit: cannot be blank.", - "Interval unit: must be 'month' or 'day'." - ], - "name": [ - "Name: cannot be blank." - ], - "price": [ - "Price: is not a number.", - "Price: must be greater than or equal to 0." - ], - "price_in_cents": [ - "Price in cents: cannot be blank." - ] - } -} +## Example + +```ruby +begin + # make the API call +rescue ProductPricePointErrorResponseException => e + puts "Caught ProductPricePointErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/product-price-point-errors.md b/doc/models/product-price-point-errors.md index 8bf1c31..10ad1d5 100644 --- a/doc/models/product-price-point-errors.md +++ b/doc/models/product-price-point-errors.md @@ -16,29 +16,29 @@ | `price` | `Array[String]` | Optional | - | | `price_in_cents` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "price_point": "can't be blank", - "interval": [ - "Recurring Interval: cannot be blank.", - "Recurring Interval: must be greater than or equal to 1." +## Example + +```ruby +product_price_point_errors = ProductPricePointErrors.new( + price_point: 'can\'t be blank', + interval: [ + 'Recurring Interval: cannot be blank.', + 'Recurring Interval: must be greater than or equal to 1.' ], - "interval_unit": [ - "Interval unit: cannot be blank.", - "Interval unit: must be 'month' or 'day'." + interval_unit: [ + 'Interval unit: cannot be blank.', + 'Interval unit: must be \'month\' or \'day\'.' ], - "name": [ - "Name: cannot be blank." + name: [ + 'Name: cannot be blank.' ], - "price": [ - "Price: is not a number.", - "Price: must be greater than or equal to 0." + price: [ + 'Price: is not a number.', + 'Price: must be greater than or equal to 0.' ], - "price_in_cents": [ - "Price in cents: cannot be blank." + price_in_cents: [ + 'Price in cents: cannot be blank.' ] -} +) ``` diff --git a/doc/models/product-price-point-response.md b/doc/models/product-price-point-response.md index 33f69f3..bb61c19 100644 --- a/doc/models/product-price-point-response.md +++ b/doc/models/product-price-point-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `price_point` | [`ProductPricePoint`](../../doc/models/product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "id": 248, - "name": "name0", - "handle": "handle6", - "price_in_cents": 196, - "interval": 44 - } -} +## Example + +```ruby +product_price_point_response = ProductPricePointResponse.new( + price_point: ProductPricePoint.new( + id: 248, + name: 'name0', + handle: 'handle6', + price_in_cents: 196, + interval: 44 + ) +) ``` diff --git a/doc/models/product-price-point.md b/doc/models/product-price-point.md index 2709500..60601f9 100644 --- a/doc/models/product-price-point.md +++ b/doc/models/product-price-point.md @@ -13,16 +13,16 @@ | `name` | `String` | Optional | The product price point name | | `handle` | `String` | Optional | The product price point API handle | | `price_in_cents` | `Integer` | Optional | The product price point price, in integer cents | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this product price point, either month or day | | `trial_price_in_cents` | `Integer` | Optional | The product price point trial price, in integer cents | -| `trial_interval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days | +| `trial_interval` | `Integer` | Optional | The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | | `trial_interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | -| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | +| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | | `introductory_offer` | `TrueClass \| FalseClass` | Optional | reserved for future use | | `initial_charge_in_cents` | `Integer` | Optional | The product price point initial charge, in integer cents | | `initial_charge_after_trial` | `TrueClass \| FalseClass` | Optional | - | -| `expiration_interval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days | +| `expiration_interval` | `Integer` | Optional | The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month, day or never | | `product_id` | `Integer` | Optional | The product id this price point belongs to | | `archived_at` | `DateTime` | Optional | Timestamp indicating when this price point was archived | @@ -34,15 +34,15 @@ | `subscription_id` | `Integer` | Optional | The subscription id this price point belongs to | | `currency_prices` | [`Array[CurrencyPrice]`](../../doc/models/currency-price.md) | Optional | An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. | -## Example (as JSON) +## Example -```json -{ - "id": 196, - "name": "name6", - "handle": "handle2", - "price_in_cents": 248, - "interval": 8 -} +```ruby +product_price_point = ProductPricePoint.new( + id: 84, + name: 'name8', + handle: 'handle4', + price_in_cents: 152, + interval: 136 +) ``` diff --git a/doc/models/product-response.md b/doc/models/product-response.md index a0e513e..3172fa5 100644 --- a/doc/models/product-response.md +++ b/doc/models/product-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `product` | [`Product`](../../doc/models/product.md) | Required | - | -## Example (as JSON) - -```json -{ - "product": { - "id": 134, - "name": "name0", - "handle": "handle6", - "description": "description0", - "accounting_code": "accounting_code6" - } -} +## Example + +```ruby +product_response = ProductResponse.new( + product: Product.new( + id: 134, + name: 'name0', + handle: 'handle6', + description: 'description0', + accounting_code: 'accounting_code6' + ) +) ``` diff --git a/doc/models/product.md b/doc/models/product.md index b1a0ce4..f1f572d 100644 --- a/doc/models/product.md +++ b/doc/models/product.md @@ -13,18 +13,18 @@ | `name` | `String` | Optional | The product name | | `handle` | `String` | Optional | The product API handle | | `description` | `String` | Optional | The product description | -| `accounting_code` | `String` | Optional | E.g. Internal ID or SKU Number | +| `accounting_code` | `String` | Optional | E.g., Internal ID or SKU Number | | `request_credit_card` | `TrueClass \| FalseClass` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, read this attribute from under the signup page. | -| `expiration_interval` | `Integer` | Optional | A numerical interval for the length a subscription to this product will run before it expires. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval | +| `expiration_interval` | `Integer` | Optional | A numerical interval for the length a subscription to this product will run before it expires. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product, either month, day or never | | `created_at` | `DateTime` | Optional | Timestamp indicating when this product was created | | `updated_at` | `DateTime` | Optional | Timestamp indicating when this product was last updated | | `price_in_cents` | `Integer` | Optional | The product price, in integer cents | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this product, either month or day | | `initial_charge_in_cents` | `Integer` | Optional | The up front charge you have specified. | | `trial_price_in_cents` | `Integer` | Optional | The price of the trial period for a subscription to this product, in integer cents. | -| `trial_interval` | `Integer` | Optional | A numerical interval for the length of the trial period of a subscription to this product. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval | +| `trial_interval` | `Integer` | Optional | A numerical interval for the length of the trial period of a subscription to this product. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval. | | `trial_interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | | `archived_at` | `DateTime` | Optional | Timestamp indicating when this product was archived | | `require_credit_card` | `TrueClass \| FalseClass` | Optional | Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product. | @@ -33,7 +33,7 @@ | `update_return_url` | `String` | Optional | The url to which a customer will be returned after a successful account update | | `initial_charge_after_trial` | `TrueClass \| FalseClass` | Optional | - | | `version_number` | `Integer` | Optional | The version of the product | -| `update_return_params` | `String` | Optional | The parameters will append to the url after a successful account update. See [help documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update) | +| `update_return_params` | `String` | Optional | The parameters will append to the url after a successful account update. See [help documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update). | | `product_family` | [`ProductFamily`](../../doc/models/product-family.md) | Optional | - | | `public_signup_pages` | [`Array[PublicSignupPage]`](../../doc/models/public-signup-page.md) | Optional | - | | `product_price_point_name` | `String` | Optional | - | @@ -46,16 +46,17 @@ | `item_category` | `String` | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | | `product_price_point_id` | `Integer` | Optional | - | | `product_price_point_handle` | `String` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 180, - "name": "name4", - "handle": "handle0", - "description": "description4", - "accounting_code": "accounting_code0" -} +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this product instead of the default derived from item_category. | + +## Example + +```ruby +product = Product.new( + id: 134, + name: 'name0', + handle: 'handle6', + description: 'description0', + accounting_code: 'accounting_code6' +) ``` diff --git a/doc/models/proforma-bad-request-error-response-exception.md b/doc/models/proforma-bad-request-error-response-exception.md index e9549ff..76fa9a0 100644 --- a/doc/models/proforma-bad-request-error-response-exception.md +++ b/doc/models/proforma-bad-request-error-response-exception.md @@ -11,18 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`ProformaError`](../../doc/models/proforma-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "subscription": { - "base": [ - "base3", - "base4" - ] - } - } -} +## Example + +```ruby +begin + # make the API call +rescue ProformaBadRequestErrorResponseException => e + puts "Caught ProformaBadRequestErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/proforma-error.md b/doc/models/proforma-error.md index f9e1ef3..71f6e9d 100644 --- a/doc/models/proforma-error.md +++ b/doc/models/proforma-error.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `subscription` | [`BaseStringError`](../../doc/models/base-string-error.md) | Optional | The error is base if it is not directly associated with a single attribute. | -## Example (as JSON) - -```json -{ - "subscription": { - "base": [ - "base3", - "base4" +## Example + +```ruby +proforma_error = ProformaError.new( + subscription: BaseStringError.new( + base: [ + 'base3', + 'base4' ] - } -} + ) +) ``` diff --git a/doc/models/proforma-invoice-credit.md b/doc/models/proforma-invoice-credit.md index a5bb2b1..c33f4cf 100644 --- a/doc/models/proforma-invoice-credit.md +++ b/doc/models/proforma-invoice-credit.md @@ -14,14 +14,14 @@ | `original_amount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | | `applied_amount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "memo": "memo2", - "original_amount": "original_amount2", - "applied_amount": "applied_amount0" -} +## Example + +```ruby +proforma_invoice_credit = ProformaInvoiceCredit.new( + uid: 'uid0', + memo: 'memo4', + original_amount: 'original_amount4', + applied_amount: 'applied_amount8' +) ``` diff --git a/doc/models/proforma-invoice-discount-source-type.md b/doc/models/proforma-invoice-discount-source-type.md index 9ca7d08..501ee2f 100644 --- a/doc/models/proforma-invoice-discount-source-type.md +++ b/doc/models/proforma-invoice-discount-source-type.md @@ -12,3 +12,9 @@ | `COUPON` | | `REFERRAL` | +## Example + +```ruby +proforma_invoice_discount_source_type = ProformaInvoiceDiscountSourceType::COUPON +``` + diff --git a/doc/models/proforma-invoice-discount.md b/doc/models/proforma-invoice-discount.md index c24ab98..f8fd37e 100644 --- a/doc/models/proforma-invoice-discount.md +++ b/doc/models/proforma-invoice-discount.md @@ -18,15 +18,15 @@ | `discount_amount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | | `line_item_breakouts` | [`Array[InvoiceDiscountBreakout]`](../../doc/models/invoice-discount-breakout.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "title": "title8", - "code": "code0", - "source_type": "Coupon", - "discount_type": "percentage" -} +## Example + +```ruby +proforma_invoice_discount = ProformaInvoiceDiscount.new( + uid: 'uid0', + title: 'title6', + code: 'code8', + source_type: ProformaInvoiceDiscountSourceType::COUPON, + discount_type: InvoiceDiscountType::ROLLOVER +) ``` diff --git a/doc/models/proforma-invoice-issued.md b/doc/models/proforma-invoice-issued.md index 14490be..f6bcf5b 100644 --- a/doc/models/proforma-invoice-issued.md +++ b/doc/models/proforma-invoice-issued.md @@ -21,29 +21,29 @@ | `product_name` | `String` | Required | - | | `line_items` | [`Array[InvoiceLineItemEventData]`](../../doc/models/invoice-line-item-event-data.md) | Required | - | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "number": "number2", - "role": "role6", - "delivery_date": "2016-03-13", - "created_at": "2016-03-13T12:52:32.123Z", - "due_amount": "due_amount2", - "paid_amount": "paid_amount8", - "tax_amount": "tax_amount6", - "total_amount": "total_amount6", - "product_name": "product_name6", - "line_items": [ - { - "uid": "uid8", - "title": "title4", - "description": "description8", - "quantity": 102, - "quantity_delta": 204 - } +## Example + +```ruby +proforma_invoice_issued = ProformaInvoiceIssued.new( + uid: 'uid8', + number: 'number4', + role: 'role8', + delivery_date: Date.iso8601('2016-03-13'), + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + due_amount: 'due_amount0', + paid_amount: 'paid_amount0', + tax_amount: 'tax_amount8', + total_amount: 'total_amount4', + product_name: 'product_name4', + line_items: [ + InvoiceLineItemEventData.new( + uid: 'uid8', + title: 'title4', + description: 'description8', + quantity: 102, + quantity_delta: 204 + ) ] -} +) ``` diff --git a/doc/models/proforma-invoice-payment.md b/doc/models/proforma-invoice-payment.md index b44a2af..366767a 100644 --- a/doc/models/proforma-invoice-payment.md +++ b/doc/models/proforma-invoice-payment.md @@ -14,14 +14,14 @@ | `applied_amount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | | `prepayment` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "memo": "memo4", - "original_amount": "original_amount4", - "applied_amount": "applied_amount8", - "prepayment": false -} +## Example + +```ruby +proforma_invoice_payment = ProformaInvoicePayment.new( + memo: 'memo2', + original_amount: 'original_amount2', + applied_amount: 'applied_amount0', + prepayment: false +) ``` diff --git a/doc/models/proforma-invoice-role.md b/doc/models/proforma-invoice-role.md index 1ccf553..3228b31 100644 --- a/doc/models/proforma-invoice-role.md +++ b/doc/models/proforma-invoice-role.md @@ -1,7 +1,7 @@ # Proforma Invoice Role -'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic +'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic. ## Enumeration @@ -16,3 +16,9 @@ | `PROFORMA_ADHOC` | | `PROFORMA_AUTOMATIC` | +## Example + +```ruby +proforma_invoice_role = ProformaInvoiceRole::PROFORMA_ADHOC +``` + diff --git a/doc/models/proforma-invoice-status.md b/doc/models/proforma-invoice-status.md index 73e3dde..e836e85 100644 --- a/doc/models/proforma-invoice-status.md +++ b/doc/models/proforma-invoice-status.md @@ -13,3 +13,9 @@ | `VOIDED` | | `ARCHIVED` | +## Example + +```ruby +proforma_invoice_status = ProformaInvoiceStatus::VOIDED +``` + diff --git a/doc/models/proforma-invoice-tax-source-type.md b/doc/models/proforma-invoice-tax-source-type.md index fab176d..3fbd244 100644 --- a/doc/models/proforma-invoice-tax-source-type.md +++ b/doc/models/proforma-invoice-tax-source-type.md @@ -12,3 +12,9 @@ | `TAX` | | `AVALARA` | +## Example + +```ruby +proforma_invoice_tax_source_type = ProformaInvoiceTaxSourceType::TAX +``` + diff --git a/doc/models/proforma-invoice-tax.md b/doc/models/proforma-invoice-tax.md index 56d5501..e862d49 100644 --- a/doc/models/proforma-invoice-tax.md +++ b/doc/models/proforma-invoice-tax.md @@ -17,15 +17,15 @@ | `tax_amount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | | `line_item_breakouts` | [`Array[InvoiceTaxBreakout]`](../../doc/models/invoice-tax-breakout.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "title": "title4", - "source_type": "Tax", - "percentage": "percentage6", - "taxable_amount": "taxable_amount2" -} +## Example + +```ruby +proforma_invoice_tax = ProformaInvoiceTax.new( + uid: 'uid4', + title: 'title0', + source_type: ProformaInvoiceTaxSourceType::TAX, + percentage: 'percentage2', + taxable_amount: 'taxable_amount8' +) ``` diff --git a/doc/models/proforma-invoice.md b/doc/models/proforma-invoice.md index 3385016..ae2001c 100644 --- a/doc/models/proforma-invoice.md +++ b/doc/models/proforma-invoice.md @@ -21,12 +21,12 @@ | `collection_method` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | | `payment_instructions` | `String` | Optional | - | | `currency` | `String` | Optional | - | -| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | +| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | | `product_name` | `String` | Optional | - | | `product_family_name` | `String` | Optional | - | -| `role` | [`ProformaInvoiceRole`](../../doc/models/proforma-invoice-role.md) | Optional | 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic | +| `role` | [`ProformaInvoiceRole`](../../doc/models/proforma-invoice-role.md) | Optional | 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic. | | `seller` | [`InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | -| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | +| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient of the invoiced subscription. | | `memo` | `String` | Optional | - | | `billing_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | | `shipping_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | @@ -47,15 +47,15 @@ | `public_url` | `String` | Optional | - | | `available_actions` | [`AvailableActions`](../../doc/models/available-actions.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "uid": "uid6", - "site_id": 196, - "customer_id": 52, - "subscription_id": 124, - "number": 0 -} +```ruby +proforma_invoice = ProformaInvoice.new( + uid: 'uid2', + site_id: 240, + customer_id: 96, + subscription_id: 168, + number: 44 +) ``` diff --git a/doc/models/proration.md b/doc/models/proration.md index e6f115d..5061c31 100644 --- a/doc/models/proration.md +++ b/doc/models/proration.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `preserve_period` | `TrueClass \| FalseClass` | Optional | The alternative to sending preserve_period as a direct attribute to migration | -## Example (as JSON) +## Example -```json -{ - "preserve_period": false -} +```ruby +proration = Proration.new( + preserve_period: false +) ``` diff --git a/doc/models/public-key.md b/doc/models/public-key.md index bfeb870..713ddc0 100644 --- a/doc/models/public-key.md +++ b/doc/models/public-key.md @@ -13,13 +13,13 @@ | `requires_security_token` | `TrueClass \| FalseClass` | Optional | - | | `created_at` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +public_key = PublicKey.new( + public_key: 'public_key0', + requires_security_token: false, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/public-signup-page.md b/doc/models/public-signup-page.md index ed8a835..3bea243 100644 --- a/doc/models/public-signup-page.md +++ b/doc/models/public-signup-page.md @@ -10,18 +10,18 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `id` | `Integer` | Optional | The id of the signup page (public_signup_pages only) | -| `return_url` | `String` | Optional | The url to which a customer will be returned after a successful signup (public_signup_pages only) | +| `return_url` | `String` | Optional | The url to which a customer will be returned after a successful signup (public_signup_pages only). | | `return_params` | `String` | Optional | The params to be appended to the return_url (public_signup_pages only) | -| `url` | `String` | Optional | The url where the signup page can be viewed (public_signup_pages only) | +| `url` | `String` | Optional | The url where the signup page can be viewed (public_signup_pages only). | -## Example (as JSON) +## Example -```json -{ - "id": 6, - "return_url": "return_url0", - "return_params": "return_params2", - "url": "url8" -} +```ruby +public_signup_page = PublicSignupPage.new( + id: 196, + return_url: 'return_url2', + return_params: 'return_params4', + url: 'url0' +) ``` diff --git a/doc/models/q-scope.md b/doc/models/q-scope.md new file mode 100644 index 0000000..0d3c8ec --- /dev/null +++ b/doc/models/q-scope.md @@ -0,0 +1,25 @@ + +# Q Scope + +## Enumeration + +`QScope` + +## Fields + +| Name | +| --- | +| `FULL_NAME` | +| `FIRST_NAME` | +| `LAST_NAME` | +| `ORGANIZATION` | +| `CUSTOMER_REFERENCE` | +| `SUBSCRIPTION_REFERENCE` | +| `LAST_FOUR` | + +## Example + +```ruby +q_scope = QScope::SUBSCRIPTION_REFERENCE +``` + diff --git a/doc/models/quantity-based-component.md b/doc/models/quantity-based-component.md index f9fd4ca..ae6ba2c 100644 --- a/doc/models/quantity-based-component.md +++ b/doc/models/quantity-based-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `unit_name` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | +| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | +| `unit_name` | `String` | Required | “The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 messages” on a subscription’s component line-item.” | | `description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is taxable or not. | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array[Price]`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | @@ -26,27 +26,33 @@ | `display_on_hosted_page` | `TrueClass \| FalseClass` | Optional | - | | `allow_fractional_quantities` | `TrueClass \| FalseClass` | Optional | - | | `public_signup_page_ids` | `Array[Integer]` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component’s default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | - -## Example (as JSON) - -```json -{ - "name": "name8", - "unit_name": "unit_name0", - "description": "description8", - "handle": "handle4", - "taxable": false, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | + +## Example + +```ruby +quantity_based_component = QuantityBasedComponent.new( + name: 'name0', + unit_name: 'unit_name2', + pricing_scheme: PricingScheme::STAIRSTEP, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "upgrade_charge": "full" -} + upgrade_charge: CreditType::PRORATED +) ``` diff --git a/doc/models/reactivate-subscription-group-request.md b/doc/models/reactivate-subscription-group-request.md index abe55bf..87819b1 100644 --- a/doc/models/reactivate-subscription-group-request.md +++ b/doc/models/reactivate-subscription-group-request.md @@ -12,12 +12,12 @@ | `resume` | `TrueClass \| FalseClass` | Optional | - | | `resume_members` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "resume": false, - "resume_members": false -} +```ruby +reactivate_subscription_group_request = ReactivateSubscriptionGroupRequest.new( + resume: false, + resume_members: false +) ``` diff --git a/doc/models/reactivate-subscription-group-response.md b/doc/models/reactivate-subscription-group-response.md index 879ceed..d7fd8ce 100644 --- a/doc/models/reactivate-subscription-group-response.md +++ b/doc/models/reactivate-subscription-group-response.md @@ -19,18 +19,19 @@ | `state` | `String` | Optional | - | | `cancel_at_end_of_period` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "scheme": 66, - "customer_id": 86, - "payment_profile_id": 250, - "subscription_ids": [ - 196, - 197 +## Example + +```ruby +reactivate_subscription_group_response = ReactivateSubscriptionGroupResponse.new( + uid: 'uid8', + scheme: 220, + customer_id: 240, + payment_profile_id: 148, + subscription_ids: [ + 94, + 95, + 96 ] -} +) ``` diff --git a/doc/models/reactivate-subscription-request.md b/doc/models/reactivate-subscription-request.md index f07490c..04438f1 100644 --- a/doc/models/reactivate-subscription-request.md +++ b/doc/models/reactivate-subscription-request.md @@ -9,24 +9,24 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `calendar_billing` | [`ReactivationBilling`](../../doc/models/reactivation-billing.md) | Optional | These values are only applicable to subscriptions using calendar billing | +| `calendar_billing` | [`ReactivationBilling`](../../doc/models/reactivation-billing.md) | Optional | These values are only applicable to subscriptions using calendar billing. | | `include_trial` | `TrueClass \| FalseClass` | Optional | If `true` is sent, the reactivated Subscription will include a trial if one is available. If `false` is sent, the trial period will be ignored. | | `preserve_balance` | `TrueClass \| FalseClass` | Optional | If `true` is passed, the existing subscription balance will NOT be cleared/reset before adding the additional reactivation charges. | | `coupon_code` | `String` | Optional | The coupon code to be applied during reactivation. | | `use_credits_and_prepayments` | `TrueClass \| FalseClass` | Optional | If true is sent, Advanced Billing will use service credits and prepayments upon reactivation. If false is sent, the service credits and prepayments will be ignored. | | `resume` | TrueClass \| FalseClass \| [Resume Options](../../doc/models/resume-options.md) \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "calendar_billing": { - "reactivation_charge": "prorated" - }, - "include_trial": false, - "preserve_balance": false, - "coupon_code": "coupon_code6", - "use_credits_and_prepayments": false -} +## Example + +```ruby +reactivate_subscription_request = ReactivateSubscriptionRequest.new( + calendar_billing: ReactivationBilling.new( + reactivation_charge: ReactivationCharge::PRORATED + ), + include_trial: false, + preserve_balance: false, + coupon_code: 'coupon_code8', + use_credits_and_prepayments: false +) ``` diff --git a/doc/models/reactivation-billing.md b/doc/models/reactivation-billing.md index 79bb07c..be6c2d7 100644 --- a/doc/models/reactivation-billing.md +++ b/doc/models/reactivation-billing.md @@ -1,7 +1,7 @@ # Reactivation Billing -These values are only applicable to subscriptions using calendar billing +These values are only applicable to subscriptions using calendar billing. ## Structure @@ -11,13 +11,13 @@ These values are only applicable to subscriptions using calendar billing | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `reactivation_charge` | [`ReactivationCharge`](../../doc/models/reactivation-charge.md) | Optional | You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal

**Default**: `ReactivationCharge::PRORATED` | +| `reactivation_charge` | [`ReactivationCharge`](../../doc/models/reactivation-charge.md) | Optional | You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal.

**Default**: `ReactivationCharge::PRORATED` | -## Example (as JSON) +## Example -```json -{ - "reactivation_charge": "prorated" -} +```ruby +reactivation_billing = ReactivationBilling.new( + reactivation_charge: ReactivationCharge::PRORATED +) ``` diff --git a/doc/models/reactivation-charge.md b/doc/models/reactivation-charge.md index dbe0bc6..a7021fa 100644 --- a/doc/models/reactivation-charge.md +++ b/doc/models/reactivation-charge.md @@ -1,7 +1,7 @@ # Reactivation Charge -You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal +You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal. ## Enumeration @@ -15,3 +15,9 @@ You may choose how to handle the reactivation charge for that subscription: 1) ` | `IMMEDIATE` | | `DELAYED` | +## Example + +```ruby +reactivation_charge = ReactivationCharge::IMMEDIATE +``` + diff --git a/doc/models/reason-code-response.md b/doc/models/reason-code-response.md index defe592..ff2bba1 100644 --- a/doc/models/reason-code-response.md +++ b/doc/models/reason-code-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `reason_code` | [`ReasonCode`](../../doc/models/reason-code.md) | Required | - | -## Example (as JSON) - -```json -{ - "reason_code": { - "id": 240, - "site_id": 166, - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```ruby +reason_code_response = ReasonCodeResponse.new( + reason_code: ReasonCode.new( + id: 240, + site_id: 166, + code: 'code4', + description: 'description6', + position: 14 + ) +) ``` diff --git a/doc/models/reason-code.md b/doc/models/reason-code.md index 1fc73bb..1065d6a 100644 --- a/doc/models/reason-code.md +++ b/doc/models/reason-code.md @@ -17,15 +17,15 @@ | `created_at` | `DateTime` | Optional | - | | `updated_at` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 164, - "site_id": 90, - "code": "code0", - "description": "description2", - "position": 194 -} +## Example + +```ruby +reason_code = ReasonCode.new( + id: 240, + site_id: 166, + code: 'code4', + description: 'description6', + position: 14 +) ``` diff --git a/doc/models/record-payment-request.md b/doc/models/record-payment-request.md index 897dea4..344a49b 100644 --- a/doc/models/record-payment-request.md +++ b/doc/models/record-payment-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `payment` | [`CreatePayment`](../../doc/models/create-payment.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment": { - "amount": "amount8", - "memo": "memo0", - "payment_details": "payment_details6", - "payment_method": "cash" - } -} +## Example + +```ruby +record_payment_request = RecordPaymentRequest.new( + payment: CreatePayment.new( + amount: 'amount8', + memo: 'memo0', + payment_details: 'payment_details6', + payment_method: InvoicePaymentMethodType::CASH + ) +) ``` diff --git a/doc/models/record-payment-response.md b/doc/models/record-payment-response.md index 265ec52..b5a4e72 100644 --- a/doc/models/record-payment-response.md +++ b/doc/models/record-payment-response.md @@ -12,35 +12,23 @@ | `paid_invoices` | [`Array[PaidInvoice]`](../../doc/models/paid-invoice.md) | Optional | - | | `prepayment` | [`InvoicePrePayment`](../../doc/models/invoice-pre-payment.md) | Optional | - | -## Example (as JSON) - -```json -{ - "paid_invoices": [ - { - "invoice_id": "invoice_id8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" - }, - { - "invoice_id": "invoice_id8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" - }, - { - "invoice_id": "invoice_id8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" - } +## Example + +```ruby +record_payment_response = RecordPaymentResponse.new( + paid_invoices: [ + PaidInvoice.new( + invoice_id: 'invoice_id8', + status: InvoiceStatus::DRAFT, + due_amount: 'due_amount0', + paid_amount: 'paid_amount0' + ) ], - "prepayment": { - "subscription_id": 148, - "amount_in_cents": 124, - "ending_balance_in_cents": 164 - } -} + prepayment: InvoicePrePayment.new( + subscription_id: 148, + amount_in_cents: 124, + ending_balance_in_cents: 164 + ) +) ``` diff --git a/doc/models/recurring-scheme.md b/doc/models/recurring-scheme.md index 8e37821..58bcea1 100644 --- a/doc/models/recurring-scheme.md +++ b/doc/models/recurring-scheme.md @@ -13,3 +13,9 @@ | `RECUR_INDEFINITELY` | | `RECUR_WITH_DURATION` | +## Example + +```ruby +recurring_scheme = RecurringScheme::RECUR_WITH_DURATION +``` + diff --git a/doc/models/referral-code.md b/doc/models/referral-code.md index d8a4829..fcc0dfd 100644 --- a/doc/models/referral-code.md +++ b/doc/models/referral-code.md @@ -14,14 +14,14 @@ | `subscription_id` | `Integer` | Optional | - | | `code` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 42, - "site_id": 224, - "subscription_id": 152, - "code": "code6" -} +## Example + +```ruby +referral_code = ReferralCode.new( + id: 46, + site_id: 228, + subscription_id: 156, + code: 'code0' +) ``` diff --git a/doc/models/referral-validation-response.md b/doc/models/referral-validation-response.md index 7c5a83b..d71d284 100644 --- a/doc/models/referral-validation-response.md +++ b/doc/models/referral-validation-response.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `referral_code` | [`ReferralCode`](../../doc/models/referral-code.md) | Optional | - | -## Example (as JSON) - -```json -{ - "referral_code": { - "id": 46, - "site_id": 228, - "subscription_id": 156, - "code": "code0" - } -} +## Example + +```ruby +referral_validation_response = ReferralValidationResponse.new( + referral_code: ReferralCode.new( + id: 46, + site_id: 228, + subscription_id: 156, + code: 'code0' + ) +) ``` diff --git a/doc/models/refund-consolidated-invoice.md b/doc/models/refund-consolidated-invoice.md index 5292dbd..2301b02 100644 --- a/doc/models/refund-consolidated-invoice.md +++ b/doc/models/refund-consolidated-invoice.md @@ -1,7 +1,7 @@ # Refund Consolidated Invoice -Refund consolidated invoice +Refund consolidated invoice. ## Structure @@ -18,19 +18,20 @@ Refund consolidated invoice | `apply_credit` | `TrueClass \| FalseClass` | Optional | If set to true, creates credit and applies it to an invoice. Defaults to `false`. | | `amount` | `String` | Optional | The amount of payment to be refunded in decimal format. Example: "10.50". This will default to the full amount of the payment if not provided. | -## Example (as JSON) +## Example -```json -{ - "memo": "memo0", - "payment_id": 46, - "segment_uids": [ - "String0", - "String1" +```ruby +refund_consolidated_invoice = RefundConsolidatedInvoice.new( + memo: 'memo2', + payment_id: 66, + segment_uids: [ + 'String2', + 'String3', + 'String4' ], - "external": false, - "apply_credit": false, - "amount": "amount8" -} + external: false, + apply_credit: false, + amount: 'amount0' +) ``` diff --git a/doc/models/refund-invoice-event-data.md b/doc/models/refund-invoice-event-data.md index 134ead1..c3430e8 100644 --- a/doc/models/refund-invoice-event-data.md +++ b/doc/models/refund-invoice-event-data.md @@ -12,7 +12,7 @@ Example schema for an `refund_invoice` event | Name | Type | Tags | Description | | --- | --- | --- | --- | | `apply_credit` | `TrueClass \| FalseClass` | Required | If true, credit was created and applied it to the invoice. | -| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | +| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | | `credit_note_attributes` | [`CreditNote`](../../doc/models/credit-note.md) | Required | - | | `memo` | `String` | Optional | The refund memo. | | `original_amount` | `String` | Optional | The full, original amount of the refund. | @@ -21,25 +21,25 @@ Example schema for an `refund_invoice` event | `refund_id` | `Integer` | Required | The ID of the refund transaction. | | `transaction_time` | `DateTime` | Required | The time the refund was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | -## Example (as JSON) - -```json -{ - "apply_credit": false, - "consolidation_level": "parent", - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo0", - "original_amount": "original_amount0", - "payment_id": 114, - "refund_amount": "refund_amount8", - "refund_id": 158, - "transaction_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +refund_invoice_event_data = RefundInvoiceEventData.new( + apply_credit: false, + credit_note_attributes: CreditNote.new( + uid: 'uid2', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 'number0' + ), + payment_id: 150, + refund_amount: 'refund_amount0', + refund_id: 194, + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + consolidation_level: InvoiceConsolidationLevel::NONE, + memo: 'memo8', + original_amount: 'original_amount8' +) ``` diff --git a/doc/models/refund-invoice-event.md b/doc/models/refund-invoice-event.md index 9155cf2..2b7a6fe 100644 --- a/doc/models/refund-invoice-event.md +++ b/doc/models/refund-invoice-event.md @@ -15,41 +15,41 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::REFUND_INVOICE` | | `event_data` | [`RefundInvoiceEventData`](../../doc/models/refund-invoice-event-data.md) | Required | Example schema for an `refund_invoice` event | -## Example (as JSON) - -```json -{ - "id": 54, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "refund_invoice", - "event_data": { - "apply_credit": false, - "consolidation_level": "child", - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo0", - "original_amount": "original_amount0", - "payment_id": 204, - "refund_amount": "refund_amount8", - "refund_id": 248, - "transaction_time": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +refund_invoice_event = RefundInvoiceEvent.new( + id: 142, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::REFUND_INVOICE, + event_data: RefundInvoiceEventData.new( + apply_credit: false, + credit_note_attributes: CreditNote.new( + uid: 'uid2', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 'number0' + ), + payment_id: 204, + refund_amount: 'refund_amount8', + refund_id: 248, + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + consolidation_level: InvoiceConsolidationLevel::CHILD, + memo: 'memo0', + original_amount: 'original_amount0' + ) +) ``` diff --git a/doc/models/refund-invoice-request.md b/doc/models/refund-invoice-request.md index 6e45de3..60d6fe1 100644 --- a/doc/models/refund-invoice-request.md +++ b/doc/models/refund-invoice-request.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `refund` | [Refund Invoice](../../doc/models/refund-invoice.md) \| [Refund Consolidated Invoice](../../doc/models/refund-consolidated-invoice.md) | Required | This is a container for any-of cases. | -## Example (as JSON) - -```json -{ - "refund": { - "amount": "amount8", - "memo": "memo0", - "payment_id": 0, - "external": false, - "apply_credit": false, - "void_invoice": false - } -} +## Example + +```ruby +refund_invoice_request = RefundInvoiceRequest.new( + refund: RefundInvoice.new( + amount: 'amount8', + memo: 'memo0', + payment_id: 0, + external: false, + apply_credit: false, + void_invoice: false + ) +) ``` diff --git a/doc/models/refund-invoice.md b/doc/models/refund-invoice.md index 8abb7b9..467754d 100644 --- a/doc/models/refund-invoice.md +++ b/doc/models/refund-invoice.md @@ -16,18 +16,18 @@ Refund an invoice or a segment of a consolidated invoice. | `payment_id` | `Integer` | Required | The ID of the payment to be refunded | | `external` | `TrueClass \| FalseClass` | Optional | Flag that marks refund as external (no money is returned to the customer). Defaults to `false`. | | `apply_credit` | `TrueClass \| FalseClass` | Optional | If set to true, creates credit and applies it to an invoice. Defaults to `false`. | -| `void_invoice` | `TrueClass \| FalseClass` | Optional | If `apply_credit` set to false and refunding full amount, if `void_invoice` set to true, invoice will be voided after refund. Defaults to `false`. | - -## Example (as JSON) - -```json -{ - "amount": "amount8", - "memo": "memo0", - "payment_id": 0, - "external": false, - "apply_credit": false, - "void_invoice": false -} +| `void_invoice` | `TrueClass \| FalseClass` | Optional | If `apply_credit` is set to false and refunding full amount, if `void_invoice` is set to true, invoice will be voided after refund. Defaults to `false`. | + +## Example + +```ruby +refund_invoice = RefundInvoice.new( + amount: 'amount6', + memo: 'memo8', + payment_id: 74, + external: false, + apply_credit: false, + void_invoice: false +) ``` diff --git a/doc/models/refund-prepayment-base-errors-response-exception.md b/doc/models/refund-prepayment-base-errors-response-exception.md index fc66364..d834735 100644 --- a/doc/models/refund-prepayment-base-errors-response-exception.md +++ b/doc/models/refund-prepayment-base-errors-response-exception.md @@ -13,20 +13,13 @@ Errors returned on creating a refund prepayment when bad request | --- | --- | --- | --- | | `errors` | [`RefundPrepaymentBaseRefundError`](../../doc/models/refund-prepayment-base-refund-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "refund": { - "base": [ - { - "key1": "val1", - "key2": "val2" - } - ] - } - } -} +## Example + +```ruby +begin + # make the API call +rescue RefundPrepaymentBaseErrorsResponseException => e + puts "Caught RefundPrepaymentBaseErrorsResponseException: #{e.message}" +end ``` diff --git a/doc/models/refund-prepayment-base-refund-error.md b/doc/models/refund-prepayment-base-refund-error.md index cd1d729..51ba38f 100644 --- a/doc/models/refund-prepayment-base-refund-error.md +++ b/doc/models/refund-prepayment-base-refund-error.md @@ -11,18 +11,15 @@ | --- | --- | --- | --- | | `refund` | [`BaseRefundError`](../../doc/models/base-refund-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "refund": { - "base": [ - { - "key1": "val1", - "key2": "val2" - } +## Example + +```ruby +refund_prepayment_base_refund_error = RefundPrepaymentBaseRefundError.new( + refund: BaseRefundError.new( + base: [ + { 'key1' => 'val1', 'key2' => 'val2' } ] - } -} + ) +) ``` diff --git a/doc/models/refund-prepayment-request.md b/doc/models/refund-prepayment-request.md index 2d4ac5a..13fa192 100644 --- a/doc/models/refund-prepayment-request.md +++ b/doc/models/refund-prepayment-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `refund` | [`RefundPrepayment`](../../doc/models/refund-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "refund": { - "amount_in_cents": 132, - "amount": "String1", - "memo": "memo2", - "external": false - } -} +## Example + +```ruby +refund_prepayment_request = RefundPrepaymentRequest.new( + refund: RefundPrepayment.new( + amount_in_cents: 132, + amount: 'String1', + memo: 'memo2', + external: false + ) +) ``` diff --git a/doc/models/refund-prepayment.md b/doc/models/refund-prepayment.md index a30809f..957dddc 100644 --- a/doc/models/refund-prepayment.md +++ b/doc/models/refund-prepayment.md @@ -14,14 +14,14 @@ | `memo` | `String` | Required | **Constraints**: *Minimum Length*: `1` | | `external` | `TrueClass \| FalseClass` | Optional | Specify the type of refund you wish to initiate. When the prepayment is external, the `external` flag is optional. But if the prepayment was made through a payment profile, the `external` flag is required. | -## Example (as JSON) - -```json -{ - "amount_in_cents": 110, - "amount": "String3", - "memo": "memo4", - "external": false -} +## Example + +```ruby +refund_prepayment = RefundPrepayment.new( + amount_in_cents: 188, + amount: 'String7', + memo: 'memo8', + external: false +) ``` diff --git a/doc/models/refund-success.md b/doc/models/refund-success.md index 6611860..d4a877e 100644 --- a/doc/models/refund-success.md +++ b/doc/models/refund-success.md @@ -13,13 +13,13 @@ | `gateway_transaction_id` | `Integer` | Required | - | | `product_id` | `Integer` | Required | - | -## Example (as JSON) - -```json -{ - "refund_id": 12, - "gateway_transaction_id": 182, - "product_id": 168 -} +## Example + +```ruby +refund_success = RefundSuccess.new( + refund_id: 194, + gateway_transaction_id: 0, + product_id: 162 +) ``` diff --git a/doc/models/register.md b/doc/models/register.md index e7e9592..b00e6d1 100644 --- a/doc/models/register.md +++ b/doc/models/register.md @@ -12,16 +12,16 @@ | `id` | `Integer` | Optional | - | | `maxio_id` | `String` | Optional | - | | `name` | `String` | Optional | - | -| `currency_code` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | +| `currency_code` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of an invoice transaction. | -## Example (as JSON) +## Example -```json -{ - "id": 90, - "maxio_id": "maxio_id0", - "name": "name6", - "currency_code": "currency_code2" -} +```ruby +register = Register.new( + id: 54, + maxio_id: 'maxio_id4', + name: 'name2', + currency_code: 'currency_code2' +) ``` diff --git a/doc/models/remove-payment-event-data.md b/doc/models/remove-payment-event-data.md index 69c0236..4542da9 100644 --- a/doc/models/remove-payment-event-data.md +++ b/doc/models/remove-payment-event-data.md @@ -19,19 +19,19 @@ Example schema for an `remove_payment` event | `payment_method` | [Payment Method Apple Pay](../../doc/models/payment-method-apple-pay.md) \| [Payment Method Bank Account](../../doc/models/payment-method-bank-account.md) \| [Payment Method Credit Card](../../doc/models/payment-method-credit-card.md) \| [Payment Method External](../../doc/models/payment-method-external.md) \| [Payment Method Paypal](../../doc/models/payment-method-paypal.md) | Required | A nested data structure detailing the method of payment | | `prepayment` | `TrueClass \| FalseClass` | Required | The flag that shows whether the original payment was a prepayment or not | -## Example (as JSON) - -```json -{ - "transaction_id": 180, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" - }, - "prepayment": false, - "original_amount": "original_amount0" -} +## Example + +```ruby +remove_payment_event_data = RemovePaymentEventData.new( + transaction_id: 50, + memo: 'memo0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + payment_method: PaymentMethodApplePay.new( + type: InvoiceEventPaymentMethod::APPLE_PAY + ), + prepayment: false, + original_amount: 'original_amount0' +) ``` diff --git a/doc/models/remove-payment-event.md b/doc/models/remove-payment-event.md index 3974a68..2b2f576 100644 --- a/doc/models/remove-payment-event.md +++ b/doc/models/remove-payment-event.md @@ -15,35 +15,35 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::REMOVE_PAYMENT` | | `event_data` | [`RemovePaymentEventData`](../../doc/models/remove-payment-event-data.md) | Required | Example schema for an `remove_payment` event | -## Example (as JSON) - -```json -{ - "id": 236, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "remove_payment", - "event_data": { - "transaction_id": 78, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" - }, - "prepayment": false, - "original_amount": "original_amount0" - } -} +## Example + +```ruby +remove_payment_event = RemovePaymentEvent.new( + id: 4, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::REMOVE_PAYMENT, + event_data: RemovePaymentEventData.new( + transaction_id: 78, + memo: 'memo0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + payment_method: PaymentMethodApplePay.new( + type: InvoiceEventPaymentMethod::APPLE_PAY + ), + prepayment: false, + original_amount: 'original_amount0' + ) +) ``` diff --git a/doc/models/renewal-preview-component.md b/doc/models/renewal-preview-component.md index d726dab..256dc1b 100644 --- a/doc/models/renewal-preview-component.md +++ b/doc/models/renewal-preview-component.md @@ -13,13 +13,13 @@ | `quantity` | `Integer` | Optional | The quantity for which you wish to preview billing. This is useful if you want to preview a predicted, higher usage value than is currently present on the subscription.

This quantity represents:

- Whether or not an on/off component is enabled - use 0 for disabled or 1 for enabled
- The desired allocated_quantity for a quantity-based component
- The desired unit_balance for a metered component
- The desired metric quantity for an events-based component | | `price_point_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "component_id": "String7", - "quantity": 174, - "price_point_id": "String1" -} +## Example + +```ruby +renewal_preview_component = RenewalPreviewComponent.new( + component_id: 'String7', + quantity: 170, + price_point_id: 'String1' +) ``` diff --git a/doc/models/renewal-preview-line-item.md b/doc/models/renewal-preview-line-item.md index 64a66b9..3df2203 100644 --- a/doc/models/renewal-preview-line-item.md +++ b/doc/models/renewal-preview-line-item.md @@ -24,15 +24,15 @@ | `period_range_start` | `String` | Optional | - | | `period_range_end` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_type": "charge", - "kind": "prepaid_usage_component", - "amount_in_cents": 154, - "memo": "memo0", - "discount_amount_in_cents": 214 -} +## Example + +```ruby +renewal_preview_line_item = RenewalPreviewLineItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: LineItemKind::TRIAL, + amount_in_cents: 254, + memo: 'memo8', + discount_amount_in_cents: 194 +) ``` diff --git a/doc/models/renewal-preview-request.md b/doc/models/renewal-preview-request.md index 50307e7..be98dd9 100644 --- a/doc/models/renewal-preview-request.md +++ b/doc/models/renewal-preview-request.md @@ -9,29 +9,24 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `components` | [`Array[RenewalPreviewComponent]`](../../doc/models/renewal-preview-component.md) | Optional | An optional array of component definitions to preview. Providing any component definitions here will override the actual components on the subscription (and their quantities), and the billing preview will contain only these components (in addition to any product base fees). | - -## Example (as JSON) - -```json -{ - "components": [ - { - "component_id": "String5", - "quantity": 210, - "price_point_id": "String3" - }, - { - "component_id": "String5", - "quantity": 210, - "price_point_id": "String3" - }, - { - "component_id": "String5", - "quantity": 210, - "price_point_id": "String3" - } +| `components` | [`Array[RenewalPreviewComponent]`](../../doc/models/renewal-preview-component.md) | Optional | (Optional) Array of component definitions to preview. Providing any component definitions here will override the actual components on the subscription (and their quantities), and the billing preview will contain only these components (in addition to any product base fees). | + +## Example + +```ruby +renewal_preview_request = RenewalPreviewRequest.new( + components: [ + RenewalPreviewComponent.new( + component_id: 'String5', + quantity: 210, + price_point_id: 'String3' + ), + RenewalPreviewComponent.new( + component_id: 'String5', + quantity: 210, + price_point_id: 'String3' + ) ] -} +) ``` diff --git a/doc/models/renewal-preview-response.md b/doc/models/renewal-preview-response.md index 9ac06c4..8911710 100644 --- a/doc/models/renewal-preview-response.md +++ b/doc/models/renewal-preview-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `renewal_preview` | [`RenewalPreview`](../../doc/models/renewal-preview.md) | Required | - | -## Example (as JSON) - -```json -{ - "renewal_preview": { - "next_assessment_at": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 132, - "total_tax_in_cents": 0, - "total_discount_in_cents": 250, - "total_in_cents": 20 - } -} +## Example + +```ruby +renewal_preview_response = RenewalPreviewResponse.new( + renewal_preview: RenewalPreview.new( + next_assessment_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + subtotal_in_cents: 132, + total_tax_in_cents: 0, + total_discount_in_cents: 250, + total_in_cents: 20 + ) +) ``` diff --git a/doc/models/renewal-preview.md b/doc/models/renewal-preview.md index 59c1a91..33b14b7 100644 --- a/doc/models/renewal-preview.md +++ b/doc/models/renewal-preview.md @@ -19,15 +19,15 @@ | `uncalculated_taxes` | `TrueClass \| FalseClass` | Optional | A boolean indicating whether or not additional taxes will be calculated at the time of renewal. This will be true if you are using Avalara and the address of the subscription is in one of your defined taxable regions. | | `line_items` | [`Array[RenewalPreviewLineItem]`](../../doc/models/renewal-preview-line-item.md) | Optional | An array of objects representing the individual transactions that will be created at the next renewal | -## Example (as JSON) - -```json -{ - "next_assessment_at": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 160, - "total_tax_in_cents": 28, - "total_discount_in_cents": 34, - "total_in_cents": 48 -} +## Example + +```ruby +renewal_preview = RenewalPreview.new( + next_assessment_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + subtotal_in_cents: 132, + total_tax_in_cents: 0, + total_discount_in_cents: 250, + total_in_cents: 20 +) ``` diff --git a/doc/models/replay-webhooks-request.md b/doc/models/replay-webhooks-request.md index c7a996d..88086da 100644 --- a/doc/models/replay-webhooks-request.md +++ b/doc/models/replay-webhooks-request.md @@ -11,13 +11,15 @@ | --- | --- | --- | --- | | `ids` | `Array[Integer]` | Required | - | -## Example (as JSON) - -```json -{ - "ids": [ - 15 +## Example + +```ruby +replay_webhooks_request = ReplayWebhooksRequest.new( + ids: [ + 233, + 234, + 235 ] -} +) ``` diff --git a/doc/models/replay-webhooks-response.md b/doc/models/replay-webhooks-response.md index 74aeca4..aa1ab89 100644 --- a/doc/models/replay-webhooks-response.md +++ b/doc/models/replay-webhooks-response.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `status` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "status": "status4" -} +```ruby +replay_webhooks_response = ReplayWebhooksResponse.new( + status: 'status0' +) ``` diff --git a/doc/models/resent-invitation.md b/doc/models/resent-invitation.md index 9758b1c..84070d3 100644 --- a/doc/models/resent-invitation.md +++ b/doc/models/resent-invitation.md @@ -16,16 +16,16 @@ | `last_invite_sent_at` | `DateTime` | Optional | - | | `last_invite_accepted_at` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "last_invite_sent_at": "01/01/2024 04:30:00", - "last_invite_accepted_at": "01/01/2024 04:35:00", - "last_sent_at": "last_sent_at8", - "last_accepted_at": "last_accepted_at8", - "send_invite_link_text": "send_invite_link_text6", - "uninvited_count": 6 -} +## Example + +```ruby +resent_invitation = ResentInvitation.new( + last_sent_at: 'last_sent_at6', + last_accepted_at: 'last_accepted_at6', + send_invite_link_text: 'send_invite_link_text4', + uninvited_count: 78, + last_invite_sent_at: DateTimeHelper.from_rfc3339('2024-01-01T04:30:00+00:00'), + last_invite_accepted_at: DateTimeHelper.from_rfc3339('2024-01-01T04:35:00+00:00') +) ``` diff --git a/doc/models/resource-type.md b/doc/models/resource-type.md index 1490b92..a7821b4 100644 --- a/doc/models/resource-type.md +++ b/doc/models/resource-type.md @@ -12,3 +12,9 @@ | `SUBSCRIPTIONS` | | `CUSTOMERS` | +## Example + +```ruby +resource_type = ResourceType::SUBSCRIPTIONS +``` + diff --git a/doc/models/restriction-type.md b/doc/models/restriction-type.md index 816172f..4f67cce 100644 --- a/doc/models/restriction-type.md +++ b/doc/models/restriction-type.md @@ -12,3 +12,9 @@ | `COMPONENT` | | `PRODUCT` | +## Example + +```ruby +restriction_type = RestrictionType::COMPONENT +``` + diff --git a/doc/models/resume-options.md b/doc/models/resume-options.md index db156b6..df7f58d 100644 --- a/doc/models/resume-options.md +++ b/doc/models/resume-options.md @@ -12,12 +12,12 @@ | `require_resume` | `TrueClass \| FalseClass` | Optional | Chargify will only attempt to resume the subscription's billing period. If not resumable, the subscription will be left in its current state. | | `forgive_balance` | `TrueClass \| FalseClass` | Optional | Indicates whether or not Chargify should clear the subscription's existing balance before attempting to resume the subscription. If subscription cannot be resumed, the balance will remain as it was before the attempt to resume was made. | -## Example (as JSON) +## Example -```json -{ - "require_resume": false, - "forgive_balance": false -} +```ruby +resume_options = ResumeOptions.new( + require_resume: false, + forgive_balance: false +) ``` diff --git a/doc/models/resumption-charge.md b/doc/models/resumption-charge.md index 799f3d3..1d494d1 100644 --- a/doc/models/resumption-charge.md +++ b/doc/models/resumption-charge.md @@ -15,3 +15,9 @@ | `IMMEDIATE` | | `DELAYED` | +## Example + +```ruby +resumption_charge = ResumptionCharge::PRORATED +``` + diff --git a/doc/models/revoked-invitation.md b/doc/models/revoked-invitation.md index b1e0bda..2b53480 100644 --- a/doc/models/revoked-invitation.md +++ b/doc/models/revoked-invitation.md @@ -13,13 +13,13 @@ | `last_accepted_at` | `String` | Optional | - | | `uninvited_count` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "last_sent_at": "last_sent_at2", - "last_accepted_at": "last_accepted_at2", - "uninvited_count": 226 -} +## Example + +```ruby +revoked_invitation = RevokedInvitation.new( + last_sent_at: 'last_sent_at4', + last_accepted_at: 'last_accepted_at4', + uninvited_count: 58 +) ``` diff --git a/doc/models/sale-rep-item-mrr.md b/doc/models/sale-rep-item-mrr.md index 87630ab..95de154 100644 --- a/doc/models/sale-rep-item-mrr.md +++ b/doc/models/sale-rep-item-mrr.md @@ -13,13 +13,13 @@ | `usage` | `String` | Optional | - | | `recurring` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "mrr": "mrr2", - "usage": "usage0", - "recurring": "recurring4" -} +## Example + +```ruby +sale_rep_item_mrr = SaleRepItemMrr.new( + mrr: 'mrr8', + usage: 'usage4', + recurring: 'recurring0' +) ``` diff --git a/doc/models/sale-rep-settings.md b/doc/models/sale-rep-settings.md index efcb1e3..0f16903 100644 --- a/doc/models/sale-rep-settings.md +++ b/doc/models/sale-rep-settings.md @@ -17,15 +17,15 @@ | `sales_rep_id` | `Integer` | Optional | - | | `sales_rep_name` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "customer_name": "customer_name8", - "subscription_id": 200, - "site_link": "site_link4", - "site_name": "site_name8", - "subscription_mrr": "subscription_mrr6" -} +## Example + +```ruby +sale_rep_settings = SaleRepSettings.new( + customer_name: 'customer_name4', + subscription_id: 168, + site_link: 'site_link0', + site_name: 'site_name6', + subscription_mrr: 'subscription_mrr2' +) ``` diff --git a/doc/models/sale-rep-subscription.md b/doc/models/sale-rep-subscription.md index 6c86ab0..3b09673 100644 --- a/doc/models/sale-rep-subscription.md +++ b/doc/models/sale-rep-subscription.md @@ -20,15 +20,15 @@ | `last_payment` | `String` | Optional | - | | `churn_date` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 18, - "site_name": "site_name2", - "subscription_url": "subscription_url6", - "customer_name": "customer_name2", - "created_at": "created_at8" -} +## Example + +```ruby +sale_rep_subscription = SaleRepSubscription.new( + id: 126, + site_name: 'site_name2', + subscription_url: 'subscription_url6', + customer_name: 'customer_name2', + created_at: 'created_at8' +) ``` diff --git a/doc/models/sale-rep.md b/doc/models/sale-rep.md index e76b786..77eb366 100644 --- a/doc/models/sale-rep.md +++ b/doc/models/sale-rep.md @@ -15,30 +15,30 @@ | `test_mode` | `TrueClass \| FalseClass` | Optional | - | | `subscriptions` | [`Array[SaleRepSubscription]`](../../doc/models/sale-rep-subscription.md) | Optional | - | -## Example (as JSON) - -```json -{ - "id": 18, - "full_name": "full_name0", - "subscriptions_count": 162, - "test_mode": false, - "subscriptions": [ - { - "id": 202, - "site_name": "site_name8", - "subscription_url": "subscription_url2", - "customer_name": "customer_name8", - "created_at": "created_at4" - }, - { - "id": 202, - "site_name": "site_name8", - "subscription_url": "subscription_url2", - "customer_name": "customer_name8", - "created_at": "created_at4" - } +## Example + +```ruby +sale_rep = SaleRep.new( + id: 214, + full_name: 'full_name0', + subscriptions_count: 34, + test_mode: false, + subscriptions: [ + SaleRepSubscription.new( + id: 202, + site_name: 'site_name8', + subscription_url: 'subscription_url2', + customer_name: 'customer_name8', + created_at: 'created_at4' + ), + SaleRepSubscription.new( + id: 202, + site_name: 'site_name8', + subscription_url: 'subscription_url2', + customer_name: 'customer_name8', + created_at: 'created_at4' + ) ] -} +) ``` diff --git a/doc/models/scheduled-renewal-component-custom-price.md b/doc/models/scheduled-renewal-component-custom-price.md index 9f1bf92..6971e92 100644 --- a/doc/models/scheduled-renewal-component-custom-price.md +++ b/doc/models/scheduled-renewal-component-custom-price.md @@ -12,22 +12,22 @@ Custom pricing for a component within a scheduled renewal. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `tax_included` | `TrueClass \| FalseClass` | Optional | Whether or not the price point includes tax | -| `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | Omit for On/Off components | +| `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | Omit for On/Off components. | | `prices` | [`Array[Price]`](../../doc/models/price.md) | Required | On/off components only need one price bracket starting at 1. | -## Example (as JSON) - -```json -{ - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +scheduled_renewal_component_custom_price = ScheduledRenewalComponentCustomPrice.new( + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "tax_included": false -} + tax_included: false +) ``` diff --git a/doc/models/scheduled-renewal-configuration-item-request.md b/doc/models/scheduled-renewal-configuration-item-request.md index 1c50749..3e63936 100644 --- a/doc/models/scheduled-renewal-configuration-item-request.md +++ b/doc/models/scheduled-renewal-configuration-item-request.md @@ -11,32 +11,32 @@ | --- | --- | --- | --- | | `renewal_configuration_item` | [Scheduled Renewal Item Request Body Component](../../doc/models/scheduled-renewal-item-request-body-component.md) \| [Scheduled Renewal Item Request Body Product](../../doc/models/scheduled-renewal-item-request-body-product.md) | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "renewal_configuration_item": { - "item_type": "Component", - "item_id": 108, - "price_point_id": 122, - "quantity": 212, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } - } -} +## Example + +```ruby +scheduled_renewal_configuration_item_request = ScheduledRenewalConfigurationItemRequest.new( + renewal_configuration_item: ScheduledRenewalItemRequestBodyComponent.new( + item_type: 'Component', + item_id: 108, + price_point_id: 122, + quantity: 212, + custom_price: ScheduledRenewalComponentCustomPrice.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false + ) + ) +) ``` diff --git a/doc/models/scheduled-renewal-configuration-item-response.md b/doc/models/scheduled-renewal-configuration-item-response.md index ec6dbed..e253eac 100644 --- a/doc/models/scheduled-renewal-configuration-item-response.md +++ b/doc/models/scheduled-renewal-configuration-item-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `scheduled_renewal_configuration_item` | [`ScheduledRenewalConfigurationItem`](../../doc/models/scheduled-renewal-configuration-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "scheduled_renewal_configuration_item": { - "id": 98, - "subscription_id": 208, - "subscription_renewal_configuration_id": 108, - "item_id": 246, - "item_type": "item_type2" - } -} +## Example + +```ruby +scheduled_renewal_configuration_item_response = ScheduledRenewalConfigurationItemResponse.new( + scheduled_renewal_configuration_item: ScheduledRenewalConfigurationItem.new( + id: 98, + subscription_id: 208, + subscription_renewal_configuration_id: 108, + item_id: 246, + item_type: 'item_type2' + ) +) ``` diff --git a/doc/models/scheduled-renewal-configuration-item.md b/doc/models/scheduled-renewal-configuration-item.md index f575e91..5b9628f 100644 --- a/doc/models/scheduled-renewal-configuration-item.md +++ b/doc/models/scheduled-renewal-configuration-item.md @@ -21,15 +21,15 @@ | `decimal_quantity` | `String` | Optional | - | | `created_at` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 146, - "subscription_id": 0, - "subscription_renewal_configuration_id": 156, - "item_id": 38, - "item_type": "item_type4" -} +## Example + +```ruby +scheduled_renewal_configuration_item = ScheduledRenewalConfigurationItem.new( + id: 98, + subscription_id: 208, + subscription_renewal_configuration_id: 108, + item_id: 246, + item_type: 'item_type2' +) ``` diff --git a/doc/models/scheduled-renewal-configuration-request-body.md b/doc/models/scheduled-renewal-configuration-request-body.md index e5f8259..0d6d15a 100644 --- a/doc/models/scheduled-renewal-configuration-request-body.md +++ b/doc/models/scheduled-renewal-configuration-request-body.md @@ -15,15 +15,15 @@ | `contract_id` | `Integer` | Optional | (Optional) Existing contract to associate with the scheduled renewal. Contracts must be enabled for your site. | | `create_new_contract` | `TrueClass \| FalseClass` | Optional | (Optional) Set to true to create a new contract when contracts are enabled. Contracts must be enabled for your site. | -## Example (as JSON) - -```json -{ - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z", - "lock_in_at": "2016-03-13T12:52:32.123Z", - "contract_id": 110, - "create_new_contract": false -} +## Example + +```ruby +scheduled_renewal_configuration_request_body = ScheduledRenewalConfigurationRequestBody.new( + starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + lock_in_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + contract_id: 88, + create_new_contract: false +) ``` diff --git a/doc/models/scheduled-renewal-configuration-request.md b/doc/models/scheduled-renewal-configuration-request.md index a3e40f7..a54ba50 100644 --- a/doc/models/scheduled-renewal-configuration-request.md +++ b/doc/models/scheduled-renewal-configuration-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `renewal_configuration` | [`ScheduledRenewalConfigurationRequestBody`](../../doc/models/scheduled-renewal-configuration-request-body.md) | Required | - | -## Example (as JSON) - -```json -{ - "renewal_configuration": { - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z", - "lock_in_at": "2016-03-13T12:52:32.123Z", - "contract_id": 244, - "create_new_contract": false - } -} +## Example + +```ruby +scheduled_renewal_configuration_request = ScheduledRenewalConfigurationRequest.new( + renewal_configuration: ScheduledRenewalConfigurationRequestBody.new( + starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + lock_in_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + contract_id: 244, + create_new_contract: false + ) +) ``` diff --git a/doc/models/scheduled-renewal-configuration-response.md b/doc/models/scheduled-renewal-configuration-response.md index 8869eab..9b7a28e 100644 --- a/doc/models/scheduled-renewal-configuration-response.md +++ b/doc/models/scheduled-renewal-configuration-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `scheduled_renewal_configuration` | [`ScheduledRenewalConfiguration`](../../doc/models/scheduled-renewal-configuration.md) | Optional | - | -## Example (as JSON) - -```json -{ - "scheduled_renewal_configuration": { - "id": 134, - "site_id": 60, - "subscription_id": 244, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +scheduled_renewal_configuration_response = ScheduledRenewalConfigurationResponse.new( + scheduled_renewal_configuration: ScheduledRenewalConfiguration.new( + id: 134, + site_id: 60, + subscription_id: 244, + starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/scheduled-renewal-configuration.md b/doc/models/scheduled-renewal-configuration.md index 422d42d..ac36451 100644 --- a/doc/models/scheduled-renewal-configuration.md +++ b/doc/models/scheduled-renewal-configuration.md @@ -20,15 +20,15 @@ | `scheduled_renewal_configuration_items` | [`Array[ScheduledRenewalConfigurationItem]`](../../doc/models/scheduled-renewal-configuration-item.md) | Optional | - | | `contract` | [`Contract`](../../doc/models/contract.md) | Optional | Contract linked to the scheduled renewal configuration. | -## Example (as JSON) - -```json -{ - "id": 152, - "site_id": 78, - "subscription_id": 6, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +scheduled_renewal_configuration = ScheduledRenewalConfiguration.new( + id: 134, + site_id: 60, + subscription_id: 244, + starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/scheduled-renewal-configurations-response.md b/doc/models/scheduled-renewal-configurations-response.md index 5fd02f6..bb3ca67 100644 --- a/doc/models/scheduled-renewal-configurations-response.md +++ b/doc/models/scheduled-renewal-configurations-response.md @@ -11,33 +11,26 @@ | --- | --- | --- | --- | | `scheduled_renewal_configurations` | [`Array[ScheduledRenewalConfiguration]`](../../doc/models/scheduled-renewal-configuration.md) | Optional | - | -## Example (as JSON) - -```json -{ - "scheduled_renewal_configurations": [ - { - "id": 122, - "site_id": 48, - "subscription_id": 232, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": 122, - "site_id": 48, - "subscription_id": 232, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": 122, - "site_id": 48, - "subscription_id": 232, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - } +## Example + +```ruby +scheduled_renewal_configurations_response = ScheduledRenewalConfigurationsResponse.new( + scheduled_renewal_configurations: [ + ScheduledRenewalConfiguration.new( + id: 122, + site_id: 48, + subscription_id: 232, + starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ), + ScheduledRenewalConfiguration.new( + id: 122, + site_id: 48, + subscription_id: 232, + starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) ] -} +) ``` diff --git a/doc/models/scheduled-renewal-item-request-body-component.md b/doc/models/scheduled-renewal-item-request-body-component.md index 5ed650e..5843b18 100644 --- a/doc/models/scheduled-renewal-item-request-body-component.md +++ b/doc/models/scheduled-renewal-item-request-body-component.md @@ -12,33 +12,33 @@ | `item_type` | `String` | Required, Constant | Item type to add. Either Product or Component.

**Value**: `'Component'` | | `item_id` | `Integer` | Required | Product or component identifier. | | `price_point_id` | `Integer` | Optional | Price point identifier. | -| `quantity` | `Integer` | Optional | Optional quantity for the item. | +| `quantity` | `Integer` | Optional | (Optional) Quantity for the item. | | `custom_price` | [`ScheduledRenewalComponentCustomPrice`](../../doc/models/scheduled-renewal-component-custom-price.md) | Optional | Custom pricing for a component within a scheduled renewal. | -## Example (as JSON) - -```json -{ - "item_type": "Component", - "item_id": 108, - "price_point_id": 122, - "quantity": 212, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} +## Example + +```ruby +scheduled_renewal_item_request_body_component = ScheduledRenewalItemRequestBodyComponent.new( + item_type: 'Component', + item_id: 228, + price_point_id: 214, + quantity: 36, + custom_price: ScheduledRenewalComponentCustomPrice.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false + ) +) ``` diff --git a/doc/models/scheduled-renewal-item-request-body-product.md b/doc/models/scheduled-renewal-item-request-body-product.md index da25a6c..a0ef310 100644 --- a/doc/models/scheduled-renewal-item-request-body-product.md +++ b/doc/models/scheduled-renewal-item-request-body-product.md @@ -12,27 +12,27 @@ | `item_type` | `String` | Required, Constant | Item type to add. Either Product or Component.

**Value**: `'Product'` | | `item_id` | `Integer` | Required | Product or component identifier. | | `price_point_id` | `Integer` | Optional | Price point identifier. | -| `quantity` | `Integer` | Optional | Optional quantity for the item. | +| `quantity` | `Integer` | Optional | (Optional) Quantity for the item. | | `custom_price` | [`ScheduledRenewalProductPricePoint`](../../doc/models/scheduled-renewal-product-price-point.md) | Optional | Custom pricing for a product within a scheduled renewal. | -## Example (as JSON) - -```json -{ - "item_type": "Product", - "item_id": 32, - "price_point_id": 18, - "quantity": 96, - "custom_price": { - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "tax_included": false, - "initial_charge_in_cents": 30, - "expiration_interval": 52 - } -} +## Example + +```ruby +scheduled_renewal_item_request_body_product = ScheduledRenewalItemRequestBodyProduct.new( + item_type: 'Product', + item_id: 18, + price_point_id: 4, + quantity: 82, + custom_price: ScheduledRenewalProductPricePoint.new( + price_in_cents: 'String3', + interval: 'String3', + interval_unit: IntervalUnit::DAY, + name: 'name4', + handle: 'handle0', + tax_included: false, + initial_charge_in_cents: 30, + expiration_interval: 52 + ) +) ``` diff --git a/doc/models/scheduled-renewal-lock-in-request.md b/doc/models/scheduled-renewal-lock-in-request.md index 4a2fcaf..8baefb2 100644 --- a/doc/models/scheduled-renewal-lock-in-request.md +++ b/doc/models/scheduled-renewal-lock-in-request.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `lock_in_at` | `Date` | Required | Date to lock in the renewal. | -## Example (as JSON) +## Example -```json -{ - "lock_in_at": "2016-03-13" -} +```ruby +scheduled_renewal_lock_in_request = ScheduledRenewalLockInRequest.new( + lock_in_at: Date.iso8601('2016-03-13') +) ``` diff --git a/doc/models/scheduled-renewal-product-price-point.md b/doc/models/scheduled-renewal-product-price-point.md index 22fc2eb..ab63692 100644 --- a/doc/models/scheduled-renewal-product-price-point.md +++ b/doc/models/scheduled-renewal-product-price-point.md @@ -18,21 +18,21 @@ Custom pricing for a product within a scheduled renewal. | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | Required if using `custom_price` attribute. | | `tax_included` | `TrueClass \| FalseClass` | Optional | (Optional) | | `initial_charge_in_cents` | `Integer` | Optional | The product price point initial charge, in integer cents. | -| `expiration_interval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | +| `expiration_interval` | `Integer` | Optional | The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month, day or never | -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String9", - "interval_unit": "day", - "tax_included": false, - "initial_charge_in_cents": 86, - "expiration_interval": 108 -} +## Example + +```ruby +scheduled_renewal_product_price_point = ScheduledRenewalProductPricePoint.new( + price_in_cents: 'String1', + interval: 'String5', + interval_unit: IntervalUnit::DAY, + name: 'name6', + handle: 'handle2', + tax_included: false, + initial_charge_in_cents: 4, + expiration_interval: 26 +) ``` diff --git a/doc/models/scheduled-renewal-update-request.md b/doc/models/scheduled-renewal-update-request.md index 01fa85c..9d8b0c8 100644 --- a/doc/models/scheduled-renewal-update-request.md +++ b/doc/models/scheduled-renewal-update-request.md @@ -11,32 +11,32 @@ | --- | --- | --- | --- | | `renewal_configuration_item` | [Scheduled Renewal Item Request Body Component](../../doc/models/scheduled-renewal-item-request-body-component.md) \| [Scheduled Renewal Item Request Body Product](../../doc/models/scheduled-renewal-item-request-body-product.md) | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "renewal_configuration_item": { - "item_type": "Component", - "item_id": 108, - "price_point_id": 122, - "quantity": 212, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } - } -} +## Example + +```ruby +scheduled_renewal_update_request = ScheduledRenewalUpdateRequest.new( + renewal_configuration_item: ScheduledRenewalItemRequestBodyComponent.new( + item_type: 'Component', + item_id: 108, + price_point_id: 122, + quantity: 212, + custom_price: ScheduledRenewalComponentCustomPrice.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false + ) + ) +) ``` diff --git a/doc/models/segment-price.md b/doc/models/segment-price.md index 9c839b0..477ba74 100644 --- a/doc/models/segment-price.md +++ b/doc/models/segment-price.md @@ -18,15 +18,15 @@ | `formatted_unit_price` | `String` | Optional | - | | `segment_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 220, - "component_id": 74, - "starting_quantity": 118, - "ending_quantity": 92, - "unit_price": "unit_price0" -} +## Example + +```ruby +segment_price = SegmentPrice.new( + id: 38, + component_id: 148, + starting_quantity: 44, + ending_quantity: 238, + unit_price: 'unit_price0' +) ``` diff --git a/doc/models/segment-response.md b/doc/models/segment-response.md index 3a808c3..4d9fd65 100644 --- a/doc/models/segment-response.md +++ b/doc/models/segment-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `segment` | [`Segment`](../../doc/models/segment.md) | Optional | - | -## Example (as JSON) - -```json -{ - "segment": { - "id": 118, - "component_id": 228, - "price_point_id": 4, - "event_based_billing_metric_id": 56, - "pricing_scheme": "stairstep" - } -} +## Example + +```ruby +segment_response = SegmentResponse.new( + segment: Segment.new( + id: 118, + component_id: 228, + price_point_id: 4, + event_based_billing_metric_id: 56, + pricing_scheme: PricingScheme::STAIRSTEP + ) +) ``` diff --git a/doc/models/segment.md b/doc/models/segment.md index 1ce932b..248bc30 100644 --- a/doc/models/segment.md +++ b/doc/models/segment.md @@ -22,15 +22,15 @@ | `updated_at` | `DateTime` | Optional | - | | `prices` | [`Array[SegmentPrice]`](../../doc/models/segment-price.md) | Optional | **Constraints**: *Minimum Items*: `1` | -## Example (as JSON) - -```json -{ - "id": 6, - "component_id": 116, - "price_point_id": 140, - "event_based_billing_metric_id": 200, - "pricing_scheme": "stairstep" -} +## Example + +```ruby +segment = Segment.new( + id: 118, + component_id: 228, + price_point_id: 4, + event_based_billing_metric_id: 56, + pricing_scheme: PricingScheme::STAIRSTEP +) ``` diff --git a/doc/models/send-email.md b/doc/models/send-email.md index a49726a..f26b853 100644 --- a/doc/models/send-email.md +++ b/doc/models/send-email.md @@ -12,12 +12,12 @@ | `can_execute` | `TrueClass \| FalseClass` | Required | - | | `url` | `String` | Required | - | -## Example (as JSON) +## Example -```json -{ - "can_execute": false, - "url": "url2" -} +```ruby +send_email = SendEmail.new( + can_execute: false, + url: 'url0' +) ``` diff --git a/doc/models/send-invoice-request.md b/doc/models/send-invoice-request.md index d1e4356..00257de 100644 --- a/doc/models/send-invoice-request.md +++ b/doc/models/send-invoice-request.md @@ -14,25 +14,29 @@ | `bcc_recipient_emails` | `Array[String]` | Optional | **Constraints**: *Maximum Items*: `5` | | `attachment_urls` | `Array[String]` | Optional | Array of URLs to files to attach to the invoice email. Max 10 files, 10MB each.

**Constraints**: *Maximum Items*: `10` | -## Example (as JSON) - -```json -{ - "recipient_emails": [ - "recipient_emails3", - "recipient_emails4" +## Example + +```ruby +send_invoice_request = SendInvoiceRequest.new( + recipient_emails: [ + 'recipient_emails9', + 'recipient_emails0', + 'recipient_emails1' ], - "cc_recipient_emails": [ - "cc_recipient_emails6", - "cc_recipient_emails5" + cc_recipient_emails: [ + 'cc_recipient_emails2', + 'cc_recipient_emails3' ], - "bcc_recipient_emails": [ - "bcc_recipient_emails6" + bcc_recipient_emails: [ + 'bcc_recipient_emails2', + 'bcc_recipient_emails1', + 'bcc_recipient_emails0' ], - "attachment_urls": [ - "attachment_urls0", - "attachment_urls1" + attachment_urls: [ + 'attachment_urls6', + 'attachment_urls7', + 'attachment_urls8' ] -} +) ``` diff --git a/doc/models/service-credit-1.md b/doc/models/service-credit-1.md index 1183b1b..a43cb6f 100644 --- a/doc/models/service-credit-1.md +++ b/doc/models/service-credit-1.md @@ -14,19 +14,19 @@ | `ending_balance_in_cents` | `Integer` | Optional | The new balance for the credit account | | `entry_type` | [`ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | | `memo` | `String` | Optional | The memo attached to the entry | -| `invoice_uid` | `String` | Optional | The invoice uid associated with the entry. Only present for debit entries | +| `invoice_uid` | `String` | Optional | The invoice uid associated with the entry. Only present for debit entries. | | `remaining_balance_in_cents` | `Integer` | Optional | The remaining balance for the entry | | `created_at` | `DateTime` | Optional | The date and time the entry was created | -## Example (as JSON) +## Example -```json -{ - "id": 174, - "amount_in_cents": 4, - "ending_balance_in_cents": 44, - "entry_type": "Credit", - "memo": "memo8" -} +```ruby +service_credit1 = ServiceCredit1.new( + id: 118, + amount_in_cents: 52, + ending_balance_in_cents: 244, + entry_type: ServiceCreditType::CREDIT, + memo: 'memo6' +) ``` diff --git a/doc/models/service-credit-response.md b/doc/models/service-credit-response.md index 3df9020..c9cb562 100644 --- a/doc/models/service-credit-response.md +++ b/doc/models/service-credit-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `service_credit` | [`ServiceCredit`](../../doc/models/service-credit.md) | Required | - | -## Example (as JSON) - -```json -{ - "service_credit": { - "id": 38, - "amount_in_cents": 124, - "ending_balance_in_cents": 164, - "entry_type": "Credit", - "memo": "memo0" - } -} +## Example + +```ruby +service_credit_response = ServiceCreditResponse.new( + service_credit: ServiceCredit.new( + id: 38, + amount_in_cents: 124, + ending_balance_in_cents: 164, + entry_type: ServiceCreditType::CREDIT, + memo: 'memo0' + ) +) ``` diff --git a/doc/models/service-credit-type.md b/doc/models/service-credit-type.md index e476384..4ce2a9b 100644 --- a/doc/models/service-credit-type.md +++ b/doc/models/service-credit-type.md @@ -14,3 +14,9 @@ The type of entry | `CREDIT` | | `DEBIT` | +## Example + +```ruby +service_credit_type = ServiceCreditType::CREDIT +``` + diff --git a/doc/models/service-credit.md b/doc/models/service-credit.md index dc1d671..524abbf 100644 --- a/doc/models/service-credit.md +++ b/doc/models/service-credit.md @@ -15,15 +15,15 @@ | `entry_type` | [`ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | | `memo` | `String` | Optional | The memo attached to the entry | -## Example (as JSON) - -```json -{ - "id": 216, - "amount_in_cents": 210, - "ending_balance_in_cents": 86, - "entry_type": "Credit", - "memo": "memo2" -} +## Example + +```ruby +service_credit = ServiceCredit.new( + id: 38, + amount_in_cents: 124, + ending_balance_in_cents: 164, + entry_type: ServiceCreditType::CREDIT, + memo: 'memo0' +) ``` diff --git a/doc/models/signup-proforma-preview-response.md b/doc/models/signup-proforma-preview-response.md index e7c2428..e706234 100644 --- a/doc/models/signup-proforma-preview-response.md +++ b/doc/models/signup-proforma-preview-response.md @@ -11,26 +11,26 @@ | --- | --- | --- | --- | | `proforma_invoice_preview` | [`SignupProformaPreview`](../../doc/models/signup-proforma-preview.md) | Required | - | -## Example (as JSON) - -```json -{ - "proforma_invoice_preview": { - "current_proforma_invoice": { - "uid": "uid6", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": 132 - }, - "next_proforma_invoice": { - "uid": "uid8", - "site_id": 212, - "customer_id": 68, - "subscription_id": 140, - "number": 16 - } - } -} +## Example + +```ruby +signup_proforma_preview_response = SignupProformaPreviewResponse.new( + proforma_invoice_preview: SignupProformaPreview.new( + current_proforma_invoice: ProformaInvoice.new( + uid: 'uid6', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 132 + ), + next_proforma_invoice: ProformaInvoice.new( + uid: 'uid8', + site_id: 212, + customer_id: 68, + subscription_id: 140, + number: 16 + ) + ) +) ``` diff --git a/doc/models/signup-proforma-preview.md b/doc/models/signup-proforma-preview.md index b575eef..a1d0f3e 100644 --- a/doc/models/signup-proforma-preview.md +++ b/doc/models/signup-proforma-preview.md @@ -12,24 +12,24 @@ | `current_proforma_invoice` | [`ProformaInvoice`](../../doc/models/proforma-invoice.md) | Optional | - | | `next_proforma_invoice` | [`ProformaInvoice`](../../doc/models/proforma-invoice.md) | Optional | - | -## Example (as JSON) - -```json -{ - "current_proforma_invoice": { - "uid": "uid6", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": 132 - }, - "next_proforma_invoice": { - "uid": "uid8", - "site_id": 212, - "customer_id": 68, - "subscription_id": 140, - "number": 16 - } -} +## Example + +```ruby +signup_proforma_preview = SignupProformaPreview.new( + current_proforma_invoice: ProformaInvoice.new( + uid: 'uid6', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 132 + ), + next_proforma_invoice: ProformaInvoice.new( + uid: 'uid8', + site_id: 212, + customer_id: 68, + subscription_id: 140, + number: 16 + ) +) ``` diff --git a/doc/models/single-error-response-exception.md b/doc/models/single-error-response-exception.md index e81876c..9d93dd5 100644 --- a/doc/models/single-error-response-exception.md +++ b/doc/models/single-error-response-exception.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `error` | `String` | Required | - | -## Example (as JSON) - -```json -{ - "error": "error2" -} +## Example + +```ruby +begin + # make the API call +rescue SingleErrorResponseException => e + puts "Caught SingleErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/single-string-error-response-exception.md b/doc/models/single-string-error-response-exception.md index a680d20..1193a97 100644 --- a/doc/models/single-string-error-response-exception.md +++ b/doc/models/single-string-error-response-exception.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `errors` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "errors": "errors4" -} +## Example + +```ruby +begin + # make the API call +rescue SingleStringErrorResponseException => e + puts "Caught SingleStringErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/site-response.md b/doc/models/site-response.md index 26c6eb6..0a7875c 100644 --- a/doc/models/site-response.md +++ b/doc/models/site-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `site` | [`Site`](../../doc/models/site.md) | Required | - | -## Example (as JSON) - -```json -{ - "site": { - "id": 64, - "name": "name4", - "subdomain": "subdomain0", - "currency": "currency4", - "seller_id": 228 - } -} +## Example + +```ruby +site_response = SiteResponse.new( + site: Site.new( + id: 64, + name: 'name4', + subdomain: 'subdomain0', + currency: 'currency4', + seller_id: 228 + ) +) ``` diff --git a/doc/models/site-statistics.md b/doc/models/site-statistics.md index fc9eb1a..04564f5 100644 --- a/doc/models/site-statistics.md +++ b/doc/models/site-statistics.md @@ -21,15 +21,15 @@ | `total_unpaid_subscriptions` | `Integer` | Optional | - | | `total_dunning_subscriptions` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "total_subscriptions": 204, - "subscriptions_today": 134, - "total_revenue": "total_revenue6", - "revenue_today": "revenue_today4", - "revenue_this_month": "revenue_this_month4" -} +## Example + +```ruby +site_statistics = SiteStatistics.new( + total_subscriptions: 186, + subscriptions_today: 152, + total_revenue: 'total_revenue6', + revenue_today: 'revenue_today4', + revenue_this_month: 'revenue_this_month4' +) ``` diff --git a/doc/models/site-summary.md b/doc/models/site-summary.md index feac9c3..265bdfb 100644 --- a/doc/models/site-summary.md +++ b/doc/models/site-summary.md @@ -15,21 +15,21 @@ | `site_currency` | `String` | Optional | - | | `stats` | [`SiteStatistics`](../../doc/models/site-statistics.md) | Optional | - | -## Example (as JSON) - -```json -{ - "seller_name": "seller_name0", - "site_name": "site_name4", - "site_id": 218, - "site_currency": "site_currency6", - "stats": { - "total_subscriptions": 110, - "subscriptions_today": 228, - "total_revenue": "total_revenue6", - "revenue_today": "revenue_today4", - "revenue_this_month": "revenue_this_month4" - } -} +## Example + +```ruby +site_summary = SiteSummary.new( + seller_name: 'seller_name8', + site_name: 'site_name4', + site_id: 170, + site_currency: 'site_currency2', + stats: SiteStatistics.new( + total_subscriptions: 110, + subscriptions_today: 228, + total_revenue: 'total_revenue6', + revenue_today: 'revenue_today4', + revenue_this_month: 'revenue_this_month4' + ) +) ``` diff --git a/doc/models/site.md b/doc/models/site.md index 2b1f82d..3cfd4f9 100644 --- a/doc/models/site.md +++ b/doc/models/site.md @@ -30,15 +30,15 @@ | `portal_enabled` | `TrueClass \| FalseClass` | Optional | Whether the Billing Portal is enabled for this site. | | `test` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 34, - "name": "name0", - "subdomain": "subdomain4", - "currency": "currency0", - "seller_id": 198 -} +## Example + +```ruby +site = Site.new( + id: 64, + name: 'name4', + subdomain: 'subdomain0', + currency: 'currency4', + seller_id: 228 +) ``` diff --git a/doc/models/sorting-direction.md b/doc/models/sorting-direction.md index 547aa44..d727ded 100644 --- a/doc/models/sorting-direction.md +++ b/doc/models/sorting-direction.md @@ -14,3 +14,9 @@ Used for sorting results. | `ASC` | | `DESC` | +## Example + +```ruby +sorting_direction = SortingDirection::ASC +``` + diff --git a/doc/models/status.md b/doc/models/status.md index 3531d2c..263113b 100644 --- a/doc/models/status.md +++ b/doc/models/status.md @@ -16,3 +16,9 @@ | `ACTIVE` | | `FULFILLED` | +## Example + +```ruby +status = Status::PENDING +``` + diff --git a/doc/models/subscription-add-coupon-error-exception.md b/doc/models/subscription-add-coupon-error-exception.md index f449428..32ba627 100644 --- a/doc/models/subscription-add-coupon-error-exception.md +++ b/doc/models/subscription-add-coupon-error-exception.md @@ -14,25 +14,13 @@ | `coupon_codes` | `Array[String]` | Optional | - | | `subscription` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "codes": [ - "codes6", - "codes7", - "codes8" - ], - "coupon_code": [ - "coupon_code8", - "coupon_code7" - ], - "coupon_codes": [ - "coupon_codes2" - ], - "subscription": [ - "subscription8" - ] -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionAddCouponErrorException => e + puts "Caught SubscriptionAddCouponErrorException: #{e.message}" +end ``` diff --git a/doc/models/subscription-component-allocation-error-exception.md b/doc/models/subscription-component-allocation-error-exception.md index 87bc6b7..98219ef 100644 --- a/doc/models/subscription-component-allocation-error-exception.md +++ b/doc/models/subscription-component-allocation-error-exception.md @@ -11,16 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`Array[SubscriptionComponentAllocationErrorItem]`](../../doc/models/subscription-component-allocation-error-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": [ - { - "kind": "kind8", - "message": "message0" - } - ] -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionComponentAllocationErrorException => e + puts "Caught SubscriptionComponentAllocationErrorException: #{e.message}" +end ``` diff --git a/doc/models/subscription-component-allocation-error-item.md b/doc/models/subscription-component-allocation-error-item.md index 29c9376..d789d4f 100644 --- a/doc/models/subscription-component-allocation-error-item.md +++ b/doc/models/subscription-component-allocation-error-item.md @@ -12,12 +12,12 @@ | `kind` | `String` | Optional | - | | `message` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "kind": "kind0", - "message": "message8" -} +```ruby +subscription_component_allocation_error_item = SubscriptionComponentAllocationErrorItem.new( + kind: 'kind0', + message: 'message2' +) ``` diff --git a/doc/models/subscription-component-response.md b/doc/models/subscription-component-response.md index 984a88f..ba84129 100644 --- a/doc/models/subscription-component-response.md +++ b/doc/models/subscription-component-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `component` | [`SubscriptionComponent`](../../doc/models/subscription-component.md) | Optional | - | -## Example (as JSON) - -```json -{ - "component": { - "id": 80, - "name": "name8", - "kind": "quantity_based_component", - "unit_name": "unit_name0", - "enabled": false - } -} +## Example + +```ruby +subscription_component_response = SubscriptionComponentResponse.new( + component: SubscriptionComponent.new( + id: 80, + name: 'name8', + kind: ComponentKind::QUANTITY_BASED_COMPONENT, + unit_name: 'unit_name0', + enabled: false + ) +) ``` diff --git a/doc/models/subscription-component-subscription.md b/doc/models/subscription-component-subscription.md index 98b697e..03e63fb 100644 --- a/doc/models/subscription-component-subscription.md +++ b/doc/models/subscription-component-subscription.md @@ -1,7 +1,7 @@ # Subscription Component Subscription -An optional object, will be returned if provided `include=subscription` query param. +(Optional) Object that will be returned if the `include=subscription` query param is provided. ## Structure @@ -14,12 +14,12 @@ An optional object, will be returned if provided `include=subscription` query pa | `state` | [`SubscriptionState`](../../doc/models/subscription-state.md) | Optional | The state of a subscription.

* **Live States**
* `active` - A normal, active subscription. It is not in a trial and is paid and up to date.
* `assessing` - An internal (transient) state that indicates a subscription is in the middle of periodic assessment. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `pending` - An internal (transient) state that indicates a subscription is in the creation process. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `trialing` - A subscription in trialing state has a valid trial subscription. This type of subscription may transition to active once payment is received when the trial has ended. Otherwise, it may go to a Problem or End of Life state.
* `paused` - An internal state that indicates that your account with Advanced Billing is in arrears.
* **Problem States**
* `past_due` - Indicates that the most recent payment has failed, and payment is past due for this subscription. If you have enabled our automated dunning, this subscription will be in the dunning process (additional status and callbacks from the dunning process will be available in the future). If you are handling dunning and payment updates yourself, you will want to use this state to initiate a payment update from your customers.
* `soft_failure` - Indicates that normal assessment/processing of the subscription has failed for a reason that cannot be fixed by the Customer. For example, a Soft Fail may result from a timeout at the gateway or incorrect credentials on your part. The subscriptions should be retried automatically. An interface is being built for you to review problems resulting from these events to take manual action when needed.
* `unpaid` - Indicates an unpaid subscription. A subscription is marked unpaid if the retry period expires and you have configured your [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) settings to have a Final Action of `mark the subscription unpaid`.
* **End of Life States**
* `canceled` - Indicates a canceled subscription. This may happen at your request (via the API or the web interface) or due to the expiration of the [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) process without payment. See the [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming) documentation for info on how to restart a canceled subscription.
While a subscription is canceled, its period will not advance, it will not accrue any new charges, and Advanced Billing will not attempt to collect the overdue balance.
* `expired` - Indicates a subscription that has expired due to running its normal life cycle. Some products may be configured to have an expiration period. An expired subscription then is one that stayed active until it fulfilled its full period.
* `failed_to_create` - Indicates that signup has failed. (You may see this state in a signup_failure webhook.)
* `on_hold` - Indicates that a subscription’s billing has been temporarily stopped. While it is expected that the subscription will resume and return to active status, this is still treated as an “End of Life” state because the customer is not paying for services during this time.
* `suspended` - Indicates that a prepaid subscription has used up all their prepayment balance. If a prepayment is applied, it will return to an active state.
* `trial_ended` - A subscription in a trial_ended state is a subscription that completed a no-obligation trial and did not have a card on file at the expiration of the trial period. See [Product Pricing – No Obligation Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product-Editing) for more details.

See [Subscription States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscription-States) for more info about subscription states and state transitions. | | `updated_at` | `DateTime` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "state": "paused", - "updated_at": "2016-03-13T12:52:32.123Z" -} +```ruby +subscription_component_subscription = SubscriptionComponentSubscription.new( + state: SubscriptionState::PAUSED, + updated_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/subscription-component.md b/doc/models/subscription-component.md index 354c45c..f09431e 100644 --- a/doc/models/subscription-component.md +++ b/doc/models/subscription-component.md @@ -13,8 +13,8 @@ | `name` | `String` | Optional | - | | `kind` | [`ComponentKind`](../../doc/models/component-kind.md) | Optional | A handle for the component type | | `unit_name` | `String` | Optional | - | -| `enabled` | `TrueClass \| FalseClass` | Optional | (for on/off components) indicates if the component is enabled for the subscription | -| `unit_balance` | `Integer` | Optional | - | +| `enabled` | `TrueClass \| FalseClass` | Optional | (for on/off components) indicates if the component is enabled for the subscription. | +| `unit_balance` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `currency` | `String` | Optional | - | | `allocated_quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | - | @@ -36,21 +36,21 @@ | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | - | | `description` | `String` | Optional | - | | `allow_fractional_quantities` | `TrueClass \| FalseClass` | Optional | - | -| `subscription` | [`SubscriptionComponentSubscription`](../../doc/models/subscription-component-subscription.md) | Optional | An optional object, will be returned if provided `include=subscription` query param. | +| `subscription` | [`SubscriptionComponentSubscription`](../../doc/models/subscription-component-subscription.md) | Optional | (Optional) Object that will be returned if the `include=subscription` query param is provided. | | `historic_usages` | [`Array[HistoricUsage]`](../../doc/models/historic-usage.md) | Optional | - | | `display_on_hosted_page` | `TrueClass \| FalseClass` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | -## Example (as JSON) +## Example -```json -{ - "id": 20, - "name": "name8", - "kind": "quantity_based_component", - "unit_name": "unit_name0", - "enabled": false -} +```ruby +subscription_component = SubscriptionComponent.new( + id: 8, + name: 'name8', + kind: ComponentKind::QUANTITY_BASED_COMPONENT, + unit_name: 'unit_name0', + enabled: false +) ``` diff --git a/doc/models/subscription-custom-price.md b/doc/models/subscription-custom-price.md index 895eea6..236eda1 100644 --- a/doc/models/subscription-custom-price.md +++ b/doc/models/subscription-custom-price.md @@ -19,25 +19,25 @@ | `trial_price_in_cents` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `trial_interval` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `trial_interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | (Optional) | -| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | +| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | | `initial_charge_in_cents` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `initial_charge_after_trial` | `TrueClass \| FalseClass` | Optional | (Optional) | | `expiration_interval` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | (Optional) | | `tax_included` | `TrueClass \| FalseClass` | Optional | (Optional) | -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "trial_price_in_cents": "String3", - "trial_interval": "String5", - "trial_interval_unit": "day" -} +## Example + +```ruby +subscription_custom_price = SubscriptionCustomPrice.new( + price_in_cents: 'String7', + interval: 'String1', + interval_unit: IntervalUnit::DAY, + name: 'name2', + handle: 'handle8', + trial_price_in_cents: 'String7', + trial_interval: 'String3', + trial_interval_unit: IntervalUnit::DAY +) ``` diff --git a/doc/models/subscription-date-field.md b/doc/models/subscription-date-field.md index 3de7f3b..c4de8d9 100644 --- a/doc/models/subscription-date-field.md +++ b/doc/models/subscription-date-field.md @@ -19,3 +19,9 @@ | `TRIAL_ENDED_AT` | | `UPDATED_AT` | +## Example + +```ruby +subscription_date_field = SubscriptionDateField::CURRENT_PERIOD_STARTS_AT +``` + diff --git a/doc/models/subscription-filter.md b/doc/models/subscription-filter.md index c699b8f..716b6f9 100644 --- a/doc/models/subscription-filter.md +++ b/doc/models/subscription-filter.md @@ -18,19 +18,19 @@ Nested filter used for List Subscription Components For Site Filter | `start_datetime` | `DateTime` | Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components that belong to the subscription with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. To use this filter you also have to include the following param in the request `include=subscription`. | | `end_datetime` | `DateTime` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components that belong to the subscription with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date. To use this filter you also have to include the following param in the request `include=subscription`. | -## Example (as JSON) +## Example -```json -{ - "states": [ - "active", - "canceled" +```ruby +subscription_filter = SubscriptionFilter.new( + states: [ + SubscriptionStateFilter::ACTIVE, + SubscriptionStateFilter::CANCELED ], - "start_date": "2024-01-17", - "end_date": "2024-01-31", - "start_datetime": "01/17/2024 09:15:30", - "end_datetime": "01/17/2024 17:20:06", - "date_field": "updated_at" -} + date_field: SubscriptionListDateField::UPDATED_AT, + start_date: Date.iso8601('2024-01-17'), + end_date: Date.iso8601('2024-01-31'), + start_datetime: DateTimeHelper.from_rfc3339('2024-01-17T09:15:30+00:00'), + end_datetime: DateTimeHelper.from_rfc3339('2024-01-17T17:20:06Z') +) ``` diff --git a/doc/models/subscription-group-balances.md b/doc/models/subscription-group-balances.md index b267f23..150149b 100644 --- a/doc/models/subscription-group-balances.md +++ b/doc/models/subscription-group-balances.md @@ -14,30 +14,30 @@ | `open_invoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | - | | `pending_discounts` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | - | -## Example (as JSON) - -```json -{ - "prepayments": { - "balance_in_cents": 192, - "automatic_balance_in_cents": 178, - "remittance_balance_in_cents": 146 - }, - "service_credits": { - "balance_in_cents": 84, - "automatic_balance_in_cents": 70, - "remittance_balance_in_cents": 38 - }, - "open_invoices": { - "balance_in_cents": 40, - "automatic_balance_in_cents": 202, - "remittance_balance_in_cents": 170 - }, - "pending_discounts": { - "balance_in_cents": 88, - "automatic_balance_in_cents": 154, - "remittance_balance_in_cents": 134 - } -} +## Example + +```ruby +subscription_group_balances = SubscriptionGroupBalances.new( + prepayments: AccountBalance.new( + balance_in_cents: 192, + automatic_balance_in_cents: 178, + remittance_balance_in_cents: 146 + ), + service_credits: AccountBalance.new( + balance_in_cents: 84, + automatic_balance_in_cents: 70, + remittance_balance_in_cents: 38 + ), + open_invoices: AccountBalance.new( + balance_in_cents: 40, + automatic_balance_in_cents: 202, + remittance_balance_in_cents: 170 + ), + pending_discounts: AccountBalance.new( + balance_in_cents: 88, + automatic_balance_in_cents: 154, + remittance_balance_in_cents: 134 + ) +) ``` diff --git a/doc/models/subscription-group-bank-account.md b/doc/models/subscription-group-bank-account.md index 207d3a1..39a346f 100644 --- a/doc/models/subscription-group-bank-account.md +++ b/doc/models/subscription-group-bank-account.md @@ -11,9 +11,9 @@ | --- | --- | --- | --- | | `bank_name` | `String` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | | `bank_account_number` | `String` | Optional | (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number | -| `bank_routing_number` | `String` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | -| `bank_iban` | `String` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | -| `bank_branch_code` | `String` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | +| `bank_routing_number` | `String` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless.) The routing number of the bank. It becomes bank_code while passing via GoCardless API. | +| `bank_iban` | `String` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided. | +| `bank_branch_code` | `String` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided. | | `bank_account_type` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | | `bank_account_holder_type` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Optional | - | @@ -26,15 +26,15 @@ | `current_vault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | | `gateway_handle` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "bank_name": "bank_name2", - "bank_account_number": "bank_account_number4", - "bank_routing_number": "bank_routing_number8", - "bank_iban": "bank_iban6", - "bank_branch_code": "bank_branch_code6" -} +```ruby +subscription_group_bank_account = SubscriptionGroupBankAccount.new( + bank_name: 'bank_name4', + bank_account_number: 'bank_account_number2', + bank_routing_number: 'bank_routing_number6', + bank_iban: 'bank_iban8', + bank_branch_code: 'bank_branch_code4' +) ``` diff --git a/doc/models/subscription-group-component-custom-price.md b/doc/models/subscription-group-component-custom-price.md index 745aaa6..3e3c7d0 100644 --- a/doc/models/subscription-group-component-custom-price.md +++ b/doc/models/subscription-group-component-custom-price.md @@ -15,34 +15,53 @@ Used in place of `price_point_id` to define a custom price point unique to the s | `prices` | [`Array[Price]`](../../doc/models/price.md) | Optional | - | | `overage_pricing` | [`Array[ComponentCustomPrice]`](../../doc/models/component-custom-price.md) | Optional | - | -## Example (as JSON) - -```json -{ - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +subscription_group_component_custom_price = SubscriptionGroupComponentCustomPrice.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "overage_pricing": [ - { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } + overage_pricing: [ + ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 230, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 10 + ), + ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 230, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 10 + ) ] -} +) ``` diff --git a/doc/models/subscription-group-create-error-response-exception.md b/doc/models/subscription-group-create-error-response-exception.md index fc22b78..fbe7669 100644 --- a/doc/models/subscription-group-create-error-response-exception.md +++ b/doc/models/subscription-group-create-error-response-exception.md @@ -11,15 +11,13 @@ | --- | --- | --- | --- | | `errors` | [Subscription Group Members Array Error](../../doc/models/subscription-group-members-array-error.md) \| [Subscription Group Single Error](../../doc/models/subscription-group-single-error.md) \| String | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "errors": { - "members": [ - "members6" - ] - } -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionGroupCreateErrorResponseException => e + puts "Caught SubscriptionGroupCreateErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/subscription-group-credit-card.md b/doc/models/subscription-group-credit-card.md index 8823818..cc81a53 100644 --- a/doc/models/subscription-group-credit-card.md +++ b/doc/models/subscription-group-credit-card.md @@ -30,16 +30,16 @@ | `cvv` | `String` | Optional | - | | `payment_type` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "chargify_token": "tok_592nf92ng0sjd4300p", - "full_number": 4111111111111111, - "vault_token": "vault_token6", - "current_vault": "braintree_blue", - "gateway_handle": "gateway_handle6", - "first_name": "first_name4" -} +## Example + +```ruby +subscription_group_credit_card = SubscriptionGroupCreditCard.new( + chargify_token: 'tok_592nf92ng0sjd4300p', + vault_token: 'vault_token8', + current_vault: CreditCardVault::PAYMILL, + gateway_handle: 'gateway_handle2', + first_name: 'first_name6', + full_number: 4111111111111111 +) ``` diff --git a/doc/models/subscription-group-customer.md b/doc/models/subscription-group-customer.md index 9efc5f7..41b9bf1 100644 --- a/doc/models/subscription-group-customer.md +++ b/doc/models/subscription-group-customer.md @@ -15,15 +15,15 @@ | `email` | `String` | Optional | - | | `reference` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name4", - "last_name": "last_name2", - "organization": "organization2", - "email": "email2", - "reference": "reference0" -} +## Example + +```ruby +subscription_group_customer = SubscriptionGroupCustomer.new( + first_name: 'first_name2', + last_name: 'last_name0', + organization: 'organization4', + email: 'email4', + reference: 'reference2' +) ``` diff --git a/doc/models/subscription-group-include.md b/doc/models/subscription-group-include.md index 3225e28..14c76e4 100644 --- a/doc/models/subscription-group-include.md +++ b/doc/models/subscription-group-include.md @@ -11,3 +11,9 @@ | --- | | `CURRENT_BILLING_AMOUNT_IN_CENTS` | +## Example + +```ruby +subscription_group_include = SubscriptionGroupInclude::CURRENT_BILLING_AMOUNT_IN_CENTS +``` + diff --git a/doc/models/subscription-group-item.md b/doc/models/subscription-group-item.md index 3ed91a8..e54cd3e 100644 --- a/doc/models/subscription-group-item.md +++ b/doc/models/subscription-group-item.md @@ -20,15 +20,15 @@ | `total_revenue_in_cents` | `Integer` | Optional | - | | `balance_in_cents` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 16, - "reference": "reference8", - "product_id": 214, - "product_handle": "product_handle4", - "product_price_point_id": 138 -} +## Example + +```ruby +subscription_group_item = SubscriptionGroupItem.new( + id: 214, + reference: 'reference2', + product_id: 156, + product_handle: 'product_handle6', + product_price_point_id: 80 +) ``` diff --git a/doc/models/subscription-group-members-array-error.md b/doc/models/subscription-group-members-array-error.md index 6d9321c..69ddc7f 100644 --- a/doc/models/subscription-group-members-array-error.md +++ b/doc/models/subscription-group-members-array-error.md @@ -11,13 +11,13 @@ | --- | --- | --- | --- | | `members` | `Array[String]` | Required | - | -## Example (as JSON) +## Example -```json -{ - "members": [ - "members6" +```ruby +subscription_group_members_array_error = SubscriptionGroupMembersArrayError.new( + members: [ + 'members2' ] -} +) ``` diff --git a/doc/models/subscription-group-payment-profile.md b/doc/models/subscription-group-payment-profile.md index 265deee..e4fb4a4 100644 --- a/doc/models/subscription-group-payment-profile.md +++ b/doc/models/subscription-group-payment-profile.md @@ -14,14 +14,14 @@ | `last_name` | `String` | Optional | - | | `masked_card_number` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 22, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" -} +## Example + +```ruby +subscription_group_payment_profile = SubscriptionGroupPaymentProfile.new( + id: 112, + first_name: 'first_name8', + last_name: 'last_name6', + masked_card_number: 'masked_card_number6' +) ``` diff --git a/doc/models/subscription-group-prepayment-method.md b/doc/models/subscription-group-prepayment-method.md index dc41027..d161751 100644 --- a/doc/models/subscription-group-prepayment-method.md +++ b/doc/models/subscription-group-prepayment-method.md @@ -16,3 +16,9 @@ | `PAYPAL_ACCOUNT` | | `OTHER` | +## Example + +```ruby +subscription_group_prepayment_method = SubscriptionGroupPrepaymentMethod::MONEY_ORDER +``` + diff --git a/doc/models/subscription-group-prepayment-request.md b/doc/models/subscription-group-prepayment-request.md index 1325feb..465ee14 100644 --- a/doc/models/subscription-group-prepayment-request.md +++ b/doc/models/subscription-group-prepayment-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `prepayment` | [`SubscriptionGroupPrepayment`](../../doc/models/subscription-group-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayment": { - "amount": 136, - "details": "details8", - "memo": "memo2", - "method": "paypal_account" - } -} +## Example + +```ruby +subscription_group_prepayment_request = SubscriptionGroupPrepaymentRequest.new( + prepayment: SubscriptionGroupPrepayment.new( + amount: 136, + details: 'details8', + memo: 'memo2', + method: SubscriptionGroupPrepaymentMethod::PAYPAL_ACCOUNT + ) +) ``` diff --git a/doc/models/subscription-group-prepayment-response.md b/doc/models/subscription-group-prepayment-response.md index e4e980d..782ab2d 100644 --- a/doc/models/subscription-group-prepayment-response.md +++ b/doc/models/subscription-group-prepayment-response.md @@ -15,15 +15,15 @@ | `entry_type` | [`ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | | `memo` | `String` | Optional | A memo attached to the entry. | -## Example (as JSON) - -```json -{ - "id": 110, - "amount_in_cents": 196, - "ending_balance_in_cents": 236, - "entry_type": "Credit", - "memo": "memo2" -} +## Example + +```ruby +subscription_group_prepayment_response = SubscriptionGroupPrepaymentResponse.new( + id: 28, + amount_in_cents: 114, + ending_balance_in_cents: 154, + entry_type: ServiceCreditType::CREDIT, + memo: 'memo2' +) ``` diff --git a/doc/models/subscription-group-prepayment.md b/doc/models/subscription-group-prepayment.md index c45c023..cd7d8d0 100644 --- a/doc/models/subscription-group-prepayment.md +++ b/doc/models/subscription-group-prepayment.md @@ -14,14 +14,14 @@ | `memo` | `String` | Required | - | | `method` | [`SubscriptionGroupPrepaymentMethod`](../../doc/models/subscription-group-prepayment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "amount": 96, - "details": "details2", - "memo": "memo6", - "method": "money_order" -} +## Example + +```ruby +subscription_group_prepayment = SubscriptionGroupPrepayment.new( + amount: 118, + details: 'details8', + memo: 'memo2', + method: SubscriptionGroupPrepaymentMethod::CHECK +) ``` diff --git a/doc/models/subscription-group-response.md b/doc/models/subscription-group-response.md index 3440197..be2c1eb 100644 --- a/doc/models/subscription-group-response.md +++ b/doc/models/subscription-group-response.md @@ -11,25 +11,25 @@ | --- | --- | --- | --- | | `subscription_group` | [`SubscriptionGroup`](../../doc/models/subscription-group.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription_group": { - "uid": "uid8", - "customer_id": 220, - "payment_profile": { - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" - }, - "payment_collection_method": "prepaid", - "subscription_ids": [ +## Example + +```ruby +subscription_group_response = SubscriptionGroupResponse.new( + subscription_group: SubscriptionGroup.new( + uid: 'uid8', + customer_id: 220, + payment_profile: SubscriptionGroupPaymentProfile.new( + id: 44, + first_name: 'first_name4', + last_name: 'last_name2', + masked_card_number: 'masked_card_number2' + ), + payment_collection_method: CollectionMethod::PREPAID, + subscription_ids: [ 74, 75 ] - } -} + ) +) ``` diff --git a/doc/models/subscription-group-signup-component.md b/doc/models/subscription-group-signup-component.md index 38fbdb0..1dac02f 100644 --- a/doc/models/subscription-group-signup-component.md +++ b/doc/models/subscription-group-signup-component.md @@ -15,73 +15,73 @@ | `price_point_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `custom_price` | [`SubscriptionGroupComponentCustomPrice`](../../doc/models/subscription-group-component-custom-price.md) | Optional | Used in place of `price_point_id` to define a custom price point unique to the subscription. You still need to provide `component_id`. | -## Example (as JSON) +## Example -```json -{ - "component_id": "String1", - "allocated_quantity": "String5", - "unit_balance": "String9", - "price_point_id": "String5", - "custom_price": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +```ruby +subscription_group_signup_component = SubscriptionGroupSignupComponent.new( + component_id: 'String9', + allocated_quantity: 'String3', + unit_balance: 'String7', + price_point_id: 'String9', + custom_price: SubscriptionGroupComponentCustomPrice.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "overage_pricing": [ - { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - }, - { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - }, - { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } + overage_pricing: [ + ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 230, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 10 + ), + ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 230, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 10 + ), + ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 230, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 10 + ) ] - } -} + ) +) ``` diff --git a/doc/models/subscription-group-signup-error-response-exception.md b/doc/models/subscription-group-signup-error-response-exception.md index d96c43c..dec642d 100644 --- a/doc/models/subscription-group-signup-error-response-exception.md +++ b/doc/models/subscription-group-signup-error-response-exception.md @@ -11,60 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`SubscriptionGroupSignupError`](../../doc/models/subscription-group-signup-error.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "subscriptions": { - "0": { - "payment_profile.chargify_token": [ - "Chargify token not found" - ], - "product": [ - "Product must be among the Products for this Site" - ], - "product_price_point_id": [ - "Product price point must belong to product." - ], - "base": [ - "No payment method was on file for the $30.00 balance'" - ], - "payment_profile.expiration_month": [ - "Credit card expiration month: cannot be blank." - ], - "payment_profile.expiration_year": [ - "Credit card expiration year: cannot be blank." - ], - "payment_profile.full_number": [ - "Credit card number: cannot be blank." - ], - "payment_profile": [ - "payment_profile2" - ] - } - }, - "payer_reference": "payer_reference4", - "payer": { - "last_name": [ - "last_name5", - "last_name6" - ], - "first_name": [ - "first_name8" - ], - "email": [ - "email0", - "email9" - ] - }, - "subscription_group": [ - "subscription_group7", - "subscription_group8", - "subscription_group9" - ], - "payment_profile_id": "payment_profile_id8" - } -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionGroupSignupErrorResponseException => e + puts "Caught SubscriptionGroupSignupErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/subscription-group-signup-error.md b/doc/models/subscription-group-signup-error.md index ab4b914..565ea84 100644 --- a/doc/models/subscription-group-signup-error.md +++ b/doc/models/subscription-group-signup-error.md @@ -16,67 +16,67 @@ | `payment_profile_id` | `String` | Optional | - | | `payer_id` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "subscriptions": { - "key0": { - "product": [ - "product9" +```ruby +subscription_group_signup_error = SubscriptionGroupSignupError.new( + subscriptions: { + 'key0': SubscriptionGroupSubscriptionError.new( + product: [ + 'product9' ], - "product_price_point_id": [ - "product_price_point_id7" + product_price_point_id: [ + 'product_price_point_id7' ], - "payment_profile": [ - "payment_profile2" + payment_profile: [ + 'payment_profile2' ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token6" + payment_profile_chargify_token: [ + 'payment_profile.chargify_token6' ], - "base": [ - "base5", - "base6" + base: [ + 'base5', + 'base6' ] - }, - "key1": { - "product": [ - "product9" + ), + 'key1': SubscriptionGroupSubscriptionError.new( + product: [ + 'product9' ], - "product_price_point_id": [ - "product_price_point_id7" + product_price_point_id: [ + 'product_price_point_id7' ], - "payment_profile": [ - "payment_profile2" + payment_profile: [ + 'payment_profile2' ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token6" + payment_profile_chargify_token: [ + 'payment_profile.chargify_token6' ], - "base": [ - "base5", - "base6" + base: [ + 'base5', + 'base6' ] - } + ) }, - "payer_reference": "payer_reference0", - "payer": { - "last_name": [ - "last_name5", - "last_name6" + payer_reference: 'payer_reference6', + payer: PayerError.new( + last_name: [ + 'last_name5', + 'last_name6' ], - "first_name": [ - "first_name8" + first_name: [ + 'first_name8' ], - "email": [ - "email0", - "email9" + email: [ + 'email0', + 'email9' ] - }, - "subscription_group": [ - "subscription_group1", - "subscription_group2" + ), + subscription_group: [ + 'subscription_group7', + 'subscription_group8' ], - "payment_profile_id": "payment_profile_id2" -} + payment_profile_id: 'payment_profile_id8' +) ``` diff --git a/doc/models/subscription-group-signup-event-data.md b/doc/models/subscription-group-signup-event-data.md index ac30e58..ea9c3e7 100644 --- a/doc/models/subscription-group-signup-event-data.md +++ b/doc/models/subscription-group-signup-event-data.md @@ -12,30 +12,30 @@ | `subscription_group` | [`SubscriptionGroupSignupFailureData`](../../doc/models/subscription-group-signup-failure-data.md) | Required | - | | `customer` | [`Customer`](../../doc/models/customer.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription_group": { - "payer_id": 150, - "payer_reference": "payer_reference6", - "payment_profile_id": 128, - "payment_collection_method": "payment_collection_method8", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } - }, - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} +## Example + +```ruby +subscription_group_signup_event_data = SubscriptionGroupSignupEventData.new( + subscription_group: SubscriptionGroupSignupFailureData.new( + payer_id: 150, + payer_reference: 'payer_reference6', + payment_profile_id: 128, + payment_collection_method: 'payment_collection_method8', + payer_attributes: PayerAttributes.new( + first_name: 'first_name2', + last_name: 'last_name0', + email: 'email4', + cc_emails: 'cc_emails2', + organization: 'organization6' + ) + ), + customer: Customer.new( + first_name: 'first_name0', + last_name: 'last_name8', + email: 'email6', + cc_emails: 'cc_emails0', + organization: 'organization6' + ) +) ``` diff --git a/doc/models/subscription-group-signup-failure-data.md b/doc/models/subscription-group-signup-failure-data.md index 75682b9..0cec55c 100644 --- a/doc/models/subscription-group-signup-failure-data.md +++ b/doc/models/subscription-group-signup-failure-data.md @@ -18,21 +18,21 @@ | `bank_account_attributes` | [`SubscriptionGroupBankAccount`](../../doc/models/subscription-group-bank-account.md) | Optional | - | | `subscriptions` | [`Array[SubscriptionGroupSignupItem]`](../../doc/models/subscription-group-signup-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "payer_id": 16, - "payer_reference": "payer_reference8", - "payment_profile_id": 6, - "payment_collection_method": "payment_collection_method0", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } -} +## Example + +```ruby +subscription_group_signup_failure_data = SubscriptionGroupSignupFailureData.new( + payer_id: 218, + payer_reference: 'payer_reference2', + payment_profile_id: 196, + payment_collection_method: 'payment_collection_method0', + payer_attributes: PayerAttributes.new( + first_name: 'first_name2', + last_name: 'last_name0', + email: 'email4', + cc_emails: 'cc_emails2', + organization: 'organization6' + ) +) ``` diff --git a/doc/models/subscription-group-signup-item.md b/doc/models/subscription-group-signup-item.md index 4a81024..2684af4 100644 --- a/doc/models/subscription-group-signup-item.md +++ b/doc/models/subscription-group-signup-item.md @@ -13,29 +13,29 @@ | `product_id` | `Integer` | Optional | The Product ID of the product for which you are creating a subscription. You can pass either `product_id` or `product_handle`. | | `product_price_point_id` | `Integer` | Optional | The ID of the particular price point on the product. | | `product_price_point_handle` | `String` | Optional | The user-friendly API handle of a product's particular price point. | -| `offer_id` | `Integer` | Optional | Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify ID of the offer or its handle prefixed with `handle:` | -| `reference` | `String` | Optional | The reference value (provided by your app) for the subscription itelf. | +| `offer_id` | `Integer` | Optional | Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify ID of the offer or its handle prefixed with `handle:`. | +| `reference` | `String` | Optional | The reference value (provided by your app) for the subscription itself. | | `primary` | `TrueClass \| FalseClass` | Optional | One of the subscriptions must be marked as primary in the group. | | `currency` | `String` | Optional | (Optional) If Multi-Currency is enabled and the currency is configured in Chargify, pass it at signup to create a subscription on a non-default currency. Note that you cannot update the currency of an existing subscription. | | `coupon_codes` | `Array[String]` | Optional | An array for all the coupons attached to the subscription. | | `components` | [`Array[SubscriptionGroupSignupComponent]`](../../doc/models/subscription-group-signup-component.md) | Optional | - | | `custom_price` | [`SubscriptionCustomPrice`](../../doc/models/subscription-custom-price.md) | Optional | (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription. A subscription can have up to 30 custom price points. Exceeding this limit will result in an API error. | -| `calendar_billing` | [`CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at | +| `calendar_billing` | [`CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at. | | `metafields` | `Hash[String, String]` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | -## Example (as JSON) - -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "product_handle": "product_handle2", - "product_id": 34, - "product_price_point_id": 214, - "product_price_point_handle": "product_price_point_handle4", - "offer_id": 150 -} +## Example + +```ruby +subscription_group_signup_item = SubscriptionGroupSignupItem.new( + product_handle: 'product_handle2', + product_id: 216, + product_price_point_id: 140, + product_price_point_handle: 'product_price_point_handle4', + offer_id: 224, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' + } +) ``` diff --git a/doc/models/subscription-group-signup-request.md b/doc/models/subscription-group-signup-request.md index 3258d8f..1df064a 100644 --- a/doc/models/subscription-group-signup-request.md +++ b/doc/models/subscription-group-signup-request.md @@ -11,36 +11,36 @@ | --- | --- | --- | --- | | `subscription_group` | [`SubscriptionGroupSignup`](../../doc/models/subscription-group-signup.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription_group": { - "subscriptions": [ - { - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "product_handle": "product_handle8", - "product_id": 144, - "product_price_point_id": 68, - "product_price_point_handle": "product_price_point_handle4", - "offer_id": 40 - } +## Example + +```ruby +subscription_group_signup_request = SubscriptionGroupSignupRequest.new( + subscription_group: SubscriptionGroupSignup.new( + subscriptions: [ + SubscriptionGroupSignupItem.new( + product_handle: 'product_handle8', + product_id: 144, + product_price_point_id: 68, + product_price_point_handle: 'product_price_point_handle4', + offer_id: 40, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' + } + ) ], - "payment_profile_id": 128, - "payer_id": 150, - "payer_reference": "payer_reference6", - "payment_collection_method": "prepaid", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } - } -} + payment_profile_id: 128, + payer_id: 150, + payer_reference: 'payer_reference6', + payment_collection_method: CollectionMethod::PREPAID, + payer_attributes: PayerAttributes.new( + first_name: 'first_name2', + last_name: 'last_name0', + email: 'email4', + cc_emails: 'cc_emails2', + organization: 'organization6' + ) + ) +) ``` diff --git a/doc/models/subscription-group-signup-response.md b/doc/models/subscription-group-signup-response.md index ad0bfeb..1ade5d0 100644 --- a/doc/models/subscription-group-signup-response.md +++ b/doc/models/subscription-group-signup-response.md @@ -21,19 +21,19 @@ | `subscriptions` | [`Array[SubscriptionGroupItem]`](../../doc/models/subscription-group-item.md) | Optional | - | | `payment_collection_method` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "scheme": 28, - "customer_id": 48, - "payment_profile_id": 44, - "subscription_ids": [ - 158, - 159, - 160 +## Example + +```ruby +subscription_group_signup_response = SubscriptionGroupSignupResponse.new( + uid: 'uid8', + scheme: 62, + customer_id: 82, + payment_profile_id: 10, + subscription_ids: [ + 192, + 193, + 194 ] -} +) ``` diff --git a/doc/models/subscription-group-signup.md b/doc/models/subscription-group-signup.md index a4b1fac..f90339b 100644 --- a/doc/models/subscription-group-signup.md +++ b/doc/models/subscription-group-signup.md @@ -18,34 +18,34 @@ | `bank_account_attributes` | [`SubscriptionGroupBankAccount`](../../doc/models/subscription-group-bank-account.md) | Optional | - | | `subscriptions` | [`Array[SubscriptionGroupSignupItem]`](../../doc/models/subscription-group-signup-item.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscriptions": [ - { - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "product_handle": "product_handle8", - "product_id": 144, - "product_price_point_id": 68, - "product_price_point_handle": "product_price_point_handle4", - "offer_id": 40 - } +## Example + +```ruby +subscription_group_signup = SubscriptionGroupSignup.new( + subscriptions: [ + SubscriptionGroupSignupItem.new( + product_handle: 'product_handle8', + product_id: 144, + product_price_point_id: 68, + product_price_point_handle: 'product_price_point_handle4', + offer_id: 40, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' + } + ) ], - "payment_profile_id": 42, - "payer_id": 64, - "payer_reference": "payer_reference8", - "payment_collection_method": "automatic", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } -} + payment_profile_id: 232, + payer_id: 254, + payer_reference: 'payer_reference2', + payment_collection_method: CollectionMethod::PREPAID, + payer_attributes: PayerAttributes.new( + first_name: 'first_name2', + last_name: 'last_name0', + email: 'email4', + cc_emails: 'cc_emails2', + organization: 'organization6' + ) +) ``` diff --git a/doc/models/subscription-group-single-error.md b/doc/models/subscription-group-single-error.md index 9eb0e03..ff3d18b 100644 --- a/doc/models/subscription-group-single-error.md +++ b/doc/models/subscription-group-single-error.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `subscription_group` | `String` | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_group": "subscription_group2" -} +```ruby +subscription_group_single_error = SubscriptionGroupSingleError.new( + subscription_group: 'subscription_group4' +) ``` diff --git a/doc/models/subscription-group-subscription-error.md b/doc/models/subscription-group-subscription-error.md index 1940968..1d3e393 100644 --- a/doc/models/subscription-group-subscription-error.md +++ b/doc/models/subscription-group-subscription-error.md @@ -20,31 +20,26 @@ Object which contains subscription errors. | `payment_profile_expiration_year` | `Array[String]` | Optional | - | | `payment_profile_full_number` | `Array[String]` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "product": [ - "product7", - "product6" +```ruby +subscription_group_subscription_error = SubscriptionGroupSubscriptionError.new( + product: [ + 'product1' ], - "product_price_point_id": [ - "product_price_point_id9", - "product_price_point_id0" + product_price_point_id: [ + 'product_price_point_id7' ], - "payment_profile": [ - "payment_profile4", - "payment_profile5" + payment_profile: [ + 'payment_profile2' ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token8", - "payment_profile.chargify_token9" + payment_profile_chargify_token: [ + 'payment_profile.chargify_token6' ], - "base": [ - "base7", - "base8", - "base9" + base: [ + 'base5', + 'base6' ] -} +) ``` diff --git a/doc/models/subscription-group-update-error-response-exception.md b/doc/models/subscription-group-update-error-response-exception.md index a5889eb..20e022c 100644 --- a/doc/models/subscription-group-update-error-response-exception.md +++ b/doc/models/subscription-group-update-error-response-exception.md @@ -11,16 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`SubscriptionGroupUpdateError`](../../doc/models/subscription-group-update-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "members": [ - "members2", - "members1" - ] - } -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionGroupUpdateErrorResponseException => e + puts "Caught SubscriptionGroupUpdateErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/subscription-group-update-error.md b/doc/models/subscription-group-update-error.md index 13309af..0606cfa 100644 --- a/doc/models/subscription-group-update-error.md +++ b/doc/models/subscription-group-update-error.md @@ -11,15 +11,15 @@ | --- | --- | --- | --- | | `members` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "members": [ - "members4", - "members5", - "members6" +## Example + +```ruby +subscription_group_update_error = SubscriptionGroupUpdateError.new( + members: [ + 'members6', + 'members5', + 'members4' ] -} +) ``` diff --git a/doc/models/subscription-group.md b/doc/models/subscription-group.md index cf6ea59..c97d656 100644 --- a/doc/models/subscription-group.md +++ b/doc/models/subscription-group.md @@ -16,24 +16,23 @@ | `subscription_ids` | `Array[Integer]` | Optional | - | | `created_at` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "customer_id": 36, - "payment_profile": { - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" - }, - "payment_collection_method": "prepaid", - "subscription_ids": [ - 146, - 147, - 148 +## Example + +```ruby +subscription_group = SubscriptionGroup.new( + uid: 'uid8', + customer_id: 220, + payment_profile: SubscriptionGroupPaymentProfile.new( + id: 44, + first_name: 'first_name4', + last_name: 'last_name2', + masked_card_number: 'masked_card_number2' + ), + payment_collection_method: CollectionMethod::PREPAID, + subscription_ids: [ + 74, + 75 ] -} +) ``` diff --git a/doc/models/subscription-groups-list-include.md b/doc/models/subscription-groups-list-include.md index 27d18a0..43435a6 100644 --- a/doc/models/subscription-groups-list-include.md +++ b/doc/models/subscription-groups-list-include.md @@ -11,3 +11,9 @@ | --- | | `ACCOUNT_BALANCES` | +## Example + +```ruby +subscription_groups_list_include = SubscriptionGroupsListInclude::ACCOUNT_BALANCES +``` + diff --git a/doc/models/subscription-include.md b/doc/models/subscription-include.md index 639f7da..d2c67b4 100644 --- a/doc/models/subscription-include.md +++ b/doc/models/subscription-include.md @@ -12,3 +12,9 @@ | `COUPONS` | | `SELF_SERVICE_PAGE_TOKEN` | +## Example + +```ruby +subscription_include = SubscriptionInclude::COUPONS +``` + diff --git a/doc/models/subscription-included-coupon.md b/doc/models/subscription-included-coupon.md index d35a6f0..6ddd743 100644 --- a/doc/models/subscription-included-coupon.md +++ b/doc/models/subscription-included-coupon.md @@ -17,17 +17,17 @@ | `amount_in_cents` | `Integer` | Optional | **Constraints**: `>= 0` | | `percentage` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "code": "\"ABCD_10\"", - "use_count": 2, - "uses_allowed": 10, - "expires_at": "\"2023-07-13T05:18:58-04:00\"", - "amount_in_cents": 1000, - "percentage": "\"15.0\"", - "recurring": false -} +## Example + +```ruby +subscription_included_coupon = SubscriptionIncludedCoupon.new( + code: '"ABCD_10"', + use_count: 2, + uses_allowed: 10, + expires_at: '"2023-07-13T05:18:58-04:00"', + recurring: false, + amount_in_cents: 1000, + percentage: '"15.0"' +) ``` diff --git a/doc/models/subscription-list-date-field.md b/doc/models/subscription-list-date-field.md index dc18409..76fcbc9 100644 --- a/doc/models/subscription-list-date-field.md +++ b/doc/models/subscription-list-date-field.md @@ -13,7 +13,7 @@ ## Example -``` -updated_at +```ruby +subscription_list_date_field = SubscriptionListDateField::UPDATED_AT ``` diff --git a/doc/models/subscription-list-include.md b/doc/models/subscription-list-include.md index 27fb9c1..20beffc 100644 --- a/doc/models/subscription-list-include.md +++ b/doc/models/subscription-list-include.md @@ -10,4 +10,14 @@ | Name | | --- | | `SELF_SERVICE_PAGE_TOKEN` | +| `CURRENT_ACCOUNT_BALANCE_IN_CENTS` | +| `CURRENT_BILLING_AMOUNT` | +| `THREE_DS_ACTION_LINK` | +| `COUPONS` | + +## Example + +```ruby +subscription_list_include = SubscriptionListInclude::THREE_DS_ACTION_LINK +``` diff --git a/doc/models/subscription-migration-preview-options.md b/doc/models/subscription-migration-preview-options.md index 7fe2066..2cea3a6 100644 --- a/doc/models/subscription-migration-preview-options.md +++ b/doc/models/subscription-migration-preview-options.md @@ -20,16 +20,16 @@ | `proration` | [`Proration`](../../doc/models/proration.md) | Optional | - | | `proration_date` | `DateTime` | Optional | The date that the proration is calculated from for the preview | -## Example (as JSON) - -```json -{ - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 242, - "product_price_point_id": 166 -} +## Example + +```ruby +subscription_migration_preview_options = SubscriptionMigrationPreviewOptions.new( + product_id: 8, + product_price_point_id: 188, + include_trial: false, + include_initial_charge: false, + include_coupons: true, + preserve_period: false +) ``` diff --git a/doc/models/subscription-migration-preview-request.md b/doc/models/subscription-migration-preview-request.md index bc50173..9380acc 100644 --- a/doc/models/subscription-migration-preview-request.md +++ b/doc/models/subscription-migration-preview-request.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `migration` | [`SubscriptionMigrationPreviewOptions`](../../doc/models/subscription-migration-preview-options.md) | Required | - | -## Example (as JSON) - -```json -{ - "migration": { - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 158, - "product_price_point_id": 82 - } -} +## Example + +```ruby +subscription_migration_preview_request = SubscriptionMigrationPreviewRequest.new( + migration: SubscriptionMigrationPreviewOptions.new( + product_id: 158, + product_price_point_id: 82, + include_trial: false, + include_initial_charge: false, + include_coupons: true, + preserve_period: false + ) +) ``` diff --git a/doc/models/subscription-migration-preview-response.md b/doc/models/subscription-migration-preview-response.md index a46b86d..13ec165 100644 --- a/doc/models/subscription-migration-preview-response.md +++ b/doc/models/subscription-migration-preview-response.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `migration` | [`SubscriptionMigrationPreview`](../../doc/models/subscription-migration-preview.md) | Required | - | -## Example (as JSON) - -```json -{ - "migration": { - "prorated_adjustment_in_cents": 196, - "charge_in_cents": 78, - "payment_due_in_cents": 250, - "credit_applied_in_cents": 210 - } -} +## Example + +```ruby +subscription_migration_preview_response = SubscriptionMigrationPreviewResponse.new( + migration: SubscriptionMigrationPreview.new( + prorated_adjustment_in_cents: 196, + charge_in_cents: 78, + payment_due_in_cents: 250, + credit_applied_in_cents: 210 + ) +) ``` diff --git a/doc/models/subscription-migration-preview.md b/doc/models/subscription-migration-preview.md index 41f08c1..8ff6e39 100644 --- a/doc/models/subscription-migration-preview.md +++ b/doc/models/subscription-migration-preview.md @@ -14,14 +14,14 @@ | `payment_due_in_cents` | `Integer` | Optional | The amount of the payment due in the case of an upgrade. | | `credit_applied_in_cents` | `Integer` | Optional | Represents a credit in cents that is applied to your subscription as part of a migration process for a specific product, which reduces the amount owed for the subscription. | -## Example (as JSON) - -```json -{ - "prorated_adjustment_in_cents": 134, - "charge_in_cents": 16, - "payment_due_in_cents": 188, - "credit_applied_in_cents": 148 -} +## Example + +```ruby +subscription_migration_preview = SubscriptionMigrationPreview.new( + prorated_adjustment_in_cents: 176, + charge_in_cents: 58, + payment_due_in_cents: 230, + credit_applied_in_cents: 190 +) ``` diff --git a/doc/models/subscription-mrr-breakout.md b/doc/models/subscription-mrr-breakout.md index f8ba7e4..2bc61bd 100644 --- a/doc/models/subscription-mrr-breakout.md +++ b/doc/models/subscription-mrr-breakout.md @@ -12,12 +12,12 @@ | `plan_amount_in_cents` | `Integer` | Required | - | | `usage_amount_in_cents` | `Integer` | Required | - | -## Example (as JSON) +## Example -```json -{ - "plan_amount_in_cents": 208, - "usage_amount_in_cents": 60 -} +```ruby +subscription_mrr_breakout = SubscriptionMRRBreakout.new( + plan_amount_in_cents: 214, + usage_amount_in_cents: 66 +) ``` diff --git a/doc/models/subscription-mrr-response.md b/doc/models/subscription-mrr-response.md index 830ca6c..2146585 100644 --- a/doc/models/subscription-mrr-response.md +++ b/doc/models/subscription-mrr-response.md @@ -11,20 +11,20 @@ | --- | --- | --- | --- | | `subscriptions_mrr` | [`Array[SubscriptionMRR]`](../../doc/models/subscription-mrr.md) | Required | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -## Example (as JSON) - -```json -{ - "subscriptions_mrr": [ - { - "subscription_id": 0, - "mrr_amount_in_cents": 0, - "breakouts": { - "plan_amount_in_cents": 0, - "usage_amount_in_cents": 0 - } - } +## Example + +```ruby +subscription_mrr_response = SubscriptionMRRResponse.new( + subscriptions_mrr: [ + SubscriptionMRR.new( + subscription_id: 0, + mrr_amount_in_cents: 0, + breakouts: SubscriptionMRRBreakout.new( + plan_amount_in_cents: 0, + usage_amount_in_cents: 0 + ) + ) ] -} +) ``` diff --git a/doc/models/subscription-mrr.md b/doc/models/subscription-mrr.md index f94116a..e02bf32 100644 --- a/doc/models/subscription-mrr.md +++ b/doc/models/subscription-mrr.md @@ -13,16 +13,16 @@ | `mrr_amount_in_cents` | `Integer` | Required | - | | `breakouts` | [`SubscriptionMRRBreakout`](../../doc/models/subscription-mrr-breakout.md) | Optional | - | -## Example (as JSON) - -```json -{ - "subscription_id": 4, - "mrr_amount_in_cents": 22, - "breakouts": { - "plan_amount_in_cents": 254, - "usage_amount_in_cents": 106 - } -} +## Example + +```ruby +subscription_mrr = SubscriptionMRR.new( + subscription_id: 186, + mrr_amount_in_cents: 204, + breakouts: SubscriptionMRRBreakout.new( + plan_amount_in_cents: 254, + usage_amount_in_cents: 106 + ) +) ``` diff --git a/doc/models/subscription-note-response.md b/doc/models/subscription-note-response.md index aaf7794..5a46523 100644 --- a/doc/models/subscription-note-response.md +++ b/doc/models/subscription-note-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `note` | [`SubscriptionNote`](../../doc/models/subscription-note.md) | Required | - | -## Example (as JSON) - -```json -{ - "note": { - "id": 28, - "body": "body0", - "subscription_id": 138, - "created_at": "2016-03-13T12:52:32.123Z", - "updated_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +subscription_note_response = SubscriptionNoteResponse.new( + note: SubscriptionNote.new( + id: 28, + body: 'body0', + subscription_id: 138, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + updated_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/subscription-note.md b/doc/models/subscription-note.md index 93a0bcd..e1da9be 100644 --- a/doc/models/subscription-note.md +++ b/doc/models/subscription-note.md @@ -16,15 +16,15 @@ | `updated_at` | `DateTime` | Optional | - | | `sticky` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 36, - "body": "body4", - "subscription_id": 146, - "created_at": "2016-03-13T12:52:32.123Z", - "updated_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +subscription_note = SubscriptionNote.new( + id: 114, + body: 'body0', + subscription_id: 224, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + updated_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/subscription-preview-response.md b/doc/models/subscription-preview-response.md index cb4ea15..9831f25 100644 --- a/doc/models/subscription-preview-response.md +++ b/doc/models/subscription-preview-response.md @@ -11,56 +11,56 @@ | --- | --- | --- | --- | | `subscription_preview` | [`SubscriptionPreview`](../../doc/models/subscription-preview.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_preview": { - "current_billing_manifest": { - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } +```ruby +subscription_preview_response = SubscriptionPreviewResponse.new( + subscription_preview: SubscriptionPreview.new( + current_billing_manifest: BillingManifest.new( + line_items: [ + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ) ], - "total_in_cents": 38, - "total_discount_in_cents": 24, - "total_tax_in_cents": 18, - "subtotal_in_cents": 150 - }, - "next_billing_manifest": { - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } + total_in_cents: 38, + total_discount_in_cents: 24, + total_tax_in_cents: 18, + subtotal_in_cents: 150 + ), + next_billing_manifest: BillingManifest.new( + line_items: [ + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ), + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ), + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ) ], - "total_in_cents": 62, - "total_discount_in_cents": 208, - "total_tax_in_cents": 42, - "subtotal_in_cents": 174 - } - } -} + total_in_cents: 62, + total_discount_in_cents: 208, + total_tax_in_cents: 42, + subtotal_in_cents: 174 + ) + ) +) ``` diff --git a/doc/models/subscription-preview.md b/doc/models/subscription-preview.md index 0ceb3da..3f5723e 100644 --- a/doc/models/subscription-preview.md +++ b/doc/models/subscription-preview.md @@ -12,54 +12,54 @@ | `current_billing_manifest` | [`BillingManifest`](../../doc/models/billing-manifest.md) | Optional | - | | `next_billing_manifest` | [`BillingManifest`](../../doc/models/billing-manifest.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "current_billing_manifest": { - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } +```ruby +subscription_preview = SubscriptionPreview.new( + current_billing_manifest: BillingManifest.new( + line_items: [ + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ) ], - "total_in_cents": 38, - "total_discount_in_cents": 24, - "total_tax_in_cents": 18, - "subtotal_in_cents": 150 - }, - "next_billing_manifest": { - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } + total_in_cents: 38, + total_discount_in_cents: 24, + total_tax_in_cents: 18, + subtotal_in_cents: 150 + ), + next_billing_manifest: BillingManifest.new( + line_items: [ + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ), + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ), + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ) ], - "total_in_cents": 62, - "total_discount_in_cents": 208, - "total_tax_in_cents": 42, - "subtotal_in_cents": 174 - } -} + total_in_cents: 62, + total_discount_in_cents: 208, + total_tax_in_cents: 42, + subtotal_in_cents: 174 + ) +) ``` diff --git a/doc/models/subscription-product-change-scheduled.md b/doc/models/subscription-product-change-scheduled.md new file mode 100644 index 0000000..b397669 --- /dev/null +++ b/doc/models/subscription-product-change-scheduled.md @@ -0,0 +1,29 @@ + +# Subscription Product Change Scheduled + +## Structure + +`SubscriptionProductChangeScheduled` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `previous_product_id` | `Integer` | Required | - | +| `new_product_id` | `Integer` | Required | - | +| `previous_product_price_point_id` | `Integer` | Optional | - | +| `new_product_price_point_id` | `Integer` | Optional | - | +| `effective_at` | `DateTime` | Optional | When the scheduled product change takes effect (the subscription's next renewal). | + +## Example + +```ruby +subscription_product_change_scheduled = SubscriptionProductChangeScheduled.new( + previous_product_id: 50, + new_product_id: 64, + previous_product_price_point_id: 174, + new_product_price_point_id: 168, + effective_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) +``` + diff --git a/doc/models/subscription-product-change.md b/doc/models/subscription-product-change.md index 8490bc7..212566e 100644 --- a/doc/models/subscription-product-change.md +++ b/doc/models/subscription-product-change.md @@ -12,12 +12,12 @@ | `previous_product_id` | `Integer` | Required | - | | `new_product_id` | `Integer` | Required | - | -## Example (as JSON) +## Example -```json -{ - "previous_product_id": 126, - "new_product_id": 12 -} +```ruby +subscription_product_change = SubscriptionProductChange.new( + previous_product_id: 250, + new_product_id: 120 +) ``` diff --git a/doc/models/subscription-product-migration-request.md b/doc/models/subscription-product-migration-request.md index 5b26993..96bf66e 100644 --- a/doc/models/subscription-product-migration-request.md +++ b/doc/models/subscription-product-migration-request.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `migration` | [`SubscriptionProductMigration`](../../doc/models/subscription-product-migration.md) | Required | - | -## Example (as JSON) - -```json -{ - "migration": { - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 158, - "product_price_point_id": 82 - } -} +## Example + +```ruby +subscription_product_migration_request = SubscriptionProductMigrationRequest.new( + migration: SubscriptionProductMigration.new( + product_id: 158, + product_price_point_id: 82, + include_trial: false, + include_initial_charge: false, + include_coupons: true, + preserve_period: false + ) +) ``` diff --git a/doc/models/subscription-product-migration.md b/doc/models/subscription-product-migration.md index 1b28420..6b921c9 100644 --- a/doc/models/subscription-product-migration.md +++ b/doc/models/subscription-product-migration.md @@ -19,16 +19,16 @@ | `product_price_point_handle` | `String` | Optional | The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. | | `proration` | [`Proration`](../../doc/models/proration.md) | Optional | - | -## Example (as JSON) - -```json -{ - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 8, - "product_price_point_id": 172 -} +## Example + +```ruby +subscription_product_migration = SubscriptionProductMigration.new( + product_id: 234, + product_price_point_id: 158, + include_trial: false, + include_initial_charge: false, + include_coupons: true, + preserve_period: false +) ``` diff --git a/doc/models/subscription-purge-type.md b/doc/models/subscription-purge-type.md index cd25299..7423cfa 100644 --- a/doc/models/subscription-purge-type.md +++ b/doc/models/subscription-purge-type.md @@ -12,3 +12,9 @@ | `CUSTOMER` | | `PAYMENT_PROFILE` | +## Example + +```ruby +subscription_purge_type = SubscriptionPurgeType::CUSTOMER +``` + diff --git a/doc/models/subscription-remove-coupon-errors-exception.md b/doc/models/subscription-remove-coupon-errors-exception.md index 360c938..0dde962 100644 --- a/doc/models/subscription-remove-coupon-errors-exception.md +++ b/doc/models/subscription-remove-coupon-errors-exception.md @@ -11,13 +11,13 @@ | --- | --- | --- | --- | | `subscription` | `Array[String]` | Required | - | -## Example (as JSON) - -```json -{ - "subscription": [ - "subscription0" - ] -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionRemoveCouponErrorsException => e + puts "Caught SubscriptionRemoveCouponErrorsException: #{e.message}" +end ``` diff --git a/doc/models/subscription-response-error-exception.md b/doc/models/subscription-response-error-exception.md index 7431e8a..d5c397d 100644 --- a/doc/models/subscription-response-error-exception.md +++ b/doc/models/subscription-response-error-exception.md @@ -11,17 +11,13 @@ | --- | --- | --- | --- | | `subscription` | [`Subscription`](../../doc/models/subscription.md) | Optional | - | -## Example (as JSON) - -```json -{ - "subscription": { - "id": 8, - "state": "paused", - "balance_in_cents": 124, - "total_revenue_in_cents": 48, - "product_price_in_cents": 238 - } -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionResponseErrorException => e + puts "Caught SubscriptionResponseErrorException: #{e.message}" +end ``` diff --git a/doc/models/subscription-response.md b/doc/models/subscription-response.md index 90a394a..356a072 100644 --- a/doc/models/subscription-response.md +++ b/doc/models/subscription-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `subscription` | [`Subscription`](../../doc/models/subscription.md) | Optional | - | -## Example (as JSON) - -```json -{ - "subscription": { - "id": 8, - "state": "paused", - "balance_in_cents": 124, - "total_revenue_in_cents": 48, - "product_price_in_cents": 238 - } -} +## Example + +```ruby +subscription_response = SubscriptionResponse.new( + subscription: Subscription.new( + id: 8, + state: SubscriptionState::PAUSED, + balance_in_cents: 124, + total_revenue_in_cents: 48, + product_price_in_cents: 238 + ) +) ``` diff --git a/doc/models/subscription-sort.md b/doc/models/subscription-sort.md index b07e8ee..0a2773d 100644 --- a/doc/models/subscription-sort.md +++ b/doc/models/subscription-sort.md @@ -20,3 +20,9 @@ | `OPEN_BALANCE` | | `EXPIRES_AT` | +## Example + +```ruby +subscription_sort = SubscriptionSort::OPEN_BALANCE +``` + diff --git a/doc/models/subscription-state-change.md b/doc/models/subscription-state-change.md index 1431d7d..68065e2 100644 --- a/doc/models/subscription-state-change.md +++ b/doc/models/subscription-state-change.md @@ -12,12 +12,12 @@ | `previous_subscription_state` | `String` | Required | **Constraints**: *Minimum Length*: `1` | | `new_subscription_state` | `String` | Required | **Constraints**: *Minimum Length*: `1` | -## Example (as JSON) +## Example -```json -{ - "previous_subscription_state": "previous_subscription_state2", - "new_subscription_state": "new_subscription_state6" -} +```ruby +subscription_state_change = SubscriptionStateChange.new( + previous_subscription_state: 'previous_subscription_state4', + new_subscription_state: 'new_subscription_state8' +) ``` diff --git a/doc/models/subscription-state-filter.md b/doc/models/subscription-state-filter.md index 148d411..6b98633 100644 --- a/doc/models/subscription-state-filter.md +++ b/doc/models/subscription-state-filter.md @@ -15,12 +15,23 @@ Allowed values for filtering by the current state of the subscription. | `CANCELED` | | `EXPIRED` | | `EXPIRED_CARDS` | +| `ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS` | +| `ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS` | | `ON_HOLD` | +| `AWAITING_SIGNUP` | +| `AWAITING_SIGNUP_DATE` | | `PAST_DUE` | | `PENDING_CANCELLATION` | | `PENDING_RENEWAL` | +| `PREPAID_DUNNING` | | `SUSPENDED` | | `TRIAL_ENDED` | | `TRIALING` | | `UNPAID` | +## Example + +```ruby +subscription_state_filter = SubscriptionStateFilter::SUSPENDED +``` + diff --git a/doc/models/subscription-state.md b/doc/models/subscription-state.md index 6e89362..5e5e1ff 100644 --- a/doc/models/subscription-state.md +++ b/doc/models/subscription-state.md @@ -48,3 +48,9 @@ See [Subscription States](https://maxio.zendesk.com/hc/en-us/articles/2425211902 | `ON_HOLD` | | `AWAITING_SIGNUP` | +## Example + +```ruby +subscription_state = SubscriptionState::ACTIVE +``` + diff --git a/doc/models/subscription.md b/doc/models/subscription.md index f48bbf2..de85052 100644 --- a/doc/models/subscription.md +++ b/doc/models/subscription.md @@ -13,13 +13,13 @@ | `state` | [`SubscriptionState`](../../doc/models/subscription-state.md) | Optional | The state of a subscription.

* **Live States**
* `active` - A normal, active subscription. It is not in a trial and is paid and up to date.
* `assessing` - An internal (transient) state that indicates a subscription is in the middle of periodic assessment. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `pending` - An internal (transient) state that indicates a subscription is in the creation process. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `trialing` - A subscription in trialing state has a valid trial subscription. This type of subscription may transition to active once payment is received when the trial has ended. Otherwise, it may go to a Problem or End of Life state.
* `paused` - An internal state that indicates that your account with Advanced Billing is in arrears.
* **Problem States**
* `past_due` - Indicates that the most recent payment has failed, and payment is past due for this subscription. If you have enabled our automated dunning, this subscription will be in the dunning process (additional status and callbacks from the dunning process will be available in the future). If you are handling dunning and payment updates yourself, you will want to use this state to initiate a payment update from your customers.
* `soft_failure` - Indicates that normal assessment/processing of the subscription has failed for a reason that cannot be fixed by the Customer. For example, a Soft Fail may result from a timeout at the gateway or incorrect credentials on your part. The subscriptions should be retried automatically. An interface is being built for you to review problems resulting from these events to take manual action when needed.
* `unpaid` - Indicates an unpaid subscription. A subscription is marked unpaid if the retry period expires and you have configured your [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) settings to have a Final Action of `mark the subscription unpaid`.
* **End of Life States**
* `canceled` - Indicates a canceled subscription. This may happen at your request (via the API or the web interface) or due to the expiration of the [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) process without payment. See the [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming) documentation for info on how to restart a canceled subscription.
While a subscription is canceled, its period will not advance, it will not accrue any new charges, and Advanced Billing will not attempt to collect the overdue balance.
* `expired` - Indicates a subscription that has expired due to running its normal life cycle. Some products may be configured to have an expiration period. An expired subscription then is one that stayed active until it fulfilled its full period.
* `failed_to_create` - Indicates that signup has failed. (You may see this state in a signup_failure webhook.)
* `on_hold` - Indicates that a subscription’s billing has been temporarily stopped. While it is expected that the subscription will resume and return to active status, this is still treated as an “End of Life” state because the customer is not paying for services during this time.
* `suspended` - Indicates that a prepaid subscription has used up all their prepayment balance. If a prepayment is applied, it will return to an active state.
* `trial_ended` - A subscription in a trial_ended state is a subscription that completed a no-obligation trial and did not have a card on file at the expiration of the trial period. See [Product Pricing – No Obligation Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product-Editing) for more details.

See [Subscription States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscription-States) for more info about subscription states and state transitions. | | `balance_in_cents` | `Integer` | Optional | Gives the current outstanding subscription balance in the number of cents. | | `total_revenue_in_cents` | `Integer` | Optional | Gives the total revenue from the subscription in the number of cents. | -| `product_price_in_cents` | `Integer` | Optional | (Added Nov 5 2013) The recurring amount of the product (and version),currently subscribed. NOTE: this may differ from the current price of,the product, if you’ve changed the price of the product but haven’t,moved this subscription to a newer version. | +| `product_price_in_cents` | `Integer` | Optional | (Added Nov 5 2013) The recurring amount of the product (and version), currently subscribed. NOTE: this may differ from the current price of the product, if you’ve changed the price of the product but haven’t moved this subscription to a newer version. | | `product_version_number` | `Integer` | Optional | The version of the product for the subscription. Note that this is a deprecated field kept for backwards-compatibility. | -| `current_period_ends_at` | `DateTime` | Optional | Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly scheduled attempted charge will occur) | -| `next_assessment_at` | `DateTime` | Optional | Timestamp that indicates when capture of payment will be tried or,retried. This value will usually track the current_period_ends_at, but,will diverge if a renewal payment fails and must be retried. In that,case, the current_period_ends_at will advance to the end of the next,period (time doesn’t stop because a payment was missed) but the,next_assessment_at will be scheduled for the auto-retry time (i.e. 24,hours in the future, in some cases) | +| `current_period_ends_at` | `DateTime` | Optional | Timestamp relating to the end of the current (recurring) period (i.e., when the next regularly scheduled attempted charge will occur) | +| `next_assessment_at` | `DateTime` | Optional | Timestamp that indicates when capture of payment will be tried or retried. This value will usually track the current_period_ends_at, but will diverge if a renewal payment fails and must be retried. In that case, the current_period_ends_at will advance to the end of the next period (time doesn’t stop because a payment was missed) but the next_assessment_at will be scheduled for the auto-retry time (e.g., 24 hours in the future, in some cases). | | `trial_started_at` | `DateTime` | Optional | Timestamp for when the trial period (if any) began | | `trial_ended_at` | `DateTime` | Optional | Timestamp for when the trial period (if any) ended | -| `activated_at` | `DateTime` | Optional | Timestamp for when the subscription began (i.e. when it came out of trial, or when it began in the case of no trial) | +| `activated_at` | `DateTime` | Optional | Timestamp for when the subscription began (i.e., when it came out of trial, or when it began in the case of no trial) | | `expires_at` | `DateTime` | Optional | Timestamp giving the expiration date of this subscription (if any) | | `created_at` | `DateTime` | Optional | The creation date for this subscription | | `updated_at` | `DateTime` | Optional | The date of last update for this subscription | @@ -28,9 +28,9 @@ | `cancel_at_end_of_period` | `TrueClass \| FalseClass` | Optional | Whether or not the subscription will (or has) canceled at the end of the period. | | `canceled_at` | `DateTime` | Optional | The timestamp of the most recent cancellation | | `current_period_started_at` | `DateTime` | Optional | Timestamp relating to the start of the current (recurring) period | -| `previous_state` | [`SubscriptionState`](../../doc/models/subscription-state.md) | Optional | Only valid for webhook payloads The previous state for webhooks that have indicated a change in state. For normal API calls, this will always be the same as the state (current state) | +| `previous_state` | [`SubscriptionState`](../../doc/models/subscription-state.md) | Optional | Only valid for webhook payloads The previous state for webhooks that have indicated a change in state. For normal API calls, this will always be the same as the state (current state). | | `signup_payment_id` | `Integer` | Optional | The ID of the transaction that generated the revenue | -| `signup_revenue` | `String` | Optional | The revenue, formatted as a string of decimal separated dollars and,cents, from the subscription signup ($50.00 would be formatted as,50.00) | +| `signup_revenue` | `String` | Optional | The revenue, formatted as a string of decimal separated dollars and cents, from the subscription signup ($50.00 would be formatted as 50.00) | | `delayed_cancel_at` | `DateTime` | Optional | Timestamp for when the subscription is currently set to cancel. | | `coupon_code` | `String` | Optional | (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon. | | `snap_day` | `String` | Optional | A day of month that subscription will be processed on. Can be 1 up to 28 or 'end'. | @@ -46,7 +46,7 @@ | `next_product_handle` | `String` | Optional | If a delayed product change is scheduled, the handle of the product that the subscription will be changed to at the next renewal. | | `coupon_use_count` | `Integer` | Optional | (deprecated) How many times the subscription's single coupon has been used. This field has no replacement for multiple coupons. | | `coupon_uses_allowed` | `Integer` | Optional | (deprecated) How many times the subscription's single coupon may be used. This field has no replacement for multiple coupons. | -| `reason_code` | `String` | Optional | The churn reason code associated to a cancelled subscription. | +| `reason_code` | `String` | Optional | The churn reason code associated to a canceled subscription. | | `automatically_resume_at` | `DateTime` | Optional | The date the subscription is scheduled to automatically resume from the on_hold state. | | `coupon_codes` | `Array[String]` | Optional | An array for all the coupons attached to the subscription. | | `offer_id` | `Integer` | Optional | The ID of the offer associated with the subscription. | @@ -57,10 +57,10 @@ | `next_product_price_point_id` | `Integer` | Optional | If a delayed product change is scheduled, the ID of the product price point that the subscription will be changed to at the next renewal. | | `net_terms` | `Integer` | Optional | On Relationship Invoicing, the number of days before a renewal invoice is due. | | `stored_credential_transaction_id` | `Integer` | Optional | For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal. | -| `reference` | `String` | Optional | The reference value (provided by your app) for the subscription istelf. | +| `reference` | `String` | Optional | The reference value (provided by your app) for the subscription itself. | | `on_hold_at` | `DateTime` | Optional | The timestamp of the most recent on hold action. | -| `prepaid_dunning` | `TrueClass \| FalseClass` | Optional | Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled | -| `coupons` | [`Array[SubscriptionIncludedCoupon]`](../../doc/models/subscription-included-coupon.md) | Optional | Additional coupon data. To use this data you also have to include the following param in the request`include[]=coupons`.
Only in Read Subscription Endpoint. | +| `prepaid_dunning` | `TrueClass \| FalseClass` | Optional | Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled. | +| `coupons` | [`Array[SubscriptionIncludedCoupon]`](../../doc/models/subscription-included-coupon.md) | Optional | Additional coupon data. To use this data you also have to include the following param in the request: `include[]=coupons`.
Only in Read Subscription Endpoint. | | `dunning_communication_delay_enabled` | `TrueClass \| FalseClass` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute. | | `dunning_communication_delay_time_zone` | `String` | Optional | Time zone for the Dunning Communication Delay feature. | | `receives_invoice_emails` | `TrueClass \| FalseClass` | Optional | - | @@ -72,38 +72,38 @@ | `prepaid_configuration` | [`PrepaidConfiguration`](../../doc/models/prepaid-configuration.md) | Optional | - | | `self_service_page_token` | `String` | Optional | Returned only for list/read Subscription operation when `include[]=self_service_page_token` parameter is provided. | -## Example (as JSON) +## Example -```json -{ - "credit_card": { - "id": 10088716, - "first_name": "Test", - "last_name": "Subscription", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2022, - "customer_id": 14543792, - "current_vault": "bogus", - "vault_token": "1", - "billing_address": "123 Montana Way", - "billing_city": "Billings", - "billing_state": "MT", - "billing_zip": "59101", - "billing_country": "US", - "customer_vault_token": null, - "billing_address_2": "", - "payment_type": "credit_card", - "site_gateway_setting_id": 1, - "gateway_handle": null - }, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "id": 96, - "state": "soft_failure", - "balance_in_cents": 212, - "total_revenue_in_cents": 136, - "product_price_in_cents": 70 -} +```ruby +subscription = Subscription.new( + id: 8, + state: SubscriptionState::PAUSED, + balance_in_cents: 124, + total_revenue_in_cents: 48, + product_price_in_cents: 238, + credit_card: CreditCardPaymentProfile.new( + payment_type: PaymentType::CREDIT_CARD, + id: 10088716, + first_name: 'Test', + last_name: 'Subscription', + masked_card_number: 'XXXX-XXXX-XXXX-1', + card_type: CardType::BOGUS, + expiration_month: 1, + expiration_year: 2022, + customer_id: 14543792, + current_vault: CreditCardVault::BOGUS, + vault_token: '1', + billing_address: '123 Montana Way', + billing_city: 'Billings', + billing_state: 'MT', + billing_zip: '59101', + billing_country: 'US', + customer_vault_token: 'customer_vault_token2', + billing_address_2: '', + site_gateway_setting_id: 1, + gateway_handle: 'gateway_handle8' + ), + dunning_communication_delay_time_zone: '"Eastern Time (US & Canada)"' +) ``` diff --git a/doc/models/subscriptions-mrr-error-response-exception.md b/doc/models/subscriptions-mrr-error-response-exception.md index 5e2aa63..936ea4d 100644 --- a/doc/models/subscriptions-mrr-error-response-exception.md +++ b/doc/models/subscriptions-mrr-error-response-exception.md @@ -11,15 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`AttributeError`](../../doc/models/attribute-error.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "attribute": [ - "supplied value is invalid, expected ISO 8601 format" - ] - } -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionsMrrErrorResponseException => e + puts "Caught SubscriptionsMrrErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/tax-configuration-kind.md b/doc/models/tax-configuration-kind.md index ef95cf0..2492d7d 100644 --- a/doc/models/tax-configuration-kind.md +++ b/doc/models/tax-configuration-kind.md @@ -14,3 +14,9 @@ | `ENUM_LINKED_AVALARA` | | `ENUM_DIGITAL_RIVER` | +## Example + +```ruby +tax_configuration_kind = TaxConfigurationKind::CUSTOM +``` + diff --git a/doc/models/tax-configuration.md b/doc/models/tax-configuration.md index dbf1ab5..3f991ab 100644 --- a/doc/models/tax-configuration.md +++ b/doc/models/tax-configuration.md @@ -13,13 +13,13 @@ | `destination_address` | [`TaxDestinationAddress`](../../doc/models/tax-destination-address.md) | Optional | - | | `fully_configured` | `TrueClass \| FalseClass` | Optional | Returns `true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: https://maxio.zendesk.com/hc/en-us/articles/24287012608909-Taxes-Overview

**Default**: `false` | -## Example (as JSON) - -```json -{ - "kind": "custom", - "fully_configured": false, - "destination_address": "shipping_only" -} +## Example + +```ruby +tax_configuration = TaxConfiguration.new( + kind: TaxConfigurationKind::CUSTOM, + destination_address: TaxDestinationAddress::SHIPPING_THEN_BILLING, + fully_configured: false +) ``` diff --git a/doc/models/tax-destination-address.md b/doc/models/tax-destination-address.md index f2a5b2a..dd80eac 100644 --- a/doc/models/tax-destination-address.md +++ b/doc/models/tax-destination-address.md @@ -14,3 +14,9 @@ | `SHIPPING_ONLY` | | `BILLING_ONLY` | +## Example + +```ruby +tax_destination_address = TaxDestinationAddress::SHIPPING_ONLY +``` + diff --git a/doc/models/tokenized-payment-profile.md b/doc/models/tokenized-payment-profile.md index b030464..13ad980 100644 --- a/doc/models/tokenized-payment-profile.md +++ b/doc/models/tokenized-payment-profile.md @@ -14,14 +14,14 @@ | `gateway_handle` | `String` | Optional | - | | `customer_vault_token` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 72, - "vault_token": "vault_token2", - "gateway_handle": "gateway_handle8", - "customer_vault_token": "customer_vault_token8" -} +## Example + +```ruby +tokenized_payment_profile = TokenizedPaymentProfile.new( + id: 216, + vault_token: 'vault_token4', + gateway_handle: 'gateway_handle6', + customer_vault_token: 'customer_vault_token0' +) ``` diff --git a/doc/models/too-many-management-link-requests-error-exception.md b/doc/models/too-many-management-link-requests-error-exception.md index b3ec634..c6451df 100644 --- a/doc/models/too-many-management-link-requests-error-exception.md +++ b/doc/models/too-many-management-link-requests-error-exception.md @@ -11,14 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`TooManyManagementLinkRequests`](../../doc/models/too-many-management-link-requests.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "error": "error4", - "new_link_available_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +begin + # make the API call +rescue TooManyManagementLinkRequestsErrorException => e + puts "Caught TooManyManagementLinkRequestsErrorException: #{e.message}" +end ``` diff --git a/doc/models/too-many-management-link-requests.md b/doc/models/too-many-management-link-requests.md index cc9eb62..648b506 100644 --- a/doc/models/too-many-management-link-requests.md +++ b/doc/models/too-many-management-link-requests.md @@ -12,12 +12,12 @@ | `error` | `String` | Required | - | | `new_link_available_at` | `DateTime` | Required | - | -## Example (as JSON) +## Example -```json -{ - "error": "error2", - "new_link_available_at": "2016-03-13T12:52:32.123Z" -} +```ruby +too_many_management_link_requests = TooManyManagementLinkRequests.new( + error: 'error4', + new_link_available_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/trial-type.md b/doc/models/trial-type.md index 1298d99..ad5ec70 100644 --- a/doc/models/trial-type.md +++ b/doc/models/trial-type.md @@ -1,7 +1,7 @@ # Trial Type -Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. +Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. ## Enumeration @@ -14,3 +14,9 @@ Indicates how a trial is handled when the trail period ends and there is no cred | `NO_OBLIGATION` | | `PAYMENT_EXPECTED` | +## Example + +```ruby +trial_type = TrialType::NO_OBLIGATION +``` + diff --git a/doc/models/update-allocation-expiration-date.md b/doc/models/update-allocation-expiration-date.md index 09af677..11c884a 100644 --- a/doc/models/update-allocation-expiration-date.md +++ b/doc/models/update-allocation-expiration-date.md @@ -11,13 +11,13 @@ | --- | --- | --- | --- | | `allocation` | [`AllocationExpirationDate`](../../doc/models/allocation-expiration-date.md) | Optional | - | -## Example (as JSON) - -```json -{ - "allocation": { - "expires_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +update_allocation_expiration_date = UpdateAllocationExpirationDate.new( + allocation: AllocationExpirationDate.new( + expires_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/update-component-price-point-request.md b/doc/models/update-component-price-point-request.md index 20d0bc6..0a75478 100644 --- a/doc/models/update-component-price-point-request.md +++ b/doc/models/update-component-price-point-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `price_point` | [`UpdateComponentPricePoint`](../../doc/models/update-component-price-point.md) | Optional | - | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "use_site_exchange_rate": false, - "tax_included": false - } -} +## Example + +```ruby +update_component_price_point_request = UpdateComponentPricePointRequest.new( + price_point: UpdateComponentPricePoint.new( + name: 'name0', + handle: 'handle6', + pricing_scheme: PricingScheme::PER_UNIT, + use_site_exchange_rate: false, + tax_included: false + ) +) ``` diff --git a/doc/models/update-component-price-point.md b/doc/models/update-component-price-point.md index beff7fd..70380f6 100644 --- a/doc/models/update-component-price-point.md +++ b/doc/models/update-component-price-point.md @@ -14,19 +14,19 @@ | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. | | `tax_included` | `TrueClass \| FalseClass` | Optional | Whether or not the price point includes tax | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | | `prices` | [`Array[UpdatePrice]`](../../doc/models/update-price.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "use_site_exchange_rate": false, - "tax_included": false -} +```ruby +update_component_price_point = UpdateComponentPricePoint.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + use_site_exchange_rate: false, + tax_included: false +) ``` diff --git a/doc/models/update-component-request.md b/doc/models/update-component-request.md index 843437a..6adb67a 100644 --- a/doc/models/update-component-request.md +++ b/doc/models/update-component-request.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `component` | [`UpdateComponent`](../../doc/models/update-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "component": { - "item_category": "Business Software", - "handle": "handle4", - "name": "name8", - "description": "description2", - "accounting_code": "accounting_code4", - "taxable": false - } -} +## Example + +```ruby +update_component_request = UpdateComponentRequest.new( + component: UpdateComponent.new( + handle: 'handle4', + name: 'name8', + description: 'description2', + accounting_code: 'accounting_code4', + taxable: false, + item_category: ItemCategory::ENUM_BUSINESS_SOFTWARE + ) +) ``` diff --git a/doc/models/update-component.md b/doc/models/update-component.md index e0e8e33..facbddb 100644 --- a/doc/models/update-component.md +++ b/doc/models/update-component.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `handle` | `String` | Optional | - | -| `name` | `String` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | +| `name` | `String` | Optional | The name of the Component, suitable for display on statements. e.g., Text Messages. | | `description` | `String` | Optional | The description of the component. | | `accounting_code` | `String` | Optional | - | | `taxable` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is taxable or not. | @@ -18,17 +18,18 @@ | `item_category` | [`ItemCategory`](../../doc/models/item-category.md) | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | | `display_on_hosted_page` | `TrueClass \| FalseClass` | Optional | - | | `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | - -## Example (as JSON) - -```json -{ - "item_category": "Business Software", - "handle": "handle6", - "name": "name0", - "description": "description0", - "accounting_code": "accounting_code6", - "taxable": false -} +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | + +## Example + +```ruby +update_component = UpdateComponent.new( + handle: 'handle2', + name: 'name6', + description: 'description4', + accounting_code: 'accounting_code2', + taxable: false, + item_category: ItemCategory::ENUM_BUSINESS_SOFTWARE +) ``` diff --git a/doc/models/update-coupon-currency.md b/doc/models/update-coupon-currency.md index 9b132ab..4a0e2bf 100644 --- a/doc/models/update-coupon-currency.md +++ b/doc/models/update-coupon-currency.md @@ -12,12 +12,12 @@ | `currency` | `String` | Required | ISO code for the site defined currency. | | `price` | `Integer` | Required | Price for the given currency. | -## Example (as JSON) +## Example -```json -{ - "currency": "currency4", - "price": 146 -} +```ruby +update_coupon_currency = UpdateCouponCurrency.new( + currency: 'currency6', + price: 14 +) ``` diff --git a/doc/models/update-currency-price.md b/doc/models/update-currency-price.md index 4c33c3f..cd70a01 100644 --- a/doc/models/update-currency-price.md +++ b/doc/models/update-currency-price.md @@ -12,12 +12,12 @@ | `id` | `Integer` | Required | ID of the currency price record being updated | | `price` | `Float` | Required | New price for the given currency | -## Example (as JSON) +## Example -```json -{ - "id": 146, - "price": 71.86 -} +```ruby +update_currency_price = UpdateCurrencyPrice.new( + id: 186, + price: 72.26 +) ``` diff --git a/doc/models/update-currency-prices-request.md b/doc/models/update-currency-prices-request.md index 29e7fbe..5ff0b11 100644 --- a/doc/models/update-currency-prices-request.md +++ b/doc/models/update-currency-prices-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[UpdateCurrencyPrice]`](../../doc/models/update-currency-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "price": 233.74 - } +## Example + +```ruby +update_currency_prices_request = UpdateCurrencyPricesRequest.new( + currency_prices: [ + UpdateCurrencyPrice.new( + id: 50, + price: 233.74 + ) ] -} +) ``` diff --git a/doc/models/update-customer-request.md b/doc/models/update-customer-request.md index 1fa229e..58d0ca1 100644 --- a/doc/models/update-customer-request.md +++ b/doc/models/update-customer-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `customer` | [`UpdateCustomer`](../../doc/models/update-customer.md) | Required | - | -## Example (as JSON) - -```json -{ - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} +## Example + +```ruby +update_customer_request = UpdateCustomerRequest.new( + customer: UpdateCustomer.new( + first_name: 'first_name0', + last_name: 'last_name8', + email: 'email6', + cc_emails: 'cc_emails0', + organization: 'organization6' + ) +) ``` diff --git a/doc/models/update-customer.md b/doc/models/update-customer.md index 33f6879..97ab3a7 100644 --- a/doc/models/update-customer.md +++ b/doc/models/update-customer.md @@ -25,20 +25,22 @@ | `locale` | `String` | Optional | Set a specific language on a customer record. | | `vat_number` | `String` | Optional | - | | `tax_exempt` | `TrueClass \| FalseClass` | Optional | - | +| `surcharging` | `TrueClass \| FalseClass` | Optional | Whether surcharging is enabled for the customer. Only applied on sites where surcharging control is enabled. | | `tax_exempt_reason` | `String` | Optional | - | | `parent_id` | `Integer` | Optional | - | -| `verified` | `TrueClass \| FalseClass` | Optional | Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway | +| `verified` | `TrueClass \| FalseClass` | Optional | Is the customer verified to use ACH as a payment method. Available only on the Authorize.Net gateway. | | `salesforce_id` | `String` | Optional | The Salesforce ID of the customer | - -## Example (as JSON) - -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails8", - "organization": "organization6" -} +| `branding_theme_id` | `Integer` | Optional | The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. | + +## Example + +```ruby +update_customer = UpdateCustomer.new( + first_name: 'first_name4', + last_name: 'last_name2', + email: 'email2', + cc_emails: 'cc_emails6', + organization: 'organization8' +) ``` diff --git a/doc/models/update-invoice-item.md b/doc/models/update-invoice-item.md new file mode 100644 index 0000000..a73f139 --- /dev/null +++ b/doc/models/update-invoice-item.md @@ -0,0 +1,40 @@ + +# Update Invoice Item + +A line item change for a draft ad hoc invoice. Supports the same attributes as line items on invoice creation, plus `uid` and `_destroy` for updating or removing existing line items. + +## Structure + +`UpdateInvoiceItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `title` | `String` | Optional | - | +| `quantity` | Float \| String \| nil | Optional | This is a container for one-of cases. | +| `unit_price` | Float \| String \| nil | Optional | This is a container for one-of cases. | +| `taxable` | `TrueClass \| FalseClass` | Optional | Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes. If using AvaTax, a tax_code parameter must also be sent. | +| `tax_code` | `String` | Optional | A string representing the tax code related to the product type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | +| `period_range_start` | `String` | Optional | YYYY-MM-DD | +| `period_range_end` | `String` | Optional | YYYY-MM-DD | +| `product_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | +| `component_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | +| `price_point_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | +| `product_price_point_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | +| `description` | `String` | Optional | **Constraints**: *Maximum Length*: `255` | +| `uid` | `String` | Optional | Unique identifier of an existing line item on the invoice. When provided, the matching line item is updated with the submitted attributes. When omitted, a new line item is added to the invoice. | +| `destroy` | `TrueClass \| FalseClass` | Optional | Set to `true` together with `uid` to remove the matching line item from the invoice. Line items not referenced in the request remain unchanged. | + +## Example + +```ruby +update_invoice_item = UpdateInvoiceItem.new( + title: 'title4', + quantity: 29.28, + unit_price: 12.5, + taxable: false, + tax_code: 'tax_code6' +) +``` + diff --git a/doc/models/update-invoice-request.md b/doc/models/update-invoice-request.md new file mode 100644 index 0000000..06cb045 --- /dev/null +++ b/doc/models/update-invoice-request.md @@ -0,0 +1,51 @@ + +# Update Invoice Request + +Request payload for updating a draft ad hoc invoice. + +## Structure + +`UpdateInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoice` | [`UpdateInvoice`](../../doc/models/update-invoice.md) | Required | Attributes of a draft ad hoc invoice which can be updated. Only the submitted attributes are changed. | + +## Example + +```ruby +update_invoice_request = UpdateInvoiceRequest.new( + invoice: UpdateInvoice.new( + line_items: [ + UpdateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ), + UpdateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ), + UpdateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ) + ], + issue_date: Date.iso8601('2024-01-01'), + net_terms: 144, + payment_instructions: 'payment_instructions6', + memo: 'memo0' + ) +) +``` + diff --git a/doc/models/update-invoice.md b/doc/models/update-invoice.md new file mode 100644 index 0000000..0fabeb4 --- /dev/null +++ b/doc/models/update-invoice.md @@ -0,0 +1,50 @@ + +# Update Invoice + +Attributes of a draft ad hoc invoice which can be updated. Only the submitted attributes are changed. + +## Structure + +`UpdateInvoice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `line_items` | [`Array[UpdateInvoiceItem]`](../../doc/models/update-invoice-item.md) | Optional | Line item changes to apply. Line items without a `uid` are added, line items with a `uid` are updated, and line items with a `uid` and `_destroy` set to `true` are removed. Existing line items not referenced in the array remain unchanged. | +| `issue_date` | `Date` | Optional | New issue date for the invoice (format YYYY-MM-DD). This date is interpreted and validated in your site's time zone. It must be today or a date in the past — future dates are not accepted. The due date is recalculated from the issue date and net terms. | +| `net_terms` | `Integer` | Optional | Number of days after the issue date on which the invoice is due. The due date is recalculated when net terms or the issue date change. | +| `payment_instructions` | `String` | Optional | Custom payment instructions displayed on the invoice. | +| `memo` | `String` | Optional | A custom memo displayed on the invoice. | +| `seller_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Replaces the seller address on the invoice | +| `billing_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Replaces the billing address on the invoice | +| `shipping_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Replaces the shipping address on the invoice | +| `coupons` | [`Array[CreateInvoiceCoupon]`](../../doc/models/create-invoice-coupon.md) | Optional | When present, replaces all discounts currently applied to the invoice. Send an empty array to remove all discounts. | + +## Example + +```ruby +update_invoice = UpdateInvoice.new( + line_items: [ + UpdateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ), + UpdateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ) + ], + issue_date: Date.iso8601('2024-01-01'), + net_terms: 130, + payment_instructions: 'payment_instructions4', + memo: 'memo2' +) +``` + diff --git a/doc/models/update-metadata-request.md b/doc/models/update-metadata-request.md index b9f775e..425ec4b 100644 --- a/doc/models/update-metadata-request.md +++ b/doc/models/update-metadata-request.md @@ -11,15 +11,15 @@ | --- | --- | --- | --- | | `metadata` | [`UpdateMetadata`](../../doc/models/update-metadata.md) | Optional | - | -## Example (as JSON) - -```json -{ - "metadata": { - "current_name": "current_name0", - "name": "name6", - "value": "value8" - } -} +## Example + +```ruby +update_metadata_request = UpdateMetadataRequest.new( + metadata: UpdateMetadata.new( + current_name: 'current_name0', + name: 'name6', + value: 'value8' + ) +) ``` diff --git a/doc/models/update-metadata.md b/doc/models/update-metadata.md index b6fc334..2fb48bd 100644 --- a/doc/models/update-metadata.md +++ b/doc/models/update-metadata.md @@ -13,13 +13,13 @@ | `name` | `String` | Optional | - | | `value` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "current_name": "current_name4", - "name": "name0", - "value": "value2" -} +## Example + +```ruby +update_metadata = UpdateMetadata.new( + current_name: 'current_name4', + name: 'name0', + value: 'value2' +) ``` diff --git a/doc/models/update-metafield.md b/doc/models/update-metafield.md index 5de4d16..5ab2421 100644 --- a/doc/models/update-metafield.md +++ b/doc/models/update-metafield.md @@ -12,26 +12,27 @@ | `current_name` | `String` | Optional | - | | `name` | `String` | Optional | - | | `scope` | [`MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | -| `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | +| `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | | `enum` | `Array[String]` | Optional | Only applicable when input_type is radio or dropdown. | -## Example (as JSON) - -```json -{ - "current_name": "current_name0", - "name": "name6", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" - }, - "input_type": "balance_tracker", - "enum": [ - "enum2" +## Example + +```ruby +update_metafield = UpdateMetafield.new( + current_name: 'current_name0', + name: 'name6', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE + ), + input_type: MetafieldInput::RADIO, + enum: [ + 'enum2', + 'enum3' ] -} +) ``` diff --git a/doc/models/update-metafields-request.md b/doc/models/update-metafields-request.md index 629e0dd..86eb68b 100644 --- a/doc/models/update-metafields-request.md +++ b/doc/models/update-metafields-request.md @@ -11,25 +11,25 @@ | --- | --- | --- | --- | | `metafields` | [Update Metafield](../../doc/models/update-metafield.md) \| Array[[Update Metafield](../../doc/models/update-metafield.md)] \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "metafields": { - "current_name": "current_name0", - "name": "name6", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" - }, - "input_type": "balance_tracker", - "enum": [ - "enum2" +## Example + +```ruby +update_metafields_request = UpdateMetafieldsRequest.new( + metafields: UpdateMetafield.new( + current_name: 'current_name0', + name: 'name6', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE + ), + input_type: MetafieldInput::BALANCE_TRACKER, + enum: [ + 'enum2' ] - } -} + ) +) ``` diff --git a/doc/models/update-payment-profile-request.md b/doc/models/update-payment-profile-request.md index 959d612..9d1aa21 100644 --- a/doc/models/update-payment-profile-request.md +++ b/doc/models/update-payment-profile-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `payment_profile` | [`UpdatePaymentProfile`](../../doc/models/update-payment-profile.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "full_number": "5424000000000015", - "first_name": "first_name4", - "last_name": "last_name2", - "card_type": "bogus", - "expiration_month": "expiration_month0" - } -} +## Example + +```ruby +update_payment_profile_request = UpdatePaymentProfileRequest.new( + payment_profile: UpdatePaymentProfile.new( + first_name: 'first_name4', + last_name: 'last_name2', + full_number: '5424000000000015', + card_type: CardType::BOGUS, + expiration_month: 'expiration_month0' + ) +) ``` diff --git a/doc/models/update-payment-profile.md b/doc/models/update-payment-profile.md index 64c0789..a6192b2 100644 --- a/doc/models/update-payment-profile.md +++ b/doc/models/update-payment-profile.md @@ -13,25 +13,25 @@ | `last_name` | `String` | Optional | The last name of the card holder. | | `full_number` | `String` | Optional | The full credit card number | | `card_type` | [`CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | -| `expiration_month` | `String` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, i.e. 5 | -| `expiration_year` | `String` | Optional | (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, i.e. 2012 | +| `expiration_month` | `String` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, e.g., 5 | +| `expiration_year` | `String` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, e.g., 2012 | | `current_vault` | [`AllVaults`](../../doc/models/all-vaults.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | -| `billing_address` | `String` | Optional | The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | -| `billing_city` | `String` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | -| `billing_state` | `String` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `billing_zip` | `String` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | -| `billing_country` | `String` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | -| `billing_address_2` | `String` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | - -## Example (as JSON) - -```json -{ - "full_number": "5424000000000015", - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "carnet", - "expiration_month": "expiration_month2" -} +| `billing_address` | `String` | Optional | The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. | +| `billing_city` | `String` | Optional | The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. | +| `billing_state` | `String` | Optional | The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | +| `billing_zip` | `String` | Optional | The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. | +| `billing_country` | `String` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | +| `billing_address_2` | `String` | Optional | Second line of the customer’s billing address, e.g., Apt. 100 | + +## Example + +```ruby +update_payment_profile = UpdatePaymentProfile.new( + first_name: 'first_name0', + last_name: 'last_name8', + full_number: '5424000000000015', + card_type: CardType::BOGUS, + expiration_month: 'expiration_month6' +) ``` diff --git a/doc/models/update-price.md b/doc/models/update-price.md index 6b60d57..631f8ac 100644 --- a/doc/models/update-price.md +++ b/doc/models/update-price.md @@ -15,15 +15,15 @@ | `destroy` | `TrueClass \| FalseClass` | Optional | - | | `starting_quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "id": 18, - "ending_quantity": 216, - "unit_price": 166.62, - "_destroy": false, - "starting_quantity": 242 -} +## Example + +```ruby +update_price = UpdatePrice.new( + id: 94, + ending_quantity: 216, + unit_price: 118.74, + destroy: false, + starting_quantity: 90 +) ``` diff --git a/doc/models/update-product-price-point-request.md b/doc/models/update-product-price-point-request.md index 163338c..94fc6e1 100644 --- a/doc/models/update-product-price-point-request.md +++ b/doc/models/update-product-price-point-request.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `price_point` | [`UpdateProductPricePoint`](../../doc/models/update-product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "handle": "handle6", - "price_in_cents": 196 - } -} +## Example + +```ruby +update_product_price_point_request = UpdateProductPricePointRequest.new( + price_point: UpdateProductPricePoint.new( + handle: 'handle6', + price_in_cents: 196 + ) +) ``` diff --git a/doc/models/update-product-price-point.md b/doc/models/update-product-price-point.md index 922ee1c..5e75df7 100644 --- a/doc/models/update-product-price-point.md +++ b/doc/models/update-product-price-point.md @@ -12,12 +12,12 @@ | `handle` | `String` | Optional | - | | `price_in_cents` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "handle": "handle6", - "price_in_cents": 220 -} +```ruby +update_product_price_point = UpdateProductPricePoint.new( + handle: 'handle2', + price_in_cents: 190 +) ``` diff --git a/doc/models/update-reason-code-request.md b/doc/models/update-reason-code-request.md index c8ef00b..3f5a87e 100644 --- a/doc/models/update-reason-code-request.md +++ b/doc/models/update-reason-code-request.md @@ -11,15 +11,15 @@ | --- | --- | --- | --- | | `reason_code` | [`UpdateReasonCode`](../../doc/models/update-reason-code.md) | Required | - | -## Example (as JSON) - -```json -{ - "reason_code": { - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```ruby +update_reason_code_request = UpdateReasonCodeRequest.new( + reason_code: UpdateReasonCode.new( + code: 'code4', + description: 'description6', + position: 14 + ) +) ``` diff --git a/doc/models/update-reason-code.md b/doc/models/update-reason-code.md index 52f41e2..6288bbb 100644 --- a/doc/models/update-reason-code.md +++ b/doc/models/update-reason-code.md @@ -13,13 +13,13 @@ | `description` | `String` | Optional | The friendly summary of what the code signifies | | `position` | `Integer` | Optional | The order that code appears in lists | -## Example (as JSON) - -```json -{ - "code": "code0", - "description": "description8", - "position": 118 -} +## Example + +```ruby +update_reason_code = UpdateReasonCode.new( + code: 'code2', + description: 'description4', + position: 12 +) ``` diff --git a/doc/models/update-segment-request.md b/doc/models/update-segment-request.md index c84e55d..0320c2c 100644 --- a/doc/models/update-segment-request.md +++ b/doc/models/update-segment-request.md @@ -11,30 +11,30 @@ | --- | --- | --- | --- | | `segment` | [`UpdateSegment`](../../doc/models/update-segment.md) | Required | - | -## Example (as JSON) - -```json -{ - "segment": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +## Example + +```ruby +update_segment_request = UpdateSegmentRequest.new( + segment: UpdateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] - } -} + ) +) ``` diff --git a/doc/models/update-segment.md b/doc/models/update-segment.md index cd4bf25..9c8f033 100644 --- a/doc/models/update-segment.md +++ b/doc/models/update-segment.md @@ -12,18 +12,23 @@ | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array[CreateOrUpdateSegmentPrice]`](../../doc/models/create-or-update-segment-price.md) | Optional | - | -## Example (as JSON) - -```json -{ - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +## Example + +```ruby +update_segment = UpdateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] -} +) ``` diff --git a/doc/models/update-subscription-component.md b/doc/models/update-subscription-component.md index b17ca83..f56422a 100644 --- a/doc/models/update-subscription-component.md +++ b/doc/models/update-subscription-component.md @@ -12,30 +12,30 @@ | `component_id` | `Integer` | Optional | - | | `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) - -```json -{ - "component_id": 244, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} +## Example + +```ruby +update_subscription_component = UpdateSubscriptionComponent.new( + component_id: 76, + custom_price: ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 66, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 174 + ) +) ``` diff --git a/doc/models/update-subscription-group-request.md b/doc/models/update-subscription-group-request.md index 439e31c..8f30a18 100644 --- a/doc/models/update-subscription-group-request.md +++ b/doc/models/update-subscription-group-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `subscription_group` | [`UpdateSubscriptionGroup`](../../doc/models/update-subscription-group.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_group": { - "member_ids": [ +```ruby +update_subscription_group_request = UpdateSubscriptionGroupRequest.new( + subscription_group: UpdateSubscriptionGroup.new( + member_ids: [ 164, 165 ] - } -} + ) +) ``` diff --git a/doc/models/update-subscription-group.md b/doc/models/update-subscription-group.md index fa720d9..902fce7 100644 --- a/doc/models/update-subscription-group.md +++ b/doc/models/update-subscription-group.md @@ -11,15 +11,14 @@ | --- | --- | --- | --- | | `member_ids` | `Array[Integer]` | Optional | - | -## Example (as JSON) - -```json -{ - "member_ids": [ - 52, - 53, - 54 +## Example + +```ruby +update_subscription_group = UpdateSubscriptionGroup.new( + member_ids: [ + 54, + 55 ] -} +) ``` diff --git a/doc/models/update-subscription-note-request.md b/doc/models/update-subscription-note-request.md index 05d27d6..96366f7 100644 --- a/doc/models/update-subscription-note-request.md +++ b/doc/models/update-subscription-note-request.md @@ -13,14 +13,14 @@ Updatable fields for Subscription Note | --- | --- | --- | --- | | `note` | [`UpdateSubscriptionNote`](../../doc/models/update-subscription-note.md) | Required | Updatable fields for Subscription Note | -## Example (as JSON) - -```json -{ - "note": { - "body": "body0", - "sticky": false - } -} +## Example + +```ruby +update_subscription_note_request = UpdateSubscriptionNoteRequest.new( + note: UpdateSubscriptionNote.new( + body: 'body0', + sticky: false + ) +) ``` diff --git a/doc/models/update-subscription-note.md b/doc/models/update-subscription-note.md index f33b53b..cdbf420 100644 --- a/doc/models/update-subscription-note.md +++ b/doc/models/update-subscription-note.md @@ -14,12 +14,12 @@ Updatable fields for Subscription Note | `body` | `String` | Required | - | | `sticky` | `TrueClass \| FalseClass` | Required | - | -## Example (as JSON) +## Example -```json -{ - "body": "body8", - "sticky": false -} +```ruby +update_subscription_note = UpdateSubscriptionNote.new( + body: 'body8', + sticky: false +) ``` diff --git a/doc/models/update-subscription-request.md b/doc/models/update-subscription-request.md index ede8dd8..eafb493 100644 --- a/doc/models/update-subscription-request.md +++ b/doc/models/update-subscription-request.md @@ -11,23 +11,23 @@ | --- | --- | --- | --- | | `subscription` | [`UpdateSubscription`](../../doc/models/update-subscription.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription": { - "defer_signup": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "credit_card_attributes": { - "full_number": "full_number2", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year2" - }, - "product_handle": "product_handle6", - "product_id": 206, - "product_change_delayed": false, - "next_product_id": "next_product_id6" - } -} +## Example + +```ruby +update_subscription_request = UpdateSubscriptionRequest.new( + subscription: UpdateSubscription.new( + credit_card_attributes: CreditCardAttributes.new( + full_number: 'full_number2', + expiration_month: 'expiration_month6', + expiration_year: 'expiration_year2' + ), + product_handle: 'product_handle6', + product_id: 206, + product_change_delayed: false, + next_product_id: 'next_product_id6', + defer_signup: false, + dunning_communication_delay_time_zone: '"Eastern Time (US & Canada)"' + ) +) ``` diff --git a/doc/models/update-subscription.md b/doc/models/update-subscription.md index b59bf88..1618948 100644 --- a/doc/models/update-subscription.md +++ b/doc/models/update-subscription.md @@ -10,15 +10,16 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `credit_card_attributes` | [`CreditCardAttributes`](../../doc/models/credit-card-attributes.md) | Optional | - | -| `product_handle` | `String` | Optional | Set to the handle of a different product to change the subscription's product | -| `product_id` | `Integer` | Optional | Set to the id of a different product to change the subscription's product | +| `product_handle` | `String` | Optional | Set to the handle of a different product to change the subscription's product. | +| `product_id` | `Integer` | Optional | Set to the id of a different product to change the subscription's product. | | `product_change_delayed` | `TrueClass \| FalseClass` | Optional | - | | `next_product_id` | `String` | Optional | Set to an empty string to cancel a delayed product change. | | `next_product_price_point_id` | `String` | Optional | - | | `snap_day` | String \| Integer \| nil | Optional | This is a container for one-of cases. | -| `initial_billing_at` | `DateTime` | Optional | (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting Signup Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed. etc. When the `initial_billing_at` date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. You can omit the initial_billing_at date to activate the subscription immediately. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time formats. | +| `initial_billing_at` | `DateTime` | Optional | (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting Signup Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed, etc. When the `initial_billing_at` date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. You can omit the initial_billing_at date to activate the subscription immediately. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time formats. | | `defer_signup` | `TrueClass \| FalseClass` | Optional | (Optional) Set this attribute to true to move the subscription from Awaiting Signup, to Awaiting Signup Date. Use this when you want to update a subscription that has an unknown initial billing date. When the first billing date is known, update a subscription to set the `initial_billing_at` date. The subscription moves to the awaiting signup with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information.

**Default**: `false` | | `next_billing_at` | `DateTime` | Optional | - | +| `branding_theme_id` | `Integer` | Optional | The ID of the Branding Theme to assign to this subscription. When set, this subscription-level Branding Theme is used instead of the customer's default Branding Theme for subscription-related documents and communications that use subscription theming. Pass null or an empty value to clear the subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. Not returned in the response. | | `expires_at` | `DateTime` | Optional | Timestamp giving the expiration date of this subscription (if any). You may manually change the expiration date at any point during a subscription period. | | `payment_collection_method` | `String` | Optional | - | | `receives_invoice_emails` | `TrueClass \| FalseClass` | Optional | - | @@ -32,21 +33,21 @@ | `product_price_point_id` | `Integer` | Optional | Set to change the current product's price point. | | `product_price_point_handle` | `String` | Optional | Set to change the current product's price point. | -## Example (as JSON) - -```json -{ - "defer_signup": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "credit_card_attributes": { - "full_number": "full_number2", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year2" - }, - "product_handle": "product_handle2", - "product_id": 114, - "product_change_delayed": false, - "next_product_id": "next_product_id8" -} +## Example + +```ruby +update_subscription = UpdateSubscription.new( + credit_card_attributes: CreditCardAttributes.new( + full_number: 'full_number2', + expiration_month: 'expiration_month6', + expiration_year: 'expiration_year2' + ), + product_handle: 'product_handle0', + product_id: 234, + product_change_delayed: false, + next_product_id: 'next_product_id0', + defer_signup: false, + dunning_communication_delay_time_zone: '"Eastern Time (US & Canada)"' +) ``` diff --git a/doc/models/upgrade-charge-credit-type.md b/doc/models/upgrade-charge-credit-type.md index 3bc95ab..5a80e64 100644 --- a/doc/models/upgrade-charge-credit-type.md +++ b/doc/models/upgrade-charge-credit-type.md @@ -21,3 +21,9 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `PRORATED` | | `NONE` | +## Example + +```ruby +upgrade_charge_credit_type = UpgradeChargeCreditType::PRORATED +``` + diff --git a/doc/models/upsert-prepaid-configuration-request.md b/doc/models/upsert-prepaid-configuration-request.md index 0282395..74c8d2d 100644 --- a/doc/models/upsert-prepaid-configuration-request.md +++ b/doc/models/upsert-prepaid-configuration-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `prepaid_configuration` | [`UpsertPrepaidConfiguration`](../../doc/models/upsert-prepaid-configuration.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepaid_configuration": { - "initial_funding_amount_in_cents": 74, - "replenish_to_amount_in_cents": 76, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 20 - } -} +## Example + +```ruby +upsert_prepaid_configuration_request = UpsertPrepaidConfigurationRequest.new( + prepaid_configuration: UpsertPrepaidConfiguration.new( + initial_funding_amount_in_cents: 74, + replenish_to_amount_in_cents: 76, + auto_replenish: false, + replenish_threshold_amount_in_cents: 20 + ) +) ``` diff --git a/doc/models/upsert-prepaid-configuration.md b/doc/models/upsert-prepaid-configuration.md index 6c5a2ed..b40d08e 100644 --- a/doc/models/upsert-prepaid-configuration.md +++ b/doc/models/upsert-prepaid-configuration.md @@ -14,14 +14,14 @@ | `auto_replenish` | `TrueClass \| FalseClass` | Optional | - | | `replenish_threshold_amount_in_cents` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "initial_funding_amount_in_cents": 40, - "replenish_to_amount_in_cents": 42, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 242 -} +## Example + +```ruby +upsert_prepaid_configuration = UpsertPrepaidConfiguration.new( + initial_funding_amount_in_cents: 104, + replenish_to_amount_in_cents: 106, + auto_replenish: false, + replenish_threshold_amount_in_cents: 206 +) ``` diff --git a/doc/models/usage-response.md b/doc/models/usage-response.md index 6afbae6..f9c0000 100644 --- a/doc/models/usage-response.md +++ b/doc/models/usage-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `usage` | [`Usage`](../../doc/models/usage.md) | Required | - | -## Example (as JSON) - -```json -{ - "usage": { - "id": 150, - "memo": "memo2", - "created_at": "2016-03-13T12:52:32.123Z", - "price_point_id": 28, - "quantity": 28 - } -} +## Example + +```ruby +usage_response = UsageResponse.new( + usage: Usage.new( + id: 150, + memo: 'memo2', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + price_point_id: 28, + quantity: 28 + ) +) ``` diff --git a/doc/models/usage.md b/doc/models/usage.md index 467f2d3..644a282 100644 --- a/doc/models/usage.md +++ b/doc/models/usage.md @@ -19,15 +19,15 @@ | `component_handle` | `String` | Optional | - | | `subscription_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 252, - "memo": "memo8", - "created_at": "2016-03-13T12:52:32.123Z", - "price_point_id": 126, - "quantity": 130 -} +## Example + +```ruby +usage = Usage.new( + id: 150, + memo: 'memo2', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + price_point_id: 28, + quantity: 28 +) ``` diff --git a/doc/models/void-invoice-event-data.md b/doc/models/void-invoice-event-data.md index 2b29f48..1ebf433 100644 --- a/doc/models/void-invoice-event-data.md +++ b/doc/models/void-invoice-event-data.md @@ -18,22 +18,22 @@ Example schema for an `void_invoice` event | `is_advance_invoice` | `TrueClass \| FalseClass` | Required | If true, the invoice is an advance invoice. | | `reason` | `String` | Required | The reason for the void. | -## Example (as JSON) - -```json -{ - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo6", - "applied_amount": "applied_amount6", - "transaction_time": "2016-03-13T12:52:32.123Z", - "is_advance_invoice": false, - "reason": "reason8" -} +## Example + +```ruby +void_invoice_event_data = VoidInvoiceEventData.new( + credit_note_attributes: CreditNote.new( + uid: 'uid2', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 'number0' + ), + memo: 'memo6', + applied_amount: 'applied_amount6', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + is_advance_invoice: false, + reason: 'reason2' +) ``` diff --git a/doc/models/void-invoice-event.md b/doc/models/void-invoice-event.md index fb4a978..33c2586 100644 --- a/doc/models/void-invoice-event.md +++ b/doc/models/void-invoice-event.md @@ -15,38 +15,38 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::VOID_INVOICE` | | `event_data` | [`VoidInvoiceEventData`](../../doc/models/void-invoice-event-data.md) | Required | Example schema for an `void_invoice` event | -## Example (as JSON) - -```json -{ - "id": 16, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "void_invoice", - "event_data": { - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "is_advance_invoice": false, - "reason": "reason2" - } -} +## Example + +```ruby +void_invoice_event = VoidInvoiceEvent.new( + id: 220, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::VOID_INVOICE, + event_data: VoidInvoiceEventData.new( + credit_note_attributes: CreditNote.new( + uid: 'uid2', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 'number0' + ), + memo: 'memo0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + is_advance_invoice: false, + reason: 'reason2' + ) +) ``` diff --git a/doc/models/void-invoice-request.md b/doc/models/void-invoice-request.md index f8ac454..b5cc78d 100644 --- a/doc/models/void-invoice-request.md +++ b/doc/models/void-invoice-request.md @@ -11,13 +11,13 @@ | --- | --- | --- | --- | | `void` | [`VoidInvoice`](../../doc/models/void-invoice.md) | Required | - | -## Example (as JSON) - -```json -{ - "void": { - "reason": "reason6" - } -} +## Example + +```ruby +void_invoice_request = VoidInvoiceRequest.new( + void: VoidInvoice.new( + reason: 'reason6' + ) +) ``` diff --git a/doc/models/void-invoice.md b/doc/models/void-invoice.md index 8ef62bb..2b8b359 100644 --- a/doc/models/void-invoice.md +++ b/doc/models/void-invoice.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `reason` | `String` | Required | **Constraints**: *Minimum Length*: `1` | -## Example (as JSON) +## Example -```json -{ - "reason": "reason2" -} +```ruby +void_invoice = VoidInvoice.new( + reason: 'reason6' +) ``` diff --git a/doc/models/void-remainder-event-data.md b/doc/models/void-remainder-event-data.md index 3fa782a..45417b4 100644 --- a/doc/models/void-remainder-event-data.md +++ b/doc/models/void-remainder-event-data.md @@ -16,20 +16,20 @@ Example schema for an `void_remainder` event | `applied_amount` | `String` | Required | The amount of the void. | | `transaction_time` | `DateTime` | Required | The time the refund was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | -## Example (as JSON) - -```json -{ - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo6", - "applied_amount": "applied_amount4", - "transaction_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +void_remainder_event_data = VoidRemainderEventData.new( + credit_note_attributes: CreditNote.new( + uid: 'uid2', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 'number0' + ), + memo: 'memo0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/void-remainder-event.md b/doc/models/void-remainder-event.md index 2b6e250..bae2164 100644 --- a/doc/models/void-remainder-event.md +++ b/doc/models/void-remainder-event.md @@ -15,36 +15,36 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::VOID_REMAINDER` | | `event_data` | [`VoidRemainderEventData`](../../doc/models/void-remainder-event-data.md) | Required | Example schema for an `void_remainder` event | -## Example (as JSON) - -```json -{ - "id": 128, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "void_remainder", - "event_data": { - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +void_remainder_event = VoidRemainderEvent.new( + id: 204, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::VOID_REMAINDER, + event_data: VoidRemainderEventData.new( + credit_note_attributes: CreditNote.new( + uid: 'uid2', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 'number0' + ), + memo: 'memo0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/webhook-order.md b/doc/models/webhook-order.md index 528b979..4471edd 100644 --- a/doc/models/webhook-order.md +++ b/doc/models/webhook-order.md @@ -12,3 +12,9 @@ | `NEWEST_FIRST` | | `OLDEST_FIRST` | +## Example + +```ruby +webhook_order = WebhookOrder::NEWEST_FIRST +``` + diff --git a/doc/models/webhook-response.md b/doc/models/webhook-response.md index 86aa8c6..a08742c 100644 --- a/doc/models/webhook-response.md +++ b/doc/models/webhook-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `webhook` | [`Webhook`](../../doc/models/webhook.md) | Optional | - | -## Example (as JSON) - -```json -{ - "webhook": { - "event": "event2", - "id": 18, - "created_at": "2016-03-13T12:52:32.123Z", - "last_error": "last_error4", - "last_error_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +webhook_response = WebhookResponse.new( + webhook: Webhook.new( + event: 'event2', + id: 18, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + last_error: 'last_error4', + last_error_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/webhook-status.md b/doc/models/webhook-status.md index 9202a9b..ebdb798 100644 --- a/doc/models/webhook-status.md +++ b/doc/models/webhook-status.md @@ -14,3 +14,9 @@ | `PENDING` | | `PAUSED` | +## Example + +```ruby +webhook_status = WebhookStatus::PENDING +``` + diff --git a/doc/models/webhook-subscription.md b/doc/models/webhook-subscription.md index 85990e5..27e08fd 100644 --- a/doc/models/webhook-subscription.md +++ b/doc/models/webhook-subscription.md @@ -39,6 +39,7 @@ | `SUBSCRIPTION_CARD_UPDATE` | | `SUBSCRIPTION_GROUP_CARD_UPDATE` | | `SUBSCRIPTION_PRODUCT_CHANGE` | +| `SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED` | | `SUBSCRIPTION_STATE_CHANGE` | | `TRIAL_END_NOTICE` | | `UPCOMING_RENEWAL_NOTICE` | @@ -48,3 +49,9 @@ | `SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED` | | `SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED` | +## Example + +```ruby +webhook_subscription = WebhookSubscription::CHJS_TOKENIZATION_SUCCESS +``` + diff --git a/doc/models/webhook.md b/doc/models/webhook.md index 290a9a0..c644294 100644 --- a/doc/models/webhook.md +++ b/doc/models/webhook.md @@ -10,27 +10,27 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `event` | `String` | Optional | A string describing which event type produced the given webhook | -| `id` | `Integer` | Optional | The unique identifier for the webhooks (unique across all of Chargify). This is not changed on a retry/replay of the same webhook, so it may be used to avoid duplicate action for the same event. | +| `id` | `Integer` | Optional | The unique identifier for the webhook (unique across all of Chargify). This is not changed on a retry/replay of the same webhook, so it may be used to avoid duplicate action for the same event. | | `created_at` | `DateTime` | Optional | Timestamp indicating when the webhook was created | | `last_error` | `String` | Optional | Text describing the status code and/or error from the last failed attempt to send the Webhook. When a webhook is retried and accepted, this field will be cleared. | | `last_error_at` | `DateTime` | Optional | Timestamp indicating when the last non-acceptance occurred. If a webhook is later resent and accepted, this field will be cleared. | | `accepted_at` | `DateTime` | Optional | Timestamp indicating when the webhook was accepted by the merchant endpoint. When a webhook is explicitly replayed by the merchant, this value will be cleared until it is accepted again. | | `last_sent_at` | `DateTime` | Optional | Timestamp indicating when the most recent attempt was made to send the webhook | | `last_sent_url` | `String` | Optional | The url that the endpoint was last sent to. | -| `successful` | `TrueClass \| FalseClass` | Optional | A boolean flag describing whether the webhook was accepted by the webhook endpoint for the most recent attempt. (Acceptance is defined by receiving a “200 OK” HTTP response within a reasonable timeframe, i.e. 15 seconds) | +| `successful` | `TrueClass \| FalseClass` | Optional | “A boolean flag describing whether the webhook was accepted by the webhook endpoint for the most recent attempt. (Acceptance is defined by receiving a “200 OK” HTTP response within a reasonable timeframe, e.g., 15 seconds.)” | | `body` | `String` | Optional | The data sent within the webhook post | | `signature` | `String` | Optional | The calculated webhook signature | | `signature_hmac_sha_256` | `String` | Optional | The calculated HMAC-SHA-256 webhook signature | -## Example (as JSON) +## Example -```json -{ - "event": "event6", - "id": 154, - "created_at": "2016-03-13T12:52:32.123Z", - "last_error": "last_error8", - "last_error_at": "2016-03-13T12:52:32.123Z" -} +```ruby +webhook = Webhook.new( + event: 'event2', + id: 18, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + last_error: 'last_error4', + last_error_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/lib/advanced_billing.rb b/lib/advanced_billing.rb index d89c52b..36c485d 100644 --- a/lib/advanced_billing.rb +++ b/lib/advanced_billing.rb @@ -249,6 +249,8 @@ require_relative 'advanced_billing/models/event_response' require_relative 'advanced_billing/models/failed_payment_event_data' require_relative 'advanced_billing/models/full_subscription_group_response' +require_relative 'advanced_billing/models/' \ + 'get_one_time_token_bank_account_payment_profile' require_relative 'advanced_billing/models/get_one_time_token_payment_profile' require_relative 'advanced_billing/models/get_one_time_token_request' require_relative 'advanced_billing/models/group_billing' @@ -313,13 +315,13 @@ require_relative 'advanced_billing/models/list_segments_filter' require_relative 'advanced_billing/models/list_segments_response' require_relative 'advanced_billing/models/list_service_credits_response' -require_relative 'advanced_billing/models/' \ - 'list_subcription_group_prepayment_item' require_relative 'advanced_billing/models/list_subscription_components_filter' require_relative 'advanced_billing/models/' \ 'list_subscription_components_for_site_filter' require_relative 'advanced_billing/models/list_subscription_components_response' require_relative 'advanced_billing/models/list_subscription_group_prepayment' +require_relative 'advanced_billing/models/' \ + 'list_subscription_group_prepayment_item' require_relative 'advanced_billing/models/' \ 'list_subscription_group_prepayment_response' require_relative 'advanced_billing/models/list_subscription_groups_item' @@ -519,6 +521,7 @@ require_relative 'advanced_billing/models/subscription_preview' require_relative 'advanced_billing/models/subscription_preview_response' require_relative 'advanced_billing/models/subscription_product_change' +require_relative 'advanced_billing/models/subscription_product_change_scheduled' require_relative 'advanced_billing/models/subscription_product_migration' require_relative 'advanced_billing/models/' \ 'subscription_product_migration_request' @@ -537,6 +540,9 @@ require_relative 'advanced_billing/models/update_currency_prices_request' require_relative 'advanced_billing/models/update_customer' require_relative 'advanced_billing/models/update_customer_request' +require_relative 'advanced_billing/models/update_invoice' +require_relative 'advanced_billing/models/update_invoice_item' +require_relative 'advanced_billing/models/update_invoice_request' require_relative 'advanced_billing/models/update_metadata' require_relative 'advanced_billing/models/update_metadata_request' require_relative 'advanced_billing/models/update_metafield' @@ -582,6 +588,7 @@ require_relative 'advanced_billing/models/chargeback_status' require_relative 'advanced_billing/models/cleanup_scope' require_relative 'advanced_billing/models/collection_method' +require_relative 'advanced_billing/models/collection_method1' require_relative 'advanced_billing/models/component_kind' require_relative 'advanced_billing/models/compounding_strategy' require_relative 'advanced_billing/models/create_invoice_status' @@ -605,6 +612,7 @@ require_relative 'advanced_billing/models/first_charge_type' require_relative 'advanced_billing/models/group_target_type' require_relative 'advanced_billing/models/group_type' +require_relative 'advanced_billing/models/group_status' require_relative 'advanced_billing/models/include_not_null' require_relative 'advanced_billing/models/include_null_or_not_null' require_relative 'advanced_billing/models/include_option' @@ -640,6 +648,7 @@ require_relative 'advanced_billing/models/proforma_invoice_role' require_relative 'advanced_billing/models/proforma_invoice_status' require_relative 'advanced_billing/models/proforma_invoice_tax_source_type' +require_relative 'advanced_billing/models/q_scope' require_relative 'advanced_billing/models/reactivation_charge' require_relative 'advanced_billing/models/recurring_scheme' require_relative 'advanced_billing/models/resource_type' diff --git a/lib/advanced_billing/controllers/advance_invoice_controller.rb b/lib/advanced_billing/controllers/advance_invoice_controller.rb index 0bdc1a8..7bab855 100644 --- a/lib/advanced_billing/controllers/advance_invoice_controller.rb +++ b/lib/advanced_billing/controllers/advance_invoice_controller.rb @@ -6,8 +6,8 @@ module AdvancedBilling # AdvanceInvoiceController class AdvanceInvoiceController < BaseController - # Generate an invoice in advance for a subscription's next renewal date. - # [See our + # Issues an invoice in advance for a subscription's next renewal date. [See + # our # docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Inv # oice-In-Advance) for more information on advance invoices, including # eligibility for generating one; for the most part, they function like any @@ -80,7 +80,7 @@ def read_advance_invoice(subscription_id) .execute end - # Void a subscription's existing advance invoice. Once voided, it can later + # Voids a subscription's existing advance invoice. Once voided, it can later # be regenerated if desired. # A `reason` is required in order to void, and the invoice must have an open # status. Voiding will cause any prepayments and credits that were applied diff --git a/lib/advanced_billing/controllers/base_controller.rb b/lib/advanced_billing/controllers/base_controller.rb index 1f1beee..e8838d0 100644 --- a/lib/advanced_billing/controllers/base_controller.rb +++ b/lib/advanced_billing/controllers/base_controller.rb @@ -10,7 +10,7 @@ class BaseController attr_accessor :config, :http_call_back def self.user_agent - 'AB SDK Ruby:9.1.0 on OS {os-info}' + 'AB SDK Ruby:10.0.0 on OS {os-info}' end def self.user_agent_parameters diff --git a/lib/advanced_billing/controllers/billing_portal_controller.rb b/lib/advanced_billing/controllers/billing_portal_controller.rb index 7aca990..1fd01e0 100644 --- a/lib/advanced_billing/controllers/billing_portal_controller.rb +++ b/lib/advanced_billing/controllers/billing_portal_controller.rb @@ -73,7 +73,7 @@ def enable_billing_portal_for_customer(customer_id, # + Only request a new URL after the `new_link_available_at` date # + You are limited to 15 requests for the same URL. If you make more than # 15 requests before `new_link_available_at`, you will be blocked from - # further Management URL requests (with a response code `429`) + # further Management URL requests (with a response code `429`). # @param [Integer] customer_id Required parameter: The Chargify id of the # customer # @return [PortalManagementLink] Response from the API call. diff --git a/lib/advanced_billing/controllers/component_price_points_controller.rb b/lib/advanced_billing/controllers/component_price_points_controller.rb index ce9629b..9b4aab5 100644 --- a/lib/advanced_billing/controllers/component_price_points_controller.rb +++ b/lib/advanced_billing/controllers/component_price_points_controller.rb @@ -73,17 +73,13 @@ def create_component_price_point(component_id, # Lists the price points associated with a component. # You may specify the component by using either the numeric id or the # `handle:gold` syntax. - # When fetching a component's price points, if you have defined multiple - # currencies at the site level, you can optionally pass the - # `?currency_prices=true` query param to include an array of currency price - # data in the response. # If the price point is set to `use_site_exchange_rate: true`, it will # return pricing based on the current exchange rate. If the flag is set to # false, it will return all of the defined prices for each currency. # @param [Integer] component_id Required parameter: The Advanced Billing id # of the component # @param [TrueClass | FalseClass] currency_prices Optional parameter: - # Include an array of currency price data + # Include an array of currency price data. # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start @@ -274,7 +270,7 @@ def update_component_price_point(component_id, # `handle:`. Example: `123` for an integer ID, or # `handle:example-price_point-handle` for a string handle. # @param [TrueClass | FalseClass] currency_prices Optional parameter: - # Include an array of currency price data + # Include an array of currency price data. # @return [ComponentPricePointCurrencyOverageResponse] Response from the API call. def read_component_price_point(component_id, price_point_id, diff --git a/lib/advanced_billing/controllers/components_controller.rb b/lib/advanced_billing/controllers/components_controller.rb index a7700ff..b725c48 100644 --- a/lib/advanced_billing/controllers/components_controller.rb +++ b/lib/advanced_billing/controllers/components_controller.rb @@ -16,9 +16,21 @@ class ComponentsController < BaseController # which DO NOT reset to zero at the start of every billing period. If you # want to bill for a quantity of something that does not change unless you # change it, then you want quantity components, instead. + # #### Hybrid Pricing + # A `volume`, `tiered`, or `stairstep` metered component can combine its + # primary pricing with a secondary pricing model (the `overage_pricing` + # parameter) so both bill as a single invoice line item instead of two. This + # does not apply to metered components configured for event-based billing + # (metric, meter, or formula). See [Hybrid + # Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements + # and configuration details. # For more information on components, see our documentation # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen # ts-Overview). + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`. Sending `"tax_code": ""` returns `422`. # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` # @param [CreateMeteredComponent] body Optional parameter: TODO: type @@ -66,9 +78,19 @@ def create_metered_component(product_family_id, # charge your customer a one-time fee for onboarding or other services. # The allocated quantity for one-time quantity-based components immediately # gets reset back to zero after the allocation is made. + # #### Hybrid Pricing + # A `volume`, `tiered`, or `stairstep` component can combine its primary + # pricing with a secondary pricing model (the `overage_pricing` parameter) + # so both bill as a single invoice line item instead of two. See [Hybrid + # Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements + # and configuration details. # For more information on components, see our documentation # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen # ts-Overview). + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`. Sending `"tax_code": ""` returns `422`. # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` # @param [CreateQuantityBasedComponent] body Optional parameter: TODO: type @@ -108,6 +130,10 @@ def create_quantity_based_component(product_family_id, # For more information on components, see our documentation # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen # ts-Overview). + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`. Sending `"tax_code": ""` returns `422`. # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` # @param [CreateOnOffComponent] body Optional parameter: TODO: type @@ -152,6 +178,10 @@ def create_on_off_component(product_family_id, # For more information on components, see our documentation # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen # ts-Overview). + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`. Sending `"tax_code": ""` returns `422`. # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` # @param [CreatePrepaidComponent] body Optional parameter: TODO: type @@ -199,6 +229,10 @@ def create_prepaid_usage_component(product_family_id, # For more information on components, see our documentation # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen # ts-Overview). + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`. Sending `"tax_code": ""` returns `422`. # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` # @param [CreateEBBComponent] body Optional parameter: TODO: type @@ -284,6 +318,10 @@ def read_component(product_family_id, # Updates a component from a specific product family. # You may read the component by either the component's id or handle. When # using the handle, it must be prefixed with `handle:`. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`. Sending `"tax_code": ""` returns `422`. # @param [Integer] product_family_id Required parameter: The Advanced # Billing id of the product family to which the component belongs # @param [String] component_id Required parameter: Either the Advanced @@ -373,9 +411,8 @@ def archive_component(product_family_id, # components with a timestamp at or before exact time provided in query. You # can specify timezone in query - otherwise your site's time zone will be # used. If provided, this parameter will be used instead of end_date. - # optional # @param [TrueClass | FalseClass] include_archived Optional parameter: - # Include archived items + # Include archived items. # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start @@ -417,6 +454,10 @@ def list_components(options = {}) # Updates a component. # You may read the component by either the component's id or handle. When # using the handle, it must be prefixed with `handle:`. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`. Sending `"tax_code": ""` returns `422`. # @param [String] component_id Required parameter: The id or handle of the # component # @param [UpdateComponentRequest] body Optional parameter: TODO: type @@ -476,7 +517,6 @@ def update_component(component_id, # components with a timestamp at or before exact time provided in query. You # can specify timezone in query - otherwise your site's time zone will be # used. If provided, this parameter will be used instead of end_date. - # optional. # @param [String] start_date Optional parameter: The start date (format # YYYY-MM-DD) with which to filter the date_field. Returns components with a # timestamp at or after midnight (12:00:00 AM) in your site’s time zone on diff --git a/lib/advanced_billing/controllers/coupons_controller.rb b/lib/advanced_billing/controllers/coupons_controller.rb index 072dbcb..11da035 100644 --- a/lib/advanced_billing/controllers/coupons_controller.rb +++ b/lib/advanced_billing/controllers/coupons_controller.rb @@ -7,16 +7,8 @@ module AdvancedBilling # CouponsController class CouponsController < BaseController # Creates a coupon under the specified product family. - # You can create either a flat amount coupon by specifying amount_in_cents, - # or a percentage coupon by specifying percentage - # You can restrict a coupon to only apply to specific products / components - # by optionally passing in `restricted_products` and/or - # `restricted_components` objects in the format: - # `{ "": boolean_value }` - # Coupons can be administered in the Advanced Billing application or created - # via API. See [creating - # coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creati - # ng-Editing-Deleting-Coupons) for more information. + # You can create either a flat amount coupon, by specifying + # `amount_in_cents`, or percentage coupon by specifying `percentage`. # See [Apply Coupons to # Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101- # Coupons-and-Subscriptions) for information on applying a coupon to a @@ -66,11 +58,10 @@ def create_coupon(product_family_id, # Use in query `per_page=200`. # @param [ListCouponsFilter] filter Optional parameter: Filter to use for # List Coupons operations - # @param [TrueClass | FalseClass] currency_prices Optional parameter: When - # fetching coupons, if you have defined multiple currencies at the site - # level, you can optionally pass the `?currency_prices=true` query param to - # include an array of currency price data in the response. Use in query - # `currency_prices=true`. + # @param [TrueClass | FalseClass] currency_prices Optional parameter: + # (Optional) If you have defined multiple currencies at the site level, you + # can pass `?currency_prices=true` to include an array of currency price + # data in the response. Use in query `currency_prices=true`. # @return [Array[CouponResponse]] Response from the API call. def list_coupons_for_product_family(options = {}) @api_call @@ -104,10 +95,10 @@ def list_coupons_for_product_family(options = {}) # @param [Integer] product_family_id Optional parameter: The Advanced # Billing id of the product family to which the coupon belongs # @param [String] code Optional parameter: The code of the coupon - # @param [TrueClass | FalseClass] currency_prices Optional parameter: When - # fetching coupons, if you have defined multiple currencies at the site - # level, you can optionally pass the `?currency_prices=true` query param to - # include an array of currency price data in the response. + # @param [TrueClass | FalseClass] currency_prices Optional parameter: + # (Optional) If you have defined multiple currencies at the site level, you + # can pass `?currency_prices=true` to include an array of currency price + # data in the response. # @return [CouponResponse] Response from the API call. def find_coupon(product_family_id: nil, code: nil, @@ -131,9 +122,6 @@ def find_coupon(product_family_id: nil, # the Coupon in this call by the ID parameter that Advanced Billing assigns. # If instead you would like to find a Coupon using a Coupon code, see the # Coupon Find method. - # When fetching a coupon, if you have defined multiple currencies at the - # site level, you can optionally pass the `?currency_prices=true` query - # param to include an array of currency price data in the response. # If the coupon is set to `use_site_exchange_rate: true`, it will return # pricing based on the current exchange rate. If the flag is set to false, # it will return all of the defined prices for each currency. @@ -141,10 +129,10 @@ def find_coupon(product_family_id: nil, # Billing id of the product family to which the coupon belongs # @param [Integer] coupon_id Required parameter: The Advanced Billing id of # the coupon - # @param [TrueClass | FalseClass] currency_prices Optional parameter: When - # fetching coupons, if you have defined multiple currencies at the site - # level, you can optionally pass the `?currency_prices=true` query param to - # include an array of currency price data in the response. + # @param [TrueClass | FalseClass] currency_prices Optional parameter: + # (Optional) If you have defined multiple currencies at the site level, you + # can pass `?currency_prices=true` to include an array of currency price + # data in the response. # @return [CouponResponse] Response from the API call. def read_coupon(product_family_id, coupon_id, @@ -253,11 +241,10 @@ def archive_coupon(product_family_id, # Use in query `per_page=200`. # @param [ListCouponsFilter] filter Optional parameter: Filter to use for # List Coupons operations - # @param [TrueClass | FalseClass] currency_prices Optional parameter: When - # fetching coupons, if you have defined multiple currencies at the site - # level, you can optionally pass the `?currency_prices=true` query param to - # include an array of currency price data in the response. Use in query - # `currency_prices=true`. + # @param [TrueClass | FalseClass] currency_prices Optional parameter: + # (Optional) If you have defined multiple currencies at the site level, you + # can pass `?currency_prices=true` to include an array of currency price + # data in the response. Use in query `currency_prices=true`. # @return [Array[CouponResponse]] Response from the API call. def list_coupons(options = {}) @api_call @@ -428,7 +415,7 @@ def create_or_update_coupon_currency_prices(coupon_id, # . to %2E # So, if the coupon subcode is `20%OFF`, the URL to delete this coupon # subcode would be: - # `https://.chargify.com/coupons/567/codes/20%25OFF.` + # `https://.chargify.com/coupons/567/codes/20%25OFF.`. # @param [Integer] coupon_id Required parameter: The Advanced Billing id of # the coupon # @param [CouponSubcodes] body Optional parameter: TODO: type description @@ -541,7 +528,7 @@ def update_coupon_subcodes(coupon_id, # ## Percent Encoding Example # Or if the coupon subcode is 20%OFF, the URL to delete this coupon subcode # would be: - # @https://.chargify.com/coupons/567/codes/20%25OFF. + # @https://.chargify.com/coupons/567/codes/20%25OFF.. # @param [Integer] coupon_id Required parameter: The Advanced Billing id of # the coupon to which the subcode belongs # @param [String] subcode Required parameter: The subcode of the coupon diff --git a/lib/advanced_billing/controllers/customers_controller.rb b/lib/advanced_billing/controllers/customers_controller.rb index 76b63ae..562e17e 100644 --- a/lib/advanced_billing/controllers/customers_controller.rb +++ b/lib/advanced_billing/controllers/customers_controller.rb @@ -230,6 +230,12 @@ def read_customer_by_reference(reference) end # Lists all subscriptions that belong to a customer. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, subscriptions no longer require an + # associated product. For subscriptions without an associated product, + # 'product', 'product_price_point_id', and 'product_price_point_type' are + # returned as 'null'. # @param [Integer] customer_id Required parameter: The Chargify id of the # customer # @return [Array[SubscriptionResponse]] Response from the API call. diff --git a/lib/advanced_billing/controllers/events_controller.rb b/lib/advanced_billing/controllers/events_controller.rb index ea53425..0e303ac 100644 --- a/lib/advanced_billing/controllers/events_controller.rb +++ b/lib/advanced_billing/controllers/events_controller.rb @@ -12,10 +12,22 @@ class EventsController < BaseController # Site. This information is **especially** useful to track down issues that # arise when subscriptions are not created due to errors. # Within the Advanced Billing UI, "Events" are referred to as "Site - # Activity". Full documentation on how to view Events / Site Activity in - # the Advanced Billing UI can be located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Act - # ivity). + # Activity". See the [Site + # Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site- + # Activity) article in the product documentation for details on how to + # record view Events / Site Activty in the Advanced Billing UI. + # If you’re using the [enhanced Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology), you’ll see updated naming in webhook events and + # messages. + # Event name changes: + # - subscription_product_change → subscription_plan_change + # - component_allocation_change → allocation_change + # - component_billing_date_change → product_billing_date_change + # Message updates: + # - “Plan changed on Subscription from previous plan to new plan” + # - “Successful payment for allocation changes to Product on Subscription” + # - “Failed payment for allocation changes to Product on Subscription” # ## List Events for a Site # This method will retrieve a list of events for a site. Use query string # filters to narrow down results. You may use the `key` filter as part of @@ -47,7 +59,7 @@ class EventsController < BaseController # "event": { # "id": 351, # "key": "subscription_product_change", - # "message": "Product changed on Marky Mark's subscription from + # "message": "Product changed on Mark Alan's subscription from # 'Basic' to 'Pro'", # "subscription_id": 205, # "event_specific_data": { @@ -64,8 +76,8 @@ class EventsController < BaseController # "event": { # "id": 353, # "key": "subscription_state_change", - # "message": "State changed on Marky Mark's subscription to Pro - # from trialing to active", + # "message": "State changed on Mark Alan's subscription to Pro from + # trialing to active", # "subscription_id": 205, # "event_specific_data": { # "new_subscription_state": "active", @@ -87,9 +99,9 @@ class EventsController < BaseController # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. # @param [Integer] since_id Optional parameter: Returns events with an id - # greater than or equal to the one specified + # greater than or equal to the one specified. # @param [Integer] max_id Optional parameter: Returns events with an id less - # than or equal to the one specified + # than or equal to the one specified. # @param [Direction] direction Optional parameter: The sort direction of the # returned events. # @param [Array[EventKey]] filter Optional parameter: You can pass multiple @@ -146,6 +158,18 @@ def list_events(options = {}) # ## Event Key # The event type is identified by the key property. You can check supported # keys [here]($m/Event%20Key). + # If you’re using the [enhanced Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology), you’ll see updated naming in webhook events and + # messages. + # Event name changes: + # - subscription_product_change → subscription_plan_change + # - component_allocation_change → allocation_change + # - component_billing_date_change → product_billing_date_change + # Message updates: + # - “Successful payment for allocation changes to Product on Subscription” + # - “Failed payment for allocation changes to Product on Subscription” + # - “Plan changed on Subscription from previous plan to new plan” # ## Event Specific Data # Different event types may include additional data in `event_specific_data` # property. @@ -167,9 +191,9 @@ def list_events(options = {}) # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. # @param [Integer] since_id Optional parameter: Returns events with an id - # greater than or equal to the one specified + # greater than or equal to the one specified. # @param [Integer] max_id Optional parameter: Returns events with an id less - # than or equal to the one specified + # than or equal to the one specified. # @param [Direction] direction Optional parameter: The sort direction of the # returned events. # @param [Array[EventKey]] filter Optional parameter: You can pass multiple @@ -201,6 +225,18 @@ def list_subscription_events(options = {}) end # Returns the total count of events for a given site. + # If you’re using the [enhanced Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology), you’ll see updated naming in webhook events and + # messages. + # Event name changes: + # - subscription_product_change → subscription_plan_change + # - component_allocation_change → allocation_change + # - component_billing_date_change → product_billing_date_change + # Message updates: + # - “Successful payment for allocation changes to Product on Subscription” + # - “Failed payment for allocation changes to Product on Subscription” + # - “Plan changed on Subscription from previous plan to new plan” # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start @@ -213,9 +249,9 @@ def list_subscription_events(options = {}) # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. # @param [Integer] since_id Optional parameter: Returns events with an id - # greater than or equal to the one specified + # greater than or equal to the one specified. # @param [Integer] max_id Optional parameter: Returns events with an id less - # than or equal to the one specified + # than or equal to the one specified. # @param [Direction] direction Optional parameter: The sort direction of the # returned events. # @param [Array[EventKey]] filter Optional parameter: You can pass multiple diff --git a/lib/advanced_billing/controllers/insights_controller.rb b/lib/advanced_billing/controllers/insights_controller.rb index 19ace1f..bbb4c15 100644 --- a/lib/advanced_billing/controllers/insights_controller.rb +++ b/lib/advanced_billing/controllers/insights_controller.rb @@ -31,9 +31,9 @@ def read_site_stats # Returns your site's current MRR, including plan and usage breakouts. # @param [DateTime] at_time Optional parameter: submit a timestamp in - # ISO8601 format to request MRR for a historic time + # ISO8601 format to request MRR for a historic time. # @param [Integer] subscription_id Optional parameter: submit the id of a - # subscription in order to limit results + # subscription in order to limit results. # @return [MRRResponse] Response from the API call. def read_mrr(at_time: nil, subscription_id: nil) @@ -75,8 +75,8 @@ def read_mrr(at_time: nil, # Usage includes revenue from: # * Metered Components # * Prepaid Usage Components - # @param [Integer] subscription_id Optional parameter: optionally filter - # results by subscription + # @param [Integer] subscription_id Optional parameter: (Optional) Filter + # results by subscription. # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start @@ -109,8 +109,8 @@ def list_mrr_movements(options = {}) .execute end - # This endpoint returns your site's current MRR, including plan and usage - # breakouts split per subscription. + # Lists your site's current MRR, including plan and usage breakouts split + # per subscription. # @param [ListMrrFilter] filter Optional parameter: Filter to use for List # MRR per subscription operation # @param [String] at_time Optional parameter: Submit a timestamp in ISO8601 diff --git a/lib/advanced_billing/controllers/invoices_controller.rb b/lib/advanced_billing/controllers/invoices_controller.rb index fb9fa83..848e47e 100644 --- a/lib/advanced_billing/controllers/invoices_controller.rb +++ b/lib/advanced_billing/controllers/invoices_controller.rb @@ -6,7 +6,7 @@ module AdvancedBilling # InvoicesController class InvoicesController < BaseController - # Refund an invoice, segment, or consolidated invoice. + # Refunds an invoice, segment, or consolidated invoice. # ## Partial Refund for Consolidated Invoice # A refund less than the total of a consolidated invoice will be split # across its segments. @@ -42,10 +42,11 @@ def refund_invoice(uid, .execute end - # By default, invoices returned on the index will only include totals, not - # detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, - # `payments`, `custom_fields`, or `refunds`. To include breakdowns, pass the - # specific field as a key in the query with a value set to `true`. + # Lists invoices for a site. By default, invoices returned on the index will + # only include totals, not detailed breakdowns for `line_items`, + # `discounts`, `taxes`, `credits`, `payments`, `custom_fields`, or + # `refunds`. To include breakdowns, pass the specific field as a key in the + # query with a value set to `true`. # @param [String] start_date Optional parameter: The start date (format # YYYY-MM-DD) with which to filter the date_field. Returns invoices with a # timestamp at or after midnight (12:00:00 AM) in your site’s time zone on @@ -79,19 +80,19 @@ def refund_invoice(uid, # @param [Direction] direction Optional parameter: The sort direction of the # returned invoices. # @param [TrueClass | FalseClass] line_items Optional parameter: Include - # line items data + # line items data. # @param [TrueClass | FalseClass] discounts Optional parameter: Include - # discounts data + # discounts data. # @param [TrueClass | FalseClass] taxes Optional parameter: Include taxes - # data + # data. # @param [TrueClass | FalseClass] credits Optional parameter: Include - # credits data + # credits data. # @param [TrueClass | FalseClass] payments Optional parameter: Include - # payments data + # payments data. # @param [TrueClass | FalseClass] custom_fields Optional parameter: Include - # custom fields data + # custom fields data. # @param [TrueClass | FalseClass] refunds Optional parameter: Include - # refunds data + # refunds data. # @param [InvoiceDateField] date_field Optional parameter: The type of # filter you would like to apply to your search. Use in query # `date_field=issue_date`. @@ -158,7 +159,7 @@ def list_invoices(options = {}) .execute end - # Use this endpoint to retrieve the details for an invoice. + # Returns the details for an invoice. # ## PDF Invoice retrieval # Individual PDF Invoices can be retrieved by using the "Accept" header # application/pdf or appending .pdf as the format portion of the URL: @@ -189,9 +190,9 @@ def read_invoice(uid) .execute end - # This endpoint returns a list of invoice events. Each event contains event - # "data" (such as an applied payment) as well as a snapshot of the `invoice` - # at the time of event completion. + # Lists invoice events for a site. Each event contains event "data" (such as + # an applied payment) as well as a snapshot of the `invoice` at the time of + # event completion. # Exposed event types are: # + issue_invoice # + apply_credit_note @@ -295,8 +296,7 @@ def record_payment_for_invoice(uid, .execute end - # This API call should be used when you want to record an external payment - # against multiple invoices. + # Records an external payment against multiple invoices. # To apply a payment to multiple invoices, at minimum, specify the `amount` # and `applications` (i.e., `invoice_uid` and `amount`) details. # ``` @@ -344,8 +344,8 @@ def record_payment_for_multiple_invoices(body: nil) .execute end - # Credit Notes are like inverse invoices. They reduce the amount a customer - # owes. + # Lists credit notes for a site. Credit Notes are like inverse invoices. + # They reduce the amount a customer owes. # By default, the credit notes returned by this endpoint will exclude the # arrays of `line_items`, `discounts`, `taxes`, `applications`, or # `refunds`. To include these arrays, pass the specific field as a key in @@ -364,15 +364,15 @@ def record_payment_for_multiple_invoices(body: nil) # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. # @param [TrueClass | FalseClass] line_items Optional parameter: Include - # line items data + # line items data. # @param [TrueClass | FalseClass] discounts Optional parameter: Include - # discounts data + # discounts data. # @param [TrueClass | FalseClass] taxes Optional parameter: Include taxes - # data + # data. # @param [TrueClass | FalseClass] refunds Optional parameter: Include - # refunds data + # refunds data. # @param [TrueClass | FalseClass] applications Optional parameter: Include - # applications data + # applications data. # @return [ListCreditNotesResponse] Response from the API call. def list_credit_notes(options = {}) @api_call @@ -395,7 +395,7 @@ def list_credit_notes(options = {}) .execute end - # Use this endpoint to retrieve the details for a credit note. + # Returns the details for a credit note. # @param [String] uid Required parameter: The unique identifier of the # credit note # @return [CreditNote] Response from the API call. @@ -415,7 +415,7 @@ def read_credit_note(uid) .execute end - # Record an external payment made against a subscription that will pay + # Records an external payment made against a subscription that will pay # partially or in full one or more invoices. # Payment will be applied starting with the oldest open invoice and then # next oldest, and so on until the amount of the payment is fully consumed. @@ -452,10 +452,9 @@ def record_payment_for_subscription(subscription_id, .execute end - # This endpoint allows you to reopen any invoice with the "canceled" status. - # Invoices enter "canceled" status if they were open at the time the - # subscription was canceled (whether through dunning or an intentional - # cancellation). + # Reopens any invoice with the "canceled" status. Invoices enter "canceled" + # status if they were open at the time the subscription was canceled + # (whether through dunning or an intentional cancellation). # Invoices with "canceled" status are no longer considered to be due. Once # reopened, they are considered due for payment. Payment may then be # captured in one of the following ways: @@ -496,9 +495,9 @@ def reopen_invoice(uid) .execute end - # This endpoint allows you to void any invoice with the "open" or "canceled" - # status. It will also allow voiding of an invoice with the "pending" - # status if it is not a consolidated invoice. + # Voids any invoice with the "open" or "canceled" status. It will also + # allow voiding of an invoice with the "pending" status if it is not a + # consolidated invoice. # @param [String] uid Required parameter: The unique identifier for the # invoice, this does not refer to the public facing invoice number. # @param [VoidInvoiceRequest] body Optional parameter: TODO: type @@ -531,9 +530,10 @@ def void_invoice(uid, .execute end - # Invoice segments returned on the index will only include totals, not - # detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, - # `payments`, or `custom_fields`. + # Lists segments for a consolidated invoice. Invoice segments returned on + # the index will only include totals, not detailed breakdowns for + # `line_items`, `discounts`, `taxes`, `credits`, `payments`, or + # `custom_fields`. # @param [String] invoice_uid Required parameter: The unique identifier of # the consolidated invoice # @param [Integer] page Optional parameter: Result records are organized in @@ -569,7 +569,7 @@ def list_consolidated_invoice_segments(options = {}) .execute end - # This endpoint will allow you to create an ad hoc invoice. + # Creates an ad hoc invoice. # ### Basic Behavior # You can create a basic invoice by sending an array of line items to this # endpoint. Each line item, at a minimum, must include a title, a quantity @@ -801,11 +801,131 @@ def create_invoice(subscription_id, .execute end - # This endpoint allows for invoices to be programmatically delivered via - # email. This endpoint supports the delivery of both ad-hoc and - # automatically generated invoices. Additionally, this endpoint supports - # email delivery to direct recipients, carbon-copy (cc) recipients, and - # blind carbon-copy (bcc) recipients. + # Updates an ad hoc invoice while it is in the `draft` state. + # **Important: only invoices with the `adhoc` role and `draft` status can be + # updated.** Any other invoice — issued, or with a different role (e.g. + # `renewal`, `signup`) — cannot be updated through this endpoint and the + # request returns a `422` error. If the invoice does not belong to the + # provided subscription, a `404` error is returned. + # Only the attributes submitted in the request are changed — omitted + # attributes keep their current values. + # ### Line Items + # The `line_items` array describes changes to the invoice's line items. Line + # items not referenced in the array remain unchanged. + # #### Adding a line item + # A line item without a `uid` is added to the invoice. The same line item + # types and options as on invoice creation are supported (custom items, + # `product_id`, `component_id`, price points, period date ranges, taxes). + # #### Updating a line item + # A line item with the `uid` of an existing line item updates that line item + # with the submitted attributes. Amounts and taxes are recalculated. + # #### Removing a line item + # A line item with a `uid` and `"_destroy": true` is removed from the + # invoice. Other line items remain unchanged. + # Referencing a `uid` which does not exist on the invoice returns a `422` + # error. + # ### Coupons + # When the `coupons` key is present, the submitted coupons replace all + # discounts currently applied to the invoice. Send an empty array to remove + # all discounts. Coupon options are the same as on invoice creation. + # ### Invoice Options + # #### Issue Date and Net Terms + # The `issue_date` parameter can be sent to change the invoice's issue date. + # Only today or dates in the past are accepted. The date is interpreted and + # validated in your site's time zone, using the `YYYY-MM-DD` format. The + # `net_terms` parameter indicates the number of days after the issue date on + # which the invoice is due. The due date is recalculated whenever the issue + # date or net terms change. + # #### Addresses + # The seller, shipping and billing addresses can be sent to replace the + # addresses on the invoice. Each address requires to send a `first_name` at + # a minimum in order to work. Taxes are recalculated after an address + # change. + # #### Memo and Payment Instructions + # A custom memo can be sent with the `memo` parameter. Likewise, custom + # payment instructions can be sent with the `payment_instructions` + # parameter. + # @param [Integer] subscription_id Required parameter: The Chargify id of + # the subscription. + # @param [String] uid Required parameter: The unique identifier for the + # invoice, this does not refer to the public facing invoice number. + # @param [UpdateInvoiceRequest] body Optional parameter: TODO: type + # description here + # @return [InvoiceResponse] Response from the API call. + def update_invoice(subscription_id, + uid, + body: nil) + @api_call + .request(new_request_builder(HttpMethodEnum::PUT, + '/subscriptions/{subscription_id}/invoices/{uid}.json', + Server::PRODUCTION) + .template_param(new_parameter(subscription_id, key: 'subscription_id') + .is_required(true) + .should_encode(true)) + .template_param(new_parameter(uid, key: 'uid') + .is_required(true) + .should_encode(true)) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(body)) + .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('BasicAuth'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(InvoiceResponse.method(:from_hash)) + .local_error_template('404', + 'Not Found:\'{$response.body}\'', + ErrorListResponseException) + .local_error_template('422', + 'HTTP Response Not OK. Status code: {$statusCode}.'\ + ' Response: \'{$response.body}\'.', + ErrorArrayMapResponseException)) + .execute + end + + # Deletes an ad hoc invoice while it is in the `draft` state. + # **Important: only invoices with the `adhoc` role and `draft` status can be + # deleted.** Any other invoice — issued, or with a different role (e.g. + # `renewal`, `signup`) — cannot be deleted through this endpoint and the + # request returns a `422` error. Issued invoices should be voided instead. + # If the invoice does not belong to the provided subscription, a `404` error + # is returned. + # A successful deletion returns a `204 No Content` response and the invoice + # is permanently removed. + # @param [Integer] subscription_id Required parameter: The Chargify id of + # the subscription. + # @param [String] uid Required parameter: The unique identifier for the + # invoice, this does not refer to the public facing invoice number. + # @return [void] Response from the API call. + def delete_invoice(subscription_id, + uid) + @api_call + .request(new_request_builder(HttpMethodEnum::DELETE, + '/subscriptions/{subscription_id}/invoices/{uid}.json', + Server::PRODUCTION) + .template_param(new_parameter(subscription_id, key: 'subscription_id') + .is_required(true) + .should_encode(true)) + .template_param(new_parameter(uid, key: 'uid') + .is_required(true) + .should_encode(true)) + .auth(Single.new('BasicAuth'))) + .response(new_response_handler + .is_response_void(true) + .local_error_template('404', + 'Not Found:\'{$response.body}\'', + ErrorListResponseException) + .local_error_template('422', + 'HTTP Response Not OK. Status code: {$statusCode}.'\ + ' Response: \'{$response.body}\'.', + ErrorListResponseException)) + .execute + end + + # Sends an invoice to the customer via email. This endpoint supports the + # delivery of both ad-hoc and automatically generated invoices. + # Additionally, this endpoint supports email delivery to direct recipients, + # carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. # **File Attachments**: You can attach files to invoice emails using # `attachment_urls[]` parameter by providing URLs to the files you want to # attach. When using attachments, the request must use `multipart/form-data` @@ -846,6 +966,7 @@ def send_invoice(uid, .execute end + # Previews the effect of customer information changes on an open invoice. # Customer information may change after an invoice is issued, which may lead # to a mismatch between customer information that is present on an open # invoice and actual customer information. This endpoint allows you to @@ -878,10 +999,9 @@ def preview_customer_information_changes(uid) .execute end - # This endpoint updates customer information on an open invoice and returns - # the updated invoice. If you would like to preview changes that will be - # applied, use the `/invoices/{uid}/customer_information/preview.json` - # endpoint first. + # Updates customer information on an open invoice and returns the updated + # invoice. If you would like to preview changes that will be applied, use + # the `/invoices/{uid}/customer_information/preview.json` endpoint first. # The endpoint doesn't accept a request body. Customer information # differences are calculated on the application side. # @param [String] uid Required parameter: The unique identifier for the @@ -910,10 +1030,9 @@ def update_customer_information(uid) .execute end - # This endpoint allows you to issue an invoice that is in "pending" or - # "draft" status. For example, you can issue an invoice that was created - # when allocating new quantity on a component and using "accrue charges" - # option. + # Issues an invoice that is in "pending" or "draft" status. For example, you + # can issue an invoice that was created when allocating new quantity on a + # component and using "accrue charges" option. # You cannot issue a pending child invoice that was created for a member # subscription in a group. # For Remittance subscriptions, the invoice will go into "open" status and diff --git a/lib/advanced_billing/controllers/payment_profiles_controller.rb b/lib/advanced_billing/controllers/payment_profiles_controller.rb index 6ea6ac5..94b85b5 100644 --- a/lib/advanced_billing/controllers/payment_profiles_controller.rb +++ b/lib/advanced_billing/controllers/payment_profiles_controller.rb @@ -111,9 +111,9 @@ def create_payment_profile(body: nil) .execute end - # Returns all active payment profiles for a site, or for one customer within - # a site. If no payment profiles are found, this endpoint will return an - # empty array, not a 404. + # Lists all active payment profiles for a site, or for one customer within a + # site. If no payment profiles are found, this endpoint will return an empty + # array, not a 404. # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start @@ -431,8 +431,8 @@ def change_subscription_default_payment_profile(subscription_id, .execute end - # This will change the default payment profile on the subscription group to - # the existing payment profile with the id specified. + # Changes the default payment profile on the subscription group to the + # existing payment profile with the specified ID. # You must elect to change the existing payment profile to a new payment # profile ID in order to receive a satisfactory response from this endpoint. # The new payment profile must belong to the subscription group's customer, @@ -466,8 +466,10 @@ def change_subscription_group_default_payment_profile(uid, .execute end - # One Time Tokens aka Advanced Billing Tokens house the credit card or ACH - # (Authorize.Net or Stripe only) data for a customer. + # Returns the one-time token data, including credit card or ACH details, + # associated with the provided token ID. One Time Tokens aka Advanced + # Billing Tokens house the credit card or ACH (Authorize.Net or Stripe only) + # data for a customer. # You can use One Time Tokens while creating a subscription or payment # profile instead of passing all bank account or credit card data directly # to a given API endpoint. @@ -496,8 +498,8 @@ def read_one_time_token(chargify_token) .execute end - # You can send a "request payment update" email to the customer associated - # with the subscription. + # Sends a "request payment update" email to the customer associated with the + # subscription. # If you attempt to send a "request payment update" email more than five # times within a 30-minute period, you will receive a `422` response with an # error message in the body. This error message will indicate that the diff --git a/lib/advanced_billing/controllers/product_families_controller.rb b/lib/advanced_billing/controllers/product_families_controller.rb index 22e5cd0..9774ced 100644 --- a/lib/advanced_billing/controllers/product_families_controller.rb +++ b/lib/advanced_billing/controllers/product_families_controller.rb @@ -45,7 +45,7 @@ class ProductFamiliesController < BaseController # can specify timezone in query - otherwise your site's time zone will be # used. If provided, this parameter will be used instead of end_date. # @param [TrueClass | FalseClass] include_archived Optional parameter: - # Include archived products + # Include archived products. # @param [ListProductsInclude] include Optional parameter: Allows including # additional data in the response. Use in query # `include=prepaid_product_price_point`. @@ -111,7 +111,7 @@ def create_product_family(body: nil) .execute end - # Returns a list of Product Families for a site. + # Lists Product Families for a site. # @param [BasicDateField] date_field Optional parameter: The type of filter # you would like to apply to your search. Use in query: # `date_field=created_at`. diff --git a/lib/advanced_billing/controllers/product_price_points_controller.rb b/lib/advanced_billing/controllers/product_price_points_controller.rb index 0e60ed7..6171a9b 100644 --- a/lib/advanced_billing/controllers/product_price_points_controller.rb +++ b/lib/advanced_billing/controllers/product_price_points_controller.rb @@ -58,13 +58,13 @@ def create_product_price_point(product_id, # many records to fetch in each request. Default value is 10. The maximum # allowed values is 200; any per_page value over 200 will be changed to # 200. - # @param [TrueClass | FalseClass] currency_prices Optional parameter: When - # fetching a product's price points, if you have defined multiple currencies - # at the site level, you can optionally pass the ?currency_prices=true query - # param to include an array of currency price data in the response. If the - # product price point is set to use_site_exchange_rate: true, it will return - # pricing based on the current exchange rate. If the flag is set to false, - # it will return all of the defined prices for each currency. + # @param [TrueClass | FalseClass] currency_prices Optional parameter: + # (Optional) If you have defined multiple currencies at the site level, you + # can pass ?currency_prices=true to include an array of currency price data + # in the response. If the product price point is set to + # use_site_exchange_rate: true, it will return pricing based on the current + # exchange rate. If the flag is set to false, it will return all of the + # defined prices for each currency. # @param [Array[PricePointType]] filter_type Optional parameter: Use in # query: `filter[type]=catalog,default`. # @param [TrueClass | FalseClass] archived Optional parameter: Set to @@ -151,13 +151,13 @@ def update_product_price_point(product_id, # handle of the price point. When using the handle, it must be prefixed with # `handle:`. Example: `123` for an integer ID, or # `handle:example-product-price-point-handle` for a string handle. - # @param [TrueClass | FalseClass] currency_prices Optional parameter: When - # fetching a product's price points, if you have defined multiple currencies - # at the site level, you can optionally pass the ?currency_prices=true query - # param to include an array of currency price data in the response. If the - # product price point is set to use_site_exchange_rate: true, it will return - # pricing based on the current exchange rate. If the flag is set to false, - # it will return all of the defined prices for each currency. + # @param [TrueClass | FalseClass] currency_prices Optional parameter: + # (Optional) If you have defined multiple currencies at the site level, you + # can pass ?currency_prices=true to include an array of currency price data + # in the response. If the product price point is set to + # use_site_exchange_rate: true, it will return pricing based on the current + # exchange rate. If the flag is set to false, it will return all of the + # defined prices for each currency. # @return [ProductPricePointResponse] Response from the API call. def read_product_price_point(product_id, price_point_id, diff --git a/lib/advanced_billing/controllers/products_controller.rb b/lib/advanced_billing/controllers/products_controller.rb index 8f18721..fa2958c 100644 --- a/lib/advanced_billing/controllers/products_controller.rb +++ b/lib/advanced_billing/controllers/products_controller.rb @@ -7,6 +7,11 @@ module AdvancedBilling # ProductsController class ProductsController < BaseController # Creates a product in your Advanced Billing site. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, the `auto_create_signup_page` parameter is + # not supported. If `auto_create_signup_page` is included (with any value) + # an error is returned. # See the following product documentation for more information: # + [Products # Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645- diff --git a/lib/advanced_billing/controllers/proforma_invoices_controller.rb b/lib/advanced_billing/controllers/proforma_invoices_controller.rb index 18452ef..f093d6e 100644 --- a/lib/advanced_billing/controllers/proforma_invoices_controller.rb +++ b/lib/advanced_billing/controllers/proforma_invoices_controller.rb @@ -47,17 +47,17 @@ def create_consolidated_proforma_invoice(uid) # @param [String] uid Required parameter: The uid of the subscription # group # @param [TrueClass | FalseClass] line_items Optional parameter: Include - # line items data + # line items data. # @param [TrueClass | FalseClass] discounts Optional parameter: Include - # discounts data + # discounts data. # @param [TrueClass | FalseClass] taxes Optional parameter: Include taxes - # data + # data. # @param [TrueClass | FalseClass] credits Optional parameter: Include - # credits data + # credits data. # @param [TrueClass | FalseClass] payments Optional parameter: Include - # payments data + # payments data. # @param [TrueClass | FalseClass] custom_fields Optional parameter: Include - # custom fields data + # custom fields data. # @return [ListProformaInvoicesResponse] Response from the API call. def list_subscription_group_proforma_invoices(options = {}) @api_call @@ -168,17 +168,17 @@ def create_proforma_invoice(subscription_id) # @param [Direction] direction Optional parameter: The sort direction of the # returned invoices. # @param [TrueClass | FalseClass] line_items Optional parameter: Include - # line items data + # line items data. # @param [TrueClass | FalseClass] discounts Optional parameter: Include - # discounts data + # discounts data. # @param [TrueClass | FalseClass] taxes Optional parameter: Include taxes - # data + # data. # @param [TrueClass | FalseClass] credits Optional parameter: Include - # credits data + # credits data. # @param [TrueClass | FalseClass] payments Optional parameter: Include - # payments data + # payments data. # @param [TrueClass | FalseClass] custom_fields Optional parameter: Include - # custom fields data + # custom fields data. # @return [ListProformaInvoicesResponse] Response from the API call. def list_proforma_invoices(options = {}) @api_call @@ -289,12 +289,12 @@ def void_proforma_invoice(proforma_invoice_uid, .execute end - # Returns a preview of the data that will be included on a given - # subscription's proforma invoice if one were to be generated. It will have - # similar line items and totals as a renewal preview, but the response will - # be presented in the format of a proforma invoice. Consequently it will - # include additional information such as the name and addresses that will - # appear on the proforma invoice. + # Previews the data that will be included on a given subscription's proforma + # invoice if one were to be generated. It will have similar line items and + # totals as a renewal preview, but the response will be presented in the + # format of a proforma invoice. Consequently it will include additional + # information such as the name and addresses that will appear on the + # proforma invoice. # The preview endpoint is subject to all the same conditions as the proforma # invoice endpoint. For example, previews are only available on the # Relationship Invoicing architecture, and previews cannot be made for diff --git a/lib/advanced_billing/controllers/sales_commissions_controller.rb b/lib/advanced_billing/controllers/sales_commissions_controller.rb index 94b3fbd..09732d4 100644 --- a/lib/advanced_billing/controllers/sales_commissions_controller.rb +++ b/lib/advanced_billing/controllers/sales_commissions_controller.rb @@ -22,7 +22,7 @@ class SalesCommissionsController < BaseController # enabled. For further information on getting access to Advanced Analytics # contact Maxio support. # > Note: The request is at seller level, it means `<>` variable - # will be replaced by `app` + # will be replaced by `app`. # @param [String] seller_id Required parameter: The Chargify id of your # seller account # @param [String] authorization Optional parameter: For authorization use @@ -63,7 +63,7 @@ def list_sales_commission_settings(options = {}) .execute end - # Returns a sales rep list with details. + # Lists sales reps with details. # ## Modified Authentication Process # The Sales Commission API differs from other Chargify API endpoints. This # resource is associated with the seller itself. Up to now all available @@ -79,7 +79,7 @@ def list_sales_commission_settings(options = {}) # enabled. For further information on getting access to Advanced Analytics # contact Maxio support. # > Note: The request is at seller level, it means `<>` variable - # will be replaced by `app` + # will be replaced by `app`. # @param [String] seller_id Required parameter: The Chargify id of your # seller account # @param [String] authorization Optional parameter: For authorization use @@ -136,7 +136,7 @@ def list_sales_reps(options = {}) # enabled. For further information on getting access to Advanced Analytics # contact Maxio support. # > Note: The request is at seller level, it means `<>` variable - # will be replaced by `app` + # will be replaced by `app`. # @param [String] seller_id Required parameter: The Chargify id of your # seller account # @param [String] sales_rep_id Required parameter: The Advanced Billing id diff --git a/lib/advanced_billing/controllers/sites_controller.rb b/lib/advanced_billing/controllers/sites_controller.rb index 3d9475d..a3c7e7b 100644 --- a/lib/advanced_billing/controllers/sites_controller.rb +++ b/lib/advanced_billing/controllers/sites_controller.rb @@ -20,7 +20,7 @@ class SitesController < BaseController # You can read more about these settings here: # [Who Pays & Customer # Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Cust - # omer-Hierarchies-WhoPays) + # omer-Hierarchies-WhoPays). # @return [SiteResponse] Response from the API call. def read_site @api_call @@ -61,7 +61,7 @@ def clear_site(cleanup_scope: CleanupScope::ALL) .execute end - # Returns public keys used for Maxio.js (formerly Chargify.js). + # Lists public keys used for Maxio.js (formerly Chargify.js). # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start diff --git a/lib/advanced_billing/controllers/subscription_components_controller.rb b/lib/advanced_billing/controllers/subscription_components_controller.rb index fa2faa7..4aa5553 100644 --- a/lib/advanced_billing/controllers/subscription_components_controller.rb +++ b/lib/advanced_billing/controllers/subscription_components_controller.rb @@ -239,7 +239,7 @@ def allocate_component(subscription_id, .execute end - # Returns the 50 most recent Allocations, ordered by most recent first. + # Lists the 50 most recent Allocations, ordered by most recent first. # ## On/Off Components # When a subscription's on/off component has been toggled to on (`1`) or off # (`0`), usage will be logged in this response. @@ -608,9 +608,9 @@ def create_usage(subscription_id_or_reference, .execute end - # Returns a list of usages associated with a subscription for a particular - # metered component. This will display the previously recorded components - # for a subscription. + # Lists usages associated with a subscription for a particular metered + # component. This will display the previously recorded components for a + # subscription. # This endpoint is not compatible with quantity-based components. # ## Since Date and Until Date Usage # Note: The `since_date` and `until_date` attributes each default to @@ -635,9 +635,9 @@ def create_usage(subscription_id_or_reference, # Advanced Billing id for the component or the component's handle prefixed # by `handle:` # @param [Integer] since_id Optional parameter: Returns usages with an id - # greater than or equal to the one specified + # greater than or equal to the one specified. # @param [Integer] max_id Optional parameter: Returns usages with an id less - # than or equal to the one specified + # than or equal to the one specified. # @param [Date] since_date Optional parameter: Returns usages with a # created_at date greater than or equal to midnight (12:00 AM) on the date # specified. @@ -783,7 +783,8 @@ def deactivate_event_based_component(subscription_id, # which the event should be published. # @param [String] store_uid Optional parameter: If you've attached your own # Keen project as an Advanced Billing event data-store, use this parameter - # to indicate the data-store. + # to indicate the data-store. This applies to Legacy Metering sites only — + # it has no effect on Maxio Metering sites. # @param [EBBEvent] body Optional parameter: TODO: type description here # @return [void] Response from the API call. def record_event(api_handle, @@ -816,7 +817,8 @@ def record_event(api_handle, # which the events should be published. # @param [String] store_uid Optional parameter: If you've attached your own # Keen project as an Advanced Billing event data-store, use this parameter - # to indicate the data-store. + # to indicate the data-store. This applies to Legacy Metering sites only — + # it has no effect on Maxio Metering sites. # @param [Array[EBBEvent]] body Optional parameter: TODO: type description # here # @return [void] Response from the API call. diff --git a/lib/advanced_billing/controllers/subscription_groups_controller.rb b/lib/advanced_billing/controllers/subscription_groups_controller.rb index ea30b65..dd6ff6e 100644 --- a/lib/advanced_billing/controllers/subscription_groups_controller.rb +++ b/lib/advanced_billing/controllers/subscription_groups_controller.rb @@ -70,8 +70,8 @@ def create_subscription_group(body: nil) .execute end - # Returns an array of subscription groups for the site. The response is - # paginated and will return a `meta` key with pagination information. + # Lists subscription groups for the site. The response is paginated and will + # return a `meta` key with pagination information. # #### Account Balance Information # Account balance information for the subscription groups is not returned by # default. If this information is desired, the `include[]=account_balances` @@ -222,7 +222,8 @@ def find_subscription_group(subscription_id) .execute end - # For sites making use of the [Relationship + # Adds an existing subscription to a subscription group. For sites making + # use of the [Relationship # Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanc # ed-Billing-Invoices-Overview) and [Customer # Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Cust @@ -277,7 +278,8 @@ def add_subscription_to_group(subscription_id, .execute end - # For sites making use of the [Relationship + # Removes an existing subscription from a subscription group. For sites + # making use of the [Relationship # Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanc # ed-Billing-Invoices-Overview) and [Customer # Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Cust diff --git a/lib/advanced_billing/controllers/subscription_renewals_controller.rb b/lib/advanced_billing/controllers/subscription_renewals_controller.rb index 8871b74..ffe9c3d 100644 --- a/lib/advanced_billing/controllers/subscription_renewals_controller.rb +++ b/lib/advanced_billing/controllers/subscription_renewals_controller.rb @@ -183,7 +183,7 @@ def lock_in_scheduled_renewal_immediately(subscription_id, .execute end - # Returns a scheduled renewal configuration to an editable state. + # Restores a scheduled renewal configuration to an editable state. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] id Required parameter: The renewal id. @@ -240,6 +240,12 @@ def cancel_scheduled_renewal_configuration(subscription_id, end # Adds product and component line items to the scheduled renewal. + # If your site has list vs sales pricing enabled, accepts + # renewal_configuration_item.custom_price.list_price_point_id, validates and + # persists it; omitted value follows existing/default behavior; with list vs + # sales pricing disabled, parameter is ignored (no validation/behavioral + # impact). This functionality is supported in the API, but is not currently + # supported in SDKs. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] scheduled_renewals_configuration_id Required parameter: @@ -275,6 +281,12 @@ def create_scheduled_renewal_configuration_item(subscription_id, end # Updates an existing configuration item’s pricing and quantity. + # If you site has list vs sales pricing enabled, accepts + # renewal_configuration_item.custom_price.list_price_point_id, validates and + # persists it; omitted value follows existing/default behavior; with list vs + # sales pricing disabled, parameter is ignored (no validation/behavioral + # impact). This functionality is supported in the API, but is not currently + # supported in SDKs. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] scheduled_renewals_configuration_id Required parameter: diff --git a/lib/advanced_billing/controllers/subscriptions_controller.rb b/lib/advanced_billing/controllers/subscriptions_controller.rb index a544a46..5e9f2c7 100644 --- a/lib/advanced_billing/controllers/subscriptions_controller.rb +++ b/lib/advanced_billing/controllers/subscriptions_controller.rb @@ -16,6 +16,61 @@ class SubscriptionsController < BaseController # Select an option from the **Request Examples** drop-down on the right side # of the portal to see examples of common scenarios for creating # subscriptions. + # ## List vs Sales Pricing + # When a subscription uses custom pricing as the sales price, you can + # optionally provide a list price for any item. If omitted, the list price + # defaults to the sales price. The difference between the list price and + # sales price is used to calculate implicit discounts, which appear on + # Invoices and in reporting. List price can also support revenue allocations + # in [Advanced + # Revenue](https://docs.maxio.com/hc/en-us/articles/24177001342861-Create-an + # d-Configure-RevenueBooks). + # If your site has list pricing enabled, the API accepts + # `custom_price.list_price_point_id` for custom pricing, validates and + # persists it, and returns list price metadata in subscription responses. If + # list pricing is disabled, this input is ignored and related response + # fields are omitted. + # When list pricing is enabled: + # - Subscription → Product `product_price_point_list_price_point_id` + # (integer) + # - `product_price_point_list_price_point_handle` (string) + # - Subscription Components (when components are included in the response, + # such as with subscriptions built from components or component + # serialization paths) `component_id` (integer) + # - `price_point_id` (integer) + # - `list_price_point_id` (integer) + # When list pricing is disabled: + # - Subscription → Product `product_price_point_list_price_point_id`: + # omitted + # - `product_price_point_list_price_point_handle`: omitted + # - Subscription Components `list_price_point_id`: omitted + # This functionality is supported in the API, but is not currently supported + # in SDKs. + # ## Subscriptions can now work independently from the catalog + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, you can create subscriptions without a + # `product_id` or `product_handle` using POST /subscriptions, building them + # entirely from components. + # A valid subscription must include at least one active component with: + # - a positive `allocated_quantity`, + # - a positive `unit_balance`, or + # - 'enabled: true' (for on/off components) + # - a configured metered component + # `component_id` can be provided as a numeric ID or in handle: format. If + # `trial_interval` and `trial_interval_unit` are included, they are applied + # at creation. + # In the response, product and product price point fields are null, and + # component details are returned instead. + # This functionality is supported in the API, but is not currently supported + # in SDKs. + # ## Payment information + # Payment information may be required to create a subscription, depending on + # the options for the Product being subscribed. See [product + # options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-Prod + # ucts) for more information. See the [Payments + # Profile]($e/Payment%20Profiles/createPaymentProfile) endpoint for details + # on payment parameters. # See the [Subscription # Signups](page:introduction/basic-concepts/subscription-signup) article for # more information on working with subscriptions in Advanced Billing. @@ -70,9 +125,14 @@ def create_subscription(body: nil) .execute end - # Returns an array of subscriptions from a Site. Pay close attention to - # query string filters and pagination in order to control responses from the - # server. + # Lists subscriptions for a site. Use the query string filters and + # pagination to control responses from the server. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, some subscriptions may not have an + # associated product. For subscriptions without an associated product, + # 'product', 'product_price_point_id', and 'product_price_point_type' are + # returned as 'null'. # ## Search for a subscription # Use the query strings below to search for a subscription using the # criteria available. The return value will be an array. @@ -91,17 +151,34 @@ def create_subscription(body: nil) # many records to fetch in each request. Default value is 20. The maximum # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. + # @param [SubscriptionSort] sort Optional parameter: The attribute by which + # to sort + # @param [SortingDirection] direction Optional parameter: Controls the order + # in which results are returned. Use in query `direction=asc`. # @param [SubscriptionStateFilter] state Optional parameter: The current # state of the subscription - # @param [Integer] product Optional parameter: The product id of the - # subscription. (Note that the product handle cannot be used.) + # @param [Integer | String | nil] product Optional parameter: Filter + # subscriptions by product. Accepts product ID or exact product name. + # Product handle is not supported. + # @param [String] q Optional parameter: Search string. + # @param [QScope] q_scope Optional parameter: Scope of fields used by the q + # search. + # @param [Integer] customer_id Optional parameter: The Advanced Billing id + # of the customer. # @param [Integer] product_price_point_id Optional parameter: The ID of the - # product price point. If supplied, product is required + # product price point. If supplied, product is required. # @param [Integer] coupon Optional parameter: The numeric id of the coupon # currently applied to the subscription. (This can be found in the URL when # editing a coupon. Note that the coupon code cannot be used.) # @param [String] coupon_code Optional parameter: The coupon code currently # applied to the subscription + # @param [CollectionMethod1] collection_method Optional parameter: The + # collection method for the subscription. + # @param [Integer] branding_theme_id Optional parameter: Filter + # subscriptions by the ID of an assigned Branding Theme. Branding Themes is + # a beta feature. See [Understand Branding + # Themes](https://docs.maxio.com/hc/en-us/articles/43796895662093-Understand + # -Branding-Themes#understand-branding-themes-0-0) for more information. # @param [SubscriptionDateField] date_field Optional parameter: The type of # filter you'd like to apply to your search. Allowed Values: , # current_period_ends_at, current_period_starts_at, created_at, @@ -130,10 +207,14 @@ def create_subscription(body: nil) # @param [Hash[String, String]] metadata Optional parameter: The value of # the metadata field specified in the parameter. Use in query # `metadata[my-field]=value&metadata[other-field]=another_value`. - # @param [SortingDirection] direction Optional parameter: Controls the order - # in which results are returned. Use in query `direction=asc`. - # @param [SubscriptionSort] sort Optional parameter: The attribute by which - # to sort + # @param [GroupStatus] group_status Optional parameter: Filter by whether a + # subscription is in a group. + # @param [TrueClass | FalseClass] dunning_exemption Optional parameter: + # Filter by dunning exemption status. + # @param [String] payment_gateways Optional parameter: Comma-separated + # payment gateway identifiers. + # @param [String] currencies Optional parameter: Comma-separated currency + # codes. # @param [Array[SubscriptionListInclude]] include Optional parameter: Allows # including additional data in the response. Use in query: # `include[]=self_service_page_token`. @@ -145,19 +226,32 @@ def list_subscriptions(options = {}) Server::PRODUCTION) .query_param(new_parameter(options['page'], key: 'page')) .query_param(new_parameter(options['per_page'], key: 'per_page')) + .query_param(new_parameter(options['sort'], key: 'sort')) + .query_param(new_parameter(options['direction'], key: 'direction')) .query_param(new_parameter(options['state'], key: 'state')) - .query_param(new_parameter(options['product'], key: 'product')) + .query_param(new_parameter(options['product'], key: 'product') + .validator(proc do |value| + UnionTypeLookUp.get(:ListSubscriptionsInputProduct) + .validate(value) + end)) + .query_param(new_parameter(options['q'], key: 'q')) + .query_param(new_parameter(options['q_scope'], key: 'q_scope')) + .query_param(new_parameter(options['customer_id'], key: 'customer_id')) .query_param(new_parameter(options['product_price_point_id'], key: 'product_price_point_id')) .query_param(new_parameter(options['coupon'], key: 'coupon')) .query_param(new_parameter(options['coupon_code'], key: 'coupon_code')) + .query_param(new_parameter(options['collection_method'], key: 'collection_method')) + .query_param(new_parameter(options['branding_theme_id'], key: 'branding_theme_id')) .query_param(new_parameter(options['date_field'], key: 'date_field')) .query_param(new_parameter(options['start_date'], key: 'start_date')) .query_param(new_parameter(options['end_date'], key: 'end_date')) .query_param(new_parameter(options['start_datetime'], key: 'start_datetime')) .query_param(new_parameter(options['end_datetime'], key: 'end_datetime')) .query_param(new_parameter(options['metadata'], key: 'metadata')) - .query_param(new_parameter(options['direction'], key: 'direction')) - .query_param(new_parameter(options['sort'], key: 'sort')) + .query_param(new_parameter(options['group_status'], key: 'group_status')) + .query_param(new_parameter(options['dunning_exemption'], key: 'dunning_exemption')) + .query_param(new_parameter(options['payment_gateways'], key: 'payment_gateways')) + .query_param(new_parameter(options['currencies'], key: 'currencies')) .query_param(new_parameter(options['include'], key: 'include')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('BasicAuth')) @@ -237,10 +331,16 @@ def list_subscriptions(options = {}) # billing date for **a subscription using a product eligible for calendar # billing**. # > Note: If you change the product associated with a subscription that - # contains a `snap_day` and immediately `READ/GET` the subscription data, it - # will still contain original `snap_day`. The `snap_day` will reset to null - # on the next billing cycle. This is because a product change is + # contains a `snap_day` and immediately READ/GET the subscription data, it + # will still contain the original `snap_day`. The `snap_day` will be reset + # to `null` on the next billing cycle. This is because a product change is # instantaneous and only affects the product associated with a subscription. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, some subscriptions may not have an + # associated product. For subscriptions without an associated product, + # `product`, `product_price_point_id`, and `product_price_point_type` are + # returned as `null`. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [UpdateSubscriptionRequest] body Optional parameter: TODO: type @@ -271,6 +371,12 @@ def update_subscription(subscription_id, end # Retrieves subscription details. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, some subscriptions may not have an + # associated product. For subscriptions without an associated product, + # 'product', 'product_price_point_id', and 'product_price_point_type' are + # returned as 'null'. # ## Self-Service Page token # Self-Service Page token for the subscription is not returned by default. # If this information is desired, the include[]=self_service_page_token @@ -461,6 +567,23 @@ def update_prepaid_subscription_configuration(subscription_id, # For more information, see our documentation # [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscrib # er-Interface-Overview). + # ## Subscriptions can now work independently from the catalog + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, you can create subscriptions without a + # `product_id` or `product_handle` using POST /subscriptions, building them + # entirely from components. + # A valid subscription must include at least one active component with: + # - a positive `allocated_quantity`, + # - a positive `unit_balance`, or + # - 'enabled: true' (for on/off components) + # `component_id` can be provided as a numeric ID or in handle: format. If + # `trial_interval` and `trial_interval_unit` are included, they are applied + # at creation. + # In the response, product and product price point fields are null, and + # component details are returned instead. + # This functionality is supported in the API, but is not currently supported + # in SDKs. # ## Taxable Subscriptions # This endpoint will preview taxes applicable to a purchase. In order for # taxes to be previewed, the following conditions must be met: diff --git a/lib/advanced_billing/controllers/webhooks_controller.rb b/lib/advanced_billing/controllers/webhooks_controller.rb index 3a731aa..c308414 100644 --- a/lib/advanced_billing/controllers/webhooks_controller.rb +++ b/lib/advanced_billing/controllers/webhooks_controller.rb @@ -126,7 +126,7 @@ def create_endpoint(body: nil) .execute end - # Returns created endpoints for a site. + # Lists endpoints configured for a site. # @return [Array[Endpoint]] Response from the API call. def list_endpoints @api_call diff --git a/lib/advanced_billing/models/account_balances.rb b/lib/advanced_billing/models/account_balances.rb index 4f22d0e..1a851bd 100644 --- a/lib/advanced_billing/models/account_balances.rb +++ b/lib/advanced_billing/models/account_balances.rb @@ -9,12 +9,12 @@ class AccountBalances < BaseModel SKIP = Object.new private_constant :SKIP - # The balance, in cents, of the sum of the subscription's open, payable + # The balance, in cents, of the sum of the subscription's open, payable # invoices. # @return [AccountBalance] attr_accessor :open_invoices - # The balance, in cents, of the sum of the subscription's pending, payable + # The balance, in cents, of the sum of the subscription's pending, payable # invoices. # @return [AccountBalance] attr_accessor :pending_invoices diff --git a/lib/advanced_billing/models/activate_subscription_request.rb b/lib/advanced_billing/models/activate_subscription_request.rb index 162cc95..65d87aa 100644 --- a/lib/advanced_billing/models/activate_subscription_request.rb +++ b/lib/advanced_billing/models/activate_subscription_request.rb @@ -10,10 +10,10 @@ class ActivateSubscriptionRequest < BaseModel private_constant :SKIP # You may choose how to handle the activation failure. `true` means do not - # change the subscription’s state and billing period. `false` means to - # continue through with the activation and enter an end of life state. If - # this parameter is omitted or `null` is passed it will default to value set - # in the site settings (default: `true`) + # change the subscription’s state and billing period. `false` means to + # continue through with the activation and enter an end-of-life state. If + # this parameter is omitted or `null` is passed it will default to the value + # set in the site settings (default: `true`). # @return [TrueClass | FalseClass] attr_accessor :revert_on_failure diff --git a/lib/advanced_billing/models/agreement_acceptance.rb b/lib/advanced_billing/models/agreement_acceptance.rb index ca0b0bc..00cbc4a 100644 --- a/lib/advanced_billing/models/agreement_acceptance.rb +++ b/lib/advanced_billing/models/agreement_acceptance.rb @@ -14,31 +14,31 @@ class AgreementAcceptance < BaseModel attr_accessor :ip_address # Required when creating a subscription with Maxio Payments. Either - # terms_url or provacy_policy_url required when providing + # terms_url or privacy_policy_url is required when providing # agreement_acceptance params. # @return [String] attr_accessor :terms_url # Required when creating a subscription with Maxio Payments. Either - # terms_url or provacy_policy_url required when providing + # terms_url or privacy_policy_url is required when providing # agreement_acceptance params. # @return [String] attr_accessor :privacy_policy_url # Required when creating a subscription with Maxio Payments. Either - # terms_url or provacy_policy_url required when providing + # terms_url or privacy_policy_url is required when providing # agreement_acceptance params. # @return [String] attr_accessor :return_refund_policy_url # Required when creating a subscription with Maxio Payments. Either - # terms_url or provacy_policy_url required when providing + # terms_url or privacy_policy_url is required when providing # agreement_acceptance params. # @return [String] attr_accessor :delivery_policy_url # Required when creating a subscription with Maxio Payments. Either - # terms_url or provacy_policy_url required when providing + # terms_url or privacy_policy_url is required when providing # agreement_acceptance params. # @return [String] attr_accessor :secure_checkout_policy_url diff --git a/lib/advanced_billing/models/allocate_components.rb b/lib/advanced_billing/models/allocate_components.rb index d29e0cb..69067f2 100644 --- a/lib/advanced_billing/models/allocate_components.rb +++ b/lib/advanced_billing/models/allocate_components.rb @@ -36,7 +36,7 @@ class AllocateComponents < BaseModel attr_accessor :downgrade_credit # (Optional) If not passed, the allocation(s) will use the payment - # collection method on the subscription + # collection method on the subscription. # @return [CollectionMethod] attr_accessor :payment_collection_method diff --git a/lib/advanced_billing/models/allocation.rb b/lib/advanced_billing/models/allocation.rb index e183de7..cf1837a 100644 --- a/lib/advanced_billing/models/allocation.rb +++ b/lib/advanced_billing/models/allocation.rb @@ -10,26 +10,26 @@ class Allocation < BaseModel SKIP = Object.new private_constant :SKIP - # The allocation unique id + # The allocation unique ID # @return [Integer] attr_accessor :allocation_id # The integer component ID for the allocation. This references a component - # that you have created in your Product setup + # that you have created in your Product setup. # @return [Integer] attr_accessor :component_id # The handle of the component. This references a component that you have - # created in your Product setup + # created in your Product setup. # @return [String] attr_accessor :component_handle # The integer subscription ID for the allocation. This references a unique - # subscription in your Site + # subscription in your Site. # @return [Integer] attr_accessor :subscription_id - # The allocated quantity set in to effect by the allocation. String for + # The allocated quantity set into effect by the allocation. String for # components supporting fractional quantities # @return [Object] attr_accessor :quantity @@ -43,8 +43,8 @@ class Allocation < BaseModel # @return [String] attr_accessor :memo - # The time that the allocation was recorded, in format and UTC timezone, - # i.e. 2012-11-20T22:00:37Z + # The time that the allocation was recorded, in ISO 8601 format and UTC + # timezone, e.g., 2012-11-20T22:00:37Z # @return [DateTime] attr_accessor :timestamp @@ -77,7 +77,7 @@ class Allocation < BaseModel # @return [String] attr_accessor :price_point_handle - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/allocation_preview_item.rb b/lib/advanced_billing/models/allocation_preview_item.rb index ab38538..6dba7e7 100644 --- a/lib/advanced_billing/models/allocation_preview_item.rb +++ b/lib/advanced_billing/models/allocation_preview_item.rb @@ -60,7 +60,7 @@ class AllocationPreviewItem < BaseModel # @return [Integer] attr_accessor :price_point_id - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/allocation_preview_line_item.rb b/lib/advanced_billing/models/allocation_preview_line_item.rb index 3e32370..18ef68a 100644 --- a/lib/advanced_billing/models/allocation_preview_line_item.rb +++ b/lib/advanced_billing/models/allocation_preview_line_item.rb @@ -41,7 +41,7 @@ class AllocationPreviewLineItem < BaseModel # @return [String] attr_accessor :component_handle - # Visible when using Fine-grained Component Control + # Visible when using Fine-grained Component Control. # @return [AllocationPreviewDirection] attr_accessor :direction diff --git a/lib/advanced_billing/models/apple_pay_payment_profile.rb b/lib/advanced_billing/models/apple_pay_payment_profile.rb index 46c1c06..0db4dac 100644 --- a/lib/advanced_billing/models/apple_pay_payment_profile.rb +++ b/lib/advanced_billing/models/apple_pay_payment_profile.rb @@ -22,7 +22,7 @@ class ApplePayPaymentProfile < BaseModel # @return [String] attr_accessor :last_name - # The Chargify-assigned id for the customer record to which the Apple Pay + # The Chargify-assigned ID for the customer record to which the Apple Pay # account belongs # @return [Integer] attr_accessor :customer_id diff --git a/lib/advanced_billing/models/apply_credit_note_event_data.rb b/lib/advanced_billing/models/apply_credit_note_event_data.rb index f8152ee..d897cf7 100644 --- a/lib/advanced_billing/models/apply_credit_note_event_data.rb +++ b/lib/advanced_billing/models/apply_credit_note_event_data.rb @@ -47,7 +47,7 @@ class ApplyCreditNoteEventData < BaseModel # @return [String] attr_accessor :role - # Shows whether it was applied to consolidated invoice or not + # Shows whether it was applied to consolidated invoice or not. # @return [TrueClass | FalseClass] attr_accessor :consolidated_invoice diff --git a/lib/advanced_billing/models/bank_account_attributes.rb b/lib/advanced_billing/models/bank_account_attributes.rb index 32357cf..866ecdd 100644 --- a/lib/advanced_billing/models/bank_account_attributes.rb +++ b/lib/advanced_billing/models/bank_account_attributes.rb @@ -18,9 +18,9 @@ class BankAccountAttributes < BaseModel # @return [String] attr_accessor :bank_name - # (Required when creating a subscription with ACH. Optional when creating a + # (Required when creating a subscription with ACH; optional when creating a # subscription with GoCardless). The routing number of the bank. It becomes - # bank_code while passing via GoCardless API + # bank_code while passing via GoCardless API. # @return [String] attr_accessor :bank_routing_number @@ -35,12 +35,12 @@ class BankAccountAttributes < BaseModel attr_accessor :bank_account_type # (Optional when creating a subscription with GoCardless) Branch code. - # Alternatively, an IBAN can be provided + # Alternatively, an IBAN can be provided. # @return [String] attr_accessor :bank_branch_code # (Optional when creating a subscription with GoCardless). International - # Bank Account Number. Alternatively, local bank details can be provided + # Bank Account Number. Alternatively, local bank details can be provided. # @return [String] attr_accessor :bank_iban diff --git a/lib/advanced_billing/models/bank_account_payment_profile.rb b/lib/advanced_billing/models/bank_account_payment_profile.rb index e8efffa..843850f 100644 --- a/lib/advanced_billing/models/bank_account_payment_profile.rb +++ b/lib/advanced_billing/models/bank_account_payment_profile.rb @@ -12,7 +12,7 @@ class BankAccountPaymentProfile < BaseModel # The Chargify-assigned ID of the stored bank account. This value can be # used as an input to payment_profile_id when creating a subscription, in - # order to re-use a stored payment profile for the same customer + # order to re-use a stored payment profile for the same customer. # @return [Integer] attr_accessor :id @@ -24,7 +24,7 @@ class BankAccountPaymentProfile < BaseModel # @return [String] attr_accessor :last_name - # The Chargify-assigned id for the customer record to which the bank account + # The Chargify-assigned ID for the customer record to which the bank account # belongs # @return [Integer] attr_accessor :customer_id @@ -74,15 +74,10 @@ class BankAccountPaymentProfile < BaseModel # A string representation of the stored bank routing number with all but the # last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be - # bank_account + # bank_account. # @return [String] attr_accessor :masked_bank_routing_number - # A string representation of the stored bank account number with all but the - # last 4 digits marked with X's (i.e. 'XXXXXXX1111') - # @return [String] - attr_accessor :masked_bank_account_number - # Defaults to checking # @return [BankAccountType] attr_accessor :bank_account_type @@ -95,18 +90,18 @@ class BankAccountPaymentProfile < BaseModel # @return [PaymentType] attr_accessor :payment_type - # denotes whether a bank account has been verified by providing the amounts - # of two small deposits made into the account + # Denotes whether a bank account has been verified by providing the amounts + # of two small deposits made into the account. # @return [TrueClass | FalseClass] attr_accessor :verified - # denotes whether a bank account has been verified by providing the amounts - # of two small deposits made into the account + # Denotes whether a bank account has been verified by providing the amounts + # of two small deposits made into the account. # @return [Integer] attr_accessor :site_gateway_setting_id - # denotes whether a bank account has been verified by providing the amounts - # of two small deposits made into the account + # Denotes whether a bank account has been verified by providing the amounts + # of two small deposits made into the account. # @return [String] attr_accessor :gateway_handle @@ -136,7 +131,6 @@ def self.names @_hash['billing_address_2'] = 'billing_address_2' @_hash['bank_name'] = 'bank_name' @_hash['masked_bank_routing_number'] = 'masked_bank_routing_number' - @_hash['masked_bank_account_number'] = 'masked_bank_account_number' @_hash['bank_account_type'] = 'bank_account_type' @_hash['bank_account_holder_type'] = 'bank_account_holder_type' @_hash['payment_type'] = 'payment_type' @@ -166,7 +160,6 @@ def self.optionals billing_address_2 bank_name masked_bank_routing_number - masked_bank_account_number bank_account_type bank_account_holder_type verified @@ -188,7 +181,6 @@ def self.nullables customer_vault_token billing_address_2 masked_bank_routing_number - masked_bank_account_number site_gateway_setting_id gateway_handle ] @@ -201,8 +193,7 @@ def initialize(payment_type: PaymentType::BANK_ACCOUNT, id: SKIP, billing_state: SKIP, billing_zip: SKIP, billing_country: SKIP, customer_vault_token: SKIP, billing_address_2: SKIP, bank_name: SKIP, - masked_bank_routing_number: SKIP, - masked_bank_account_number: SKIP, bank_account_type: SKIP, + masked_bank_routing_number: SKIP, bank_account_type: SKIP, bank_account_holder_type: SKIP, verified: false, site_gateway_setting_id: SKIP, gateway_handle: SKIP, created_at: SKIP, updated_at: SKIP, @@ -230,10 +221,6 @@ def initialize(payment_type: PaymentType::BANK_ACCOUNT, id: SKIP, @masked_bank_routing_number = masked_bank_routing_number end - unless masked_bank_account_number == SKIP - @masked_bank_account_number = - masked_bank_account_number - end @bank_account_type = bank_account_type unless bank_account_type == SKIP @bank_account_holder_type = bank_account_holder_type unless bank_account_holder_type == SKIP @payment_type = payment_type @@ -270,8 +257,6 @@ def self.from_hash(hash) bank_name = hash.key?('bank_name') ? hash['bank_name'] : SKIP masked_bank_routing_number = hash.key?('masked_bank_routing_number') ? hash['masked_bank_routing_number'] : SKIP - masked_bank_account_number = - hash.key?('masked_bank_account_number') ? hash['masked_bank_account_number'] : SKIP bank_account_type = hash.key?('bank_account_type') ? hash['bank_account_type'] : SKIP bank_account_holder_type = @@ -312,7 +297,6 @@ def self.from_hash(hash) billing_address_2: billing_address_2, bank_name: bank_name, masked_bank_routing_number: masked_bank_routing_number, - masked_bank_account_number: masked_bank_account_number, bank_account_type: bank_account_type, bank_account_holder_type: bank_account_holder_type, verified: verified, @@ -354,8 +338,7 @@ def to_s " billing_state: #{@billing_state}, billing_zip: #{@billing_zip}, billing_country:"\ " #{@billing_country}, customer_vault_token: #{@customer_vault_token}, billing_address_2:"\ " #{@billing_address_2}, bank_name: #{@bank_name}, masked_bank_routing_number:"\ - " #{@masked_bank_routing_number}, masked_bank_account_number:"\ - " #{@masked_bank_account_number}, bank_account_type: #{@bank_account_type},"\ + " #{@masked_bank_routing_number}, bank_account_type: #{@bank_account_type},"\ " bank_account_holder_type: #{@bank_account_holder_type}, payment_type: #{@payment_type},"\ " verified: #{@verified}, site_gateway_setting_id: #{@site_gateway_setting_id},"\ " gateway_handle: #{@gateway_handle}, created_at: #{@created_at}, updated_at:"\ @@ -372,8 +355,7 @@ def inspect " #{@billing_state.inspect}, billing_zip: #{@billing_zip.inspect}, billing_country:"\ " #{@billing_country.inspect}, customer_vault_token: #{@customer_vault_token.inspect},"\ " billing_address_2: #{@billing_address_2.inspect}, bank_name: #{@bank_name.inspect},"\ - " masked_bank_routing_number: #{@masked_bank_routing_number.inspect},"\ - " masked_bank_account_number: #{@masked_bank_account_number.inspect}, bank_account_type:"\ + " masked_bank_routing_number: #{@masked_bank_routing_number.inspect}, bank_account_type:"\ " #{@bank_account_type.inspect}, bank_account_holder_type:"\ " #{@bank_account_holder_type.inspect}, payment_type: #{@payment_type.inspect}, verified:"\ " #{@verified.inspect}, site_gateway_setting_id: #{@site_gateway_setting_id.inspect},"\ diff --git a/lib/advanced_billing/models/calendar_billing.rb b/lib/advanced_billing/models/calendar_billing.rb index 70a70b4..633d53b 100644 --- a/lib/advanced_billing/models/calendar_billing.rb +++ b/lib/advanced_billing/models/calendar_billing.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # (Optional). Cannot be used when also specifying next_billing_at + # (Optional). Cannot be used when also specifying next_billing_at. class CalendarBilling < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/advanced_billing/models/cancellation_options.rb b/lib/advanced_billing/models/cancellation_options.rb index 62913a9..9678261 100644 --- a/lib/advanced_billing/models/cancellation_options.rb +++ b/lib/advanced_billing/models/cancellation_options.rb @@ -27,7 +27,7 @@ class CancellationOptions < BaseModel # @return [TrueClass | FalseClass] attr_accessor :cancel_at_end_of_period - # Schedules the cancellation on the provided date. This is option is not + # Schedules the cancellation on the provided date. This option is not # applicable for prepaid subscriptions. To use this option, the Schedule # Subscription Cancellation feature must be enabled on your site. # @return [DateTime] diff --git a/lib/advanced_billing/models/chargify_ebb.rb b/lib/advanced_billing/models/chargify_ebb.rb index f6db3c2..eaa02c5 100644 --- a/lib/advanced_billing/models/chargify_ebb.rb +++ b/lib/advanced_billing/models/chargify_ebb.rb @@ -33,14 +33,14 @@ class ChargifyEBB < BaseModel attr_accessor :uniqueness_token # Id of Maxio Advanced Billing Subscription which is connected to this - # event. + # event. # Provide `subscription_id` if you configured `chargify.subscription_id` as # Subscription Identifier in your Event Stream. # @return [Integer] attr_accessor :subscription_id # Reference of Maxio Advanced Billing Subscription which is connected to - # this event. + # this event. # Provide `subscription_reference` if you configured # `chargify.subscription_reference` as Subscription Identifier in your Event # Stream. diff --git a/lib/advanced_billing/models/collection_method1.rb b/lib/advanced_billing/models/collection_method1.rb new file mode 100644 index 0000000..83a3a22 --- /dev/null +++ b/lib/advanced_billing/models/collection_method1.rb @@ -0,0 +1,40 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # collection_method1. + class CollectionMethod1 + COLLECTION_METHOD1 = [ + # TODO: Write general description for AUTOMATIC + AUTOMATIC = 'automatic'.freeze, + + # TODO: Write general description for REMITTANCE + REMITTANCE = 'remittance'.freeze, + + # TODO: Write general description for PREPAID + PREPAID = 'prepaid'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + COLLECTION_METHOD1.include?(value) + end + + def self.from_value(value, default_value = AUTOMATIC) + return default_value if value.nil? + + str = value.to_s.strip + + case str.downcase + when 'automatic' then AUTOMATIC + when 'remittance' then REMITTANCE + when 'prepaid' then PREPAID + else + default_value + end + end + end +end diff --git a/lib/advanced_billing/models/component.rb b/lib/advanced_billing/models/component.rb index 120b089..260884a 100644 --- a/lib/advanced_billing/models/component.rb +++ b/lib/advanced_billing/models/component.rb @@ -15,7 +15,7 @@ class Component < BaseModel # @return [Integer] attr_accessor :id - # The name of the Component, suitable for display on statements. i.e. Text + # The name of the Component, suitable for display on statements. e.g., Text # Messages. # @return [String] attr_accessor :name @@ -28,7 +28,7 @@ class Component < BaseModel # @return [PricingScheme] attr_accessor :pricing_scheme - # The name of the unit that the component’s usage is measured in. i.e. + # The name of the unit that the component’s usage is measured in. e.g., # message # @return [String] attr_accessor :unit_name @@ -50,7 +50,7 @@ class Component < BaseModel # @return [String] attr_accessor :product_family_handle - # deprecated - use unit_price instead + # deprecated - use unit_price instead. # @return [Integer] attr_accessor :price_per_unit_in_cents @@ -163,8 +163,8 @@ class Component < BaseModel # @return [Integer] attr_accessor :event_based_billing_metric_id - # The numerical interval. i.e. an interval of ‘30’ coupled with an - # interval_unit of day would mean this component's default price point would + # The numerical interval. e.g., an interval of ‘30’ coupled with an + # interval_unit of day would mean this component’s default price point would # renew every 30 days. This property is only available for sites with # Multifrequency enabled. # @return [Integer] @@ -176,6 +176,12 @@ class Component < BaseModel # @return [IntervalUnit] attr_accessor :interval_unit + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -215,6 +221,7 @@ def self.names 'event_based_billing_metric_id' @_hash['interval'] = 'interval' @_hash['interval_unit'] = 'interval_unit' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -256,6 +263,7 @@ def self.optionals event_based_billing_metric_id interval interval_unit + unspsc_code ] end @@ -279,6 +287,7 @@ def self.nullables use_site_exchange_rate accounting_code interval_unit + unspsc_code ] end @@ -296,7 +305,8 @@ def initialize(id: SKIP, name: SKIP, handle: SKIP, pricing_scheme: SKIP, allow_fractional_quantities: SKIP, item_category: SKIP, use_site_exchange_rate: SKIP, accounting_code: SKIP, event_based_billing_metric_id: SKIP, interval: SKIP, - interval_unit: SKIP, additional_properties: {}) + interval_unit: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -346,6 +356,7 @@ def initialize(id: SKIP, name: SKIP, handle: SKIP, pricing_scheme: SKIP, end @interval = interval unless interval == SKIP @interval_unit = interval_unit unless interval_unit == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -434,6 +445,7 @@ def self.from_hash(hash) hash.key?('event_based_billing_metric_id') ? hash['event_based_billing_metric_id'] : SKIP interval = hash.key?('interval') ? hash['interval'] : SKIP interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -474,6 +486,7 @@ def self.from_hash(hash) event_based_billing_metric_id: event_based_billing_metric_id, interval: interval, interval_unit: interval_unit, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -507,7 +520,8 @@ def to_s " #{@allow_fractional_quantities}, item_category: #{@item_category}, use_site_exchange_rate:"\ " #{@use_site_exchange_rate}, accounting_code: #{@accounting_code},"\ " event_based_billing_metric_id: #{@event_based_billing_metric_id}, interval: #{@interval},"\ - " interval_unit: #{@interval_unit}, additional_properties: #{get_additional_properties}>" + " interval_unit: #{@interval_unit}, unspsc_code: #{@unspsc_code}, additional_properties:"\ + " #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -533,7 +547,8 @@ def inspect " use_site_exchange_rate: #{@use_site_exchange_rate.inspect}, accounting_code:"\ " #{@accounting_code.inspect}, event_based_billing_metric_id:"\ " #{@event_based_billing_metric_id.inspect}, interval: #{@interval.inspect}, interval_unit:"\ - " #{@interval_unit.inspect}, additional_properties: #{get_additional_properties}>" + " #{@interval_unit.inspect}, unspsc_code: #{@unspsc_code.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/component_custom_price.rb b/lib/advanced_billing/models/component_custom_price.rb index bafefbe..20b367d 100644 --- a/lib/advanced_billing/models/component_custom_price.rb +++ b/lib/advanced_billing/models/component_custom_price.rb @@ -14,11 +14,11 @@ class ComponentCustomPrice < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_included - # Omit for On/Off components + # Omit for On/Off components. # @return [PricingScheme] attr_accessor :pricing_scheme - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. @@ -31,7 +31,7 @@ class ComponentCustomPrice < BaseModel # @return [IntervalUnit] attr_accessor :interval_unit - # Optional id of the price point to use for list price calculations when + # (Optional) Id of the price point to use for list price calculations when # overriding the customer price. # @return [Integer] attr_accessor :list_price_point_id diff --git a/lib/advanced_billing/models/component_price_point.rb b/lib/advanced_billing/models/component_price_point.rb index 24cb3e0..1f5f675 100644 --- a/lib/advanced_billing/models/component_price_point.rb +++ b/lib/advanced_billing/models/component_price_point.rb @@ -23,11 +23,11 @@ class ComponentPricePoint < BaseModel # @return [PricePointType] attr_accessor :type - # Note: Refer to type attribute instead + # Note: Refer to type attribute instead. # @return [TrueClass | FalseClass] attr_accessor :default - # Note: Refer to type attribute instead + # Note: Refer to type attribute instead. # @return [String] attr_accessor :name @@ -89,7 +89,7 @@ class ComponentPricePoint < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_included - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/component_price_point_item.rb b/lib/advanced_billing/models/component_price_point_item.rb index daa5a9b..544aafb 100644 --- a/lib/advanced_billing/models/component_price_point_item.rb +++ b/lib/advanced_billing/models/component_price_point_item.rb @@ -23,7 +23,7 @@ class ComponentPricePointItem < BaseModel # @return [PricingScheme] attr_accessor :pricing_scheme - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/coupon_payload.rb b/lib/advanced_billing/models/coupon_payload.rb index 917d816..d4f2f89 100644 --- a/lib/advanced_billing/models/coupon_payload.rb +++ b/lib/advanced_billing/models/coupon_payload.rb @@ -17,7 +17,7 @@ class CouponPayload < BaseModel # Required when creating a new coupon. The code is limited to 255 # characters. May contain uppercase alphanumeric characters and these # special characters (which allow for email addresses to be used): “%”, “@”, - # “+”, “-”, “_”, and “.” + # “+”, “-”, “_”, and “.”. # @return [String] attr_accessor :code @@ -28,12 +28,12 @@ class CouponPayload < BaseModel attr_accessor :description # Required when creating a new percentage coupon. Can't be used together - # with amount_in_cents. Percentage discount + # with amount_in_cents. Percentage discount. # @return [Object] attr_accessor :percentage # Required when creating a new flat amount coupon. Can't be used together - # with percentage. Flat USD discount + # with percentage. Flat USD discount. # @return [Integer] attr_accessor :amount_in_cents diff --git a/lib/advanced_billing/models/coupon_request.rb b/lib/advanced_billing/models/coupon_request.rb index f8e877c..d360416 100644 --- a/lib/advanced_billing/models/coupon_request.rb +++ b/lib/advanced_billing/models/coupon_request.rb @@ -15,13 +15,13 @@ class CouponRequest < BaseModel # An object where the keys are product IDs or handles (prefixed with # 'handle:'), and the values are booleans indicating if the coupon should be - # applicable to the product + # applicable to the product. # @return [Hash[String, TrueClass | FalseClass]] attr_accessor :restricted_products # An object where the keys are component IDs or handles (prefixed with # 'handle:'), and the values are booleans indicating if the coupon should be - # applicable to the component + # applicable to the component. # @return [Hash[String, TrueClass | FalseClass]] attr_accessor :restricted_components diff --git a/lib/advanced_billing/models/coupon_usage.rb b/lib/advanced_billing/models/coupon_usage.rb index ff80ab1..1a2da23 100644 --- a/lib/advanced_billing/models/coupon_usage.rb +++ b/lib/advanced_billing/models/coupon_usage.rb @@ -29,13 +29,13 @@ class CouponUsage < BaseModel # @return [Integer] attr_accessor :savings_in_cents - # Total revenue of the all subscriptions that have received a discount from - # this coupon. + # Total revenue of all subscriptions that have received a discount from this + # coupon. # @return [Integer] attr_accessor :revenue - # Total revenue of the all subscriptions that have received a discount from - # this coupon. + # Total revenue of all subscriptions that have received a discount from this + # coupon. # @return [Integer] attr_accessor :revenue_in_cents diff --git a/lib/advanced_billing/models/create_allocation.rb b/lib/advanced_billing/models/create_allocation.rb index 74df733..080f51b 100644 --- a/lib/advanced_billing/models/create_allocation.rb +++ b/lib/advanced_billing/models/create_allocation.rb @@ -11,8 +11,8 @@ class CreateAllocation < BaseModel # The allocated quantity to which to set the line-items allocated quantity. # By default, this is an integer. If decimal allocations are enabled for the - # component, it will be a decimal number. For On/Off components, use 1for on - # and 0 for off. + # component, it will be a decimal number. For On/Off components, use 1 for + # on and 0 for off. # @return [Float] attr_accessor :quantity diff --git a/lib/advanced_billing/models/create_component_price_point.rb b/lib/advanced_billing/models/create_component_price_point.rb index af8a7ec..ece358f 100644 --- a/lib/advanced_billing/models/create_component_price_point.rb +++ b/lib/advanced_billing/models/create_component_price_point.rb @@ -40,7 +40,7 @@ class CreateComponentPricePoint < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_included - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this price point would renew every 30 # days. This property is only available for sites with Multifrequency # enabled. diff --git a/lib/advanced_billing/models/create_customer.rb b/lib/advanced_billing/models/create_customer.rb index 936bc72..228b1c3 100644 --- a/lib/advanced_billing/models/create_customer.rb +++ b/lib/advanced_billing/models/create_customer.rb @@ -73,7 +73,13 @@ class CreateCustomer < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_exempt - # Set a specific language on a customer record. + # Whether surcharging is enabled for the customer. Defaults to `true` when + # omitted. Only applied on sites where surcharging control is enabled. + # @return [TrueClass | FalseClass] + attr_accessor :surcharging + + # Whether surcharging is enabled for the customer. Defaults to `true` when + # omitted. Only applied on sites where surcharging control is enabled. # @return [String] attr_accessor :tax_exempt_reason @@ -86,6 +92,13 @@ class CreateCustomer < BaseModel # @return [String] attr_accessor :salesforce_id + # The ID of the Branding Theme assigned to this customer as the customer's + # default Branding Theme. This customer-level Branding Theme is used when a + # subscription does not have its own subscription-level Branding Theme. + # Available only when Branding Themes are enabled for the site. + # @return [Integer] + attr_accessor :branding_theme_id + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -105,9 +118,11 @@ def self.names @_hash['locale'] = 'locale' @_hash['vat_number'] = 'vat_number' @_hash['tax_exempt'] = 'tax_exempt' + @_hash['surcharging'] = 'surcharging' @_hash['tax_exempt_reason'] = 'tax_exempt_reason' @_hash['parent_id'] = 'parent_id' @_hash['salesforce_id'] = 'salesforce_id' + @_hash['branding_theme_id'] = 'branding_theme_id' @_hash end @@ -127,9 +142,11 @@ def self.optionals locale vat_number tax_exempt + surcharging tax_exempt_reason parent_id salesforce_id + branding_theme_id ] end @@ -138,6 +155,7 @@ def self.nullables %w[ parent_id salesforce_id + branding_theme_id ] end @@ -145,8 +163,9 @@ def initialize(first_name:, last_name:, email:, cc_emails: SKIP, organization: SKIP, reference: SKIP, address: SKIP, address_2: SKIP, city: SKIP, state: SKIP, zip: SKIP, country: SKIP, phone: SKIP, locale: SKIP, vat_number: SKIP, - tax_exempt: SKIP, tax_exempt_reason: SKIP, parent_id: SKIP, - salesforce_id: SKIP, additional_properties: {}) + tax_exempt: SKIP, surcharging: SKIP, tax_exempt_reason: SKIP, + parent_id: SKIP, salesforce_id: SKIP, + branding_theme_id: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -168,9 +187,11 @@ def initialize(first_name:, last_name:, email:, cc_emails: SKIP, @locale = locale unless locale == SKIP @vat_number = vat_number unless vat_number == SKIP @tax_exempt = tax_exempt unless tax_exempt == SKIP + @surcharging = surcharging unless surcharging == SKIP @tax_exempt_reason = tax_exempt_reason unless tax_exempt_reason == SKIP @parent_id = parent_id unless parent_id == SKIP @salesforce_id = salesforce_id unless salesforce_id == SKIP + @branding_theme_id = branding_theme_id unless branding_theme_id == SKIP end # Creates an instance of the object from a hash. @@ -194,10 +215,13 @@ def self.from_hash(hash) locale = hash.key?('locale') ? hash['locale'] : SKIP vat_number = hash.key?('vat_number') ? hash['vat_number'] : SKIP tax_exempt = hash.key?('tax_exempt') ? hash['tax_exempt'] : SKIP + surcharging = hash.key?('surcharging') ? hash['surcharging'] : SKIP tax_exempt_reason = hash.key?('tax_exempt_reason') ? hash['tax_exempt_reason'] : SKIP parent_id = hash.key?('parent_id') ? hash['parent_id'] : SKIP salesforce_id = hash.key?('salesforce_id') ? hash['salesforce_id'] : SKIP + branding_theme_id = + hash.key?('branding_theme_id') ? hash['branding_theme_id'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -219,9 +243,11 @@ def self.from_hash(hash) locale: locale, vat_number: vat_number, tax_exempt: tax_exempt, + surcharging: surcharging, tax_exempt_reason: tax_exempt_reason, parent_id: parent_id, salesforce_id: salesforce_id, + branding_theme_id: branding_theme_id, additional_properties: additional_properties) end @@ -232,8 +258,9 @@ def to_s " cc_emails: #{@cc_emails}, organization: #{@organization}, reference: #{@reference},"\ " address: #{@address}, address_2: #{@address_2}, city: #{@city}, state: #{@state}, zip:"\ " #{@zip}, country: #{@country}, phone: #{@phone}, locale: #{@locale}, vat_number:"\ - " #{@vat_number}, tax_exempt: #{@tax_exempt}, tax_exempt_reason: #{@tax_exempt_reason},"\ - " parent_id: #{@parent_id}, salesforce_id: #{@salesforce_id}, additional_properties:"\ + " #{@vat_number}, tax_exempt: #{@tax_exempt}, surcharging: #{@surcharging},"\ + " tax_exempt_reason: #{@tax_exempt_reason}, parent_id: #{@parent_id}, salesforce_id:"\ + " #{@salesforce_id}, branding_theme_id: #{@branding_theme_id}, additional_properties:"\ " #{get_additional_properties}>" end @@ -246,9 +273,10 @@ def inspect " address_2: #{@address_2.inspect}, city: #{@city.inspect}, state: #{@state.inspect}, zip:"\ " #{@zip.inspect}, country: #{@country.inspect}, phone: #{@phone.inspect}, locale:"\ " #{@locale.inspect}, vat_number: #{@vat_number.inspect}, tax_exempt:"\ - " #{@tax_exempt.inspect}, tax_exempt_reason: #{@tax_exempt_reason.inspect}, parent_id:"\ - " #{@parent_id.inspect}, salesforce_id: #{@salesforce_id.inspect}, additional_properties:"\ - " #{get_additional_properties}>" + " #{@tax_exempt.inspect}, surcharging: #{@surcharging.inspect}, tax_exempt_reason:"\ + " #{@tax_exempt_reason.inspect}, parent_id: #{@parent_id.inspect}, salesforce_id:"\ + " #{@salesforce_id.inspect}, branding_theme_id: #{@branding_theme_id.inspect},"\ + " additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/create_invoice.rb b/lib/advanced_billing/models/create_invoice.rb index b0c441d..813b659 100644 --- a/lib/advanced_billing/models/create_invoice.rb +++ b/lib/advanced_billing/models/create_invoice.rb @@ -38,23 +38,23 @@ class CreateInvoice < BaseModel # @return [String] attr_accessor :memo - # Overrides the defaults for the site + # Overrides the defaults for the site. # @return [CreateInvoiceAddress] attr_accessor :seller_address - # Overrides the default for the customer + # Overrides the default for the customer. # @return [CreateInvoiceAddress] attr_accessor :billing_address - # Overrides the default for the customer + # Overrides the default for the customer. # @return [CreateInvoiceAddress] attr_accessor :shipping_address - # Overrides the default for the customer + # Overrides the default for the customer. # @return [Array[CreateInvoiceCoupon]] attr_accessor :coupons - # Overrides the default for the customer + # Overrides the default for the customer. # @return [CreateInvoiceStatus] attr_accessor :status diff --git a/lib/advanced_billing/models/create_invoice_item.rb b/lib/advanced_billing/models/create_invoice_item.rb index 50a35a7..22a9546 100644 --- a/lib/advanced_billing/models/create_invoice_item.rb +++ b/lib/advanced_billing/models/create_invoice_item.rb @@ -13,13 +13,13 @@ class CreateInvoiceItem < BaseModel # @return [String] attr_accessor :title - # The quantity can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The quantity can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065. If you submit a value with more than 8 decimal places, we will # round it down to the 8th decimal place. # @return [Object] attr_accessor :quantity - # The unit_price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The unit_price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065. If you submit a value with more than 8 decimal places, we will # round it down to the 8th decimal place. # @return [Object] diff --git a/lib/advanced_billing/models/create_or_update_endpoint.rb b/lib/advanced_billing/models/create_or_update_endpoint.rb index 2144c47..806e294 100644 --- a/lib/advanced_billing/models/create_or_update_endpoint.rb +++ b/lib/advanced_billing/models/create_or_update_endpoint.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Used to Create or Update Endpoint + # Used to Create or Update Endpoint. class CreateOrUpdateEndpoint < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/advanced_billing/models/create_or_update_endpoint_request.rb b/lib/advanced_billing/models/create_or_update_endpoint_request.rb index c62bd44..10c7c97 100644 --- a/lib/advanced_billing/models/create_or_update_endpoint_request.rb +++ b/lib/advanced_billing/models/create_or_update_endpoint_request.rb @@ -4,12 +4,12 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Used to Create or Update Endpoint + # Used to Create or Update Endpoint. class CreateOrUpdateEndpointRequest < BaseModel SKIP = Object.new private_constant :SKIP - # Used to Create or Update Endpoint + # Used to Create or Update Endpoint. # @return [CreateOrUpdateEndpoint] attr_accessor :endpoint diff --git a/lib/advanced_billing/models/create_or_update_product.rb b/lib/advanced_billing/models/create_or_update_product.rb index 9732962..7122919 100644 --- a/lib/advanced_billing/models/create_or_update_product.rb +++ b/lib/advanced_billing/models/create_or_update_product.rb @@ -35,8 +35,8 @@ class CreateOrUpdateProduct < BaseModel # @return [Integer] attr_accessor :price_in_cents - # The numerical interval. i.e. an interval of ‘30’ coupled with an - # interval_unit of day would mean this product would renew every 30 days + # The numerical interval. e.g., an interval of ‘30’ coupled with an + # interval_unit of day would mean this product would renew every 30 days. # @return [Integer] attr_accessor :interval @@ -49,7 +49,7 @@ class CreateOrUpdateProduct < BaseModel # @return [Integer] attr_accessor :trial_price_in_cents - # The numerical trial interval. i.e. an interval of ‘30’ coupled with a + # The numerical trial interval. e.g., an interval of ‘30’ coupled with a # trial_interval_unit of day would mean this product trial would last 30 # days. # @return [Integer] @@ -60,7 +60,7 @@ class CreateOrUpdateProduct < BaseModel # @return [IntervalUnit] attr_accessor :trial_interval_unit - # Indicates how a trial is handled when the trail period ends and there is + # Indicates how a trial is handled when the trial period ends and there is # no credit card on file. For `no_obligation`, the subscription transitions # to a Trial Ended state. Maxio will not send any emails or statements. For # `payment_expected`, the subscription transitions to a Past Due state. @@ -69,7 +69,7 @@ class CreateOrUpdateProduct < BaseModel # @return [TrialType] attr_accessor :trial_type - # The numerical expiration interval. i.e. an expiration_interval of ‘30’ + # The numerical expiration interval. e.g., an expiration_interval of ‘30’ # coupled with an expiration_interval_unit of day would mean this product # would expire after 30 days. # @return [Integer] @@ -91,6 +91,12 @@ class CreateOrUpdateProduct < BaseModel # @return [String] attr_accessor :tax_code + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this product instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -110,6 +116,7 @@ def self.names @_hash['expiration_interval_unit'] = 'expiration_interval_unit' @_hash['auto_create_signup_page'] = 'auto_create_signup_page' @_hash['tax_code'] = 'tax_code' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -127,6 +134,7 @@ def self.optionals expiration_interval_unit auto_create_signup_page tax_code + unspsc_code ] end @@ -136,6 +144,7 @@ def self.nullables trial_interval_unit trial_type expiration_interval_unit + unspsc_code ] end @@ -146,7 +155,7 @@ def initialize(name:, description:, price_in_cents:, interval:, trial_type: SKIP, expiration_interval: SKIP, expiration_interval_unit: SKIP, auto_create_signup_page: SKIP, tax_code: SKIP, - additional_properties: {}) + unspsc_code: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -168,6 +177,7 @@ def initialize(name:, description:, price_in_cents:, interval:, @expiration_interval_unit = expiration_interval_unit unless expiration_interval_unit == SKIP @auto_create_signup_page = auto_create_signup_page unless auto_create_signup_page == SKIP @tax_code = tax_code unless tax_code == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -200,6 +210,7 @@ def self.from_hash(hash) auto_create_signup_page = hash.key?('auto_create_signup_page') ? hash['auto_create_signup_page'] : SKIP tax_code = hash.key?('tax_code') ? hash['tax_code'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -221,6 +232,7 @@ def self.from_hash(hash) expiration_interval_unit: expiration_interval_unit, auto_create_signup_page: auto_create_signup_page, tax_code: tax_code, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -234,7 +246,8 @@ def to_s " #{@trial_interval}, trial_interval_unit: #{@trial_interval_unit}, trial_type:"\ " #{@trial_type}, expiration_interval: #{@expiration_interval}, expiration_interval_unit:"\ " #{@expiration_interval_unit}, auto_create_signup_page: #{@auto_create_signup_page},"\ - " tax_code: #{@tax_code}, additional_properties: #{get_additional_properties}>" + " tax_code: #{@tax_code}, unspsc_code: #{@unspsc_code}, additional_properties:"\ + " #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -249,8 +262,8 @@ def inspect " #{@trial_interval_unit.inspect}, trial_type: #{@trial_type.inspect}, expiration_interval:"\ " #{@expiration_interval.inspect}, expiration_interval_unit:"\ " #{@expiration_interval_unit.inspect}, auto_create_signup_page:"\ - " #{@auto_create_signup_page.inspect}, tax_code: #{@tax_code.inspect},"\ - " additional_properties: #{get_additional_properties}>" + " #{@auto_create_signup_page.inspect}, tax_code: #{@tax_code.inspect}, unspsc_code:"\ + " #{@unspsc_code.inspect}, additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/create_or_update_segment_price.rb b/lib/advanced_billing/models/create_or_update_segment_price.rb index 1ffc386..bcf2272 100644 --- a/lib/advanced_billing/models/create_or_update_segment_price.rb +++ b/lib/advanced_billing/models/create_or_update_segment_price.rb @@ -17,7 +17,7 @@ class CreateOrUpdateSegmentPrice < BaseModel # @return [Integer] attr_accessor :ending_quantity - # The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :unit_price diff --git a/lib/advanced_billing/models/create_payment_profile.rb b/lib/advanced_billing/models/create_payment_profile.rb index c32693d..e67cee8 100644 --- a/lib/advanced_billing/models/create_payment_profile.rb +++ b/lib/advanced_billing/models/create_payment_profile.rb @@ -49,31 +49,31 @@ class CreatePaymentProfile < BaseModel # (Optional when performing an Import via vault_token, required otherwise) # The 1- or 2-digit credit card expiration month, as an integer or string, - # i.e. 5 + # e.g., 5 # @return [Object] attr_accessor :expiration_month - # (Optional when performing a Import via vault_token, required otherwise) - # The 4-digit credit card expiration year, as an integer or string, i.e. + # (Optional when performing an Import via vault_token, required otherwise) + # The 4-digit credit card expiration year, as an integer or string, e.g., # 2012 # @return [Object] attr_accessor :expiration_year - # The credit card or bank account billing street address (i.e. 123 Main + # The credit card or bank account billing street address (e.g., 123 Main # St.). This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_address - # Second line of the customer’s billing address i.e. Apt. 100 + # Second line of the customer’s billing address e.g., Apt. 100 # @return [String] attr_accessor :billing_address_2 - # The credit card or bank account billing address city (i.e. “Boston”). This - # value is merely passed through to the payment gateway. + # The credit card or bank account billing address city (e.g., “Boston”). + # This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_city - # The credit card or bank account billing address state (i.e. MA). This + # The credit card or bank account billing address state (e.g., MA). This # value is merely passed through to the payment gateway. This must conform # to the # [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in @@ -81,16 +81,16 @@ class CreatePaymentProfile < BaseModel # @return [String] attr_accessor :billing_state - # The credit card or bank account billing address country, required in + # “The credit card or bank account billing address country, required in # [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) - # format (i.e. “US”). This value is merely passed through to the payment + # format (e.g., “US”). This value is merely passed through to the payment # gateway. Some gateways require country codes in a specific format. Check # your gateway’s documentation. If creating an ACH subscription, only US is - # supported at this time. + # supported at this time.” # @return [String] attr_accessor :billing_country - # The credit card or bank account billing address zip code (i.e. 12345). + # The credit card or bank account billing address zip code (e.g., 12345). # This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_zip @@ -148,13 +148,13 @@ class CreatePaymentProfile < BaseModel # (Optional when creating with GoCardless, required with Stripe Direct # Debit). International Bank Account Number. Alternatively, local bank - # details can be provided + # details can be provided. # @return [String] attr_accessor :bank_iban # (Required when creating with ACH. Optional when creating a subscription # with GoCardless). The routing number of the bank. It becomes bank_code - # while passing via GoCardless API + # while passing via GoCardless API. # @return [String] attr_accessor :bank_routing_number @@ -164,7 +164,7 @@ class CreatePaymentProfile < BaseModel attr_accessor :bank_account_number # (Optional when creating with GoCardless, required with Stripe BECS or BACS - # Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided + # Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided. # @return [String] attr_accessor :bank_branch_code diff --git a/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb b/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb index f645e20..b5eb7eb 100644 --- a/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +++ b/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb @@ -41,24 +41,24 @@ class CreatePrepaidUsageComponentPricePoint < BaseModel attr_accessor :use_site_exchange_rate # (only for prepaid usage components) Boolean which controls whether or not - # remaining units should be rolled over to the next period + # remaining units should be rolled over to the next period. # @return [TrueClass | FalseClass] attr_accessor :rollover_prepaid_remainder # (only for prepaid usage components) Boolean which controls whether or not - # the allocated quantity should be renewed at the beginning of each period + # the allocated quantity should be renewed at the beginning of each period. # @return [TrueClass | FalseClass] attr_accessor :renew_prepaid_allocation # (only for prepaid usage components where rollover_prepaid_remainder is # true) The number of `expiration_interval_unit`s after which rollover - # amounts should expire + # amounts should expire. # @return [Float] attr_accessor :expiration_interval # (only for prepaid usage components where rollover_prepaid_remainder is # true) A string representing the expiration interval unit for this - # component, either month or day + # component, either month or day. # @return [ExpirationIntervalUnit] attr_accessor :expiration_interval_unit diff --git a/lib/advanced_billing/models/create_prepayment.rb b/lib/advanced_billing/models/create_prepayment.rb index 9bd7025..1112e03 100644 --- a/lib/advanced_billing/models/create_prepayment.rb +++ b/lib/advanced_billing/models/create_prepayment.rb @@ -21,14 +21,14 @@ class CreatePrepayment < BaseModel # @return [String] attr_accessor :memo - # :- When the `method` specified is `"credit_card_on_file"`, the prepayment + # When the `method` specified is `"credit_card_on_file"`, the prepayment # amount will be collected using the default credit card payment profile and # applied to the prepayment account balance. This is especially useful for # manual replenishment of prepaid subscriptions. # @return [CreatePrepaymentMethod] attr_accessor :method - # :- When the `method` specified is `"credit_card_on_file"`, the prepayment + # When the `method` specified is `"credit_card_on_file"`, the prepayment # amount will be collected using the default credit card payment profile and # applied to the prepayment account balance. This is especially useful for # manual replenishment of prepaid subscriptions. diff --git a/lib/advanced_billing/models/create_prepayment_method.rb b/lib/advanced_billing/models/create_prepayment_method.rb index 79e1932..d5040bd 100644 --- a/lib/advanced_billing/models/create_prepayment_method.rb +++ b/lib/advanced_billing/models/create_prepayment_method.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # :- When the `method` specified is `"credit_card_on_file"`, the prepayment + # When the `method` specified is `"credit_card_on_file"`, the prepayment # amount will be collected using the default credit card payment profile and # applied to the prepayment account balance. This is especially useful for # manual replenishment of prepaid subscriptions. diff --git a/lib/advanced_billing/models/create_product_family.rb b/lib/advanced_billing/models/create_product_family.rb index 0391585..62a1f13 100644 --- a/lib/advanced_billing/models/create_product_family.rb +++ b/lib/advanced_billing/models/create_product_family.rb @@ -21,12 +21,18 @@ class CreateProductFamily < BaseModel # @return [String] attr_accessor :description + # Whether surcharging applies to this product family. Defaults to `true` + # when omitted. Only applied on sites where surcharging is enabled. + # @return [TrueClass | FalseClass] + attr_accessor :surcharging + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['handle'] = 'handle' @_hash['description'] = 'description' + @_hash['surcharging'] = 'surcharging' @_hash end @@ -35,6 +41,7 @@ def self.optionals %w[ handle description + surcharging ] end @@ -46,7 +53,7 @@ def self.nullables ] end - def initialize(name:, handle: SKIP, description: SKIP, + def initialize(name:, handle: SKIP, description: SKIP, surcharging: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| @@ -56,6 +63,7 @@ def initialize(name:, handle: SKIP, description: SKIP, @name = name @handle = handle unless handle == SKIP @description = description unless description == SKIP + @surcharging = surcharging unless surcharging == SKIP end # Creates an instance of the object from a hash. @@ -66,6 +74,7 @@ def self.from_hash(hash) name = hash.key?('name') ? hash['name'] : nil handle = hash.key?('handle') ? hash['handle'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP + surcharging = hash.key?('surcharging') ? hash['surcharging'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -74,6 +83,7 @@ def self.from_hash(hash) CreateProductFamily.new(name: name, handle: handle, description: description, + surcharging: surcharging, additional_properties: additional_properties) end @@ -81,14 +91,15 @@ def self.from_hash(hash) def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, handle: #{@handle}, description: #{@description},"\ - " additional_properties: #{get_additional_properties}>" + " surcharging: #{@surcharging}, additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, handle: #{@handle.inspect}, description:"\ - " #{@description.inspect}, additional_properties: #{get_additional_properties}>" + " #{@description.inspect}, surcharging: #{@surcharging.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/create_product_price_point.rb b/lib/advanced_billing/models/create_product_price_point.rb index aa172c1..e721142 100644 --- a/lib/advanced_billing/models/create_product_price_point.rb +++ b/lib/advanced_billing/models/create_product_price_point.rb @@ -21,9 +21,9 @@ class CreateProductPricePoint < BaseModel # @return [Integer] attr_accessor :price_in_cents - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this product price point would renew every - # 30 days + # 30 days. # @return [Integer] attr_accessor :interval @@ -36,7 +36,7 @@ class CreateProductPricePoint < BaseModel # @return [Integer] attr_accessor :trial_price_in_cents - # The numerical trial interval. i.e. an interval of ‘30’ coupled with a + # The numerical trial interval. e.g., an interval of ‘30’ coupled with a # trial_interval_unit of day would mean this product price point trial would # last 30 days. # @return [Integer] @@ -47,7 +47,7 @@ class CreateProductPricePoint < BaseModel # @return [IntervalUnit] attr_accessor :trial_interval_unit - # Indicates how a trial is handled when the trail period ends and there is + # Indicates how a trial is handled when the trial period ends and there is # no credit card on file. For `no_obligation`, the subscription transitions # to a Trial Ended state. Maxio will not send any emails or statements. For # `payment_expected`, the subscription transitions to a Past Due state. @@ -64,7 +64,7 @@ class CreateProductPricePoint < BaseModel # @return [TrueClass | FalseClass] attr_accessor :initial_charge_after_trial - # The numerical expiration interval. i.e. an expiration_interval of ‘30’ + # The numerical expiration interval. e.g., an expiration_interval of ‘30’ # coupled with an expiration_interval_unit of day would mean this product # price point would expire after 30 days. # @return [Integer] diff --git a/lib/advanced_billing/models/create_subscription.rb b/lib/advanced_billing/models/create_subscription.rb index f08abd4..e721bc3 100644 --- a/lib/advanced_billing/models/create_subscription.rb +++ b/lib/advanced_billing/models/create_subscription.rb @@ -68,6 +68,15 @@ class CreateSubscription < BaseModel # @return [Integer] attr_accessor :customer_id + # The ID of the Branding Theme to assign to this subscription. When set, + # this subscription-level Branding Theme is used instead of the customer's + # default Branding Theme for subscription-related documents and + # communications that use subscription theming. Pass null or an empty value + # to clear the subscription-level Branding Theme. Available only when + # Branding Themes are enabled for the site. Not returned in the response. + # @return [Integer] + attr_accessor :branding_theme_id + # (Optional) Set this attribute to a future date/time to sync imported # subscriptions to your existing renewal schedule. See the notes on # “Date/Time Format” in our [subscription import @@ -104,7 +113,7 @@ class CreateSubscription < BaseModel # (Optional) Set this attribute to true to create the subscription in the # Awaiting Signup Date state. Use this when you want to create a - # subscription that has an unknown first billing date. When the first + # subscription that has an unknown first billing date. When the first # billing date is known, update a subscription and set the # `initial_billing_at` date. The subscription moves to the Awaiting Signup # state with a scheduled initial billing date. You can omit the @@ -133,7 +142,7 @@ class CreateSubscription < BaseModel # use a new (unstored) card or bank account for the subscription, use # `payment_profile_attributes` instead to create a new payment profile along # with the subscription. (This value is available on an existing - # subscription via the API as `credit_card` > id or `bank_account` > id) + # subscription via the API as `credit_card` > id or `bank_account` > id.) # @return [Integer] attr_accessor :payment_profile_id @@ -166,7 +175,7 @@ class CreateSubscription < BaseModel # @return [Array[CreateSubscriptionComponent]] attr_accessor :components - # (Optional). Cannot be used when also specifying next_billing_at + # (Optional). Cannot be used when also specifying next_billing_at. # @return [CalendarBilling] attr_accessor :calendar_billing @@ -258,13 +267,13 @@ class CreateSubscription < BaseModel # Use in place of passing product and component information to set up the # subscription with an existing offer. May be either the Chargify id of the - # offer or its handle prefixed with `handle:`.er + # offer or its handle prefixed with `handle:`. # @return [Object] attr_accessor :offer_id # Use in place of passing product and component information to set up the # subscription with an existing offer. May be either the Chargify id of the - # offer or its handle prefixed with `handle:`.er + # offer or its handle prefixed with `handle:`. # @return [UpsertPrepaidConfiguration] attr_accessor :prepaid_configuration @@ -337,6 +346,7 @@ def self.names @_hash['receives_invoice_emails'] = 'receives_invoice_emails' @_hash['net_terms'] = 'net_terms' @_hash['customer_id'] = 'customer_id' + @_hash['branding_theme_id'] = 'branding_theme_id' @_hash['next_billing_at'] = 'next_billing_at' @_hash['initial_billing_at'] = 'initial_billing_at' @_hash['defer_signup'] = 'defer_signup' @@ -398,6 +408,7 @@ def self.optionals receives_invoice_emails net_terms customer_id + branding_theme_id next_billing_at initial_billing_at defer_signup @@ -443,6 +454,7 @@ def self.optionals # An array for nullable fields def self.nullables %w[ + branding_theme_id dunning_communication_delay_time_zone ] end @@ -453,11 +465,12 @@ def initialize(product_handle: SKIP, product_id: SKIP, coupon_code: SKIP, coupon_codes: SKIP, payment_collection_method: SKIP, receives_invoice_emails: SKIP, net_terms: SKIP, - customer_id: SKIP, next_billing_at: SKIP, - initial_billing_at: SKIP, defer_signup: false, - stored_credential_transaction_id: SKIP, sales_rep_id: SKIP, - payment_profile_id: SKIP, reference: SKIP, - customer_attributes: SKIP, payment_profile_attributes: SKIP, + customer_id: SKIP, branding_theme_id: SKIP, + next_billing_at: SKIP, initial_billing_at: SKIP, + defer_signup: false, stored_credential_transaction_id: SKIP, + sales_rep_id: SKIP, payment_profile_id: SKIP, + reference: SKIP, customer_attributes: SKIP, + payment_profile_attributes: SKIP, credit_card_attributes: SKIP, bank_account_attributes: SKIP, components: SKIP, calendar_billing: SKIP, metafields: SKIP, customer_reference: SKIP, group: SKIP, ref: SKIP, @@ -496,6 +509,7 @@ def initialize(product_handle: SKIP, product_id: SKIP, @receives_invoice_emails = receives_invoice_emails unless receives_invoice_emails == SKIP @net_terms = net_terms unless net_terms == SKIP @customer_id = customer_id unless customer_id == SKIP + @branding_theme_id = branding_theme_id unless branding_theme_id == SKIP @next_billing_at = next_billing_at unless next_billing_at == SKIP @initial_billing_at = initial_billing_at unless initial_billing_at == SKIP @defer_signup = defer_signup unless defer_signup == SKIP @@ -580,6 +594,8 @@ def self.from_hash(hash) hash.key?('receives_invoice_emails') ? hash['receives_invoice_emails'] : SKIP net_terms = hash.key?('net_terms') ? hash['net_terms'] : SKIP customer_id = hash.key?('customer_id') ? hash['customer_id'] : SKIP + branding_theme_id = + hash.key?('branding_theme_id') ? hash['branding_theme_id'] : SKIP next_billing_at = if hash.key?('next_billing_at') (DateTimeHelper.from_rfc3339(hash['next_billing_at']) if hash['next_billing_at']) else @@ -692,6 +708,7 @@ def self.from_hash(hash) receives_invoice_emails: receives_invoice_emails, net_terms: net_terms, customer_id: customer_id, + branding_theme_id: branding_theme_id, next_billing_at: next_billing_at, initial_billing_at: initial_billing_at, defer_signup: defer_signup, @@ -776,14 +793,14 @@ def to_s " #{@product_price_point_id}, custom_price: #{@custom_price}, coupon_code: #{@coupon_code},"\ " coupon_codes: #{@coupon_codes}, payment_collection_method: #{@payment_collection_method},"\ " receives_invoice_emails: #{@receives_invoice_emails}, net_terms: #{@net_terms},"\ - " customer_id: #{@customer_id}, next_billing_at: #{@next_billing_at}, initial_billing_at:"\ - " #{@initial_billing_at}, defer_signup: #{@defer_signup}, stored_credential_transaction_id:"\ - " #{@stored_credential_transaction_id}, sales_rep_id: #{@sales_rep_id}, payment_profile_id:"\ - " #{@payment_profile_id}, reference: #{@reference}, customer_attributes:"\ - " #{@customer_attributes}, payment_profile_attributes: #{@payment_profile_attributes},"\ - " credit_card_attributes: #{@credit_card_attributes}, bank_account_attributes:"\ - " #{@bank_account_attributes}, components: #{@components}, calendar_billing:"\ - " #{@calendar_billing}, metafields: #{@metafields}, customer_reference:"\ + " customer_id: #{@customer_id}, branding_theme_id: #{@branding_theme_id}, next_billing_at:"\ + " #{@next_billing_at}, initial_billing_at: #{@initial_billing_at}, defer_signup:"\ + " #{@defer_signup}, stored_credential_transaction_id: #{@stored_credential_transaction_id},"\ + " sales_rep_id: #{@sales_rep_id}, payment_profile_id: #{@payment_profile_id}, reference:"\ + " #{@reference}, customer_attributes: #{@customer_attributes}, payment_profile_attributes:"\ + " #{@payment_profile_attributes}, credit_card_attributes: #{@credit_card_attributes},"\ + " bank_account_attributes: #{@bank_account_attributes}, components: #{@components},"\ + " calendar_billing: #{@calendar_billing}, metafields: #{@metafields}, customer_reference:"\ " #{@customer_reference}, group: #{@group}, ref: #{@ref}, cancellation_message:"\ " #{@cancellation_message}, cancellation_method: #{@cancellation_method}, currency:"\ " #{@currency}, expires_at: #{@expires_at}, expiration_tracks_next_billing_change:"\ @@ -811,7 +828,8 @@ def inspect " #{@coupon_code.inspect}, coupon_codes: #{@coupon_codes.inspect},"\ " payment_collection_method: #{@payment_collection_method.inspect}, receives_invoice_emails:"\ " #{@receives_invoice_emails.inspect}, net_terms: #{@net_terms.inspect}, customer_id:"\ - " #{@customer_id.inspect}, next_billing_at: #{@next_billing_at.inspect}, initial_billing_at:"\ + " #{@customer_id.inspect}, branding_theme_id: #{@branding_theme_id.inspect},"\ + " next_billing_at: #{@next_billing_at.inspect}, initial_billing_at:"\ " #{@initial_billing_at.inspect}, defer_signup: #{@defer_signup.inspect},"\ " stored_credential_transaction_id: #{@stored_credential_transaction_id.inspect},"\ " sales_rep_id: #{@sales_rep_id.inspect}, payment_profile_id:"\ diff --git a/lib/advanced_billing/models/create_subscription_component.rb b/lib/advanced_billing/models/create_subscription_component.rb index ce43bb6..aa4f164 100644 --- a/lib/advanced_billing/models/create_subscription_component.rb +++ b/lib/advanced_billing/models/create_subscription_component.rb @@ -18,7 +18,7 @@ class CreateSubscriptionComponent < BaseModel attr_accessor :enabled # Used for metered and events based components. - # @return [Integer] + # @return [Object] attr_accessor :unit_balance # Used for quantity based components. @@ -96,7 +96,9 @@ def self.from_hash(hash) UnionTypeLookUp.get(:CreateSubscriptionComponentComponentId), hash['component_id'] ) : SKIP enabled = hash.key?('enabled') ? hash['enabled'] : SKIP - unit_balance = hash.key?('unit_balance') ? hash['unit_balance'] : SKIP + unit_balance = hash.key?('unit_balance') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:CreateSubscriptionComponentUnitBalance), hash['unit_balance'] + ) : SKIP allocated_quantity = hash.key?('allocated_quantity') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:CreateSubscriptionComponentAllocatedQuantity), hash['allocated_quantity'] ) : SKIP diff --git a/lib/advanced_billing/models/credit_card_payment_profile.rb b/lib/advanced_billing/models/credit_card_payment_profile.rb index d857bb7..d42a195 100644 --- a/lib/advanced_billing/models/credit_card_payment_profile.rb +++ b/lib/advanced_billing/models/credit_card_payment_profile.rb @@ -25,7 +25,7 @@ class CreditCardPaymentProfile < BaseModel attr_accessor :last_name # A string representation of the credit card number with all but the last 4 - # digits masked with X’s (i.e. ‘XXXX-XXXX-XXXX-1234’). + # digits masked with X’s (e.g., ‘XXXX-XXXX-XXXX-1234’). # @return [String] attr_accessor :masked_card_number @@ -37,7 +37,7 @@ class CreditCardPaymentProfile < BaseModel # @return [Integer] attr_accessor :expiration_month - # An integer representing the 4-digit expiration year of the card(i.e. + # An integer representing the 4-digit expiration year of the card(e.g., # ‘2012’). # @return [Integer] attr_accessor :expiration_year @@ -96,13 +96,13 @@ class CreditCardPaymentProfile < BaseModel # Token received after sending billing information using Maxio.js (formerly # Chargify.js). This token will only be received if passed as a sole - # attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + # attribute of credit_card_attributes (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). # @return [String] attr_accessor :chargify_token # Token received after sending billing information using Maxio.js (formerly # Chargify.js). This token will only be received if passed as a sole - # attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + # attribute of credit_card_attributes (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). # @return [Integer] attr_accessor :site_gateway_setting_id @@ -180,6 +180,7 @@ def self.optionals # An array for nullable fields def self.nullables %w[ + card_type vault_token billing_address billing_city diff --git a/lib/advanced_billing/models/credit_note.rb b/lib/advanced_billing/models/credit_note.rb index 5ea7f2c..76030ba 100644 --- a/lib/advanced_billing/models/credit_note.rb +++ b/lib/advanced_billing/models/credit_note.rb @@ -74,7 +74,7 @@ class CreditNote < BaseModel # @return [InvoiceSeller] attr_accessor :seller - # Information about the customer who is owner or recipient the credited + # Information about the customer who is owner or recipient of the credited # subscription. # @return [InvoiceCustomer] attr_accessor :customer @@ -95,7 +95,7 @@ class CreditNote < BaseModel # Total discount applied to the credit note. Note that this is a positive # amount representing the discount amount being credited back to the - # customer (i.e. a credit on an earlier discount). For example, if the + # customer (i.e., a credit on an earlier discount). For example, if the # original purchase was $1.00 and the original discount was $0.10, a credit # of $0.50 of the original purchase (half) would have a discount credit of # $0.05 (also half). @@ -103,8 +103,8 @@ class CreditNote < BaseModel attr_accessor :discount_amount # Total tax of the credit note. Note that this is a positive amount - # representing a previously taxex amount being credited back to the customer - # (i.e. a credit of an earlier tax). For example, if the original purchase + # representing a previously taxed amount being credited back to the customer + # (i.e., a credit of an earlier tax). For example, if the original purchase # was $1.00 and the original tax was $0.10, a credit of $0.50 of the # original purchase (half) would also have a tax credit of $0.05 (also # half). @@ -112,7 +112,7 @@ class CreditNote < BaseModel attr_accessor :tax_amount # The credit note total, which is `subtotal_amount - discount_amount + - # tax_amount`.' + # tax_amount`. # @return [String] attr_accessor :total_amount @@ -148,7 +148,7 @@ class CreditNote < BaseModel # An array of origin invoices for the credit note. Learn more about [Origin # Invoice from our # docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-No - # tes-Proration#origin-invoices) + # tes-Proration#origin-invoices). # @return [Array[OriginInvoice]] attr_accessor :origin_invoices diff --git a/lib/advanced_billing/models/credit_note_line_item.rb b/lib/advanced_billing/models/credit_note_line_item.rb index d63d551..185d44c 100644 --- a/lib/advanced_billing/models/credit_note_line_item.rb +++ b/lib/advanced_billing/models/credit_note_line_item.rb @@ -32,7 +32,7 @@ class CreditNoteLineItem < BaseModel attr_accessor :quantity # The price per unit for the line item. - # When tiered pricing was used (i.e. not every unit was actually priced at + # When tiered pricing was used (i.e., not every unit was actually priced at # the same price) this will be the blended average cost per unit and the # `tiered_unit_price` field will be set to `true`. # @return [String] diff --git a/lib/advanced_billing/models/currency_overage_prices.rb b/lib/advanced_billing/models/currency_overage_prices.rb index 401ee3f..2736f1f 100644 --- a/lib/advanced_billing/models/currency_overage_prices.rb +++ b/lib/advanced_billing/models/currency_overage_prices.rb @@ -23,11 +23,11 @@ class CurrencyOveragePrices < BaseModel # @return [PricePointType] attr_accessor :type - # Note: Refer to type attribute instead + # Note: Refer to type attribute instead. # @return [TrueClass | FalseClass] attr_accessor :default - # Note: Refer to type attribute instead + # Note: Refer to type attribute instead. # @return [String] attr_accessor :name @@ -89,7 +89,7 @@ class CurrencyOveragePrices < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_included - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/customer.rb b/lib/advanced_billing/models/customer.rb index dbac2ff..800ce78 100644 --- a/lib/advanced_billing/models/customer.rb +++ b/lib/advanced_billing/models/customer.rb @@ -22,8 +22,8 @@ class Customer < BaseModel # @return [String] attr_accessor :email - # A comma-separated list of emails that should be cc’d on all customer - # communications (i.e. “joe@example.com, sue@example.com”) + # “A comma-separated list of emails that should be cc’d on all customer + # communications (e.g., “joe@example.com, sue@example.com”)” # @return [String] attr_accessor :cc_emails @@ -49,19 +49,19 @@ class Customer < BaseModel # @return [DateTime] attr_accessor :updated_at - # The customer’s shipping street address (i.e. “123 Main St.”) + # The customer’s shipping street address (e.g., “123 Main St.”) # @return [String] attr_accessor :address - # Second line of the customer’s shipping address i.e. “Apt. 100” + # Second line of the customer’s shipping address e.g., “Apt. 100” # @return [String] attr_accessor :address_2 - # The customer’s shipping address city (i.e. “Boston”) + # The customer’s shipping address city (e.g., “Boston”) # @return [String] attr_accessor :city - # The customer’s shipping address state (i.e. “MA”) + # The customer’s shipping address state (e.g., “MA”) # @return [String] attr_accessor :state @@ -69,7 +69,7 @@ class Customer < BaseModel # @return [String] attr_accessor :state_name - # The customer’s shipping address zip code (i.e. “12345”) + # The customer’s shipping address zip code (e.g., “12345”) # @return [String] attr_accessor :zip @@ -107,6 +107,11 @@ class Customer < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_exempt + # Whether surcharging is enabled for the customer. Only included on sites + # where surcharging control is enabled. + # @return [TrueClass | FalseClass] + attr_accessor :surcharging + # The VAT business identification number for the customer. This number is # used to determine VAT tax opt out rules. It is not validated when added or # updated on a customer record. Instead, it is validated via VIES before @@ -144,6 +149,13 @@ class Customer < BaseModel # @return [String] attr_accessor :maxioid + # The ID of the Branding Theme assigned to this customer as the customer's + # default Branding Theme. This customer-level Branding Theme is used when a + # subscription does not have its own subscription-level Branding Theme. + # Available only when Branding Themes are enabled for the site. + # @return [Integer] + attr_accessor :branding_theme_id + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -171,6 +183,7 @@ def self.names @_hash['portal_invite_last_accepted_at'] = 'portal_invite_last_accepted_at' @_hash['tax_exempt'] = 'tax_exempt' + @_hash['surcharging'] = 'surcharging' @_hash['vat_number'] = 'vat_number' @_hash['parent_id'] = 'parent_id' @_hash['locale'] = 'locale' @@ -181,6 +194,7 @@ def self.names @_hash['default_auto_renewal_profile_id'] = 'default_auto_renewal_profile_id' @_hash['maxioid'] = 'maxioid' + @_hash['branding_theme_id'] = 'branding_theme_id' @_hash end @@ -210,6 +224,7 @@ def self.optionals portal_invite_last_sent_at portal_invite_last_accepted_at tax_exempt + surcharging vat_number parent_id locale @@ -218,6 +233,7 @@ def self.optionals tax_exempt_reason default_auto_renewal_profile_id maxioid + branding_theme_id ] end @@ -248,6 +264,7 @@ def self.nullables tax_exempt_reason default_auto_renewal_profile_id maxioid + branding_theme_id ] end @@ -259,11 +276,11 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, verified: SKIP, portal_customer_created_at: SKIP, portal_invite_last_sent_at: SKIP, portal_invite_last_accepted_at: SKIP, tax_exempt: SKIP, - vat_number: SKIP, parent_id: SKIP, locale: SKIP, - default_subscription_group_uid: SKIP, salesforce_id: SKIP, - tax_exempt_reason: SKIP, + surcharging: SKIP, vat_number: SKIP, parent_id: SKIP, + locale: SKIP, default_subscription_group_uid: SKIP, + salesforce_id: SKIP, tax_exempt_reason: SKIP, default_auto_renewal_profile_id: SKIP, maxioid: SKIP, - additional_properties: {}) + branding_theme_id: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -301,6 +318,7 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, portal_invite_last_accepted_at end @tax_exempt = tax_exempt unless tax_exempt == SKIP + @surcharging = surcharging unless surcharging == SKIP @vat_number = vat_number unless vat_number == SKIP @parent_id = parent_id unless parent_id == SKIP @locale = locale unless locale == SKIP @@ -315,6 +333,7 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, default_auto_renewal_profile_id end @maxioid = maxioid unless maxioid == SKIP + @branding_theme_id = branding_theme_id unless branding_theme_id == SKIP end # Creates an instance of the object from a hash. @@ -365,6 +384,7 @@ def self.from_hash(hash) SKIP end tax_exempt = hash.key?('tax_exempt') ? hash['tax_exempt'] : SKIP + surcharging = hash.key?('surcharging') ? hash['surcharging'] : SKIP vat_number = hash.key?('vat_number') ? hash['vat_number'] : SKIP parent_id = hash.key?('parent_id') ? hash['parent_id'] : SKIP locale = hash.key?('locale') ? hash['locale'] : SKIP @@ -376,6 +396,8 @@ def self.from_hash(hash) default_auto_renewal_profile_id = hash.key?('default_auto_renewal_profile_id') ? hash['default_auto_renewal_profile_id'] : SKIP maxioid = hash.key?('maxioid') ? hash['maxioid'] : SKIP + branding_theme_id = + hash.key?('branding_theme_id') ? hash['branding_theme_id'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -404,6 +426,7 @@ def self.from_hash(hash) portal_invite_last_sent_at: portal_invite_last_sent_at, portal_invite_last_accepted_at: portal_invite_last_accepted_at, tax_exempt: tax_exempt, + surcharging: surcharging, vat_number: vat_number, parent_id: parent_id, locale: locale, @@ -412,6 +435,7 @@ def self.from_hash(hash) tax_exempt_reason: tax_exempt_reason, default_auto_renewal_profile_id: default_auto_renewal_profile_id, maxioid: maxioid, + branding_theme_id: branding_theme_id, additional_properties: additional_properties) end @@ -456,11 +480,12 @@ def to_s " verified: #{@verified}, portal_customer_created_at: #{@portal_customer_created_at},"\ " portal_invite_last_sent_at: #{@portal_invite_last_sent_at},"\ " portal_invite_last_accepted_at: #{@portal_invite_last_accepted_at}, tax_exempt:"\ - " #{@tax_exempt}, vat_number: #{@vat_number}, parent_id: #{@parent_id}, locale: #{@locale},"\ - " default_subscription_group_uid: #{@default_subscription_group_uid}, salesforce_id:"\ - " #{@salesforce_id}, tax_exempt_reason: #{@tax_exempt_reason},"\ - " default_auto_renewal_profile_id: #{@default_auto_renewal_profile_id}, maxioid:"\ - " #{@maxioid}, additional_properties: #{get_additional_properties}>" + " #{@tax_exempt}, surcharging: #{@surcharging}, vat_number: #{@vat_number}, parent_id:"\ + " #{@parent_id}, locale: #{@locale}, default_subscription_group_uid:"\ + " #{@default_subscription_group_uid}, salesforce_id: #{@salesforce_id}, tax_exempt_reason:"\ + " #{@tax_exempt_reason}, default_auto_renewal_profile_id:"\ + " #{@default_auto_renewal_profile_id}, maxioid: #{@maxioid}, branding_theme_id:"\ + " #{@branding_theme_id}, additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -477,12 +502,13 @@ def inspect " #{@portal_customer_created_at.inspect}, portal_invite_last_sent_at:"\ " #{@portal_invite_last_sent_at.inspect}, portal_invite_last_accepted_at:"\ " #{@portal_invite_last_accepted_at.inspect}, tax_exempt: #{@tax_exempt.inspect},"\ - " vat_number: #{@vat_number.inspect}, parent_id: #{@parent_id.inspect}, locale:"\ - " #{@locale.inspect}, default_subscription_group_uid:"\ + " surcharging: #{@surcharging.inspect}, vat_number: #{@vat_number.inspect}, parent_id:"\ + " #{@parent_id.inspect}, locale: #{@locale.inspect}, default_subscription_group_uid:"\ " #{@default_subscription_group_uid.inspect}, salesforce_id: #{@salesforce_id.inspect},"\ " tax_exempt_reason: #{@tax_exempt_reason.inspect}, default_auto_renewal_profile_id:"\ " #{@default_auto_renewal_profile_id.inspect}, maxioid: #{@maxioid.inspect},"\ - " additional_properties: #{get_additional_properties}>" + " branding_theme_id: #{@branding_theme_id.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/customer_attributes.rb b/lib/advanced_billing/models/customer_attributes.rb index 483a88e..1183db5 100644 --- a/lib/advanced_billing/models/customer_attributes.rb +++ b/lib/advanced_billing/models/customer_attributes.rb @@ -24,48 +24,47 @@ class CustomerAttributes < BaseModel # @return [String] attr_accessor :email - # A list of emails that should be cc’d on all customer communications. - # Optional. + # (Optional) A list of emails that should be cc’d on all customer + # communications. # @return [String] attr_accessor :cc_emails - # The organization/company of the customer. Optional. + # (Optional) The organization/company of the customer. # @return [String] attr_accessor :organization - # A customer “reference”, or unique identifier from your app, stored in - # Chargify. Can be used so that you may reference your customer’s within - # Chargify using the same unique value you use in your application. - # Optional. + # (Optional) A customer “reference”, or unique identifier from your app, + # stored in Chargify. Can be used so that you may reference your customer’s + # within Chargify using the same unique value you use in your application. # @return [String] attr_accessor :reference - # (Optional) The customer’s shipping street address (i.e. “123 Main St.”). + # (Optional) The customer’s shipping street address (e.g., “123 Main St.”). # @return [String] attr_accessor :address - # (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” + # (Optional) Second line of the customer’s shipping address e.g., “Apt. 100” # @return [String] attr_accessor :address_2 - # (Optional) The customer’s shipping address city (i.e. “Boston”). + # (Optional) The customer’s shipping address city (e.g., “Boston”). # @return [String] attr_accessor :city - # (Optional) The customer’s shipping address state (i.e. “MA”). This must + # “(Optional) The customer’s shipping address state (e.g., “MA”). This must # conform to the # [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in - # order to be valid for tax locale purposes. + # order to be valid for tax locale purposes.” # @return [String] attr_accessor :state - # (Optional) The customer’s shipping address zip code (i.e. “12345”). + # (Optional) The customer’s shipping address zip code (e.g., “12345”). # @return [String] attr_accessor :zip - # (Optional) The customer shipping address country, required in [ISO_3166-1 - # alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. - # “US”). + # “(Optional) The customer shipping address country, required in [ISO_3166-1 + # alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., + # “US”).” # @return [String] attr_accessor :country @@ -82,7 +81,13 @@ class CustomerAttributes < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_exempt - # (Optional) Supplying the VAT number allows EU customer’s to opt-out of the + # (Optional) Whether surcharging is enabled for the customer. Defaults to + # `true` when omitted. Only applied on sites where surcharging control is + # enabled. + # @return [TrueClass | FalseClass] + attr_accessor :surcharging + + # (Optional) Supplying the VAT number allows EU customers to opt-out of the # Value Added Tax assuming the merchant address and customer billing address # are not within the same EU country. It’s important to omit the country # code from the VAT number upon entry. Otherwise, taxes will be assessed @@ -127,6 +132,7 @@ def self.names @_hash['phone'] = 'phone' @_hash['verified'] = 'verified' @_hash['tax_exempt'] = 'tax_exempt' + @_hash['surcharging'] = 'surcharging' @_hash['vat_number'] = 'vat_number' @_hash['metafields'] = 'metafields' @_hash['parent_id'] = 'parent_id' @@ -154,6 +160,7 @@ def self.optionals phone verified tax_exempt + surcharging vat_number metafields parent_id @@ -176,8 +183,8 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, cc_emails: SKIP, organization: SKIP, reference: SKIP, address: SKIP, address_2: SKIP, city: SKIP, state: SKIP, zip: SKIP, country: SKIP, phone: SKIP, verified: SKIP, - tax_exempt: SKIP, vat_number: SKIP, metafields: SKIP, - parent_id: SKIP, salesforce_id: SKIP, + tax_exempt: SKIP, surcharging: SKIP, vat_number: SKIP, + metafields: SKIP, parent_id: SKIP, salesforce_id: SKIP, default_auto_renewal_profile_id: SKIP, additional_properties: {}) # Add additional model properties to the instance. @@ -200,6 +207,7 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, @phone = phone unless phone == SKIP @verified = verified unless verified == SKIP @tax_exempt = tax_exempt unless tax_exempt == SKIP + @surcharging = surcharging unless surcharging == SKIP @vat_number = vat_number unless vat_number == SKIP @metafields = metafields unless metafields == SKIP @parent_id = parent_id unless parent_id == SKIP @@ -230,6 +238,7 @@ def self.from_hash(hash) phone = hash.key?('phone') ? hash['phone'] : SKIP verified = hash.key?('verified') ? hash['verified'] : SKIP tax_exempt = hash.key?('tax_exempt') ? hash['tax_exempt'] : SKIP + surcharging = hash.key?('surcharging') ? hash['surcharging'] : SKIP vat_number = hash.key?('vat_number') ? hash['vat_number'] : SKIP metafields = hash.key?('metafields') ? hash['metafields'] : SKIP parent_id = hash.key?('parent_id') ? hash['parent_id'] : SKIP @@ -256,6 +265,7 @@ def self.from_hash(hash) phone: phone, verified: verified, tax_exempt: tax_exempt, + surcharging: surcharging, vat_number: vat_number, metafields: metafields, parent_id: parent_id, @@ -281,9 +291,10 @@ def to_s " cc_emails: #{@cc_emails}, organization: #{@organization}, reference: #{@reference},"\ " address: #{@address}, address_2: #{@address_2}, city: #{@city}, state: #{@state}, zip:"\ " #{@zip}, country: #{@country}, phone: #{@phone}, verified: #{@verified}, tax_exempt:"\ - " #{@tax_exempt}, vat_number: #{@vat_number}, metafields: #{@metafields}, parent_id:"\ - " #{@parent_id}, salesforce_id: #{@salesforce_id}, default_auto_renewal_profile_id:"\ - " #{@default_auto_renewal_profile_id}, additional_properties: #{get_additional_properties}>" + " #{@tax_exempt}, surcharging: #{@surcharging}, vat_number: #{@vat_number}, metafields:"\ + " #{@metafields}, parent_id: #{@parent_id}, salesforce_id: #{@salesforce_id},"\ + " default_auto_renewal_profile_id: #{@default_auto_renewal_profile_id},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -294,11 +305,12 @@ def inspect " #{@organization.inspect}, reference: #{@reference.inspect}, address: #{@address.inspect},"\ " address_2: #{@address_2.inspect}, city: #{@city.inspect}, state: #{@state.inspect}, zip:"\ " #{@zip.inspect}, country: #{@country.inspect}, phone: #{@phone.inspect}, verified:"\ - " #{@verified.inspect}, tax_exempt: #{@tax_exempt.inspect}, vat_number:"\ - " #{@vat_number.inspect}, metafields: #{@metafields.inspect}, parent_id:"\ - " #{@parent_id.inspect}, salesforce_id: #{@salesforce_id.inspect},"\ - " default_auto_renewal_profile_id: #{@default_auto_renewal_profile_id.inspect},"\ - " additional_properties: #{get_additional_properties}>" + " #{@verified.inspect}, tax_exempt: #{@tax_exempt.inspect}, surcharging:"\ + " #{@surcharging.inspect}, vat_number: #{@vat_number.inspect}, metafields:"\ + " #{@metafields.inspect}, parent_id: #{@parent_id.inspect}, salesforce_id:"\ + " #{@salesforce_id.inspect}, default_auto_renewal_profile_id:"\ + " #{@default_auto_renewal_profile_id.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/debit_note.rb b/lib/advanced_billing/models/debit_note.rb index c12a7f7..a82c03b 100644 --- a/lib/advanced_billing/models/debit_note.rb +++ b/lib/advanced_billing/models/debit_note.rb @@ -26,7 +26,7 @@ class DebitNote < BaseModel # @return [Integer] attr_accessor :subscription_id - # A unique, identifier that appears on the debit note and in places it is + # A unique identifier that appears on the debit note and in places it is # referenced. # @return [Integer] attr_accessor :number @@ -44,7 +44,7 @@ class DebitNote < BaseModel # @return [String] attr_accessor :origin_credit_note_uid - # A unique, identifying string of the connected credit note. + # A unique identifying string of the connected credit note. # @return [String] attr_accessor :origin_credit_note_number @@ -88,8 +88,8 @@ class DebitNote < BaseModel # @return [InvoiceSeller] attr_accessor :seller - # Information about the customer who is owner or recipient the debited - # subscription. + # Information about the customer who is the owner or recipient of the + # debited subscription. # @return [InvoiceCustomer] attr_accessor :customer diff --git a/lib/advanced_billing/models/ebb_component.rb b/lib/advanced_billing/models/ebb_component.rb index 2e0cd93..05c0b21 100644 --- a/lib/advanced_billing/models/ebb_component.rb +++ b/lib/advanced_billing/models/ebb_component.rb @@ -10,14 +10,14 @@ class EBBComponent < BaseModel private_constant :SKIP # A name for this component that is suitable for showing customers and - # displaying on billing statements, ie. "Minutes". + # displaying on billing statements, i.e., "Minutes". # @return [String] attr_accessor :name - # The name of the unit of measurement for the component. It should be - # singular since it will be automatically pluralized when necessary. i.e. + # “The name of the unit of measurement for the component. It should be + # singular since it will be automatically pluralized when necessary. i.e., # “message”, which may then be shown as “5 messages” on a subscription’s - # component line-item + # component line-item” # @return [String] attr_accessor :unit_name @@ -27,7 +27,7 @@ class EBBComponent < BaseModel attr_accessor :description # A unique identifier for your use that can be used to retrieve this - # component is subsequent requests. Must start with a letter or number and + # component in subsequent requests. Must start with a letter or number and # may only contain lowercase letters, numbers, or the characters '.', ':', # '-', or '_'. # @return [String] @@ -60,7 +60,7 @@ class EBBComponent < BaseModel attr_accessor :price_points # The amount the customer will be charged per unit when the pricing scheme - # is “per_unit”. The price can contain up to 8 decimal places. i.e. 1.00 or + # is “per_unit”. The price can contain up to 8 decimal places. i.e., 1.00 or # 0.0012 or 0.00000065 # @return [Object] attr_accessor :unit_price @@ -82,7 +82,7 @@ class EBBComponent < BaseModel # @return [Integer] attr_accessor :event_based_billing_metric_id - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. i.e., an interval of ‘30’ coupled with an # interval_unit of day would mean this component's default price point would # renew every 30 days. This property is only available for sites with # Multifrequency enabled. @@ -95,6 +95,12 @@ class EBBComponent < BaseModel # @return [IntervalUnit] attr_accessor :interval_unit + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -113,6 +119,7 @@ def self.names 'event_based_billing_metric_id' @_hash['interval'] = 'interval' @_hash['interval_unit'] = 'interval_unit' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -129,6 +136,7 @@ def self.optionals hide_date_range_on_invoice interval interval_unit + unspsc_code ] end @@ -136,6 +144,7 @@ def self.optionals def self.nullables %w[ interval_unit + unspsc_code ] end @@ -144,7 +153,8 @@ def initialize(name:, unit_name:, pricing_scheme:, handle: SKIP, taxable: SKIP, prices: SKIP, price_points: SKIP, unit_price: SKIP, tax_code: SKIP, hide_date_range_on_invoice: SKIP, interval: SKIP, - interval_unit: SKIP, additional_properties: {}) + interval_unit: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -167,6 +177,7 @@ def initialize(name:, unit_name:, pricing_scheme:, @event_based_billing_metric_id = event_based_billing_metric_id @interval = interval unless interval == SKIP @interval_unit = interval_unit unless interval_unit == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -211,6 +222,7 @@ def self.from_hash(hash) hash.key?('hide_date_range_on_invoice') ? hash['hide_date_range_on_invoice'] : SKIP interval = hash.key?('interval') ? hash['interval'] : SKIP interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -230,6 +242,7 @@ def self.from_hash(hash) hide_date_range_on_invoice: hide_date_range_on_invoice, interval: interval, interval_unit: interval_unit, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -271,7 +284,8 @@ def to_s " #{@prices}, price_points: #{@price_points}, unit_price: #{@unit_price}, tax_code:"\ " #{@tax_code}, hide_date_range_on_invoice: #{@hide_date_range_on_invoice},"\ " event_based_billing_metric_id: #{@event_based_billing_metric_id}, interval: #{@interval},"\ - " interval_unit: #{@interval_unit}, additional_properties: #{get_additional_properties}>" + " interval_unit: #{@interval_unit}, unspsc_code: #{@unspsc_code}, additional_properties:"\ + " #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -283,8 +297,8 @@ def inspect " #{@price_points.inspect}, unit_price: #{@unit_price.inspect}, tax_code:"\ " #{@tax_code.inspect}, hide_date_range_on_invoice: #{@hide_date_range_on_invoice.inspect},"\ " event_based_billing_metric_id: #{@event_based_billing_metric_id.inspect}, interval:"\ - " #{@interval.inspect}, interval_unit: #{@interval_unit.inspect}, additional_properties:"\ - " #{get_additional_properties}>" + " #{@interval.inspect}, interval_unit: #{@interval_unit.inspect}, unspsc_code:"\ + " #{@unspsc_code.inspect}, additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/event.rb b/lib/advanced_billing/models/event.rb index 2ef8b0f..b7576bf 100644 --- a/lib/advanced_billing/models/event.rb +++ b/lib/advanced_billing/models/event.rb @@ -37,6 +37,8 @@ class Event < BaseModel # The schema varies based on the event key. The key-to-event data mapping is # as follows: # * `subscription_product_change` - SubscriptionProductChange + # * `subscription_product_change_scheduled` - + # SubscriptionProductChangeScheduled # * `subscription_state_change` - SubscriptionStateChange # * `signup_success`, `delayed_signup_creation_success`, `payment_success`, # `payment_failure`, `renewal_success`, `renewal_failure`, diff --git a/lib/advanced_billing/models/event_key.rb b/lib/advanced_billing/models/event_key.rb index ce123c6..3667c70 100644 --- a/lib/advanced_billing/models/event_key.rb +++ b/lib/advanced_billing/models/event_key.rb @@ -43,6 +43,10 @@ class EventKey # TODO: Write general description for SUBSCRIPTION_PRODUCT_CHANGE SUBSCRIPTION_PRODUCT_CHANGE = 'subscription_product_change'.freeze, + # TODO: Write general description for + # SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED + SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED = 'subscription_product_change_scheduled'.freeze, + # TODO: Write general description for PENDING_CANCELLATION_CHANGE PENDING_CANCELLATION_CHANGE = 'pending_cancellation_change'.freeze, @@ -288,6 +292,7 @@ def self.from_value(value, default_value = PAYMENT_SUCCESS) when 'renewal_failure' then RENEWAL_FAILURE when 'subscription_state_change' then SUBSCRIPTION_STATE_CHANGE when 'subscription_product_change' then SUBSCRIPTION_PRODUCT_CHANGE + when 'subscription_product_change_scheduled' then SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED when 'pending_cancellation_change' then PENDING_CANCELLATION_CHANGE when 'expiring_card' then EXPIRING_CARD when 'customer_update' then CUSTOMER_UPDATE diff --git a/lib/advanced_billing/models/failed_payment_action.rb b/lib/advanced_billing/models/failed_payment_action.rb index c96d1e2..0059dab 100644 --- a/lib/advanced_billing/models/failed_payment_action.rb +++ b/lib/advanced_billing/models/failed_payment_action.rb @@ -13,7 +13,7 @@ module AdvancedBilling # recorded in the invoice history. - `initiate_dunning` - prepayments and # credits applied to the invoice; invoice status set to "open"; email sent to # the customer for the issued invoice (if setting applies); payment failure - # recorded in the invoice history; subscription will most likely go into + # recorded in the invoice history; subscription will most likely go into # "past_due" or "canceled" state (depending upon net terms and dunning # settings). class FailedPaymentAction diff --git a/lib/advanced_billing/models/get_one_time_token_bank_account_payment_profile.rb b/lib/advanced_billing/models/get_one_time_token_bank_account_payment_profile.rb new file mode 100644 index 0000000..918743a --- /dev/null +++ b/lib/advanced_billing/models/get_one_time_token_bank_account_payment_profile.rb @@ -0,0 +1,393 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # GetOneTimeTokenBankAccountPaymentProfile Model. + class GetOneTimeTokenBankAccountPaymentProfile < BaseModel + SKIP = Object.new + private_constant :SKIP + + # TODO: Write general description for this method + # @return [String] + attr_accessor :id + + # TODO: Write general description for this method + # @return [String] + attr_accessor :first_name + + # TODO: Write general description for this method + # @return [String] + attr_accessor :last_name + + # TODO: Write general description for this method + # @return [String] + attr_accessor :customer_id + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [BankAccountVault] + attr_accessor :current_vault + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :vault_token + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :billing_address + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :billing_address_2 + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :billing_city + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :billing_country + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :billing_state + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :billing_zip + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :bank_name + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :masked_bank_routing_number + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :masked_bank_account_number + + # Defaults to checking + # @return [BankAccountType] + attr_accessor :bank_account_type + + # Defaults to personal + # @return [BankAccountHolderType] + attr_accessor :bank_account_holder_type + + # Defaults to personal + # @return [String] + attr_accessor :payment_type + + # Defaults to personal + # @return [TrueClass | FalseClass] + attr_accessor :disabled + + # Defaults to personal + # @return [Integer] + attr_accessor :site_gateway_setting_id + + # Defaults to personal + # @return [String] + attr_accessor :customer_vault_token + + # Defaults to personal + # @return [String] + attr_accessor :gateway_handle + + # Defaults to personal + # @return [TrueClass | FalseClass] + attr_accessor :verified + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['id'] = 'id' + @_hash['first_name'] = 'first_name' + @_hash['last_name'] = 'last_name' + @_hash['customer_id'] = 'customer_id' + @_hash['current_vault'] = 'current_vault' + @_hash['vault_token'] = 'vault_token' + @_hash['billing_address'] = 'billing_address' + @_hash['billing_address_2'] = 'billing_address_2' + @_hash['billing_city'] = 'billing_city' + @_hash['billing_country'] = 'billing_country' + @_hash['billing_state'] = 'billing_state' + @_hash['billing_zip'] = 'billing_zip' + @_hash['bank_name'] = 'bank_name' + @_hash['masked_bank_routing_number'] = 'masked_bank_routing_number' + @_hash['masked_bank_account_number'] = 'masked_bank_account_number' + @_hash['bank_account_type'] = 'bank_account_type' + @_hash['bank_account_holder_type'] = 'bank_account_holder_type' + @_hash['payment_type'] = 'payment_type' + @_hash['disabled'] = 'disabled' + @_hash['site_gateway_setting_id'] = 'site_gateway_setting_id' + @_hash['customer_vault_token'] = 'customer_vault_token' + @_hash['gateway_handle'] = 'gateway_handle' + @_hash['verified'] = 'verified' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + id + customer_id + billing_address_2 + customer_vault_token + gateway_handle + verified + ] + end + + # An array for nullable fields + def self.nullables + %w[ + id + customer_id + customer_vault_token + gateway_handle + verified + ] + end + + def initialize(first_name:, last_name:, current_vault:, vault_token:, + billing_address:, billing_city:, billing_country:, + billing_state:, billing_zip:, bank_name:, + masked_bank_routing_number:, masked_bank_account_number:, + bank_account_type:, bank_account_holder_type:, payment_type:, + disabled:, site_gateway_setting_id:, id: SKIP, + customer_id: SKIP, billing_address_2: SKIP, + customer_vault_token: SKIP, gateway_handle: SKIP, + verified: SKIP, additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @id = id unless id == SKIP + @first_name = first_name + @last_name = last_name + @customer_id = customer_id unless customer_id == SKIP + @current_vault = current_vault + @vault_token = vault_token + @billing_address = billing_address + @billing_address_2 = billing_address_2 unless billing_address_2 == SKIP + @billing_city = billing_city + @billing_country = billing_country + @billing_state = billing_state + @billing_zip = billing_zip + @bank_name = bank_name + @masked_bank_routing_number = masked_bank_routing_number + @masked_bank_account_number = masked_bank_account_number + @bank_account_type = bank_account_type + @bank_account_holder_type = bank_account_holder_type + @payment_type = payment_type + @disabled = disabled + @site_gateway_setting_id = site_gateway_setting_id + @customer_vault_token = customer_vault_token unless customer_vault_token == SKIP + @gateway_handle = gateway_handle unless gateway_handle == SKIP + @verified = verified unless verified == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + first_name = hash.key?('first_name') ? hash['first_name'] : nil + last_name = hash.key?('last_name') ? hash['last_name'] : nil + current_vault = hash.key?('current_vault') ? hash['current_vault'] : nil + vault_token = hash.key?('vault_token') ? hash['vault_token'] : nil + billing_address = + hash.key?('billing_address') ? hash['billing_address'] : nil + billing_city = hash.key?('billing_city') ? hash['billing_city'] : nil + billing_country = + hash.key?('billing_country') ? hash['billing_country'] : nil + billing_state = hash.key?('billing_state') ? hash['billing_state'] : nil + billing_zip = hash.key?('billing_zip') ? hash['billing_zip'] : nil + bank_name = hash.key?('bank_name') ? hash['bank_name'] : nil + masked_bank_routing_number = + hash.key?('masked_bank_routing_number') ? hash['masked_bank_routing_number'] : nil + masked_bank_account_number = + hash.key?('masked_bank_account_number') ? hash['masked_bank_account_number'] : nil + bank_account_type = + hash.key?('bank_account_type') ? hash['bank_account_type'] : nil + bank_account_holder_type = + hash.key?('bank_account_holder_type') ? hash['bank_account_holder_type'] : nil + payment_type = hash.key?('payment_type') ? hash['payment_type'] : nil + disabled = hash.key?('disabled') ? hash['disabled'] : nil + site_gateway_setting_id = + hash.key?('site_gateway_setting_id') ? hash['site_gateway_setting_id'] : nil + id = hash.key?('id') ? hash['id'] : SKIP + customer_id = hash.key?('customer_id') ? hash['customer_id'] : SKIP + billing_address_2 = + hash.key?('billing_address_2') ? hash['billing_address_2'] : SKIP + customer_vault_token = + hash.key?('customer_vault_token') ? hash['customer_vault_token'] : SKIP + gateway_handle = + hash.key?('gateway_handle') ? hash['gateway_handle'] : SKIP + verified = hash.key?('verified') ? hash['verified'] : SKIP + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + GetOneTimeTokenBankAccountPaymentProfile.new(first_name: first_name, + last_name: last_name, + current_vault: current_vault, + vault_token: vault_token, + billing_address: billing_address, + billing_city: billing_city, + billing_country: billing_country, + billing_state: billing_state, + billing_zip: billing_zip, + bank_name: bank_name, + masked_bank_routing_number: masked_bank_routing_number, + masked_bank_account_number: masked_bank_account_number, + bank_account_type: bank_account_type, + bank_account_holder_type: bank_account_holder_type, + payment_type: payment_type, + disabled: disabled, + site_gateway_setting_id: site_gateway_setting_id, + id: id, + customer_id: customer_id, + billing_address_2: billing_address_2, + customer_vault_token: customer_vault_token, + gateway_handle: gateway_handle, + verified: verified, + additional_properties: additional_properties) + end + + # Validates an instance of the object from a given value. + # @param [GetOneTimeTokenBankAccountPaymentProfile | Hash] The value against the validation is performed. + def self.validate(value) + if value.instance_of? self + return ( + APIHelper.valid_type?(value.first_name, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.last_name, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.current_vault, + ->(val) { BankAccountVault.validate(val) }) and + APIHelper.valid_type?(value.vault_token, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_address, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_city, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_country, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_state, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_zip, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.bank_name, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.masked_bank_routing_number, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.masked_bank_account_number, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.bank_account_type, + ->(val) { BankAccountType.validate(val) }) and + APIHelper.valid_type?(value.bank_account_holder_type, + ->(val) { BankAccountHolderType.validate(val) }) and + APIHelper.valid_type?(value.payment_type, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.disabled, + ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and + APIHelper.valid_type?(value.site_gateway_setting_id, + ->(val) { val.instance_of? Integer }) + ) + end + + return false unless value.instance_of? Hash + + ( + APIHelper.valid_type?(value['first_name'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['last_name'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['current_vault'], + ->(val) { BankAccountVault.validate(val) }) and + APIHelper.valid_type?(value['vault_token'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_address'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_city'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_country'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_state'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_zip'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['bank_name'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['masked_bank_routing_number'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['masked_bank_account_number'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['bank_account_type'], + ->(val) { BankAccountType.validate(val) }) and + APIHelper.valid_type?(value['bank_account_holder_type'], + ->(val) { BankAccountHolderType.validate(val) }) and + APIHelper.valid_type?(value['payment_type'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['disabled'], + ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and + APIHelper.valid_type?(value['site_gateway_setting_id'], + ->(val) { val.instance_of? Integer }) + ) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id}, first_name: #{@first_name}, last_name: #{@last_name},"\ + " customer_id: #{@customer_id}, current_vault: #{@current_vault}, vault_token:"\ + " #{@vault_token}, billing_address: #{@billing_address}, billing_address_2:"\ + " #{@billing_address_2}, billing_city: #{@billing_city}, billing_country:"\ + " #{@billing_country}, billing_state: #{@billing_state}, billing_zip: #{@billing_zip},"\ + " bank_name: #{@bank_name}, masked_bank_routing_number: #{@masked_bank_routing_number},"\ + " masked_bank_account_number: #{@masked_bank_account_number}, bank_account_type:"\ + " #{@bank_account_type}, bank_account_holder_type: #{@bank_account_holder_type},"\ + " payment_type: #{@payment_type}, disabled: #{@disabled}, site_gateway_setting_id:"\ + " #{@site_gateway_setting_id}, customer_vault_token: #{@customer_vault_token},"\ + " gateway_handle: #{@gateway_handle}, verified: #{@verified}, additional_properties:"\ + " #{get_additional_properties}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id.inspect}, first_name: #{@first_name.inspect}, last_name:"\ + " #{@last_name.inspect}, customer_id: #{@customer_id.inspect}, current_vault:"\ + " #{@current_vault.inspect}, vault_token: #{@vault_token.inspect}, billing_address:"\ + " #{@billing_address.inspect}, billing_address_2: #{@billing_address_2.inspect},"\ + " billing_city: #{@billing_city.inspect}, billing_country: #{@billing_country.inspect},"\ + " billing_state: #{@billing_state.inspect}, billing_zip: #{@billing_zip.inspect}, bank_name:"\ + " #{@bank_name.inspect}, masked_bank_routing_number: #{@masked_bank_routing_number.inspect},"\ + " masked_bank_account_number: #{@masked_bank_account_number.inspect}, bank_account_type:"\ + " #{@bank_account_type.inspect}, bank_account_holder_type:"\ + " #{@bank_account_holder_type.inspect}, payment_type: #{@payment_type.inspect}, disabled:"\ + " #{@disabled.inspect}, site_gateway_setting_id: #{@site_gateway_setting_id.inspect},"\ + " customer_vault_token: #{@customer_vault_token.inspect}, gateway_handle:"\ + " #{@gateway_handle.inspect}, verified: #{@verified.inspect}, additional_properties:"\ + " #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/get_one_time_token_payment_profile.rb b/lib/advanced_billing/models/get_one_time_token_payment_profile.rb index 24658ab..5372b81 100644 --- a/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +++ b/lib/advanced_billing/models/get_one_time_token_payment_profile.rb @@ -254,6 +254,84 @@ def self.from_hash(hash) additional_properties: additional_properties) end + # Validates an instance of the object from a given value. + # @param [GetOneTimeTokenPaymentProfile | Hash] The value against the validation is performed. + def self.validate(value) + if value.instance_of? self + return ( + APIHelper.valid_type?(value.first_name, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.last_name, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.masked_card_number, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.card_type, + ->(val) { CardType.validate(val) }) and + APIHelper.valid_type?(value.expiration_month, + ->(val) { val.instance_of? Float }) and + APIHelper.valid_type?(value.expiration_year, + ->(val) { val.instance_of? Float }) and + APIHelper.valid_type?(value.current_vault, + ->(val) { CreditCardVault.validate(val) }) and + APIHelper.valid_type?(value.vault_token, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_address, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_city, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_country, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_state, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_zip, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.payment_type, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.disabled, + ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and + APIHelper.valid_type?(value.site_gateway_setting_id, + ->(val) { val.instance_of? Integer }) + ) + end + + return false unless value.instance_of? Hash + + ( + APIHelper.valid_type?(value['first_name'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['last_name'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['masked_card_number'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['card_type'], + ->(val) { CardType.validate(val) }) and + APIHelper.valid_type?(value['expiration_month'], + ->(val) { val.instance_of? Float }) and + APIHelper.valid_type?(value['expiration_year'], + ->(val) { val.instance_of? Float }) and + APIHelper.valid_type?(value['current_vault'], + ->(val) { CreditCardVault.validate(val) }) and + APIHelper.valid_type?(value['vault_token'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_address'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_city'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_country'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_state'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_zip'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['payment_type'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['disabled'], + ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and + APIHelper.valid_type?(value['site_gateway_setting_id'], + ->(val) { val.instance_of? Integer }) + ) + end + # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last diff --git a/lib/advanced_billing/models/get_one_time_token_request.rb b/lib/advanced_billing/models/get_one_time_token_request.rb index 923985d..b6294d1 100644 --- a/lib/advanced_billing/models/get_one_time_token_request.rb +++ b/lib/advanced_billing/models/get_one_time_token_request.rb @@ -10,7 +10,7 @@ class GetOneTimeTokenRequest < BaseModel private_constant :SKIP # TODO: Write general description for this method - # @return [GetOneTimeTokenPaymentProfile] + # @return [Object] attr_accessor :payment_profile # A mapping from model property names to API property names. @@ -44,8 +44,9 @@ def self.from_hash(hash) return nil unless hash # Extract variables from the hash. - payment_profile = GetOneTimeTokenPaymentProfile.from_hash(hash['payment_profile']) if - hash['payment_profile'] + payment_profile = hash.key?('payment_profile') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:GetOneTimeTokenRequestPaymentProfile), hash['payment_profile'] + ) : nil # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -55,6 +56,20 @@ def self.from_hash(hash) additional_properties: additional_properties) end + # Validates an instance of the object from a given value. + # @param [GetOneTimeTokenRequest | Hash] The value against the validation is performed. + def self.validate(value) + if value.instance_of? self + return UnionTypeLookUp.get(:GetOneTimeTokenRequestPaymentProfile) + .validate(value.payment_profile) + end + + return false unless value.instance_of? Hash + + UnionTypeLookUp.get(:GetOneTimeTokenRequestPaymentProfile) + .validate(value['payment_profile']) + end + # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last diff --git a/lib/advanced_billing/models/group_billing.rb b/lib/advanced_billing/models/group_billing.rb index 93b79b0..a9c479b 100644 --- a/lib/advanced_billing/models/group_billing.rb +++ b/lib/advanced_billing/models/group_billing.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Optional attributes related to billing date and accrual. Note: Only + # (Optional) Attributes related to billing date and accrual. Note: Only # applicable for new subscriptions. class GroupBilling < BaseModel SKIP = Object.new diff --git a/lib/advanced_billing/models/group_settings.rb b/lib/advanced_billing/models/group_settings.rb index 4fafe2a..9c292e9 100644 --- a/lib/advanced_billing/models/group_settings.rb +++ b/lib/advanced_billing/models/group_settings.rb @@ -14,7 +14,7 @@ class GroupSettings < BaseModel # @return [GroupTarget] attr_accessor :target - # Optional attributes related to billing date and accrual. Note: Only + # (Optional) Attributes related to billing date and accrual. Note: Only # applicable for new subscriptions. # @return [GroupBilling] attr_accessor :billing diff --git a/lib/advanced_billing/models/group_status.rb b/lib/advanced_billing/models/group_status.rb new file mode 100644 index 0000000..278dc07 --- /dev/null +++ b/lib/advanced_billing/models/group_status.rb @@ -0,0 +1,36 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # group_status. + class GroupStatus + GROUP_STATUS = [ + # TODO: Write general description for UNGROUPED + UNGROUPED = 'ungrouped'.freeze, + + # TODO: Write general description for GROUPED + GROUPED = 'grouped'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + GROUP_STATUS.include?(value) + end + + def self.from_value(value, default_value = UNGROUPED) + return default_value if value.nil? + + str = value.to_s.strip + + case str.downcase + when 'ungrouped' then UNGROUPED + when 'grouped' then GROUPED + else + default_value + end + end + end +end diff --git a/lib/advanced_billing/models/group_target.rb b/lib/advanced_billing/models/group_target.rb index cef9c44..dad3a6b 100644 --- a/lib/advanced_billing/models/group_target.rb +++ b/lib/advanced_billing/models/group_target.rb @@ -15,8 +15,8 @@ class GroupTarget < BaseModel attr_accessor :type # The id of the target customer or subscription to group the existing - # subscription with. Ignored and should not be included if type is "self" , - # "parent", or "eldest" + # subscription with. Ignored and should not be included if type is "self", + # "parent", or "eldest". # @return [Integer] attr_accessor :id diff --git a/lib/advanced_billing/models/historic_usage.rb b/lib/advanced_billing/models/historic_usage.rb index fda701d..4000058 100644 --- a/lib/advanced_billing/models/historic_usage.rb +++ b/lib/advanced_billing/models/historic_usage.rb @@ -5,8 +5,8 @@ require 'date' module AdvancedBilling - # Optional for Event Based Components. If the `include=historic_usages` query - # param is provided, the last ten billing periods will be returned. + # (Optional) For Event Based Components. If the `include=historic_usages` + # query param is provided, the last ten billing periods will be returned. class HistoricUsage < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/advanced_billing/models/invoice.rb b/lib/advanced_billing/models/invoice.rb index 3ba2d70..497cb24 100644 --- a/lib/advanced_billing/models/invoice.rb +++ b/lib/advanced_billing/models/invoice.rb @@ -39,30 +39,30 @@ class Invoice < BaseModel attr_accessor :number # A monotonically increasing number assigned to invoices as they are - # created. This number is unique within a site and can be used to sort and + # created. This number is unique within a site and can be used to sort and # order invoices. # @return [Integer] attr_accessor :sequence_number # A monotonically increasing number assigned to invoices as they are - # created. This number is unique within a site and can be used to sort and + # created. This number is unique within a site and can be used to sort and # order invoices. # @return [DateTime] attr_accessor :transaction_time # A monotonically increasing number assigned to invoices as they are - # created. This number is unique within a site and can be used to sort and + # created. This number is unique within a site and can be used to sort and # order invoices. # @return [DateTime] attr_accessor :created_at # A monotonically increasing number assigned to invoices as they are - # created. This number is unique within a site and can be used to sort and + # created. This number is unique within a site and can be used to sort and # order invoices. # @return [DateTime] attr_accessor :updated_at - # Date the invoice was issued to the customer. This is the date that the + # Date the invoice was issued to the customer. This is the date that the # invoice was made available for payment. # The format is `"YYYY-MM-DD"`. # @return [Date] @@ -117,7 +117,7 @@ class Invoice < BaseModel attr_accessor :currency # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. @@ -165,27 +165,27 @@ class Invoice < BaseModel # @return [InvoiceSeller] attr_accessor :seller - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [InvoiceCustomer] attr_accessor :customer - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [InvoicePayer] attr_accessor :payer - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[String]] attr_accessor :recipient_emails - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Integer] attr_accessor :net_terms - # The memo printed on invoices of any collection type. This message is in + # The memo printed on invoices of any collection type. This message is in # control of the merchant. # @return [String] attr_accessor :memo @@ -212,7 +212,7 @@ class Invoice < BaseModel attr_accessor :tax_amount # The invoice total, which is `subtotal_amount - discount_amount + - # tax_amount`.' + # tax_amount`. # @return [String] attr_accessor :total_amount @@ -292,6 +292,13 @@ class Invoice < BaseModel # @return [Date] attr_accessor :public_url_expires_on + # The ID of the Branding Theme associated with this invoice. This value + # represents the Branding Theme used for invoice theming, such as themed + # invoice rendering. Available only when Branding Themes are enabled for the + # site. + # @return [Integer] + attr_accessor :branding_theme_id + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -352,6 +359,7 @@ def self.names @_hash['public_url'] = 'public_url' @_hash['previous_balance_data'] = 'previous_balance_data' @_hash['public_url_expires_on'] = 'public_url_expires_on' + @_hash['branding_theme_id'] = 'branding_theme_id' @_hash end @@ -414,6 +422,7 @@ def self.optionals public_url previous_balance_data public_url_expires_on + branding_theme_id ] end @@ -426,6 +435,7 @@ def self.nullables subscription_group_id parent_invoice_number group_primary_subscription_id + branding_theme_id ] end @@ -450,7 +460,7 @@ def initialize(id: SKIP, uid: SKIP, site_id: SKIP, customer_id: SKIP, payments: SKIP, custom_fields: SKIP, display_settings: SKIP, avatax_details: SKIP, public_url: SKIP, previous_balance_data: SKIP, public_url_expires_on: SKIP, - additional_properties: {}) + branding_theme_id: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -515,6 +525,7 @@ def initialize(id: SKIP, uid: SKIP, site_id: SKIP, customer_id: SKIP, @public_url = public_url unless public_url == SKIP @previous_balance_data = previous_balance_data unless previous_balance_data == SKIP @public_url_expires_on = public_url_expires_on unless public_url_expires_on == SKIP + @branding_theme_id = branding_theme_id unless branding_theme_id == SKIP end # Creates an instance of the object from a hash. @@ -682,6 +693,8 @@ def self.from_hash(hash) hash['previous_balance_data'] public_url_expires_on = hash.key?('public_url_expires_on') ? hash['public_url_expires_on'] : SKIP + branding_theme_id = + hash.key?('branding_theme_id') ? hash['branding_theme_id'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -743,6 +756,7 @@ def self.from_hash(hash) public_url: public_url, previous_balance_data: previous_balance_data, public_url_expires_on: public_url_expires_on, + branding_theme_id: branding_theme_id, additional_properties: additional_properties) end @@ -793,7 +807,8 @@ def to_s " #{@refunds}, payments: #{@payments}, custom_fields: #{@custom_fields}, display_settings:"\ " #{@display_settings}, avatax_details: #{@avatax_details}, public_url: #{@public_url},"\ " previous_balance_data: #{@previous_balance_data}, public_url_expires_on:"\ - " #{@public_url_expires_on}, additional_properties: #{get_additional_properties}>" + " #{@public_url_expires_on}, branding_theme_id: #{@branding_theme_id},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -827,7 +842,8 @@ def inspect " display_settings: #{@display_settings.inspect}, avatax_details:"\ " #{@avatax_details.inspect}, public_url: #{@public_url.inspect}, previous_balance_data:"\ " #{@previous_balance_data.inspect}, public_url_expires_on:"\ - " #{@public_url_expires_on.inspect}, additional_properties: #{get_additional_properties}>" + " #{@public_url_expires_on.inspect}, branding_theme_id: #{@branding_theme_id.inspect},"\ + " additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/invoice_consolidation_level.rb b/lib/advanced_billing/models/invoice_consolidation_level.rb index 99f8f20..15e12df 100644 --- a/lib/advanced_billing/models/invoice_consolidation_level.rb +++ b/lib/advanced_billing/models/invoice_consolidation_level.rb @@ -5,7 +5,7 @@ module AdvancedBilling # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: * "none": A normal + # consolidation. It will hold one of the following values: * "none": A normal # invoice with no consolidation. * "child": An invoice segment which has been # combined into a consolidated invoice. * "parent": A consolidated invoice, # whose contents are composed of invoice segments. "Parent" invoices do not diff --git a/lib/advanced_billing/models/invoice_customer.rb b/lib/advanced_billing/models/invoice_customer.rb index 7ed18f2..6ddbca3 100644 --- a/lib/advanced_billing/models/invoice_customer.rb +++ b/lib/advanced_billing/models/invoice_customer.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. class InvoiceCustomer < BaseModel SKIP = Object.new diff --git a/lib/advanced_billing/models/invoice_line_item.rb b/lib/advanced_billing/models/invoice_line_item.rb index 2990e73..551ec73 100644 --- a/lib/advanced_billing/models/invoice_line_item.rb +++ b/lib/advanced_billing/models/invoice_line_item.rb @@ -9,7 +9,7 @@ class InvoiceLineItem < BaseModel SKIP = Object.new private_constant :SKIP - # Unique identifier for the line item. Useful when cross-referencing the + # Unique identifier for the line item. Useful when cross-referencing the # line against individual discounts in the `discounts` or `taxes` lists. # @return [String] attr_accessor :uid @@ -18,7 +18,7 @@ class InvoiceLineItem < BaseModel # @return [String] attr_accessor :title - # Detailed description for the charge or item represented by this line. May + # Detailed description for the charge or item represented by this line. May # include proration details in plain text. # Note: this string may contain line breaks that are hints for the best # display format on the invoice. @@ -32,7 +32,7 @@ class InvoiceLineItem < BaseModel attr_accessor :quantity # The price per unit for the line item. - # When tiered pricing was used (i.e. not every unit was actually priced at + # When tiered pricing was used (i.e., not every unit was actually priced at # the same price) this will be the blended average cost per unit and the # `tiered_unit_price` field will be set to `true`. # @return [String] @@ -77,7 +77,7 @@ class InvoiceLineItem < BaseModel # The non-canonical total amount for the line. # `subtotal_amount` is the canonical amount for a line. The invoice # `total_amount` is derived from the sum of the line `subtotal_amount`s and - # discounts or taxes applied thereafter. Therefore, due to rounding or + # discounts or taxes applied thereafter. Therefore, due to rounding or # precision errors, the sum of line `total_amount`s may not equal the # invoice `total_amount`. # @return [String] @@ -92,7 +92,7 @@ class InvoiceLineItem < BaseModel # `"YYYY-MM-DD"`. # * For periodic charges paid in advance, this date will match the billing # date, and the end date will be in the future. - # * For periodic charges paid in arrears (e.g. metered charges), this date + # * For periodic charges paid in arrears (e.g., metered charges), this date # will be the date of the previous billing, and the end date will be the # current billing date. # * For non-periodic charges, this date and the end date will match. @@ -103,7 +103,7 @@ class InvoiceLineItem < BaseModel # `"YYYY-MM-DD"`. # * For periodic charges paid in advance, this date will match the next # (future) billing date. - # * For periodic charges paid in arrears (e.g. metered charges), this date + # * For periodic charges paid in arrears (e.g., metered charges), this date # will be the date of the current billing date. # * For non-periodic charges, this date and the start date will match. # @return [Date] @@ -113,7 +113,7 @@ class InvoiceLineItem < BaseModel # `"YYYY-MM-DD"`. # * For periodic charges paid in advance, this date will match the next # (future) billing date. - # * For periodic charges paid in arrears (e.g. metered charges), this date + # * For periodic charges paid in arrears (e.g., metered charges), this date # will be the date of the current billing date. # * For non-periodic charges, this date and the start date will match. # @return [Integer] diff --git a/lib/advanced_billing/models/issue_invoice_event_data.rb b/lib/advanced_billing/models/issue_invoice_event_data.rb index a391bc7..593dae8 100644 --- a/lib/advanced_billing/models/issue_invoice_event_data.rb +++ b/lib/advanced_billing/models/issue_invoice_event_data.rb @@ -10,7 +10,7 @@ class IssueInvoiceEventData < BaseModel private_constant :SKIP # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. diff --git a/lib/advanced_billing/models/issue_invoice_request.rb b/lib/advanced_billing/models/issue_invoice_request.rb index 9df9a58..170692c 100644 --- a/lib/advanced_billing/models/issue_invoice_request.rb +++ b/lib/advanced_billing/models/issue_invoice_request.rb @@ -20,7 +20,7 @@ class IssueInvoiceRequest < BaseModel # - `initiate_dunning` - prepayments and credits applied to the invoice; # invoice status set to "open"; email sent to the customer for the issued # invoice (if setting applies); payment failure recorded in the invoice - # history; subscription will most likely go into "past_due" or "canceled" + # history; subscription will most likely go into "past_due" or "canceled" # state (depending upon net terms and dunning settings). # @return [FailedPaymentAction] attr_accessor :on_failed_payment diff --git a/lib/advanced_billing/models/list_subscription_group_prepayment.rb b/lib/advanced_billing/models/list_subscription_group_prepayment.rb index 26ecfb0..2861467 100644 --- a/lib/advanced_billing/models/list_subscription_group_prepayment.rb +++ b/lib/advanced_billing/models/list_subscription_group_prepayment.rb @@ -10,7 +10,7 @@ class ListSubscriptionGroupPrepayment < BaseModel private_constant :SKIP # TODO: Write general description for this method - # @return [ListSubcriptionGroupPrepaymentItem] + # @return [ListSubscriptionGroupPrepaymentItem] attr_accessor :prepayment # A mapping from model property names to API property names. @@ -44,7 +44,7 @@ def self.from_hash(hash) return nil unless hash # Extract variables from the hash. - prepayment = ListSubcriptionGroupPrepaymentItem.from_hash(hash['prepayment']) if + prepayment = ListSubscriptionGroupPrepaymentItem.from_hash(hash['prepayment']) if hash['prepayment'] # Clean out expected properties from Hash. diff --git a/lib/advanced_billing/models/list_subcription_group_prepayment_item.rb b/lib/advanced_billing/models/list_subscription_group_prepayment_item.rb similarity index 86% rename from lib/advanced_billing/models/list_subcription_group_prepayment_item.rb rename to lib/advanced_billing/models/list_subscription_group_prepayment_item.rb index a0608a3..313a148 100644 --- a/lib/advanced_billing/models/list_subcription_group_prepayment_item.rb +++ b/lib/advanced_billing/models/list_subscription_group_prepayment_item.rb @@ -5,8 +5,8 @@ require 'date' module AdvancedBilling - # ListSubcriptionGroupPrepaymentItem Model. - class ListSubcriptionGroupPrepaymentItem < BaseModel + # ListSubscriptionGroupPrepaymentItem Model. + class ListSubscriptionGroupPrepaymentItem < BaseModel SKIP = Object.new private_constant :SKIP @@ -131,16 +131,16 @@ def self.from_hash(hash) additional_properties = hash.reject { |k, _| names.value?(k) } # Create object from extracted values. - ListSubcriptionGroupPrepaymentItem.new(id: id, - subscription_group_uid: subscription_group_uid, - amount_in_cents: amount_in_cents, - remaining_amount_in_cents: remaining_amount_in_cents, - details: details, - external: external, - memo: memo, - payment_type: payment_type, - created_at: created_at, - additional_properties: additional_properties) + ListSubscriptionGroupPrepaymentItem.new(id: id, + subscription_group_uid: subscription_group_uid, + amount_in_cents: amount_in_cents, + remaining_amount_in_cents: remaining_amount_in_cents, + details: details, + external: external, + memo: memo, + payment_type: payment_type, + created_at: created_at, + additional_properties: additional_properties) end def to_custom_created_at diff --git a/lib/advanced_billing/models/metered_component.rb b/lib/advanced_billing/models/metered_component.rb index f6fd5ea..bc720a1 100644 --- a/lib/advanced_billing/models/metered_component.rb +++ b/lib/advanced_billing/models/metered_component.rb @@ -10,12 +10,12 @@ class MeteredComponent < BaseModel private_constant :SKIP # A name for this component that is suitable for showing customers and - # displaying on billing statements, ie. "Minutes". + # displaying on billing statements, e.g., "Minutes". # @return [String] attr_accessor :name # The name of the unit of measurement for the component. It should be - # singular since it will be automatically pluralized when necessary. i.e. + # singular since it will be automatically pluralized when necessary. e.g., # “message”, which may then be shown as “5 messages” on a subscription’s # component line-item # @return [String] @@ -27,7 +27,7 @@ class MeteredComponent < BaseModel attr_accessor :description # A unique identifier for your use that can be used to retrieve this - # component is subsequent requests. Must start with a letter or number and + # component in subsequent requests. Must start with a letter or number and # may only contain lowercase letters, numbers, or the characters '.', ':', # '-', or '_'. # @return [String] @@ -62,7 +62,7 @@ class MeteredComponent < BaseModel # The amount the customer will be charged per unit when the pricing scheme # is “per_unit”. For On/Off Components, this is the amount that the customer # will be charged when they turn the component on for the subscription. The - # price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :unit_price @@ -97,7 +97,7 @@ class MeteredComponent < BaseModel # @return [Array[Integer]] attr_accessor :public_signup_page_ids - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component's default price point would # renew every 30 days. This property is only available for sites with # Multifrequency enabled. @@ -110,6 +110,12 @@ class MeteredComponent < BaseModel # @return [IntervalUnit] attr_accessor :interval_unit + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -129,6 +135,7 @@ def self.names @_hash['public_signup_page_ids'] = 'public_signup_page_ids' @_hash['interval'] = 'interval' @_hash['interval_unit'] = 'interval_unit' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -148,6 +155,7 @@ def self.optionals public_signup_page_ids interval interval_unit + unspsc_code ] end @@ -155,6 +163,7 @@ def self.optionals def self.nullables %w[ interval_unit + unspsc_code ] end @@ -165,7 +174,8 @@ def initialize(name:, unit_name:, pricing_scheme:, description: SKIP, display_on_hosted_page: SKIP, allow_fractional_quantities: SKIP, public_signup_page_ids: SKIP, interval: SKIP, - interval_unit: SKIP, additional_properties: {}) + interval_unit: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -193,6 +203,7 @@ def initialize(name:, unit_name:, pricing_scheme:, description: SKIP, @public_signup_page_ids = public_signup_page_ids unless public_signup_page_ids == SKIP @interval = interval unless interval == SKIP @interval_unit = interval_unit unless interval_unit == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -241,6 +252,7 @@ def self.from_hash(hash) hash.key?('public_signup_page_ids') ? hash['public_signup_page_ids'] : SKIP interval = hash.key?('interval') ? hash['interval'] : SKIP interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -262,6 +274,7 @@ def self.from_hash(hash) public_signup_page_ids: public_signup_page_ids, interval: interval, interval_unit: interval_unit, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -300,8 +313,8 @@ def to_s " #{@tax_code}, hide_date_range_on_invoice: #{@hide_date_range_on_invoice},"\ " display_on_hosted_page: #{@display_on_hosted_page}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities}, public_signup_page_ids: #{@public_signup_page_ids},"\ - " interval: #{@interval}, interval_unit: #{@interval_unit}, additional_properties:"\ - " #{get_additional_properties}>" + " interval: #{@interval}, interval_unit: #{@interval_unit}, unspsc_code: #{@unspsc_code},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -315,7 +328,8 @@ def inspect " display_on_hosted_page: #{@display_on_hosted_page.inspect}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities.inspect}, public_signup_page_ids:"\ " #{@public_signup_page_ids.inspect}, interval: #{@interval.inspect}, interval_unit:"\ - " #{@interval_unit.inspect}, additional_properties: #{get_additional_properties}>" + " #{@interval_unit.inspect}, unspsc_code: #{@unspsc_code.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/metered_usage.rb b/lib/advanced_billing/models/metered_usage.rb index d397b57..2913291 100644 --- a/lib/advanced_billing/models/metered_usage.rb +++ b/lib/advanced_billing/models/metered_usage.rb @@ -14,7 +14,7 @@ class MeteredUsage < BaseModel attr_accessor :previous_unit_balance # TODO: Write general description for this method - # @return [Integer] + # @return [Object] attr_accessor :new_unit_balance # TODO: Write general description for this method @@ -78,8 +78,9 @@ def self.from_hash(hash) # Extract variables from the hash. previous_unit_balance = hash.key?('previous_unit_balance') ? hash['previous_unit_balance'] : nil - new_unit_balance = - hash.key?('new_unit_balance') ? hash['new_unit_balance'] : nil + new_unit_balance = hash.key?('new_unit_balance') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:MeteredUsageNewUnitBalance), hash['new_unit_balance'] + ) : nil usage_quantity = hash.key?('usage_quantity') ? hash['usage_quantity'] : nil component_id = hash.key?('component_id') ? hash['component_id'] : nil @@ -107,8 +108,8 @@ def self.validate(value) return ( APIHelper.valid_type?(value.previous_unit_balance, ->(val) { val.instance_of? String }) and - APIHelper.valid_type?(value.new_unit_balance, - ->(val) { val.instance_of? Integer }) and + UnionTypeLookUp.get(:MeteredUsageNewUnitBalance) + .validate(value.new_unit_balance) and APIHelper.valid_type?(value.usage_quantity, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.component_id, @@ -125,8 +126,8 @@ def self.validate(value) ( APIHelper.valid_type?(value['previous_unit_balance'], ->(val) { val.instance_of? String }) and - APIHelper.valid_type?(value['new_unit_balance'], - ->(val) { val.instance_of? Integer }) and + UnionTypeLookUp.get(:MeteredUsageNewUnitBalance) + .validate(value['new_unit_balance']) and APIHelper.valid_type?(value['usage_quantity'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['component_id'], diff --git a/lib/advanced_billing/models/offer_item.rb b/lib/advanced_billing/models/offer_item.rb index 7f0701f..750ae47 100644 --- a/lib/advanced_billing/models/offer_item.rb +++ b/lib/advanced_billing/models/offer_item.rb @@ -41,7 +41,7 @@ class OfferItem < BaseModel # @return [Array[CurrencyPrice]] attr_accessor :currency_prices - # The numerical interval. i.e. an interval of '30' coupled with an + # The numerical interval. e.g., an interval of '30' coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/on_off_component.rb b/lib/advanced_billing/models/on_off_component.rb index e506ac3..e63fd70 100644 --- a/lib/advanced_billing/models/on_off_component.rb +++ b/lib/advanced_billing/models/on_off_component.rb @@ -10,7 +10,7 @@ class OnOffComponent < BaseModel private_constant :SKIP # A name for this component that is suitable for showing customers and - # displaying on billing statements, ie. "Minutes". + # displaying on billing statements, e.g., "Minutes". # @return [String] attr_accessor :name @@ -20,7 +20,7 @@ class OnOffComponent < BaseModel attr_accessor :description # A unique identifier for your use that can be used to retrieve this - # component is subsequent requests. Must start with a letter or number and + # component in subsequent requests. Must start with a letter or number and # may only contain lowercase letters, numbers, or the characters '.', ':', # '-', or '_'. # @return [String] @@ -47,7 +47,7 @@ class OnOffComponent < BaseModel # This is the amount that the customer will be charged when they turn the # component on for the subscription. The price can contain up to 8 decimal - # places. i.e. 1.00 or 0.0012 or 0.00000065 + # places. e.g., 1.00 or 0.0012 or 0.00000065 # @return [Object] attr_accessor :unit_price @@ -81,7 +81,7 @@ class OnOffComponent < BaseModel # @return [Array[Integer]] attr_accessor :public_signup_page_ids - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component's default price point would # renew every 30 days. This property is only available for sites with # Multifrequency enabled. @@ -94,6 +94,12 @@ class OnOffComponent < BaseModel # @return [IntervalUnit] attr_accessor :interval_unit + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -112,6 +118,7 @@ def self.names @_hash['public_signup_page_ids'] = 'public_signup_page_ids' @_hash['interval'] = 'interval' @_hash['interval_unit'] = 'interval_unit' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -131,6 +138,7 @@ def self.optionals public_signup_page_ids interval interval_unit + unspsc_code ] end @@ -140,6 +148,7 @@ def self.nullables upgrade_charge downgrade_credit interval_unit + unspsc_code ] end @@ -150,7 +159,8 @@ def initialize(name:, unit_price:, description: SKIP, handle: SKIP, display_on_hosted_page: SKIP, allow_fractional_quantities: SKIP, public_signup_page_ids: SKIP, interval: SKIP, - interval_unit: SKIP, additional_properties: {}) + interval_unit: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -177,6 +187,7 @@ def initialize(name:, unit_price:, description: SKIP, handle: SKIP, @public_signup_page_ids = public_signup_page_ids unless public_signup_page_ids == SKIP @interval = interval unless interval == SKIP @interval_unit = interval_unit unless interval_unit == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -216,6 +227,7 @@ def self.from_hash(hash) hash.key?('public_signup_page_ids') ? hash['public_signup_page_ids'] : SKIP interval = hash.key?('interval') ? hash['interval'] : SKIP interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -236,6 +248,7 @@ def self.from_hash(hash) public_signup_page_ids: public_signup_page_ids, interval: interval, interval_unit: interval_unit, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -270,7 +283,8 @@ def to_s " hide_date_range_on_invoice: #{@hide_date_range_on_invoice}, display_on_hosted_page:"\ " #{@display_on_hosted_page}, allow_fractional_quantities: #{@allow_fractional_quantities},"\ " public_signup_page_ids: #{@public_signup_page_ids}, interval: #{@interval}, interval_unit:"\ - " #{@interval_unit}, additional_properties: #{get_additional_properties}>" + " #{@interval_unit}, unspsc_code: #{@unspsc_code}, additional_properties:"\ + " #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -284,7 +298,8 @@ def inspect " display_on_hosted_page: #{@display_on_hosted_page.inspect}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities.inspect}, public_signup_page_ids:"\ " #{@public_signup_page_ids.inspect}, interval: #{@interval.inspect}, interval_unit:"\ - " #{@interval_unit.inspect}, additional_properties: #{get_additional_properties}>" + " #{@interval_unit.inspect}, unspsc_code: #{@unspsc_code.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/pause_request.rb b/lib/advanced_billing/models/pause_request.rb index 60816b4..e1b18a3 100644 --- a/lib/advanced_billing/models/pause_request.rb +++ b/lib/advanced_billing/models/pause_request.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Allows to pause a Subscription + # Allows you to pause a Subscription. class PauseRequest < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/advanced_billing/models/payment_profile_attributes.rb b/lib/advanced_billing/models/payment_profile_attributes.rb index eae26b6..ad8988f 100644 --- a/lib/advanced_billing/models/payment_profile_attributes.rb +++ b/lib/advanced_billing/models/payment_profile_attributes.rb @@ -11,19 +11,19 @@ class PaymentProfileAttributes < BaseModel # (Optional) Token received after sending billing information using Maxio.js # (formerly Chargify.js). This token must be passed as a sole attribute of - # `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + # `payment_profile_attributes` (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). # @return [String] attr_accessor :chargify_token # (Optional) Token received after sending billing information using Maxio.js # (formerly Chargify.js). This token must be passed as a sole attribute of - # `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + # `payment_profile_attributes` (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). # @return [Integer] attr_accessor :id # (Optional) Token received after sending billing information using Maxio.js # (formerly Chargify.js). This token must be passed as a sole attribute of - # `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + # `payment_profile_attributes` (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). # @return [PaymentType] attr_accessor :payment_type @@ -42,47 +42,48 @@ class PaymentProfileAttributes < BaseModel # @return [String] attr_accessor :masked_card_number - # The full credit card number (string representation, i.e. 5424000000000015) + # The full credit card number (string representation, e.g., + # 5424000000000015) # @return [String] attr_accessor :full_number # (Optional, used only for Subscription Import) If you know the card type - # (i.e. Visa, MC, etc) you may supply it here so that we may display the + # (e.g., Visa, MC, etc.) you may supply it here so that we may display the # card type in the UI. # @return [CardType] attr_accessor :card_type # (Optional when performing a Subscription Import via vault_token, required # otherwise) The 1- or 2-digit credit card expiration month, as an integer - # or string, i.e. 5 + # or string, e.g., 5 # @return [Object] attr_accessor :expiration_month # (Optional when performing a Subscription Import via vault_token, required # otherwise) The 4-digit credit card expiration year, as an integer or - # string, i.e. 2012 + # string, e.g., 2012 # @return [Object] attr_accessor :expiration_year # (Optional, may be required by your product configuration or gateway - # settings) The credit card or bank account billing street address (i.e. 123 - # Main St.). This value is merely passed through to the payment gateway. + # settings) The credit card or bank account billing street address (e.g., + # 123 Main St.). This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_address - # (Optional) Second line of the customer’s billing address i.e. Apt. 100 + # (Optional) Second line of the customer’s billing address, e.g., Apt. 100 # @return [String] attr_accessor :billing_address_2 # (Optional, may be required by your product configuration or gateway - # settings) The credit card or bank account billing address city (i.e. + # settings) The credit card or bank account billing address city (e.g., # “Boston”). This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_city # (Optional, may be required by your product configuration or gateway - # settings) The credit card or bank account billing address state (i.e. MA). - # This value is merely passed through to the payment gateway. This must + # settings) The credit card or bank account billing address state (e.g., + # MA). This value is merely passed through to the payment gateway. This must # conform to the # [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in # order to be valid for tax locale purposes. @@ -92,7 +93,7 @@ class PaymentProfileAttributes < BaseModel # (Optional, may be required by your product configuration or gateway # settings) The credit card or bank account billing address country, # required in [ISO_3166-1 - # alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. + # alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., # “US”). This value is merely passed through to the payment gateway. Some # gateways require country codes in a specific format. Check your gateway’s # documentation. If creating an ACH subscription, only US is supported at @@ -101,7 +102,7 @@ class PaymentProfileAttributes < BaseModel attr_accessor :billing_country # (Optional, may be required by your product configuration or gateway - # settings) The credit card or bank account billing address zip code (i.e. + # settings) The credit card or bank account billing address zip code (e.g., # 12345). This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_zip @@ -160,7 +161,7 @@ class PaymentProfileAttributes < BaseModel # (Optional, used only for Subscription Import) If you have the last 4 # digits of the credit card number, you may supply them here so that we may - # create a masked card number (i.e. XXXX-XXXX-XXXX-1234) for display in the + # create a masked card number (e.g., XXXX-XXXX-XXXX-1234) for display in the # UI. Last 4 digits are required for refunds in Auth.Net. # @return [String] attr_accessor :last_four diff --git a/lib/advanced_billing/models/prepaid_usage.rb b/lib/advanced_billing/models/prepaid_usage.rb index 8f3b185..2113b4f 100644 --- a/lib/advanced_billing/models/prepaid_usage.rb +++ b/lib/advanced_billing/models/prepaid_usage.rb @@ -18,11 +18,11 @@ class PrepaidUsage < BaseModel attr_accessor :previous_overage_unit_balance # TODO: Write general description for this method - # @return [Integer] + # @return [Object] attr_accessor :new_unit_balance # TODO: Write general description for this method - # @return [Integer] + # @return [Object] attr_accessor :new_overage_unit_balance # TODO: Write general description for this method @@ -107,10 +107,12 @@ def self.from_hash(hash) hash.key?('previous_unit_balance') ? hash['previous_unit_balance'] : nil previous_overage_unit_balance = hash.key?('previous_overage_unit_balance') ? hash['previous_overage_unit_balance'] : nil - new_unit_balance = - hash.key?('new_unit_balance') ? hash['new_unit_balance'] : nil - new_overage_unit_balance = - hash.key?('new_overage_unit_balance') ? hash['new_overage_unit_balance'] : nil + new_unit_balance = hash.key?('new_unit_balance') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:PrepaidUsageNewUnitBalance), hash['new_unit_balance'] + ) : nil + new_overage_unit_balance = hash.key?('new_overage_unit_balance') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:PrepaidUsageNewOverageUnitBalance), hash['new_overage_unit_balance'] + ) : nil usage_quantity = hash.key?('usage_quantity') ? hash['usage_quantity'] : nil overage_usage_quantity = @@ -156,10 +158,10 @@ def self.validate(value) ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.previous_overage_unit_balance, ->(val) { val.instance_of? String }) and - APIHelper.valid_type?(value.new_unit_balance, - ->(val) { val.instance_of? Integer }) and - APIHelper.valid_type?(value.new_overage_unit_balance, - ->(val) { val.instance_of? Integer }) and + UnionTypeLookUp.get(:PrepaidUsageNewUnitBalance) + .validate(value.new_unit_balance) and + UnionTypeLookUp.get(:PrepaidUsageNewOverageUnitBalance) + .validate(value.new_overage_unit_balance) and APIHelper.valid_type?(value.usage_quantity, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.overage_usage_quantity, @@ -184,10 +186,10 @@ def self.validate(value) ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['previous_overage_unit_balance'], ->(val) { val.instance_of? String }) and - APIHelper.valid_type?(value['new_unit_balance'], - ->(val) { val.instance_of? Integer }) and - APIHelper.valid_type?(value['new_overage_unit_balance'], - ->(val) { val.instance_of? Integer }) and + UnionTypeLookUp.get(:PrepaidUsageNewUnitBalance) + .validate(value['new_unit_balance']) and + UnionTypeLookUp.get(:PrepaidUsageNewOverageUnitBalance) + .validate(value['new_overage_unit_balance']) and APIHelper.valid_type?(value['usage_quantity'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['overage_usage_quantity'], diff --git a/lib/advanced_billing/models/prepaid_usage_component.rb b/lib/advanced_billing/models/prepaid_usage_component.rb index ca41f3c..94d217e 100644 --- a/lib/advanced_billing/models/prepaid_usage_component.rb +++ b/lib/advanced_billing/models/prepaid_usage_component.rb @@ -10,12 +10,12 @@ class PrepaidUsageComponent < BaseModel private_constant :SKIP # A name for this component that is suitable for showing customers and - # displaying on billing statements, ie. "Minutes". + # displaying on billing statements, e.g., "Minutes". # @return [String] attr_accessor :name # The name of the unit of measurement for the component. It should be - # singular since it will be automatically pluralized when necessary. i.e. + # singular since it will be automatically pluralized when necessary. e.g., # “message”, which may then be shown as “5 messages” on a subscription’s # component line-item # @return [String] @@ -27,7 +27,7 @@ class PrepaidUsageComponent < BaseModel attr_accessor :description # A unique identifier for your use that can be used to retrieve this - # component is subsequent requests. Must start with a letter or number and + # component in subsequent requests. Must start with a letter or number and # may only contain lowercase letters, numbers, or the characters '.', ':', # '-', or '_'. # @return [String] @@ -69,7 +69,7 @@ class PrepaidUsageComponent < BaseModel # The amount the customer will be charged per unit when the pricing scheme # is “per_unit”. For On/Off Components, this is the amount that the customer # will be charged when they turn the component on for the subscription. The - # price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :unit_price @@ -93,12 +93,12 @@ class PrepaidUsageComponent < BaseModel attr_accessor :overage_pricing # Boolean which controls whether or not remaining units should be rolled - # over to the next period + # over to the next period. # @return [TrueClass | FalseClass] attr_accessor :rollover_prepaid_remainder # Boolean which controls whether or not the allocated quantity should be - # renewed at the beginning of each period + # renewed at the beginning of each period. # @return [TrueClass | FalseClass] attr_accessor :renew_prepaid_allocation @@ -132,6 +132,12 @@ class PrepaidUsageComponent < BaseModel # @return [Array[Integer]] attr_accessor :public_signup_page_ids + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -156,6 +162,7 @@ def self.names @_hash['display_on_hosted_page'] = 'display_on_hosted_page' @_hash['allow_fractional_quantities'] = 'allow_fractional_quantities' @_hash['public_signup_page_ids'] = 'public_signup_page_ids' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -179,6 +186,7 @@ def self.optionals display_on_hosted_page allow_fractional_quantities public_signup_page_ids + unspsc_code ] end @@ -188,6 +196,7 @@ def self.nullables upgrade_charge downgrade_credit expiration_interval_unit + unspsc_code ] end @@ -200,7 +209,8 @@ def initialize(name:, unit_name:, pricing_scheme:, overage_pricing:, renew_prepaid_allocation: SKIP, expiration_interval: SKIP, expiration_interval_unit: SKIP, display_on_hosted_page: SKIP, allow_fractional_quantities: SKIP, - public_signup_page_ids: SKIP, additional_properties: {}) + public_signup_page_ids: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -236,6 +246,7 @@ def initialize(name:, unit_name:, pricing_scheme:, overage_pricing:, allow_fractional_quantities end @public_signup_page_ids = public_signup_page_ids unless public_signup_page_ids == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -296,6 +307,7 @@ def self.from_hash(hash) hash.key?('allow_fractional_quantities') ? hash['allow_fractional_quantities'] : SKIP public_signup_page_ids = hash.key?('public_signup_page_ids') ? hash['public_signup_page_ids'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -322,6 +334,7 @@ def self.from_hash(hash) display_on_hosted_page: display_on_hosted_page, allow_fractional_quantities: allow_fractional_quantities, public_signup_page_ids: public_signup_page_ids, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -370,7 +383,7 @@ def to_s " #{@expiration_interval}, expiration_interval_unit: #{@expiration_interval_unit},"\ " display_on_hosted_page: #{@display_on_hosted_page}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities}, public_signup_page_ids: #{@public_signup_page_ids},"\ - " additional_properties: #{get_additional_properties}>" + " unspsc_code: #{@unspsc_code}, additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -389,7 +402,8 @@ def inspect " #{@expiration_interval_unit.inspect}, display_on_hosted_page:"\ " #{@display_on_hosted_page.inspect}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities.inspect}, public_signup_page_ids:"\ - " #{@public_signup_page_ids.inspect}, additional_properties: #{get_additional_properties}>" + " #{@public_signup_page_ids.inspect}, unspsc_code: #{@unspsc_code.inspect},"\ + " additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/price.rb b/lib/advanced_billing/models/price.rb index f84afc0..4cc849d 100644 --- a/lib/advanced_billing/models/price.rb +++ b/lib/advanced_billing/models/price.rb @@ -17,7 +17,7 @@ class Price < BaseModel # @return [Object] attr_accessor :ending_quantity - # The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :unit_price diff --git a/lib/advanced_billing/models/product.rb b/lib/advanced_billing/models/product.rb index 58046f5..a5ab89a 100644 --- a/lib/advanced_billing/models/product.rb +++ b/lib/advanced_billing/models/product.rb @@ -26,7 +26,7 @@ class Product < BaseModel # @return [String] attr_accessor :description - # E.g. Internal ID or SKU Number + # E.g., Internal ID or SKU Number # @return [String] attr_accessor :accounting_code @@ -39,7 +39,7 @@ class Product < BaseModel # A numerical interval for the length a subscription to this product will # run before it expires. See the description of interval for a description # of how this value is coupled with an interval unit to calculate the full - # interval + # interval. # @return [Integer] attr_accessor :expiration_interval @@ -60,8 +60,8 @@ class Product < BaseModel # @return [Integer] attr_accessor :price_in_cents - # The numerical interval. i.e. an interval of ‘30’ coupled with an - # interval_unit of day would mean this product would renew every 30 days + # The numerical interval. e.g., an interval of ‘30’ coupled with an + # interval_unit of day would mean this product would renew every 30 days. # @return [Integer] attr_accessor :interval @@ -81,7 +81,8 @@ class Product < BaseModel # A numerical interval for the length of the trial period of a subscription # to this product. See the description of interval for a description of how - # this value is coupled with an interval unit to calculate the full interval + # this value is coupled with an interval unit to calculate the full + # interval. # @return [Integer] attr_accessor :trial_interval @@ -126,28 +127,28 @@ class Product < BaseModel # The parameters will append to the url after a successful account update. # See [help # documentation](https://help.chargify.com/products/product-editing.html#ret - # urn-parameters-after-account-update) + # urn-parameters-after-account-update). # @return [String] attr_accessor :update_return_params # The parameters will append to the url after a successful account update. # See [help # documentation](https://help.chargify.com/products/product-editing.html#ret - # urn-parameters-after-account-update) + # urn-parameters-after-account-update). # @return [ProductFamily] attr_accessor :product_family # The parameters will append to the url after a successful account update. # See [help # documentation](https://help.chargify.com/products/product-editing.html#ret - # urn-parameters-after-account-update) + # urn-parameters-after-account-update). # @return [Array[PublicSignupPage]] attr_accessor :public_signup_pages # The parameters will append to the url after a successful account update. # See [help # documentation](https://help.chargify.com/products/product-editing.html#ret - # urn-parameters-after-account-update) + # urn-parameters-after-account-update). # @return [String] attr_accessor :product_price_point_name @@ -199,6 +200,12 @@ class Product < BaseModel # @return [String] attr_accessor :product_price_point_handle + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this product instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -240,6 +247,7 @@ def self.names @_hash['item_category'] = 'item_category' @_hash['product_price_point_id'] = 'product_price_point_id' @_hash['product_price_point_handle'] = 'product_price_point_handle' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -283,6 +291,7 @@ def self.optionals item_category product_price_point_id product_price_point_handle + unspsc_code ] end @@ -307,6 +316,7 @@ def self.nullables use_site_exchange_rate item_category product_price_point_handle + unspsc_code ] end @@ -327,7 +337,8 @@ def initialize(id: SKIP, name: SKIP, handle: SKIP, description: SKIP, default_product_price_point_id: SKIP, use_site_exchange_rate: SKIP, item_category: SKIP, product_price_point_id: SKIP, - product_price_point_handle: SKIP, additional_properties: {}) + product_price_point_handle: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -379,6 +390,7 @@ def initialize(id: SKIP, name: SKIP, handle: SKIP, description: SKIP, @product_price_point_handle = product_price_point_handle end + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -466,6 +478,7 @@ def self.from_hash(hash) hash.key?('product_price_point_id') ? hash['product_price_point_id'] : SKIP product_price_point_handle = hash.key?('product_price_point_handle') ? hash['product_price_point_handle'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -508,6 +521,7 @@ def self.from_hash(hash) item_category: item_category, product_price_point_id: product_price_point_id, product_price_point_handle: product_price_point_handle, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -544,8 +558,8 @@ def to_s " tax_code: #{@tax_code}, default_product_price_point_id:"\ " #{@default_product_price_point_id}, use_site_exchange_rate: #{@use_site_exchange_rate},"\ " item_category: #{@item_category}, product_price_point_id: #{@product_price_point_id},"\ - " product_price_point_handle: #{@product_price_point_handle}, additional_properties:"\ - " #{get_additional_properties}>" + " product_price_point_handle: #{@product_price_point_handle}, unspsc_code: #{@unspsc_code},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -574,8 +588,8 @@ def inspect " default_product_price_point_id: #{@default_product_price_point_id.inspect},"\ " use_site_exchange_rate: #{@use_site_exchange_rate.inspect}, item_category:"\ " #{@item_category.inspect}, product_price_point_id: #{@product_price_point_id.inspect},"\ - " product_price_point_handle: #{@product_price_point_handle.inspect}, additional_properties:"\ - " #{get_additional_properties}>" + " product_price_point_handle: #{@product_price_point_handle.inspect}, unspsc_code:"\ + " #{@unspsc_code.inspect}, additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/product_family.rb b/lib/advanced_billing/models/product_family.rb index d50f3bf..e66d411 100644 --- a/lib/advanced_billing/models/product_family.rb +++ b/lib/advanced_billing/models/product_family.rb @@ -30,11 +30,18 @@ class ProductFamily < BaseModel # @return [String] attr_accessor :description - # TODO: Write general description for this method + # Whether surcharging applies to this product family. Only included on sites + # where surcharging is enabled. + # @return [TrueClass | FalseClass] + attr_accessor :surcharging + + # Whether surcharging applies to this product family. Only included on sites + # where surcharging is enabled. # @return [DateTime] attr_accessor :created_at - # TODO: Write general description for this method + # Whether surcharging applies to this product family. Only included on sites + # where surcharging is enabled. # @return [DateTime] attr_accessor :updated_at @@ -51,6 +58,7 @@ def self.names @_hash['handle'] = 'handle' @_hash['accounting_code'] = 'accounting_code' @_hash['description'] = 'description' + @_hash['surcharging'] = 'surcharging' @_hash['created_at'] = 'created_at' @_hash['updated_at'] = 'updated_at' @_hash['archived_at'] = 'archived_at' @@ -65,6 +73,7 @@ def self.optionals handle accounting_code description + surcharging created_at updated_at archived_at @@ -81,8 +90,9 @@ def self.nullables end def initialize(id: SKIP, name: SKIP, handle: SKIP, accounting_code: SKIP, - description: SKIP, created_at: SKIP, updated_at: SKIP, - archived_at: SKIP, additional_properties: {}) + description: SKIP, surcharging: SKIP, created_at: SKIP, + updated_at: SKIP, archived_at: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -93,6 +103,7 @@ def initialize(id: SKIP, name: SKIP, handle: SKIP, accounting_code: SKIP, @handle = handle unless handle == SKIP @accounting_code = accounting_code unless accounting_code == SKIP @description = description unless description == SKIP + @surcharging = surcharging unless surcharging == SKIP @created_at = created_at unless created_at == SKIP @updated_at = updated_at unless updated_at == SKIP @archived_at = archived_at unless archived_at == SKIP @@ -109,6 +120,7 @@ def self.from_hash(hash) accounting_code = hash.key?('accounting_code') ? hash['accounting_code'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP + surcharging = hash.key?('surcharging') ? hash['surcharging'] : SKIP created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) else @@ -134,6 +146,7 @@ def self.from_hash(hash) handle: handle, accounting_code: accounting_code, description: description, + surcharging: surcharging, created_at: created_at, updated_at: updated_at, archived_at: archived_at, @@ -156,9 +169,9 @@ def to_custom_archived_at def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, name: #{@name}, handle: #{@handle}, accounting_code:"\ - " #{@accounting_code}, description: #{@description}, created_at: #{@created_at}, updated_at:"\ - " #{@updated_at}, archived_at: #{@archived_at}, additional_properties:"\ - " #{get_additional_properties}>" + " #{@accounting_code}, description: #{@description}, surcharging: #{@surcharging},"\ + " created_at: #{@created_at}, updated_at: #{@updated_at}, archived_at: #{@archived_at},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -166,8 +179,9 @@ def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, handle: #{@handle.inspect},"\ " accounting_code: #{@accounting_code.inspect}, description: #{@description.inspect},"\ - " created_at: #{@created_at.inspect}, updated_at: #{@updated_at.inspect}, archived_at:"\ - " #{@archived_at.inspect}, additional_properties: #{get_additional_properties}>" + " surcharging: #{@surcharging.inspect}, created_at: #{@created_at.inspect}, updated_at:"\ + " #{@updated_at.inspect}, archived_at: #{@archived_at.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/product_price_point.rb b/lib/advanced_billing/models/product_price_point.rb index f41f85f..a83c553 100644 --- a/lib/advanced_billing/models/product_price_point.rb +++ b/lib/advanced_billing/models/product_price_point.rb @@ -26,9 +26,9 @@ class ProductPricePoint < BaseModel # @return [Integer] attr_accessor :price_in_cents - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this product price point would renew every - # 30 days + # 30 days. # @return [Integer] attr_accessor :interval @@ -41,9 +41,9 @@ class ProductPricePoint < BaseModel # @return [Integer] attr_accessor :trial_price_in_cents - # The numerical trial interval. i.e. an interval of ‘30’ coupled with a + # The numerical trial interval. e.g., an interval of ‘30’ coupled with a # trial_interval_unit of day would mean this product price point trial would - # last 30 days + # last 30 days. # @return [Integer] attr_accessor :trial_interval @@ -52,7 +52,7 @@ class ProductPricePoint < BaseModel # @return [IntervalUnit] attr_accessor :trial_interval_unit - # Indicates how a trial is handled when the trail period ends and there is + # Indicates how a trial is handled when the trial period ends and there is # no credit card on file. For `no_obligation`, the subscription transitions # to a Trial Ended state. Maxio will not send any emails or statements. For # `payment_expected`, the subscription transitions to a Past Due state. @@ -73,9 +73,9 @@ class ProductPricePoint < BaseModel # @return [TrueClass | FalseClass] attr_accessor :initial_charge_after_trial - # The numerical expiration interval. i.e. an expiration_interval of ‘30’ + # The numerical expiration interval. e.g., an expiration_interval of ‘30’ # coupled with an expiration_interval_unit of day would mean this product - # price point would expire after 30 days + # price point would expire after 30 days. # @return [Integer] attr_accessor :expiration_interval diff --git a/lib/advanced_billing/models/proforma_invoice.rb b/lib/advanced_billing/models/proforma_invoice.rb index 63fe9f1..0f95f77 100644 --- a/lib/advanced_billing/models/proforma_invoice.rb +++ b/lib/advanced_billing/models/proforma_invoice.rb @@ -68,7 +68,7 @@ class ProformaInvoice < BaseModel attr_accessor :currency # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. @@ -83,7 +83,7 @@ class ProformaInvoice < BaseModel attr_accessor :consolidation_level # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. @@ -98,7 +98,7 @@ class ProformaInvoice < BaseModel attr_accessor :product_name # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. @@ -113,7 +113,7 @@ class ProformaInvoice < BaseModel attr_accessor :product_family_name # 'proforma' value is deprecated in favor of proforma_adhoc and - # proforma_automatic + # proforma_automatic. # @return [ProformaInvoiceRole] attr_accessor :role @@ -122,102 +122,102 @@ class ProformaInvoice < BaseModel # @return [InvoiceSeller] attr_accessor :seller - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [InvoiceCustomer] attr_accessor :customer - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :memo - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [InvoiceAddress] attr_accessor :billing_address - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [InvoiceAddress] attr_accessor :shipping_address - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :subtotal_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :discount_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :tax_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :total_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :credit_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :paid_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :refund_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :due_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[InvoiceLineItem]] attr_accessor :line_items - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[ProformaInvoiceDiscount]] attr_accessor :discounts - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[ProformaInvoiceTax]] attr_accessor :taxes - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[ProformaInvoiceCredit]] attr_accessor :credits - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[ProformaInvoicePayment]] attr_accessor :payments - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[InvoiceCustomField]] attr_accessor :custom_fields - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :public_url - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [AvailableActions] attr_accessor :available_actions diff --git a/lib/advanced_billing/models/proforma_invoice_role.rb b/lib/advanced_billing/models/proforma_invoice_role.rb index 2f11d93..d0a9f07 100644 --- a/lib/advanced_billing/models/proforma_invoice_role.rb +++ b/lib/advanced_billing/models/proforma_invoice_role.rb @@ -5,7 +5,7 @@ module AdvancedBilling # 'proforma' value is deprecated in favor of proforma_adhoc and - # proforma_automatic + # proforma_automatic. class ProformaInvoiceRole PROFORMA_INVOICE_ROLE = [ # TODO: Write general description for UNSET diff --git a/lib/advanced_billing/models/public_signup_page.rb b/lib/advanced_billing/models/public_signup_page.rb index c2e7d6d..6925da3 100644 --- a/lib/advanced_billing/models/public_signup_page.rb +++ b/lib/advanced_billing/models/public_signup_page.rb @@ -14,7 +14,7 @@ class PublicSignupPage < BaseModel attr_accessor :id # The url to which a customer will be returned after a successful signup - # (public_signup_pages only) + # (public_signup_pages only). # @return [String] attr_accessor :return_url @@ -22,7 +22,7 @@ class PublicSignupPage < BaseModel # @return [String] attr_accessor :return_params - # The url where the signup page can be viewed (public_signup_pages only) + # The url where the signup page can be viewed (public_signup_pages only). # @return [String] attr_accessor :url diff --git a/lib/advanced_billing/models/q_scope.rb b/lib/advanced_billing/models/q_scope.rb new file mode 100644 index 0000000..0d4a4ec --- /dev/null +++ b/lib/advanced_billing/models/q_scope.rb @@ -0,0 +1,56 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # q_scope. + class QScope + Q_SCOPE = [ + # TODO: Write general description for FULL_NAME + FULL_NAME = 'full_name'.freeze, + + # TODO: Write general description for FIRST_NAME + FIRST_NAME = 'first_name'.freeze, + + # TODO: Write general description for LAST_NAME + LAST_NAME = 'last_name'.freeze, + + # TODO: Write general description for ORGANIZATION + ORGANIZATION = 'organization'.freeze, + + # TODO: Write general description for CUSTOMER_REFERENCE + CUSTOMER_REFERENCE = 'customer_reference'.freeze, + + # TODO: Write general description for SUBSCRIPTION_REFERENCE + SUBSCRIPTION_REFERENCE = 'subscription_reference'.freeze, + + # TODO: Write general description for LAST_FOUR + LAST_FOUR = 'last_four'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + Q_SCOPE.include?(value) + end + + def self.from_value(value, default_value = FULL_NAME) + return default_value if value.nil? + + str = value.to_s.strip + + case str.downcase + when 'full_name' then FULL_NAME + when 'first_name' then FIRST_NAME + when 'last_name' then LAST_NAME + when 'organization' then ORGANIZATION + when 'customer_reference' then CUSTOMER_REFERENCE + when 'subscription_reference' then SUBSCRIPTION_REFERENCE + when 'last_four' then LAST_FOUR + else + default_value + end + end + end +end diff --git a/lib/advanced_billing/models/quantity_based_component.rb b/lib/advanced_billing/models/quantity_based_component.rb index 230d7b7..25bf0b8 100644 --- a/lib/advanced_billing/models/quantity_based_component.rb +++ b/lib/advanced_billing/models/quantity_based_component.rb @@ -10,14 +10,14 @@ class QuantityBasedComponent < BaseModel private_constant :SKIP # A name for this component that is suitable for showing customers and - # displaying on billing statements, ie. "Minutes". + # displaying on billing statements, e.g., "Minutes". # @return [String] attr_accessor :name - # The name of the unit of measurement for the component. It should be - # singular since it will be automatically pluralized when necessary. i.e. + # “The name of the unit of measurement for the component. It should be + # singular since it will be automatically pluralized when necessary. e.g., # “message”, which may then be shown as “5 messages” on a subscription’s - # component line-item + # component line-item.” # @return [String] attr_accessor :unit_name @@ -27,7 +27,7 @@ class QuantityBasedComponent < BaseModel attr_accessor :description # A unique identifier for your use that can be used to retrieve this - # component is subsequent requests. Must start with a letter or number and + # component in subsequent requests. Must start with a letter or number and # may only contain lowercase letters, numbers, or the characters '.', ':', # '-', or '_'. # @return [String] @@ -69,7 +69,7 @@ class QuantityBasedComponent < BaseModel # The amount the customer will be charged per unit when the pricing scheme # is “per_unit”. For On/Off Components, this is the amount that the customer # will be charged when they turn the component on for the subscription. The - # price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :unit_price @@ -110,8 +110,8 @@ class QuantityBasedComponent < BaseModel # @return [Array[Integer]] attr_accessor :public_signup_page_ids - # The numerical interval. i.e. an interval of ‘30’ coupled with an - # interval_unit of day would mean this component's default price point would + # The numerical interval. e.g., an interval of ‘30’ coupled with an + # interval_unit of day would mean this component’s default price point would # renew every 30 days. This property is only available for sites with # Multifrequency enabled. # @return [Integer] @@ -123,6 +123,12 @@ class QuantityBasedComponent < BaseModel # @return [IntervalUnit] attr_accessor :interval_unit + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -145,6 +151,7 @@ def self.names @_hash['public_signup_page_ids'] = 'public_signup_page_ids' @_hash['interval'] = 'interval' @_hash['interval_unit'] = 'interval_unit' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -167,6 +174,7 @@ def self.optionals public_signup_page_ids interval interval_unit + unspsc_code ] end @@ -176,6 +184,7 @@ def self.nullables upgrade_charge downgrade_credit interval_unit + unspsc_code ] end @@ -187,7 +196,8 @@ def initialize(name:, unit_name:, pricing_scheme:, description: SKIP, display_on_hosted_page: SKIP, allow_fractional_quantities: SKIP, public_signup_page_ids: SKIP, interval: SKIP, - interval_unit: SKIP, additional_properties: {}) + interval_unit: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -218,6 +228,7 @@ def initialize(name:, unit_name:, pricing_scheme:, description: SKIP, @public_signup_page_ids = public_signup_page_ids unless public_signup_page_ids == SKIP @interval = interval unless interval == SKIP @interval_unit = interval_unit unless interval_unit == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -271,6 +282,7 @@ def self.from_hash(hash) hash.key?('public_signup_page_ids') ? hash['public_signup_page_ids'] : SKIP interval = hash.key?('interval') ? hash['interval'] : SKIP interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -295,6 +307,7 @@ def self.from_hash(hash) public_signup_page_ids: public_signup_page_ids, interval: interval, interval_unit: interval_unit, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -334,8 +347,8 @@ def to_s " hide_date_range_on_invoice: #{@hide_date_range_on_invoice}, recurring: #{@recurring},"\ " display_on_hosted_page: #{@display_on_hosted_page}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities}, public_signup_page_ids: #{@public_signup_page_ids},"\ - " interval: #{@interval}, interval_unit: #{@interval_unit}, additional_properties:"\ - " #{get_additional_properties}>" + " interval: #{@interval}, interval_unit: #{@interval_unit}, unspsc_code: #{@unspsc_code},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -351,7 +364,8 @@ def inspect " #{@display_on_hosted_page.inspect}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities.inspect}, public_signup_page_ids:"\ " #{@public_signup_page_ids.inspect}, interval: #{@interval.inspect}, interval_unit:"\ - " #{@interval_unit.inspect}, additional_properties: #{get_additional_properties}>" + " #{@interval_unit.inspect}, unspsc_code: #{@unspsc_code.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/reactivate_subscription_request.rb b/lib/advanced_billing/models/reactivate_subscription_request.rb index 23bba4e..09a7bb7 100644 --- a/lib/advanced_billing/models/reactivate_subscription_request.rb +++ b/lib/advanced_billing/models/reactivate_subscription_request.rb @@ -9,7 +9,7 @@ class ReactivateSubscriptionRequest < BaseModel SKIP = Object.new private_constant :SKIP - # These values are only applicable to subscriptions using calendar billing + # These values are only applicable to subscriptions using calendar billing. # @return [ReactivationBilling] attr_accessor :calendar_billing diff --git a/lib/advanced_billing/models/reactivation_billing.rb b/lib/advanced_billing/models/reactivation_billing.rb index 2e544de..2aa9372 100644 --- a/lib/advanced_billing/models/reactivation_billing.rb +++ b/lib/advanced_billing/models/reactivation_billing.rb @@ -4,17 +4,16 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # These values are only applicable to subscriptions using calendar billing + # These values are only applicable to subscriptions using calendar billing. class ReactivationBilling < BaseModel SKIP = Object.new private_constant :SKIP # You may choose how to handle the reactivation charge for that # subscription: 1) `prorated` A prorated charge for the product price will - # be attempted for to complete the period 2) `immediate` A full-price charge - # for the product price will be attempted immediately 3) `delayed` A - # full-price charge for the product price will be attempted at the next - # renewal + # be attempted to complete the period 2) `immediate` A full-price charge for + # the product price will be attempted immediately 3) `delayed` A full-price + # charge for the product price will be attempted at the next renewal. # @return [ReactivationCharge] attr_accessor :reactivation_charge diff --git a/lib/advanced_billing/models/reactivation_charge.rb b/lib/advanced_billing/models/reactivation_charge.rb index 9024803..6bfd2c6 100644 --- a/lib/advanced_billing/models/reactivation_charge.rb +++ b/lib/advanced_billing/models/reactivation_charge.rb @@ -5,10 +5,10 @@ module AdvancedBilling # You may choose how to handle the reactivation charge for that subscription: - # 1) `prorated` A prorated charge for the product price will be attempted for - # to complete the period 2) `immediate` A full-price charge for the product - # price will be attempted immediately 3) `delayed` A full-price charge for the - # product price will be attempted at the next renewal + # 1) `prorated` A prorated charge for the product price will be attempted to + # complete the period 2) `immediate` A full-price charge for the product price + # will be attempted immediately 3) `delayed` A full-price charge for the + # product price will be attempted at the next renewal. class ReactivationCharge REACTIVATION_CHARGE = [ # TODO: Write general description for PRORATED diff --git a/lib/advanced_billing/models/refund_consolidated_invoice.rb b/lib/advanced_billing/models/refund_consolidated_invoice.rb index ff4fcc0..7f04864 100644 --- a/lib/advanced_billing/models/refund_consolidated_invoice.rb +++ b/lib/advanced_billing/models/refund_consolidated_invoice.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Refund consolidated invoice + # Refund consolidated invoice. class RefundConsolidatedInvoice < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/advanced_billing/models/refund_invoice.rb b/lib/advanced_billing/models/refund_invoice.rb index dfacab5..cf4ae88 100644 --- a/lib/advanced_billing/models/refund_invoice.rb +++ b/lib/advanced_billing/models/refund_invoice.rb @@ -32,9 +32,9 @@ class RefundInvoice < BaseModel # @return [TrueClass | FalseClass] attr_accessor :apply_credit - # If `apply_credit` set to false and refunding full amount, if - # `void_invoice` set to true, invoice will be voided after refund. Defaults - # to `false`. + # If `apply_credit` is set to false and refunding full amount, if + # `void_invoice` is set to true, invoice will be voided after refund. + # Defaults to `false`. # @return [TrueClass | FalseClass] attr_accessor :void_invoice diff --git a/lib/advanced_billing/models/refund_invoice_event_data.rb b/lib/advanced_billing/models/refund_invoice_event_data.rb index dc2238f..6a50bb1 100644 --- a/lib/advanced_billing/models/refund_invoice_event_data.rb +++ b/lib/advanced_billing/models/refund_invoice_event_data.rb @@ -15,7 +15,7 @@ class RefundInvoiceEventData < BaseModel attr_accessor :apply_credit # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. @@ -30,7 +30,7 @@ class RefundInvoiceEventData < BaseModel attr_accessor :consolidation_level # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. diff --git a/lib/advanced_billing/models/register.rb b/lib/advanced_billing/models/register.rb index e39d951..a088dcb 100644 --- a/lib/advanced_billing/models/register.rb +++ b/lib/advanced_billing/models/register.rb @@ -22,7 +22,7 @@ class Register < BaseModel attr_accessor :name # The ISO 4217 currency code (3 character string) representing the currency - # of invoice transaction. + # of an invoice transaction. # @return [String] attr_accessor :currency_code diff --git a/lib/advanced_billing/models/renewal_preview_request.rb b/lib/advanced_billing/models/renewal_preview_request.rb index 9bcf155..f363056 100644 --- a/lib/advanced_billing/models/renewal_preview_request.rb +++ b/lib/advanced_billing/models/renewal_preview_request.rb @@ -9,7 +9,7 @@ class RenewalPreviewRequest < BaseModel SKIP = Object.new private_constant :SKIP - # An optional array of component definitions to preview. Providing any + # (Optional) Array of component definitions to preview. Providing any # component definitions here will override the actual components on the # subscription (and their quantities), and the billing preview will contain # only these components (in addition to any product base fees). diff --git a/lib/advanced_billing/models/scheduled_renewal_component_custom_price.rb b/lib/advanced_billing/models/scheduled_renewal_component_custom_price.rb index ffd9cde..599e4e6 100644 --- a/lib/advanced_billing/models/scheduled_renewal_component_custom_price.rb +++ b/lib/advanced_billing/models/scheduled_renewal_component_custom_price.rb @@ -13,7 +13,7 @@ class ScheduledRenewalComponentCustomPrice < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_included - # Omit for On/Off components + # Omit for On/Off components. # @return [PricingScheme] attr_accessor :pricing_scheme diff --git a/lib/advanced_billing/models/scheduled_renewal_item_request_body_component.rb b/lib/advanced_billing/models/scheduled_renewal_item_request_body_component.rb index 1439877..e2e317e 100644 --- a/lib/advanced_billing/models/scheduled_renewal_item_request_body_component.rb +++ b/lib/advanced_billing/models/scheduled_renewal_item_request_body_component.rb @@ -21,7 +21,7 @@ class ScheduledRenewalItemRequestBodyComponent < BaseModel # @return [Integer] attr_accessor :price_point_id - # Optional quantity for the item. + # (Optional) Quantity for the item. # @return [Integer] attr_accessor :quantity diff --git a/lib/advanced_billing/models/scheduled_renewal_item_request_body_product.rb b/lib/advanced_billing/models/scheduled_renewal_item_request_body_product.rb index 13f5529..88afbb4 100644 --- a/lib/advanced_billing/models/scheduled_renewal_item_request_body_product.rb +++ b/lib/advanced_billing/models/scheduled_renewal_item_request_body_product.rb @@ -21,7 +21,7 @@ class ScheduledRenewalItemRequestBodyProduct < BaseModel # @return [Integer] attr_accessor :price_point_id - # Optional quantity for the item. + # (Optional) Quantity for the item. # @return [Integer] attr_accessor :quantity diff --git a/lib/advanced_billing/models/scheduled_renewal_product_price_point.rb b/lib/advanced_billing/models/scheduled_renewal_product_price_point.rb index 7e8ddd1..b5a1f96 100644 --- a/lib/advanced_billing/models/scheduled_renewal_product_price_point.rb +++ b/lib/advanced_billing/models/scheduled_renewal_product_price_point.rb @@ -37,7 +37,7 @@ class ScheduledRenewalProductPricePoint < BaseModel # @return [Integer] attr_accessor :initial_charge_in_cents - # The numerical expiration interval. i.e. an expiration_interval of ‘30’ + # The numerical expiration interval. e.g., an expiration_interval of ‘30’ # coupled with an expiration_interval_unit of day would mean this product # price point would expire after 30 days. # @return [Integer] diff --git a/lib/advanced_billing/models/service_credit1.rb b/lib/advanced_billing/models/service_credit1.rb index 06738cd..0252a16 100644 --- a/lib/advanced_billing/models/service_credit1.rb +++ b/lib/advanced_billing/models/service_credit1.rb @@ -30,7 +30,7 @@ class ServiceCredit1 < BaseModel # @return [String] attr_accessor :memo - # The invoice uid associated with the entry. Only present for debit entries + # The invoice uid associated with the entry. Only present for debit entries. # @return [String] attr_accessor :invoice_uid diff --git a/lib/advanced_billing/models/subscription.rb b/lib/advanced_billing/models/subscription.rb index 444ca3d..0553120 100644 --- a/lib/advanced_billing/models/subscription.rb +++ b/lib/advanced_billing/models/subscription.rb @@ -97,10 +97,10 @@ class Subscription < BaseModel # @return [Integer] attr_accessor :total_revenue_in_cents - # (Added Nov 5 2013) The recurring amount of the product (and - # version),currently subscribed. NOTE: this may differ from the current - # price of,the product, if you’ve changed the price of the product but - # haven’t,moved this subscription to a newer version. + # (Added Nov 5 2013) The recurring amount of the product (and version), + # currently subscribed. NOTE: this may differ from the current price of the + # product, if you’ve changed the price of the product but haven’t moved this + # subscription to a newer version. # @return [Integer] attr_accessor :product_price_in_cents @@ -109,18 +109,18 @@ class Subscription < BaseModel # @return [Integer] attr_accessor :product_version_number - # Timestamp relating to the end of the current (recurring) period (i.e.,when - # the next regularly scheduled attempted charge will occur) + # Timestamp relating to the end of the current (recurring) period (i.e., + # when the next regularly scheduled attempted charge will occur) # @return [DateTime] attr_accessor :current_period_ends_at - # Timestamp that indicates when capture of payment will be tried or,retried. - # This value will usually track the current_period_ends_at, but,will diverge - # if a renewal payment fails and must be retried. In that,case, the - # current_period_ends_at will advance to the end of the next,period (time - # doesn’t stop because a payment was missed) but the,next_assessment_at will - # be scheduled for the auto-retry time (i.e. 24,hours in the future, in some - # cases) + # Timestamp that indicates when capture of payment will be tried or retried. + # This value will usually track the current_period_ends_at, but will diverge + # if a renewal payment fails and must be retried. In that case, the + # current_period_ends_at will advance to the end of the next period (time + # doesn’t stop because a payment was missed) but the next_assessment_at will + # be scheduled for the auto-retry time (e.g., 24 hours in the future, in + # some cases). # @return [DateTime] attr_accessor :next_assessment_at @@ -132,8 +132,8 @@ class Subscription < BaseModel # @return [DateTime] attr_accessor :trial_ended_at - # Timestamp for when the subscription began (i.e. when it came out of trial, - # or when it began in the case of no trial) + # Timestamp for when the subscription began (i.e., when it came out of + # trial, or when it began in the case of no trial) # @return [DateTime] attr_accessor :activated_at @@ -173,7 +173,7 @@ class Subscription < BaseModel # Only valid for webhook payloads The previous state for webhooks that have # indicated a change in state. For normal API calls, this will always be the - # same as the state (current state) + # same as the state (current state). # @return [SubscriptionState] attr_accessor :previous_state @@ -181,8 +181,8 @@ class Subscription < BaseModel # @return [Integer] attr_accessor :signup_payment_id - # The revenue, formatted as a string of decimal separated dollars and,cents, - # from the subscription signup ($50.00 would be formatted as,50.00) + # The revenue, formatted as a string of decimal separated dollars and cents, + # from the subscription signup ($50.00 would be formatted as 50.00) # @return [String] attr_accessor :signup_revenue @@ -271,7 +271,7 @@ class Subscription < BaseModel # @return [Integer] attr_accessor :coupon_uses_allowed - # The churn reason code associated to a cancelled subscription. + # The churn reason code associated to a canceled subscription. # @return [String] attr_accessor :reason_code @@ -329,7 +329,7 @@ class Subscription < BaseModel # @return [Integer] attr_accessor :stored_credential_transaction_id - # The reference value (provided by your app) for the subscription istelf. + # The reference value (provided by your app) for the subscription itself. # @return [String] attr_accessor :reference @@ -339,12 +339,12 @@ class Subscription < BaseModel # Boolean representing whether the subscription is prepaid and currently in # dunning. Only returned for Relationship Invoicing sites with the feature - # enabled + # enabled. # @return [TrueClass | FalseClass] attr_accessor :prepaid_dunning # Additional coupon data. To use this data you also have to include the - # following param in the request`include[]=coupons`. + # following param in the request: `include[]=coupons`. # Only in Read Subscription Endpoint. # @return [Array[SubscriptionIncludedCoupon]] attr_accessor :coupons diff --git a/lib/advanced_billing/models/subscription_component.rb b/lib/advanced_billing/models/subscription_component.rb index ad751f4..9e20e71 100644 --- a/lib/advanced_billing/models/subscription_component.rb +++ b/lib/advanced_billing/models/subscription_component.rb @@ -27,17 +27,17 @@ class SubscriptionComponent < BaseModel attr_accessor :unit_name # (for on/off components) indicates if the component is enabled for the - # subscription + # subscription. # @return [TrueClass | FalseClass] attr_accessor :enabled # (for on/off components) indicates if the component is enabled for the - # subscription - # @return [Integer] + # subscription. + # @return [Object] attr_accessor :unit_balance # (for on/off components) indicates if the component is enabled for the - # subscription + # subscription. # @return [String] attr_accessor :currency @@ -147,22 +147,22 @@ class SubscriptionComponent < BaseModel # @return [TrueClass | FalseClass] attr_accessor :allow_fractional_quantities - # An optional object, will be returned if provided `include=subscription` - # query param. + # (Optional) Object that will be returned if the `include=subscription` + # query param is provided. # @return [SubscriptionComponentSubscription] attr_accessor :subscription - # An optional object, will be returned if provided `include=subscription` - # query param. + # (Optional) Object that will be returned if the `include=subscription` + # query param is provided. # @return [Array[HistoricUsage]] attr_accessor :historic_usages - # An optional object, will be returned if provided `include=subscription` - # query param. + # (Optional) Object that will be returned if the `include=subscription` + # query param is provided. # @return [TrueClass | FalseClass] attr_accessor :display_on_hosted_page - # The numerical interval. i.e. an interval of '30' coupled with an + # The numerical interval. e.g., an interval of '30' coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. @@ -336,7 +336,9 @@ def self.from_hash(hash) kind = hash.key?('kind') ? hash['kind'] : SKIP unit_name = hash.key?('unit_name') ? hash['unit_name'] : SKIP enabled = hash.key?('enabled') ? hash['enabled'] : SKIP - unit_balance = hash.key?('unit_balance') ? hash['unit_balance'] : SKIP + unit_balance = hash.key?('unit_balance') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:SubscriptionComponentUnitBalance), hash['unit_balance'] + ) : SKIP currency = hash.key?('currency') ? hash['currency'] : SKIP allocated_quantity = hash.key?('allocated_quantity') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:SubscriptionComponentAllocatedQuantity), hash['allocated_quantity'] diff --git a/lib/advanced_billing/models/subscription_component_subscription.rb b/lib/advanced_billing/models/subscription_component_subscription.rb index b3ea245..812976a 100644 --- a/lib/advanced_billing/models/subscription_component_subscription.rb +++ b/lib/advanced_billing/models/subscription_component_subscription.rb @@ -5,8 +5,8 @@ require 'date' module AdvancedBilling - # An optional object, will be returned if provided `include=subscription` - # query param. + # (Optional) Object that will be returned if the `include=subscription` query + # param is provided. class SubscriptionComponentSubscription < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/advanced_billing/models/subscription_custom_price.rb b/lib/advanced_billing/models/subscription_custom_price.rb index d2d4734..65de21a 100644 --- a/lib/advanced_billing/models/subscription_custom_price.rb +++ b/lib/advanced_billing/models/subscription_custom_price.rb @@ -43,7 +43,7 @@ class SubscriptionCustomPrice < BaseModel # @return [IntervalUnit] attr_accessor :trial_interval_unit - # Indicates how a trial is handled when the trail period ends and there is + # Indicates how a trial is handled when the trial period ends and there is # no credit card on file. For `no_obligation`, the subscription transitions # to a Trial Ended state. Maxio will not send any emails or statements. For # `payment_expected`, the subscription transitions to a Past Due state. diff --git a/lib/advanced_billing/models/subscription_group_bank_account.rb b/lib/advanced_billing/models/subscription_group_bank_account.rb index 380cb7e..4ed062b 100644 --- a/lib/advanced_billing/models/subscription_group_bank_account.rb +++ b/lib/advanced_billing/models/subscription_group_bank_account.rb @@ -21,18 +21,18 @@ class SubscriptionGroupBankAccount < BaseModel attr_accessor :bank_account_number # (Required when creating a subscription with ACH. Optional when creating a - # subscription with GoCardless). The routing number of the bank. It becomes - # bank_code while passing via GoCardless API + # subscription with GoCardless.) The routing number of the bank. It becomes + # bank_code while passing via GoCardless API. # @return [String] attr_accessor :bank_routing_number # (Optional when creating a subscription with GoCardless). International - # Bank Account Number. Alternatively, local bank details can be provided + # Bank Account Number. Alternatively, local bank details can be provided. # @return [String] attr_accessor :bank_iban # (Optional when creating a subscription with GoCardless) Branch code. - # Alternatively, an IBAN can be provided + # Alternatively, an IBAN can be provided. # @return [String] attr_accessor :bank_branch_code diff --git a/lib/advanced_billing/models/subscription_group_signup_item.rb b/lib/advanced_billing/models/subscription_group_signup_item.rb index 47d98d6..da056f1 100644 --- a/lib/advanced_billing/models/subscription_group_signup_item.rb +++ b/lib/advanced_billing/models/subscription_group_signup_item.rb @@ -29,11 +29,11 @@ class SubscriptionGroupSignupItem < BaseModel # Use in place of passing product and component information to set up the # subscription with an existing offer. May be either the Chargify ID of the - # offer or its handle prefixed with `handle:` + # offer or its handle prefixed with `handle:`. # @return [Integer] attr_accessor :offer_id - # The reference value (provided by your app) for the subscription itelf. + # The reference value (provided by your app) for the subscription itself. # @return [String] attr_accessor :reference @@ -62,7 +62,7 @@ class SubscriptionGroupSignupItem < BaseModel # @return [SubscriptionCustomPrice] attr_accessor :custom_price - # (Optional). Cannot be used when also specifying next_billing_at + # (Optional). Cannot be used when also specifying next_billing_at. # @return [CalendarBilling] attr_accessor :calendar_billing diff --git a/lib/advanced_billing/models/subscription_list_include.rb b/lib/advanced_billing/models/subscription_list_include.rb index b6042e2..0170ada 100644 --- a/lib/advanced_billing/models/subscription_list_include.rb +++ b/lib/advanced_billing/models/subscription_list_include.rb @@ -8,7 +8,19 @@ module AdvancedBilling class SubscriptionListInclude SUBSCRIPTION_LIST_INCLUDE = [ # TODO: Write general description for SELF_SERVICE_PAGE_TOKEN - SELF_SERVICE_PAGE_TOKEN = 'self_service_page_token'.freeze + SELF_SERVICE_PAGE_TOKEN = 'self_service_page_token'.freeze, + + # TODO: Write general description for CURRENT_ACCOUNT_BALANCE_IN_CENTS + CURRENT_ACCOUNT_BALANCE_IN_CENTS = 'current_account_balance_in_cents'.freeze, + + # TODO: Write general description for CURRENT_BILLING_AMOUNT + CURRENT_BILLING_AMOUNT = 'current_billing_amount'.freeze, + + # TODO: Write general description for THREE_DS_ACTION_LINK + THREE_DS_ACTION_LINK = 'three_ds_action_link'.freeze, + + # TODO: Write general description for COUPONS + COUPONS = 'coupons'.freeze ].freeze def self.validate(value) @@ -20,7 +32,17 @@ def self.validate(value) def self.from_value(value, default_value = SELF_SERVICE_PAGE_TOKEN) return default_value if value.nil? - default_value + str = value.to_s.strip + + case str.downcase + when 'self_service_page_token' then SELF_SERVICE_PAGE_TOKEN + when 'current_account_balance_in_cents' then CURRENT_ACCOUNT_BALANCE_IN_CENTS + when 'current_billing_amount' then CURRENT_BILLING_AMOUNT + when 'three_ds_action_link' then THREE_DS_ACTION_LINK + when 'coupons' then COUPONS + else + default_value + end end end end diff --git a/lib/advanced_billing/models/subscription_product_change_scheduled.rb b/lib/advanced_billing/models/subscription_product_change_scheduled.rb new file mode 100644 index 0000000..1a93018 --- /dev/null +++ b/lib/advanced_billing/models/subscription_product_change_scheduled.rb @@ -0,0 +1,162 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +require 'date' +module AdvancedBilling + # SubscriptionProductChangeScheduled Model. + class SubscriptionProductChangeScheduled < BaseModel + SKIP = Object.new + private_constant :SKIP + + # TODO: Write general description for this method + # @return [Integer] + attr_accessor :previous_product_id + + # TODO: Write general description for this method + # @return [Integer] + attr_accessor :new_product_id + + # TODO: Write general description for this method + # @return [Integer] + attr_accessor :previous_product_price_point_id + + # TODO: Write general description for this method + # @return [Integer] + attr_accessor :new_product_price_point_id + + # When the scheduled product change takes effect (the subscription's next + # renewal). + # @return [DateTime] + attr_accessor :effective_at + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['previous_product_id'] = 'previous_product_id' + @_hash['new_product_id'] = 'new_product_id' + @_hash['previous_product_price_point_id'] = + 'previous_product_price_point_id' + @_hash['new_product_price_point_id'] = 'new_product_price_point_id' + @_hash['effective_at'] = 'effective_at' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + previous_product_price_point_id + new_product_price_point_id + effective_at + ] + end + + # An array for nullable fields + def self.nullables + %w[ + previous_product_price_point_id + new_product_price_point_id + effective_at + ] + end + + def initialize(previous_product_id:, new_product_id:, + previous_product_price_point_id: SKIP, + new_product_price_point_id: SKIP, effective_at: SKIP, + additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @previous_product_id = previous_product_id + @new_product_id = new_product_id + unless previous_product_price_point_id == SKIP + @previous_product_price_point_id = + previous_product_price_point_id + end + unless new_product_price_point_id == SKIP + @new_product_price_point_id = + new_product_price_point_id + end + @effective_at = effective_at unless effective_at == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + previous_product_id = + hash.key?('previous_product_id') ? hash['previous_product_id'] : nil + new_product_id = + hash.key?('new_product_id') ? hash['new_product_id'] : nil + previous_product_price_point_id = + hash.key?('previous_product_price_point_id') ? hash['previous_product_price_point_id'] : SKIP + new_product_price_point_id = + hash.key?('new_product_price_point_id') ? hash['new_product_price_point_id'] : SKIP + effective_at = if hash.key?('effective_at') + (DateTimeHelper.from_rfc3339(hash['effective_at']) if hash['effective_at']) + else + SKIP + end + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + SubscriptionProductChangeScheduled.new(previous_product_id: previous_product_id, + new_product_id: new_product_id, + previous_product_price_point_id: previous_product_price_point_id, + new_product_price_point_id: new_product_price_point_id, + effective_at: effective_at, + additional_properties: additional_properties) + end + + def to_custom_effective_at + DateTimeHelper.to_rfc3339(effective_at) + end + + # Validates an instance of the object from a given value. + # @param [SubscriptionProductChangeScheduled | Hash] The value against the validation is performed. + def self.validate(value) + if value.instance_of? self + return ( + APIHelper.valid_type?(value.previous_product_id, + ->(val) { val.instance_of? Integer }) and + APIHelper.valid_type?(value.new_product_id, + ->(val) { val.instance_of? Integer }) + ) + end + + return false unless value.instance_of? Hash + + ( + APIHelper.valid_type?(value['previous_product_id'], + ->(val) { val.instance_of? Integer }) and + APIHelper.valid_type?(value['new_product_id'], + ->(val) { val.instance_of? Integer }) + ) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} previous_product_id: #{@previous_product_id}, new_product_id:"\ + " #{@new_product_id}, previous_product_price_point_id: #{@previous_product_price_point_id},"\ + " new_product_price_point_id: #{@new_product_price_point_id}, effective_at:"\ + " #{@effective_at}, additional_properties: #{get_additional_properties}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} previous_product_id: #{@previous_product_id.inspect}, new_product_id:"\ + " #{@new_product_id.inspect}, previous_product_price_point_id:"\ + " #{@previous_product_price_point_id.inspect}, new_product_price_point_id:"\ + " #{@new_product_price_point_id.inspect}, effective_at: #{@effective_at.inspect},"\ + " additional_properties: #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/subscription_state_filter.rb b/lib/advanced_billing/models/subscription_state_filter.rb index 8e4243c..f2dc643 100644 --- a/lib/advanced_billing/models/subscription_state_filter.rb +++ b/lib/advanced_billing/models/subscription_state_filter.rb @@ -19,9 +19,22 @@ class SubscriptionStateFilter # TODO: Write general description for EXPIRED_CARDS EXPIRED_CARDS = 'expired_cards'.freeze, + # TODO: Write general description for + # ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS + ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS = 'expired_cards_(live_subscriptions)'.freeze, + + # TODO: Write general description for ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS + ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS = 'expired_cards_(all_subscriptions)'.freeze, + # TODO: Write general description for ON_HOLD ON_HOLD = 'on_hold'.freeze, + # TODO: Write general description for AWAITING_SIGNUP + AWAITING_SIGNUP = 'awaiting_signup'.freeze, + + # TODO: Write general description for AWAITING_SIGNUP_DATE + AWAITING_SIGNUP_DATE = 'awaiting_signup_date'.freeze, + # TODO: Write general description for PAST_DUE PAST_DUE = 'past_due'.freeze, @@ -31,6 +44,9 @@ class SubscriptionStateFilter # TODO: Write general description for PENDING_RENEWAL PENDING_RENEWAL = 'pending_renewal'.freeze, + # TODO: Write general description for PREPAID_DUNNING + PREPAID_DUNNING = 'prepaid_dunning'.freeze, + # TODO: Write general description for SUSPENDED SUSPENDED = 'suspended'.freeze, @@ -60,10 +76,15 @@ def self.from_value(value, default_value = ACTIVE) when 'canceled' then CANCELED when 'expired' then EXPIRED when 'expired_cards' then EXPIRED_CARDS + when 'enum_expired_cards_live_subscriptions' then ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS + when 'enum_expired_cards_all_subscriptions' then ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS when 'on_hold' then ON_HOLD + when 'awaiting_signup' then AWAITING_SIGNUP + when 'awaiting_signup_date' then AWAITING_SIGNUP_DATE when 'past_due' then PAST_DUE when 'pending_cancellation' then PENDING_CANCELLATION when 'pending_renewal' then PENDING_RENEWAL + when 'prepaid_dunning' then PREPAID_DUNNING when 'suspended' then SUSPENDED when 'trial_ended' then TRIAL_ENDED when 'trialing' then TRIALING diff --git a/lib/advanced_billing/models/trial_type.rb b/lib/advanced_billing/models/trial_type.rb index 8e66dc5..0b805d7 100644 --- a/lib/advanced_billing/models/trial_type.rb +++ b/lib/advanced_billing/models/trial_type.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Indicates how a trial is handled when the trail period ends and there is no + # Indicates how a trial is handled when the trial period ends and there is no # credit card on file. For `no_obligation`, the subscription transitions to a # Trial Ended state. Maxio will not send any emails or statements. For # `payment_expected`, the subscription transitions to a Past Due state. Maxio diff --git a/lib/advanced_billing/models/update_component.rb b/lib/advanced_billing/models/update_component.rb index 1c3bffc..c788c4f 100644 --- a/lib/advanced_billing/models/update_component.rb +++ b/lib/advanced_billing/models/update_component.rb @@ -13,7 +13,7 @@ class UpdateComponent < BaseModel # @return [String] attr_accessor :handle - # The name of the Component, suitable for display on statements. i.e. Text + # The name of the Component, suitable for display on statements. e.g., Text # Messages. # @return [String] attr_accessor :name @@ -51,6 +51,12 @@ class UpdateComponent < BaseModel # @return [CreditType] attr_accessor :upgrade_charge + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -63,6 +69,7 @@ def self.names @_hash['item_category'] = 'item_category' @_hash['display_on_hosted_page'] = 'display_on_hosted_page' @_hash['upgrade_charge'] = 'upgrade_charge' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -78,6 +85,7 @@ def self.optionals item_category display_on_hosted_page upgrade_charge + unspsc_code ] end @@ -89,13 +97,15 @@ def self.nullables tax_code item_category upgrade_charge + unspsc_code ] end def initialize(handle: SKIP, name: SKIP, description: SKIP, accounting_code: SKIP, taxable: SKIP, tax_code: SKIP, item_category: SKIP, display_on_hosted_page: SKIP, - upgrade_charge: SKIP, additional_properties: {}) + upgrade_charge: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -110,6 +120,7 @@ def initialize(handle: SKIP, name: SKIP, description: SKIP, @item_category = item_category unless item_category == SKIP @display_on_hosted_page = display_on_hosted_page unless display_on_hosted_page == SKIP @upgrade_charge = upgrade_charge unless upgrade_charge == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -129,6 +140,7 @@ def self.from_hash(hash) hash.key?('display_on_hosted_page') ? hash['display_on_hosted_page'] : SKIP upgrade_charge = hash.key?('upgrade_charge') ? hash['upgrade_charge'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -143,6 +155,7 @@ def self.from_hash(hash) item_category: item_category, display_on_hosted_page: display_on_hosted_page, upgrade_charge: upgrade_charge, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -152,7 +165,8 @@ def to_s "<#{class_name} handle: #{@handle}, name: #{@name}, description: #{@description},"\ " accounting_code: #{@accounting_code}, taxable: #{@taxable}, tax_code: #{@tax_code},"\ " item_category: #{@item_category}, display_on_hosted_page: #{@display_on_hosted_page},"\ - " upgrade_charge: #{@upgrade_charge}, additional_properties: #{get_additional_properties}>" + " upgrade_charge: #{@upgrade_charge}, unspsc_code: #{@unspsc_code}, additional_properties:"\ + " #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -162,8 +176,8 @@ def inspect " #{@description.inspect}, accounting_code: #{@accounting_code.inspect}, taxable:"\ " #{@taxable.inspect}, tax_code: #{@tax_code.inspect}, item_category:"\ " #{@item_category.inspect}, display_on_hosted_page: #{@display_on_hosted_page.inspect},"\ - " upgrade_charge: #{@upgrade_charge.inspect}, additional_properties:"\ - " #{get_additional_properties}>" + " upgrade_charge: #{@upgrade_charge.inspect}, unspsc_code: #{@unspsc_code.inspect},"\ + " additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/update_component_price_point.rb b/lib/advanced_billing/models/update_component_price_point.rb index e482d2f..1b5c0d7 100644 --- a/lib/advanced_billing/models/update_component_price_point.rb +++ b/lib/advanced_billing/models/update_component_price_point.rb @@ -32,7 +32,7 @@ class UpdateComponentPricePoint < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_included - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/update_customer.rb b/lib/advanced_billing/models/update_customer.rb index 6aeb389..e0a622a 100644 --- a/lib/advanced_billing/models/update_customer.rb +++ b/lib/advanced_billing/models/update_customer.rb @@ -73,16 +73,23 @@ class UpdateCustomer < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_exempt - # Set a specific language on a customer record. + # Whether surcharging is enabled for the customer. Only applied on sites + # where surcharging control is enabled. + # @return [TrueClass | FalseClass] + attr_accessor :surcharging + + # Whether surcharging is enabled for the customer. Only applied on sites + # where surcharging control is enabled. # @return [String] attr_accessor :tax_exempt_reason - # Set a specific language on a customer record. + # Whether surcharging is enabled for the customer. Only applied on sites + # where surcharging control is enabled. # @return [Integer] attr_accessor :parent_id # Is the customer verified to use ACH as a payment method. Available only on - # Authorize.Net gateway + # the Authorize.Net gateway. # @return [TrueClass | FalseClass] attr_accessor :verified @@ -90,6 +97,13 @@ class UpdateCustomer < BaseModel # @return [String] attr_accessor :salesforce_id + # The ID of the Branding Theme assigned to this customer as the customer's + # default Branding Theme. This customer-level Branding Theme is used when a + # subscription does not have its own subscription-level Branding Theme. + # Available only when Branding Themes are enabled for the site. + # @return [Integer] + attr_accessor :branding_theme_id + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -109,10 +123,12 @@ def self.names @_hash['locale'] = 'locale' @_hash['vat_number'] = 'vat_number' @_hash['tax_exempt'] = 'tax_exempt' + @_hash['surcharging'] = 'surcharging' @_hash['tax_exempt_reason'] = 'tax_exempt_reason' @_hash['parent_id'] = 'parent_id' @_hash['verified'] = 'verified' @_hash['salesforce_id'] = 'salesforce_id' + @_hash['branding_theme_id'] = 'branding_theme_id' @_hash end @@ -135,10 +151,12 @@ def self.optionals locale vat_number tax_exempt + surcharging tax_exempt_reason parent_id verified salesforce_id + branding_theme_id ] end @@ -148,6 +166,7 @@ def self.nullables parent_id verified salesforce_id + branding_theme_id ] end @@ -155,8 +174,9 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, cc_emails: SKIP, organization: SKIP, reference: SKIP, address: SKIP, address_2: SKIP, city: SKIP, state: SKIP, zip: SKIP, country: SKIP, phone: SKIP, locale: SKIP, - vat_number: SKIP, tax_exempt: SKIP, tax_exempt_reason: SKIP, - parent_id: SKIP, verified: SKIP, salesforce_id: SKIP, + vat_number: SKIP, tax_exempt: SKIP, surcharging: SKIP, + tax_exempt_reason: SKIP, parent_id: SKIP, verified: SKIP, + salesforce_id: SKIP, branding_theme_id: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| @@ -179,10 +199,12 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, @locale = locale unless locale == SKIP @vat_number = vat_number unless vat_number == SKIP @tax_exempt = tax_exempt unless tax_exempt == SKIP + @surcharging = surcharging unless surcharging == SKIP @tax_exempt_reason = tax_exempt_reason unless tax_exempt_reason == SKIP @parent_id = parent_id unless parent_id == SKIP @verified = verified unless verified == SKIP @salesforce_id = salesforce_id unless salesforce_id == SKIP + @branding_theme_id = branding_theme_id unless branding_theme_id == SKIP end # Creates an instance of the object from a hash. @@ -206,11 +228,14 @@ def self.from_hash(hash) locale = hash.key?('locale') ? hash['locale'] : SKIP vat_number = hash.key?('vat_number') ? hash['vat_number'] : SKIP tax_exempt = hash.key?('tax_exempt') ? hash['tax_exempt'] : SKIP + surcharging = hash.key?('surcharging') ? hash['surcharging'] : SKIP tax_exempt_reason = hash.key?('tax_exempt_reason') ? hash['tax_exempt_reason'] : SKIP parent_id = hash.key?('parent_id') ? hash['parent_id'] : SKIP verified = hash.key?('verified') ? hash['verified'] : SKIP salesforce_id = hash.key?('salesforce_id') ? hash['salesforce_id'] : SKIP + branding_theme_id = + hash.key?('branding_theme_id') ? hash['branding_theme_id'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -232,10 +257,12 @@ def self.from_hash(hash) locale: locale, vat_number: vat_number, tax_exempt: tax_exempt, + surcharging: surcharging, tax_exempt_reason: tax_exempt_reason, parent_id: parent_id, verified: verified, salesforce_id: salesforce_id, + branding_theme_id: branding_theme_id, additional_properties: additional_properties) end @@ -246,8 +273,9 @@ def to_s " cc_emails: #{@cc_emails}, organization: #{@organization}, reference: #{@reference},"\ " address: #{@address}, address_2: #{@address_2}, city: #{@city}, state: #{@state}, zip:"\ " #{@zip}, country: #{@country}, phone: #{@phone}, locale: #{@locale}, vat_number:"\ - " #{@vat_number}, tax_exempt: #{@tax_exempt}, tax_exempt_reason: #{@tax_exempt_reason},"\ - " parent_id: #{@parent_id}, verified: #{@verified}, salesforce_id: #{@salesforce_id},"\ + " #{@vat_number}, tax_exempt: #{@tax_exempt}, surcharging: #{@surcharging},"\ + " tax_exempt_reason: #{@tax_exempt_reason}, parent_id: #{@parent_id}, verified:"\ + " #{@verified}, salesforce_id: #{@salesforce_id}, branding_theme_id: #{@branding_theme_id},"\ " additional_properties: #{get_additional_properties}>" end @@ -260,9 +288,10 @@ def inspect " address_2: #{@address_2.inspect}, city: #{@city.inspect}, state: #{@state.inspect}, zip:"\ " #{@zip.inspect}, country: #{@country.inspect}, phone: #{@phone.inspect}, locale:"\ " #{@locale.inspect}, vat_number: #{@vat_number.inspect}, tax_exempt:"\ - " #{@tax_exempt.inspect}, tax_exempt_reason: #{@tax_exempt_reason.inspect}, parent_id:"\ - " #{@parent_id.inspect}, verified: #{@verified.inspect}, salesforce_id:"\ - " #{@salesforce_id.inspect}, additional_properties: #{get_additional_properties}>" + " #{@tax_exempt.inspect}, surcharging: #{@surcharging.inspect}, tax_exempt_reason:"\ + " #{@tax_exempt_reason.inspect}, parent_id: #{@parent_id.inspect}, verified:"\ + " #{@verified.inspect}, salesforce_id: #{@salesforce_id.inspect}, branding_theme_id:"\ + " #{@branding_theme_id.inspect}, additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/update_invoice.rb b/lib/advanced_billing/models/update_invoice.rb new file mode 100644 index 0000000..2fbad1b --- /dev/null +++ b/lib/advanced_billing/models/update_invoice.rb @@ -0,0 +1,185 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # Attributes of a draft ad hoc invoice which can be updated. Only the + # submitted attributes are changed. + class UpdateInvoice < BaseModel + SKIP = Object.new + private_constant :SKIP + + # Line item changes to apply. Line items without a `uid` are added, line + # items with a `uid` are updated, and line items with a `uid` and `_destroy` + # set to `true` are removed. Existing line items not referenced in the array + # remain unchanged. + # @return [Array[UpdateInvoiceItem]] + attr_accessor :line_items + + # New issue date for the invoice (format YYYY-MM-DD). This date is + # interpreted and validated in your site's time zone. It must be today or a + # date in the past — future dates are not accepted. The due date is + # recalculated from the issue date and net terms. + # @return [Date] + attr_accessor :issue_date + + # Number of days after the issue date on which the invoice is due. The due + # date is recalculated when net terms or the issue date change. + # @return [Integer] + attr_accessor :net_terms + + # Custom payment instructions displayed on the invoice. + # @return [String] + attr_accessor :payment_instructions + + # A custom memo displayed on the invoice. + # @return [String] + attr_accessor :memo + + # Replaces the seller address on the invoice + # @return [CreateInvoiceAddress] + attr_accessor :seller_address + + # Replaces the billing address on the invoice + # @return [CreateInvoiceAddress] + attr_accessor :billing_address + + # Replaces the shipping address on the invoice + # @return [CreateInvoiceAddress] + attr_accessor :shipping_address + + # When present, replaces all discounts currently applied to the invoice. + # Send an empty array to remove all discounts. + # @return [Array[CreateInvoiceCoupon]] + attr_accessor :coupons + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['line_items'] = 'line_items' + @_hash['issue_date'] = 'issue_date' + @_hash['net_terms'] = 'net_terms' + @_hash['payment_instructions'] = 'payment_instructions' + @_hash['memo'] = 'memo' + @_hash['seller_address'] = 'seller_address' + @_hash['billing_address'] = 'billing_address' + @_hash['shipping_address'] = 'shipping_address' + @_hash['coupons'] = 'coupons' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + line_items + issue_date + net_terms + payment_instructions + memo + seller_address + billing_address + shipping_address + coupons + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(line_items: SKIP, issue_date: SKIP, net_terms: SKIP, + payment_instructions: SKIP, memo: SKIP, seller_address: SKIP, + billing_address: SKIP, shipping_address: SKIP, coupons: SKIP, + additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @line_items = line_items unless line_items == SKIP + @issue_date = issue_date unless issue_date == SKIP + @net_terms = net_terms unless net_terms == SKIP + @payment_instructions = payment_instructions unless payment_instructions == SKIP + @memo = memo unless memo == SKIP + @seller_address = seller_address unless seller_address == SKIP + @billing_address = billing_address unless billing_address == SKIP + @shipping_address = shipping_address unless shipping_address == SKIP + @coupons = coupons unless coupons == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + # Parameter is an array, so we need to iterate through it + line_items = nil + unless hash['line_items'].nil? + line_items = [] + hash['line_items'].each do |structure| + line_items << (UpdateInvoiceItem.from_hash(structure) if structure) + end + end + + line_items = SKIP unless hash.key?('line_items') + issue_date = hash.key?('issue_date') ? hash['issue_date'] : SKIP + net_terms = hash.key?('net_terms') ? hash['net_terms'] : SKIP + payment_instructions = + hash.key?('payment_instructions') ? hash['payment_instructions'] : SKIP + memo = hash.key?('memo') ? hash['memo'] : SKIP + seller_address = CreateInvoiceAddress.from_hash(hash['seller_address']) if + hash['seller_address'] + billing_address = CreateInvoiceAddress.from_hash(hash['billing_address']) if + hash['billing_address'] + shipping_address = CreateInvoiceAddress.from_hash(hash['shipping_address']) if + hash['shipping_address'] + # Parameter is an array, so we need to iterate through it + coupons = nil + unless hash['coupons'].nil? + coupons = [] + hash['coupons'].each do |structure| + coupons << (CreateInvoiceCoupon.from_hash(structure) if structure) + end + end + + coupons = SKIP unless hash.key?('coupons') + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + UpdateInvoice.new(line_items: line_items, + issue_date: issue_date, + net_terms: net_terms, + payment_instructions: payment_instructions, + memo: memo, + seller_address: seller_address, + billing_address: billing_address, + shipping_address: shipping_address, + coupons: coupons, + additional_properties: additional_properties) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} line_items: #{@line_items}, issue_date: #{@issue_date}, net_terms:"\ + " #{@net_terms}, payment_instructions: #{@payment_instructions}, memo: #{@memo},"\ + " seller_address: #{@seller_address}, billing_address: #{@billing_address},"\ + " shipping_address: #{@shipping_address}, coupons: #{@coupons}, additional_properties:"\ + " #{get_additional_properties}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} line_items: #{@line_items.inspect}, issue_date: #{@issue_date.inspect},"\ + " net_terms: #{@net_terms.inspect}, payment_instructions: #{@payment_instructions.inspect},"\ + " memo: #{@memo.inspect}, seller_address: #{@seller_address.inspect}, billing_address:"\ + " #{@billing_address.inspect}, shipping_address: #{@shipping_address.inspect}, coupons:"\ + " #{@coupons.inspect}, additional_properties: #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/update_invoice_item.rb b/lib/advanced_billing/models/update_invoice_item.rb new file mode 100644 index 0000000..c926da7 --- /dev/null +++ b/lib/advanced_billing/models/update_invoice_item.rb @@ -0,0 +1,242 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # A line item change for a draft ad hoc invoice. Supports the same attributes + # as line items on invoice creation, plus `uid` and `_destroy` for updating or + # removing existing line items. + class UpdateInvoiceItem < BaseModel + SKIP = Object.new + private_constant :SKIP + + # TODO: Write general description for this method + # @return [String] + attr_accessor :title + + # The quantity can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or + # 0.00000065. If you submit a value with more than 8 decimal places, we will + # round it down to the 8th decimal place. + # @return [Object] + attr_accessor :quantity + + # The unit_price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or + # 0.00000065. If you submit a value with more than 8 decimal places, we will + # round it down to the 8th decimal place. + # @return [Object] + attr_accessor :unit_price + + # Set to true to automatically calculate taxes. Site must be configured to + # use and calculate taxes. If using AvaTax, a tax_code parameter must also + # be sent. + # @return [TrueClass | FalseClass] + attr_accessor :taxable + + # A string representing the tax code related to the product type. This is + # especially important when using AvaTax to tax based on locale. This + # attribute has a max length of 25 characters. + # @return [String] + attr_accessor :tax_code + + # YYYY-MM-DD + # @return [String] + attr_accessor :period_range_start + + # YYYY-MM-DD + # @return [String] + attr_accessor :period_range_end + + # Product handle or product id. + # @return [Object] + attr_accessor :product_id + + # Component handle or component id. + # @return [Object] + attr_accessor :component_id + + # Price point handle or id. For component. + # @return [Object] + attr_accessor :price_point_id + + # Price point handle or id. For component. + # @return [Object] + attr_accessor :product_price_point_id + + # Price point handle or id. For component. + # @return [String] + attr_accessor :description + + # Unique identifier of an existing line item on the invoice. When provided, + # the matching line item is updated with the submitted attributes. When + # omitted, a new line item is added to the invoice. + # @return [String] + attr_accessor :uid + + # Set to `true` together with `uid` to remove the matching line item from + # the invoice. Line items not referenced in the request remain unchanged. + # @return [TrueClass | FalseClass] + attr_accessor :destroy + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['title'] = 'title' + @_hash['quantity'] = 'quantity' + @_hash['unit_price'] = 'unit_price' + @_hash['taxable'] = 'taxable' + @_hash['tax_code'] = 'tax_code' + @_hash['period_range_start'] = 'period_range_start' + @_hash['period_range_end'] = 'period_range_end' + @_hash['product_id'] = 'product_id' + @_hash['component_id'] = 'component_id' + @_hash['price_point_id'] = 'price_point_id' + @_hash['product_price_point_id'] = 'product_price_point_id' + @_hash['description'] = 'description' + @_hash['uid'] = 'uid' + @_hash['destroy'] = '_destroy' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + title + quantity + unit_price + taxable + tax_code + period_range_start + period_range_end + product_id + component_id + price_point_id + product_price_point_id + description + uid + destroy + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(title: SKIP, quantity: SKIP, unit_price: SKIP, taxable: SKIP, + tax_code: SKIP, period_range_start: SKIP, + period_range_end: SKIP, product_id: SKIP, component_id: SKIP, + price_point_id: SKIP, product_price_point_id: SKIP, + description: SKIP, uid: SKIP, destroy: SKIP, + additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @title = title unless title == SKIP + @quantity = quantity unless quantity == SKIP + @unit_price = unit_price unless unit_price == SKIP + @taxable = taxable unless taxable == SKIP + @tax_code = tax_code unless tax_code == SKIP + @period_range_start = period_range_start unless period_range_start == SKIP + @period_range_end = period_range_end unless period_range_end == SKIP + @product_id = product_id unless product_id == SKIP + @component_id = component_id unless component_id == SKIP + @price_point_id = price_point_id unless price_point_id == SKIP + @product_price_point_id = product_price_point_id unless product_price_point_id == SKIP + @description = description unless description == SKIP + @uid = uid unless uid == SKIP + @destroy = destroy unless destroy == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + title = hash.key?('title') ? hash['title'] : SKIP + quantity = hash.key?('quantity') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:UpdateInvoiceItemQuantity), hash['quantity'] + ) : SKIP + unit_price = hash.key?('unit_price') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:UpdateInvoiceItemUnitPrice), hash['unit_price'] + ) : SKIP + taxable = hash.key?('taxable') ? hash['taxable'] : SKIP + tax_code = hash.key?('tax_code') ? hash['tax_code'] : SKIP + period_range_start = + hash.key?('period_range_start') ? hash['period_range_start'] : SKIP + period_range_end = + hash.key?('period_range_end') ? hash['period_range_end'] : SKIP + product_id = hash.key?('product_id') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:UpdateInvoiceItemProductId), hash['product_id'] + ) : SKIP + component_id = hash.key?('component_id') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:UpdateInvoiceItemComponentId), hash['component_id'] + ) : SKIP + price_point_id = hash.key?('price_point_id') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:UpdateInvoiceItemPricePointId), hash['price_point_id'] + ) : SKIP + product_price_point_id = hash.key?('product_price_point_id') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:UpdateInvoiceItemProductPricePointId), hash['product_price_point_id'] + ) : SKIP + description = hash.key?('description') ? hash['description'] : SKIP + uid = hash.key?('uid') ? hash['uid'] : SKIP + destroy = hash.key?('_destroy') ? hash['_destroy'] : SKIP + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + UpdateInvoiceItem.new(title: title, + quantity: quantity, + unit_price: unit_price, + taxable: taxable, + tax_code: tax_code, + period_range_start: period_range_start, + period_range_end: period_range_end, + product_id: product_id, + component_id: component_id, + price_point_id: price_point_id, + product_price_point_id: product_price_point_id, + description: description, + uid: uid, + destroy: destroy, + additional_properties: additional_properties) + end + + # Validates an instance of the object from a given value. + # @param [UpdateInvoiceItem | Hash] The value against the validation is performed. + def self.validate(value) + return true if value.instance_of? self + + return false unless value.instance_of? Hash + + true + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} title: #{@title}, quantity: #{@quantity}, unit_price: #{@unit_price},"\ + " taxable: #{@taxable}, tax_code: #{@tax_code}, period_range_start: #{@period_range_start},"\ + " period_range_end: #{@period_range_end}, product_id: #{@product_id}, component_id:"\ + " #{@component_id}, price_point_id: #{@price_point_id}, product_price_point_id:"\ + " #{@product_price_point_id}, description: #{@description}, uid: #{@uid}, destroy:"\ + " #{@destroy}, additional_properties: #{get_additional_properties}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} title: #{@title.inspect}, quantity: #{@quantity.inspect}, unit_price:"\ + " #{@unit_price.inspect}, taxable: #{@taxable.inspect}, tax_code: #{@tax_code.inspect},"\ + " period_range_start: #{@period_range_start.inspect}, period_range_end:"\ + " #{@period_range_end.inspect}, product_id: #{@product_id.inspect}, component_id:"\ + " #{@component_id.inspect}, price_point_id: #{@price_point_id.inspect},"\ + " product_price_point_id: #{@product_price_point_id.inspect}, description:"\ + " #{@description.inspect}, uid: #{@uid.inspect}, destroy: #{@destroy.inspect},"\ + " additional_properties: #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/update_invoice_request.rb b/lib/advanced_billing/models/update_invoice_request.rb new file mode 100644 index 0000000..b70f353 --- /dev/null +++ b/lib/advanced_billing/models/update_invoice_request.rb @@ -0,0 +1,71 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # Request payload for updating a draft ad hoc invoice. + class UpdateInvoiceRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # Attributes of a draft ad hoc invoice which can be updated. Only the + # submitted attributes are changed. + # @return [UpdateInvoice] + attr_accessor :invoice + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['invoice'] = 'invoice' + @_hash + end + + # An array for optional fields + def self.optionals + [] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(invoice:, additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @invoice = invoice + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + invoice = UpdateInvoice.from_hash(hash['invoice']) if hash['invoice'] + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + UpdateInvoiceRequest.new(invoice: invoice, + additional_properties: additional_properties) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} invoice: #{@invoice}, additional_properties: #{get_additional_properties}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} invoice: #{@invoice.inspect}, additional_properties:"\ + " #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/update_payment_profile.rb b/lib/advanced_billing/models/update_payment_profile.rb index f4807b9..01793ab 100644 --- a/lib/advanced_billing/models/update_payment_profile.rb +++ b/lib/advanced_billing/models/update_payment_profile.rb @@ -27,12 +27,12 @@ class UpdatePaymentProfile < BaseModel # (Optional when performing an Import via vault_token, required otherwise) # The 1- or 2-digit credit card expiration month, as an integer or string, - # i.e. 5 + # e.g., 5 # @return [String] attr_accessor :expiration_month - # (Optional when performing a Import via vault_token, required otherwise) - # The 4-digit credit card expiration year, as an integer or string, i.e. + # (Optional when performing an Import via vault_token, required otherwise) + # The 4-digit credit card expiration year, as an integer or string, e.g., # 2012 # @return [String] attr_accessor :expiration_year @@ -42,17 +42,17 @@ class UpdatePaymentProfile < BaseModel # @return [AllVaults] attr_accessor :current_vault - # The credit card or bank account billing street address (i.e. 123 Main + # The credit card or bank account billing street address (e.g., 123 Main # St.). This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_address - # The credit card or bank account billing address city (i.e. “Boston”). This - # value is merely passed through to the payment gateway. + # The credit card or bank account billing address city (e.g., “Boston”). + # This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_city - # The credit card or bank account billing address state (i.e. MA). This + # The credit card or bank account billing address state (e.g., MA). This # value is merely passed through to the payment gateway. This must conform # to the # [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in @@ -60,21 +60,21 @@ class UpdatePaymentProfile < BaseModel # @return [String] attr_accessor :billing_state - # The credit card or bank account billing address zip code (i.e. 12345). + # The credit card or bank account billing address zip code (e.g., 12345). # This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_zip # The credit card or bank account billing address country, required in # [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) - # format (i.e. “US”). This value is merely passed through to the payment + # format (e.g., “US”). This value is merely passed through to the payment # gateway. Some gateways require country codes in a specific format. Check # your gateway’s documentation. If creating an ACH subscription, only US is # supported at this time. # @return [String] attr_accessor :billing_country - # Second line of the customer’s billing address i.e. Apt. 100 + # Second line of the customer’s billing address, e.g., Apt. 100 # @return [String] attr_accessor :billing_address_2 diff --git a/lib/advanced_billing/models/update_price.rb b/lib/advanced_billing/models/update_price.rb index e2ce006..dfb6ae0 100644 --- a/lib/advanced_billing/models/update_price.rb +++ b/lib/advanced_billing/models/update_price.rb @@ -17,17 +17,17 @@ class UpdatePrice < BaseModel # @return [Object] attr_accessor :ending_quantity - # The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :unit_price - # The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [TrueClass | FalseClass] attr_accessor :destroy - # The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :starting_quantity diff --git a/lib/advanced_billing/models/update_subscription.rb b/lib/advanced_billing/models/update_subscription.rb index 3b59fc1..b2f597b 100644 --- a/lib/advanced_billing/models/update_subscription.rb +++ b/lib/advanced_billing/models/update_subscription.rb @@ -15,15 +15,15 @@ class UpdateSubscription < BaseModel attr_accessor :credit_card_attributes # Set to the handle of a different product to change the subscription's - # product + # product. # @return [String] attr_accessor :product_handle - # Set to the id of a different product to change the subscription's product + # Set to the id of a different product to change the subscription's product. # @return [Integer] attr_accessor :product_id - # Set to the id of a different product to change the subscription's product + # Set to the id of a different product to change the subscription's product. # @return [TrueClass | FalseClass] attr_accessor :product_change_delayed @@ -43,7 +43,7 @@ class UpdateSubscription < BaseModel # (Optional) Set this attribute to a future date/time to update a # subscription in the Awaiting Signup Date state, to Awaiting Signup. In the # Awaiting Signup state, a subscription behaves like any other. It can be - # canceled, allocated to, or have its billing date changed. etc. When the + # canceled, allocated to, or have its billing date changed, etc. When the # `initial_billing_at` date hits, the subscription will transition to the # expected state. If the product has a trial, the subscription will enter a # trial, otherwise it will go active. Setup fees will be respected either @@ -81,6 +81,15 @@ class UpdateSubscription < BaseModel # @return [DateTime] attr_accessor :next_billing_at + # The ID of the Branding Theme to assign to this subscription. When set, + # this subscription-level Branding Theme is used instead of the customer's + # default Branding Theme for subscription-related documents and + # communications that use subscription theming. Pass null or an empty value + # to clear the subscription-level Branding Theme. Available only when + # Branding Themes are enabled for the site. Not returned in the response. + # @return [Integer] + attr_accessor :branding_theme_id + # Timestamp giving the expiration date of this subscription (if any). You # may manually change the expiration date at any point during a subscription # period. @@ -159,6 +168,7 @@ def self.names @_hash['initial_billing_at'] = 'initial_billing_at' @_hash['defer_signup'] = 'defer_signup' @_hash['next_billing_at'] = 'next_billing_at' + @_hash['branding_theme_id'] = 'branding_theme_id' @_hash['expires_at'] = 'expires_at' @_hash['payment_collection_method'] = 'payment_collection_method' @_hash['receives_invoice_emails'] = 'receives_invoice_emails' @@ -190,6 +200,7 @@ def self.optionals initial_billing_at defer_signup next_billing_at + branding_theme_id expires_at payment_collection_method receives_invoice_emails @@ -208,6 +219,7 @@ def self.optionals # An array for nullable fields def self.nullables %w[ + branding_theme_id dunning_communication_delay_time_zone ] end @@ -216,7 +228,8 @@ def initialize(credit_card_attributes: SKIP, product_handle: SKIP, product_id: SKIP, product_change_delayed: SKIP, next_product_id: SKIP, next_product_price_point_id: SKIP, snap_day: SKIP, initial_billing_at: SKIP, - defer_signup: false, next_billing_at: SKIP, expires_at: SKIP, + defer_signup: false, next_billing_at: SKIP, + branding_theme_id: SKIP, expires_at: SKIP, payment_collection_method: SKIP, receives_invoice_emails: SKIP, net_terms: SKIP, stored_credential_transaction_id: SKIP, reference: SKIP, @@ -243,6 +256,7 @@ def initialize(credit_card_attributes: SKIP, product_handle: SKIP, @initial_billing_at = initial_billing_at unless initial_billing_at == SKIP @defer_signup = defer_signup unless defer_signup == SKIP @next_billing_at = next_billing_at unless next_billing_at == SKIP + @branding_theme_id = branding_theme_id unless branding_theme_id == SKIP @expires_at = expires_at unless expires_at == SKIP unless payment_collection_method == SKIP @payment_collection_method = @@ -302,6 +316,8 @@ def self.from_hash(hash) else SKIP end + branding_theme_id = + hash.key?('branding_theme_id') ? hash['branding_theme_id'] : SKIP expires_at = if hash.key?('expires_at') (DateTimeHelper.from_rfc3339(hash['expires_at']) if hash['expires_at']) else @@ -352,6 +368,7 @@ def self.from_hash(hash) initial_billing_at: initial_billing_at, defer_signup: defer_signup, next_billing_at: next_billing_at, + branding_theme_id: branding_theme_id, expires_at: expires_at, payment_collection_method: payment_collection_method, receives_invoice_emails: receives_invoice_emails, @@ -397,15 +414,15 @@ def to_s " #{@product_change_delayed}, next_product_id: #{@next_product_id},"\ " next_product_price_point_id: #{@next_product_price_point_id}, snap_day: #{@snap_day},"\ " initial_billing_at: #{@initial_billing_at}, defer_signup: #{@defer_signup},"\ - " next_billing_at: #{@next_billing_at}, expires_at: #{@expires_at},"\ - " payment_collection_method: #{@payment_collection_method}, receives_invoice_emails:"\ - " #{@receives_invoice_emails}, net_terms: #{@net_terms}, stored_credential_transaction_id:"\ - " #{@stored_credential_transaction_id}, reference: #{@reference}, custom_price:"\ - " #{@custom_price}, components: #{@components}, dunning_communication_delay_enabled:"\ - " #{@dunning_communication_delay_enabled}, dunning_communication_delay_time_zone:"\ - " #{@dunning_communication_delay_time_zone}, product_price_point_id:"\ - " #{@product_price_point_id}, product_price_point_handle: #{@product_price_point_handle},"\ - " additional_properties: #{get_additional_properties}>" + " next_billing_at: #{@next_billing_at}, branding_theme_id: #{@branding_theme_id},"\ + " expires_at: #{@expires_at}, payment_collection_method: #{@payment_collection_method},"\ + " receives_invoice_emails: #{@receives_invoice_emails}, net_terms: #{@net_terms},"\ + " stored_credential_transaction_id: #{@stored_credential_transaction_id}, reference:"\ + " #{@reference}, custom_price: #{@custom_price}, components: #{@components},"\ + " dunning_communication_delay_enabled: #{@dunning_communication_delay_enabled},"\ + " dunning_communication_delay_time_zone: #{@dunning_communication_delay_time_zone},"\ + " product_price_point_id: #{@product_price_point_id}, product_price_point_handle:"\ + " #{@product_price_point_handle}, additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -416,15 +433,16 @@ def inspect " #{@product_change_delayed.inspect}, next_product_id: #{@next_product_id.inspect},"\ " next_product_price_point_id: #{@next_product_price_point_id.inspect}, snap_day:"\ " #{@snap_day.inspect}, initial_billing_at: #{@initial_billing_at.inspect}, defer_signup:"\ - " #{@defer_signup.inspect}, next_billing_at: #{@next_billing_at.inspect}, expires_at:"\ - " #{@expires_at.inspect}, payment_collection_method: #{@payment_collection_method.inspect},"\ - " receives_invoice_emails: #{@receives_invoice_emails.inspect}, net_terms:"\ - " #{@net_terms.inspect}, stored_credential_transaction_id:"\ - " #{@stored_credential_transaction_id.inspect}, reference: #{@reference.inspect},"\ - " custom_price: #{@custom_price.inspect}, components: #{@components.inspect},"\ - " dunning_communication_delay_enabled: #{@dunning_communication_delay_enabled.inspect},"\ - " dunning_communication_delay_time_zone: #{@dunning_communication_delay_time_zone.inspect},"\ - " product_price_point_id: #{@product_price_point_id.inspect}, product_price_point_handle:"\ + " #{@defer_signup.inspect}, next_billing_at: #{@next_billing_at.inspect}, branding_theme_id:"\ + " #{@branding_theme_id.inspect}, expires_at: #{@expires_at.inspect},"\ + " payment_collection_method: #{@payment_collection_method.inspect}, receives_invoice_emails:"\ + " #{@receives_invoice_emails.inspect}, net_terms: #{@net_terms.inspect},"\ + " stored_credential_transaction_id: #{@stored_credential_transaction_id.inspect}, reference:"\ + " #{@reference.inspect}, custom_price: #{@custom_price.inspect}, components:"\ + " #{@components.inspect}, dunning_communication_delay_enabled:"\ + " #{@dunning_communication_delay_enabled.inspect}, dunning_communication_delay_time_zone:"\ + " #{@dunning_communication_delay_time_zone.inspect}, product_price_point_id:"\ + " #{@product_price_point_id.inspect}, product_price_point_handle:"\ " #{@product_price_point_handle.inspect}, additional_properties:"\ " #{get_additional_properties}>" end diff --git a/lib/advanced_billing/models/webhook.rb b/lib/advanced_billing/models/webhook.rb index d29c526..c7dd8c4 100644 --- a/lib/advanced_billing/models/webhook.rb +++ b/lib/advanced_billing/models/webhook.rb @@ -14,7 +14,7 @@ class Webhook < BaseModel # @return [String] attr_accessor :event - # The unique identifier for the webhooks (unique across all of Chargify). + # The unique identifier for the webhook (unique across all of Chargify). # This is not changed on a retry/replay of the same webhook, so it may be # used to avoid duplicate action for the same event. # @return [Integer] @@ -50,9 +50,10 @@ class Webhook < BaseModel # @return [String] attr_accessor :last_sent_url - # A boolean flag describing whether the webhook was accepted by the webhook + # “A boolean flag describing whether the webhook was accepted by the webhook # endpoint for the most recent attempt. (Acceptance is defined by receiving - # a “200 OK” HTTP response within a reasonable timeframe, i.e. 15 seconds) + # a “200 OK” HTTP response within a reasonable timeframe, e.g., 15 + # seconds.)” # @return [TrueClass | FalseClass] attr_accessor :successful diff --git a/lib/advanced_billing/models/webhook_subscription.rb b/lib/advanced_billing/models/webhook_subscription.rb index 7b79899..6672fb9 100644 --- a/lib/advanced_billing/models/webhook_subscription.rb +++ b/lib/advanced_billing/models/webhook_subscription.rb @@ -97,6 +97,10 @@ class WebhookSubscription # TODO: Write general description for SUBSCRIPTION_PRODUCT_CHANGE SUBSCRIPTION_PRODUCT_CHANGE = 'subscription_product_change'.freeze, + # TODO: Write general description for + # SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED + SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED = 'subscription_product_change_scheduled'.freeze, + # TODO: Write general description for SUBSCRIPTION_STATE_CHANGE SUBSCRIPTION_STATE_CHANGE = 'subscription_state_change'.freeze, @@ -166,6 +170,7 @@ def self.from_value(value, default_value = BILLING_DATE_CHANGE) when 'subscription_card_update' then SUBSCRIPTION_CARD_UPDATE when 'subscription_group_card_update' then SUBSCRIPTION_GROUP_CARD_UPDATE when 'subscription_product_change' then SUBSCRIPTION_PRODUCT_CHANGE + when 'subscription_product_change_scheduled' then SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED when 'subscription_state_change' then SUBSCRIPTION_STATE_CHANGE when 'trial_end_notice' then TRIAL_END_NOTICE when 'upcoming_renewal_notice' then UPCOMING_RENEWAL_NOTICE diff --git a/lib/advanced_billing/utilities/union_type_lookup.rb b/lib/advanced_billing/utilities/union_type_lookup.rb index b4b8710..f30089a 100644 --- a/lib/advanced_billing/utilities/union_type_lookup.rb +++ b/lib/advanced_billing/utilities/union_type_lookup.rb @@ -124,6 +124,16 @@ def self.union_types ] ), + :ListSubscriptionsInputProduct => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + :CreateUsageSubscriptionIdOrReference => OneOf.new( [ LeafType.new(Integer), @@ -565,6 +575,16 @@ def self.union_types ) ), + :CreateSubscriptionComponentUnitBalance => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + :CreateSubscriptionComponentAllocatedQuantity => OneOf.new( [ LeafType.new(Integer), @@ -617,6 +637,7 @@ def self.union_types :EventEventSpecificData => OneOf.new( [ LeafType.new(SubscriptionProductChange), + LeafType.new(SubscriptionProductChangeScheduled), LeafType.new(SubscriptionStateChange), LeafType.new(PaymentRelatedEvents), LeafType.new(RefundSuccess), @@ -642,6 +663,13 @@ def self.union_types ) ), + :GetOneTimeTokenRequestPaymentProfile => AnyOf.new( + [ + LeafType.new(GetOneTimeTokenPaymentProfile), + LeafType.new(GetOneTimeTokenBankAccountPaymentProfile) + ] + ), + :IssueServiceCreditAmount => OneOf.new( [ LeafType.new(Float), @@ -672,6 +700,13 @@ def self.union_types ) ), + :MeteredUsageNewUnitBalance => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) + ] + ), + :OnOffComponentUnitPrice => OneOf.new( [ LeafType.new(String), @@ -720,6 +755,20 @@ def self.union_types ] ), + :PrepaidUsageNewUnitBalance => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) + ] + ), + + :PrepaidUsageNewOverageUnitBalance => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) + ] + ), + :PrepaidUsageComponentUnitPrice => OneOf.new( [ LeafType.new(String), @@ -894,6 +943,16 @@ def self.union_types ) ), + :SubscriptionComponentUnitBalance => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + :SubscriptionComponentAllocatedQuantity => OneOf.new( [ LeafType.new(Integer), @@ -1036,6 +1095,66 @@ def self.union_types ) ), + :UpdateInvoiceItemQuantity => OneOf.new( + [ + LeafType.new(Float), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + + :UpdateInvoiceItemUnitPrice => OneOf.new( + [ + LeafType.new(Float), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + + :UpdateInvoiceItemProductId => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Integer) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + + :UpdateInvoiceItemComponentId => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Integer) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + + :UpdateInvoiceItemPricePointId => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Integer) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + + :UpdateInvoiceItemProductPricePointId => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Integer) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + :UpdateMetafieldsRequestMetafields => OneOf.new( [ LeafType.new(UpdateMetafield), From 5204b2f31c66f582f6621d5bfbb5d9b4599db8ee Mon Sep 17 00:00:00 2001 From: lucassus Date: Wed, 12 Aug 2026 16:04:29 +0000 Subject: [PATCH 7/9] Automated commit message --- doc/models/bank-account-payment-profile.md | 1 + .../models/bank_account_payment_profile.rb | 24 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/doc/models/bank-account-payment-profile.md b/doc/models/bank-account-payment-profile.md index c3171ad..69b7e20 100644 --- a/doc/models/bank-account-payment-profile.md +++ b/doc/models/bank-account-payment-profile.md @@ -24,6 +24,7 @@ | `billing_address_2` | `String` | Optional | The current billing street address, second line, for the bank account | | `bank_name` | `String` | Optional | The bank where the account resides | | `masked_bank_routing_number` | `String` | Optional | A string representation of the stored bank routing number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account. | +| `masked_bank_account_number` | `String` | Optional | A string representation of the stored bank account number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). | | `bank_account_type` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | | `bank_account_holder_type` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType::BANK_ACCOUNT` | diff --git a/lib/advanced_billing/models/bank_account_payment_profile.rb b/lib/advanced_billing/models/bank_account_payment_profile.rb index 843850f..4580a58 100644 --- a/lib/advanced_billing/models/bank_account_payment_profile.rb +++ b/lib/advanced_billing/models/bank_account_payment_profile.rb @@ -78,6 +78,11 @@ class BankAccountPaymentProfile < BaseModel # @return [String] attr_accessor :masked_bank_routing_number + # A string representation of the stored bank account number with all but the + # last 4 digits marked with X's (i.e. 'XXXXXXX1111'). + # @return [String] + attr_accessor :masked_bank_account_number + # Defaults to checking # @return [BankAccountType] attr_accessor :bank_account_type @@ -131,6 +136,7 @@ def self.names @_hash['billing_address_2'] = 'billing_address_2' @_hash['bank_name'] = 'bank_name' @_hash['masked_bank_routing_number'] = 'masked_bank_routing_number' + @_hash['masked_bank_account_number'] = 'masked_bank_account_number' @_hash['bank_account_type'] = 'bank_account_type' @_hash['bank_account_holder_type'] = 'bank_account_holder_type' @_hash['payment_type'] = 'payment_type' @@ -160,6 +166,7 @@ def self.optionals billing_address_2 bank_name masked_bank_routing_number + masked_bank_account_number bank_account_type bank_account_holder_type verified @@ -181,6 +188,7 @@ def self.nullables customer_vault_token billing_address_2 masked_bank_routing_number + masked_bank_account_number site_gateway_setting_id gateway_handle ] @@ -193,7 +201,8 @@ def initialize(payment_type: PaymentType::BANK_ACCOUNT, id: SKIP, billing_state: SKIP, billing_zip: SKIP, billing_country: SKIP, customer_vault_token: SKIP, billing_address_2: SKIP, bank_name: SKIP, - masked_bank_routing_number: SKIP, bank_account_type: SKIP, + masked_bank_routing_number: SKIP, + masked_bank_account_number: SKIP, bank_account_type: SKIP, bank_account_holder_type: SKIP, verified: false, site_gateway_setting_id: SKIP, gateway_handle: SKIP, created_at: SKIP, updated_at: SKIP, @@ -221,6 +230,10 @@ def initialize(payment_type: PaymentType::BANK_ACCOUNT, id: SKIP, @masked_bank_routing_number = masked_bank_routing_number end + unless masked_bank_account_number == SKIP + @masked_bank_account_number = + masked_bank_account_number + end @bank_account_type = bank_account_type unless bank_account_type == SKIP @bank_account_holder_type = bank_account_holder_type unless bank_account_holder_type == SKIP @payment_type = payment_type @@ -257,6 +270,8 @@ def self.from_hash(hash) bank_name = hash.key?('bank_name') ? hash['bank_name'] : SKIP masked_bank_routing_number = hash.key?('masked_bank_routing_number') ? hash['masked_bank_routing_number'] : SKIP + masked_bank_account_number = + hash.key?('masked_bank_account_number') ? hash['masked_bank_account_number'] : SKIP bank_account_type = hash.key?('bank_account_type') ? hash['bank_account_type'] : SKIP bank_account_holder_type = @@ -297,6 +312,7 @@ def self.from_hash(hash) billing_address_2: billing_address_2, bank_name: bank_name, masked_bank_routing_number: masked_bank_routing_number, + masked_bank_account_number: masked_bank_account_number, bank_account_type: bank_account_type, bank_account_holder_type: bank_account_holder_type, verified: verified, @@ -338,7 +354,8 @@ def to_s " billing_state: #{@billing_state}, billing_zip: #{@billing_zip}, billing_country:"\ " #{@billing_country}, customer_vault_token: #{@customer_vault_token}, billing_address_2:"\ " #{@billing_address_2}, bank_name: #{@bank_name}, masked_bank_routing_number:"\ - " #{@masked_bank_routing_number}, bank_account_type: #{@bank_account_type},"\ + " #{@masked_bank_routing_number}, masked_bank_account_number:"\ + " #{@masked_bank_account_number}, bank_account_type: #{@bank_account_type},"\ " bank_account_holder_type: #{@bank_account_holder_type}, payment_type: #{@payment_type},"\ " verified: #{@verified}, site_gateway_setting_id: #{@site_gateway_setting_id},"\ " gateway_handle: #{@gateway_handle}, created_at: #{@created_at}, updated_at:"\ @@ -355,7 +372,8 @@ def inspect " #{@billing_state.inspect}, billing_zip: #{@billing_zip.inspect}, billing_country:"\ " #{@billing_country.inspect}, customer_vault_token: #{@customer_vault_token.inspect},"\ " billing_address_2: #{@billing_address_2.inspect}, bank_name: #{@bank_name.inspect},"\ - " masked_bank_routing_number: #{@masked_bank_routing_number.inspect}, bank_account_type:"\ + " masked_bank_routing_number: #{@masked_bank_routing_number.inspect},"\ + " masked_bank_account_number: #{@masked_bank_account_number.inspect}, bank_account_type:"\ " #{@bank_account_type.inspect}, bank_account_holder_type:"\ " #{@bank_account_holder_type.inspect}, payment_type: #{@payment_type.inspect}, verified:"\ " #{@verified.inspect}, site_gateway_setting_id: #{@site_gateway_setting_id.inspect},"\ From 9b80bb0153d3bfe11928e39a44e3854c276a261f Mon Sep 17 00:00:00 2001 From: lucassus Date: Wed, 12 Aug 2026 19:04:07 +0000 Subject: [PATCH 8/9] Automated commit message --- doc/controllers/advance-invoice.md | 16 +- doc/controllers/api-exports.md | 6 +- doc/controllers/billing-portal.md | 24 +-- doc/controllers/components.md | 14 +- doc/controllers/coupons.md | 45 ++--- doc/controllers/customers.md | 19 +- .../events-based-billing-segments.md | 4 +- doc/controllers/events.md | 58 +++---- doc/controllers/invoices.md | 23 +-- doc/controllers/offers.md | 6 +- doc/controllers/payment-profiles.md | 8 +- doc/controllers/product-families.md | 2 +- doc/controllers/products.md | 6 +- doc/controllers/proforma-invoices.md | 2 +- doc/controllers/reason-codes.md | 12 +- doc/controllers/referral-codes.md | 8 +- doc/controllers/sites.md | 17 +- doc/controllers/subscription-components.md | 20 +-- doc/controllers/subscription-groups.md | 14 +- doc/controllers/subscription-notes.md | 6 +- doc/controllers/subscription-products.md | 8 +- doc/controllers/subscription-status.md | 14 +- doc/controllers/subscriptions.md | 32 ++-- .../containers/event-event-specific-data.md | 16 +- doc/models/event-response.md | 5 +- doc/models/event.md | 7 +- .../subscription-product-change-scheduled.md | 29 ---- doc/models/subscription-product-change.md | 10 +- lib/advanced_billing.rb | 1 - .../controllers/advance_invoice_controller.rb | 37 ++-- .../controllers/api_exports_controller.rb | 5 +- .../controllers/billing_portal_controller.rb | 50 +++--- .../controllers/components_controller.rb | 25 +-- .../controllers/coupons_controller.rb | 70 +++----- .../controllers/customers_controller.rb | 47 +++-- ...vents_based_billing_segments_controller.rb | 6 +- .../controllers/events_controller.rb | 68 ++++---- .../controllers/invoices_controller.rb | 27 +-- .../controllers/offers_controller.rb | 10 +- .../payment_profiles_controller.rb | 18 +- .../product_families_controller.rb | 5 +- .../controllers/products_controller.rb | 8 +- .../proforma_invoices_controller.rb | 9 +- .../controllers/reason_codes_controller.rb | 11 +- .../controllers/referral_codes_controller.rb | 12 +- .../controllers/sites_controller.rb | 22 +-- .../subscription_components_controller.rb | 38 ++-- .../subscription_groups_controller.rb | 3 +- .../subscription_notes_controller.rb | 12 +- .../subscription_products_controller.rb | 22 ++- .../subscription_status_controller.rb | 34 ++-- .../controllers/subscriptions_controller.rb | 79 ++++----- lib/advanced_billing/models/event.rb | 5 +- .../models/subscription_product_change.rb | 70 +++++++- .../subscription_product_change_scheduled.rb | 162 ------------------ .../utilities/union_type_lookup.rb | 1 - 56 files changed, 504 insertions(+), 784 deletions(-) delete mode 100644 doc/models/subscription-product-change-scheduled.md delete mode 100644 lib/advanced_billing/models/subscription_product_change_scheduled.rb diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index fb90bb3..d5307fd 100644 --- a/doc/controllers/advance-invoice.md +++ b/doc/controllers/advance-invoice.md @@ -17,10 +17,13 @@ advance_invoice_controller = client.advance_invoice # Issue Advance Invoice -Issues an invoice in advance for a subscription's next renewal date. [See our docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility for generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided. -A subscription may only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists will return an error. -That said, regeneration of the invoice may be forced with the params `force: true`, which will void an advance invoice if one exists and generate a new one. If no advance invoice exists, a new one will be generated. -We recommend using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it. +Issues an invoice in advance for a subscription's next renewal date. For the most part, advance invoices function like any other invoice, except they are issued early and have special behavior upon being voided. For more information on advance invoices, including eligibility for generating one, see [Issue Invoice In Advance](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance). + +A subscription can only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists returns an error. + +Regeneration of the invoice can be forced with the params `force: true`, which voids an advance invoice if one exists and generates a new one. If no advance invoice exists, a new one is generated. + +Consider using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it. ```ruby def issue_advance_invoice(subscription_id, @@ -111,7 +114,10 @@ puts result # Void Advance Invoice Voids a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. -A `reason` is required in order to void, and the invoice must have an open status. Voiding will cause any prepayments and credits that were applied to the invoice to be returned to the subscription. For a full overview of the impact of voiding, [see our help docs](../../doc/models/invoice.md). + +A `reason` is required to void, and the invoice must have an open status. Voiding causes any prepayments and credits that were applied to the invoice to be returned to the subscription. + +For a full overview of the impact of voiding, see [Invoice](../../doc/models/invoice.md). ```ruby def void_advance_invoice(subscription_id, diff --git a/doc/controllers/api-exports.md b/doc/controllers/api-exports.md index 26f89c8..e7dafbb 100644 --- a/doc/controllers/api-exports.md +++ b/doc/controllers/api-exports.md @@ -167,9 +167,7 @@ puts result # Export Proforma Invoices -Creates a proforma invoices export and returns a batch job object. - -It is only available for Relationship Invoicing architecture. +Creates a proforma invoices export and returns a batch job object. Proforma invoices are only available on Relationship Invoicing sites. ```ruby def export_proforma_invoices @@ -267,7 +265,7 @@ puts result # Read Proforma Invoices Export -Returns a batch job object for a proforma invoices export. +Returns a batch job object for a proforma invoices export. Proforma invoices are only available on Relationship Invoicing sites. ```ruby def read_proforma_invoices_export(batch_id) diff --git a/doc/controllers/billing-portal.md b/doc/controllers/billing-portal.md index 746af4b..2483e6f 100644 --- a/doc/controllers/billing-portal.md +++ b/doc/controllers/billing-portal.md @@ -20,21 +20,15 @@ billing_portal_controller = client.billing_portal Enables Billing Portal access for a customer, with an option to send an invitation email at the same time. -## Billing Portal Documentation - -Full documentation on how the Billing Portal operates within the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview). - -This documentation is focused on how to configure the Billing Portal Settings, as well as Subscriber Interaction and Merchant Management of the Billing Portal. - -You can use this endpoint to enable Billing Portal access for a Customer, with the option of sending the Customer an Invitation email at the same time. - ## Billing Portal Security -If your customer has been invited to the Billing Portal, then they will receive a link to manage their subscription (the “Management URL”) automatically at the bottom of their statements, invoices, and receipts. **This link changes periodically for security and is only valid for 65 days.** +If your customer has been invited to the Billing Portal, they receive a link to manage their subscription (the “Management URL”) automatically at the bottom of their statements, invoices, and receipts. **This link changes periodically for security and is only valid for 65 days.** + +If you need to provide your customer their Management URL through other means, you can retrieve it [via the API](../../doc/controllers/billing-portal.md#read-billing-portal-link). Because the URL is cryptographically signed with a timestamp, merchants cannot generate the URL without requesting it through the API. -If you need to provide your customer their Management URL through other means, you can retrieve it via the API. Because the URL is cryptographically signed with a timestamp, it is not possible for merchants to generate the URL without requesting it from Advanced Billing. +To prevent abuse and overuse, request a new URL only when absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as much as possible. If you use the URL frequently (such as to display on your website), **do not** make an API request every time. -In order to prevent abuse & overuse, we ask that you request a new URL only when absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as much as possible. If you use the URL frequently (such as to display on your website), **do not** make an API request to Advanced Billing every time. +For more information configuring the Billing Portal, see [Billing Portal Overview](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview). ```ruby def enable_billing_portal_for_customer(customer_id, @@ -78,13 +72,13 @@ puts result Returns the exact URL required for a subscriber to access the Billing Portal. -## Rules for Management Link API +## Management Link Request Rules -+ When retrieving a management URL, multiple requests for the same customer in a short period will return the **same** URL -+ We will not generate a new URL for 15 days ++ When retrieving a management URL, multiple requests for the same customer in a short period return the **same** URL ++ A new URL is not generated for 15 days + You must cache and remember this URL if you are going to need it again within 15 days + Only request a new URL after the `new_link_available_at` date -+ You are limited to 15 requests for the same URL. If you make more than 15 requests before `new_link_available_at`, you will be blocked from further Management URL requests (with a response code `429`). ++ You are limited to 15 requests for the same URL. If you make more than 15 requests before `new_link_available_at`, you are blocked from further Management URL requests (with a response code `429`). ```ruby def read_billing_portal_link(customer_id) diff --git a/doc/controllers/components.md b/doc/controllers/components.md index 7bfbb67..180558b 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -151,7 +151,7 @@ puts result Creates a Quantity Based component definition under the specified product family. A Quantity Based component can then be added and “allocated” for a subscription. -When defining a Quantity Based component, you can choose one of 2 types: +When defining a Quantity Based component, you can choose one of two types: #### Recurring @@ -163,6 +163,8 @@ One-time quantity-based components are used to create ad hoc usage charges that The allocated quantity for one-time quantity-based components immediately gets reset back to zero after the allocation is made. +For more information, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + #### Hybrid Pricing A `volume`, `tiered`, or `stairstep` component can combine its primary pricing with a secondary pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item instead of two. See [Hybrid Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and configuration details. @@ -386,11 +388,11 @@ puts result Creates a prepaid usage component definition under the specified product family. A prepaid component can then be added and “allocated” for a subscription. -Prepaid components allow customers to pre-purchase units that can be used up over time on their subscription. In a sense, they are the mirror image of metered components; while metered components charge at the end of the period for the amount of units used, prepaid components are charged for at the time of purchase, and we subsequently keep track of the usage against the amount purchased. +Prepaid components allow customers to pre-purchase units that can be used up over time on their subscription. In a sense, they are the mirror image of metered components; while metered components charge at the end of the period for the amount of units used, prepaid components are charged for at the time of purchase, and usage is subsequently tracked against the amount purchased. -For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +For more information, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). -If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`; sending a blank value results in a validation error. ```ruby def create_prepaid_usage_component(product_family_id, @@ -531,9 +533,9 @@ Event-based components are similar to other component types, in that you define So, instead of reporting usage directly for each component (as you would with metered components), the usage is derived from analysis of your events. -For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +For more information, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). -If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`; sending a blank value results in a validation error. ```ruby def create_event_based_component(product_family_id, diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index 8767410..09c16fd 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -250,9 +250,9 @@ puts result # Find Coupon -Searches for a coupon by code, returning a 404 if no coupon is found. By passing a code parameter, the find will attempt to locate a coupon that matches that code. +Searches for a coupon by code. -If you have more than one product family and if the coupon you are trying to find does not belong to the default product family in your site, then you will need to specify (either in the url or as a query string param) the product family id. +If you have more than one product family and if the coupon you are trying to find does not belong to the default product family in your site, you need to specify (either in the URL or as a query string param) the `product_family_id`. ```ruby def find_coupon(product_family_id: nil, @@ -290,10 +290,11 @@ puts result # Read Coupon -Returns a coupon by its Advanced Billing-assigned ID. You must identify the Coupon in this call by the ID parameter that Advanced Billing assigns. -If instead you would like to find a Coupon using a Coupon code, see the Coupon Find method. +Returns a coupon by its system-assigned ID. You must identify the Coupon in this call by the ID parameter assigned to it. -If the coupon is set to `use_site_exchange_rate: true`, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. +If instead you would like to find a Coupon using a Coupon code, use the [Find Coupon](../../doc/controllers/coupons.md#find-coupon) endpoint. + +If the coupon is set to `use_site_exchange_rate: true`, it returns pricing based on the current exchange rate. If the flag is set to false, it returns all of the defined prices for each currency. ```ruby def read_coupon(product_family_id, @@ -723,23 +724,17 @@ puts result # Validate Coupon -Verifies whether a specific coupon code is valid. This method is useful for validating coupon codes that are entered by a customer. If the coupon is found and is valid, the coupon will be returned with a 200 status code. - -If the coupon is invalid, the status code will be 404 and the response will say why it is invalid. If the coupon is valid, the status code will be 200 and the coupon will be returned. The following reasons for invalidity are supported: - -+ Coupon not found -+ Coupon is invalid -+ Coupon expired +Verifies whether a specific coupon code is valid. This method is useful for validating coupon codes that are entered by a customer. -If you have more than one product family and if the coupon you are validating does not belong to the first product family in your site, then you will need to specify the product family, either in the url or as a query string param. This can be done by supplying the id or the handle in the `handle:my-family` format. +If you have more than one product family and if the coupon you are validating does not belong to the first product family in your site, you need to specify the product family, either in the URL or as a query string param. This can be done by supplying the id or the handle in the `handle:my-family` format. -Eg. +Supplying the `product_family_handle` in the URL: ``` https://.chargify.com/product_families/handle:/coupons/validate.?code= ``` -Or: +Supplying the `product_family_id` as a query parameter: ``` https://.chargify.com/coupons/validate.?code=&product_family_id= @@ -876,8 +871,6 @@ puts result Creates subcodes for an existing coupon. -## Coupon Subcodes Intro - Coupon Subcodes allow you to create a set of unique codes that allow you to expand the use of one coupon. For example: @@ -892,21 +885,9 @@ Coupon Subcodes: + DP80302 + SPRINGBALTIMORE -Coupon subcodes can be administered in the Admin Interface or via the API. - -When creating a coupon subcode, you must specify a coupon to attach it to using the coupon_id. Valid coupon subcodes are all capital letters, contain only letters and numbers, and do not have any spaces. Lowercase letters will be capitalized before the subcode is created. - -## Coupon Subcodes Documentation +When creating a coupon subcode, you must specify a coupon to attach it to using the coupon_id. Valid coupon subcodes are all capital letters, contain only letters and numbers, and do not have any spaces. Lowercase letters are capitalized before the subcode is created. -Full documentation on how to create coupon subcodes in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes). - -Additionally, for documentation on how to apply a coupon to a Subscription within the Advanced Billing UI, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). - -## Create Coupon Subcode - -This request allows you to create specific subcodes underneath an existing coupon code. - -*Note*: If you are using any of the allowed special characters ("%", "@", "+", "-", "_", and "."), you must encode them for use in the URL. +Note: If you are using any of the allowed special characters ("%", "@", "+", "-", "_", and "."), you must encode them for use in the URL. % to %25 @ to %40 @@ -917,6 +898,8 @@ This request allows you to create specific subcodes underneath an existing coupo So, if the coupon subcode is `20%OFF`, the URL to delete this coupon subcode would be: `https://.chargify.com/coupons/567/codes/20%25OFF.`. +For more information on coupon codes and applying coupons to subscriptions, see [Coupon Codes](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes) and [Coupons and Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). + ```ruby def create_coupon_subcodes(coupon_id, body: nil) diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index 0f04524..02563a9 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -21,30 +21,29 @@ customers_controller = client.customers # Create Customer -Creates a new customer; can also be created alongside a new subscription. The only validation restriction is that you may only create one customer for a given reference value. +Creates a new customer; can also be created alongside a new subscription. The only validation restriction is that you can only create one customer for a given reference value. -If provided, the `reference` value must be unique. It represents a unique identifier for the customer from your own app, i.e. the customer’s ID. This allows you to retrieve a given customer via a piece of shared information. Alternatively, you may choose to leave `reference` blank, and store Advanced Billing’s unique ID for the customer, which is in the `id` attribute. +If provided, the `reference` value must be unique. It represents a unique identifier for the customer from your own app, i.e. the customer’s ID. This allows you to retrieve a given customer via a piece of shared information. Alternatively, you can choose to leave `reference` blank, and store the system-assigned unique ID for the customer, which is in the `id` attribute. -Full documentation on how to locate, create and edit Customers in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-Details). +For more information, see [Customer Details](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-Details). ## Required Country Format -Advanced Billing requires that you use the ISO Standard Country codes when formatting country attribute of the customer. +Format the country attribute of the customer using the ISO Standard Country codes. -Countries should be formatted as 2 characters. For more information, see the following wikipedia article on [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) +Countries should be formatted as two characters. For more information, see [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes). ## Required State Format -Advanced Billing requires that you use the ISO Standard State codes when formatting state attribute of the customer. +Format the state attribute of the customer using the ISO Standard State codes. -+ US States (2 characters): [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) ++ US States (two characters): see [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US). -+ States Outside the US (2-3 characters): To find the correct state codes outside of the US, go to [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in the “ISO 3166-2 codes” column next to country you wish to populate. ++ States Outside the US (two to three characters): To find the correct state codes outside the US, go to [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in the “ISO 3166-2 codes” column next to the country you wish to populate. ## Locale -Advanced Billing allows you to attribute a language/region to your customer to deliver invoices in any required language. -For more: [Customer Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Customer-Locale) +You can attribute a language/region to the customer to deliver invoices in any required language. For more information, see [Customer Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Customer-Locale). ```ruby def create_customer(body: nil) diff --git a/doc/controllers/events-based-billing-segments.md b/doc/controllers/events-based-billing-segments.md index e6a8752..98fef5e 100644 --- a/doc/controllers/events-based-billing-segments.md +++ b/doc/controllers/events-based-billing-segments.md @@ -149,9 +149,9 @@ puts result # Update Segment -Updates a single segment for a component with a segmented metric. It allows you to update the pricing for the segment. +Updates a single segment for a component with a segmented metric. You can also update the pricing for the segment. -You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. +You can specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. ```ruby def update_segment(component_id, diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 93bb000..1dc6259 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -19,29 +19,11 @@ events_controller = client.events Lists events for a site. -## Events Intro +Events include various activity that happens around a Site. This information is **especially** useful to track down issues that arise when subscriptions are not created due to errors. -Advanced Billing Events include various activity that happens around a Site. This information is **especially** useful to track down issues that arise when subscriptions are not created due to errors. +Within the UI, Events are referred to as Site Activity. For more information, see [Site Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). -Within the Advanced Billing UI, "Events" are referred to as "Site Activity". See the [Site Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity) article in the product documentation for details on how to record view Events / Site Activty in the Advanced Billing UI. - -If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. - -Event name changes: - -- subscription_product_change → subscription_plan_change -- component_allocation_change → allocation_change -- component_billing_date_change → product_billing_date_change - -Message updates: - -- “Plan changed on Subscription from previous plan to new plan” -- “Successful payment for allocation changes to Product on Subscription” -- “Failed payment for allocation changes to Product on Subscription” - -## List Events for a Site - -This method will retrieve a list of events for a site. Use query string filters to narrow down results. You may use the `key` filter as part of your query string to narrow down results. +Use query string filters to narrow down results. You can use the `filter` parameter to filter by event key. ### Legacy Filters @@ -56,7 +38,7 @@ The following keys are no longer supported. ## Event Key -The event type is identified by the key property. You can check supported keys [here](../../doc/models/event-key.md). +The event type is identified by the key property. See [Event Key](../../doc/models/event-key.md) for a complete list of supported keys. ## Event Specific Data @@ -102,6 +84,22 @@ Here’s an example event for the `subscription_state_change` event: } ``` +## Enhanced Catalog Experience + +If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + +Event name changes: + +- subscription_product_change → subscription_plan_change +- component_allocation_change → allocation_change +- component_billing_date_change → product_billing_date_change + +Message updates: + +- “Plan changed on Subscription from previous plan to new plan” +- “Successful payment for allocation changes to Product on Subscription” +- “Failed payment for allocation changes to Product on Subscription” + ```ruby def list_events(options = {}) ``` @@ -219,7 +217,15 @@ Lists events for a subscription. ## Event Key -The event type is identified by the key property. You can check supported keys [here](../../doc/models/event-key.md). +The event type is identified by the key property. See [Event Key](../../doc/models/event-key.md) for a complete list of supported keys. + +## Event Specific Data + +Different event types may include additional data in `event_specific_data` property. +While some events share the same schema for `event_specific_data`, others may not include it at all. +For precise mappings from key to event_specific_data, refer to [Event](../../doc/models/event.md). + +## Enhanced Catalog Experience If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. @@ -235,12 +241,6 @@ Message updates: - “Failed payment for allocation changes to Product on Subscription” - “Plan changed on Subscription from previous plan to new plan” -## Event Specific Data - -Different event types may include additional data in `event_specific_data` property. -While some events share the same schema for `event_specific_data`, others may not include it at all. -For precise mappings from key to event_specific_data, refer to [Event](../../doc/models/event.md). - ```ruby def list_subscription_events(options = {}) ``` diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index a5148bd..44350a2 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -1060,7 +1060,7 @@ puts result # Record Payment for Invoice -Applies a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the Bulk Payment endpoint. +Applies a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the [Record Payment for Multiple Invoices](../../doc/controllers/invoices.md#record-payment-for-multiple-invoices) endpoint. ```ruby def record_payment_for_invoice(uid, @@ -1118,27 +1118,6 @@ Records an external payment against multiple invoices. To apply a payment to multiple invoices, at minimum, specify the `amount` and `applications` (i.e., `invoice_uid` and `amount`) details. -``` -{ - "payment": { - "memo": "to pay the bills", - "details": "check number 8675309", - "method": "check", - "amount": "250.00", - "applications": [ - { - "invoice_uid": "inv_8gk5bwkct3gqt", - "amount": "100.00" - }, - { - "invoice_uid": "inv_7bc6bwkct3lyt", - "amount": "150.00" - } - ] - } -} -``` - Note that the invoice payment amounts must be greater than 0. Total amount must be greater or equal to invoices payment amount sum. ```ruby diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index efab388..683e770 100644 --- a/doc/controllers/offers.md +++ b/doc/controllers/offers.md @@ -19,15 +19,13 @@ offers_controller = client.offers # Create Offer -Creates an offer within your Advanced Billing site. - -## Documentation +Creates an offer within your site. Offers allow you to package complicated combinations of products, components and coupons into a convenient package which can then be subscribed to just like products. Once an offer is defined it can be used as an alternative to the product when creating subscriptions. -Full documentation on how to use offers in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overview). +For more information, see [Offers](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overview) in the product documentation. ## Using a Product Price Point diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index a4b728a..ef42307 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -133,7 +133,7 @@ puts result # List Payment Profiles -Lists all active payment profiles for a site, or for one customer within a site. If no payment profiles are found, this endpoint will return an empty array, not a 404. +Lists all active payment profiles for a site, or for one customer within a site. If no payment profiles are found, this endpoint returns an empty array. ```ruby def list_payment_profiles(options = {}) @@ -457,7 +457,7 @@ puts result Deletes an unused payment profile. -If the payment profile is in use by one or more subscriptions or groups, a 422 and error message will be returned. +If the payment profile is in use by one or more subscriptions or groups, an error message is returned. ```ruby def delete_unused_payment_profile(payment_profile_id) @@ -499,9 +499,9 @@ payment_profiles_controller.delete_unused_payment_profile(payment_profile_id) Deletes a payment profile belonging to the customer on the subscription. -+ If the customer has multiple subscriptions, the payment profile will be removed from all of them. +If the customer has multiple subscriptions, the payment profile is removed from all of them. -+ If you delete the default payment profile for a subscription, you will need to specify another payment profile to be the default through the api, or either prompt the user to enter a card in the billing portal or on the self-service page, or visit the Payment Details tab on the subscription in the Admin UI and use the “Add New Credit Card” or “Make Active Payment Method” link, (depending on whether there are other cards present). +If you delete the default payment profile for a subscription, you need to specify another payment profile to be the default through the API, or either prompt the user to enter a card in the billing portal or on the self-service page, or visit the Payment Details tab on the subscription in the Admin UI and use the “Add New Credit Card” or “Make Active Payment Method” link, (depending on whether there are other cards present). ```ruby def delete_subscriptions_payment_profile(subscription_id, diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index 6cee36a..0bda901 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -180,7 +180,7 @@ puts result # Create Product Family -Creates a Product Family within your Advanced Billing site. Create a Product Family to act as a container for your products, components, and coupons. +Creates a Product Family within your site. Create a Product Family to act as a container for your products, components, and coupons. Full documentation on how Product Families operate within the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Product-Families). diff --git a/doc/controllers/products.md b/doc/controllers/products.md index 20955f4..364c37f 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -20,13 +20,13 @@ products_controller = client.products # Create Product -Creates a product in your Advanced Billing site. +Creates a product in your site. If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, the `auto_create_signup_page` parameter is not supported. If `auto_create_signup_page` is included (with any value) an error is returned. -See the following product documentation for more information: +For more information, see: -+ [Products Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) ++ [Products Overview](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) + [Changing a Subscription's Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations) ```ruby diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 926f074..2ded2f1 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -24,7 +24,7 @@ proforma_invoices_controller = client.proforma_invoices # Create Consolidated Proforma Invoice -Creates a consolidated proforma invoice asynchronously. It will return a 201 with no message, or a 422 with any errors. To find and view the new consolidated proforma invoice, you may poll the subscription group listing for proforma invoices; only one consolidated proforma invoice may be created per group at a time. +Creates a consolidated proforma invoice asynchronously. To find and view the new consolidated proforma invoice, you can poll the subscription group listing for proforma invoices; only one consolidated proforma invoice can be created per group at a time. If the information becomes outdated, simply void the old consolidated proforma invoice and generate a new one. diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index 231ca64..d4904aa 100644 --- a/doc/controllers/reason-codes.md +++ b/doc/controllers/reason-codes.md @@ -21,21 +21,11 @@ reason_codes_controller = client.reason_codes Creates a reason code for a given site. -# Reason Codes Intro - Reason Codes are a way to gain a high-level view of why your customers are cancelling the subscription to your product or service. Add a set of churn reason codes to be displayed in-app and/or the Maxio Billing Portal. As your subscribers decide to cancel their subscription, learn why they decided to cancel. -## Reason Code Documentation - -Full documentation on how Reason Codes operate within Advanced Billing can be located under the following links. - -[Churn Reason Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Reason-Codes) - -## Create Reason Code - -This method gives a merchant the option to create reason codes for a given site. +For more information, see [Churn Reason Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Reason-Codes). ```ruby def create_reason_code(body: nil) diff --git a/doc/controllers/referral-codes.md b/doc/controllers/referral-codes.md index f358057..f5c5b67 100644 --- a/doc/controllers/referral-codes.md +++ b/doc/controllers/referral-codes.md @@ -13,13 +13,7 @@ referral_codes_controller = client.referral_codes Validates whether a referral code is valid and applicable within your site. This method is useful for validating referral codes that are entered by a customer. -## Referrals Documentation - -Full documentation on how to use the referrals feature in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/sections/24286965611405-Referrals). - -## Server Response - -If the referral code is valid the status code will be `200` and the referral code will be returned. If the referral code is invalid, a `404` response will be returned. +For more information, see [Understanding Referrals](https://docs.maxio.com/hc/en-us/articles/24286981223693-Understanding-Referrals) in the product documentation. ```ruby def validate_referral_code(code) diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index 03db5e7..0520ab2 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -19,20 +19,19 @@ sites_controller = client.sites Retrieves site data. -Full documentation on Sites in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites). - -Specifically, the [Clearing Site Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-Site-Data) section is relevant to this endpoint documentation. +For more information, see [Sites](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites) in the product documentation. Specifically, the [Clearing Site Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-Site-Data) section is relevant to this endpoint. #### Relationship invoicing enabled -If the site has RI enabled then you will see more settings like: +If the site has Relationship invoicing enabled, additional properties are returned in the response: - "customer_hierarchy_enabled": true, - "whopays_enabled": true, - "whopays_default_payer": "self" +``` +"customer_hierarchy_enabled": true, +"whopays_enabled": true, +"whopays_default_payer": "self" +``` -You can read more about these settings here: -[Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays). +For more information, see [Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays). ```ruby def read_site diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index 0a64e28..893eada 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -1313,13 +1313,13 @@ puts result Activates an event-based component for a single subscription. -In order to bill your subscribers on your Events data under the Events-Based Billing feature, the components must be activated for the subscriber. +To bill your subscribers on your Events data under the Events-Based Billing feature, the components must be activated for the subscriber. -Learn more about the role of activation in the [Events-Based Billing docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Based-Billing-Overview). +For more information, see [Design Your Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). -Use this endpoint to activate an event-based component for a single subscription. Activating an event-based component causes Advanced Billing to bill for events when the subscription is renewed. +Use this endpoint to activate an event-based component for a single subscription. Activating an event-based component causes billing for events when the subscription is renewed. -*Note: it is possible to stream events for a subscription at any time, regardless of component activation status. The activation status only determines if the subscription should be billed for event-based component usage at renewal.* +Note: it is possible to stream events for a subscription at any time, regardless of component activation status. The activation status only determines if the subscription should be billed for event-based component usage at renewal. ```ruby def activate_event_based_component(subscription_id, @@ -1424,21 +1424,15 @@ subscription_components_controller.deactivate_event_based_component( Records a single event for Events-Based Billing. -## Documentation - Events-Based Billing is an evolved form of metered billing that is based on data-rich events streamed in real-time from your system to Advanced Billing. These events can then be transformed, enriched, or analyzed to form the computed totals of usage charges billed to your customers. This API allows you to stream events into the Advanced Billing data ingestion engine. -Learn more about the feature in general in the [Events-Based Billing help docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Based-Billing-Overview). - -## Record Event - -Use this endpoint to record a single event. +For more information, see [Design Your Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). -*Note: this endpoint differs from the standard Chargify API endpoints in that the URL subdomain will be `events` and your site subdomain will be included in the URL path. For example:* +Note: this endpoint differs from the standard URL for this API in that `events` and your site subdomain are included in the path. For example: ``` https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle @@ -1495,7 +1489,7 @@ subscription_components_controller.record_event( Records a collection of events. -*Note: this endpoint differs from the standard Chargify API endpoints in that the subdomain will be `events` and your site subdomain will be included in the URL path.* +Note: this endpoint differs from the standard URL for this API in that `events` and your site subdomain are included in the path. A maximum of 1000 events can be published in a single request. A 422 will be returned if this limit is exceeded. diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index 83a4c40..dd34cba 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -310,9 +310,9 @@ puts result "current_billing_amount_in_cents": 11500, "customer": { "first_name": "Mark", - "last_name": "Wannabewahlberg", - "organization": "The Funky Bunch", - "email": "markymark@example.com", + "last_name": "Smith", + "organization": "Acme Inc.", + "email": "smith@example.com", "reference": "4c92223b-bc16-4d0d-87ff-b177a89a2655" }, "account_balances": { @@ -464,7 +464,7 @@ puts result Finds the subscription group associated with a subscription. -If the subscription is not in a group, the endpoint will return a 404 code. +If the subscription is not in a group, this endpoint returns an error. ```ruby def find_subscription_group(subscription_id) @@ -514,9 +514,9 @@ puts result "cancel_at_end_of_period": false, "customer": { "first_name": "Mark", - "last_name": "Wannabewahlberg", - "organization": "The Funky Bunch", - "email": "markymark@example.com", + "last_name": "Smith", + "organization": "Acme Inc.", + "email": "smith@example.com", "reference": "4c92223b-bc16-4d0d-87ff-b177a89a2655" }, "account_balances": { diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index 6ec186e..3d0285c 100644 --- a/doc/controllers/subscription-notes.md +++ b/doc/controllers/subscription-notes.md @@ -21,13 +21,11 @@ subscription_notes_controller = client.subscription_notes Creates a note for a subscription. -## How to Use Subscription Notes - Notes allow you to record information about a particular Subscription in a free text format. -If you have structured data such as birth date, color, etc., consider using Metadata instead. +If you have structured data such as birth date, color, etc., consider using [Metadata](../../doc/controllers/custom-fields.md#create-metadata) instead. -Full documentation on how to use Notes in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24251712214413-Subscription-Summary-Overview). +For more information, see [Adding Notes](https://docs.maxio.com/hc/en-us/articles/24251654953997-Understanding-the-Subscription-Summary-Page#billing-portal-status:~:text=documentation%20for%20more.-,Adding%20Notes,-Notes%20are%20optional) in the product documentation. ```ruby def create_subscription_note(subscription_id, diff --git a/doc/controllers/subscription-products.md b/doc/controllers/subscription-products.md index d9bacd6..4ab9ee7 100644 --- a/doc/controllers/subscription-products.md +++ b/doc/controllers/subscription-products.md @@ -18,17 +18,15 @@ subscription_products_controller = client.subscription_products Migrates a subscription to a different product. -In order to create a migration, you must pass the `product_id` or `product_handle` in the object when you send a POST request. You may also pass either a `product_price_point_id` or `product_price_point_handle` to choose which price point the subscription is moved to. If no price point identifier is passed the subscription will be moved to the products default price point. The response will be the updated subscription. +To create a migration, you must pass the `product_id` or `product_handle` in the object when you send a POST request. You can also pass either a `product_price_point_id` or `product_price_point_handle` to choose which price point the subscription is moved to. If no price point identifier is passed, the subscription is moved to the product's default price point. The response is the updated subscription. ## Valid Subscriptions -Subscriptions should be in the `active` or `trialing` state in order to be migrated. +Subscriptions should be in the `active` or `trialing` state to be migrated. (For backwards compatibility reasons, it is possible to migrate a subscription that is in the `trial_ended` state via the API, however this is not recommended. Since `trial_ended` is an end-of-life state, the subscription should be canceled, the product changed, and then the subscription can be reactivated.) -## Migrations Documentation - -Full documentation on how to record Migrations in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24181589372429-Data-Migration-to-Advanced-Billing). +For more information, see [Product Changes and Migrations](https://docs.maxio.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations). ## Failed Migrations diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index 2c3f946..4ac306f 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -1344,26 +1344,26 @@ puts result Previews a subscription’s next renewal assessment. Renewal Preview is an object representing a subscription’s next assessment. You can retrieve it to see a snapshot of how much your customer will be charged on their next renewal. -The "Next Billing" amount and "Next Billing" date are already represented in the UI on each Subscriber's Summary. For more information, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). +The "Next Billing" amount and "Next Billing" date are already represented in the UI on each Subscriber's Summary. For more information, see [Subscriber Interface Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). ## Optional Component Fields -This endpoint is particularly useful due to the fact that it will return the computed billing amount for the base product and the components which are in use by a subscriber. +This endpoint is particularly useful because it returns the computed billing amount for the base product and the components which are in use by a subscriber. -By default, the preview will include billing details for all components _at their **current** quantities_. This means: +By default, the preview includes billing details for all components _at their **current** quantities_. This means: * Current `allocated_quantity` for quantity-based components * Current enabled/disabled status for on/off components * Current metered usage `unit_balance` for metered components * Current metric quantity value for events recorded thus far for events-based components -In the above statements, "current" means the quantity or value as of the call to the renewal preview endpoint. We do not predict end-of-period values for components, so metered or events-based usage may be less than it will eventually be at the end of the period. +In the above statements, "current" means the quantity or value as of the call to the renewal preview endpoint. End-of-period values for components are not predicted, so metered or events-based usage may be less than it will eventually be at the end of the period. -Optionally, **you may provide your own custom quantities** for any component to see a billing preview for non-current quantities. This is accomplished by sending a request body with data under the `components` key. See the request body documentation below. +Optionally, **you can provide your own custom quantities** for any component to see a billing preview for non-current quantities. This is accomplished by sending a request body with data under the `components` key. See the request body documentation below. -## Subscription Side Effects +## Preview Behavior -You can request a `POST` to obtain this data from the endpoint without any side effects. This method allows you to preview data, but does not log any changes against a subscription. +Sending a `POST` request to this endpoint returns preview data without modifying the subscription. This method previews data, but does not log any changes against a subscription. ```ruby def preview_renewal(subscription_id, diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index a0f0f2b..c54ce8b 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -875,7 +875,7 @@ puts result Purges an individual subscription for sites in test mode. -Provide the subscription ID in the url. To confirm, supply the customer ID in the query string `ack` parameter. You may also delete the customer record and/or payment profiles by passing `cascade` parameters. For example, to delete just the customer record, the query params would be: `?ack={customer_id}&cascade[]=customer` +Provide the subscription ID in the URL. To confirm, supply the customer ID in the query string `ack` parameter. You may also delete the customer record and/or payment profiles by passing `cascade` parameters. For example, to delete just the customer record, the query params would be: `?ack={customer_id}&cascade[]=customer` If you need to remove subscriptions from a live site, contact support to discuss your use case. @@ -1008,9 +1008,9 @@ Previews a subscription by POSTing the same JSON or XML as for a subscription cr The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. -A subscription will not be created by utilizing this endpoint; it is meant to serve as a prediction. +This endpoint does not create a subscription; it is meant to serve as a prediction. -For more information, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). +For more information, see [Subscriber Interface Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). ## Subscriptions can now work independently from the catalog @@ -1030,21 +1030,21 @@ This functionality is supported in the API, but is not currently supported in SD ## Taxable Subscriptions -This endpoint will preview taxes applicable to a purchase. In order for taxes to be previewed, the following conditions must be met: +This endpoint previews taxes applicable to a purchase. For taxes to be previewed, the following conditions must be met: + Taxes must be configured on the subscription + The preview must be for the purchase of a taxable product or component, or combination of the two. -+ The subscription payload must contain a full billing or shipping address in order to calculate tax ++ The subscription payload must contain a full billing or shipping address to calculate tax -For more information about creating taxable previews, see our documentation guide on how to create [taxable subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes) +For more information about creating taxable previews, see [Taxes](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes). -You do **not** need to include a card number to generate tax information when you are previewing a subscription. However, when you actually want to create the subscription, you must include the credit card information if you want the billing address to be stored in Advanced Billing. The billing address and the credit card information are stored together within the payment profile object. Also, you may not send a billing address to Advanced Billing without payment profile information, as the address is stored on the card. +You do **not** need to include a card number to generate tax information when you are previewing a subscription. However, when you actually want to create the subscription, you must include the credit card information if you want the billing address to be stored. The billing address and the credit card information are stored together within the payment profile object. Also, you cannot send a billing address without payment profile information, as the address is stored on the card. You can pass shipping and billing addresses and still decide not to calculate taxes. To do that, pass `skip_billing_manifest_taxes: true` attribute. ## Non-taxable Subscriptions -If you'd like to calculate subscriptions that do not include tax you may leave off the billing information. +If you'd like to calculate subscriptions that do not include tax, you can leave off the billing information. ```ruby def preview_subscription(body: nil) @@ -1416,7 +1416,7 @@ puts result Removes a coupon from an existing subscription. -For more information on the expected behavior of removing a coupon from a subscription, see our documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon) +For more information on the expected behavior of removing a coupon from a subscription, see [Coupons and Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon). ```ruby def remove_coupon_from_subscription(subscription_id, @@ -1464,16 +1464,14 @@ puts result # Activate Subscription -Activates awaiting signup and trialing subscriptions. This feature is only available on the Relationship Invoicing architecture. Subscriptions in a group may not be activated immediately. - -For details on how the activation works, and how to activate subscriptions through the application, see [activation](#). +Activates awaiting signup and trialing subscriptions. This feature is only available on the Relationship Invoicing architecture. Subscriptions in a group cannot be activated immediately. The `revert_on_failure` parameter controls the behavior upon activation failure. -- If set to `true` and something goes wrong i.e. payment fails, then Advanced Billing will not change the subscription's state. The subscription’s billing period will also remain the same. -- If set to `false` and something goes wrong i.e. payment fails, then Advanced Billing will continue through with the activation and enter an end of life state. For trialing subscriptions, that will either be trial ended (if the trial is no obligation), past due (if the trial has an obligation), or canceled (if the site has no dunning strategy, or has a strategy that says to cancel immediately). For awaiting signup subscriptions, that will always be canceled. +- If set to `true` and something goes wrong i.e. payment fails, the subscription's state does not change. The subscription’s billing period also remains the same. +- If set to `false` and something goes wrong i.e. payment fails, the activation continues and enters an end of life state. For trialing subscriptions, that is either trial ended (if the trial is no obligation), past due (if the trial has an obligation), or canceled (if the site has no dunning strategy, or has a strategy that says to cancel immediately). For awaiting signup subscriptions, that is always canceled. -The default activation failure behavior can be configured per activation attempt, or you may set a default value under Config > Settings > Subscription Activation Settings. +The default activation failure behavior can be configured per activation attempt, or you can set a default value under Config > Settings > Subscription Activation Settings. ## Activation Scenarios @@ -1505,8 +1503,8 @@ The default activation failure behavior can be configured per activation attempt ### Activate Trialing subscription -You can read more about the behavior of trialing subscriptions [here](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). -When the `revert_on_failure` parameter is set to `true`, the subscription's state will remain as Trialing, we will void the invoice from activation and return any prepayments and credits applied to the invoice back to the subscription. +For more information about the behavior of trialing subscriptions, see [Trialing Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). +When the `revert_on_failure` parameter is set to `true`, the subscription's state remains Trialing; the invoice from activation is voided, and any prepayments and credits applied to the invoice are returned to the subscription. ```ruby def activate_subscription(subscription_id, diff --git a/doc/models/containers/event-event-specific-data.md b/doc/models/containers/event-event-specific-data.md index cba5e91..e65836a 100644 --- a/doc/models/containers/event-event-specific-data.md +++ b/doc/models/containers/event-event-specific-data.md @@ -3,14 +3,13 @@ ## Data Type -`SubscriptionProductChange | SubscriptionProductChangeScheduled | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | SubscriptionGroupSignupEventData | CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged | ItemPricePointChanged | CustomFieldValueChange | ChjsTokenizationSuccess | ChjsTokenizationFailure` +`SubscriptionProductChange | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | SubscriptionGroupSignupEventData | CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged | ItemPricePointChanged | CustomFieldValueChange | ChjsTokenizationSuccess | ChjsTokenizationFailure` ## Cases | Type | | --- | | [`SubscriptionProductChange`](../../../doc/models/subscription-product-change.md) | -| [`SubscriptionProductChangeScheduled`](../../../doc/models/subscription-product-change-scheduled.md) | | [`SubscriptionStateChange`](../../../doc/models/subscription-state-change.md) | | [`PaymentRelatedEvents`](../../../doc/models/payment-related-events.md) | | [`RefundSuccess`](../../../doc/models/refund-success.md) | @@ -44,19 +43,6 @@ value = SubscriptionProductChange.new( ) ``` -## SubscriptionProductChangeScheduled - -### Initialization Code - -#### Example - -```ruby -value = SubscriptionProductChangeScheduled.new( - previous_product_id: 62, - new_product_id: 52 -) -``` - ## SubscriptionStateChange ### Initialization Code diff --git a/doc/models/event-response.md b/doc/models/event-response.md index af38276..a09452b 100644 --- a/doc/models/event-response.md +++ b/doc/models/event-response.md @@ -24,7 +24,10 @@ event_response = EventResponse.new( created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), event_specific_data: SubscriptionProductChange.new( previous_product_id: 126, - new_product_id: 12 + new_product_id: 12, + previous_product_price_point_id: 250, + new_product_price_point_id: 244, + effective_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') ) ) ) diff --git a/doc/models/event.md b/doc/models/event.md index 1840c58..e3b247e 100644 --- a/doc/models/event.md +++ b/doc/models/event.md @@ -15,7 +15,7 @@ | `subscription_id` | `Integer` | Required | - | | `customer_id` | `Integer` | Required | - | | `created_at` | `DateTime` | Required | - | -| `event_specific_data` | [Subscription Product Change](../../doc/models/subscription-product-change.md) \| [Subscription Product Change Scheduled](../../doc/models/subscription-product-change-scheduled.md) \| [Subscription State Change](../../doc/models/subscription-state-change.md) \| [Payment Related Events](../../doc/models/payment-related-events.md) \| [Refund Success](../../doc/models/refund-success.md) \| [Component Allocation Change](../../doc/models/component-allocation-change.md) \| [Metered Usage](../../doc/models/metered-usage.md) \| [Prepaid Usage](../../doc/models/prepaid-usage.md) \| [Dunning Step Reached](../../doc/models/dunning-step-reached.md) \| [Invoice Issued](../../doc/models/invoice-issued.md) \| [Pending Cancellation Change](../../doc/models/pending-cancellation-change.md) \| [Prepaid Subscription Balance Changed](../../doc/models/prepaid-subscription-balance-changed.md) \| [Proforma Invoice Issued](../../doc/models/proforma-invoice-issued.md) \| [Subscription Group Signup Event Data](../../doc/models/subscription-group-signup-event-data.md) \| [Credit Account Balance Changed](../../doc/models/credit-account-balance-changed.md) \| [Prepayment Account Balance Changed](../../doc/models/prepayment-account-balance-changed.md) \| [Payment Collection Method Changed](../../doc/models/payment-collection-method-changed.md) \| [Item Price Point Changed](../../doc/models/item-price-point-changed.md) \| [Custom Field Value Change](../../doc/models/custom-field-value-change.md) \| [Chjs Tokenization Success](../../doc/models/chjs-tokenization-success.md) \| [Chjs Tokenization Failure](../../doc/models/chjs-tokenization-failure.md) \| nil | Required | This is a container for one-of cases. | +| `event_specific_data` | [Subscription Product Change](../../doc/models/subscription-product-change.md) \| [Subscription State Change](../../doc/models/subscription-state-change.md) \| [Payment Related Events](../../doc/models/payment-related-events.md) \| [Refund Success](../../doc/models/refund-success.md) \| [Component Allocation Change](../../doc/models/component-allocation-change.md) \| [Metered Usage](../../doc/models/metered-usage.md) \| [Prepaid Usage](../../doc/models/prepaid-usage.md) \| [Dunning Step Reached](../../doc/models/dunning-step-reached.md) \| [Invoice Issued](../../doc/models/invoice-issued.md) \| [Pending Cancellation Change](../../doc/models/pending-cancellation-change.md) \| [Prepaid Subscription Balance Changed](../../doc/models/prepaid-subscription-balance-changed.md) \| [Proforma Invoice Issued](../../doc/models/proforma-invoice-issued.md) \| [Subscription Group Signup Event Data](../../doc/models/subscription-group-signup-event-data.md) \| [Credit Account Balance Changed](../../doc/models/credit-account-balance-changed.md) \| [Prepayment Account Balance Changed](../../doc/models/prepayment-account-balance-changed.md) \| [Payment Collection Method Changed](../../doc/models/payment-collection-method-changed.md) \| [Item Price Point Changed](../../doc/models/item-price-point-changed.md) \| [Custom Field Value Change](../../doc/models/custom-field-value-change.md) \| [Chjs Tokenization Success](../../doc/models/chjs-tokenization-success.md) \| [Chjs Tokenization Failure](../../doc/models/chjs-tokenization-failure.md) \| nil | Required | This is a container for one-of cases. | ## Example @@ -29,7 +29,10 @@ event = Event.new( created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), event_specific_data: SubscriptionProductChange.new( previous_product_id: 126, - new_product_id: 12 + new_product_id: 12, + previous_product_price_point_id: 250, + new_product_price_point_id: 244, + effective_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') ) ) ``` diff --git a/doc/models/subscription-product-change-scheduled.md b/doc/models/subscription-product-change-scheduled.md deleted file mode 100644 index b397669..0000000 --- a/doc/models/subscription-product-change-scheduled.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Subscription Product Change Scheduled - -## Structure - -`SubscriptionProductChangeScheduled` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `previous_product_id` | `Integer` | Required | - | -| `new_product_id` | `Integer` | Required | - | -| `previous_product_price_point_id` | `Integer` | Optional | - | -| `new_product_price_point_id` | `Integer` | Optional | - | -| `effective_at` | `DateTime` | Optional | When the scheduled product change takes effect (the subscription's next renewal). | - -## Example - -```ruby -subscription_product_change_scheduled = SubscriptionProductChangeScheduled.new( - previous_product_id: 50, - new_product_id: 64, - previous_product_price_point_id: 174, - new_product_price_point_id: 168, - effective_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') -) -``` - diff --git a/doc/models/subscription-product-change.md b/doc/models/subscription-product-change.md index 212566e..db0774f 100644 --- a/doc/models/subscription-product-change.md +++ b/doc/models/subscription-product-change.md @@ -1,6 +1,8 @@ # Subscription Product Change +Event data for both `subscription_product_change` and `subscription_product_change_scheduled`. The price point and `effective_at` fields are only populated for scheduled changes. + ## Structure `SubscriptionProductChange` @@ -11,13 +13,19 @@ | --- | --- | --- | --- | | `previous_product_id` | `Integer` | Required | - | | `new_product_id` | `Integer` | Required | - | +| `previous_product_price_point_id` | `Integer` | Optional | - | +| `new_product_price_point_id` | `Integer` | Optional | - | +| `effective_at` | `DateTime` | Optional | When the scheduled product change takes effect (the subscription's next renewal). Only sent for `subscription_product_change_scheduled`. | ## Example ```ruby subscription_product_change = SubscriptionProductChange.new( previous_product_id: 250, - new_product_id: 120 + new_product_id: 120, + previous_product_price_point_id: 118, + new_product_price_point_id: 112, + effective_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') ) ``` diff --git a/lib/advanced_billing.rb b/lib/advanced_billing.rb index 36c485d..4997912 100644 --- a/lib/advanced_billing.rb +++ b/lib/advanced_billing.rb @@ -521,7 +521,6 @@ require_relative 'advanced_billing/models/subscription_preview' require_relative 'advanced_billing/models/subscription_preview_response' require_relative 'advanced_billing/models/subscription_product_change' -require_relative 'advanced_billing/models/subscription_product_change_scheduled' require_relative 'advanced_billing/models/subscription_product_migration' require_relative 'advanced_billing/models/' \ 'subscription_product_migration_request' diff --git a/lib/advanced_billing/controllers/advance_invoice_controller.rb b/lib/advanced_billing/controllers/advance_invoice_controller.rb index 7bab855..9317fc4 100644 --- a/lib/advanced_billing/controllers/advance_invoice_controller.rb +++ b/lib/advanced_billing/controllers/advance_invoice_controller.rb @@ -6,21 +6,20 @@ module AdvancedBilling # AdvanceInvoiceController class AdvanceInvoiceController < BaseController - # Issues an invoice in advance for a subscription's next renewal date. [See - # our - # docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Inv - # oice-In-Advance) for more information on advance invoices, including - # eligibility for generating one; for the most part, they function like any - # other invoice, except they are issued early and have special behavior upon - # being voided. - # A subscription may only have one advance invoice per billing period. - # Attempting to issue an advance invoice when one already exists will return - # an error. - # That said, regeneration of the invoice may be forced with the params - # `force: true`, which will void an advance invoice if one exists and - # generate a new one. If no advance invoice exists, a new one will be - # generated. - # We recommend using either the create or preview endpoints for proforma + # Issues an invoice in advance for a subscription's next renewal date. For + # the most part, advance invoices function like any other invoice, except + # they are issued early and have special behavior upon being voided. For + # more information on advance invoices, including eligibility for generating + # one, see [Issue Invoice In + # Advance](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue- + # Invoice-In-Advance). + # A subscription can only have one advance invoice per billing period. + # Attempting to issue an advance invoice when one already exists returns an + # error. + # Regeneration of the invoice can be forced with the params `force: true`, + # which voids an advance invoice if one exists and generates a new one. If + # no advance invoice exists, a new one is generated. + # Consider using either the create or preview endpoints for proforma # invoices to preview this advance invoice before using this endpoint to # generate it. # @param [Integer] subscription_id Required parameter: The Chargify id of @@ -82,10 +81,10 @@ def read_advance_invoice(subscription_id) # Voids a subscription's existing advance invoice. Once voided, it can later # be regenerated if desired. - # A `reason` is required in order to void, and the invoice must have an open - # status. Voiding will cause any prepayments and credits that were applied - # to the invoice to be returned to the subscription. For a full overview of - # the impact of voiding, [see our help docs]($m/Invoice). + # A `reason` is required to void, and the invoice must have an open status. + # Voiding causes any prepayments and credits that were applied to the + # invoice to be returned to the subscription. + # For a full overview of the impact of voiding, see [Invoice]($m/Invoice). # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [VoidInvoiceRequest] body Optional parameter: TODO: type diff --git a/lib/advanced_billing/controllers/api_exports_controller.rb b/lib/advanced_billing/controllers/api_exports_controller.rb index a34874f..190a71b 100644 --- a/lib/advanced_billing/controllers/api_exports_controller.rb +++ b/lib/advanced_billing/controllers/api_exports_controller.rb @@ -127,7 +127,7 @@ def list_exported_subscriptions(options = {}) end # Creates a proforma invoices export and returns a batch job object. - # It is only available for Relationship Invoicing architecture. + # Proforma invoices are only available on Relationship Invoicing sites. # @return [BatchJobResponse] Response from the API call. def export_proforma_invoices @api_call @@ -190,7 +190,8 @@ def export_subscriptions .execute end - # Returns a batch job object for a proforma invoices export. + # Returns a batch job object for a proforma invoices export. Proforma + # invoices are only available on Relationship Invoicing sites. # @param [String] batch_id Required parameter: Id of a Batch Job. # @return [BatchJobResponse] Response from the API call. def read_proforma_invoices_export(batch_id) diff --git a/lib/advanced_billing/controllers/billing_portal_controller.rb b/lib/advanced_billing/controllers/billing_portal_controller.rb index 1fd01e0..bd1aa48 100644 --- a/lib/advanced_billing/controllers/billing_portal_controller.rb +++ b/lib/advanced_billing/controllers/billing_portal_controller.rb @@ -8,32 +8,24 @@ module AdvancedBilling class BillingPortalController < BaseController # Enables Billing Portal access for a customer, with an option to send an # invitation email at the same time. - # ## Billing Portal Documentation - # Full documentation on how the Billing Portal operates within the Advanced - # Billing UI can be located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing- - # Portal-Overview). - # This documentation is focused on how to configure the Billing Portal - # Settings, as well as Subscriber Interaction and Merchant Management of the - # Billing Portal. - # You can use this endpoint to enable Billing Portal access for a Customer, - # with the option of sending the Customer an Invitation email at the same - # time. # ## Billing Portal Security - # If your customer has been invited to the Billing Portal, then they will - # receive a link to manage their subscription (the “Management URL”) - # automatically at the bottom of their statements, invoices, and receipts. - # **This link changes periodically for security and is only valid for 65 - # days.** + # If your customer has been invited to the Billing Portal, they receive a + # link to manage their subscription (the “Management URL”) automatically at + # the bottom of their statements, invoices, and receipts. **This link + # changes periodically for security and is only valid for 65 days.** # If you need to provide your customer their Management URL through other - # means, you can retrieve it via the API. Because the URL is - # cryptographically signed with a timestamp, it is not possible for - # merchants to generate the URL without requesting it from Advanced Billing. - # In order to prevent abuse & overuse, we ask that you request a new URL - # only when absolutely necessary. Management URLs are good for 65 days, so - # you should re-use a previously generated one as much as possible. If you - # use the URL frequently (such as to display on your website), **do not** - # make an API request to Advanced Billing every time. + # means, you can retrieve it [via the + # API]($e/Billing%20Portal/readBillingPortalLink). Because the URL is + # cryptographically signed with a timestamp, merchants cannot generate the + # URL without requesting it through the API. + # To prevent abuse and overuse, request a new URL only when absolutely + # necessary. Management URLs are good for 65 days, so you should re-use a + # previously generated one as much as possible. If you use the URL + # frequently (such as to display on your website), **do not** make an API + # request every time. + # For more information configuring the Billing Portal, see [Billing Portal + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billi + # ng-Portal-Overview). # @param [Integer] customer_id Required parameter: The Chargify id of the # customer # @param [AutoInvite] auto_invite Optional parameter: When set to 1, an @@ -64,16 +56,16 @@ def enable_billing_portal_for_customer(customer_id, # Returns the exact URL required for a subscriber to access the Billing # Portal. - # ## Rules for Management Link API + # ## Management Link Request Rules # + When retrieving a management URL, multiple requests for the same - # customer in a short period will return the **same** URL - # + We will not generate a new URL for 15 days + # customer in a short period return the **same** URL + # + A new URL is not generated for 15 days # + You must cache and remember this URL if you are going to need it again # within 15 days # + Only request a new URL after the `new_link_available_at` date # + You are limited to 15 requests for the same URL. If you make more than - # 15 requests before `new_link_available_at`, you will be blocked from - # further Management URL requests (with a response code `429`). + # 15 requests before `new_link_available_at`, you are blocked from further + # Management URL requests (with a response code `429`). # @param [Integer] customer_id Required parameter: The Chargify id of the # customer # @return [PortalManagementLink] Response from the API call. diff --git a/lib/advanced_billing/controllers/components_controller.rb b/lib/advanced_billing/controllers/components_controller.rb index b725c48..e012eec 100644 --- a/lib/advanced_billing/controllers/components_controller.rb +++ b/lib/advanced_billing/controllers/components_controller.rb @@ -66,7 +66,7 @@ def create_metered_component(product_family_id, # Creates a Quantity Based component definition under the specified product # family. A Quantity Based component can then be added and “allocated” for a # subscription. - # When defining a Quantity Based component, you can choose one of 2 types: + # When defining a Quantity Based component, you can choose one of two types: # #### Recurring # Recurring quantity-based components are used to bill for the number of # some unit (think monthly software user licenses or the number of pairs of @@ -78,6 +78,9 @@ def create_metered_component(product_family_id, # charge your customer a one-time fee for onboarding or other services. # The allocated quantity for one-time quantity-based components immediately # gets reset back to zero after the allocation is made. + # For more information, see [Components + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Compo + # nents-Overview). # #### Hybrid Pricing # A `volume`, `tiered`, or `stairstep` component can combine its primary # pricing with a secondary pricing model (the `overage_pricing` parameter) @@ -173,15 +176,15 @@ def create_on_off_component(product_family_id, # up over time on their subscription. In a sense, they are the mirror image # of metered components; while metered components charge at the end of the # period for the amount of units used, prepaid components are charged for at - # the time of purchase, and we subsequently keep track of the usage against - # the amount purchased. - # For more information on components, see our documentation - # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen - # ts-Overview). + # the time of purchase, and usage is subsequently tracked against the amount + # purchased. + # For more information, see [Components + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Compo + # nents-Overview). # If you have the new [Catalog # experience](page:help/announcements/2026-announcements#new-catalog-experie # nce-and-terminology) enabled, taxable components must include a non-blank - # `tax_code`. Sending `"tax_code": ""` returns `422`. + # `tax_code`; sending a blank value results in a validation error. # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` # @param [CreatePrepaidComponent] body Optional parameter: TODO: type @@ -226,13 +229,13 @@ def create_prepaid_usage_component(product_family_id, # So, instead of reporting usage directly for each component (as you would # with metered components), the usage is derived from analysis of your # events. - # For more information on components, see our documentation - # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen - # ts-Overview). + # For more information, see [Components + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Compo + # nents-Overview). # If you have the new [Catalog # experience](page:help/announcements/2026-announcements#new-catalog-experie # nce-and-terminology) enabled, taxable components must include a non-blank - # `tax_code`. Sending `"tax_code": ""` returns `422`. + # `tax_code`; sending a blank value results in a validation error. # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` # @param [CreateEBBComponent] body Optional parameter: TODO: type diff --git a/lib/advanced_billing/controllers/coupons_controller.rb b/lib/advanced_billing/controllers/coupons_controller.rb index 11da035..7d1bbe8 100644 --- a/lib/advanced_billing/controllers/coupons_controller.rb +++ b/lib/advanced_billing/controllers/coupons_controller.rb @@ -85,13 +85,11 @@ def list_coupons_for_product_family(options = {}) .execute end - # Searches for a coupon by code, returning a 404 if no coupon is found. By - # passing a code parameter, the find will attempt to locate a coupon that - # matches that code. + # Searches for a coupon by code. # If you have more than one product family and if the coupon you are trying - # to find does not belong to the default product family in your site, then - # you will need to specify (either in the url or as a query string param) - # the product family id. + # to find does not belong to the default product family in your site, you + # need to specify (either in the URL or as a query string param) the + # `product_family_id`. # @param [Integer] product_family_id Optional parameter: The Advanced # Billing id of the product family to which the coupon belongs # @param [String] code Optional parameter: The code of the coupon @@ -118,13 +116,13 @@ def find_coupon(product_family_id: nil, .execute end - # Returns a coupon by its Advanced Billing-assigned ID. You must identify - # the Coupon in this call by the ID parameter that Advanced Billing assigns. - # If instead you would like to find a Coupon using a Coupon code, see the - # Coupon Find method. - # If the coupon is set to `use_site_exchange_rate: true`, it will return - # pricing based on the current exchange rate. If the flag is set to false, - # it will return all of the defined prices for each currency. + # Returns a coupon by its system-assigned ID. You must identify the Coupon + # in this call by the ID parameter assigned to it. + # If instead you would like to find a Coupon using a Coupon code, use the + # [Find Coupon]($e/Coupons/findCoupon) endpoint. + # If the coupon is set to `use_site_exchange_rate: true`, it returns pricing + # based on the current exchange rate. If the flag is set to false, it + # returns all of the defined prices for each currency. # @param [Integer] product_family_id Required parameter: The Advanced # Billing id of the product family to which the coupon belongs # @param [Integer] coupon_id Required parameter: The Advanced Billing id of @@ -293,26 +291,18 @@ def read_coupon_usage(product_family_id, end # Verifies whether a specific coupon code is valid. This method is useful - # for validating coupon codes that are entered by a customer. If the coupon - # is found and is valid, the coupon will be returned with a 200 status code. - # If the coupon is invalid, the status code will be 404 and the response - # will say why it is invalid. If the coupon is valid, the status code will - # be 200 and the coupon will be returned. The following reasons for - # invalidity are supported: - # + Coupon not found - # + Coupon is invalid - # + Coupon expired + # for validating coupon codes that are entered by a customer. # If you have more than one product family and if the coupon you are - # validating does not belong to the first product family in your site, then - # you will need to specify the product family, either in the url or as a - # query string param. This can be done by supplying the id or the handle in - # the `handle:my-family` format. - # Eg. + # validating does not belong to the first product family in your site, you + # need to specify the product family, either in the URL or as a query string + # param. This can be done by supplying the id or the handle in the + # `handle:my-family` format. + # Supplying the `product_family_handle` in the URL: # ``` # https://.chargify.com/product_families/handle:/coupons/validate.?code= # ``` - # Or: + # Supplying the `product_family_id` as a query parameter: # ``` # https://.chargify.com/coupons/validate.?code=&product_family_id= @@ -378,7 +368,6 @@ def create_or_update_coupon_currency_prices(coupon_id, end # Creates subcodes for an existing coupon. - # ## Coupon Subcodes Intro # Coupon Subcodes allow you to create a set of unique codes that allow you # to expand the use of one coupon. # For example: @@ -388,24 +377,11 @@ def create_or_update_coupon_currency_prices(coupon_id, # + SPRING90210 # + DP80302 # + SPRINGBALTIMORE - # Coupon subcodes can be administered in the Admin Interface or via the API. # When creating a coupon subcode, you must specify a coupon to attach it to # using the coupon_id. Valid coupon subcodes are all capital letters, # contain only letters and numbers, and do not have any spaces. Lowercase - # letters will be capitalized before the subcode is created. - # ## Coupon Subcodes Documentation - # Full documentation on how to create coupon subcodes in the Advanced - # Billing UI can be located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-C - # odes). - # Additionally, for documentation on how to apply a coupon to a Subscription - # within the Advanced Billing UI, see our documentation - # [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons- - # and-Subscriptions). - # ## Create Coupon Subcode - # This request allows you to create specific subcodes underneath an existing - # coupon code. - # *Note*: If you are using any of the allowed special characters ("%", "@", + # letters are capitalized before the subcode is created. + # Note: If you are using any of the allowed special characters ("%", "@", # "+", "-", "_", and "."), you must encode them for use in the URL. # % to %25 # @ to %40 @@ -416,6 +392,12 @@ def create_or_update_coupon_currency_prices(coupon_id, # So, if the coupon subcode is `20%OFF`, the URL to delete this coupon # subcode would be: # `https://.chargify.com/coupons/567/codes/20%25OFF.`. + # For more information on coupon codes and applying coupons to + # subscriptions, see [Coupon + # Codes](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-C + # odes) and [Coupons and + # Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101- + # Coupons-and-Subscriptions). # @param [Integer] coupon_id Required parameter: The Advanced Billing id of # the coupon # @param [CouponSubcodes] body Optional parameter: TODO: type description diff --git a/lib/advanced_billing/controllers/customers_controller.rb b/lib/advanced_billing/controllers/customers_controller.rb index 562e17e..d5746a8 100644 --- a/lib/advanced_billing/controllers/customers_controller.rb +++ b/lib/advanced_billing/controllers/customers_controller.rb @@ -7,40 +7,37 @@ module AdvancedBilling # CustomersController class CustomersController < BaseController # Creates a new customer; can also be created alongside a new subscription. - # The only validation restriction is that you may only create one customer + # The only validation restriction is that you can only create one customer # for a given reference value. # If provided, the `reference` value must be unique. It represents a unique # identifier for the customer from your own app, i.e. the customer’s ID. # This allows you to retrieve a given customer via a piece of shared - # information. Alternatively, you may choose to leave `reference` blank, and - # store Advanced Billing’s unique ID for the customer, which is in the `id` + # information. Alternatively, you can choose to leave `reference` blank, and + # store the system-assigned unique ID for the customer, which is in the `id` # attribute. - # Full documentation on how to locate, create and edit Customers in the - # Advanced Billing UI can be located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer - # -Details). + # For more information, see [Customer + # Details](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Custom + # er-Details). # ## Required Country Format - # Advanced Billing requires that you use the ISO Standard Country codes when - # formatting country attribute of the customer. - # Countries should be formatted as 2 characters. For more information, see - # the following wikipedia article on - # [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) + # Format the country attribute of the customer using the ISO Standard + # Country codes. + # Countries should be formatted as two characters. For more information, see + # [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes). # ## Required State Format - # Advanced Billing requires that you use the ISO Standard State codes when - # formatting state attribute of the customer. - # + US States (2 characters): - # [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) - # + States Outside the US (2-3 characters): To find the correct state codes - # outside of the US, go to - # [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and - # click on the link in the “ISO 3166-2 codes” column next to country you - # wish to populate. + # Format the state attribute of the customer using the ISO Standard State + # codes. + # + US States (two characters): see [ISO + # 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US). + # + States Outside the US (two to three characters): To find the correct + # state codes outside the US, go to [ISO + # 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click + # on the link in the “ISO 3166-2 codes” column next to the country you wish + # to populate. # ## Locale - # Advanced Billing allows you to attribute a language/region to your - # customer to deliver invoices in any required language. - # For more: [Customer + # You can attribute a language/region to the customer to deliver invoices in + # any required language. For more information, see [Customer # Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Custome - # r-Locale) + # r-Locale). # @param [CreateCustomerRequest] body Optional parameter: TODO: type # description here # @return [CustomerResponse] Response from the API call. diff --git a/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb b/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb index 9bfe35d..347bb82 100644 --- a/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +++ b/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb @@ -104,9 +104,9 @@ def list_segments_for_price_point(options = {}) .execute end - # Updates a single segment for a component with a segmented metric. It - # allows you to update the pricing for the segment. - # You may specify component and/or price point by using either the numeric + # Updates a single segment for a component with a segmented metric. You can + # also update the pricing for the segment. + # You can specify component and/or price point by using either the numeric # ID or the `handle:gold` syntax. # @param [String] component_id Required parameter: ID or Handle of the # Component diff --git a/lib/advanced_billing/controllers/events_controller.rb b/lib/advanced_billing/controllers/events_controller.rb index 0e303ac..ea2a130 100644 --- a/lib/advanced_billing/controllers/events_controller.rb +++ b/lib/advanced_billing/controllers/events_controller.rb @@ -7,31 +7,15 @@ module AdvancedBilling # EventsController class EventsController < BaseController # Lists events for a site. - # ## Events Intro - # Advanced Billing Events include various activity that happens around a - # Site. This information is **especially** useful to track down issues that - # arise when subscriptions are not created due to errors. - # Within the Advanced Billing UI, "Events" are referred to as "Site - # Activity". See the [Site + # Events include various activity that happens around a Site. This + # information is **especially** useful to track down issues that arise when + # subscriptions are not created due to errors. + # Within the UI, Events are referred to as Site Activity. For more + # information, see [Site # Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site- - # Activity) article in the product documentation for details on how to - # record view Events / Site Activty in the Advanced Billing UI. - # If you’re using the [enhanced Catalog - # experience](page:help/announcements/2026-announcements#new-catalog-experie - # nce-and-terminology), you’ll see updated naming in webhook events and - # messages. - # Event name changes: - # - subscription_product_change → subscription_plan_change - # - component_allocation_change → allocation_change - # - component_billing_date_change → product_billing_date_change - # Message updates: - # - “Plan changed on Subscription from previous plan to new plan” - # - “Successful payment for allocation changes to Product on Subscription” - # - “Failed payment for allocation changes to Product on Subscription” - # ## List Events for a Site - # This method will retrieve a list of events for a site. Use query string - # filters to narrow down results. You may use the `key` filter as part of - # your query string to narrow down results. + # Activity). + # Use query string filters to narrow down results. You can use the `filter` + # parameter to filter by event key. # ### Legacy Filters # The following keys are no longer supported. # + `payment_failure_recreated` @@ -43,8 +27,8 @@ class EventsController < BaseController # + `zferral_revenue_post_success` - (Specific to the deprecated Zferral # integration) # ## Event Key - # The event type is identified by the key property. You can check supported - # keys [here]($m/Event%20Key). + # The event type is identified by the key property. See [Event + # Key]($m/Event%20Key) for a complete list of supported keys. # ## Event Specific Data # Different event types may include additional data in `event_specific_data` # property. @@ -87,6 +71,19 @@ class EventsController < BaseController # } # } # ``` + # ## Enhanced Catalog Experience + # If you’re using the [enhanced Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology), you’ll see updated naming in webhook events and + # messages. + # Event name changes: + # - subscription_product_change → subscription_plan_change + # - component_allocation_change → allocation_change + # - component_billing_date_change → product_billing_date_change + # Message updates: + # - “Plan changed on Subscription from previous plan to new plan” + # - “Successful payment for allocation changes to Product on Subscription” + # - “Failed payment for allocation changes to Product on Subscription” # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start @@ -156,8 +153,16 @@ def list_events(options = {}) # Lists events for a subscription. # ## Event Key - # The event type is identified by the key property. You can check supported - # keys [here]($m/Event%20Key). + # The event type is identified by the key property. See [Event + # Key]($m/Event%20Key) for a complete list of supported keys. + # ## Event Specific Data + # Different event types may include additional data in `event_specific_data` + # property. + # While some events share the same schema for `event_specific_data`, others + # may not include it at all. + # For precise mappings from key to event_specific_data, refer to + # [Event]($m/Event). + # ## Enhanced Catalog Experience # If you’re using the [enhanced Catalog # experience](page:help/announcements/2026-announcements#new-catalog-experie # nce-and-terminology), you’ll see updated naming in webhook events and @@ -170,13 +175,6 @@ def list_events(options = {}) # - “Successful payment for allocation changes to Product on Subscription” # - “Failed payment for allocation changes to Product on Subscription” # - “Plan changed on Subscription from previous plan to new plan” - # ## Event Specific Data - # Different event types may include additional data in `event_specific_data` - # property. - # While some events share the same schema for `event_specific_data`, others - # may not include it at all. - # For precise mappings from key to event_specific_data, refer to - # [Event]($m/Event). # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] page Optional parameter: Result records are organized in diff --git a/lib/advanced_billing/controllers/invoices_controller.rb b/lib/advanced_billing/controllers/invoices_controller.rb index 848e47e..0bf3eae 100644 --- a/lib/advanced_billing/controllers/invoices_controller.rb +++ b/lib/advanced_billing/controllers/invoices_controller.rb @@ -265,8 +265,9 @@ def list_invoice_events(options = {}) end # Applies a payment of a given type against a specific invoice. If you would - # like to apply a payment across multiple invoices, you can use the Bulk - # Payment endpoint. + # like to apply a payment across multiple invoices, you can use the [Record + # Payment for Multiple + # Invoices]($e/Invoices/recordPaymentForMultipleInvoices) endpoint. # @param [String] uid Required parameter: The unique identifier for the # invoice, this does not refer to the public facing invoice number. # @param [CreateInvoicePaymentRequest] body Optional parameter: TODO: type @@ -297,28 +298,8 @@ def record_payment_for_invoice(uid, end # Records an external payment against multiple invoices. - # To apply a payment to multiple invoices, at minimum, specify the `amount` + # To apply a payment to multiple invoices, at minimum, specify the `amount` # and `applications` (i.e., `invoice_uid` and `amount`) details. - # ``` - # { - # "payment": { - # "memo": "to pay the bills", - # "details": "check number 8675309", - # "method": "check", - # "amount": "250.00", - # "applications": [ - # { - # "invoice_uid": "inv_8gk5bwkct3gqt", - # "amount": "100.00" - # }, - # { - # "invoice_uid": "inv_7bc6bwkct3lyt", - # "amount": "150.00" - # } - # ] - # } - # } - # ``` # Note that the invoice payment amounts must be greater than 0. Total amount # must be greater or equal to invoices payment amount sum. # @param [CreateMultiInvoicePaymentRequest] body Optional parameter: TODO: diff --git a/lib/advanced_billing/controllers/offers_controller.rb b/lib/advanced_billing/controllers/offers_controller.rb index 617b1f7..73f0e97 100644 --- a/lib/advanced_billing/controllers/offers_controller.rb +++ b/lib/advanced_billing/controllers/offers_controller.rb @@ -6,17 +6,15 @@ module AdvancedBilling # OffersController class OffersController < BaseController - # Creates an offer within your Advanced Billing site. - # ## Documentation + # Creates an offer within your site. # Offers allow you to package complicated combinations of products, # components and coupons into a convenient package which can then be # subscribed to just like products. # Once an offer is defined it can be used as an alternative to the product # when creating subscriptions. - # Full documentation on how to use offers in the Advanced Billing UI can be - # located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-O - # verview). + # For more information, see + # [Offers](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers + # -Overview) in the product documentation. # ## Using a Product Price Point # You can optionally pass in a `product_price_point_id` that corresponds # with the `product_id` and the offer will use that price point. If a diff --git a/lib/advanced_billing/controllers/payment_profiles_controller.rb b/lib/advanced_billing/controllers/payment_profiles_controller.rb index 94b85b5..2f4599d 100644 --- a/lib/advanced_billing/controllers/payment_profiles_controller.rb +++ b/lib/advanced_billing/controllers/payment_profiles_controller.rb @@ -112,8 +112,8 @@ def create_payment_profile(body: nil) end # Lists all active payment profiles for a site, or for one customer within a - # site. If no payment profiles are found, this endpoint will return an empty - # array, not a 404. + # site. If no payment profiles are found, this endpoint returns an empty + # array. # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start @@ -277,8 +277,8 @@ def update_payment_profile(payment_profile_id, end # Deletes an unused payment profile. - # If the payment profile is in use by one or more subscriptions or groups, a - # 422 and error message will be returned. + # If the payment profile is in use by one or more subscriptions or groups, + # an error message is returned. # @param [Integer] payment_profile_id Required parameter: The Chargify id of # the payment profile # @return [void] Response from the API call. @@ -304,11 +304,11 @@ def delete_unused_payment_profile(payment_profile_id) end # Deletes a payment profile belonging to the customer on the subscription. - # + If the customer has multiple subscriptions, the payment profile will be - # removed from all of them. - # + If you delete the default payment profile for a subscription, you will - # need to specify another payment profile to be the default through the api, - # or either prompt the user to enter a card in the billing portal or on the + # If the customer has multiple subscriptions, the payment profile is removed + # from all of them. + # If you delete the default payment profile for a subscription, you need to + # specify another payment profile to be the default through the API, or + # either prompt the user to enter a card in the billing portal or on the # self-service page, or visit the Payment Details tab on the subscription in # the Admin UI and use the “Add New Credit Card” or “Make Active Payment # Method” link, (depending on whether there are other cards present). diff --git a/lib/advanced_billing/controllers/product_families_controller.rb b/lib/advanced_billing/controllers/product_families_controller.rb index 9774ced..51a0f60 100644 --- a/lib/advanced_billing/controllers/product_families_controller.rb +++ b/lib/advanced_billing/controllers/product_families_controller.rb @@ -81,9 +81,8 @@ def list_products_for_product_family(options = {}) .execute end - # Creates a Product Family within your Advanced Billing site. Create a - # Product Family to act as a container for your products, components, and - # coupons. + # Creates a Product Family within your site. Create a Product Family to act + # as a container for your products, components, and coupons. # Full documentation on how Product Families operate within the Advanced # Billing UI can be located # [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Product- diff --git a/lib/advanced_billing/controllers/products_controller.rb b/lib/advanced_billing/controllers/products_controller.rb index fa2958c..44352d6 100644 --- a/lib/advanced_billing/controllers/products_controller.rb +++ b/lib/advanced_billing/controllers/products_controller.rb @@ -6,16 +6,16 @@ module AdvancedBilling # ProductsController class ProductsController < BaseController - # Creates a product in your Advanced Billing site. + # Creates a product in your site. # If you have the new [Catalog # experience](page:help/announcements/2026-announcements#new-catalog-experie # nce-and-terminology) enabled, the `auto_create_signup_page` parameter is # not supported. If `auto_create_signup_page` is included (with any value) # an error is returned. - # See the following product documentation for more information: + # For more information, see: # + [Products - # Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645- - # Products-Overview) + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Produ + # cts-Overview) # + [Changing a Subscription's # Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581-Produc # t-Changes-and-Migrations) diff --git a/lib/advanced_billing/controllers/proforma_invoices_controller.rb b/lib/advanced_billing/controllers/proforma_invoices_controller.rb index f093d6e..6e1c624 100644 --- a/lib/advanced_billing/controllers/proforma_invoices_controller.rb +++ b/lib/advanced_billing/controllers/proforma_invoices_controller.rb @@ -6,11 +6,10 @@ module AdvancedBilling # ProformaInvoicesController class ProformaInvoicesController < BaseController - # Creates a consolidated proforma invoice asynchronously. It will return a - # 201 with no message, or a 422 with any errors. To find and view the new - # consolidated proforma invoice, you may poll the subscription group listing - # for proforma invoices; only one consolidated proforma invoice may be - # created per group at a time. + # Creates a consolidated proforma invoice asynchronously. To find and view + # the new consolidated proforma invoice, you can poll the subscription group + # listing for proforma invoices; only one consolidated proforma invoice can + # be created per group at a time. # If the information becomes outdated, simply void the old consolidated # proforma invoice and generate a new one. # ## Restrictions diff --git a/lib/advanced_billing/controllers/reason_codes_controller.rb b/lib/advanced_billing/controllers/reason_codes_controller.rb index e26fdac..591309f 100644 --- a/lib/advanced_billing/controllers/reason_codes_controller.rb +++ b/lib/advanced_billing/controllers/reason_codes_controller.rb @@ -7,21 +7,14 @@ module AdvancedBilling # ReasonCodesController class ReasonCodesController < BaseController # Creates a reason code for a given site. - # # Reason Codes Intro # Reason Codes are a way to gain a high-level view of why your customers are # cancelling the subscription to your product or service. # Add a set of churn reason codes to be displayed in-app and/or the Maxio # Billing Portal. As your subscribers decide to cancel their subscription, # learn why they decided to cancel. - # ## Reason Code Documentation - # Full documentation on how Reason Codes operate within Advanced Billing can - # be located under the following links. - # [Churn Reason + # For more information, see [Churn Reason # Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Re - # ason-Codes) - # ## Create Reason Code - # This method gives a merchant the option to create reason codes for a given - # site. + # ason-Codes). # @param [CreateReasonCodeRequest] body Optional parameter: TODO: type # description here # @return [ReasonCodeResponse] Response from the API call. diff --git a/lib/advanced_billing/controllers/referral_codes_controller.rb b/lib/advanced_billing/controllers/referral_codes_controller.rb index 6660815..9c7fa24 100644 --- a/lib/advanced_billing/controllers/referral_codes_controller.rb +++ b/lib/advanced_billing/controllers/referral_codes_controller.rb @@ -9,15 +9,9 @@ class ReferralCodesController < BaseController # Validates whether a referral code is valid and applicable within your # site. This method is useful for validating referral codes that are entered # by a customer. - # ## Referrals Documentation - # Full documentation on how to use the referrals feature in the Advanced - # Billing UI can be located - # [here](https://maxio.zendesk.com/hc/en-us/sections/24286965611405-Referral - # s). - # ## Server Response - # If the referral code is valid the status code will be `200` and the - # referral code will be returned. If the referral code is invalid, a `404` - # response will be returned. + # For more information, see [Understanding + # Referrals](https://docs.maxio.com/hc/en-us/articles/24286981223693-Underst + # anding-Referrals) in the product documentation. # @param [String] code Required parameter: The referral code you are trying # to validate # @return [ReferralValidationResponse] Response from the API call. diff --git a/lib/advanced_billing/controllers/sites_controller.rb b/lib/advanced_billing/controllers/sites_controller.rb index a3c7e7b..8f2620a 100644 --- a/lib/advanced_billing/controllers/sites_controller.rb +++ b/lib/advanced_billing/controllers/sites_controller.rb @@ -7,18 +7,20 @@ module AdvancedBilling # SitesController class SitesController < BaseController # Retrieves site data. - # Full documentation on Sites in the Advanced Billing UI can be located - # [here](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites). - # Specifically, the [Clearing Site + # For more information, see + # [Sites](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites) + # in the product documentation. Specifically, the [Clearing Site # Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing- - # Site-Data) section is relevant to this endpoint documentation. + # Site-Data) section is relevant to this endpoint. # #### Relationship invoicing enabled - # If the site has RI enabled then you will see more settings like: - # "customer_hierarchy_enabled": true, - # "whopays_enabled": true, - # "whopays_default_payer": "self" - # You can read more about these settings here: - # [Who Pays & Customer + # If the site has Relationship invoicing enabled, additional properties are + # returned in the response: + # ``` + # "customer_hierarchy_enabled": true, + # "whopays_enabled": true, + # "whopays_default_payer": "self" + # ``` + # For more information, see [Who Pays & Customer # Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Cust # omer-Hierarchies-WhoPays). # @return [SiteResponse] Response from the API call. diff --git a/lib/advanced_billing/controllers/subscription_components_controller.rb b/lib/advanced_billing/controllers/subscription_components_controller.rb index 4aa5553..c3fd7fc 100644 --- a/lib/advanced_billing/controllers/subscription_components_controller.rb +++ b/lib/advanced_billing/controllers/subscription_components_controller.rb @@ -691,19 +691,18 @@ def list_usages(options = {}) end # Activates an event-based component for a single subscription. - # In order to bill your subscribers on your Events data under the - # Events-Based Billing feature, the components must be activated for the - # subscriber. - # Learn more about the role of activation in the [Events-Based Billing - # docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Ba - # sed-Billing-Overview). + # To bill your subscribers on your Events data under the Events-Based + # Billing feature, the components must be activated for the subscriber. + # For more information, see [Design Your + # Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Yo + # ur-Catalog?method=componenttypes). # Use this endpoint to activate an event-based component for a single - # subscription. Activating an event-based component causes Advanced Billing - # to bill for events when the subscription is renewed. - # *Note: it is possible to stream events for a subscription at any time, + # subscription. Activating an event-based component causes billing for + # events when the subscription is renewed. + # Note: it is possible to stream events for a subscription at any time, # regardless of component activation status. The activation status only # determines if the subscription should be billed for event-based component - # usage at renewal.* + # usage at renewal. # @param [Integer] subscription_id Required parameter: The Advanced Billing # id of the subscription # @param [Integer] component_id Required parameter: The Advanced Billing id @@ -760,7 +759,6 @@ def deactivate_event_based_component(subscription_id, end # Records a single event for Events-Based Billing. - # ## Documentation # Events-Based Billing is an evolved form of metered billing that is based # on data-rich events streamed in real-time from your system to Advanced # Billing. @@ -768,14 +766,11 @@ def deactivate_event_based_component(subscription_id, # computed totals of usage charges billed to your customers. # This API allows you to stream events into the Advanced Billing data # ingestion engine. - # Learn more about the feature in general in the [Events-Based Billing help - # docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Ba - # sed-Billing-Overview). - # ## Record Event - # Use this endpoint to record a single event. - # *Note: this endpoint differs from the standard Chargify API endpoints in - # that the URL subdomain will be `events` and your site subdomain will be - # included in the URL path. For example:* + # For more information, see [Design Your + # Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Yo + # ur-Catalog?method=componenttypes). + # Note: this endpoint differs from the standard URL for this API in that + # `events` and your site subdomain are included in the path. For example: # ``` # https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle # ``` @@ -808,9 +803,8 @@ def record_event(api_handle, end # Records a collection of events. - # *Note: this endpoint differs from the standard Chargify API endpoints in - # that the subdomain will be `events` and your site subdomain will be - # included in the URL path.* + # Note: this endpoint differs from the standard URL for this API in that + # `events` and your site subdomain are included in the path. # A maximum of 1000 events can be published in a single request. A 422 will # be returned if this limit is exceeded. # @param [String] api_handle Required parameter: Identifies the Stream for diff --git a/lib/advanced_billing/controllers/subscription_groups_controller.rb b/lib/advanced_billing/controllers/subscription_groups_controller.rb index dd6ff6e..ce52a6d 100644 --- a/lib/advanced_billing/controllers/subscription_groups_controller.rb +++ b/lib/advanced_billing/controllers/subscription_groups_controller.rb @@ -199,8 +199,7 @@ def delete_subscription_group(uid) end # Finds the subscription group associated with a subscription. - # If the subscription is not in a group, the endpoint will return a 404 - # code. + # If the subscription is not in a group, this endpoint returns an error. # @param [String] subscription_id Required parameter: The Advanced Billing # id of the subscription associated with the subscription group # @return [FullSubscriptionGroupResponse] Response from the API call. diff --git a/lib/advanced_billing/controllers/subscription_notes_controller.rb b/lib/advanced_billing/controllers/subscription_notes_controller.rb index 0b43c6e..e9a8007 100644 --- a/lib/advanced_billing/controllers/subscription_notes_controller.rb +++ b/lib/advanced_billing/controllers/subscription_notes_controller.rb @@ -7,15 +7,15 @@ module AdvancedBilling # SubscriptionNotesController class SubscriptionNotesController < BaseController # Creates a note for a subscription. - # ## How to Use Subscription Notes # Notes allow you to record information about a particular Subscription in a # free text format. # If you have structured data such as birth date, color, etc., consider - # using Metadata instead. - # Full documentation on how to use Notes in the Advanced Billing UI can be - # located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24251712214413-Subscrip - # tion-Summary-Overview). + # using [Metadata]($e/Custom%20Fields/createMetadata) instead. + # For more information, see [Adding + # Notes](https://docs.maxio.com/hc/en-us/articles/24251654953997-Understandi + # ng-the-Subscription-Summary-Page#billing-portal-status:~:text=documentatio + # n%20for%20more.-,Adding%20Notes,-Notes%20are%20optional) in the product + # documentation. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [UpdateSubscriptionNoteRequest] body Optional parameter: TODO: type diff --git a/lib/advanced_billing/controllers/subscription_products_controller.rb b/lib/advanced_billing/controllers/subscription_products_controller.rb index 8ab5ac5..cb3952d 100644 --- a/lib/advanced_billing/controllers/subscription_products_controller.rb +++ b/lib/advanced_billing/controllers/subscription_products_controller.rb @@ -7,25 +7,23 @@ module AdvancedBilling # SubscriptionProductsController class SubscriptionProductsController < BaseController # Migrates a subscription to a different product. - # In order to create a migration, you must pass the `product_id` or - # `product_handle` in the object when you send a POST request. You may also - # pass either a `product_price_point_id` or `product_price_point_handle` to - # choose which price point the subscription is moved to. If no price point - # identifier is passed the subscription will be moved to the products - # default price point. The response will be the updated subscription. + # To create a migration, you must pass the `product_id` or `product_handle` + # in the object when you send a POST request. You can also pass either a + # `product_price_point_id` or `product_price_point_handle` to choose which + # price point the subscription is moved to. If no price point identifier is + # passed, the subscription is moved to the product's default price point. + # The response is the updated subscription. # ## Valid Subscriptions - # Subscriptions should be in the `active` or `trialing` state in order to be + # Subscriptions should be in the `active` or `trialing` state to be # migrated. # (For backwards compatibility reasons, it is possible to migrate a # subscription that is in the `trial_ended` state via the API, however this # is not recommended. Since `trial_ended` is an end-of-life state, the # subscription should be canceled, the product changed, and then the # subscription can be reactivated.) - # ## Migrations Documentation - # Full documentation on how to record Migrations in the Advanced Billing UI - # can be located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24181589372429-Data-Mig - # ration-to-Advanced-Billing). + # For more information, see [Product Changes and + # Migrations](https://docs.maxio.com/hc/en-us/articles/24252069837581-Produc + # t-Changes-and-Migrations). # ## Failed Migrations # Important note: One of the most common ways that a migration can fail is # when the attempt is made to migrate a subscription to its current product. diff --git a/lib/advanced_billing/controllers/subscription_status_controller.rb b/lib/advanced_billing/controllers/subscription_status_controller.rb index 275283a..70dae7b 100644 --- a/lib/advanced_billing/controllers/subscription_status_controller.rb +++ b/lib/advanced_billing/controllers/subscription_status_controller.rb @@ -450,33 +450,33 @@ def cancel_dunning(subscription_id) # to see a snapshot of how much your customer will be charged on their next # renewal. # The "Next Billing" amount and "Next Billing" date are already represented - # in the UI on each Subscriber's Summary. For more information, see our - # documentation - # [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscrib - # er-Interface-Overview). + # in the UI on each Subscriber's Summary. For more information, see + # [Subscriber Interface + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subsc + # riber-Interface-Overview). # ## Optional Component Fields - # This endpoint is particularly useful due to the fact that it will return - # the computed billing amount for the base product and the components which - # are in use by a subscriber. - # By default, the preview will include billing details for all components - # _at their **current** quantities_. This means: + # This endpoint is particularly useful because it returns the computed + # billing amount for the base product and the components which are in use by + # a subscriber. + # By default, the preview includes billing details for all components _at + # their **current** quantities_. This means: # * Current `allocated_quantity` for quantity-based components # * Current enabled/disabled status for on/off components # * Current metered usage `unit_balance` for metered components # * Current metric quantity value for events recorded thus far for # events-based components # In the above statements, "current" means the quantity or value as of the - # call to the renewal preview endpoint. We do not predict end-of-period - # values for components, so metered or events-based usage may be less than - # it will eventually be at the end of the period. - # Optionally, **you may provide your own custom quantities** for any + # call to the renewal preview endpoint. End-of-period values for components + # are not predicted, so metered or events-based usage may be less than it + # will eventually be at the end of the period. + # Optionally, **you can provide your own custom quantities** for any # component to see a billing preview for non-current quantities. This is # accomplished by sending a request body with data under the `components` # key. See the request body documentation below. - # ## Subscription Side Effects - # You can request a `POST` to obtain this data from the endpoint without any - # side effects. This method allows you to preview data, but does not log any - # changes against a subscription. + # ## Preview Behavior + # Sending a `POST` request to this endpoint returns preview data without + # modifying the subscription. This method previews data, but does not log + # any changes against a subscription. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [RenewalPreviewRequest] body Optional parameter: TODO: type diff --git a/lib/advanced_billing/controllers/subscriptions_controller.rb b/lib/advanced_billing/controllers/subscriptions_controller.rb index 5e9f2c7..ed9297e 100644 --- a/lib/advanced_billing/controllers/subscriptions_controller.rb +++ b/lib/advanced_billing/controllers/subscriptions_controller.rb @@ -485,7 +485,7 @@ def find_subscription(reference: nil) end # Purges an individual subscription for sites in test mode. - # Provide the subscription ID in the url. To confirm, supply the customer + # Provide the subscription ID in the URL. To confirm, supply the customer # ID in the query string `ack` parameter. You may also delete the customer # record and/or payment profiles by passing `cascade` parameters. For # example, to delete just the customer record, the query params would be: @@ -562,11 +562,11 @@ def update_prepaid_subscription_configuration(subscription_id, # subscription creation. # The "Next Billing" amount and "Next Billing" date are represented in each # Subscriber's Summary. - # A subscription will not be created by utilizing this endpoint; it is meant - # to serve as a prediction. - # For more information, see our documentation - # [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscrib - # er-Interface-Overview). + # This endpoint does not create a subscription; it is meant to serve as a + # prediction. + # For more information, see [Subscriber Interface + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subsc + # riber-Interface-Overview). # ## Subscriptions can now work independently from the catalog # If you have the new [Catalog # experience](page:help/announcements/2026-announcements#new-catalog-experie @@ -585,30 +585,27 @@ def update_prepaid_subscription_configuration(subscription_id, # This functionality is supported in the API, but is not currently supported # in SDKs. # ## Taxable Subscriptions - # This endpoint will preview taxes applicable to a purchase. In order for - # taxes to be previewed, the following conditions must be met: + # This endpoint previews taxes applicable to a purchase. For taxes to be + # previewed, the following conditions must be met: # + Taxes must be configured on the subscription # + The preview must be for the purchase of a taxable product or component, # or combination of the two. # + The subscription payload must contain a full billing or shipping address - # in order to calculate tax - # For more information about creating taxable previews, see our - # documentation guide on how to create [taxable - # subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349325 - # -Taxes) + # to calculate tax + # For more information about creating taxable previews, see + # [Taxes](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes). # You do **not** need to include a card number to generate tax information # when you are previewing a subscription. However, when you actually want to # create the subscription, you must include the credit card information if - # you want the billing address to be stored in Advanced Billing. The billing - # address and the credit card information are stored together within the - # payment profile object. Also, you may not send a billing address to - # Advanced Billing without payment profile information, as the address is - # stored on the card. + # you want the billing address to be stored. The billing address and the + # credit card information are stored together within the payment profile + # object. Also, you cannot send a billing address without payment profile + # information, as the address is stored on the card. # You can pass shipping and billing addresses and still decide not to # calculate taxes. To do that, pass `skip_billing_manifest_taxes: true` # attribute. # ## Non-taxable Subscriptions - # If you'd like to calculate subscriptions that do not include tax you may + # If you'd like to calculate subscriptions that do not include tax, you can # leave off the billing information. # @param [CreateSubscriptionRequest] body Optional parameter: TODO: type # description here @@ -678,9 +675,9 @@ def apply_coupons_to_subscription(subscription_id, # Removes a coupon from an existing subscription. # For more information on the expected behavior of removing a coupon from a - # subscription, see our documentation - # [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons - # -and-Subscriptions#removing-a-coupon) + # subscription, see [Coupons and + # Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101- + # Coupons-and-Subscriptions#removing-a-coupon). # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [String] coupon_code Optional parameter: The coupon code @@ -709,23 +706,20 @@ def remove_coupon_from_subscription(subscription_id, # Activates awaiting signup and trialing subscriptions. This feature is only # available on the Relationship Invoicing architecture. Subscriptions in a - # group may not be activated immediately. - # For details on how the activation works, and how to activate subscriptions - # through the application, see [activation](#). + # group cannot be activated immediately. # The `revert_on_failure` parameter controls the behavior upon activation # failure. - # - If set to `true` and something goes wrong i.e. payment fails, then - # Advanced Billing will not change the subscription's state. The - # subscription’s billing period will also remain the same. - # - If set to `false` and something goes wrong i.e. payment fails, then - # Advanced Billing will continue through with the activation and enter an - # end of life state. For trialing subscriptions, that will either be trial - # ended (if the trial is no obligation), past due (if the trial has an - # obligation), or canceled (if the site has no dunning strategy, or has a - # strategy that says to cancel immediately). For awaiting signup - # subscriptions, that will always be canceled. + # - If set to `true` and something goes wrong i.e. payment fails, the + # subscription's state does not change. The subscription’s billing period + # also remains the same. + # - If set to `false` and something goes wrong i.e. payment fails, the + # activation continues and enters an end of life state. For trialing + # subscriptions, that is either trial ended (if the trial is no obligation), + # past due (if the trial has an obligation), or canceled (if the site has no + # dunning strategy, or has a strategy that says to cancel immediately). For + # awaiting signup subscriptions, that is always canceled. # The default activation failure behavior can be configured per activation - # attempt, or you may set a default value under Config > Settings > + # attempt, or you can set a default value under Config > Settings > # Subscription Activation Settings. # ## Activation Scenarios # ### Activate Awaiting Signup subscription @@ -750,13 +744,14 @@ def remove_coupon_from_subscription(subscription_id, # ROF -->|false| PD[Past Due] # ``` # ### Activate Trialing subscription - # You can read more about the behavior of trialing subscriptions - # [here](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing - # -Subscriptions). + # For more information about the behavior of trialing subscriptions, see + # [Trialing + # Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24252155721869- + # Trialing-Subscriptions). # When the `revert_on_failure` parameter is set to `true`, the - # subscription's state will remain as Trialing, we will void the invoice - # from activation and return any prepayments and credits applied to the - # invoice back to the subscription. + # subscription's state remains Trialing; the invoice from activation is + # voided, and any prepayments and credits applied to the invoice are + # returned to the subscription. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [ActivateSubscriptionRequest] body Optional parameter: TODO: type diff --git a/lib/advanced_billing/models/event.rb b/lib/advanced_billing/models/event.rb index b7576bf..e2447f0 100644 --- a/lib/advanced_billing/models/event.rb +++ b/lib/advanced_billing/models/event.rb @@ -36,9 +36,8 @@ class Event < BaseModel # The schema varies based on the event key. The key-to-event data mapping is # as follows: - # * `subscription_product_change` - SubscriptionProductChange - # * `subscription_product_change_scheduled` - - # SubscriptionProductChangeScheduled + # * `subscription_product_change`, `subscription_product_change_scheduled` - + # SubscriptionProductChange # * `subscription_state_change` - SubscriptionStateChange # * `signup_success`, `delayed_signup_creation_success`, `payment_success`, # `payment_failure`, `renewal_success`, `renewal_failure`, diff --git a/lib/advanced_billing/models/subscription_product_change.rb b/lib/advanced_billing/models/subscription_product_change.rb index 4698d6a..fc34005 100644 --- a/lib/advanced_billing/models/subscription_product_change.rb +++ b/lib/advanced_billing/models/subscription_product_change.rb @@ -3,8 +3,11 @@ # This file was automatically generated for Maxio by # APIMATIC v3.0 ( https://www.apimatic.io ). +require 'date' module AdvancedBilling - # SubscriptionProductChange Model. + # Event data for both `subscription_product_change` and + # `subscription_product_change_scheduled`. The price point and `effective_at` + # fields are only populated for scheduled changes. class SubscriptionProductChange < BaseModel SKIP = Object.new private_constant :SKIP @@ -17,25 +20,52 @@ class SubscriptionProductChange < BaseModel # @return [Integer] attr_accessor :new_product_id + # TODO: Write general description for this method + # @return [Integer] + attr_accessor :previous_product_price_point_id + + # TODO: Write general description for this method + # @return [Integer] + attr_accessor :new_product_price_point_id + + # When the scheduled product change takes effect (the subscription's next + # renewal). Only sent for `subscription_product_change_scheduled`. + # @return [DateTime] + attr_accessor :effective_at + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @_hash['previous_product_id'] = 'previous_product_id' @_hash['new_product_id'] = 'new_product_id' + @_hash['previous_product_price_point_id'] = + 'previous_product_price_point_id' + @_hash['new_product_price_point_id'] = 'new_product_price_point_id' + @_hash['effective_at'] = 'effective_at' @_hash end # An array for optional fields def self.optionals - [] + %w[ + previous_product_price_point_id + new_product_price_point_id + effective_at + ] end # An array for nullable fields def self.nullables - [] + %w[ + previous_product_price_point_id + new_product_price_point_id + effective_at + ] end def initialize(previous_product_id:, new_product_id:, + previous_product_price_point_id: SKIP, + new_product_price_point_id: SKIP, effective_at: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| @@ -44,6 +74,15 @@ def initialize(previous_product_id:, new_product_id:, @previous_product_id = previous_product_id @new_product_id = new_product_id + unless previous_product_price_point_id == SKIP + @previous_product_price_point_id = + previous_product_price_point_id + end + unless new_product_price_point_id == SKIP + @new_product_price_point_id = + new_product_price_point_id + end + @effective_at = effective_at unless effective_at == SKIP end # Creates an instance of the object from a hash. @@ -55,6 +94,15 @@ def self.from_hash(hash) hash.key?('previous_product_id') ? hash['previous_product_id'] : nil new_product_id = hash.key?('new_product_id') ? hash['new_product_id'] : nil + previous_product_price_point_id = + hash.key?('previous_product_price_point_id') ? hash['previous_product_price_point_id'] : SKIP + new_product_price_point_id = + hash.key?('new_product_price_point_id') ? hash['new_product_price_point_id'] : SKIP + effective_at = if hash.key?('effective_at') + (DateTimeHelper.from_rfc3339(hash['effective_at']) if hash['effective_at']) + else + SKIP + end # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -62,9 +110,16 @@ def self.from_hash(hash) # Create object from extracted values. SubscriptionProductChange.new(previous_product_id: previous_product_id, new_product_id: new_product_id, + previous_product_price_point_id: previous_product_price_point_id, + new_product_price_point_id: new_product_price_point_id, + effective_at: effective_at, additional_properties: additional_properties) end + def to_custom_effective_at + DateTimeHelper.to_rfc3339(effective_at) + end + # Validates an instance of the object from a given value. # @param [SubscriptionProductChange | Hash] The value against the validation is performed. def self.validate(value) @@ -91,14 +146,19 @@ def self.validate(value) def to_s class_name = self.class.name.split('::').last "<#{class_name} previous_product_id: #{@previous_product_id}, new_product_id:"\ - " #{@new_product_id}, additional_properties: #{get_additional_properties}>" + " #{@new_product_id}, previous_product_price_point_id: #{@previous_product_price_point_id},"\ + " new_product_price_point_id: #{@new_product_price_point_id}, effective_at:"\ + " #{@effective_at}, additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. def inspect class_name = self.class.name.split('::').last "<#{class_name} previous_product_id: #{@previous_product_id.inspect}, new_product_id:"\ - " #{@new_product_id.inspect}, additional_properties: #{get_additional_properties}>" + " #{@new_product_id.inspect}, previous_product_price_point_id:"\ + " #{@previous_product_price_point_id.inspect}, new_product_price_point_id:"\ + " #{@new_product_price_point_id.inspect}, effective_at: #{@effective_at.inspect},"\ + " additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/subscription_product_change_scheduled.rb b/lib/advanced_billing/models/subscription_product_change_scheduled.rb deleted file mode 100644 index 1a93018..0000000 --- a/lib/advanced_billing/models/subscription_product_change_scheduled.rb +++ /dev/null @@ -1,162 +0,0 @@ -# advanced_billing -# -# This file was automatically generated for Maxio by -# APIMATIC v3.0 ( https://www.apimatic.io ). - -require 'date' -module AdvancedBilling - # SubscriptionProductChangeScheduled Model. - class SubscriptionProductChangeScheduled < BaseModel - SKIP = Object.new - private_constant :SKIP - - # TODO: Write general description for this method - # @return [Integer] - attr_accessor :previous_product_id - - # TODO: Write general description for this method - # @return [Integer] - attr_accessor :new_product_id - - # TODO: Write general description for this method - # @return [Integer] - attr_accessor :previous_product_price_point_id - - # TODO: Write general description for this method - # @return [Integer] - attr_accessor :new_product_price_point_id - - # When the scheduled product change takes effect (the subscription's next - # renewal). - # @return [DateTime] - attr_accessor :effective_at - - # A mapping from model property names to API property names. - def self.names - @_hash = {} if @_hash.nil? - @_hash['previous_product_id'] = 'previous_product_id' - @_hash['new_product_id'] = 'new_product_id' - @_hash['previous_product_price_point_id'] = - 'previous_product_price_point_id' - @_hash['new_product_price_point_id'] = 'new_product_price_point_id' - @_hash['effective_at'] = 'effective_at' - @_hash - end - - # An array for optional fields - def self.optionals - %w[ - previous_product_price_point_id - new_product_price_point_id - effective_at - ] - end - - # An array for nullable fields - def self.nullables - %w[ - previous_product_price_point_id - new_product_price_point_id - effective_at - ] - end - - def initialize(previous_product_id:, new_product_id:, - previous_product_price_point_id: SKIP, - new_product_price_point_id: SKIP, effective_at: SKIP, - additional_properties: {}) - # Add additional model properties to the instance. - additional_properties.each do |_name, _value| - instance_variable_set("@#{_name}", _value) - end - - @previous_product_id = previous_product_id - @new_product_id = new_product_id - unless previous_product_price_point_id == SKIP - @previous_product_price_point_id = - previous_product_price_point_id - end - unless new_product_price_point_id == SKIP - @new_product_price_point_id = - new_product_price_point_id - end - @effective_at = effective_at unless effective_at == SKIP - end - - # Creates an instance of the object from a hash. - def self.from_hash(hash) - return nil unless hash - - # Extract variables from the hash. - previous_product_id = - hash.key?('previous_product_id') ? hash['previous_product_id'] : nil - new_product_id = - hash.key?('new_product_id') ? hash['new_product_id'] : nil - previous_product_price_point_id = - hash.key?('previous_product_price_point_id') ? hash['previous_product_price_point_id'] : SKIP - new_product_price_point_id = - hash.key?('new_product_price_point_id') ? hash['new_product_price_point_id'] : SKIP - effective_at = if hash.key?('effective_at') - (DateTimeHelper.from_rfc3339(hash['effective_at']) if hash['effective_at']) - else - SKIP - end - - # Clean out expected properties from Hash. - additional_properties = hash.reject { |k, _| names.value?(k) } - - # Create object from extracted values. - SubscriptionProductChangeScheduled.new(previous_product_id: previous_product_id, - new_product_id: new_product_id, - previous_product_price_point_id: previous_product_price_point_id, - new_product_price_point_id: new_product_price_point_id, - effective_at: effective_at, - additional_properties: additional_properties) - end - - def to_custom_effective_at - DateTimeHelper.to_rfc3339(effective_at) - end - - # Validates an instance of the object from a given value. - # @param [SubscriptionProductChangeScheduled | Hash] The value against the validation is performed. - def self.validate(value) - if value.instance_of? self - return ( - APIHelper.valid_type?(value.previous_product_id, - ->(val) { val.instance_of? Integer }) and - APIHelper.valid_type?(value.new_product_id, - ->(val) { val.instance_of? Integer }) - ) - end - - return false unless value.instance_of? Hash - - ( - APIHelper.valid_type?(value['previous_product_id'], - ->(val) { val.instance_of? Integer }) and - APIHelper.valid_type?(value['new_product_id'], - ->(val) { val.instance_of? Integer }) - ) - end - - # Provides a human-readable string representation of the object. - def to_s - class_name = self.class.name.split('::').last - "<#{class_name} previous_product_id: #{@previous_product_id}, new_product_id:"\ - " #{@new_product_id}, previous_product_price_point_id: #{@previous_product_price_point_id},"\ - " new_product_price_point_id: #{@new_product_price_point_id}, effective_at:"\ - " #{@effective_at}, additional_properties: #{get_additional_properties}>" - end - - # Provides a debugging-friendly string with detailed object information. - def inspect - class_name = self.class.name.split('::').last - "<#{class_name} previous_product_id: #{@previous_product_id.inspect}, new_product_id:"\ - " #{@new_product_id.inspect}, previous_product_price_point_id:"\ - " #{@previous_product_price_point_id.inspect}, new_product_price_point_id:"\ - " #{@new_product_price_point_id.inspect}, effective_at: #{@effective_at.inspect},"\ - " additional_properties: #{get_additional_properties}>" - end - end -end diff --git a/lib/advanced_billing/utilities/union_type_lookup.rb b/lib/advanced_billing/utilities/union_type_lookup.rb index f30089a..93e935a 100644 --- a/lib/advanced_billing/utilities/union_type_lookup.rb +++ b/lib/advanced_billing/utilities/union_type_lookup.rb @@ -637,7 +637,6 @@ def self.union_types :EventEventSpecificData => OneOf.new( [ LeafType.new(SubscriptionProductChange), - LeafType.new(SubscriptionProductChangeScheduled), LeafType.new(SubscriptionStateChange), LeafType.new(PaymentRelatedEvents), LeafType.new(RefundSuccess), From e55da49cbe4be772be8ea71e0e51c8923de1f319 Mon Sep 17 00:00:00 2001 From: lucassus Date: Thu, 13 Aug 2026 14:21:52 +0000 Subject: [PATCH 9/9] Automated commit message --- doc/models/q-scope.md | 3 +-- doc/models/subscription-list-include.md | 3 +-- lib/advanced_billing/models/q_scope.rb | 6 +----- lib/advanced_billing/models/subscription_list_include.rb | 4 ---- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/doc/models/q-scope.md b/doc/models/q-scope.md index 0d3c8ec..9e9a025 100644 --- a/doc/models/q-scope.md +++ b/doc/models/q-scope.md @@ -15,11 +15,10 @@ | `ORGANIZATION` | | `CUSTOMER_REFERENCE` | | `SUBSCRIPTION_REFERENCE` | -| `LAST_FOUR` | ## Example ```ruby -q_scope = QScope::SUBSCRIPTION_REFERENCE +q_scope = QScope::LAST_NAME ``` diff --git a/doc/models/subscription-list-include.md b/doc/models/subscription-list-include.md index 20beffc..cfced66 100644 --- a/doc/models/subscription-list-include.md +++ b/doc/models/subscription-list-include.md @@ -12,12 +12,11 @@ | `SELF_SERVICE_PAGE_TOKEN` | | `CURRENT_ACCOUNT_BALANCE_IN_CENTS` | | `CURRENT_BILLING_AMOUNT` | -| `THREE_DS_ACTION_LINK` | | `COUPONS` | ## Example ```ruby -subscription_list_include = SubscriptionListInclude::THREE_DS_ACTION_LINK +subscription_list_include = SubscriptionListInclude::SELF_SERVICE_PAGE_TOKEN ``` diff --git a/lib/advanced_billing/models/q_scope.rb b/lib/advanced_billing/models/q_scope.rb index 0d4a4ec..a3a7afb 100644 --- a/lib/advanced_billing/models/q_scope.rb +++ b/lib/advanced_billing/models/q_scope.rb @@ -23,10 +23,7 @@ class QScope CUSTOMER_REFERENCE = 'customer_reference'.freeze, # TODO: Write general description for SUBSCRIPTION_REFERENCE - SUBSCRIPTION_REFERENCE = 'subscription_reference'.freeze, - - # TODO: Write general description for LAST_FOUR - LAST_FOUR = 'last_four'.freeze + SUBSCRIPTION_REFERENCE = 'subscription_reference'.freeze ].freeze def self.validate(value) @@ -47,7 +44,6 @@ def self.from_value(value, default_value = FULL_NAME) when 'organization' then ORGANIZATION when 'customer_reference' then CUSTOMER_REFERENCE when 'subscription_reference' then SUBSCRIPTION_REFERENCE - when 'last_four' then LAST_FOUR else default_value end diff --git a/lib/advanced_billing/models/subscription_list_include.rb b/lib/advanced_billing/models/subscription_list_include.rb index 0170ada..e1f0789 100644 --- a/lib/advanced_billing/models/subscription_list_include.rb +++ b/lib/advanced_billing/models/subscription_list_include.rb @@ -16,9 +16,6 @@ class SubscriptionListInclude # TODO: Write general description for CURRENT_BILLING_AMOUNT CURRENT_BILLING_AMOUNT = 'current_billing_amount'.freeze, - # TODO: Write general description for THREE_DS_ACTION_LINK - THREE_DS_ACTION_LINK = 'three_ds_action_link'.freeze, - # TODO: Write general description for COUPONS COUPONS = 'coupons'.freeze ].freeze @@ -38,7 +35,6 @@ def self.from_value(value, default_value = SELF_SERVICE_PAGE_TOKEN) when 'self_service_page_token' then SELF_SERVICE_PAGE_TOKEN when 'current_account_balance_in_cents' then CURRENT_ACCOUNT_BALANCE_IN_CENTS when 'current_billing_amount' then CURRENT_BILLING_AMOUNT - when 'three_ds_action_link' then THREE_DS_ACTION_LINK when 'coupons' then COUPONS else default_value