maxio-advanced-billing-sdk 7.0.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +101 -43
  3. data/bin/console +15 -0
  4. data/lib/advanced_billing/client.rb +14 -3
  5. data/lib/advanced_billing/configuration.rb +82 -5
  6. data/lib/advanced_billing/controllers/advance_invoice_controller.rb +2 -2
  7. data/lib/advanced_billing/controllers/base_controller.rb +1 -1
  8. data/lib/advanced_billing/controllers/billing_portal_controller.rb +2 -2
  9. data/lib/advanced_billing/controllers/component_price_points_controller.rb +3 -4
  10. data/lib/advanced_billing/controllers/components_controller.rb +7 -8
  11. data/lib/advanced_billing/controllers/coupons_controller.rb +5 -11
  12. data/lib/advanced_billing/controllers/custom_fields_controller.rb +102 -128
  13. data/lib/advanced_billing/controllers/customers_controller.rb +6 -6
  14. data/lib/advanced_billing/controllers/invoices_controller.rb +48 -11
  15. data/lib/advanced_billing/controllers/payment_profiles_controller.rb +76 -250
  16. data/lib/advanced_billing/controllers/product_families_controller.rb +7 -8
  17. data/lib/advanced_billing/controllers/product_price_points_controller.rb +15 -17
  18. data/lib/advanced_billing/controllers/products_controller.rb +7 -8
  19. data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +1 -1
  20. data/lib/advanced_billing/controllers/sales_commissions_controller.rb +3 -3
  21. data/lib/advanced_billing/controllers/subscription_components_controller.rb +53 -44
  22. data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +9 -9
  23. data/lib/advanced_billing/controllers/subscription_groups_controller.rb +10 -5
  24. data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +1 -1
  25. data/lib/advanced_billing/controllers/subscription_products_controller.rb +6 -7
  26. data/lib/advanced_billing/controllers/subscription_status_controller.rb +6 -7
  27. data/lib/advanced_billing/controllers/subscriptions_controller.rb +87 -810
  28. data/lib/advanced_billing/controllers/webhooks_controller.rb +23 -48
  29. data/lib/advanced_billing/http/auth/basic_auth.rb +12 -0
  30. data/lib/advanced_billing/http/proxy_settings.rb +22 -0
  31. data/lib/advanced_billing/models/activate_event_based_component.rb +1 -2
  32. data/lib/advanced_billing/models/all_vaults.rb +45 -0
  33. data/lib/advanced_billing/models/allocation_preview_direction.rb +13 -0
  34. data/lib/advanced_billing/models/allocation_preview_line_item_kind.rb +15 -0
  35. data/lib/advanced_billing/models/apple_pay_vault.rb +6 -0
  36. data/lib/advanced_billing/models/auto_invite.rb +19 -0
  37. data/lib/advanced_billing/models/bank_account_holder_type.rb +13 -0
  38. data/lib/advanced_billing/models/bank_account_type.rb +13 -0
  39. data/lib/advanced_billing/models/bank_account_vault.rb +19 -0
  40. data/lib/advanced_billing/models/basic_date_field.rb +13 -0
  41. data/lib/advanced_billing/models/billing_manifest_line_item_kind.rb +17 -0
  42. data/lib/advanced_billing/models/billing_schedule.rb +2 -2
  43. data/lib/advanced_billing/models/calendar_billing.rb +3 -1
  44. data/lib/advanced_billing/models/cancellation_method.rb +17 -0
  45. data/lib/advanced_billing/models/card_type.rb +47 -0
  46. data/lib/advanced_billing/models/chargeback_status.rb +15 -0
  47. data/lib/advanced_billing/models/chargify_ebb.rb +4 -4
  48. data/lib/advanced_billing/models/cleanup_scope.rb +13 -0
  49. data/lib/advanced_billing/models/collection_method.rb +15 -0
  50. data/lib/advanced_billing/models/component.rb +31 -31
  51. data/lib/advanced_billing/models/component_custom_price.rb +61 -3
  52. data/lib/advanced_billing/models/component_kind.rb +16 -0
  53. data/lib/advanced_billing/models/compounding_strategy.rb +13 -0
  54. data/lib/advanced_billing/models/create_allocation.rb +1 -2
  55. data/lib/advanced_billing/models/create_invoice_coupon.rb +16 -7
  56. data/lib/advanced_billing/models/create_invoice_item.rb +5 -5
  57. data/lib/advanced_billing/models/create_invoice_status.rb +13 -0
  58. data/lib/advanced_billing/models/create_metafield.rb +3 -5
  59. data/lib/advanced_billing/models/create_or_update_product.rb +12 -7
  60. data/lib/advanced_billing/models/create_payment_profile.rb +6 -6
  61. data/lib/advanced_billing/models/create_prepayment_method.rb +19 -0
  62. data/lib/advanced_billing/models/create_product_price_point.rb +8 -3
  63. data/lib/advanced_billing/models/create_signup_proforma_preview_include.rb +6 -0
  64. data/lib/advanced_billing/models/create_usage.rb +17 -7
  65. data/lib/advanced_billing/models/credit_card_vault.rb +44 -0
  66. data/lib/advanced_billing/models/credit_note_status.rb +13 -0
  67. data/lib/advanced_billing/models/credit_scheme.rb +14 -0
  68. data/lib/advanced_billing/models/credit_type.rb +14 -0
  69. data/lib/advanced_billing/models/currency_price_role.rb +14 -0
  70. data/lib/advanced_billing/models/custom_field_owner.rb +13 -0
  71. data/lib/advanced_billing/models/debit_note_role.rb +13 -0
  72. data/lib/advanced_billing/models/debit_note_status.rb +15 -0
  73. data/lib/advanced_billing/models/direction.rb +13 -0
  74. data/lib/advanced_billing/models/discount_type.rb +13 -0
  75. data/lib/advanced_billing/models/ebb_component.rb +2 -2
  76. data/lib/advanced_billing/models/event_key.rb +91 -0
  77. data/lib/advanced_billing/models/expiration_interval_unit.rb +14 -0
  78. data/lib/advanced_billing/models/failed_payment_action.rb +14 -0
  79. data/lib/advanced_billing/models/first_charge_type.rb +14 -0
  80. data/lib/advanced_billing/models/group_target_type.rb +16 -0
  81. data/lib/advanced_billing/models/group_type.rb +13 -0
  82. data/lib/advanced_billing/models/include_not_null.rb +6 -0
  83. data/lib/advanced_billing/models/include_null_or_not_null.rb +13 -0
  84. data/lib/advanced_billing/models/include_option.rb +13 -0
  85. data/lib/advanced_billing/models/interval_unit.rb +13 -0
  86. data/lib/advanced_billing/models/invoice_consolidation_level.rb +14 -0
  87. data/lib/advanced_billing/models/invoice_date_field.rb +16 -0
  88. data/lib/advanced_billing/models/invoice_discount_source_type.rb +14 -0
  89. data/lib/advanced_billing/models/invoice_discount_type.rb +14 -0
  90. data/lib/advanced_billing/models/invoice_event_payment_method.rb +16 -0
  91. data/lib/advanced_billing/models/invoice_event_type.rb +26 -0
  92. data/lib/advanced_billing/models/invoice_payment_method_type.rb +17 -0
  93. data/lib/advanced_billing/models/invoice_payment_type.rb +15 -0
  94. data/lib/advanced_billing/models/invoice_role.rb +21 -0
  95. data/lib/advanced_billing/models/invoice_sort_field.rb +19 -0
  96. data/lib/advanced_billing/models/invoice_status.rb +18 -0
  97. data/lib/advanced_billing/models/item_category.rb +16 -0
  98. data/lib/advanced_billing/models/line_item_kind.rb +21 -0
  99. data/lib/advanced_billing/models/line_item_transaction_type.rb +18 -0
  100. data/lib/advanced_billing/models/list_components_price_points_include.rb +6 -0
  101. data/lib/advanced_billing/models/list_coupons_filter.rb +22 -6
  102. data/lib/advanced_billing/models/list_events_date_field.rb +6 -0
  103. data/lib/advanced_billing/models/list_prepayment_date_field.rb +13 -0
  104. data/lib/advanced_billing/models/list_products_include.rb +6 -0
  105. data/lib/advanced_billing/models/list_products_price_points_include.rb +6 -0
  106. data/lib/advanced_billing/models/list_subscription_components_include.rb +13 -0
  107. data/lib/advanced_billing/models/list_subscription_components_sort.rb +13 -0
  108. data/lib/advanced_billing/models/metafield.rb +8 -11
  109. data/lib/advanced_billing/models/metafield_input.rb +18 -5
  110. data/lib/advanced_billing/models/metafield_scope.rb +9 -4
  111. data/lib/advanced_billing/models/metered_component.rb +2 -2
  112. data/lib/advanced_billing/models/nested_subscription_group.rb +10 -0
  113. data/lib/advanced_billing/models/on_off_component.rb +2 -2
  114. data/lib/advanced_billing/models/pay_pal_vault.rb +15 -0
  115. data/lib/advanced_billing/models/payment_profile_attributes.rb +3 -3
  116. data/lib/advanced_billing/models/payment_type.rb +15 -0
  117. data/lib/advanced_billing/models/prepaid_configuration.rb +10 -0
  118. data/lib/advanced_billing/models/prepaid_usage_component.rb +2 -2
  119. data/lib/advanced_billing/models/prepayment_method.rb +18 -0
  120. data/lib/advanced_billing/models/price_point_type.rb +14 -0
  121. data/lib/advanced_billing/models/pricing_scheme.rb +15 -0
  122. data/lib/advanced_billing/models/product.rb +18 -8
  123. data/lib/advanced_billing/models/product_family.rb +10 -0
  124. data/lib/advanced_billing/models/product_price_point.rb +8 -3
  125. data/lib/advanced_billing/models/proforma_invoice_discount_source_type.rb +13 -0
  126. data/lib/advanced_billing/models/proforma_invoice_role.rb +15 -0
  127. data/lib/advanced_billing/models/proforma_invoice_status.rb +14 -0
  128. data/lib/advanced_billing/models/proforma_invoice_tax_source_type.rb +13 -0
  129. data/lib/advanced_billing/models/public_signup_page.rb +10 -0
  130. data/lib/advanced_billing/models/quantity_based_component.rb +2 -2
  131. data/lib/advanced_billing/models/reactivation_charge.rb +14 -0
  132. data/lib/advanced_billing/models/recurring_scheme.rb +14 -0
  133. data/lib/advanced_billing/models/resource_type.rb +13 -0
  134. data/lib/advanced_billing/models/restriction_type.rb +13 -0
  135. data/lib/advanced_billing/models/resume_options.rb +1 -1
  136. data/lib/advanced_billing/models/resumption_charge.rb +14 -0
  137. data/lib/advanced_billing/models/service_credit_type.rb +13 -0
  138. data/lib/advanced_billing/models/snap_day.rb +7 -2
  139. data/lib/advanced_billing/models/sorting_direction.rb +13 -0
  140. data/lib/advanced_billing/models/subscription.rb +16 -3
  141. data/lib/advanced_billing/models/subscription_custom_price.rb +23 -7
  142. data/lib/advanced_billing/models/subscription_date_field.rb +20 -0
  143. data/lib/advanced_billing/models/subscription_group_include.rb +6 -0
  144. data/lib/advanced_billing/models/subscription_group_prepayment_method.rb +17 -0
  145. data/lib/advanced_billing/models/subscription_groups_list_include.rb +6 -0
  146. data/lib/advanced_billing/models/subscription_include.rb +13 -0
  147. data/lib/advanced_billing/models/subscription_included_coupon.rb +10 -0
  148. data/lib/advanced_billing/models/subscription_list_date_field.rb +6 -0
  149. data/lib/advanced_billing/models/subscription_list_include.rb +6 -0
  150. data/lib/advanced_billing/models/subscription_purge_type.rb +13 -0
  151. data/lib/advanced_billing/models/subscription_sort.rb +17 -0
  152. data/lib/advanced_billing/models/subscription_state.rb +26 -0
  153. data/lib/advanced_billing/models/subscription_state_filter.rb +23 -0
  154. data/lib/advanced_billing/models/tax_configuration_kind.rb +15 -0
  155. data/lib/advanced_billing/models/tax_destination_address.rb +15 -0
  156. data/lib/advanced_billing/models/trial_type.rb +41 -0
  157. data/lib/advanced_billing/models/update_component.rb +2 -2
  158. data/lib/advanced_billing/models/update_metafield.rb +4 -6
  159. data/lib/advanced_billing/models/update_payment_profile.rb +3 -3
  160. data/lib/advanced_billing/models/update_subscription.rb +1 -0
  161. data/lib/advanced_billing/models/webhook_order.rb +13 -0
  162. data/lib/advanced_billing/models/webhook_status.rb +15 -0
  163. data/lib/advanced_billing/models/webhook_subscription.rb +46 -0
  164. data/lib/advanced_billing/utilities/union_type_lookup.rb +32 -5
  165. data/lib/advanced_billing.rb +2 -0
  166. metadata +11 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e794dec4e6e0ed8d205c57b25cd86308e63832c61276d5199c30e771380f982
