recurly 3.29.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/.bumpversion.cfg +1 -1
  3. data/.github/workflows/docs.yml +1 -1
  4. data/.github_changelog_generator +8 -0
  5. data/.travis.yml +13 -0
  6. data/CHANGELOG.md +202 -380
  7. data/CONTRIBUTING.md +0 -4
  8. data/GETTING_STARTED.md +20 -17
  9. data/README.md +0 -3
  10. data/lib/recurly/client/operations.rb +778 -662
  11. data/lib/recurly/client.rb +44 -28
  12. data/lib/recurly/errors/api_errors.rb +3 -2
  13. data/lib/recurly/errors.rb +5 -23
  14. data/lib/recurly/pager.rb +5 -15
  15. data/lib/recurly/requests/{account_acquisition_updatable.rb → account_acquisition_update.rb} +1 -1
  16. data/lib/recurly/requests/account_create.rb +2 -14
  17. data/lib/recurly/requests/account_purchase.rb +2 -14
  18. data/lib/recurly/requests/account_update.rb +0 -12
  19. data/lib/recurly/requests/add_on_create.rb +4 -4
  20. data/lib/recurly/requests/add_on_pricing.rb +5 -5
  21. data/lib/recurly/requests/add_on_update.rb +2 -2
  22. data/lib/recurly/requests/address.rb +1 -13
  23. data/lib/recurly/requests/billing_info_create.rb +3 -47
  24. data/lib/recurly/requests/coupon_create.rb +1 -1
  25. data/lib/recurly/requests/external_transaction.rb +1 -1
  26. data/lib/recurly/requests/invoice_address.rb +1 -5
  27. data/lib/recurly/requests/invoice_collect.rb +1 -1
  28. data/lib/recurly/requests/{invoice_updatable.rb → invoice_update.rb} +1 -1
  29. data/lib/recurly/requests/line_item_create.rb +2 -10
  30. data/lib/recurly/requests/line_item_refund.rb +0 -4
  31. data/lib/recurly/requests/plan_create.rb +0 -16
  32. data/lib/recurly/requests/plan_pricing.rb +1 -5
  33. data/lib/recurly/requests/plan_update.rb +0 -12
  34. data/lib/recurly/requests/pricing.rb +0 -4
  35. data/lib/recurly/requests/purchase_create.rb +1 -1
  36. data/lib/recurly/requests/shipping_address_create.rb +1 -5
  37. data/lib/recurly/requests/shipping_address_update.rb +1 -5
  38. data/lib/recurly/requests/subscription_add_on_create.rb +8 -4
  39. data/lib/recurly/requests/subscription_add_on_tier.rb +5 -1
  40. data/lib/recurly/requests/subscription_add_on_update.rb +6 -2
  41. data/lib/recurly/requests/subscription_change_create.rb +1 -13
  42. data/lib/recurly/requests/subscription_create.rb +5 -13
  43. data/lib/recurly/requests/subscription_pause.rb +1 -1
  44. data/lib/recurly/requests/subscription_purchase.rb +2 -10
  45. data/lib/recurly/requests/subscription_update.rb +1 -5
  46. data/lib/recurly/requests/tier.rb +2 -2
  47. data/lib/recurly/requests/{plan_ramp_pricing.rb → tier_pricing.rb} +6 -2
  48. data/lib/recurly/requests/usage_create.rb +1 -1
  49. data/lib/recurly/resources/account.rb +0 -12
  50. data/lib/recurly/resources/account_balance_amount.rb +0 -8
  51. data/lib/recurly/resources/account_mini.rb +0 -4
  52. data/lib/recurly/resources/add_on.rb +1 -1
  53. data/lib/recurly/resources/add_on_pricing.rb +5 -5
  54. data/lib/recurly/resources/address.rb +1 -13
  55. data/lib/recurly/resources/address_with_name.rb +46 -0
  56. data/lib/recurly/resources/billing_info.rb +1 -5
  57. data/lib/recurly/resources/billing_info_updated_by.rb +1 -1
  58. data/lib/recurly/resources/coupon.rb +5 -17
  59. data/lib/recurly/resources/custom_field_definition.rb +1 -1
  60. data/lib/recurly/resources/invoice.rb +8 -12
  61. data/lib/recurly/resources/invoice_address.rb +1 -5
  62. data/lib/recurly/resources/line_item.rb +7 -23
  63. data/lib/recurly/resources/payment_method.rb +0 -12
  64. data/lib/recurly/resources/plan.rb +1 -17
  65. data/lib/recurly/resources/plan_pricing.rb +1 -5
  66. data/lib/recurly/resources/pricing.rb +0 -4
  67. data/lib/recurly/resources/shipping_address.rb +1 -5
  68. data/lib/recurly/resources/subscription.rb +0 -12
  69. data/lib/recurly/resources/subscription_add_on.rb +6 -2
  70. data/lib/recurly/resources/subscription_add_on_tier.rb +5 -1
  71. data/lib/recurly/resources/subscription_change.rb +0 -16
  72. data/lib/recurly/resources/tax_info.rb +3 -7
  73. data/lib/recurly/resources/tier.rb +2 -2
  74. data/lib/recurly/resources/{plan_ramp_pricing.rb → tier_pricing.rb} +6 -2
  75. data/lib/recurly/resources/transaction.rb +3 -7
  76. data/lib/recurly/resources/unique_coupon_code_params.rb +26 -0
  77. data/lib/recurly/resources/usage.rb +6 -2
  78. data/lib/recurly/version.rb +1 -1
  79. data/openapi/api.yaml +2028 -3132
  80. data/scripts/build +2 -2
  81. data/scripts/bump +11 -0
  82. data/scripts/changelog +14 -0
  83. data/scripts/format +2 -2
  84. data/scripts/prepare-release +29 -43
  85. data/scripts/release +20 -5
  86. metadata +17 -33
  87. data/.changelog_config.yaml +0 -11
  88. data/.github/workflows/ci.yml +0 -29
  89. data/.github/workflows/pr-review.yml +0 -27
  90. data/CODE_OF_CONDUCT.md +0 -130
  91. data/lib/recurly/errors/network_errors.rb +0 -10
  92. data/lib/recurly/requests/billing_info_verify.rb +0 -14
  93. data/lib/recurly/requests/dunning_campaigns_bulk_update.rb +0 -18
  94. data/lib/recurly/requests/gateway_attributes.rb +0 -14
  95. data/lib/recurly/requests/plan_ramp_interval.rb +0 -18
  96. data/lib/recurly/requests/subscription_change_billing_info_create.rb +0 -14
  97. data/lib/recurly/requests/subscription_ramp_interval.rb +0 -18
  98. data/lib/recurly/resources/dunning_campaign.rb +0 -50
  99. data/lib/recurly/resources/dunning_campaigns_bulk_update_response.rb +0 -18
  100. data/lib/recurly/resources/dunning_cycle.rb +0 -58
  101. data/lib/recurly/resources/dunning_interval.rb +0 -18
  102. data/lib/recurly/resources/gateway_attributes.rb +0 -14
  103. data/lib/recurly/resources/line_item_list.rb +0 -26
  104. data/lib/recurly/resources/plan_ramp_interval.rb +0 -18
  105. data/lib/recurly/resources/subscription_change_billing_info.rb +0 -14
  106. data/lib/recurly/resources/subscription_change_preview.rb +0 -90
  107. data/lib/recurly/resources/subscription_ramp_interval_response.rb +0 -30
  108. data/lib/recurly/resources/tax_detail.rb +0 -38
