maxio-advanced-billing-sdk 10.0.0 → 11.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.
- checksums.yaml +4 -4
- data/README.md +60 -51
- data/lib/advanced_billing/client.rb +54 -0
- data/lib/advanced_billing/controllers/advance_invoice_controller.rb +2 -2
- data/lib/advanced_billing/controllers/base_controller.rb +1 -1
- data/lib/advanced_billing/controllers/billing_portal_controller.rb +2 -2
- data/lib/advanced_billing/controllers/component_features_controller.rb +327 -0
- data/lib/advanced_billing/controllers/component_price_points_controller.rb +2 -2
- data/lib/advanced_billing/controllers/components_controller.rb +36 -27
- data/lib/advanced_billing/controllers/coupons_controller.rb +7 -7
- data/lib/advanced_billing/controllers/custom_fields_controller.rb +6 -5
- data/lib/advanced_billing/controllers/customers_controller.rb +59 -4
- data/lib/advanced_billing/controllers/entitlements_controller.rb +55 -0
- data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +62 -3
- data/lib/advanced_billing/controllers/events_controller.rb +2 -2
- data/lib/advanced_billing/controllers/feature_templates_controller.rb +243 -0
- data/lib/advanced_billing/controllers/insights_controller.rb +6 -5
- data/lib/advanced_billing/controllers/invoices_controller.rb +44 -1
- data/lib/advanced_billing/controllers/offers_controller.rb +2 -2
- data/lib/advanced_billing/controllers/payment_profiles_controller.rb +41 -36
- data/lib/advanced_billing/controllers/product_families_controller.rb +3 -4
- data/lib/advanced_billing/controllers/product_features_controller.rb +323 -0
- data/lib/advanced_billing/controllers/product_price_points_controller.rb +2 -2
- data/lib/advanced_billing/controllers/products_controller.rb +17 -5
- data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +14 -0
- data/lib/advanced_billing/controllers/reason_codes_controller.rb +2 -2
- data/lib/advanced_billing/controllers/referral_codes_controller.rb +2 -2
- data/lib/advanced_billing/controllers/sites_controller.rb +6 -6
- data/lib/advanced_billing/controllers/subscription_components_controller.rb +83 -32
- data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +3 -3
- data/lib/advanced_billing/controllers/subscription_groups_controller.rb +51 -12
- data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +3 -3
- data/lib/advanced_billing/controllers/subscription_notes_controller.rb +3 -4
- data/lib/advanced_billing/controllers/subscription_products_controller.rb +5 -5
- data/lib/advanced_billing/controllers/subscription_renewals_controller.rb +18 -0
- data/lib/advanced_billing/controllers/subscription_status_controller.rb +10 -10
- data/lib/advanced_billing/controllers/subscriptions_controller.rb +179 -42
- data/lib/advanced_billing/controllers/wallet_adjustments_controller.rb +121 -0
- data/lib/advanced_billing/controllers/wallet_products_controller.rb +278 -0
- data/lib/advanced_billing/controllers/wallet_purchases_controller.rb +171 -0
- data/lib/advanced_billing/controllers/wallet_transactions_controller.rb +160 -0
- data/lib/advanced_billing/controllers/wallets_controller.rb +259 -0
- data/lib/advanced_billing/exceptions/event_based_billing_list_segments_errors_exception.rb +1 -1
- data/lib/advanced_billing/exceptions/event_based_billing_segment_exception.rb +2 -2
- data/lib/advanced_billing/exceptions/{event_based_billing_segment_errors_exception.rb → event_based_billing_segment_write_error_response_exception.rb} +5 -6
- data/lib/advanced_billing/exceptions/segment_price_point_errors_exception.rb +48 -0
- data/lib/advanced_billing/exceptions/wallet_error_response_exception.rb +76 -0
- data/lib/advanced_billing/models/active_wallets.rb +88 -0
- data/lib/advanced_billing/models/adjustment.rb +196 -0
- data/lib/advanced_billing/models/aggregated_entitlement.rb +186 -0
- data/lib/advanced_billing/models/aggregated_entitlement_periodicity.rb +93 -0
- data/lib/advanced_billing/models/aggregated_entitlements_response.rb +108 -0
- data/lib/advanced_billing/models/change_invoice_status_event_data.rb +6 -6
- data/lib/advanced_billing/models/clone_component_price_point.rb +25 -5
- data/lib/advanced_billing/models/clone_feature_catalog_item.rb +144 -0
- data/lib/advanced_billing/models/component.rb +57 -13
- data/lib/advanced_billing/models/component_currency_price.rb +31 -7
- data/lib/advanced_billing/models/component_custom_price.rb +45 -7
- data/lib/advanced_billing/models/component_kind.rb +5 -1
- data/lib/advanced_billing/models/component_price_point.rb +38 -3
- data/lib/advanced_billing/models/component_price_point_assignment.rb +12 -4
- data/lib/advanced_billing/models/component_price_point_item.rb +19 -4
- data/lib/advanced_billing/models/create_component_price_point.rb +34 -3
- data/lib/advanced_billing/models/create_customer.rb +62 -8
- data/lib/advanced_billing/models/create_feature_catalog_item_request.rb +71 -0
- data/lib/advanced_billing/models/create_feature_template_request.rb +70 -0
- data/lib/advanced_billing/models/create_subscription.rb +22 -21
- data/lib/advanced_billing/models/{event_based_billing_segment_error.rb → create_wallet_adjustment_request.rb} +13 -15
- data/lib/advanced_billing/models/create_wallet_product_request.rb +74 -0
- data/lib/advanced_billing/models/create_wallet_purchase_request.rb +72 -0
- data/lib/advanced_billing/models/create_wallet_request.rb +70 -0
- data/lib/advanced_billing/models/create_wallet_transaction_request.rb +72 -0
- data/lib/advanced_billing/models/credit_note.rb +12 -3
- data/lib/advanced_billing/models/credit_note_date_field.rb +44 -0
- data/lib/advanced_billing/models/credit_note_line_item.rb +50 -11
- data/lib/advanced_billing/models/currency_overage_prices.rb +69 -6
- data/lib/advanced_billing/models/customer.rb +103 -14
- data/lib/advanced_billing/models/ebb_component.rb +59 -27
- data/lib/advanced_billing/models/entitlement_periodicity_unit.rb +48 -0
- data/lib/advanced_billing/models/entity_identifier_kind.rb +62 -0
- data/lib/advanced_billing/models/errors.rb +1 -1
- data/lib/advanced_billing/models/event_based_billing_segment_error_details.rb +88 -0
- data/lib/advanced_billing/models/feature.rb +172 -0
- data/lib/advanced_billing/models/feature1.rb +155 -0
- data/lib/advanced_billing/models/feature2.rb +174 -0
- data/lib/advanced_billing/models/feature3.rb +117 -0
- data/lib/advanced_billing/models/feature_catalog_item.rb +246 -0
- data/lib/advanced_billing/models/feature_catalog_item_response.rb +73 -0
- data/lib/advanced_billing/models/feature_catalog_items_list_response.rb +91 -0
- data/lib/advanced_billing/models/feature_kind.rb +44 -0
- data/lib/advanced_billing/models/feature_owner_price_point_type.rb +38 -0
- data/lib/advanced_billing/models/feature_template.rb +276 -0
- data/lib/advanced_billing/models/feature_template_response.rb +71 -0
- data/lib/advanced_billing/models/feature_templates_list_response.rb +100 -0
- data/lib/advanced_billing/models/feature_value_type.rb +42 -0
- data/lib/advanced_billing/models/full_subscription_group_response.rb +65 -65
- data/lib/advanced_billing/models/grant_expiration_unit.rb +43 -0
- data/lib/advanced_billing/models/invoice.rb +8 -8
- data/lib/advanced_billing/models/invoice_consolidation_level.rb +2 -2
- data/lib/advanced_billing/models/invoice_line_item.rb +77 -8
- data/lib/advanced_billing/models/invoice_status.rb +2 -2
- data/lib/advanced_billing/models/invoice_tax.rb +22 -11
- data/lib/advanced_billing/models/issue_invoice_event_data.rb +6 -6
- data/lib/advanced_billing/models/kind.rb +44 -0
- data/lib/advanced_billing/models/kind1.rb +37 -0
- data/lib/advanced_billing/models/list_components_price_points_include.rb +16 -2
- data/lib/advanced_billing/models/meter.rb +105 -0
- data/lib/advanced_billing/models/metered_component.rb +37 -19
- data/lib/advanced_billing/models/origin.rb +55 -0
- data/lib/advanced_billing/models/owner_type.rb +27 -0
- data/lib/advanced_billing/models/paid_invoice.rb +2 -2
- data/lib/advanced_billing/models/prepaid_usage_component.rb +3 -3
- data/lib/advanced_billing/models/price1.rb +98 -0
- data/lib/advanced_billing/models/product.rb +70 -6
- data/lib/advanced_billing/models/proforma_invoice.rb +6 -6
- data/lib/advanced_billing/models/proforma_invoice_tax.rb +10 -5
- data/lib/advanced_billing/models/proforma_invoice_tax_source_type.rb +23 -2
- data/lib/advanced_billing/models/purchase.rb +114 -0
- data/lib/advanced_billing/models/q_scope.rb +5 -1
- data/lib/advanced_billing/models/quantity_based_component.rb +40 -24
- data/lib/advanced_billing/models/reason.rb +77 -0
- data/lib/advanced_billing/models/refund_invoice_event_data.rb +6 -4
- data/lib/advanced_billing/models/secondary_pricing.rb +112 -0
- data/lib/advanced_billing/models/segment.rb +28 -4
- data/lib/advanced_billing/models/segment_price_point_error_details.rb +71 -0
- data/lib/advanced_billing/models/site.rb +71 -5
- data/lib/advanced_billing/models/sort_by.rb +44 -0
- data/lib/advanced_billing/models/sort_by1.rb +40 -0
- data/lib/advanced_billing/models/sort_direction.rb +36 -0
- data/lib/advanced_billing/models/status1.rb +40 -0
- data/lib/advanced_billing/models/status2.rb +36 -0
- data/lib/advanced_billing/models/subscription.rb +13 -13
- data/lib/advanced_billing/models/subscription_component.rb +21 -7
- data/lib/advanced_billing/models/subscription_component_custom_price_segment.rb +285 -0
- data/lib/advanced_billing/models/subscription_component_subscription.rb +26 -26
- data/lib/advanced_billing/models/subscription_custom_price.rb +31 -3
- data/lib/advanced_billing/models/subscription_group_item.rb +41 -22
- data/lib/advanced_billing/models/subscription_group_signup_error.rb +18 -12
- data/lib/advanced_billing/models/subscription_group_signup_item.rb +36 -10
- data/lib/advanced_billing/models/subscription_group_signup_response.rb +39 -39
- data/lib/advanced_billing/models/subscription_group_subscription_error.rb +26 -16
- data/lib/advanced_billing/models/subscription_state.rb +30 -29
- data/lib/advanced_billing/models/tax_configuration.rb +1 -1
- data/lib/advanced_billing/models/tax_configuration_kind.rb +21 -1
- data/lib/advanced_billing/models/update_component.rb +55 -6
- data/lib/advanced_billing/models/update_component_price_point.rb +34 -2
- data/lib/advanced_billing/models/update_customer.rb +63 -10
- data/lib/advanced_billing/models/update_feature_catalog_item_request.rb +70 -0
- data/lib/advanced_billing/models/update_feature_template_request.rb +71 -0
- data/lib/advanced_billing/models/update_secondary_pricing.rb +104 -0
- data/lib/advanced_billing/models/update_subscription.rb +9 -7
- data/lib/advanced_billing/models/update_wallet_product_request.rb +78 -0
- data/lib/advanced_billing/models/update_wallet_request.rb +70 -0
- data/lib/advanced_billing/models/wallet.rb +420 -0
- data/lib/advanced_billing/models/wallet1.rb +237 -0
- data/lib/advanced_billing/models/wallet2.rb +75 -0
- data/lib/advanced_billing/models/wallet_grant.rb +267 -0
- data/lib/advanced_billing/models/wallet_grant_result_response.rb +89 -0
- data/lib/advanced_billing/models/wallet_hard_stop_overflow.rb +39 -0
- data/lib/advanced_billing/models/wallet_origin.rb +39 -0
- data/lib/advanced_billing/models/wallet_product.rb +189 -0
- data/lib/advanced_billing/models/wallet_product1.rb +130 -0
- data/lib/advanced_billing/models/wallet_product_active_wallet.rb +145 -0
- data/lib/advanced_billing/models/wallet_product_list_item.rb +624 -0
- data/lib/advanced_billing/models/wallet_product_price_point_attributes.rb +170 -0
- data/lib/advanced_billing/models/wallet_product_price_point_summary.rb +126 -0
- data/lib/advanced_billing/models/wallet_product_response.rb +73 -0
- data/lib/advanced_billing/models/wallet_product_usage_count.rb +84 -0
- data/lib/advanced_billing/models/wallet_product_usage_response.rb +110 -0
- data/lib/advanced_billing/models/wallet_product_usage_template.rb +197 -0
- data/lib/advanced_billing/models/wallet_products_list_response.rb +104 -0
- data/lib/advanced_billing/models/wallet_purchase.rb +121 -0
- data/lib/advanced_billing/models/wallet_purchase_preview.rb +99 -0
- data/lib/advanced_billing/models/wallet_purchase_preview_response.rb +80 -0
- data/lib/advanced_billing/models/wallet_purchase_result_response.rb +88 -0
- data/lib/advanced_billing/models/wallet_recurring_funding.rb +197 -0
- data/lib/advanced_billing/models/wallet_recurring_funding_status.rb +45 -0
- data/lib/advanced_billing/models/wallet_response.rb +72 -0
- data/lib/advanced_billing/models/wallet_status.rb +36 -0
- data/lib/advanced_billing/models/wallet_transaction.rb +278 -0
- data/lib/advanced_billing/models/wallet_transaction1.rb +140 -0
- data/lib/advanced_billing/models/wallet_transaction_result_response.rb +133 -0
- data/lib/advanced_billing/models/wallet_transactions_list_response.rb +88 -0
- data/lib/advanced_billing/models/wallets_list_response.rb +88 -0
- data/lib/advanced_billing/utilities/union_type_lookup.rb +179 -0
- data/lib/advanced_billing.rb +98 -2
- metadata +97 -4
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
# advanced_billing
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for Maxio by
|
|
4
|
+
# APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module AdvancedBilling
|
|
7
|
+
# ComponentFeaturesController
|
|
8
|
+
class ComponentFeaturesController < BaseController
|
|
9
|
+
# Lists the feature catalog items attached to this component, including
|
|
10
|
+
# price-point-specific overrides.
|
|
11
|
+
# @param [Integer] component_id Required parameter: The Advanced Billing id
|
|
12
|
+
# of the component.
|
|
13
|
+
# @return [FeatureCatalogItemsListResponse] Response from the API call.
|
|
14
|
+
def list_component_features(component_id)
|
|
15
|
+
@api_call
|
|
16
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
17
|
+
'/components/{component_id}/features.json',
|
|
18
|
+
Server::PRODUCTION)
|
|
19
|
+
.template_param(new_parameter(component_id, key: 'component_id')
|
|
20
|
+
.is_required(true)
|
|
21
|
+
.should_encode(true))
|
|
22
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
23
|
+
.auth(Single.new('BasicAuth')))
|
|
24
|
+
.response(new_response_handler
|
|
25
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
26
|
+
.deserialize_into(FeatureCatalogItemsListResponse.method(:from_hash))
|
|
27
|
+
.local_error('403',
|
|
28
|
+
'Forbidden',
|
|
29
|
+
ErrorListResponseException)
|
|
30
|
+
.local_error('404',
|
|
31
|
+
'Not Found',
|
|
32
|
+
APIException))
|
|
33
|
+
.execute
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Attaches a feature template to this component. Pass `price_point_type:
|
|
37
|
+
# "PricePoint"` and `price_point_id` to scope the feature catalog item to a
|
|
38
|
+
# single component price point instead of the whole component. `value`, the
|
|
39
|
+
# periodicity and the grant expiration fall back to the feature template's
|
|
40
|
+
# defaults when omitted.
|
|
41
|
+
# **Product- or component-level items are a template.** A feature catalog
|
|
42
|
+
# item without `price_point_id` is copied onto price points created after it
|
|
43
|
+
# (except bulk-created price points; [Clone Component Price
|
|
44
|
+
# Point]($e/Component%3A%20Price%20Points/cloneComponentPricePoint) applies
|
|
45
|
+
# only the `feature_catalog_items` you send with it, and the automatic clone
|
|
46
|
+
# described below copies the source's features), but it is not added to
|
|
47
|
+
# price points that already exist, so their subscribers get nothing from it,
|
|
48
|
+
# even with `propagate_to_subscriptions: true`. To grant a feature to
|
|
49
|
+
# existing subscribers, create the item on each existing price point.
|
|
50
|
+
# **Restoring a template item.** Restoring an archived product- or
|
|
51
|
+
# component-level item, or creating one again for the same feature template,
|
|
52
|
+
# also restores the price-point copies that were archived together with it
|
|
53
|
+
# (for example, when the feature template was archived). If one of those
|
|
54
|
+
# price points has subscribers without the feature, the call returns `422`
|
|
55
|
+
# naming that price point, unless you send `propagate_to_subscriptions:
|
|
56
|
+
# true`, which restores the copies and grants the feature to those
|
|
57
|
+
# subscribers.
|
|
58
|
+
# **Price points with subscribers.** When the feature catalog item is scoped
|
|
59
|
+
# to a price point that already has subscribers and you don't send
|
|
60
|
+
# `propagate_to_subscriptions: true`, the new feature applies to new
|
|
61
|
+
# subscriptions only. The price point is cloned with its current features,
|
|
62
|
+
# the new feature is applied to the clone, and the response carries the
|
|
63
|
+
# clone's `price_point_id`. The feature catalog item in the response is also
|
|
64
|
+
# a different record, with a new `id`: later calls for the clone must use
|
|
65
|
+
# that `id`, not the original one. Existing subscribers stay on the original
|
|
66
|
+
# price point, unchanged; sign new subscriptions up on the clone to give
|
|
67
|
+
# them the change. A component price point has subscribers when any
|
|
68
|
+
# subscription, including a canceled one or one allocated a quantity of
|
|
69
|
+
# zero, has the component at that price point. Price points that can't be
|
|
70
|
+
# cloned (archived or custom ones, or a component price point with an
|
|
71
|
+
# interval on a site without multi-frequency) make the request return `422`,
|
|
72
|
+
# with a message naming `propagate_to_subscriptions: true` as the way to
|
|
73
|
+
# apply the change to existing subscribers instead.
|
|
74
|
+
# @param [Integer] component_id Required parameter: The Advanced Billing id
|
|
75
|
+
# of the component.
|
|
76
|
+
# @param [CreateFeatureCatalogItemRequest] body Optional parameter: TODO:
|
|
77
|
+
# type description here
|
|
78
|
+
# @return [FeatureCatalogItemResponse] Response from the API call.
|
|
79
|
+
def create_component_feature(component_id,
|
|
80
|
+
body: nil)
|
|
81
|
+
@api_call
|
|
82
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
83
|
+
'/components/{component_id}/features.json',
|
|
84
|
+
Server::PRODUCTION)
|
|
85
|
+
.template_param(new_parameter(component_id, key: 'component_id')
|
|
86
|
+
.is_required(true)
|
|
87
|
+
.should_encode(true))
|
|
88
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
89
|
+
.body_param(new_parameter(body))
|
|
90
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
91
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
92
|
+
.auth(Single.new('BasicAuth')))
|
|
93
|
+
.response(new_response_handler
|
|
94
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
95
|
+
.deserialize_into(FeatureCatalogItemResponse.method(:from_hash))
|
|
96
|
+
.local_error('403',
|
|
97
|
+
'Forbidden',
|
|
98
|
+
ErrorListResponseException)
|
|
99
|
+
.local_error('404',
|
|
100
|
+
'Not Found',
|
|
101
|
+
APIException)
|
|
102
|
+
.local_error_template('422',
|
|
103
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
|
104
|
+
' Response: \'{$response.body}\'.',
|
|
105
|
+
ErrorListResponseException))
|
|
106
|
+
.execute
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Returns a single feature catalog item attached to this component.
|
|
110
|
+
# @param [Integer] component_id Required parameter: The Advanced Billing id
|
|
111
|
+
# of the component.
|
|
112
|
+
# @param [Integer] id Required parameter: The Advanced Billing id of the
|
|
113
|
+
# feature catalog item.
|
|
114
|
+
# @return [FeatureCatalogItemResponse] Response from the API call.
|
|
115
|
+
def read_component_feature(component_id,
|
|
116
|
+
id)
|
|
117
|
+
@api_call
|
|
118
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
119
|
+
'/components/{component_id}/features/{id}.json',
|
|
120
|
+
Server::PRODUCTION)
|
|
121
|
+
.template_param(new_parameter(component_id, key: 'component_id')
|
|
122
|
+
.is_required(true)
|
|
123
|
+
.should_encode(true))
|
|
124
|
+
.template_param(new_parameter(id, key: 'id')
|
|
125
|
+
.is_required(true)
|
|
126
|
+
.should_encode(true))
|
|
127
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
128
|
+
.auth(Single.new('BasicAuth')))
|
|
129
|
+
.response(new_response_handler
|
|
130
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
131
|
+
.deserialize_into(FeatureCatalogItemResponse.method(:from_hash))
|
|
132
|
+
.local_error('403',
|
|
133
|
+
'Forbidden',
|
|
134
|
+
ErrorListResponseException)
|
|
135
|
+
.local_error('404',
|
|
136
|
+
'Not Found',
|
|
137
|
+
APIException))
|
|
138
|
+
.execute
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Updates the value or periodicity of a feature catalog item attached to
|
|
142
|
+
# this component. A request that changes nothing returns the item as it is.
|
|
143
|
+
# **Price points with subscribers.** When the feature catalog item is scoped
|
|
144
|
+
# to a price point that already has subscribers and you don't send
|
|
145
|
+
# `propagate_to_subscriptions: true`, the update applies to new
|
|
146
|
+
# subscriptions only. The price point is cloned with its current features,
|
|
147
|
+
# the update is applied to the clone, and the response carries the clone's
|
|
148
|
+
# `price_point_id`. The feature catalog item in the response is also a
|
|
149
|
+
# different record, with a new `id`: later calls for the clone must use that
|
|
150
|
+
# `id`, not the original one. Existing subscribers stay on the original
|
|
151
|
+
# price point, unchanged; sign new subscriptions up on the clone to give
|
|
152
|
+
# them the change. A component price point has subscribers when any
|
|
153
|
+
# subscription, including a canceled one or one allocated a quantity of
|
|
154
|
+
# zero, has the component at that price point. Price points that can't be
|
|
155
|
+
# cloned (archived or custom ones, or a component price point with an
|
|
156
|
+
# interval on a site without multi-frequency) make the request return `422`,
|
|
157
|
+
# with a message naming `propagate_to_subscriptions: true` as the way to
|
|
158
|
+
# apply the change to existing subscribers instead.
|
|
159
|
+
# @param [Integer] component_id Required parameter: The Advanced Billing id
|
|
160
|
+
# of the component.
|
|
161
|
+
# @param [Integer] id Required parameter: The Advanced Billing id of the
|
|
162
|
+
# feature catalog item.
|
|
163
|
+
# @param [UpdateFeatureCatalogItemRequest] body Optional parameter: TODO:
|
|
164
|
+
# type description here
|
|
165
|
+
# @return [FeatureCatalogItemResponse] Response from the API call.
|
|
166
|
+
def update_component_feature(component_id,
|
|
167
|
+
id,
|
|
168
|
+
body: nil)
|
|
169
|
+
@api_call
|
|
170
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
|
171
|
+
'/components/{component_id}/features/{id}.json',
|
|
172
|
+
Server::PRODUCTION)
|
|
173
|
+
.template_param(new_parameter(component_id, key: 'component_id')
|
|
174
|
+
.is_required(true)
|
|
175
|
+
.should_encode(true))
|
|
176
|
+
.template_param(new_parameter(id, key: 'id')
|
|
177
|
+
.is_required(true)
|
|
178
|
+
.should_encode(true))
|
|
179
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
180
|
+
.body_param(new_parameter(body))
|
|
181
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
182
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
183
|
+
.auth(Single.new('BasicAuth')))
|
|
184
|
+
.response(new_response_handler
|
|
185
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
186
|
+
.deserialize_into(FeatureCatalogItemResponse.method(:from_hash))
|
|
187
|
+
.local_error('403',
|
|
188
|
+
'Forbidden',
|
|
189
|
+
ErrorListResponseException)
|
|
190
|
+
.local_error('404',
|
|
191
|
+
'Not Found',
|
|
192
|
+
APIException)
|
|
193
|
+
.local_error_template('422',
|
|
194
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
|
195
|
+
' Response: \'{$response.body}\'.',
|
|
196
|
+
ErrorListResponseException))
|
|
197
|
+
.execute
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Removes a feature catalog item from this component. Returns `204` when the
|
|
201
|
+
# item is removed in place.
|
|
202
|
+
# **Price points with subscribers.** When the feature catalog item is scoped
|
|
203
|
+
# to a price point that already has subscribers and you don't send
|
|
204
|
+
# `destroy_entitlements=true`, the removal applies to new subscriptions
|
|
205
|
+
# only. The price point is cloned with its current features, the removal is
|
|
206
|
+
# applied to the clone, and the call returns `200` with the archived feature
|
|
207
|
+
# catalog item on the clone (carrying the clone's `price_point_id` and a new
|
|
208
|
+
# `id`) instead of `204`. Existing subscribers stay on the original price
|
|
209
|
+
# point, unchanged; sign new subscriptions up on the clone to give them the
|
|
210
|
+
# change. A component price point has subscribers when any subscription,
|
|
211
|
+
# including a canceled one or one allocated a quantity of zero, has the
|
|
212
|
+
# component at that price point. Price points that can't be cloned (archived
|
|
213
|
+
# or custom ones, or a component price point with an interval on a site
|
|
214
|
+
# without multi-frequency) make the request return `422`, with a message
|
|
215
|
+
# naming `destroy_entitlements=true` as the way to apply the change to
|
|
216
|
+
# existing subscribers instead.
|
|
217
|
+
# @param [Integer] component_id Required parameter: The Advanced Billing id
|
|
218
|
+
# of the component.
|
|
219
|
+
# @param [Integer] id Required parameter: The Advanced Billing id of the
|
|
220
|
+
# feature catalog item.
|
|
221
|
+
# @param [TrueClass | FalseClass] destroy_entitlements Optional parameter:
|
|
222
|
+
# When `true`, permanently deletes this feature catalog item and every
|
|
223
|
+
# entitlement it created, revoking subscriber access immediately. When
|
|
224
|
+
# `false` (default), the feature catalog item is archived and existing
|
|
225
|
+
# entitlements are preserved.
|
|
226
|
+
# @return [FeatureCatalogItemResponse] Response from the API call.
|
|
227
|
+
def remove_component_feature(component_id,
|
|
228
|
+
id,
|
|
229
|
+
destroy_entitlements: false)
|
|
230
|
+
@api_call
|
|
231
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
232
|
+
'/components/{component_id}/features/{id}.json',
|
|
233
|
+
Server::PRODUCTION)
|
|
234
|
+
.template_param(new_parameter(component_id, key: 'component_id')
|
|
235
|
+
.is_required(true)
|
|
236
|
+
.should_encode(true))
|
|
237
|
+
.template_param(new_parameter(id, key: 'id')
|
|
238
|
+
.is_required(true)
|
|
239
|
+
.should_encode(true))
|
|
240
|
+
.query_param(new_parameter(destroy_entitlements, key: 'destroy_entitlements'))
|
|
241
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
242
|
+
.auth(Single.new('BasicAuth')))
|
|
243
|
+
.response(new_response_handler
|
|
244
|
+
.is_nullable_response(true)
|
|
245
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
246
|
+
.deserialize_into(FeatureCatalogItemResponse.method(:from_hash))
|
|
247
|
+
.local_error('403',
|
|
248
|
+
'Forbidden',
|
|
249
|
+
ErrorListResponseException)
|
|
250
|
+
.local_error('404',
|
|
251
|
+
'Not Found',
|
|
252
|
+
APIException)
|
|
253
|
+
.local_error('422',
|
|
254
|
+
'The price point has subscribers but can\'t be cloned (it is'\
|
|
255
|
+
' archived or custom, or it is a component price point with an'\
|
|
256
|
+
' interval on a site without multi-frequency). Send'\
|
|
257
|
+
' `destroy_entitlements=true` to remove the feature from its'\
|
|
258
|
+
' existing subscribers instead.',
|
|
259
|
+
ErrorListResponseException))
|
|
260
|
+
.execute
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# Clears the archived state of a feature catalog item attached to this
|
|
264
|
+
# component. Returns `422` if the parent feature template is still archived.
|
|
265
|
+
# Restore the feature template first. Otherwise, restoring an item that
|
|
266
|
+
# isn't archived returns it unchanged.
|
|
267
|
+
# **Price points with subscribers.** When the feature catalog item is scoped
|
|
268
|
+
# to a price point that already has subscribers and you don't send
|
|
269
|
+
# `propagate_to_subscriptions=true`, the restore applies to new
|
|
270
|
+
# subscriptions only. The price point is cloned with its current features,
|
|
271
|
+
# the restore is applied to the clone, and the response carries the clone's
|
|
272
|
+
# `price_point_id`. The feature catalog item in the response is also a
|
|
273
|
+
# different record, with a new `id`: later calls for the clone must use that
|
|
274
|
+
# `id`, not the original one. Existing subscribers stay on the original
|
|
275
|
+
# price point, unchanged; sign new subscriptions up on the clone to give
|
|
276
|
+
# them the change. A component price point has subscribers when any
|
|
277
|
+
# subscription, including a canceled one or one allocated a quantity of
|
|
278
|
+
# zero, has the component at that price point. Price points that can't be
|
|
279
|
+
# cloned (archived or custom ones, or a component price point with an
|
|
280
|
+
# interval on a site without multi-frequency) make the request return `422`,
|
|
281
|
+
# with a message naming `propagate_to_subscriptions: true` as the way to
|
|
282
|
+
# apply the change to existing subscribers instead.
|
|
283
|
+
# @param [Integer] component_id Required parameter: The Advanced Billing id
|
|
284
|
+
# of the component.
|
|
285
|
+
# @param [Integer] id Required parameter: The Advanced Billing id of the
|
|
286
|
+
# feature catalog item.
|
|
287
|
+
# @param [TrueClass | FalseClass] propagate_to_subscriptions Optional
|
|
288
|
+
# parameter: When `true`, the restored feature is applied to the existing
|
|
289
|
+
# subscriptions on its price point. When `false` (default), an item scoped
|
|
290
|
+
# to a price point with subscribers is restored on a clone of that price
|
|
291
|
+
# point instead; a product- or component-level item is never cloned, and
|
|
292
|
+
# returns `422` if a price-point copy it restores has subscribers without
|
|
293
|
+
# the feature. See the description.
|
|
294
|
+
# @return [FeatureCatalogItemResponse] Response from the API call.
|
|
295
|
+
def restore_component_feature(component_id,
|
|
296
|
+
id,
|
|
297
|
+
propagate_to_subscriptions: false)
|
|
298
|
+
@api_call
|
|
299
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
300
|
+
'/components/{component_id}/features/{id}/restore.json',
|
|
301
|
+
Server::PRODUCTION)
|
|
302
|
+
.template_param(new_parameter(component_id, key: 'component_id')
|
|
303
|
+
.is_required(true)
|
|
304
|
+
.should_encode(true))
|
|
305
|
+
.template_param(new_parameter(id, key: 'id')
|
|
306
|
+
.is_required(true)
|
|
307
|
+
.should_encode(true))
|
|
308
|
+
.query_param(new_parameter(propagate_to_subscriptions, key: 'propagate_to_subscriptions'))
|
|
309
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
310
|
+
.auth(Single.new('BasicAuth')))
|
|
311
|
+
.response(new_response_handler
|
|
312
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
313
|
+
.deserialize_into(FeatureCatalogItemResponse.method(:from_hash))
|
|
314
|
+
.local_error('403',
|
|
315
|
+
'Forbidden',
|
|
316
|
+
ErrorListResponseException)
|
|
317
|
+
.local_error('404',
|
|
318
|
+
'Not Found',
|
|
319
|
+
APIException)
|
|
320
|
+
.local_error_template('422',
|
|
321
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
|
322
|
+
' Response: \'{$response.body}\'.',
|
|
323
|
+
ErrorListResponseException))
|
|
324
|
+
.execute
|
|
325
|
+
end
|
|
326
|
+
end
|
|
327
|
+
end
|
|
@@ -10,8 +10,8 @@ module AdvancedBilling
|
|
|
10
10
|
# apply to all new subscriptions going forward - existing subscriptions will
|
|
11
11
|
# remain on their current price point.
|
|
12
12
|
# See [Price Points
|
|
13
|
-
# Documentation](https://maxio.
|
|
14
|
-
#
|
|
13
|
+
# Documentation](https://docs.maxio.com/billing/catalog/products/set-product
|
|
14
|
+
# -price-points) for more information on price points and moving
|
|
15
15
|
# subscriptions between price points.
|
|
16
16
|
# Note: Custom price points are not able to be set as the default for a
|
|
17
17
|
# component.
|
|
@@ -18,15 +18,15 @@ module AdvancedBilling
|
|
|
18
18
|
# change it, then you want quantity components, instead.
|
|
19
19
|
# #### Hybrid Pricing
|
|
20
20
|
# A `volume`, `tiered`, or `stairstep` metered component can combine its
|
|
21
|
-
# primary pricing with a secondary pricing model (the `
|
|
21
|
+
# primary pricing with a secondary pricing model (the `secondary_pricing`
|
|
22
22
|
# parameter) so both bill as a single invoice line item instead of two. This
|
|
23
23
|
# does not apply to metered components configured for event-based billing
|
|
24
24
|
# (metric, meter, or formula). See [Hybrid
|
|
25
25
|
# Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements
|
|
26
26
|
# and configuration details.
|
|
27
27
|
# For more information on components, see our documentation
|
|
28
|
-
# [here](https://maxio.
|
|
29
|
-
#
|
|
28
|
+
# [here](https://docs.maxio.com/billing/catalog/products/understand-products
|
|
29
|
+
# ).
|
|
30
30
|
# If you have the new [Catalog
|
|
31
31
|
# experience](page:help/announcements/2026-announcements#new-catalog-experie
|
|
32
32
|
# nce-and-terminology) enabled, taxable components must include a non-blank
|
|
@@ -78,18 +78,18 @@ module AdvancedBilling
|
|
|
78
78
|
# charge your customer a one-time fee for onboarding or other services.
|
|
79
79
|
# The allocated quantity for one-time quantity-based components immediately
|
|
80
80
|
# gets reset back to zero after the allocation is made.
|
|
81
|
-
# For more information, see [
|
|
82
|
-
#
|
|
83
|
-
#
|
|
81
|
+
# For more information, see [Understand
|
|
82
|
+
# Products](https://docs.maxio.com/billing/catalog/products/understand-produ
|
|
83
|
+
# cts).
|
|
84
84
|
# #### Hybrid Pricing
|
|
85
85
|
# A `volume`, `tiered`, or `stairstep` component can combine its primary
|
|
86
|
-
# pricing with a secondary pricing model (the `
|
|
86
|
+
# pricing with a secondary pricing model (the `secondary_pricing` parameter)
|
|
87
87
|
# so both bill as a single invoice line item instead of two. See [Hybrid
|
|
88
88
|
# Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements
|
|
89
89
|
# and configuration details.
|
|
90
90
|
# For more information on components, see our documentation
|
|
91
|
-
# [here](https://maxio.
|
|
92
|
-
#
|
|
91
|
+
# [here](https://docs.maxio.com/billing/catalog/products/understand-products
|
|
92
|
+
# ).
|
|
93
93
|
# If you have the new [Catalog
|
|
94
94
|
# experience](page:help/announcements/2026-announcements#new-catalog-experie
|
|
95
95
|
# nce-and-terminology) enabled, taxable components must include a non-blank
|
|
@@ -131,8 +131,8 @@ module AdvancedBilling
|
|
|
131
131
|
# On/off components are used for any flat fee, recurring add on (think
|
|
132
132
|
# $99/month for tech support or a flat add on shipping fee).
|
|
133
133
|
# For more information on components, see our documentation
|
|
134
|
-
# [here](https://maxio.
|
|
135
|
-
#
|
|
134
|
+
# [here](https://docs.maxio.com/billing/catalog/products/understand-products
|
|
135
|
+
# ).
|
|
136
136
|
# If you have the new [Catalog
|
|
137
137
|
# experience](page:help/announcements/2026-announcements#new-catalog-experie
|
|
138
138
|
# nce-and-terminology) enabled, taxable components must include a non-blank
|
|
@@ -178,9 +178,9 @@ module AdvancedBilling
|
|
|
178
178
|
# period for the amount of units used, prepaid components are charged for at
|
|
179
179
|
# the time of purchase, and usage is subsequently tracked against the amount
|
|
180
180
|
# purchased.
|
|
181
|
-
# For more information, see [
|
|
182
|
-
#
|
|
183
|
-
#
|
|
181
|
+
# For more information, see [Understand
|
|
182
|
+
# Products](https://docs.maxio.com/billing/catalog/products/understand-produ
|
|
183
|
+
# cts).
|
|
184
184
|
# If you have the new [Catalog
|
|
185
185
|
# experience](page:help/announcements/2026-announcements#new-catalog-experie
|
|
186
186
|
# nce-and-terminology) enabled, taxable components must include a non-blank
|
|
@@ -220,18 +220,20 @@ module AdvancedBilling
|
|
|
220
220
|
# Creates an event-based component definition under the specified product
|
|
221
221
|
# family. An event-based component can then be added and “allocated” for a
|
|
222
222
|
# subscription.
|
|
223
|
-
# Event-based components are similar to other component types
|
|
224
|
-
#
|
|
225
|
-
#
|
|
226
|
-
#
|
|
227
|
-
#
|
|
228
|
-
#
|
|
229
|
-
#
|
|
230
|
-
#
|
|
231
|
-
#
|
|
232
|
-
#
|
|
233
|
-
#
|
|
234
|
-
#
|
|
223
|
+
# Event-based components are similar to other component types: you define
|
|
224
|
+
# their parameters (such as name and taxability) and pricing.
|
|
225
|
+
# For [Maxio
|
|
226
|
+
# Metering](https://docs.maxio.com/billing/maxio-metering/overview/understan
|
|
227
|
+
# d-maxio-metering), provide either `metering_meter_id` or
|
|
228
|
+
# `metering_formula`, but not both. For legacy Events Based Billing, provide
|
|
229
|
+
# `event_based_billing_metric_id` instead. Meter IDs and legacy metric IDs
|
|
230
|
+
# identify different resources. A legacy metric ID cannot replace a meter ID
|
|
231
|
+
# or formula on a site using Maxio Metering.
|
|
232
|
+
# Instead of reporting usage directly for each component (as you would with
|
|
233
|
+
# metered components), usage is derived from analysis of your events.
|
|
234
|
+
# For more information, see [Understand
|
|
235
|
+
# Products](https://docs.maxio.com/billing/catalog/products/understand-produ
|
|
236
|
+
# cts).
|
|
235
237
|
# If you have the new [Catalog
|
|
236
238
|
# experience](page:help/announcements/2026-announcements#new-catalog-experie
|
|
237
239
|
# nce-and-terminology) enabled, taxable components must include a non-blank
|
|
@@ -297,9 +299,15 @@ module AdvancedBilling
|
|
|
297
299
|
# @param [String] component_id Required parameter: Either the Advanced
|
|
298
300
|
# Billing id of the component or the handle for the component prefixed with
|
|
299
301
|
# `handle:`
|
|
302
|
+
# @param [TrueClass | FalseClass] include_features Optional parameter: When
|
|
303
|
+
# `true`, embeds the active feature catalog items for each result in a
|
|
304
|
+
# `features` array. Default value is `false`. Ignored on sites without
|
|
305
|
+
# Entitlements enabled: no `features` key is returned and no error is
|
|
306
|
+
# raised.
|
|
300
307
|
# @return [ComponentResponse] Response from the API call.
|
|
301
308
|
def read_component(product_family_id,
|
|
302
|
-
component_id
|
|
309
|
+
component_id,
|
|
310
|
+
include_features: false)
|
|
303
311
|
@api_call
|
|
304
312
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
305
313
|
'/product_families/{product_family_id}/components/{component_id}.json',
|
|
@@ -310,6 +318,7 @@ module AdvancedBilling
|
|
|
310
318
|
.template_param(new_parameter(component_id, key: 'component_id')
|
|
311
319
|
.is_required(true)
|
|
312
320
|
.should_encode(true))
|
|
321
|
+
.query_param(new_parameter(include_features, key: 'include_features'))
|
|
313
322
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
314
323
|
.auth(Single.new('BasicAuth')))
|
|
315
324
|
.response(new_response_handler
|
|
@@ -10,9 +10,9 @@ module AdvancedBilling
|
|
|
10
10
|
# You can create either a flat amount coupon, by specifying
|
|
11
11
|
# `amount_in_cents`, or percentage coupon by specifying `percentage`.
|
|
12
12
|
# See [Apply Coupons to
|
|
13
|
-
# Subscriptions](https://maxio.
|
|
14
|
-
#
|
|
15
|
-
#
|
|
13
|
+
# Subscriptions](https://docs.maxio.com/billing/catalog/coupons/apply-coupon
|
|
14
|
+
# s-to-subscriptions) for information on applying a coupon to a subscription
|
|
15
|
+
# in the Advanced Billing UI.
|
|
16
16
|
# @param [Integer] product_family_id Required parameter: The Advanced
|
|
17
17
|
# Billing id of the product family to which the coupon belongs
|
|
18
18
|
# @param [CouponRequest] body Optional parameter: TODO: type description
|
|
@@ -394,10 +394,10 @@ module AdvancedBilling
|
|
|
394
394
|
# `https://<subdomain>.chargify.com/coupons/567/codes/20%25OFF.<format>`.
|
|
395
395
|
# For more information on coupon codes and applying coupons to
|
|
396
396
|
# subscriptions, see [Coupon
|
|
397
|
-
# Codes](https://maxio.
|
|
398
|
-
#
|
|
399
|
-
# Subscriptions](https://maxio.
|
|
400
|
-
#
|
|
397
|
+
# Codes](https://docs.maxio.com/billing/catalog/coupons/set-coupon-codes)
|
|
398
|
+
# and [Coupons and
|
|
399
|
+
# Subscriptions](https://docs.maxio.com/billing/catalog/coupons/apply-coupon
|
|
400
|
+
# s-to-subscriptions).
|
|
401
401
|
# @param [Integer] coupon_id Required parameter: The Advanced Billing id of
|
|
402
402
|
# the coupon
|
|
403
403
|
# @param [CouponSubcodes] body Optional parameter: TODO: type description
|
|
@@ -24,11 +24,12 @@ module AdvancedBilling
|
|
|
24
24
|
# - Metafield is the custom field
|
|
25
25
|
# - Metadata is the data populating the custom field.
|
|
26
26
|
# See [Custom Fields
|
|
27
|
-
# Reference](https://docs.maxio.com/
|
|
28
|
-
#
|
|
29
|
-
# Tab](https://maxio.
|
|
30
|
-
#
|
|
31
|
-
# the Advanced
|
|
27
|
+
# Reference](https://docs.maxio.com/configuration/advanced-billing/custom-fi
|
|
28
|
+
# elds/configure-custom-fields) and [Custom Fields
|
|
29
|
+
# Tab](https://docs.maxio.com/getting-started/maxio-platform-basics/advanced
|
|
30
|
+
# -billing-overview-and-resources/subscription-summary-tabs/viewing-and-edit
|
|
31
|
+
# ing-custom-fields) for information on using Custom Fields in the Advanced
|
|
32
|
+
# Billing UI.
|
|
32
33
|
# @param [ResourceType] resource_type Required parameter: The resource type
|
|
33
34
|
# to which the metafields belong.
|
|
34
35
|
# @param [CreateMetafieldsRequest] body Optional parameter: TODO: type
|
|
@@ -16,8 +16,8 @@ module AdvancedBilling
|
|
|
16
16
|
# store the system-assigned unique ID for the customer, which is in the `id`
|
|
17
17
|
# attribute.
|
|
18
18
|
# For more information, see [Customer
|
|
19
|
-
# Details](https://maxio.
|
|
20
|
-
#
|
|
19
|
+
# Details](https://docs.maxio.com/billing/subscriptions/customers/view-custo
|
|
20
|
+
# mer-information).
|
|
21
21
|
# ## Required Country Format
|
|
22
22
|
# Format the country attribute of the customer using the ISO Standard
|
|
23
23
|
# Country codes.
|
|
@@ -36,8 +36,27 @@ module AdvancedBilling
|
|
|
36
36
|
# ## Locale
|
|
37
37
|
# You can attribute a language/region to the customer to deliver invoices in
|
|
38
38
|
# any required language. For more information, see [Customer
|
|
39
|
-
# Locale](https://maxio.
|
|
40
|
-
#
|
|
39
|
+
# Locale](https://docs.maxio.com/configuration/advanced-billing/settings/mul
|
|
40
|
+
# ti-lingual-invoices/customer-locale).
|
|
41
|
+
# ## Tax and Business Identifiers
|
|
42
|
+
# Send `entity_identifier_kind` and `entity_identifier_value` together to
|
|
43
|
+
# store the customer's tax or business identifier, such as an EU VAT number,
|
|
44
|
+
# a French SIREN, or a LEI. A customer holds one identifier at a time.
|
|
45
|
+
# The `vat_eu` and `national_tax` kinds also require `vat_country`. An
|
|
46
|
+
# unsupported kind, a missing or mismatched `vat_country`, or a `gln`,
|
|
47
|
+
# `duns`, or `lei` value in the wrong format returns `422`.
|
|
48
|
+
# Always send the kind. `entity_identifier_value` on its own is stored as a
|
|
49
|
+
# `company_reg` when no `vat_country` is present, and returns `422` naming
|
|
50
|
+
# `entity_identifier_kind` when one is.
|
|
51
|
+
# A blank pair is ignored rather than rejected, so a `vat_number` sent
|
|
52
|
+
# alongside it still takes effect.
|
|
53
|
+
# The legacy `vat_number` and `vat_country` pair still works on its own.
|
|
54
|
+
# When neither entity identifier field is sent, Advanced Billing derives the
|
|
55
|
+
# kind from `vat_country`: an EU member state code or `GB` gives `vat_eu`,
|
|
56
|
+
# one of the national tax country codes gives `national_tax`, and a blank or
|
|
57
|
+
# unrecognized country gives `company_reg`.
|
|
58
|
+
# The response reports the stored identifier in `entity_identifier_kind` and
|
|
59
|
+
# `entity_identifier_value`, and repeats its value in `vat_number`.
|
|
41
60
|
# @param [CreateCustomerRequest] body Optional parameter: TODO: type
|
|
42
61
|
# description here
|
|
43
62
|
# @return [CustomerResponse] Response from the API call.
|
|
@@ -157,6 +176,42 @@ module AdvancedBilling
|
|
|
157
176
|
end
|
|
158
177
|
|
|
159
178
|
# Updates the customer.
|
|
179
|
+
# ## Tax and Business Identifiers
|
|
180
|
+
# Send `entity_identifier_kind` and `entity_identifier_value` together to
|
|
181
|
+
# store the customer's tax or business identifier, such as an EU VAT number,
|
|
182
|
+
# a French SIREN, or a LEI. A customer holds one identifier at a time, so
|
|
183
|
+
# saving an identifier of a different kind replaces the existing one.
|
|
184
|
+
# The `vat_eu` and `national_tax` kinds also require `vat_country`. An
|
|
185
|
+
# unsupported kind, a missing or mismatched `vat_country`, or a `gln`,
|
|
186
|
+
# `duns`, or `lei` value in the wrong format returns `422`.
|
|
187
|
+
# Always send the kind. `entity_identifier_value` on its own is stored as a
|
|
188
|
+
# `company_reg` when no `vat_country` is present, and returns `422` naming
|
|
189
|
+
# `entity_identifier_kind` when one is.
|
|
190
|
+
# To clear an identifier, send a supported `entity_identifier_kind` with a
|
|
191
|
+
# blank `entity_identifier_value`, or send a blank `vat_number` on its own.
|
|
192
|
+
# The first form also clears `vat_number` and `vat_country`, and it removes
|
|
193
|
+
# whichever identifier the customer holds, whatever kind you send with it.
|
|
194
|
+
# The legacy `vat_number` and `vat_country` pair still works on its own.
|
|
195
|
+
# When neither entity identifier field is sent, Advanced Billing derives the
|
|
196
|
+
# kind from `vat_country`: an EU member state code or `GB` gives `vat_eu`,
|
|
197
|
+
# one of the national tax country codes gives `national_tax`, and a blank or
|
|
198
|
+
# unrecognized country gives `company_reg`.
|
|
199
|
+
# Sending a customer response straight back leaves the tax ID alone. A blank
|
|
200
|
+
# pair, and a pair that still matches the stored identifier with
|
|
201
|
+
# `vat_country` unchanged, are read as nothing to change rather than as a
|
|
202
|
+
# request to clear. For `gln`, `duns`, and `lei` that also covers the
|
|
203
|
+
# `vat_number` the response mirrors back, so the kind survives the round
|
|
204
|
+
# trip.
|
|
205
|
+
# What you do change is applied, and the entity identifier fields take
|
|
206
|
+
# precedence over `vat_number`. A different kind or value writes that
|
|
207
|
+
# identifier, and `vat_number` and `vat_country` follow from it. A different
|
|
208
|
+
# `vat_country` next to an unchanged pair is a real edit, so it is validated
|
|
209
|
+
# and can return `422`. Changing only `vat_number` leaves the pair
|
|
210
|
+
# unchanged, so the derivation above decides the kind, which turns a `gln`,
|
|
211
|
+
# `duns`, or `lei` customer into a `company_reg`. Setting `vat_number` to
|
|
212
|
+
# `null` or a blank string still clears the identifier.
|
|
213
|
+
# The response reports the stored identifier in `entity_identifier_kind` and
|
|
214
|
+
# `entity_identifier_value`, and repeats its value in `vat_number`.
|
|
160
215
|
# @param [Integer] id Required parameter: The Advanced Billing id of the
|
|
161
216
|
# customer
|
|
162
217
|
# @param [UpdateCustomerRequest] body Optional parameter: TODO: type
|