4
- data.tar.gz: 51cdb3baf82c47a6517215e6d13b4fcc4f9e5b3c0796e2abebb83904de14202b
3
+ metadata.gz: 4162d051ddc0cf07b64fd725db7e949703d79f1d4f6d2392f6eebc7bab3d4a93
4
+ data.tar.gz: 219842157f663b67e9abbc765cd0789d7493a74638c104352bcf599877ec4d40
5
5
  SHA512:
6
- metadata.gz: e425f11949f8727347d53e007398adb921c065f4b95f273b45e1111e784726c6f00d6c3db2369c68a14055c6753678ba0b36bf335cdf1c240ede45f3e895773e
7
- data.tar.gz: 1b10ad59202050b50634794e3e6d2244146093a1fabb3a3231d70ce172c5ed014071ed5679f3c18e7f8542b6ee000e1e4643f20524a58817974406af15d06ad2
6
+ metadata.gz: 9b036081cec516a5b4a0029890bf667539a4907509c3547b86a84456e3a119b95ab8d0ed1ec35cd3be15fb3a6dc32847918e2f745122d579b78d2c8477a31ccf
7
+ data.tar.gz: 6f10a8b2cae2905d8bb8a6b110de110f2408173f0d6a61713e3a54b5ac2252cabddbab1654fb4ec0821703e2a662aba37c31e0d4c0f239c879003acb3011349d
data/README.md CHANGED
@@ -29,20 +29,55 @@ curl -u <api_key>:x -H Accept:application/json -H Content-Type:application/json
29
29
  Install the gem from the command line:
30
30
 
31
31
  ```bash
32
- gem install maxio-advanced-billing-sdk -v 7.0.0
32
+ gem install maxio-advanced-billing-sdk -v 8.0.0
33
33
  ```
34
34
 
35
35
  Or add the gem to your Gemfile and run `bundle`:
36
36
 
37
37
  ```ruby
38
- gem 'maxio-advanced-billing-sdk', '7.0.0'
38
+ gem 'maxio-advanced-billing-sdk', '8.0.0'
39
39
  ```
40
40
 
41
- For additional gem details, see the [RubyGems page for the maxio-advanced-billing-sdk gem](https://rubygems.org/gems/maxio-advanced-billing-sdk/versions/7.0.0).
41
+ For additional gem details, see the [RubyGems page for the maxio-advanced-billing-sdk gem](https://rubygems.org/gems/maxio-advanced-billing-sdk/versions/8.0.0).
42
+
43
+ ## IRB Console Usage
44
+
45
+ You can explore the SDK interactively using IRB in two ways
46
+
47
+ ### 1. Use IRB with Installed Gem
48
+
49
+ Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and type the following command to start the irb console.
50
+
51
+ ```bash
52
+ irb
53
+ ```
54
+
55
+ Now you can load the SDK in the IRB
56
+
57
+ ```ruby
58
+ require 'advanced_billing'
59
+ include AdvancedBilling
60
+ ```
61
+
62
+ ### 2. Use IRB within SDK
63
+
64
+ Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and navigate to the root folder of SDK.
65
+
66
+ ```
67
+ cd path/to/advanced_billing
68
+ ```
69
+
70
+ Now you can start the preconfigured irb console by running the following command
71
+
72
+ ```bash
73
+ ruby bin/console
74
+ ```
75
+
76
+ **_Note:_** This automatically loads the SDK from lib/
42
77
 
43
78
  ## Initialize the API Client
44
79
 
45
- **_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/client.md)
80
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/client.md)
46
81
 