@@ -15,17 +15,13 @@ module Recurly
15
15
  define_attribute :company, String
16
16
 
17
17
  # @!attribute country
18
- # @return [String] Country, 2-letter ISO 3166-1 alpha-2 code.
18
+ # @return [String] Country, 2-letter ISO code.
19
19
  define_attribute :country, String
20
20
 
21
21
  # @!attribute first_name
22
22
  # @return [String] First name
23
23
  define_attribute :first_name, String
24
24
 
25
- # @!attribute geo_code
26
- # @return [String] Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
27
- define_attribute :geo_code, String
28
-
29
25
  # @!attribute last_name
30
26
  # @return [String] Last name
31
27
  define_attribute :last_name, String
@@ -7,7 +7,7 @@ module Recurly
7
7
  class InvoiceCollect < Request
8
8
 
9
9
  # @!attribute billing_info_id
10
- # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
10
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
11
11
  define_attribute :billing_info_id, String
12
12
 
13
13
  # @!attribute three_d_secure_action_result_token_id
@@ -4,7 +4,7 @@
4
4
  # need and we will usher them to the appropriate places.
5
5
  module Recurly
6
6
  module Requests
7
- class InvoiceUpdatable < Request
7
+ class InvoiceUpdate < Request
8
8
 
9
9
  # @!attribute address
10
10
  # @return [InvoiceAddress]
@@ -26,10 +26,6 @@ module Recurly
26
26
  # @return [String] 3-letter ISO 4217 currency code. If `item_code`/`item_id` is part of the request then `currency` is optional, if the site has a single default currency. `currency` is required if `item_code`/`item_id` is present, and there are multiple currencies defined on the site. If `item_code`/`item_id` is not present `currency` is required.
27
27
  define_attribute :currency, String
28
28
 
29
- # @!attribute custom_fields
30
- # @return [Array[CustomField]] The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
31
- define_attribute :custom_fields, Array, { :item_type => :CustomField }
32
-
33
29
  # @!attribute description
34
30
  # @return [String] Description that appears on the invoice. If `item_code`/`item_id` is part of the request then `description` must be absent.
35
31
  define_attribute :description, String
@@ -39,11 +35,11 @@ module Recurly
39
35
  define_attribute :end_date, DateTime
40
36
 
41
37
  # @!attribute item_code
42
- # @return [String] Unique code to identify an item. Avaliable when the Credit Invoices feature is enabled.
38
+ # @return [String] Unique code to identify an item. Available when the Credit Invoices and Subscription Billing Terms features are enabled.
43
39
  define_attribute :item_code, String