47
82
  The following parameters are configurable for the API Client:
48
83
 
@@ -59,12 +94,18 @@ The following parameters are configurable for the API Client:
59
94
  | retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
60
95
  | retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
61
96
  | http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
62
- | basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication |
97
+ | proxy_settings | [`ProxySettings`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
98
+ | basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication |
63
99
 
64
100
  The API client can be initialized as follows:
65
101
 
102
+ ### Code-Based Client Initialization
103
+
66
104
  ```ruby
67
- client = AdvancedBilling::Client.new(
105
+ require 'advanced_billing'
106
+ include AdvancedBilling
107
+
108
+ client = Client.new(
68
109
  basic_auth_credentials: BasicAuthCredentials.new(
69
110
  username: 'BasicAuthUserName',
70
111
  password: 'BasicAuthPassword'
@@ -74,6 +115,18 @@ client = AdvancedBilling::Client.new(
74
115
  )
75
116
  ```
76
117
 
118
+ ### Environment-Based Client Initialization
119
+
120
+ ```ruby
121
+ require 'advanced_billing'
122
+ include AdvancedBilling
123
+
124
+ # Create client from environment
125
+ client = Client.from_env
126
+ ```
127
+
128
+ See the [`Environment-Based Client Initialization`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/environment-based-client-initialization.md) section for details.
129
+
77
130
  ## Environments
78
131
 
79
132
  The SDK can be configured to use a different environment for making API calls. Available environments are:
@@ -89,52 +142,57 @@ The SDK can be configured to use a different environment for making API calls. A
89
142
 
90
143
  This API uses the following authentication schemes.
91
144
 
92
- * [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/auth/basic-authentication.md)
145
+ * [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/auth/basic-authentication.md)
93
146
 
94
147
  ## List of APIs
95
148
 
96
- * [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/api-exports.md)
97
- * [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/advance-invoice.md)
98
- * [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/billing-portal.md)
99
- * [Component Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/component-price-points.md)
100
- * [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/custom-fields.md)
101
- * [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/events-based-billing-segments.md)
102
- * [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/payment-profiles.md)
103
- * [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/product-families.md)
104
- * [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/product-price-points.md)
105
- * [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/proforma-invoices.md)
106
- * [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/reason-codes.md)
107
- * [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/referral-codes.md)
108
- * [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/sales-commissions.md)
109
- * [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-components.md)
110
- * [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-groups.md)
111
- * [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-group-invoice-account.md)
112
- * [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-group-status.md)
113
- * [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-invoice-account.md)
114
- * [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-notes.md)
115
- * [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-products.md)
116
- * [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-status.md)
117
- * [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/coupons.md)
118
- * [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/components.md)
119
- * [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/customers.md)
120
- * [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/events.md)
121
- * [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/insights.md)
122
- * [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/invoices.md)
123
- * [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/offers.md)
124
- * [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/products.md)
125
- * [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/sites.md)
126
- * [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscriptions.md)
127
- * [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/webhooks.md)
149
+ * [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/api-exports.md)
150
+ * [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/advance-invoice.md)
151
+ * [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/billing-portal.md)
152
+ * [Component Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/component-price-points.md)
153
+ * [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/custom-fields.md)
154
+ * [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/events-based-billing-segments.md)
155
+ * [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/payment-profiles.md)
156
+ * [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/product-families.md)
157
+ * [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/product-price-points.md)
158
+ * [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/proforma-invoices.md)
159
+ * [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/reason-codes.md)
160
+ * [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/referral-codes.md)
161
+ * [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/sales-commissions.md)
162
+ * [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/subscription-components.md)
163
+ * [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/subscription-groups.md)
164
+ * [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/subscription-group-invoice-account.md)
165
+ * [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/subscription-group-status.md)
166
+ * [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/subscription-invoice-account.md)
167
+ * [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/subscription-notes.md)
168
+ * [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/subscription-products.md)
169
+ * [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/subscription-status.md)
170
+ * [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/coupons.md)
171
+ * [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/components.md)
172
+ * [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/customers.md)
173
+ * [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/events.md)
174
+ * [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/insights.md)
175
+ * [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/invoices.md)
176
+ * [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/offers.md)
177
+ * [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/products.md)
178
+ * [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/sites.md)
179
+ * [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/subscriptions.md)
180
+ * [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/controllers/webhooks.md)
128
181
 
129
182
  ## SDK Infrastructure
130
183
 
184
+ ### Configuration
185
+
186
+ * [ProxySettings](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/proxy-settings.md)
187
+ * [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/environment-based-client-initialization.md)
188
+
131
189
  ### HTTP
132
190
 
133
- * [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/http-response.md)
134
- * [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/http-request.md)
191
+ * [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/http-response.md)
192
+ * [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/http-request.md)
135
193
 
136
194
  ### Utilities
137
195
 
138
- * [ApiHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/api-helper.md)
139
- * [DateTimeHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/date-time-helper.md)
196
+ * [ApiHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/api-helper.md)
197
+ * [DateTimeHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/8.0.0/doc/date-time-helper.md)
140
198
 
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Load the lib folder into Ruby's load path
4
+ $LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
5
+
6
+ # Require the gem
7
+ require 'advanced_billing'
8
+
9
+ puts 'AdvancedBilling SDK loaded!'
10
+ puts 'You can now create a client with: client = AdvancedBilling::Client.new'
11
+ puts 'Or use from_env: client = AdvancedBilling::Client.from_env'
12
+
13
+ # Start an interactive IRB session
14
+ require 'irb'
15
+ IRB.start
@@ -9,6 +9,10 @@ module AdvancedBilling
9
9
  include CoreLibrary
10
10
  attr_reader :config, :auth_managers
11
11
 
12
+ def user_agent_detail
13
+ config.user_agent_detail
14
+ end
15
+
12
16
  # Access to api_exports controller.
13
17
  # @return [APIExportsController] Returns the controller instance.
14
18
  def api_exports
@@ -205,7 +209,7 @@ module AdvancedBilling
205
209
  connection: nil, adapter: :net_http_persistent, timeout: 120,
206
210
  max_retries: 0, retry_interval: 1, backoff_factor: 2,
207
211
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
208
- retry_methods: %i[get put], http_callback: nil,
212
+ retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
209
213
  environment: Environment::US, site: 'subdomain',
210
214
  basic_auth_credentials: nil, config: nil
211
215
  )