44
40
 
45
41
  # @!attribute item_id
46
- # @return [String] System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled.
42
+ # @return [String] System-generated unique identifier for an item. Available when the Credit Invoices and Subscription Billing Terms features are enabled.
47
43
  define_attribute :item_id, String
48
44
 
49
45
  # @!attribute origin
@@ -74,10 +70,6 @@ module Recurly
74
70
  # @return [Boolean] `true` exempts tax on charges, `false` applies tax on charges. If not defined, then defaults to the Plan and Site settings. This attribute does not work for credits (negative line items). Credits are always applied post-tax. Pre-tax discounts should use the Coupons feature.
75
71
  define_attribute :tax_exempt, :Boolean
76
72
 
77
- # @!attribute tax_inclusive
78
- # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
79
- define_attribute :tax_inclusive, :Boolean
80
-
81
73
  # @!attribute type
82
74
  # @return [String] Line item type. If `item_code`/`item_id` is present then `type` should not be present. If `item_code`/`item_id` is not present then `type` is required.
83
75
  define_attribute :type, String
@@ -17,10 +17,6 @@ module Recurly
17
17
  # @!attribute quantity
18
18
  # @return [Integer] Line item quantity to be refunded.
19
19
  define_attribute :quantity, Integer
20
-
21
- # @!attribute quantity_decimal
22
- # @return [String] A floating-point alternative to Quantity. If this value is present, it will be used in place of Quantity for calculations, and Quantity will be the rounded integer value of this number. This field supports up to 9 decimal places. The Decimal Quantity feature must be enabled to utilize this field.
23
- define_attribute :quantity_decimal, String
24
20
  end
25
21
  end
26
22
  end
@@ -38,18 +38,10 @@ module Recurly
38
38
  # @return [Array[PlanPricing]] Pricing
39
39
  define_attribute :currencies, Array, { :item_type => :PlanPricing }
40
40
 
41
- # @!attribute custom_fields
42
- # @return [Array[CustomField]] The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
43
- define_attribute :custom_fields, Array, { :item_type => :CustomField }
44
-
45
41
  # @!attribute description
46
42
  # @return [String] Optional description, not displayed.
47
43
  define_attribute :description, String
48
44
 
49
- # @!attribute dunning_campaign_id
50
- # @return [String] Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
51
- define_attribute :dunning_campaign_id, String
52
-
53
45
  # @!attribute hosted_pages
54
46
  # @return [PlanHostedPages] Hosted pages settings
55
47
  define_attribute :hosted_pages, :PlanHostedPages
@@ -66,14 +58,6 @@ module Recurly
66
58
  # @return [String] This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
67
59
  define_attribute :name, String
68
60
 
69
- # @!attribute pricing_model
70
- # @return [String] A fixed pricing model has the same price for each billing period. A ramp pricing model defines a set of Ramp Intervals, where a subscription changes price on a specified cadence of billing periods. The price change could be an increase or decrease.
71
- define_attribute :pricing_model, String
72
-
73
- # @!attribute ramp_intervals
74
- # @return [Array[PlanRampInterval]] Ramp Intervals
75
- define_attribute :ramp_intervals, Array, { :item_type => :PlanRampInterval }
76
-
77
61
  # @!attribute revenue_schedule_type
78
62
  # @return [String] Revenue schedule type
79
63
  define_attribute :revenue_schedule_type, String
@@ -14,12 +14,8 @@ module Recurly
14
14
  # @return [Float] Amount of one-time setup fee automatically charged at the beginning of a subscription billing cycle. For subscription plans with a trial, the setup fee will be charged at the time of signup. Setup fees do not increase with the quantity of a subscription plan.
15
15
  define_attribute :setup_fee, Float
16
16
 
17
- # @!attribute tax_inclusive
18
- # @return [Boolean] This field is deprecated. Please do not use it.
19
- define_attribute :tax_inclusive, :Boolean
20
-
21
17
  # @!attribute unit_amount
22
- # @return [Float] This field should not be sent when the pricing model is 'ramp'.
18
+ # @return [Float] Unit price
23
19
  define_attribute :unit_amount, Float
24
20
  end
25
21
  end
@@ -34,18 +34,10 @@ module Recurly
34
34
  # @return [Array[PlanPricing]] Pricing
35
35
  define_attribute :currencies, Array, { :item_type => :PlanPricing }
36
36
 
37
- # @!attribute custom_fields
38
- # @return [Array[CustomField]] The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
39
- define_attribute :custom_fields, Array, { :item_type => :CustomField }
40
-
41
37
  # @!attribute description
42
38
  # @return [String] Optional description, not displayed.
43
39
  define_attribute :description, String
44
40
 
45
- # @!attribute dunning_campaign_id
46
- # @return [String] Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
47
- define_attribute :dunning_campaign_id, String
48
-
49
41
  # @!attribute hosted_pages
50
42
  # @return [PlanHostedPages] Hosted pages settings
51
43
  define_attribute :hosted_pages, :PlanHostedPages