@@ -216,8 +220,8 @@ module AdvancedBilling
216
220
  backoff_factor: backoff_factor,
217
221
  retry_statuses: retry_statuses,
218
222
  retry_methods: retry_methods, http_callback: http_callback,
219
- environment: environment, site: site,
220
- basic_auth_credentials: basic_auth_credentials
223
+ proxy_settings: proxy_settings, environment: environment,
224
+ site: site, basic_auth_credentials: basic_auth_credentials
221
225
  )
222
226
  else
223
227
  config
@@ -242,5 +246,12 @@ module AdvancedBilling
242
246
  %w[BasicAuth].each { |auth| @auth_managers[auth] = nil }
243
247
  @auth_managers['BasicAuth'] = BasicAuth.new(http_client_config.basic_auth_credentials)
244
248
  end
249
+
250
+ # Creates a client directly from environment variables.
251
+ def self.from_env(**overrides)
252
+ default_config = Configuration.build_default_config_from_env
253
+ new_config = default_config.clone_with(**overrides)
254
+ new(config: new_config)
255
+ end
245
256
  end
246
257
  end
@@ -12,6 +12,21 @@ module AdvancedBilling
12
12
  US = 'US'.freeze,
13
13
  EU = 'EU'.freeze
14
14
  ].freeze
15
+
16
+ # Converts a string or symbol into a valid Environment constant.
17
+ def self.from_value(value, default_value = US)
18
+ return default_value if value.nil?
19
+
20
+ str = value.to_s.strip.downcase
21
+ case str
22
+ when 'us' then US
23
+ when 'eu' then EU
24
+
25
+ else
26
+ warn "[Environment] Unknown environment '#{value}', falling back to #{default_value} "
27
+ default_value
28
+ end
29
+ end
15
30
  end
16
31
 
17
32
  # An enum for API servers.
@@ -20,6 +35,21 @@ module AdvancedBilling
20
35
  PRODUCTION = 'production'.freeze,
21
36
  EBB = 'ebb'.freeze
22
37
  ].freeze
38
+
39
+ # Converts a string or symbol into a valid Server constant.
40
+ def self.from_value(value, default_value = PRODUCTION)
41
+ return default_value if value.nil?
42
+
43
+ str = value.to_s.strip.downcase
44
+ case str
45
+ when 'production' then PRODUCTION
46
+ when 'ebb' then EBB
47
+
48
+ else
49
+ warn "[Server] Unknown server '#{value}', falling back to #{default_value} "
50
+ default_value
51
+ end
52
+ end
23
53
  end
24
54
 
25
55
  # All configuration including auth info and base URI for the API access
@@ -36,14 +66,15 @@ module AdvancedBilling
36
66
  connection: nil, adapter: :net_http_persistent, timeout: 120,
37
67
  max_retries: 0, retry_interval: 1, backoff_factor: 2,
38
68
  retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
39
- retry_methods: %i[get put], http_callback: nil,
69
+ retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
40
70
  environment: Environment::US, site: 'subdomain',
41
71
  basic_auth_credentials: nil
42
72
  )
43
73
  super connection: connection, adapter: adapter, timeout: timeout,
44
74
  max_retries: max_retries, retry_interval: retry_interval,
45
75
  backoff_factor: backoff_factor, retry_statuses: retry_statuses,
46
- retry_methods: retry_methods, http_callback: http_callback
76
+ retry_methods: retry_methods, http_callback: http_callback,
77
+ proxy_settings: proxy_settings
47
78
 
48
79
  # Current API environment
49
80
  @environment = String(environment)
@@ -64,7 +95,8 @@ module AdvancedBilling
64
95
  def clone_with(connection: nil, adapter: nil, timeout: nil,
65
96
  max_retries: nil, retry_interval: nil, backoff_factor: nil,
66
97
  retry_statuses: nil, retry_methods: nil, http_callback: nil,
67
- environment: nil, site: nil, basic_auth_credentials: nil)
98
+ proxy_settings: nil, environment: nil, site: nil,
99
+ basic_auth_credentials: nil)
68
100
  connection ||= self.connection
69
101
  adapter ||= self.adapter
70
102
  timeout ||= self.timeout
@@ -74,6 +106,7 @@ module AdvancedBilling
74
106
  retry_statuses ||= self.retry_statuses
75
107
  retry_methods ||= self.retry_methods
76
108
  http_callback ||= self.http_callback
109
+ proxy_settings ||= self.proxy_settings
77
110
  environment ||= self.environment
78
111
  site ||= self.site
79
112
  basic_auth_credentials ||= self.basic_auth_credentials
@@ -84,8 +117,9 @@ module AdvancedBilling
84
117
  backoff_factor: backoff_factor,
85
118
  retry_statuses: retry_statuses,
86
119
  retry_methods: retry_methods,
87
- http_callback: http_callback, environment: environment,
88
- site: site,
120
+ http_callback: http_callback,
121
+ proxy_settings: proxy_settings,
122
+ environment: environment, site: site,
89
123
  basic_auth_credentials: basic_auth_credentials)
90
124
  end
91
125
 
@@ -114,5 +148,48 @@ module AdvancedBilling
114
148
  ENVIRONMENTS[environment][server], parameters
115
149
  )
116
150
  end