@@ -58,10 +50,6 @@ module Recurly
58
50
  # @return [String] This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
59
51
  define_attribute :name, String
60
52
 
61
- # @!attribute ramp_intervals
62
- # @return [Array[PlanRampInterval]] Ramp Intervals
63
- define_attribute :ramp_intervals, Array, { :item_type => :PlanRampInterval }
64
-
65
53
  # @!attribute revenue_schedule_type
66
54
  # @return [String] Revenue schedule type
67
55
  define_attribute :revenue_schedule_type, String
@@ -10,10 +10,6 @@ module Recurly
10
10
  # @return [String] 3-letter ISO 4217 currency code.
11
11
  define_attribute :currency, String
12
12
 
13
- # @!attribute tax_inclusive
14
- # @return [Boolean] This field is deprecated. Please do not use it.
15
- define_attribute :tax_inclusive, :Boolean
16
-
17
13
  # @!attribute unit_amount
18
14
  # @return [Float] Unit price
19
15
  define_attribute :unit_amount, Float
@@ -11,7 +11,7 @@ module Recurly
11
11
  define_attribute :account, :AccountPurchase
12
12
 
13
13
  # @!attribute billing_info_id
14
- # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
14
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
15
15
  define_attribute :billing_info_id, String
16
16
 
17
17
  # @!attribute collection_method
@@ -15,7 +15,7 @@ module Recurly
15
15
  define_attribute :company, String
16
16
 
17
17
  # @!attribute country
18
- # @return [String] Country, 2-letter ISO 3166-1 alpha-2 code.
18
+ # @return [String] Country, 2-letter ISO code.
19
19
  define_attribute :country, String
20
20
 
21
21
  # @!attribute email
@@ -26,10 +26,6 @@ module Recurly
26
26
  # @return [String]
27
27
  define_attribute :first_name, String
28
28
 
29
- # @!attribute geo_code
30
- # @return [String] Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
31
- define_attribute :geo_code, String
32
-
33
29
  # @!attribute last_name
34
30
  # @return [String]
35
31
  define_attribute :last_name, String
@@ -15,7 +15,7 @@ module Recurly
15
15
  define_attribute :company, String
16
16
 
17
17
  # @!attribute country
18
- # @return [String] Country, 2-letter ISO 3166-1 alpha-2 code.
18
+ # @return [String] Country, 2-letter ISO code.
19
19
  define_attribute :country, String
20
20
 
21
21
  # @!attribute email
@@ -26,10 +26,6 @@ module Recurly
26
26
  # @return [String]
27
27
  define_attribute :first_name, String
28
28
 
29
- # @!attribute geo_code
30
- # @return [String] Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
31
- define_attribute :geo_code, String
32
-
33
29
  # @!attribute id
34
30
  # @return [String] Shipping Address ID
35
31
  define_attribute :id, String
@@ -7,7 +7,7 @@ module Recurly
7
7
  class SubscriptionAddOnCreate < Request
8
8
 
9
9
  # @!attribute add_on_source
10
- # @return [String] Used to determine where the associated add-on data is pulled from. If this value is set to `plan_add_on` or left blank, then add_on data will be pulled from the plan's add-ons. If the associated `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then the associated add-on data will be pulled from the site's item catalog.
10
+ # @return [String] Used to determine where the associated add-on data is pulled from. If this value is set to `plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then the associated add-on data will be pulled from the site's item catalog.
11
11
  define_attribute :add_on_source, String
12
12
 
13
13
  # @!attribute code
@@ -23,15 +23,19 @@ module Recurly
23
23
  define_attribute :revenue_schedule_type, String
24
24
 
25
25
  # @!attribute tiers
26
- # @return [Array[SubscriptionAddOnTier]] If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object must include one to many tiers with `ending_quantity` and `unit_amount`. There must be one tier with an `ending_quantity` of 999999999 which is the default if not provided. See our [Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an overview of how to configure quantity-based pricing models.
26
+ # @return [Array[SubscriptionAddOnTier]] If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object must include one to many tiers with `ending_quantity` and `unit_amount`. There must be one tier with an `ending_quantity` of 999999999 which is the default if not provided. See our [Guide](https://developers.recurly.com/guides/item-addon-guide.html) for an overview of how to configure quantity-based pricing models.
27
27
  define_attribute :tiers, Array, { :item_type => :SubscriptionAddOnTier }
28
28
 
29
29
  # @!attribute unit_amount
30
- # @return [Float] * Optionally, override the add-on's default unit amount. * If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` must be absent.
30
+ # @return [Float] Allows up to 2 decimal places. Optionally, override the add-on's default unit amount. If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` cannot be provided.
31
31
  define_attribute :unit_amount, Float
32
32
 
33
+ # @!attribute unit_amount_decimal
34
+ # @return [String] Allows up to 9 decimal places. Optionally, override the add-on's default unit amount. If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount_decimal` cannot be provided. Only supported when the plan add-on's `add_on_type` = `usage`. If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
35
+ define_attribute :unit_amount_decimal, String
36
+
33
37
  # @!attribute usage_percentage