151
+
152
+ # Builds a Configuration instance using environment variables.
153
+ def self.build_default_config_from_env
154
+ # === Core environment ===
155
+ environment = Environment.from_value(ENV.fetch('ENVIRONMENT', 'us'))
156
+ site = ENV.fetch('SITE', 'subdomain')
157
+ timeout = (ENV['TIMEOUT'] || 120).to_f
158
+ max_retries = (ENV['MAX_RETRIES'] || 0).to_i
159
+ retry_interval = (ENV['RETRY_INTERVAL'] || 1).to_f
160
+ backoff_factor = (ENV['BACKOFF_FACTOR'] || 2).to_f
161
+ retry_statuses = ENV.fetch('RETRY_STATUSES',
162
+ '[408, 413, 429, 500, 502, 503, 504, 521, 522, 524]').gsub(/[\[\]]/, '')
163
+ .split(',')
164
+ .map(&:strip)
165
+ .map do |item|
166
+ item.match?(/\A\d+\z/) ? item.to_i : item.downcase
167
+ end
168
+ retry_methods = ENV.fetch('RETRY_METHODS', '%i[get put]').gsub(/[\[\]]/, '')
169
+ .split(',')
170
+ .map(&:strip)
171
+ .map do |item|
172
+ item.match?(/\A\d+\z/) ? item.to_i : item.downcase
173
+ end
174
+
175
+ # === Authentication credentials ===
176
+ basic_auth_credentials = BasicAuthCredentials.from_env
177
+
178
+ # === Proxy settings ===
179
+ proxy_settings = ProxySettings.from_env
180
+
181
+ Configuration.new(
182
+ environment: environment,
183
+ site: site,
184
+ timeout: timeout,
185
+ max_retries: max_retries,
186
+ retry_interval: retry_interval,
187
+ backoff_factor: backoff_factor,
188
+ retry_statuses: retry_statuses,
189
+ retry_methods: retry_methods,
190
+ basic_auth_credentials: basic_auth_credentials,
191
+ proxy_settings: proxy_settings
192
+ )
193
+ end
117
194
  end
118
195
  end
@@ -7,7 +7,7 @@ module AdvancedBilling
7
7
  # AdvanceInvoiceController
8
8
  class AdvanceInvoiceController < BaseController
9
9
  # Generate an invoice in advance for a subscription's next renewal date.
10
- # [Please see our
10
+ # [See our
11
11
  # docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Inv
12
12
  # oice-In-Advance) for more information on advance invoices, including
13
13
  # eligibility on generating one; for the most part, they function like any
@@ -85,7 +85,7 @@ module AdvancedBilling
85
85
  # A `reason` is required in order to void, and the invoice must have an open
86
86
  # status. Voiding will cause any prepayments and credits that were applied
87
87
  # to the invoice to be returned to the subscription. For a full overview of
88
- # the impact of voiding, please [see our help docs]($m/Invoice).
88
+ # the impact of voiding, [see our help docs]($m/Invoice).
89
89
  # @param [Integer] subscription_id Required parameter: The Chargify id of
90
90
  # the subscription
91
91
  # @param [VoidInvoiceRequest] body Optional parameter: TODO: type
@@ -10,7 +10,7 @@ module AdvancedBilling
10
10
  attr_accessor :config, :http_call_back
11
11
 
12
12
  def self.user_agent
13
- 'AB SDK Ruby:7.0.0 on OS {os-info}'
13
+ 'AB SDK Ruby:8.0.0 on OS {os-info}'
14
14
  end
15
15
 
16
16
  def self.user_agent_parameters
@@ -30,8 +30,8 @@ module AdvancedBilling
30
30
  # In order to prevent abuse & overuse, we ask that you request a new URL
31
31
  # only when absolutely necessary. Management URLs are good for 65 days, so
32
32
  # you should re-use a previously generated one as much as possible. If you
33
- # use the URL frequently (such as to display on your website), please **do
34
- # not** make an API request to Advanced Billing every time.
33
+ # use the URL frequently (such as to display on your website), **do not**
34
+ # make an API request to Advanced Billing every time.
35
35
  # @param [Integer] customer_id Required parameter: The Chargify id of the
36
36
  # customer
37
37
  # @param [AutoInvite] auto_invite Optional parameter: When set to 1, an
@@ -40,8 +40,7 @@ module AdvancedBilling
40
40
  .execute
41
41
  end
42
42
 
43
- # This endpoint can be used to create a new price point for an existing
44
- # component.
43
+ # Creates a price point for an existing component.
45
44
  # @param [Integer] component_id Required parameter: The Advanced Billing id
46
45
  # of the component
47
46
  # @param [CreateComponentPricePointRequest] body Optional parameter: TODO:
@@ -152,8 +151,8 @@ module AdvancedBilling
152
151
  .execute
153
152
  end
154
153
 
155
- # When updating a price point, it's prices can be updated as well by
156
- # creating new prices or editing / removing existing ones.
154
+ # When updating a price point, prices can be updated as well by creating new
155
+ # prices or editing / removing existing ones.
157
156
  # Passing in a price bracket without an `id` will attempt to create a new
158
157
  # price.
159
158
  # Including an `id` will update the corresponding price, and including the
@@ -17,7 +17,7 @@ module AdvancedBilling
17
17
  # which DO NOT reset to zero at the start of every billing period. If you
18
18
  # want to bill for a quantity of something that does not change unless you
19
19
  # change it, then you want quantity components, instead.
20
- # For more information on components, please see our documentation
20
+ # For more information on components, see our documentation
21
21
  # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen
22
22
  # ts-Overview).
23
23
  # @param [String] product_family_id Required parameter: Either the product
@@ -67,7 +67,7 @@ module AdvancedBilling
67
67
  # charge your customer a one-time fee for onboarding or other services.
68
68
  # The allocated quantity for one-time quantity-based components immediately
69
69
  # gets reset back to zero after the allocation is made.