34
- # @return [Float] The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is percentage. Must be omitted otherwise. `usage_percentage` does not support tiers. See our [Guide](https://recurly.com/developers/guides/usage-based-billing-guide.html) for an overview of how to configure usage add-ons.
38
+ # @return [Float] The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is percentage. Must be omitted otherwise. `usage_percentage` does not support tiers. See our [Guide](https://developers.recurly.com/guides/usage-based-billing-guide.html) for an overview of how to configure usage add-ons.
35
39
  define_attribute :usage_percentage, Float
36
40
  end
37
41
  end
@@ -11,8 +11,12 @@ module Recurly
11
11
  define_attribute :ending_quantity, Integer
12
12
 
13
13
  # @!attribute unit_amount
14
- # @return [Float] Unit amount
14
+ # @return [Float] Allows up to 2 decimal places. Optionally, override the tiers' default unit amount.
15
15
  define_attribute :unit_amount, Float
16
+
17
+ # @!attribute unit_amount_decimal
18
+ # @return [String] Allows up to 9 decimal places. Optionally, override tiers' default unit amount. If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
19
+ define_attribute :unit_amount_decimal, String
16
20
  end
17
21
  end
18
22
  end
@@ -7,7 +7,7 @@ module Recurly
7
7
  class SubscriptionAddOnUpdate < Request
8
8
 
9
9
  # @!attribute add_on_source
10
- # @return [String] Used to determine where the associated add-on data is pulled from. If this value is set to `plan_add_on` or left blank, then add_on data will be pulled from the plan's add-ons. If the associated `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then the associated add-on data will be pulled from the site's item catalog.
10
+ # @return [String] Used to determine where the associated add-on data is pulled from. If this value is set to `plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then the associated add-on data will be pulled from the site's item catalog.
11
11
  define_attribute :add_on_source, String
12
12
 
13
13
  # @!attribute code
@@ -31,9 +31,13 @@ module Recurly
31
31
  define_attribute :tiers, Array, { :item_type => :SubscriptionAddOnTier }
32
32
 
33
33
  # @!attribute unit_amount
34
- # @return [Float] Optionally, override the add-on's default unit amount.
34
+ # @return [Float] Allows up to 2 decimal places. Optionally, override the add-on's default unit amount. If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` cannot be provided.
35
35
  define_attribute :unit_amount, Float
36
36
 
37
+ # @!attribute unit_amount_decimal
38
+ # @return [String] Allows up to 9 decimal places. Optionally, override the add-on's default unit amount. If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount_decimal` cannot be provided. Only supported when the plan add-on's `add_on_type` = `usage`. If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
39
+ define_attribute :unit_amount_decimal, String
40
+
37
41
  # @!attribute usage_percentage
38
42
  # @return [Float] The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if add_on_type is usage and usage_type is percentage.
39
43
  define_attribute :usage_percentage, Float
@@ -7,13 +7,9 @@ module Recurly
7
7
  class SubscriptionChangeCreate < Request
8
8
 
9
9
  # @!attribute add_ons
10
- # @return [Array[SubscriptionAddOnUpdate]] If this value is omitted your existing add-ons will be removed. If you provide a value for this field it will replace any existing add-ons. So, when adding or modifying an add-on, you need to include the existing subscription add-ons. Unchanged add-ons can be included just using the subscription add-on's ID: `{"id": "abc123"}`. If a subscription add-on's `code` is supplied without the `id`, `{"code": "def456"}`, the subscription add-on attributes will be set to the current values of the plan add-on unless provided in the request. - If an `id` is passed, any attributes not passed in will pull from the existing subscription add-on - If a `code` is passed, any attributes not passed in will pull from the current values of the plan add-on - Attributes passed in as part of the request will override either of the above scenarios
10
+ # @return [Array[SubscriptionAddOnUpdate]] If you provide a value for this field it will replace any existing add-ons. So, when adding or modifying an add-on, you need to include the existing subscription add-ons. Unchanged add-ons can be included just using the subscription add-on''s ID: `{"id": "abc123"}`. If this value is omitted your existing add-ons will be unaffected. To remove all existing add-ons, this value should be an empty array.' If a subscription add-on's `code` is supplied without the `id`, `{"code": "def456"}`, the subscription add-on attributes will be set to the current values of the plan add-on unless provided in the request. - If an `id` is passed, any attributes not passed in will pull from the existing subscription add-on - If a `code` is passed, any attributes not passed in will pull from the current values of the plan add-on - Attributes passed in as part of the request will override either of the above scenarios
11
11
  define_attribute :add_ons, Array, { :item_type => :SubscriptionAddOnUpdate }
12
12
 
13
- # @!attribute billing_info
14
- # @return [SubscriptionChangeBillingInfoCreate]
15
- define_attribute :billing_info, :SubscriptionChangeBillingInfoCreate
16
-
17
13
  # @!attribute collection_method
18
14
  # @return [String] Collection method
19
15
  define_attribute :collection_method, String
@@ -46,10 +42,6 @@ module Recurly
46
42
  # @return [Integer] Optionally override the default quantity of 1.
47
43
  define_attribute :quantity, Integer
48
44
 
49
- # @!attribute ramp_intervals
50
- # @return [Array[SubscriptionRampInterval]] The new set of ramp intervals for the subscription.
51
- define_attribute :ramp_intervals, Array, { :item_type => :SubscriptionRampInterval }
52
-
53
45
  # @!attribute revenue_schedule_type
54
46
  # @return [String] Revenue schedule type
55
47
  define_attribute :revenue_schedule_type, String
@@ -58,10 +50,6 @@ module Recurly
58
50
  # @return [SubscriptionChangeShippingCreate] The shipping address can currently only be changed immediately, using SubscriptionUpdate.
59
51
  define_attribute :shipping, :SubscriptionChangeShippingCreate
60
52
 
61
- # @!attribute tax_inclusive
62
- # @return [Boolean] This field is deprecated. Please do not use it.
63
- define_attribute :tax_inclusive, :Boolean
64
-
65
53
  # @!attribute timeframe
66
54
  # @return [String] The timeframe parameter controls when the upgrade or downgrade takes place. The subscription change can occur now, when the subscription is next billed, or when the subscription term ends. Generally, if you're performing an upgrade, you will want the change to occur immediately (now). If you're performing a downgrade, you should set the timeframe to `term_end` or `bill_date` so the change takes effect at a scheduled billing date. The `renewal` timeframe option is accepted as an alias for `term_end`.
67
55
  define_attribute :timeframe, String
@@ -19,16 +19,16 @@ module Recurly
19
19
  define_attribute :auto_renew, :Boolean
20
20
 
21
21
  # @!attribute billing_info_id
22
- # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
22
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
23
23
  define_attribute :billing_info_id, String
24
24
 
25
25
  # @!attribute collection_method
26
26
  # @return [String] Collection method
27
27
  define_attribute :collection_method, String
28
28
 
29
- # @!attribute coupon_code
30
- # @return [String] Optional coupon code to redeem on the account and discount the subscription. Please note, the subscription request will fail if the coupon is invalid.
31
- define_attribute :coupon_code, String
29
+ # @!attribute coupon_codes
30
+ # @return [Array[String]] A list of coupon_codes to be redeemed on the subscription or account during the purchase.
31
+ define_attribute :coupon_codes, Array, { :item_type => String }
32
32
 
33
33
  # @!attribute credit_customer_notes
34
34
  # @return [String] If there are pending credits on the account that will be invoiced during the subscription creation, these will be used as the Customer Notes on the credit invoice.
@@ -70,10 +70,6 @@ module Recurly
70
70
  # @return [Integer] Optionally override the default quantity of 1.
71
71
  define_attribute :quantity, Integer
72
72
 
73
- # @!attribute ramp_intervals
74
- # @return [Array[SubscriptionRampInterval]] The new set of ramp intervals for the subscription.
75
- define_attribute :ramp_intervals, Array, { :item_type => :SubscriptionRampInterval }
76
-
77
73
  # @!attribute renewal_billing_cycles
78
74
  # @return [Integer] If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.
79
75
  define_attribute :renewal_billing_cycles, Integer
@@ -90,10 +86,6 @@ module Recurly
90
86
  # @return [DateTime] If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial.
91
87
  define_attribute :starts_at, DateTime
92
88
 
93
- # @!attribute tax_inclusive
94
- # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
95
- define_attribute :tax_inclusive, :Boolean
96
-
97
89
  # @!attribute terms_and_conditions
98
90
  # @return [String] This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes to add or override Terms and Conditions. Custom notes will stay with a subscription on all renewals.
99
91
  define_attribute :terms_and_conditions, String
@@ -107,7 +99,7 @@ module Recurly
107
99
  define_attribute :transaction_type, String
108
100
 
109
101
  # @!attribute trial_ends_at
110
- # @return [DateTime] IIf set, overrides the default trial behavior for the subscription. When the current date time or a past date time is provided the subscription will begin with no trial phase (overriding any plan default trial). When a future date time is provided the subscription will begin with a trial phase ending at the specified date time.
102
+ # @return [DateTime] If set, overrides the default trial behavior for the subscription. The date must be in the future.
111
103
  define_attribute :trial_ends_at, DateTime
112
104
 
113
105
  # @!attribute unit_amount
@@ -7,7 +7,7 @@ module Recurly
7
7
  class SubscriptionPause < Request
8
8
 
9
9
  # @!attribute remaining_pause_cycles
10
- # @return [Integer] Number of billing cycles to pause the subscriptions. A value of 0 will cancel any pending pauses on the subscription.
10
+ # @return [Integer] Number of billing cycles to pause the subscriptions.
11
11
  define_attribute :remaining_pause_cycles, Integer
12
12
  end
13
13
  end
@@ -34,10 +34,6 @@ module Recurly
34
34
  # @return [Integer] Optionally override the default quantity of 1.
35
35
  define_attribute :quantity, Integer
36
36
 