70
- # For more information on components, please see our documentation
70
+ # For more information on components, see our documentation
71
71
  # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen
72
72
  # ts-Overview).
73
73
  # @param [String] product_family_id Required parameter: Either the product
@@ -107,7 +107,7 @@ module AdvancedBilling
107
107
  # can then be added and “allocated” for a subscription.
108
108
  # On/off components are used for any flat fee, recurring add on (think
109
109
  # $99/month for tech support or a flat add on shipping fee).
110
- # For more information on components, please see our documentation
110
+ # For more information on components, see our documentation
111
111
  # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen
112
112
  # ts-Overview).
113
113
  # @param [String] product_family_id Required parameter: Either the product
@@ -151,7 +151,7 @@ module AdvancedBilling
151
151
  # period for the amount of units used, prepaid components are charged for at
152
152
  # the time of purchase, and we subsequently keep track of the usage against
153
153
  # the amount purchased.
154
- # For more information on components, please see our documentation
154
+ # For more information on components, see our documentation
155
155
  # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen
156
156
  # ts-Overview).
157
157
  # @param [String] product_family_id Required parameter: Either the product
@@ -198,7 +198,7 @@ module AdvancedBilling
198
198
  # So, instead of reporting usage directly for each component (as you would
199
199
  # with metered components), the usage is derived from analysis of your
200
200
  # events.
201
- # For more information on components, please see our documentation
201
+ # For more information on components, see our documentation
202
202
  # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen
203
203
  # ts-Overview).
204
204
  # @param [String] product_family_id Required parameter: Either the product
@@ -254,9 +254,8 @@ module AdvancedBilling
254
254
  .execute
255
255
  end
256
256
 
257
- # This request will return information regarding a component from a specific
258
- # product family.
259
- # You may read the component by either the component's id or handle. When
257
+ # Returns information regarding a component from a specific product family.
258
+ # You can read the component by either the component's id or handle. When
260
259
  # using the handle, it must be prefixed with `handle:`.
261
260
  # @param [Integer] product_family_id Required parameter: The Advanced
262
261
  # Billing id of the product family to which the component belongs
@@ -8,11 +8,11 @@ module AdvancedBilling
8
8
  class CouponsController < BaseController
9
9
  # ## Coupons Documentation
10
10
  # Coupons can be administered in the Advanced Billing application or created
11
- # via API. Please view our section on [creating
11
+ # via API. View our section on [creating
12
12
  # coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creati
13
13
  # ng-Editing-Deleting-Coupons) for more information.
14
14
  # Additionally, for documentation on how to apply a coupon to a subscription
15
- # within the Advanced Billing UI, please see our documentation
15
+ # within the Advanced Billing UI, see our documentation
16
16
  # [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-
17
17
  # and-Subscriptions).
18
18
  # ## Create Coupon
@@ -53,9 +53,6 @@ module AdvancedBilling
53
53
  end
54
54
 
55
55
  # List coupons for a specific Product Family in a Site.
56
- # If the coupon is set to `use_site_exchange_rate: true`, it will return
57
- # pricing based on the current exchange rate. If the flag is set to false,
58
- # it will return all of the defined prices for each currency.
59
56
  # @param [Integer] product_family_id Required parameter: The Advanced
60
57
  # Billing id of the product family to which the coupon belongs
61
58
  # @param [Integer] page Optional parameter: Result records are organized in
@@ -247,9 +244,6 @@ module AdvancedBilling
247
244
  end
248
245
 
249
246
  # You can retrieve a list of coupons.
250
- # If the coupon is set to `use_site_exchange_rate: true`, it will return
251
- # pricing based on the current exchange rate. If the flag is set to false,
252
- # it will return all of the defined prices for each currency.
253
247
  # @param [Integer] page Optional parameter: Result records are organized in
254
248
  # pages. By default, the first page of results is displayed. The page
255
249
  # parameter specifies a page number of results to fetch. You can start
@@ -291,9 +285,9 @@ module AdvancedBilling
291
285
  # This request will provide details about the coupon usage as an array of
292
286
  # data hashes, one per product.
293
287
  # @param [Integer] product_family_id Required parameter: The Advanced
294
- # Billing id of the product family to which the coupon belongs
288
+ # Billing id of the product family to which the coupon belongs.
295
289
  # @param [Integer] coupon_id Required parameter: The Advanced Billing id of
296
- # the coupon
290
+ # the coupon.
297
291
  # @return [Array[CouponUsage]] Response from the API call.
298
292
  def read_coupon_usage(product_family_id,
299
293
  coupon_id)
@@ -423,7 +417,7 @@ module AdvancedBilling
423
417
  # [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-C
424
418
  # odes).
425
419
  # Additionally, for documentation on how to apply a coupon to a Subscription
426
- # within the Advanced Billing UI, please see our documentation
420
+ # within the Advanced Billing UI, see our documentation
427
421
  # [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-
428
422
  # and-Subscriptions).
429
423
  # ## Create Coupon Subcode