37
- # @!attribute ramp_intervals
38
- # @return [Array[SubscriptionRampInterval]] The new set of ramp intervals for the subscription.
39
- define_attribute :ramp_intervals, Array, { :item_type => :SubscriptionRampInterval }
40
-
41
37
  # @!attribute renewal_billing_cycles
42
38
  # @return [Integer] If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.
43
39
  define_attribute :renewal_billing_cycles, Integer
@@ -54,20 +50,16 @@ module Recurly
54
50
  # @return [DateTime] If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial.
55
51
  define_attribute :starts_at, DateTime
56
52
 
57
- # @!attribute tax_inclusive
58
- # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
59
- define_attribute :tax_inclusive, :Boolean
60
-
61
53
  # @!attribute total_billing_cycles
62
54
  # @return [Integer] The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.
63
55
  define_attribute :total_billing_cycles, Integer
64
56
 
65
57
  # @!attribute trial_ends_at
66
- # @return [DateTime] If set, overrides the default trial behavior for the subscription. When the current date time or a past date time is provided the subscription will begin with no trial phase (overriding any plan default trial). When a future date time is provided the subscription will begin with a trial phase ending at the specified date time.
58
+ # @return [DateTime] If set, overrides the default trial behavior for the subscription. The date must be in the future.
67
59
  define_attribute :trial_ends_at, DateTime
68
60
 
69
61
  # @!attribute unit_amount
70
- # @return [Float] Override the unit amount of the subscription plan by setting this value. If not provided, the subscription will inherit the price from the subscription plan for the provided currency.
62
+ # @return [Float] Override the unit amount of the subscription plan by setting this value in cents. If not provided, the subscription will inherit the price from the subscription plan for the provided currency.
71
63
  define_attribute :unit_amount, Float
72
64
  end
73
65
  end
@@ -11,7 +11,7 @@ module Recurly
11
11
  define_attribute :auto_renew, :Boolean
12
12
 
13
13
  # @!attribute billing_info_id
14
- # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
14
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
15
15
  define_attribute :billing_info_id, String
16
16
 
17
17
  # @!attribute collection_method
@@ -54,10 +54,6 @@ module Recurly
54
54
  # @return [SubscriptionShippingUpdate] Subscription shipping details
55
55
  define_attribute :shipping, :SubscriptionShippingUpdate
56
56
 
57
- # @!attribute tax_inclusive
58
- # @return [Boolean] This field is deprecated. Please do not use it.
59
- define_attribute :tax_inclusive, :Boolean
60
-
61
57
  # @!attribute terms_and_conditions
62
58
  # @return [String] Specify custom notes to add or override Terms and Conditions. Custom notes will stay with a subscription on all renewals.
63
59
  define_attribute :terms_and_conditions, String
@@ -7,8 +7,8 @@ module Recurly
7
7
  class Tier < Request
8
8
 
9
9
  # @!attribute currencies
10
- # @return [Array[Pricing]] Tier pricing
11
- define_attribute :currencies, Array, { :item_type => :Pricing }
10
+ # @return [Array[TierPricing]] Tier pricing
11
+ define_attribute :currencies, Array, { :item_type => :TierPricing }
12
12
 
13
13
  # @!attribute ending_quantity
14
14
  # @return [Integer] Ending quantity
@@ -4,15 +4,19 @@
4
4
  # need and we will usher them to the appropriate places.
5
5
  module Recurly
6
6
  module Requests
7
- class PlanRampPricing < Request
7
+ class TierPricing < Request
8
8
 
9
9
  # @!attribute currency
10
10
  # @return [String] 3-letter ISO 4217 currency code.
11
11
  define_attribute :currency, String
12
12
 
13
13
  # @!attribute unit_amount
14
- # @return [Float] Represents the price for the Ramp Interval.
14
+ # @return [Float] Allows up to 2 decimal places. Required unless `unit_amount_decimal` is provided.
15
15
  define_attribute :unit_amount, Float
16
+
17
+ # @!attribute unit_amount_decimal
18
+ # @return [String] Allows up to 9 decimal places. Only supported when `add_on_type` = `usage`. If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
19
+ define_attribute :unit_amount_decimal, String
16
20
  end
17
21
  end
18
22
  end
@@ -7,7 +7,7 @@ module Recurly
7
7
  class UsageCreate < Request
8
8
 
9
9
  # @!attribute amount
10
- # @return [Float] The amount of usage. Can be positive, negative, or 0. If the Decimal Quantity feature is enabled, this value will be rounded to nine decimal places. Otherwise, all digits after the decimal will be stripped. If the usage-based add-on is billed with a percentage, your usage should be a monetary amount formatted in cents (e.g., $5.00 is "500").
10
+ # @return [Float] The amount of usage. Can be positive, negative, or 0. No decimals allowed, we will strip them. If the usage-based add-on is billed with a percentage, your usage will be a monetary amount you will want to format in cents. (e.g., $5.00 is "500").
11
11
  define_attribute :amount, Float
12
12
 
13
13
  # @!attribute merchant_tag
@@ -42,18 +42,10 @@ module Recurly
42
42
  # @return [DateTime] If present, when the account was last marked inactive.
43
43
  define_attribute :deleted_at, DateTime
44
44
 
45
- # @!attribute dunning_campaign_id
46
- # @return [String] Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
47
- define_attribute :dunning_campaign_id, String
48
-
49
45
  # @!attribute email
50
46
  # @return [String] The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
51
47
  define_attribute :email, String
52
48
 
53
- # @!attribute entity_use_code
54
- # @return [String] The Avalara AvaTax value that can be passed to identify the customer type for tax purposes. The range of values can be A - R (more info at Avalara). Value is case-sensitive.
55
- define_attribute :entity_use_code, String
56
-
57
49
  # @!attribute exemption_certificate
58
50
  # @return [String] The tax exemption certificate number for the account. If the merchant has an integration for the Vertex tax provider, this optional value will be sent in any tax calculation requests for the account.
59
51
  define_attribute :exemption_certificate, String
@@ -110,10 +102,6 @@ module Recurly
110
102
  # @return [String] Used to determine the language and locale of emails sent on behalf of the merchant to the customer.
111
103
  define_attribute :preferred_locale, String
112
104
 
113
- # @!attribute preferred_time_zone
114
- # @return [String] The [IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names) used to determine the time zone of emails sent on behalf of the merchant to the customer.
115
- define_attribute :preferred_time_zone, String
116
-
117
105
  # @!attribute shipping_addresses
118
106
  # @return [Array[ShippingAddress]] The shipping addresses on the account.
119
107
  define_attribute :shipping_addresses, Array, { :item_type => :ShippingAddress }
@@ -10,17 +10,9 @@ module Recurly
10
10
  # @return [Float] Total amount the account is past due.
11
11
  define_attribute :amount, Float
12
12
 
13
- # @!attribute available_credit_amount
14
- # @return [Float] Total amount of the open balances on credit invoices for the account.
15
- define_attribute :available_credit_amount, Float
16
-
17
13
  # @!attribute currency
18
14
  # @return [String] 3-letter ISO 4217 currency code.
19
15
  define_attribute :currency, String
20
-
21
- # @!attribute processing_prepayment_amount
22
- # @return [Float] Total amount for the prepayment credit invoices in a `processing` state on the account.
23
- define_attribute :processing_prepayment_amount, Float
24
16
  end
25
17
  end
26
18
  end
@@ -18,10 +18,6 @@ module Recurly
18
18
  # @return [String]
19
19
  define_attribute :company, String
20
20
 
21
- # @!attribute dunning_campaign_id
22
- # @return [String] Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
23
- define_attribute :dunning_campaign_id, String
24
-
25
21
  # @!attribute email
26
22
  # @return [String] The email address used for communicating with this customer.
27
23
  define_attribute :email, String
@@ -91,7 +91,7 @@ module Recurly
91
91
  define_attribute :tax_code, String
92
92
 
93
93
  # @!attribute tier_type
94
- # @return [String] The type of tiering used by the Add-on.
94
+ # @return [String] The pricing model for the add-on. For more information, [click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). See our [Guide](https://developers.recurly.com/guides/item-addon-guide.html) for an overview of how to configure quantity-based pricing models.
95
95
  define_attribute :tier_type, String
96
96
 
97
97
  # @!attribute tiers
@@ -10,13 +10,13 @@ module Recurly
10
10
  # @return [String] 3-letter ISO 4217 currency code.
11
11
  define_attribute :currency, String
12
12
 
13
- # @!attribute tax_inclusive
14
- # @return [Boolean] This field is deprecated. Please do not use it.
15
- define_attribute :tax_inclusive, :Boolean
16
-
17
13
  # @!attribute unit_amount
18
- # @return [Float] Unit price
14
+ # @return [Float] Allows up to 2 decimal places. Required unless `unit_amount_decimal` is provided.
19
15
  define_attribute :unit_amount, Float
16
+
17
+ # @!attribute unit_amount_decimal
18
+ # @return [String] Allows up to 9 decimal places. Only supported when `add_on_type` = `usage`. If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
19
+ define_attribute :unit_amount_decimal, String
20
20
  end
21
21
  end
22
22
  end
@@ -11,21 +11,9 @@ module Recurly
11
11
  define_attribute :city, String
12
12
 
13
13
  # @!attribute country
14
- # @return [String] Country, 2-letter ISO 3166-1 alpha-2 code.
14
+ # @return [String] Country, 2-letter ISO code.
15
15
  define_attribute :country, String
16
16
 
17
- # @!attribute first_name
18
- # @return [String] First name
19
- define_attribute :first_name, String
20
-
21
- # @!attribute geo_code
22
- # @return [String] Code that represents a geographic entity (location or object). Only returned for Sling Vertex Integration
23
- define_attribute :geo_code, String
24
-
25
- # @!attribute last_name
26
- # @return [String] Last name
27
- define_attribute :last_name, String
28
-
29
17
  # @!attribute phone
30
18
  # @return [String] Phone number
31
19
  define_attribute :phone, String