recurly 3.29.1 → 4.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/.bumpversion.cfg +1 -1
- data/.github/workflows/docs.yml +2 -2
- data/.github_changelog_generator +8 -0
- data/.travis.yml +13 -0
- data/CHANGELOG.md +202 -391
- data/CONTRIBUTING.md +0 -4
- data/GETTING_STARTED.md +20 -17
- data/README.md +0 -3
- data/lib/data/ca-certificates.crt +40 -0
- data/lib/recurly/client/operations.rb +815 -748
- data/lib/recurly/client.rb +44 -28
- data/lib/recurly/errors/api_errors.rb +33 -1
- data/lib/recurly/errors.rb +5 -23
- data/lib/recurly/pager.rb +5 -15
- data/lib/recurly/requests/{account_acquisition_updatable.rb → account_acquisition_update.rb} +1 -1
- data/lib/recurly/requests/account_create.rb +2 -14
- data/lib/recurly/requests/account_purchase.rb +2 -14
- data/lib/recurly/requests/account_update.rb +0 -12
- data/lib/recurly/requests/add_on_create.rb +5 -5
- data/lib/recurly/requests/add_on_pricing.rb +5 -5
- data/lib/recurly/requests/add_on_update.rb +3 -3
- data/lib/recurly/requests/address.rb +1 -13
- data/lib/recurly/requests/billing_info_create.rb +4 -52
- data/lib/recurly/requests/coupon_create.rb +1 -1
- data/lib/recurly/requests/custom_field.rb +0 -8
- data/lib/recurly/requests/external_transaction.rb +1 -1
- data/lib/recurly/requests/invoice_address.rb +1 -5
- data/lib/recurly/requests/invoice_collect.rb +1 -1
- data/lib/recurly/requests/invoice_create.rb +1 -9
- data/lib/recurly/requests/{invoice_updatable.rb → invoice_update.rb} +1 -1
- data/lib/recurly/requests/item_create.rb +1 -1
- data/lib/recurly/requests/item_update.rb +1 -1
- data/lib/recurly/requests/line_item_create.rb +3 -15
- data/lib/recurly/requests/line_item_refund.rb +0 -4
- data/lib/recurly/requests/plan_create.rb +1 -17
- data/lib/recurly/requests/plan_pricing.rb +1 -5
- data/lib/recurly/requests/plan_update.rb +1 -13
- data/lib/recurly/requests/pricing.rb +0 -4
- data/lib/recurly/requests/purchase_create.rb +1 -9
- data/lib/recurly/requests/shipping_address_create.rb +1 -5
- data/lib/recurly/requests/shipping_address_update.rb +1 -5
- data/lib/recurly/requests/subscription_add_on_create.rb +8 -4
- data/lib/recurly/requests/subscription_add_on_tier.rb +5 -1
- data/lib/recurly/requests/subscription_add_on_update.rb +6 -2
- data/lib/recurly/requests/subscription_change_create.rb +1 -13
- data/lib/recurly/requests/subscription_create.rb +6 -26
- data/lib/recurly/requests/subscription_pause.rb +1 -1
- data/lib/recurly/requests/subscription_purchase.rb +3 -31
- data/lib/recurly/requests/subscription_update.rb +1 -13
- data/lib/recurly/requests/tier.rb +2 -2
- data/lib/recurly/requests/{plan_ramp_pricing.rb → tier_pricing.rb} +6 -2
- data/lib/recurly/requests/usage_create.rb +1 -1
- data/lib/recurly/resources/account.rb +0 -12
- data/lib/recurly/resources/account_balance_amount.rb +0 -8
- data/lib/recurly/resources/account_mini.rb +0 -4
- data/lib/recurly/resources/add_on.rb +2 -2
- data/lib/recurly/resources/add_on_pricing.rb +5 -5
- data/lib/recurly/resources/address.rb +1 -13
- data/lib/recurly/resources/address_with_name.rb +46 -0
- data/lib/recurly/resources/billing_info.rb +1 -5
- data/lib/recurly/resources/billing_info_updated_by.rb +1 -1
- data/lib/recurly/resources/coupon.rb +5 -17
- data/lib/recurly/resources/custom_field.rb +0 -8
- data/lib/recurly/resources/custom_field_definition.rb +1 -1
- data/lib/recurly/resources/invoice.rb +8 -20
- data/lib/recurly/resources/invoice_address.rb +1 -5
- data/lib/recurly/resources/item.rb +1 -1
- data/lib/recurly/resources/line_item.rb +9 -29
- data/lib/recurly/resources/payment_method.rb +0 -12
- data/lib/recurly/resources/plan.rb +2 -18
- data/lib/recurly/resources/plan_pricing.rb +1 -5
- data/lib/recurly/resources/pricing.rb +0 -4
- data/lib/recurly/resources/shipping_address.rb +1 -5
- data/lib/recurly/resources/subscription.rb +0 -20
- data/lib/recurly/resources/subscription_add_on.rb +6 -2
- data/lib/recurly/resources/subscription_add_on_tier.rb +5 -1
- data/lib/recurly/resources/subscription_change.rb +0 -16
- data/lib/recurly/resources/tax_info.rb +3 -7
- data/lib/recurly/resources/tier.rb +2 -2
- data/lib/recurly/resources/{plan_ramp_pricing.rb → tier_pricing.rb} +6 -2
- data/lib/recurly/resources/transaction.rb +3 -7
- data/lib/recurly/resources/unique_coupon_code_params.rb +26 -0
- data/lib/recurly/resources/usage.rb +6 -2
- data/lib/recurly/version.rb +1 -1
- data/openapi/api.yaml +2308 -13819
- data/scripts/build +2 -2
- data/scripts/bump +11 -0
- data/scripts/changelog +14 -0
- data/scripts/format +2 -2
- data/scripts/prepare-release +29 -43
- data/scripts/release +20 -5
- metadata +14 -33
- data/.changelog_config.yaml +0 -11
- data/.github/workflows/ci.yml +0 -29
- data/.github/workflows/pr-review.yml +0 -27
- data/CODE_OF_CONDUCT.md +0 -130
- data/lib/recurly/errors/network_errors.rb +0 -10
- data/lib/recurly/requests/billing_info_verify.rb +0 -18
- data/lib/recurly/requests/billing_info_verify_cvv.rb +0 -26
- data/lib/recurly/requests/credit_application_policy.rb +0 -18
- data/lib/recurly/requests/dunning_campaigns_bulk_update.rb +0 -18
- data/lib/recurly/requests/gateway_attributes.rb +0 -14
- data/lib/recurly/requests/plan_ramp_interval.rb +0 -18
- data/lib/recurly/requests/subscription_change_billing_info_create.rb +0 -14
- data/lib/recurly/requests/subscription_ramp_interval.rb +0 -18
- data/lib/recurly/resources/credit_application_policy.rb +0 -18
- data/lib/recurly/resources/dunning_campaign.rb +0 -50
- data/lib/recurly/resources/dunning_campaigns_bulk_update_response.rb +0 -18
- data/lib/recurly/resources/dunning_cycle.rb +0 -58
- data/lib/recurly/resources/dunning_interval.rb +0 -18
- data/lib/recurly/resources/gateway_attributes.rb +0 -14
- data/lib/recurly/resources/line_item_list.rb +0 -26
- data/lib/recurly/resources/plan_ramp_interval.rb +0 -18
- data/lib/recurly/resources/subscription_change_billing_info.rb +0 -14
- data/lib/recurly/resources/subscription_change_preview.rb +0 -90
- data/lib/recurly/resources/subscription_ramp_interval_response.rb +0 -30
- data/lib/recurly/resources/tax_detail.rb +0 -38
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
module Recurly
|
|
6
6
|
class Client
|
|
7
7
|
def api_version
|
|
8
|
-
"
|
|
8
|
+
"v2021-02-25"
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
# List sites
|
|
12
12
|
#
|
|
13
|
-
# {https://developers.recurly.com/api/
|
|
13
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_sites list_sites api documenation}
|
|
14
14
|
#
|
|
15
|
-
# @param
|
|
15
|
+
# @param params [Hash] Optional query string parameters:
|
|
16
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
16
17
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
17
18
|
#
|
|
18
19
|
# *Important notes:*
|
|
@@ -24,17 +25,20 @@ module Recurly
|
|
|
24
25
|
# * Records are returned in an arbitrary order. Since results are all
|
|
25
26
|
# returned at once you can sort the records yourself.
|
|
26
27
|
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
28
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
29
|
+
# :order [String] Sort order.
|
|
30
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
30
31
|
# order. In descending order updated records will move behind the cursor and could
|
|
31
32
|
# prevent some records from being returned.
|
|
32
33
|
#
|
|
33
|
-
#
|
|
34
|
+
# :state [String] Filter by state.
|
|
34
35
|
#
|
|
35
36
|
# @return [Pager<Resources::Site>] A list of sites.
|
|
36
37
|
# @example
|
|
37
|
-
#
|
|
38
|
+
# params = {
|
|
39
|
+
# limit: 200
|
|
40
|
+
# }
|
|
41
|
+
# sites = @client.list_sites(params: params)
|
|
38
42
|
# sites.each do |site|
|
|
39
43
|
# puts "Site: #{site.subdomain}"
|
|
40
44
|
# end
|
|
@@ -46,9 +50,10 @@ module Recurly
|
|
|
46
50
|
|
|
47
51
|
# Fetch a site
|
|
48
52
|
#
|
|
49
|
-
# {https://developers.recurly.com/api/
|
|
53
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_site get_site api documenation}
|
|
50
54
|
#
|
|
51
55
|
# @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
56
|
+
# @param params [Hash] Optional query string parameters:
|
|
52
57
|
#
|
|
53
58
|
# @return [Resources::Site] A site.
|
|
54
59
|
# @example
|
|
@@ -61,16 +66,17 @@ module Recurly
|
|
|
61
66
|
# puts "Resource Not Found"
|
|
62
67
|
# end
|
|
63
68
|
#
|
|
64
|
-
def get_site(site_id
|
|
69
|
+
def get_site(site_id:, **options)
|
|
65
70
|
path = interpolate_path("/sites/{site_id}", site_id: site_id)
|
|
66
|
-
get(path)
|
|
71
|
+
get(path, **options)
|
|
67
72
|
end
|
|
68
73
|
|
|
69
74
|
# List a site's accounts
|
|
70
75
|
#
|
|
71
|
-
# {https://developers.recurly.com/api/
|
|
76
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_accounts list_accounts api documenation}
|
|
72
77
|
#
|
|
73
|
-
# @param
|
|
78
|
+
# @param params [Hash] Optional query string parameters:
|
|
79
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
74
80
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
75
81
|
#
|
|
76
82
|
# *Important notes:*
|
|
@@ -82,43 +88,47 @@ module Recurly
|
|
|
82
88
|
# * Records are returned in an arbitrary order. Since results are all
|
|
83
89
|
# returned at once you can sort the records yourself.
|
|
84
90
|
#
|
|
85
|
-
#
|
|
86
|
-
#
|
|
87
|
-
#
|
|
91
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
92
|
+
# :order [String] Sort order.
|
|
93
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
88
94
|
# order. In descending order updated records will move behind the cursor and could
|
|
89
95
|
# prevent some records from being returned.
|
|
90
96
|
#
|
|
91
|
-
#
|
|
97
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
92
98
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
93
99
|
#
|
|
94
|
-
#
|
|
100
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
95
101
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
96
102
|
#
|
|
97
|
-
#
|
|
98
|
-
#
|
|
103
|
+
# :email [String] Filter for accounts with this exact email address. A blank value will return accounts with both +null+ and +""+ email addresses. Note that multiple accounts can share one email address.
|
|
104
|
+
# :subscriber [Boolean] Filter for accounts with or without a subscription in the +active+,
|
|
99
105
|
# +canceled+, or +future+ state.
|
|
100
106
|
#
|
|
101
|
-
#
|
|
102
|
-
#
|
|
107
|
+
# :past_due [String] Filter for accounts with an invoice in the +past_due+ state.
|
|
108
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
103
109
|
#
|
|
104
110
|
# @return [Pager<Resources::Account>] A list of the site's accounts.
|
|
105
111
|
# @example
|
|
106
|
-
#
|
|
112
|
+
# params = {
|
|
113
|
+
# limit: 200
|
|
114
|
+
# }
|
|
115
|
+
# accounts = @client.list_accounts(params: params)
|
|
107
116
|
# accounts.each do |account|
|
|
108
117
|
# puts "Account: #{account.code}"
|
|
109
118
|
# end
|
|
110
119
|
#
|
|
111
120
|
def list_accounts(**options)
|
|
112
|
-
path = "/accounts"
|
|
121
|
+
path = interpolate_path("/accounts")
|
|
113
122
|
pager(path, **options)
|
|
114
123
|
end
|
|
115
124
|
|
|
116
125
|
# Create an account
|
|
117
126
|
#
|
|
118
|
-
# {https://developers.recurly.com/api/
|
|
127
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_account create_account api documenation}
|
|
119
128
|
#
|
|
120
129
|
# @param body [Requests::AccountCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountCreate}
|
|
121
|
-
# @param
|
|
130
|
+
# @param params [Hash] Optional query string parameters:
|
|
131
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
122
132
|
#
|
|
123
133
|
# @return [Resources::Account] An account.
|
|
124
134
|
# @example
|
|
@@ -127,7 +137,6 @@ module Recurly
|
|
|
127
137
|
# code: account_code,
|
|
128
138
|
# first_name: "Benjamin",
|
|
129
139
|
# last_name: "Du Monde",
|
|
130
|
-
# preferred_time_zone: "America/Chicago",
|
|
131
140
|
# acquisition: {
|
|
132
141
|
# campaign: "podcast-marketing",
|
|
133
142
|
# channel: "social_media",
|
|
@@ -159,16 +168,17 @@ module Recurly
|
|
|
159
168
|
# end
|
|
160
169
|
#
|
|
161
170
|
def create_account(body:, **options)
|
|
162
|
-
path = "/accounts"
|
|
171
|
+
path = interpolate_path("/accounts")
|
|
163
172
|
post(path, body, Requests::AccountCreate, **options)
|
|
164
173
|
end
|
|
165
174
|
|
|
166
175
|
# Fetch an account
|
|
167
176
|
#
|
|
168
|
-
# {https://developers.recurly.com/api/
|
|
177
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_account get_account api documenation}
|
|
169
178
|
#
|
|
170
179
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
171
|
-
# @param
|
|
180
|
+
# @param params [Hash] Optional query string parameters:
|
|
181
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
172
182
|
#
|
|
173
183
|
# @return [Resources::Account] An account.
|
|
174
184
|
# @example
|
|
@@ -186,13 +196,14 @@ module Recurly
|
|
|
186
196
|
get(path, **options)
|
|
187
197
|
end
|
|
188
198
|
|
|
189
|
-
#
|
|
199
|
+
# Update an account
|
|
190
200
|
#
|
|
191
|
-
# {https://developers.recurly.com/api/
|
|
201
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_account update_account api documenation}
|
|
192
202
|
#
|
|
193
203
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
194
204
|
# @param body [Requests::AccountUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountUpdate}
|
|
195
|
-
# @param
|
|
205
|
+
# @param params [Hash] Optional query string parameters:
|
|
206
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
196
207
|
#
|
|
197
208
|
# @return [Resources::Account] An account.
|
|
198
209
|
# @example
|
|
@@ -219,10 +230,11 @@ module Recurly
|
|
|
219
230
|
|
|
220
231
|
# Deactivate an account
|
|
221
232
|
#
|
|
222
|
-
# {https://developers.recurly.com/api/
|
|
233
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_account deactivate_account api documenation}
|
|
223
234
|
#
|
|
224
235
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
225
|
-
# @param
|
|
236
|
+
# @param params [Hash] Optional query string parameters:
|
|
237
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
226
238
|
#
|
|
227
239
|
# @return [Resources::Account] An account.
|
|
228
240
|
# @example
|
|
@@ -242,10 +254,11 @@ module Recurly
|
|
|
242
254
|
|
|
243
255
|
# Fetch an account's acquisition data
|
|
244
256
|
#
|
|
245
|
-
# {https://developers.recurly.com/api/
|
|
257
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_account_acquisition get_account_acquisition api documenation}
|
|
246
258
|
#
|
|
247
259
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
248
|
-
# @param
|
|
260
|
+
# @param params [Hash] Optional query string parameters:
|
|
261
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
249
262
|
#
|
|
250
263
|
# @return [Resources::AccountAcquisition] An account's acquisition data.
|
|
251
264
|
# @example
|
|
@@ -265,11 +278,12 @@ module Recurly
|
|
|
265
278
|
|
|
266
279
|
# Update an account's acquisition data
|
|
267
280
|
#
|
|
268
|
-
# {https://developers.recurly.com/api/
|
|
281
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_account_acquisition update_account_acquisition api documenation}
|
|
269
282
|
#
|
|
270
283
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
271
|
-
# @param body [Requests::
|
|
272
|
-
# @param
|
|
284
|
+
# @param body [Requests::AccountAcquisitionUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountAcquisitionUpdate}
|
|
285
|
+
# @param params [Hash] Optional query string parameters:
|
|
286
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
273
287
|
#
|
|
274
288
|
# @return [Resources::AccountAcquisition] An account's updated acquisition data.
|
|
275
289
|
# @example
|
|
@@ -296,15 +310,16 @@ module Recurly
|
|
|
296
310
|
#
|
|
297
311
|
def update_account_acquisition(account_id:, body:, **options)
|
|
298
312
|
path = interpolate_path("/accounts/{account_id}/acquisition", account_id: account_id)
|
|
299
|
-
put(path, body, Requests::
|
|
313
|
+
put(path, body, Requests::AccountAcquisitionUpdate, **options)
|
|
300
314
|
end
|
|
301
315
|
|
|
302
316
|
# Remove an account's acquisition data
|
|
303
317
|
#
|
|
304
|
-
# {https://developers.recurly.com/api/
|
|
318
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_account_acquisition remove_account_acquisition api documenation}
|
|
305
319
|
#
|
|
306
320
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
307
|
-
# @param
|
|
321
|
+
# @param params [Hash] Optional query string parameters:
|
|
322
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
308
323
|
#
|
|
309
324
|
# @return [Resources::Empty] Acquisition data was succesfully deleted.
|
|
310
325
|
# @example
|
|
@@ -324,10 +339,11 @@ module Recurly
|
|
|
324
339
|
|
|
325
340
|
# Reactivate an inactive account
|
|
326
341
|
#
|
|
327
|
-
# {https://developers.recurly.com/api/
|
|
342
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_account reactivate_account api documenation}
|
|
328
343
|
#
|
|
329
344
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
330
|
-
# @param
|
|
345
|
+
# @param params [Hash] Optional query string parameters:
|
|
346
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
331
347
|
#
|
|
332
348
|
# @return [Resources::Account] An account.
|
|
333
349
|
# @example
|
|
@@ -347,10 +363,11 @@ module Recurly
|
|
|
347
363
|
|
|
348
364
|
# Fetch an account's balance and past due status
|
|
349
365
|
#
|
|
350
|
-
# {https://developers.recurly.com/api/
|
|
366
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_account_balance get_account_balance api documenation}
|
|
351
367
|
#
|
|
352
368
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
353
|
-
# @param
|
|
369
|
+
# @param params [Hash] Optional query string parameters:
|
|
370
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
354
371
|
#
|
|
355
372
|
# @return [Resources::AccountBalance] An account's balance.
|
|
356
373
|
# @example
|
|
@@ -370,10 +387,11 @@ module Recurly
|
|
|
370
387
|
|
|
371
388
|
# Fetch an account's billing information
|
|
372
389
|
#
|
|
373
|
-
# {https://developers.recurly.com/api/
|
|
390
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_billing_info get_billing_info api documenation}
|
|
374
391
|
#
|
|
375
392
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
376
|
-
# @param
|
|
393
|
+
# @param params [Hash] Optional query string parameters:
|
|
394
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
377
395
|
#
|
|
378
396
|
# @return [Resources::BillingInfo] An account's billing information.
|
|
379
397
|
# @example
|
|
@@ -393,11 +411,12 @@ module Recurly
|
|
|
393
411
|
|
|
394
412
|
# Set an account's billing information
|
|
395
413
|
#
|
|
396
|
-
# {https://developers.recurly.com/api/
|
|
414
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_billing_info update_billing_info api documenation}
|
|
397
415
|
#
|
|
398
416
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
399
417
|
# @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
|
|
400
|
-
# @param
|
|
418
|
+
# @param params [Hash] Optional query string parameters:
|
|
419
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
401
420
|
#
|
|
402
421
|
# @return [Resources::BillingInfo] Updated billing information.
|
|
403
422
|
# @example
|
|
@@ -424,10 +443,11 @@ module Recurly
|
|
|
424
443
|
|
|
425
444
|
# Remove an account's billing information
|
|
426
445
|
#
|
|
427
|
-
# {https://developers.recurly.com/api/
|
|
446
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_billing_info remove_billing_info api documenation}
|
|
428
447
|
#
|
|
429
448
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
430
|
-
# @param
|
|
449
|
+
# @param params [Hash] Optional query string parameters:
|
|
450
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
431
451
|
#
|
|
432
452
|
# @return [Resources::Empty] Billing information deleted
|
|
433
453
|
# @example
|
|
@@ -445,51 +465,13 @@ module Recurly
|
|
|
445
465
|
delete(path, **options)
|
|
446
466
|
end
|
|
447
467
|
|
|
448
|
-
# Verify an account's credit card billing information
|
|
449
|
-
#
|
|
450
|
-
# {https://developers.recurly.com/api/v2019-10-10#operation/verify_billing_info verify_billing_info api documentation}
|
|
451
|
-
#
|
|
452
|
-
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
453
|
-
# @param body [Requests::BillingInfoVerify] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoVerify}
|
|
454
|
-
# @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
455
|
-
#
|
|
456
|
-
# @return [Resources::Transaction] Transaction information from verify.
|
|
457
|
-
# @example
|
|
458
|
-
# begin
|
|
459
|
-
# transaction = @client.verify_billing_info(account_id: account_id)
|
|
460
|
-
# puts "Got Transaction #{transaction}"
|
|
461
|
-
# rescue Recurly::Errors::NotFoundError
|
|
462
|
-
# # If the resource was not found, you may want to alert the user or
|
|
463
|
-
# # just return nil
|
|
464
|
-
# puts "Resource Not Found"
|
|
465
|
-
# end
|
|
466
|
-
#
|
|
467
|
-
def verify_billing_info(account_id:, **options)
|
|
468
|
-
path = interpolate_path("/accounts/{account_id}/billing_info/verify", account_id: account_id)
|
|
469
|
-
post(path, options[:body], Requests::BillingInfoVerify, **options)
|
|
470
|
-
end
|
|
471
|
-
|
|
472
|
-
# Verify an account's credit card billing cvv
|
|
473
|
-
#
|
|
474
|
-
# {https://developers.recurly.com/api/v2019-10-10#operation/verify_billing_info_cvv verify_billing_info_cvv api documentation}
|
|
475
|
-
#
|
|
476
|
-
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
477
|
-
# @param body [Requests::BillingInfoVerifyCVV] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoVerifyCVV}
|
|
478
|
-
# @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
479
|
-
#
|
|
480
|
-
# @return [Resources::Transaction] Transaction information from verify.
|
|
481
|
-
#
|
|
482
|
-
def verify_billing_info_cvv(account_id:, body:, **options)
|
|
483
|
-
path = interpolate_path("/accounts/{account_id}/billing_info/verify_cvv", account_id: account_id)
|
|
484
|
-
post(path, body, Requests::BillingInfoVerifyCVV, **options)
|
|
485
|
-
end
|
|
486
|
-
|
|
487
468
|
# Get the list of billing information associated with an account
|
|
488
469
|
#
|
|
489
|
-
# {https://developers.recurly.com/api/
|
|
470
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_billing_infos list_billing_infos api documenation}
|
|
490
471
|
#
|
|
491
472
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
492
|
-
# @param
|
|
473
|
+
# @param params [Hash] Optional query string parameters:
|
|
474
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
493
475
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
494
476
|
#
|
|
495
477
|
# *Important notes:*
|
|
@@ -501,17 +483,17 @@ module Recurly
|
|
|
501
483
|
# * Records are returned in an arbitrary order. Since results are all
|
|
502
484
|
# returned at once you can sort the records yourself.
|
|
503
485
|
#
|
|
504
|
-
#
|
|
486
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
505
487
|
# order. In descending order updated records will move behind the cursor and could
|
|
506
488
|
# prevent some records from being returned.
|
|
507
489
|
#
|
|
508
|
-
#
|
|
490
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
509
491
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
510
492
|
#
|
|
511
|
-
#
|
|
493
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
512
494
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
513
495
|
#
|
|
514
|
-
#
|
|
496
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
515
497
|
#
|
|
516
498
|
# @return [Pager<Resources::BillingInfo>] A list of the the billing information for an account's
|
|
517
499
|
#
|
|
@@ -520,13 +502,14 @@ module Recurly
|
|
|
520
502
|
pager(path, **options)
|
|
521
503
|
end
|
|
522
504
|
|
|
523
|
-
#
|
|
505
|
+
# Set an account's billing information when the wallet feature is enabled
|
|
524
506
|
#
|
|
525
|
-
# {https://developers.recurly.com/api/
|
|
507
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_billing_info create_billing_info api documenation}
|
|
526
508
|
#
|
|
527
509
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
528
510
|
# @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
|
|
529
|
-
# @param
|
|
511
|
+
# @param params [Hash] Optional query string parameters:
|
|
512
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
530
513
|
#
|
|
531
514
|
# @return [Resources::BillingInfo] Updated billing information.
|
|
532
515
|
#
|
|
@@ -537,11 +520,12 @@ module Recurly
|
|
|
537
520
|
|
|
538
521
|
# Fetch a billing info
|
|
539
522
|
#
|
|
540
|
-
# {https://developers.recurly.com/api/
|
|
523
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_a_billing_info get_a_billing_info api documenation}
|
|
541
524
|
#
|
|
542
525
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
543
|
-
# @param billing_info_id [String] Billing Info ID.
|
|
544
|
-
# @param
|
|
526
|
+
# @param billing_info_id [String] Billing Info ID.
|
|
527
|
+
# @param params [Hash] Optional query string parameters:
|
|
528
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
545
529
|
#
|
|
546
530
|
# @return [Resources::BillingInfo] A billing info.
|
|
547
531
|
#
|
|
@@ -552,12 +536,13 @@ module Recurly
|
|
|
552
536
|
|
|
553
537
|
# Update an account's billing information
|
|
554
538
|
#
|
|
555
|
-
# {https://developers.recurly.com/api/
|
|
539
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_a_billing_info update_a_billing_info api documenation}
|
|
556
540
|
#
|
|
557
541
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
558
|
-
# @param billing_info_id [String] Billing Info ID.
|
|
542
|
+
# @param billing_info_id [String] Billing Info ID.
|
|
559
543
|
# @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
|
|
560
|
-
# @param
|
|
544
|
+
# @param params [Hash] Optional query string parameters:
|
|
545
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
561
546
|
#
|
|
562
547
|
# @return [Resources::BillingInfo] Updated billing information.
|
|
563
548
|
#
|
|
@@ -568,11 +553,12 @@ module Recurly
|
|
|
568
553
|
|
|
569
554
|
# Remove an account's billing information
|
|
570
555
|
#
|
|
571
|
-
# {https://developers.recurly.com/api/
|
|
556
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_a_billing_info remove_a_billing_info api documenation}
|
|
572
557
|
#
|
|
573
558
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
574
|
-
# @param billing_info_id [String] Billing Info ID.
|
|
575
|
-
# @param
|
|
559
|
+
# @param billing_info_id [String] Billing Info ID.
|
|
560
|
+
# @param params [Hash] Optional query string parameters:
|
|
561
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
576
562
|
#
|
|
577
563
|
# @return [Resources::Empty] Billing information deleted
|
|
578
564
|
#
|
|
@@ -581,44 +567,13 @@ module Recurly
|
|
|
581
567
|
delete(path, **options)
|
|
582
568
|
end
|
|
583
569
|
|
|
584
|
-
#
|
|
585
|
-
#
|
|
586
|
-
# {https://developers.recurly.com/api/v2019-10-10#operation/verify_billing_infos verify_billing_infos api documentation}
|
|
587
|
-
#
|
|
588
|
-
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
589
|
-
# @param billing_info_id [String] Billing Info ID. Can ONLY be used for sites utilizing the Wallet feature.
|
|
590
|
-
# @param body [Requests::BillingInfoVerify] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoVerify}
|
|
591
|
-
# @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
592
|
-
#
|
|
593
|
-
# @return [Resources::Transaction] Transaction information from verify.
|
|
594
|
-
#
|
|
595
|
-
def verify_billing_infos(account_id:, billing_info_id:, **options)
|
|
596
|
-
path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}/verify", account_id: account_id, billing_info_id: billing_info_id)
|
|
597
|
-
post(path, options[:body], Requests::BillingInfoVerify, **options)
|
|
598
|
-
end
|
|
599
|
-
|
|
600
|
-
# Verify a billing information's credit card cvv
|
|
601
|
-
#
|
|
602
|
-
# {https://developers.recurly.com/api/v2019-10-10#operation/verify_billing_infos_cvv verify_billing_infos_cvv api documentation}
|
|
603
|
-
#
|
|
604
|
-
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
605
|
-
# @param billing_info_id [String] Billing Info ID. Can ONLY be used for sites utilizing the Wallet feature.
|
|
606
|
-
# @param body [Requests::BillingInfoVerifyCVV] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoVerifyCVV}
|
|
607
|
-
# @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
608
|
-
#
|
|
609
|
-
# @return [Resources::Transaction] Transaction information from verify.
|
|
610
|
-
#
|
|
611
|
-
def verify_billing_infos_cvv(account_id:, billing_info_id:, body:, **options)
|
|
612
|
-
path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}/verify_cvv", account_id: account_id, billing_info_id: billing_info_id)
|
|
613
|
-
post(path, body, Requests::BillingInfoVerifyCVV, **options)
|
|
614
|
-
end
|
|
615
|
-
|
|
616
|
-
# List the coupon redemptions for an account
|
|
570
|
+
# Show the coupon redemptions for an account
|
|
617
571
|
#
|
|
618
|
-
# {https://developers.recurly.com/api/
|
|
572
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_coupon_redemptions list_account_coupon_redemptions api documenation}
|
|
619
573
|
#
|
|
620
574
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
621
|
-
# @param
|
|
575
|
+
# @param params [Hash] Optional query string parameters:
|
|
576
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
622
577
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
623
578
|
#
|
|
624
579
|
# *Important notes:*
|
|
@@ -630,24 +585,27 @@ module Recurly
|
|
|
630
585
|
# * Records are returned in an arbitrary order. Since results are all
|
|
631
586
|
# returned at once you can sort the records yourself.
|
|
632
587
|
#
|
|
633
|
-
#
|
|
588
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
634
589
|
# order. In descending order updated records will move behind the cursor and could
|
|
635
590
|
# prevent some records from being returned.
|
|
636
591
|
#
|
|
637
|
-
#
|
|
592
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
638
593
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
639
594
|
#
|
|
640
|
-
#
|
|
595
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
641
596
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
642
597
|
#
|
|
643
|
-
#
|
|
644
|
-
#
|
|
598
|
+
# :state [String] Filter by state.
|
|
599
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
645
600
|
#
|
|
646
601
|
# @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on an account.
|
|
647
602
|
# @example
|
|
603
|
+
# params = {
|
|
604
|
+
# limit: 200
|
|
605
|
+
# }
|
|
648
606
|
# redemptions = @client.list_account_coupon_redemptions(
|
|
649
607
|
# account_id: account_id,
|
|
650
|
-
#
|
|
608
|
+
# params: params
|
|
651
609
|
# )
|
|
652
610
|
# redemptions.each do |redemption|
|
|
653
611
|
# puts "CouponRedemption: #{redemption.id}"
|
|
@@ -658,36 +616,37 @@ module Recurly
|
|
|
658
616
|
pager(path, **options)
|
|
659
617
|
end
|
|
660
618
|
|
|
661
|
-
#
|
|
619
|
+
# Show the coupon redemptions that are active on an account
|
|
662
620
|
#
|
|
663
|
-
# {https://developers.recurly.com/api/
|
|
621
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_active_coupon_redemptions list_active_coupon_redemptions api documenation}
|
|
664
622
|
#
|
|
665
623
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
666
|
-
# @param
|
|
624
|
+
# @param params [Hash] Optional query string parameters:
|
|
625
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
667
626
|
#
|
|
668
|
-
# @return [Resources::CouponRedemption]
|
|
627
|
+
# @return [Pager<Resources::CouponRedemption>] Active coupon redemptions on an account.
|
|
669
628
|
# @example
|
|
670
|
-
#
|
|
671
|
-
#
|
|
672
|
-
#
|
|
673
|
-
#
|
|
674
|
-
#
|
|
675
|
-
#
|
|
676
|
-
# puts "Resource Not Found"
|
|
629
|
+
# params = {
|
|
630
|
+
# limit: 200
|
|
631
|
+
# }
|
|
632
|
+
# redemptions = @client.list_active_coupon_redemptions(account_id: account_id, params: params)
|
|
633
|
+
# redemptions.each do |redemption|
|
|
634
|
+
# puts "Redemption: #{redemption.id}"
|
|
677
635
|
# end
|
|
678
636
|
#
|
|
679
|
-
def
|
|
637
|
+
def list_active_coupon_redemptions(account_id:, **options)
|
|
680
638
|
path = interpolate_path("/accounts/{account_id}/coupon_redemptions/active", account_id: account_id)
|
|
681
|
-
|
|
639
|
+
pager(path, **options)
|
|
682
640
|
end
|
|
683
641
|
|
|
684
642
|
# Generate an active coupon redemption on an account or subscription
|
|
685
643
|
#
|
|
686
|
-
# {https://developers.recurly.com/api/
|
|
644
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_coupon_redemption create_coupon_redemption api documenation}
|
|
687
645
|
#
|
|
688
646
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
689
647
|
# @param body [Requests::CouponRedemptionCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponRedemptionCreate}
|
|
690
|
-
# @param
|
|
648
|
+
# @param params [Hash] Optional query string parameters:
|
|
649
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
691
650
|
#
|
|
692
651
|
# @return [Resources::CouponRedemption] Returns the new coupon redemption.
|
|
693
652
|
# @example
|
|
@@ -714,10 +673,11 @@ module Recurly
|
|
|
714
673
|
|
|
715
674
|
# Delete the active coupon redemption from an account
|
|
716
675
|
#
|
|
717
|
-
# {https://developers.recurly.com/api/
|
|
676
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_coupon_redemption remove_coupon_redemption api documenation}
|
|
718
677
|
#
|
|
719
678
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
720
|
-
# @param
|
|
679
|
+
# @param params [Hash] Optional query string parameters:
|
|
680
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
721
681
|
#
|
|
722
682
|
# @return [Resources::CouponRedemption] Coupon redemption deleted.
|
|
723
683
|
# @example
|
|
@@ -737,28 +697,32 @@ module Recurly
|
|
|
737
697
|
|
|
738
698
|
# List an account's credit payments
|
|
739
699
|
#
|
|
740
|
-
# {https://developers.recurly.com/api/
|
|
700
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_credit_payments list_account_credit_payments api documenation}
|
|
741
701
|
#
|
|
742
702
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
743
|
-
# @param
|
|
744
|
-
#
|
|
745
|
-
#
|
|
703
|
+
# @param params [Hash] Optional query string parameters:
|
|
704
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
705
|
+
# :order [String] Sort order.
|
|
706
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
746
707
|
# order. In descending order updated records will move behind the cursor and could
|
|
747
708
|
# prevent some records from being returned.
|
|
748
709
|
#
|
|
749
|
-
#
|
|
710
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
750
711
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
751
712
|
#
|
|
752
|
-
#
|
|
713
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
753
714
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
754
715
|
#
|
|
755
|
-
#
|
|
716
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
756
717
|
#
|
|
757
718
|
# @return [Pager<Resources::CreditPayment>] A list of the account's credit payments.
|
|
758
719
|
# @example
|
|
720
|
+
# params = {
|
|
721
|
+
# limit: 200
|
|
722
|
+
# }
|
|
759
723
|
# payments = @client.list_account_credit_payments(
|
|
760
724
|
# account_id: account_id,
|
|
761
|
-
#
|
|
725
|
+
# params: params
|
|
762
726
|
# )
|
|
763
727
|
# payments.each do |payment|
|
|
764
728
|
# puts "CreditPayment: #{payment.id}"
|
|
@@ -771,10 +735,11 @@ module Recurly
|
|
|
771
735
|
|
|
772
736
|
# List an account's invoices
|
|
773
737
|
#
|
|
774
|
-
# {https://developers.recurly.com/api/
|
|
738
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_invoices list_account_invoices api documenation}
|
|
775
739
|
#
|
|
776
740
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
777
|
-
# @param
|
|
741
|
+
# @param params [Hash] Optional query string parameters:
|
|
742
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
778
743
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
779
744
|
#
|
|
780
745
|
# *Important notes:*
|
|
@@ -786,32 +751,34 @@ module Recurly
|
|
|
786
751
|
# * Records are returned in an arbitrary order. Since results are all
|
|
787
752
|
# returned at once you can sort the records yourself.
|
|
788
753
|
#
|
|
789
|
-
#
|
|
790
|
-
#
|
|
791
|
-
#
|
|
792
|
-
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
754
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
755
|
+
# :order [String] Sort order.
|
|
756
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
793
757
|
# order. In descending order updated records will move behind the cursor and could
|
|
794
758
|
# prevent some records from being returned.
|
|
795
759
|
#
|
|
796
|
-
#
|
|
760
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
797
761
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
798
762
|
#
|
|
799
|
-
#
|
|
763
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
800
764
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
801
765
|
#
|
|
802
|
-
#
|
|
766
|
+
# :type [String] Filter by type when:
|
|
803
767
|
# - +type=charge+, only charge invoices will be returned.
|
|
804
768
|
# - +type=credit+, only credit invoices will be returned.
|
|
805
769
|
# - +type=non-legacy+, only charge and credit invoices will be returned.
|
|
806
770
|
# - +type=legacy+, only legacy invoices will be returned.
|
|
807
771
|
#
|
|
808
|
-
#
|
|
772
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
809
773
|
#
|
|
810
774
|
# @return [Pager<Resources::Invoice>] A list of the account's invoices.
|
|
811
775
|
# @example
|
|
776
|
+
# params = {
|
|
777
|
+
# limit: 200
|
|
778
|
+
# }
|
|
812
779
|
# invoices = @client.list_account_invoices(
|
|
813
780
|
# account_id: account_id,
|
|
814
|
-
#
|
|
781
|
+
# params: params
|
|
815
782
|
# )
|
|
816
783
|
# invoices.each do |invoice|
|
|
817
784
|
# puts "Invoice: #{invoice.number}"
|
|
@@ -824,11 +791,12 @@ module Recurly
|
|
|
824
791
|
|
|
825
792
|
# Create an invoice for pending line items
|
|
826
793
|
#
|
|
827
|
-
# {https://developers.recurly.com/api/
|
|
794
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_invoice create_invoice api documenation}
|
|
828
795
|
#
|
|
829
796
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
830
797
|
# @param body [Requests::InvoiceCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCreate}
|
|
831
|
-
# @param
|
|
798
|
+
# @param params [Hash] Optional query string parameters:
|
|
799
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
832
800
|
#
|
|
833
801
|
# @return [Resources::InvoiceCollection] Returns the new invoices.
|
|
834
802
|
# @example
|
|
@@ -855,11 +823,12 @@ module Recurly
|
|
|
855
823
|
|
|
856
824
|
# Preview new invoice for pending line items
|
|
857
825
|
#
|
|
858
|
-
# {https://developers.recurly.com/api/
|
|
826
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/preview_invoice preview_invoice api documenation}
|
|
859
827
|
#
|
|
860
828
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
861
829
|
# @param body [Requests::InvoiceCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCreate}
|
|
862
|
-
# @param
|
|
830
|
+
# @param params [Hash] Optional query string parameters:
|
|
831
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
863
832
|
#
|
|
864
833
|
# @return [Resources::InvoiceCollection] Returns the invoice previews.
|
|
865
834
|
# @example
|
|
@@ -886,10 +855,11 @@ module Recurly
|
|
|
886
855
|
|
|
887
856
|
# List an account's line items
|
|
888
857
|
#
|
|
889
|
-
# {https://developers.recurly.com/api/
|
|
858
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_line_items list_account_line_items api documenation}
|
|
890
859
|
#
|
|
891
860
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
892
|
-
# @param
|
|
861
|
+
# @param params [Hash] Optional query string parameters:
|
|
862
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
893
863
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
894
864
|
#
|
|
895
865
|
# *Important notes:*
|
|
@@ -901,28 +871,31 @@ module Recurly
|
|
|
901
871
|
# * Records are returned in an arbitrary order. Since results are all
|
|
902
872
|
# returned at once you can sort the records yourself.
|
|
903
873
|
#
|
|
904
|
-
#
|
|
905
|
-
#
|
|
906
|
-
#
|
|
874
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
875
|
+
# :order [String] Sort order.
|
|
876
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
907
877
|
# order. In descending order updated records will move behind the cursor and could
|
|
908
878
|
# prevent some records from being returned.
|
|
909
879
|
#
|
|
910
|
-
#
|
|
880
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
911
881
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
912
882
|
#
|
|
913
|
-
#
|
|
883
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
914
884
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
915
885
|
#
|
|
916
|
-
#
|
|
917
|
-
#
|
|
918
|
-
#
|
|
919
|
-
#
|
|
886
|
+
# :original [String] Filter by original field.
|
|
887
|
+
# :state [String] Filter by state field.
|
|
888
|
+
# :type [String] Filter by type field.
|
|
889
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
920
890
|
#
|
|
921
891
|
# @return [Pager<Resources::LineItem>] A list of the account's line items.
|
|
922
892
|
# @example
|
|
893
|
+
# params = {
|
|
894
|
+
# limit: 200
|
|
895
|
+
# }
|
|
923
896
|
# line_items = @client.list_account_line_items(
|
|
924
897
|
# account_id: account_id,
|
|
925
|
-
#
|
|
898
|
+
# params: params
|
|
926
899
|
# )
|
|
927
900
|
# line_items.each do |line_item|
|
|
928
901
|
# puts "LineItem: #{line_item.id}"
|
|
@@ -935,11 +908,12 @@ module Recurly
|
|
|
935
908
|
|
|
936
909
|
# Create a new line item for the account
|
|
937
910
|
#
|
|
938
|
-
# {https://developers.recurly.com/api/
|
|
911
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_line_item create_line_item api documenation}
|
|
939
912
|
#
|
|
940
913
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
941
914
|
# @param body [Requests::LineItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::LineItemCreate}
|
|
942
|
-
# @param
|
|
915
|
+
# @param params [Hash] Optional query string parameters:
|
|
916
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
943
917
|
#
|
|
944
918
|
# @return [Resources::LineItem] Returns the new line item.
|
|
945
919
|
# @example
|
|
@@ -965,12 +939,13 @@ module Recurly
|
|
|
965
939
|
post(path, body, Requests::LineItemCreate, **options)
|
|
966
940
|
end
|
|
967
941
|
|
|
968
|
-
#
|
|
942
|
+
# Fetch a list of an account's notes
|
|
969
943
|
#
|
|
970
|
-
# {https://developers.recurly.com/api/
|
|
944
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_notes list_account_notes api documenation}
|
|
971
945
|
#
|
|
972
946
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
973
|
-
# @param
|
|
947
|
+
# @param params [Hash] Optional query string parameters:
|
|
948
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
974
949
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
975
950
|
#
|
|
976
951
|
# *Important notes:*
|
|
@@ -982,11 +957,14 @@ module Recurly
|
|
|
982
957
|
# * Records are returned in an arbitrary order. Since results are all
|
|
983
958
|
# returned at once you can sort the records yourself.
|
|
984
959
|
#
|
|
985
|
-
#
|
|
960
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
986
961
|
#
|
|
987
962
|
# @return [Pager<Resources::AccountNote>] A list of an account's notes.
|
|
988
963
|
# @example
|
|
989
|
-
#
|
|
964
|
+
# params = {
|
|
965
|
+
# limit: 200
|
|
966
|
+
# }
|
|
967
|
+
# account_notes = @client.list_account_notes(account_id: account_id, params: params)
|
|
990
968
|
# account_notes.each do |note|
|
|
991
969
|
# puts "AccountNote: #{note.message}"
|
|
992
970
|
# end
|
|
@@ -998,11 +976,12 @@ module Recurly
|
|
|
998
976
|
|
|
999
977
|
# Fetch an account note
|
|
1000
978
|
#
|
|
1001
|
-
# {https://developers.recurly.com/api/
|
|
979
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_account_note get_account_note api documenation}
|
|
1002
980
|
#
|
|
1003
981
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
1004
982
|
# @param account_note_id [String] Account Note ID.
|
|
1005
|
-
# @param
|
|
983
|
+
# @param params [Hash] Optional query string parameters:
|
|
984
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1006
985
|
#
|
|
1007
986
|
# @return [Resources::AccountNote] An account note.
|
|
1008
987
|
# @example
|
|
@@ -1025,10 +1004,11 @@ module Recurly
|
|
|
1025
1004
|
|
|
1026
1005
|
# Fetch a list of an account's shipping addresses
|
|
1027
1006
|
#
|
|
1028
|
-
# {https://developers.recurly.com/api/
|
|
1007
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_shipping_addresses list_shipping_addresses api documenation}
|
|
1029
1008
|
#
|
|
1030
1009
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
1031
|
-
# @param
|
|
1010
|
+
# @param params [Hash] Optional query string parameters:
|
|
1011
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
1032
1012
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
1033
1013
|
#
|
|
1034
1014
|
# *Important notes:*
|
|
@@ -1040,25 +1020,28 @@ module Recurly
|
|
|
1040
1020
|
# * Records are returned in an arbitrary order. Since results are all
|
|
1041
1021
|
# returned at once you can sort the records yourself.
|
|
1042
1022
|
#
|
|
1043
|
-
#
|
|
1044
|
-
#
|
|
1045
|
-
#
|
|
1023
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
1024
|
+
# :order [String] Sort order.
|
|
1025
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
1046
1026
|
# order. In descending order updated records will move behind the cursor and could
|
|
1047
1027
|
# prevent some records from being returned.
|
|
1048
1028
|
#
|
|
1049
|
-
#
|
|
1029
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
1050
1030
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1051
1031
|
#
|
|
1052
|
-
#
|
|
1032
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
1053
1033
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1054
1034
|
#
|
|
1055
|
-
#
|
|
1035
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1056
1036
|
#
|
|
1057
1037
|
# @return [Pager<Resources::ShippingAddress>] A list of an account's shipping addresses.
|
|
1058
1038
|
# @example
|
|
1039
|
+
# params = {
|
|
1040
|
+
# limit: 200
|
|
1041
|
+
# }
|
|
1059
1042
|
# shipping_addresses = @client.list_shipping_addresses(
|
|
1060
1043
|
# account_id: account_id,
|
|
1061
|
-
#
|
|
1044
|
+
# params: params
|
|
1062
1045
|
# )
|
|
1063
1046
|
# shipping_addresses.each do |addr|
|
|
1064
1047
|
# puts "ShippingAddress: #{addr.nickname} - #{addr.street1}"
|
|
@@ -1071,11 +1054,12 @@ module Recurly
|
|
|
1071
1054
|
|
|
1072
1055
|
# Create a new shipping address for the account
|
|
1073
1056
|
#
|
|
1074
|
-
# {https://developers.recurly.com/api/
|
|
1057
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_shipping_address create_shipping_address api documenation}
|
|
1075
1058
|
#
|
|
1076
1059
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
1077
1060
|
# @param body [Requests::ShippingAddressCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressCreate}
|
|
1078
|
-
# @param
|
|
1061
|
+
# @param params [Hash] Optional query string parameters:
|
|
1062
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1079
1063
|
#
|
|
1080
1064
|
# @return [Resources::ShippingAddress] Returns the new shipping address.
|
|
1081
1065
|
# @example
|
|
@@ -1105,11 +1089,12 @@ module Recurly
|
|
|
1105
1089
|
|
|
1106
1090
|
# Fetch an account's shipping address
|
|
1107
1091
|
#
|
|
1108
|
-
# {https://developers.recurly.com/api/
|
|
1092
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_shipping_address get_shipping_address api documenation}
|
|
1109
1093
|
#
|
|
1110
1094
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
1111
1095
|
# @param shipping_address_id [String] Shipping Address ID.
|
|
1112
|
-
# @param
|
|
1096
|
+
# @param params [Hash] Optional query string parameters:
|
|
1097
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1113
1098
|
#
|
|
1114
1099
|
# @return [Resources::ShippingAddress] A shipping address.
|
|
1115
1100
|
# @example
|
|
@@ -1132,12 +1117,13 @@ module Recurly
|
|
|
1132
1117
|
|
|
1133
1118
|
# Update an account's shipping address
|
|
1134
1119
|
#
|
|
1135
|
-
# {https://developers.recurly.com/api/
|
|
1120
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_shipping_address update_shipping_address api documenation}
|
|
1136
1121
|
#
|
|
1137
1122
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
1138
1123
|
# @param shipping_address_id [String] Shipping Address ID.
|
|
1139
1124
|
# @param body [Requests::ShippingAddressUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressUpdate}
|
|
1140
|
-
# @param
|
|
1125
|
+
# @param params [Hash] Optional query string parameters:
|
|
1126
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1141
1127
|
#
|
|
1142
1128
|
# @return [Resources::ShippingAddress] The updated shipping address.
|
|
1143
1129
|
# @example
|
|
@@ -1166,11 +1152,12 @@ module Recurly
|
|
|
1166
1152
|
|
|
1167
1153
|
# Remove an account's shipping address
|
|
1168
1154
|
#
|
|
1169
|
-
# {https://developers.recurly.com/api/
|
|
1155
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_shipping_address remove_shipping_address api documenation}
|
|
1170
1156
|
#
|
|
1171
1157
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
1172
1158
|
# @param shipping_address_id [String] Shipping Address ID.
|
|
1173
|
-
# @param
|
|
1159
|
+
# @param params [Hash] Optional query string parameters:
|
|
1160
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1174
1161
|
#
|
|
1175
1162
|
# @return [Resources::Empty] Shipping address deleted.
|
|
1176
1163
|
# @example
|
|
@@ -1193,10 +1180,11 @@ module Recurly
|
|
|
1193
1180
|
|
|
1194
1181
|
# List an account's subscriptions
|
|
1195
1182
|
#
|
|
1196
|
-
# {https://developers.recurly.com/api/
|
|
1183
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_subscriptions list_account_subscriptions api documenation}
|
|
1197
1184
|
#
|
|
1198
1185
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
1199
|
-
# @param
|
|
1186
|
+
# @param params [Hash] Optional query string parameters:
|
|
1187
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
1200
1188
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
1201
1189
|
#
|
|
1202
1190
|
# *Important notes:*
|
|
@@ -1208,31 +1196,34 @@ module Recurly
|
|
|
1208
1196
|
# * Records are returned in an arbitrary order. Since results are all
|
|
1209
1197
|
# returned at once you can sort the records yourself.
|
|
1210
1198
|
#
|
|
1211
|
-
#
|
|
1212
|
-
#
|
|
1213
|
-
#
|
|
1199
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
1200
|
+
# :order [String] Sort order.
|
|
1201
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
1214
1202
|
# order. In descending order updated records will move behind the cursor and could
|
|
1215
1203
|
# prevent some records from being returned.
|
|
1216
1204
|
#
|
|
1217
|
-
#
|
|
1205
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
1218
1206
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1219
1207
|
#
|
|
1220
|
-
#
|
|
1208
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
1221
1209
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1222
1210
|
#
|
|
1223
|
-
#
|
|
1211
|
+
# :state [String] Filter by state.
|
|
1224
1212
|
#
|
|
1225
1213
|
# - When +state=active+, +state=canceled+, +state=expired+, or +state=future+, subscriptions with states that match the query and only those subscriptions will be returned.
|
|
1226
1214
|
# - When +state=in_trial+, only subscriptions that have a trial_started_at date earlier than now and a trial_ends_at date later than now will be returned.
|
|
1227
1215
|
# - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
|
|
1228
1216
|
#
|
|
1229
|
-
#
|
|
1217
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1230
1218
|
#
|
|
1231
1219
|
# @return [Pager<Resources::Subscription>] A list of the account's subscriptions.
|
|
1232
1220
|
# @example
|
|
1221
|
+
# params = {
|
|
1222
|
+
# limit: 200
|
|
1223
|
+
# }
|
|
1233
1224
|
# subscriptions = @client.list_account_subscriptions(
|
|
1234
1225
|
# account_id: account_id,
|
|
1235
|
-
#
|
|
1226
|
+
# params: params
|
|
1236
1227
|
# )
|
|
1237
1228
|
# subscriptions.each do |subscription|
|
|
1238
1229
|
# puts "Subscription: #{subscription.uuid}"
|
|
@@ -1245,10 +1236,11 @@ module Recurly
|
|
|
1245
1236
|
|
|
1246
1237
|
# List an account's transactions
|
|
1247
1238
|
#
|
|
1248
|
-
# {https://developers.recurly.com/api/
|
|
1239
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_transactions list_account_transactions api documenation}
|
|
1249
1240
|
#
|
|
1250
1241
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
1251
|
-
# @param
|
|
1242
|
+
# @param params [Hash] Optional query string parameters:
|
|
1243
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
1252
1244
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
1253
1245
|
#
|
|
1254
1246
|
# *Important notes:*
|
|
@@ -1260,27 +1252,30 @@ module Recurly
|
|
|
1260
1252
|
# * Records are returned in an arbitrary order. Since results are all
|
|
1261
1253
|
# returned at once you can sort the records yourself.
|
|
1262
1254
|
#
|
|
1263
|
-
#
|
|
1264
|
-
#
|
|
1265
|
-
#
|
|
1255
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
1256
|
+
# :order [String] Sort order.
|
|
1257
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
1266
1258
|
# order. In descending order updated records will move behind the cursor and could
|
|
1267
1259
|
# prevent some records from being returned.
|
|
1268
1260
|
#
|
|
1269
|
-
#
|
|
1261
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
1270
1262
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1271
1263
|
#
|
|
1272
|
-
#
|
|
1264
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
1273
1265
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1274
1266
|
#
|
|
1275
|
-
#
|
|
1276
|
-
#
|
|
1277
|
-
#
|
|
1267
|
+
# :type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions.
|
|
1268
|
+
# :success [String] Filter by success field.
|
|
1269
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1278
1270
|
#
|
|
1279
1271
|
# @return [Pager<Resources::Transaction>] A list of the account's transactions.
|
|
1280
1272
|
# @example
|
|
1273
|
+
# params = {
|
|
1274
|
+
# limit: 200
|
|
1275
|
+
# }
|
|
1281
1276
|
# transactions = @client.list_account_transactions(
|
|
1282
1277
|
# account_id: account_id,
|
|
1283
|
-
#
|
|
1278
|
+
# params: params
|
|
1284
1279
|
# )
|
|
1285
1280
|
# transactions.each do |transaction|
|
|
1286
1281
|
# puts "Transaction: #{transaction.uuid}"
|
|
@@ -1293,10 +1288,11 @@ module Recurly
|
|
|
1293
1288
|
|
|
1294
1289
|
# List an account's child accounts
|
|
1295
1290
|
#
|
|
1296
|
-
# {https://developers.recurly.com/api/
|
|
1291
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_child_accounts list_child_accounts api documenation}
|
|
1297
1292
|
#
|
|
1298
1293
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
|
1299
|
-
# @param
|
|
1294
|
+
# @param params [Hash] Optional query string parameters:
|
|
1295
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
1300
1296
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
1301
1297
|
#
|
|
1302
1298
|
# *Important notes:*
|
|
@@ -1308,30 +1304,33 @@ module Recurly
|
|
|
1308
1304
|
# * Records are returned in an arbitrary order. Since results are all
|
|
1309
1305
|
# returned at once you can sort the records yourself.
|
|
1310
1306
|
#
|
|
1311
|
-
#
|
|
1312
|
-
#
|
|
1313
|
-
#
|
|
1307
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
1308
|
+
# :order [String] Sort order.
|
|
1309
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
1314
1310
|
# order. In descending order updated records will move behind the cursor and could
|
|
1315
1311
|
# prevent some records from being returned.
|
|
1316
1312
|
#
|
|
1317
|
-
#
|
|
1313
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
1318
1314
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1319
1315
|
#
|
|
1320
|
-
#
|
|
1316
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
1321
1317
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1322
1318
|
#
|
|
1323
|
-
#
|
|
1324
|
-
#
|
|
1319
|
+
# :email [String] Filter for accounts with this exact email address. A blank value will return accounts with both +null+ and +""+ email addresses. Note that multiple accounts can share one email address.
|
|
1320
|
+
# :subscriber [Boolean] Filter for accounts with or without a subscription in the +active+,
|
|
1325
1321
|
# +canceled+, or +future+ state.
|
|
1326
1322
|
#
|
|
1327
|
-
#
|
|
1328
|
-
#
|
|
1323
|
+
# :past_due [String] Filter for accounts with an invoice in the +past_due+ state.
|
|
1324
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1329
1325
|
#
|
|
1330
1326
|
# @return [Pager<Resources::Account>] A list of an account's child accounts.
|
|
1331
1327
|
# @example
|
|
1328
|
+
# params = {
|
|
1329
|
+
# limit: 200
|
|
1330
|
+
# }
|
|
1332
1331
|
# child_accounts = @client.list_child_accounts(
|
|
1333
1332
|
# account_id: account_id,
|
|
1334
|
-
#
|
|
1333
|
+
# params: params
|
|
1335
1334
|
# )
|
|
1336
1335
|
# child_accounts.each do |child|
|
|
1337
1336
|
# puts "Account: #{child.code}"
|
|
@@ -1344,9 +1343,10 @@ module Recurly
|
|
|
1344
1343
|
|
|
1345
1344
|
# List a site's account acquisition data
|
|
1346
1345
|
#
|
|
1347
|
-
# {https://developers.recurly.com/api/
|
|
1346
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_acquisition list_account_acquisition api documenation}
|
|
1348
1347
|
#
|
|
1349
|
-
# @param
|
|
1348
|
+
# @param params [Hash] Optional query string parameters:
|
|
1349
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
1350
1350
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
1351
1351
|
#
|
|
1352
1352
|
# *Important notes:*
|
|
@@ -1358,37 +1358,41 @@ module Recurly
|
|
|
1358
1358
|
# * Records are returned in an arbitrary order. Since results are all
|
|
1359
1359
|
# returned at once you can sort the records yourself.
|
|
1360
1360
|
#
|
|
1361
|
-
#
|
|
1362
|
-
#
|
|
1363
|
-
#
|
|
1361
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
1362
|
+
# :order [String] Sort order.
|
|
1363
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
1364
1364
|
# order. In descending order updated records will move behind the cursor and could
|
|
1365
1365
|
# prevent some records from being returned.
|
|
1366
1366
|
#
|
|
1367
|
-
#
|
|
1367
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
1368
1368
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1369
1369
|
#
|
|
1370
|
-
#
|
|
1370
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
1371
1371
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1372
1372
|
#
|
|
1373
|
-
#
|
|
1373
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1374
1374
|
#
|
|
1375
1375
|
# @return [Pager<Resources::AccountAcquisition>] A list of the site's account acquisition data.
|
|
1376
1376
|
# @example
|
|
1377
|
-
#
|
|
1377
|
+
# params = {
|
|
1378
|
+
# limit: 200
|
|
1379
|
+
# }
|
|
1380
|
+
# acquisitions = @client.list_account_acquisition(params: params)
|
|
1378
1381
|
# acquisitions.each do |acquisition|
|
|
1379
1382
|
# puts "AccountAcquisition: #{acquisition.cost}"
|
|
1380
1383
|
# end
|
|
1381
1384
|
#
|
|
1382
1385
|
def list_account_acquisition(**options)
|
|
1383
|
-
path = "/acquisitions"
|
|
1386
|
+
path = interpolate_path("/acquisitions")
|
|
1384
1387
|
pager(path, **options)
|
|
1385
1388
|
end
|
|
1386
1389
|
|
|
1387
1390
|
# List a site's coupons
|
|
1388
1391
|
#
|
|
1389
|
-
# {https://developers.recurly.com/api/
|
|
1392
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_coupons list_coupons api documenation}
|
|
1390
1393
|
#
|
|
1391
|
-
# @param
|
|
1394
|
+
# @param params [Hash] Optional query string parameters:
|
|
1395
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
1392
1396
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
1393
1397
|
#
|
|
1394
1398
|
# *Important notes:*
|
|
@@ -1400,38 +1404,42 @@ module Recurly
|
|
|
1400
1404
|
# * Records are returned in an arbitrary order. Since results are all
|
|
1401
1405
|
# returned at once you can sort the records yourself.
|
|
1402
1406
|
#
|
|
1403
|
-
#
|
|
1404
|
-
#
|
|
1405
|
-
#
|
|
1407
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
1408
|
+
# :order [String] Sort order.
|
|
1409
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
1406
1410
|
# order. In descending order updated records will move behind the cursor and could
|
|
1407
1411
|
# prevent some records from being returned.
|
|
1408
1412
|
#
|
|
1409
|
-
#
|
|
1413
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
1410
1414
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1411
1415
|
#
|
|
1412
|
-
#
|
|
1416
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
1413
1417
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1414
1418
|
#
|
|
1415
|
-
#
|
|
1419
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1416
1420
|
#
|
|
1417
1421
|
# @return [Pager<Resources::Coupon>] A list of the site's coupons.
|
|
1418
1422
|
# @example
|
|
1419
|
-
#
|
|
1423
|
+
# params = {
|
|
1424
|
+
# limit: 200
|
|
1425
|
+
# }
|
|
1426
|
+
# coupons = @client.list_coupons(params: params)
|
|
1420
1427
|
# coupons.each do |coupon|
|
|
1421
1428
|
# puts "coupon: #{coupon.code}"
|
|
1422
1429
|
# end
|
|
1423
1430
|
#
|
|
1424
1431
|
def list_coupons(**options)
|
|
1425
|
-
path = "/coupons"
|
|
1432
|
+
path = interpolate_path("/coupons")
|
|
1426
1433
|
pager(path, **options)
|
|
1427
1434
|
end
|
|
1428
1435
|
|
|
1429
1436
|
# Create a new coupon
|
|
1430
1437
|
#
|
|
1431
|
-
# {https://developers.recurly.com/api/
|
|
1438
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_coupon create_coupon api documenation}
|
|
1432
1439
|
#
|
|
1433
1440
|
# @param body [Requests::CouponCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponCreate}
|
|
1434
|
-
# @param
|
|
1441
|
+
# @param params [Hash] Optional query string parameters:
|
|
1442
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1435
1443
|
#
|
|
1436
1444
|
# @return [Resources::Coupon] A new coupon.
|
|
1437
1445
|
# @example
|
|
@@ -1458,16 +1466,17 @@ module Recurly
|
|
|
1458
1466
|
# end
|
|
1459
1467
|
#
|
|
1460
1468
|
def create_coupon(body:, **options)
|
|
1461
|
-
path = "/coupons"
|
|
1469
|
+
path = interpolate_path("/coupons")
|
|
1462
1470
|
post(path, body, Requests::CouponCreate, **options)
|
|
1463
1471
|
end
|
|
1464
1472
|
|
|
1465
1473
|
# Fetch a coupon
|
|
1466
1474
|
#
|
|
1467
|
-
# {https://developers.recurly.com/api/
|
|
1475
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_coupon get_coupon api documenation}
|
|
1468
1476
|
#
|
|
1469
1477
|
# @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
|
|
1470
|
-
# @param
|
|
1478
|
+
# @param params [Hash] Optional query string parameters:
|
|
1479
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1471
1480
|
#
|
|
1472
1481
|
# @return [Resources::Coupon] A coupon.
|
|
1473
1482
|
# @example
|
|
@@ -1487,11 +1496,12 @@ module Recurly
|
|
|
1487
1496
|
|
|
1488
1497
|
# Update an active coupon
|
|
1489
1498
|
#
|
|
1490
|
-
# {https://developers.recurly.com/api/
|
|
1499
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_coupon update_coupon api documenation}
|
|
1491
1500
|
#
|
|
1492
1501
|
# @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
|
|
1493
1502
|
# @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
|
|
1494
|
-
# @param
|
|
1503
|
+
# @param params [Hash] Optional query string parameters:
|
|
1504
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1495
1505
|
#
|
|
1496
1506
|
# @return [Resources::Coupon] The updated coupon.
|
|
1497
1507
|
# @example
|
|
@@ -1514,10 +1524,11 @@ module Recurly
|
|
|
1514
1524
|
|
|
1515
1525
|
# Expire a coupon
|
|
1516
1526
|
#
|
|
1517
|
-
# {https://developers.recurly.com/api/
|
|
1527
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_coupon deactivate_coupon api documenation}
|
|
1518
1528
|
#
|
|
1519
1529
|
# @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
|
|
1520
|
-
# @param
|
|
1530
|
+
# @param params [Hash] Optional query string parameters:
|
|
1531
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1521
1532
|
#
|
|
1522
1533
|
# @return [Resources::Coupon] The expired Coupon
|
|
1523
1534
|
# @example
|
|
@@ -1535,26 +1546,32 @@ module Recurly
|
|
|
1535
1546
|
delete(path, **options)
|
|
1536
1547
|
end
|
|
1537
1548
|
|
|
1549
|
+
# Generate unique coupon codes
|
|
1550
|
+
#
|
|
1551
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/generate_unique_coupon_codes generate_unique_coupon_codes api documenation}
|
|
1552
|
+
#
|
|
1553
|
+
# @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
|
|
1554
|
+
# @param body [Requests::CouponBulkCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponBulkCreate}
|
|
1555
|
+
# @param params [Hash] Optional query string parameters:
|
|
1556
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1557
|
+
#
|
|
1558
|
+
# @return [Resources::UniqueCouponCodeParams] A set of parameters that can be passed to the `list_unique_coupon_codes` endpoint to obtain only the newly generated `UniqueCouponCodes`.
|
|
1559
|
+
#
|
|
1560
|
+
def generate_unique_coupon_codes(coupon_id:, body:, **options)
|
|
1561
|
+
path = interpolate_path("/coupons/{coupon_id}/generate", coupon_id: coupon_id)
|
|
1562
|
+
post(path, body, Requests::CouponBulkCreate, **options)
|
|
1563
|
+
end
|
|
1564
|
+
|
|
1538
1565
|
# Restore an inactive coupon
|
|
1539
1566
|
#
|
|
1540
|
-
# {https://developers.recurly.com/api/
|
|
1567
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/restore_coupon restore_coupon api documenation}
|
|
1541
1568
|
#
|
|
1542
1569
|
# @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
|
|
1543
1570
|
# @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
|
|
1544
|
-
# @param
|
|
1571
|
+
# @param params [Hash] Optional query string parameters:
|
|
1572
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1545
1573
|
#
|
|
1546
1574
|
# @return [Resources::Coupon] The restored coupon.
|
|
1547
|
-
# @example
|
|
1548
|
-
# begin
|
|
1549
|
-
# coupon = @client.restore_coupon(coupon_id: coupon_id, body: {
|
|
1550
|
-
# name: "New Coupon Name"
|
|
1551
|
-
# })
|
|
1552
|
-
# puts "Restored coupon #{coupon}"
|
|
1553
|
-
# rescue Recurly::Errors::NotFoundError
|
|
1554
|
-
# # If the resource was not found, you may want to alert the user or
|
|
1555
|
-
# # just return nil
|
|
1556
|
-
# puts "Resource Not Found"
|
|
1557
|
-
# end
|
|
1558
1575
|
#
|
|
1559
1576
|
def restore_coupon(coupon_id:, body:, **options)
|
|
1560
1577
|
path = interpolate_path("/coupons/{coupon_id}/restore", coupon_id: coupon_id)
|
|
@@ -1563,10 +1580,11 @@ module Recurly
|
|
|
1563
1580
|
|
|
1564
1581
|
# List unique coupon codes associated with a bulk coupon
|
|
1565
1582
|
#
|
|
1566
|
-
# {https://developers.recurly.com/api/
|
|
1583
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_unique_coupon_codes list_unique_coupon_codes api documenation}
|
|
1567
1584
|
#
|
|
1568
1585
|
# @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
|
|
1569
|
-
# @param
|
|
1586
|
+
# @param params [Hash] Optional query string parameters:
|
|
1587
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
1570
1588
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
1571
1589
|
#
|
|
1572
1590
|
# *Important notes:*
|
|
@@ -1578,19 +1596,19 @@ module Recurly
|
|
|
1578
1596
|
# * Records are returned in an arbitrary order. Since results are all
|
|
1579
1597
|
# returned at once you can sort the records yourself.
|
|
1580
1598
|
#
|
|
1581
|
-
#
|
|
1582
|
-
#
|
|
1583
|
-
#
|
|
1599
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
1600
|
+
# :order [String] Sort order.
|
|
1601
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
1584
1602
|
# order. In descending order updated records will move behind the cursor and could
|
|
1585
1603
|
# prevent some records from being returned.
|
|
1586
1604
|
#
|
|
1587
|
-
#
|
|
1605
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
1588
1606
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1589
1607
|
#
|
|
1590
|
-
#
|
|
1608
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
1591
1609
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1592
1610
|
#
|
|
1593
|
-
#
|
|
1611
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1594
1612
|
#
|
|
1595
1613
|
# @return [Pager<Resources::UniqueCouponCode>] A list of unique coupon codes that were generated
|
|
1596
1614
|
#
|
|
@@ -1601,40 +1619,45 @@ module Recurly
|
|
|
1601
1619
|
|
|
1602
1620
|
# List a site's credit payments
|
|
1603
1621
|
#
|
|
1604
|
-
# {https://developers.recurly.com/api/
|
|
1622
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_credit_payments list_credit_payments api documenation}
|
|
1605
1623
|
#
|
|
1606
|
-
# @param
|
|
1607
|
-
#
|
|
1608
|
-
#
|
|
1624
|
+
# @param params [Hash] Optional query string parameters:
|
|
1625
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
1626
|
+
# :order [String] Sort order.
|
|
1627
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
1609
1628
|
# order. In descending order updated records will move behind the cursor and could
|
|
1610
1629
|
# prevent some records from being returned.
|
|
1611
1630
|
#
|
|
1612
|
-
#
|
|
1631
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
1613
1632
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1614
1633
|
#
|
|
1615
|
-
#
|
|
1634
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
1616
1635
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1617
1636
|
#
|
|
1618
|
-
#
|
|
1637
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1619
1638
|
#
|
|
1620
1639
|
# @return [Pager<Resources::CreditPayment>] A list of the site's credit payments.
|
|
1621
1640
|
# @example
|
|
1622
|
-
#
|
|
1641
|
+
# params = {
|
|
1642
|
+
# limit: 200
|
|
1643
|
+
# }
|
|
1644
|
+
# payments = @client.list_credit_payments(params: params)
|
|
1623
1645
|
# payments.each do |payment|
|
|
1624
1646
|
# puts "CreditPayment: #{payment.id}"
|
|
1625
1647
|
# end
|
|
1626
1648
|
#
|
|
1627
1649
|
def list_credit_payments(**options)
|
|
1628
|
-
path = "/credit_payments"
|
|
1650
|
+
path = interpolate_path("/credit_payments")
|
|
1629
1651
|
pager(path, **options)
|
|
1630
1652
|
end
|
|
1631
1653
|
|
|
1632
1654
|
# Fetch a credit payment
|
|
1633
1655
|
#
|
|
1634
|
-
# {https://developers.recurly.com/api/
|
|
1656
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_credit_payment get_credit_payment api documenation}
|
|
1635
1657
|
#
|
|
1636
1658
|
# @param credit_payment_id [String] Credit Payment ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
1637
|
-
# @param
|
|
1659
|
+
# @param params [Hash] Optional query string parameters:
|
|
1660
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1638
1661
|
#
|
|
1639
1662
|
# @return [Resources::CreditPayment] A credit payment.
|
|
1640
1663
|
#
|
|
@@ -1645,9 +1668,10 @@ module Recurly
|
|
|
1645
1668
|
|
|
1646
1669
|
# List a site's custom field definitions
|
|
1647
1670
|
#
|
|
1648
|
-
# {https://developers.recurly.com/api/
|
|
1671
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_custom_field_definitions list_custom_field_definitions api documenation}
|
|
1649
1672
|
#
|
|
1650
|
-
# @param
|
|
1673
|
+
# @param params [Hash] Optional query string parameters:
|
|
1674
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
1651
1675
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
1652
1676
|
#
|
|
1653
1677
|
# *Important notes:*
|
|
@@ -1659,39 +1683,43 @@ module Recurly
|
|
|
1659
1683
|
# * Records are returned in an arbitrary order. Since results are all
|
|
1660
1684
|
# returned at once you can sort the records yourself.
|
|
1661
1685
|
#
|
|
1662
|
-
#
|
|
1663
|
-
#
|
|
1664
|
-
#
|
|
1686
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
1687
|
+
# :order [String] Sort order.
|
|
1688
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
1665
1689
|
# order. In descending order updated records will move behind the cursor and could
|
|
1666
1690
|
# prevent some records from being returned.
|
|
1667
1691
|
#
|
|
1668
|
-
#
|
|
1692
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
1669
1693
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1670
1694
|
#
|
|
1671
|
-
#
|
|
1695
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
1672
1696
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1673
1697
|
#
|
|
1674
|
-
#
|
|
1675
|
-
#
|
|
1698
|
+
# :related_type [String] Filter by related type.
|
|
1699
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1676
1700
|
#
|
|
1677
1701
|
# @return [Pager<Resources::CustomFieldDefinition>] A list of the site's custom field definitions.
|
|
1678
1702
|
# @example
|
|
1679
|
-
#
|
|
1703
|
+
# params = {
|
|
1704
|
+
# limit: 200
|
|
1705
|
+
# }
|
|
1706
|
+
# custom_fields = @client.list_custom_field_definitions(params: params)
|
|
1680
1707
|
# custom_fields.each do |field|
|
|
1681
1708
|
# puts "CustomFieldDefinition: #{field.name}"
|
|
1682
1709
|
# end
|
|
1683
1710
|
#
|
|
1684
1711
|
def list_custom_field_definitions(**options)
|
|
1685
|
-
path = "/custom_field_definitions"
|
|
1712
|
+
path = interpolate_path("/custom_field_definitions")
|
|
1686
1713
|
pager(path, **options)
|
|
1687
1714
|
end
|
|
1688
1715
|
|
|
1689
1716
|
# Fetch an custom field definition
|
|
1690
1717
|
#
|
|
1691
|
-
# {https://developers.recurly.com/api/
|
|
1718
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_custom_field_definition get_custom_field_definition api documenation}
|
|
1692
1719
|
#
|
|
1693
1720
|
# @param custom_field_definition_id [String] Custom Field Definition ID
|
|
1694
|
-
# @param
|
|
1721
|
+
# @param params [Hash] Optional query string parameters:
|
|
1722
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1695
1723
|
#
|
|
1696
1724
|
# @return [Resources::CustomFieldDefinition] An custom field definition.
|
|
1697
1725
|
# @example
|
|
@@ -1713,9 +1741,10 @@ module Recurly
|
|
|
1713
1741
|
|
|
1714
1742
|
# List a site's items
|
|
1715
1743
|
#
|
|
1716
|
-
# {https://developers.recurly.com/api/
|
|
1744
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_items list_items api documenation}
|
|
1717
1745
|
#
|
|
1718
|
-
# @param
|
|
1746
|
+
# @param params [Hash] Optional query string parameters:
|
|
1747
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
1719
1748
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
1720
1749
|
#
|
|
1721
1750
|
# *Important notes:*
|
|
@@ -1727,39 +1756,43 @@ module Recurly
|
|
|
1727
1756
|
# * Records are returned in an arbitrary order. Since results are all
|
|
1728
1757
|
# returned at once you can sort the records yourself.
|
|
1729
1758
|
#
|
|
1730
|
-
#
|
|
1731
|
-
#
|
|
1732
|
-
#
|
|
1759
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
1760
|
+
# :order [String] Sort order.
|
|
1761
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
1733
1762
|
# order. In descending order updated records will move behind the cursor and could
|
|
1734
1763
|
# prevent some records from being returned.
|
|
1735
1764
|
#
|
|
1736
|
-
#
|
|
1765
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
1737
1766
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1738
1767
|
#
|
|
1739
|
-
#
|
|
1768
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
1740
1769
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1741
1770
|
#
|
|
1742
|
-
#
|
|
1743
|
-
#
|
|
1771
|
+
# :state [String] Filter by state.
|
|
1772
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1744
1773
|
#
|
|
1745
1774
|
# @return [Pager<Resources::Item>] A list of the site's items.
|
|
1746
1775
|
# @example
|
|
1747
|
-
#
|
|
1776
|
+
# params = {
|
|
1777
|
+
# limit: 200
|
|
1778
|
+
# }
|
|
1779
|
+
# items = @client.list_items(params: params)
|
|
1748
1780
|
# items.each do |item|
|
|
1749
1781
|
# puts "Item: #{item.code}"
|
|
1750
1782
|
# end
|
|
1751
1783
|
#
|
|
1752
1784
|
def list_items(**options)
|
|
1753
|
-
path = "/items"
|
|
1785
|
+
path = interpolate_path("/items")
|
|
1754
1786
|
pager(path, **options)
|
|
1755
1787
|
end
|
|
1756
1788
|
|
|
1757
1789
|
# Create a new item
|
|
1758
1790
|
#
|
|
1759
|
-
# {https://developers.recurly.com/api/
|
|
1791
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_item create_item api documenation}
|
|
1760
1792
|
#
|
|
1761
1793
|
# @param body [Requests::ItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemCreate}
|
|
1762
|
-
# @param
|
|
1794
|
+
# @param params [Hash] Optional query string parameters:
|
|
1795
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1763
1796
|
#
|
|
1764
1797
|
# @return [Resources::Item] A new item.
|
|
1765
1798
|
# @example
|
|
@@ -1785,16 +1818,17 @@ module Recurly
|
|
|
1785
1818
|
# end
|
|
1786
1819
|
#
|
|
1787
1820
|
def create_item(body:, **options)
|
|
1788
|
-
path = "/items"
|
|
1821
|
+
path = interpolate_path("/items")
|
|
1789
1822
|
post(path, body, Requests::ItemCreate, **options)
|
|
1790
1823
|
end
|
|
1791
1824
|
|
|
1792
1825
|
# Fetch an item
|
|
1793
1826
|
#
|
|
1794
|
-
# {https://developers.recurly.com/api/
|
|
1827
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_item get_item api documenation}
|
|
1795
1828
|
#
|
|
1796
1829
|
# @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
|
|
1797
|
-
# @param
|
|
1830
|
+
# @param params [Hash] Optional query string parameters:
|
|
1831
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1798
1832
|
#
|
|
1799
1833
|
# @return [Resources::Item] An item.
|
|
1800
1834
|
# @example
|
|
@@ -1814,11 +1848,12 @@ module Recurly
|
|
|
1814
1848
|
|
|
1815
1849
|
# Update an active item
|
|
1816
1850
|
#
|
|
1817
|
-
# {https://developers.recurly.com/api/
|
|
1851
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_item update_item api documenation}
|
|
1818
1852
|
#
|
|
1819
1853
|
# @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
|
|
1820
1854
|
# @param body [Requests::ItemUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemUpdate}
|
|
1821
|
-
# @param
|
|
1855
|
+
# @param params [Hash] Optional query string parameters:
|
|
1856
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1822
1857
|
#
|
|
1823
1858
|
# @return [Resources::Item] The updated item.
|
|
1824
1859
|
# @example
|
|
@@ -1845,10 +1880,11 @@ module Recurly
|
|
|
1845
1880
|
|
|
1846
1881
|
# Deactivate an item
|
|
1847
1882
|
#
|
|
1848
|
-
# {https://developers.recurly.com/api/
|
|
1883
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_item deactivate_item api documenation}
|
|
1849
1884
|
#
|
|
1850
1885
|
# @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
|
|
1851
|
-
# @param
|
|
1886
|
+
# @param params [Hash] Optional query string parameters:
|
|
1887
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1852
1888
|
#
|
|
1853
1889
|
# @return [Resources::Item] An item.
|
|
1854
1890
|
# @example
|
|
@@ -1868,10 +1904,11 @@ module Recurly
|
|
|
1868
1904
|
|
|
1869
1905
|
# Reactivate an inactive item
|
|
1870
1906
|
#
|
|
1871
|
-
# {https://developers.recurly.com/api/
|
|
1907
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_item reactivate_item api documenation}
|
|
1872
1908
|
#
|
|
1873
1909
|
# @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
|
|
1874
|
-
# @param
|
|
1910
|
+
# @param params [Hash] Optional query string parameters:
|
|
1911
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1875
1912
|
#
|
|
1876
1913
|
# @return [Resources::Item] An item.
|
|
1877
1914
|
# @example
|
|
@@ -1891,9 +1928,10 @@ module Recurly
|
|
|
1891
1928
|
|
|
1892
1929
|
# List a site's measured units
|
|
1893
1930
|
#
|
|
1894
|
-
# {https://developers.recurly.com/api/
|
|
1931
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_measured_unit list_measured_unit api documenation}
|
|
1895
1932
|
#
|
|
1896
|
-
# @param
|
|
1933
|
+
# @param params [Hash] Optional query string parameters:
|
|
1934
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
1897
1935
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
1898
1936
|
#
|
|
1899
1937
|
# *Important notes:*
|
|
@@ -1905,48 +1943,50 @@ module Recurly
|
|
|
1905
1943
|
# * Records are returned in an arbitrary order. Since results are all
|
|
1906
1944
|
# returned at once you can sort the records yourself.
|
|
1907
1945
|
#
|
|
1908
|
-
#
|
|
1909
|
-
#
|
|
1910
|
-
#
|
|
1946
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
1947
|
+
# :order [String] Sort order.
|
|
1948
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
1911
1949
|
# order. In descending order updated records will move behind the cursor and could
|
|
1912
1950
|
# prevent some records from being returned.
|
|
1913
1951
|
#
|
|
1914
|
-
#
|
|
1952
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
1915
1953
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1916
1954
|
#
|
|
1917
|
-
#
|
|
1955
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
1918
1956
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
1919
1957
|
#
|
|
1920
|
-
#
|
|
1921
|
-
#
|
|
1958
|
+
# :state [String] Filter by state.
|
|
1959
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1922
1960
|
#
|
|
1923
1961
|
# @return [Pager<Resources::MeasuredUnit>] A list of the site's measured units.
|
|
1924
1962
|
#
|
|
1925
1963
|
def list_measured_unit(**options)
|
|
1926
|
-
path = "/measured_units"
|
|
1964
|
+
path = interpolate_path("/measured_units")
|
|
1927
1965
|
pager(path, **options)
|
|
1928
1966
|
end
|
|
1929
1967
|
|
|
1930
1968
|
# Create a new measured unit
|
|
1931
1969
|
#
|
|
1932
|
-
# {https://developers.recurly.com/api/
|
|
1970
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_measured_unit create_measured_unit api documenation}
|
|
1933
1971
|
#
|
|
1934
1972
|
# @param body [Requests::MeasuredUnitCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::MeasuredUnitCreate}
|
|
1935
|
-
# @param
|
|
1973
|
+
# @param params [Hash] Optional query string parameters:
|
|
1974
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1936
1975
|
#
|
|
1937
1976
|
# @return [Resources::MeasuredUnit] A new measured unit.
|
|
1938
1977
|
#
|
|
1939
1978
|
def create_measured_unit(body:, **options)
|
|
1940
|
-
path = "/measured_units"
|
|
1979
|
+
path = interpolate_path("/measured_units")
|
|
1941
1980
|
post(path, body, Requests::MeasuredUnitCreate, **options)
|
|
1942
1981
|
end
|
|
1943
1982
|
|
|
1944
1983
|
# Fetch a measured unit
|
|
1945
1984
|
#
|
|
1946
|
-
# {https://developers.recurly.com/api/
|
|
1985
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_measured_unit get_measured_unit api documenation}
|
|
1947
1986
|
#
|
|
1948
1987
|
# @param measured_unit_id [String] Measured unit ID or name. For ID no prefix is used e.g. +e28zov4fw0v2+. For name use prefix +name-+, e.g. +name-Storage+.
|
|
1949
|
-
# @param
|
|
1988
|
+
# @param params [Hash] Optional query string parameters:
|
|
1989
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1950
1990
|
#
|
|
1951
1991
|
# @return [Resources::MeasuredUnit] An item.
|
|
1952
1992
|
#
|
|
@@ -1957,11 +1997,12 @@ module Recurly
|
|
|
1957
1997
|
|
|
1958
1998
|
# Update a measured unit
|
|
1959
1999
|
#
|
|
1960
|
-
# {https://developers.recurly.com/api/
|
|
2000
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_measured_unit update_measured_unit api documenation}
|
|
1961
2001
|
#
|
|
1962
2002
|
# @param measured_unit_id [String] Measured unit ID or name. For ID no prefix is used e.g. +e28zov4fw0v2+. For name use prefix +name-+, e.g. +name-Storage+.
|
|
1963
2003
|
# @param body [Requests::MeasuredUnitUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::MeasuredUnitUpdate}
|
|
1964
|
-
# @param
|
|
2004
|
+
# @param params [Hash] Optional query string parameters:
|
|
2005
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1965
2006
|
#
|
|
1966
2007
|
# @return [Resources::MeasuredUnit] The updated measured_unit.
|
|
1967
2008
|
#
|
|
@@ -1972,10 +2013,11 @@ module Recurly
|
|
|
1972
2013
|
|
|
1973
2014
|
# Remove a measured unit
|
|
1974
2015
|
#
|
|
1975
|
-
# {https://developers.recurly.com/api/
|
|
2016
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_measured_unit remove_measured_unit api documenation}
|
|
1976
2017
|
#
|
|
1977
2018
|
# @param measured_unit_id [String] Measured unit ID or name. For ID no prefix is used e.g. +e28zov4fw0v2+. For name use prefix +name-+, e.g. +name-Storage+.
|
|
1978
|
-
# @param
|
|
2019
|
+
# @param params [Hash] Optional query string parameters:
|
|
2020
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
1979
2021
|
#
|
|
1980
2022
|
# @return [Resources::MeasuredUnit] A measured unit.
|
|
1981
2023
|
#
|
|
@@ -1986,9 +2028,10 @@ module Recurly
|
|
|
1986
2028
|
|
|
1987
2029
|
# List a site's invoices
|
|
1988
2030
|
#
|
|
1989
|
-
# {https://developers.recurly.com/api/
|
|
2031
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_invoices list_invoices api documenation}
|
|
1990
2032
|
#
|
|
1991
|
-
# @param
|
|
2033
|
+
# @param params [Hash] Optional query string parameters:
|
|
2034
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
1992
2035
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
1993
2036
|
#
|
|
1994
2037
|
# *Important notes:*
|
|
@@ -2000,45 +2043,48 @@ module Recurly
|
|
|
2000
2043
|
# * Records are returned in an arbitrary order. Since results are all
|
|
2001
2044
|
# returned at once you can sort the records yourself.
|
|
2002
2045
|
#
|
|
2003
|
-
#
|
|
2004
|
-
#
|
|
2005
|
-
#
|
|
2006
|
-
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
2046
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
2047
|
+
# :order [String] Sort order.
|
|
2048
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
2007
2049
|
# order. In descending order updated records will move behind the cursor and could
|
|
2008
2050
|
# prevent some records from being returned.
|
|
2009
2051
|
#
|
|
2010
|
-
#
|
|
2052
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
2011
2053
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2012
2054
|
#
|
|
2013
|
-
#
|
|
2055
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
2014
2056
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2015
2057
|
#
|
|
2016
|
-
#
|
|
2058
|
+
# :type [String] Filter by type when:
|
|
2017
2059
|
# - +type=charge+, only charge invoices will be returned.
|
|
2018
2060
|
# - +type=credit+, only credit invoices will be returned.
|
|
2019
2061
|
# - +type=non-legacy+, only charge and credit invoices will be returned.
|
|
2020
2062
|
# - +type=legacy+, only legacy invoices will be returned.
|
|
2021
2063
|
#
|
|
2022
|
-
#
|
|
2064
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2023
2065
|
#
|
|
2024
2066
|
# @return [Pager<Resources::Invoice>] A list of the site's invoices.
|
|
2025
2067
|
# @example
|
|
2026
|
-
#
|
|
2068
|
+
# params = {
|
|
2069
|
+
# limit: 200
|
|
2070
|
+
# }
|
|
2071
|
+
# invoices = @client.list_invoices(params: params)
|
|
2027
2072
|
# invoices.each do |invoice|
|
|
2028
2073
|
# puts "Invoice: #{invoice.number}"
|
|
2029
2074
|
# end
|
|
2030
2075
|
#
|
|
2031
2076
|
def list_invoices(**options)
|
|
2032
|
-
path = "/invoices"
|
|
2077
|
+
path = interpolate_path("/invoices")
|
|
2033
2078
|
pager(path, **options)
|
|
2034
2079
|
end
|
|
2035
2080
|
|
|
2036
2081
|
# Fetch an invoice
|
|
2037
2082
|
#
|
|
2038
|
-
# {https://developers.recurly.com/api/
|
|
2083
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_invoice get_invoice api documenation}
|
|
2039
2084
|
#
|
|
2040
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2041
|
-
# @param
|
|
2085
|
+
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2086
|
+
# @param params [Hash] Optional query string parameters:
|
|
2087
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2042
2088
|
#
|
|
2043
2089
|
# @return [Resources::Invoice] An invoice.
|
|
2044
2090
|
# @example
|
|
@@ -2058,11 +2104,12 @@ module Recurly
|
|
|
2058
2104
|
|
|
2059
2105
|
# Update an invoice
|
|
2060
2106
|
#
|
|
2061
|
-
# {https://developers.recurly.com/api/
|
|
2107
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_invoice update_invoice api documenation}
|
|
2062
2108
|
#
|
|
2063
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2064
|
-
# @param body [Requests::
|
|
2065
|
-
# @param
|
|
2109
|
+
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2110
|
+
# @param body [Requests::InvoiceUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceUpdate}
|
|
2111
|
+
# @param params [Hash] Optional query string parameters:
|
|
2112
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2066
2113
|
#
|
|
2067
2114
|
# @return [Resources::Invoice] An invoice.
|
|
2068
2115
|
# @example
|
|
@@ -2071,7 +2118,7 @@ module Recurly
|
|
|
2071
2118
|
# customer_notes: "New Notes",
|
|
2072
2119
|
# terms_and_conditions: "New Terms and Conditions"
|
|
2073
2120
|
# }
|
|
2074
|
-
# invoice = @client.
|
|
2121
|
+
# invoice = @client.update_invoice(invoice_id: invoice_id, body: invoice_update)
|
|
2075
2122
|
# puts "Updated invoice #{invoice}"
|
|
2076
2123
|
# rescue Recurly::Errors::NotFoundError
|
|
2077
2124
|
# # If the resource was not found, you may want to alert the user or
|
|
@@ -2079,17 +2126,18 @@ module Recurly
|
|
|
2079
2126
|
# puts "Resource Not Found"
|
|
2080
2127
|
# end
|
|
2081
2128
|
#
|
|
2082
|
-
def
|
|
2129
|
+
def update_invoice(invoice_id:, body:, **options)
|
|
2083
2130
|
path = interpolate_path("/invoices/{invoice_id}", invoice_id: invoice_id)
|
|
2084
|
-
put(path, body, Requests::
|
|
2131
|
+
put(path, body, Requests::InvoiceUpdate, **options)
|
|
2085
2132
|
end
|
|
2086
2133
|
|
|
2087
2134
|
# Fetch an invoice as a PDF
|
|
2088
2135
|
#
|
|
2089
|
-
# {https://developers.recurly.com/api/
|
|
2136
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_invoice_pdf get_invoice_pdf api documenation}
|
|
2090
2137
|
#
|
|
2091
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2092
|
-
# @param
|
|
2138
|
+
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2139
|
+
# @param params [Hash] Optional query string parameters:
|
|
2140
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2093
2141
|
#
|
|
2094
2142
|
# @return [Resources::BinaryFile] An invoice as a PDF.
|
|
2095
2143
|
# @example
|
|
@@ -2110,36 +2158,14 @@ module Recurly
|
|
|
2110
2158
|
get(path, **options)
|
|
2111
2159
|
end
|
|
2112
2160
|
|
|
2113
|
-
# Apply available credit to a pending or past due charge invoice
|
|
2114
|
-
#
|
|
2115
|
-
# {https://developers.recurly.com/api/v2019-10-10#operation/apply_credit_balance apply_credit_balance api documentation}
|
|
2116
|
-
#
|
|
2117
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+. For number with prefix or country code, use +number-+ and +prefix+, e.g. +number-TEST-FR1001+
|
|
2118
|
-
# @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2119
|
-
#
|
|
2120
|
-
# @return [Resources::Invoice] The updated invoice.
|
|
2121
|
-
# @example
|
|
2122
|
-
# begin
|
|
2123
|
-
# invoice = @client.apply_credit_balance(invoice_id: invoice_id)
|
|
2124
|
-
# puts "Applied credit balance to invoice #{invoice}"
|
|
2125
|
-
# rescue Recurly::Errors::NotFoundError
|
|
2126
|
-
# # If the resource was not found, you may want to alert the user or
|
|
2127
|
-
# # just return nil
|
|
2128
|
-
# puts "Resource Not Found"
|
|
2129
|
-
# end
|
|
2130
|
-
#
|
|
2131
|
-
def apply_credit_balance(invoice_id:, **options)
|
|
2132
|
-
path = interpolate_path("/invoices/{invoice_id}/apply_credit_balance", invoice_id: invoice_id)
|
|
2133
|
-
put(path, **options)
|
|
2134
|
-
end
|
|
2135
|
-
|
|
2136
2161
|
# Collect a pending or past due, automatic invoice
|
|
2137
2162
|
#
|
|
2138
|
-
# {https://developers.recurly.com/api/
|
|
2163
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/collect_invoice collect_invoice api documenation}
|
|
2139
2164
|
#
|
|
2140
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2141
|
-
# @param
|
|
2142
|
-
#
|
|
2165
|
+
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2166
|
+
# @param params [Hash] Optional query string parameters:
|
|
2167
|
+
# :body [Requests::InvoiceCollect] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCollect}
|
|
2168
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2143
2169
|
#
|
|
2144
2170
|
# @return [Resources::Invoice] The updated invoice.
|
|
2145
2171
|
# @example
|
|
@@ -2159,15 +2185,16 @@ module Recurly
|
|
|
2159
2185
|
|
|
2160
2186
|
# Mark an open invoice as failed
|
|
2161
2187
|
#
|
|
2162
|
-
# {https://developers.recurly.com/api/
|
|
2188
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/mark_invoice_failed mark_invoice_failed api documenation}
|
|
2163
2189
|
#
|
|
2164
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2165
|
-
# @param
|
|
2190
|
+
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2191
|
+
# @param params [Hash] Optional query string parameters:
|
|
2192
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2166
2193
|
#
|
|
2167
2194
|
# @return [Resources::Invoice] The updated invoice.
|
|
2168
2195
|
# @example
|
|
2169
2196
|
# begin
|
|
2170
|
-
# invoice = @client.
|
|
2197
|
+
# invoice = @client.mark_invoice_failed(invoice_id: invoice_id)
|
|
2171
2198
|
# puts "Failed invoice #{invoice}"
|
|
2172
2199
|
# rescue Recurly::Errors::NotFoundError
|
|
2173
2200
|
# # If the resource was not found, you may want to alert the user or
|
|
@@ -2175,17 +2202,18 @@ module Recurly
|
|
|
2175
2202
|
# puts "Resource Not Found"
|
|
2176
2203
|
# end
|
|
2177
2204
|
#
|
|
2178
|
-
def
|
|
2205
|
+
def mark_invoice_failed(invoice_id:, **options)
|
|
2179
2206
|
path = interpolate_path("/invoices/{invoice_id}/mark_failed", invoice_id: invoice_id)
|
|
2180
2207
|
put(path, **options)
|
|
2181
2208
|
end
|
|
2182
2209
|
|
|
2183
2210
|
# Mark an open invoice as successful
|
|
2184
2211
|
#
|
|
2185
|
-
# {https://developers.recurly.com/api/
|
|
2212
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/mark_invoice_successful mark_invoice_successful api documenation}
|
|
2186
2213
|
#
|
|
2187
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2188
|
-
# @param
|
|
2214
|
+
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2215
|
+
# @param params [Hash] Optional query string parameters:
|
|
2216
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2189
2217
|
#
|
|
2190
2218
|
# @return [Resources::Invoice] The updated invoice.
|
|
2191
2219
|
# @example
|
|
@@ -2205,10 +2233,11 @@ module Recurly
|
|
|
2205
2233
|
|
|
2206
2234
|
# Reopen a closed, manual invoice
|
|
2207
2235
|
#
|
|
2208
|
-
# {https://developers.recurly.com/api/
|
|
2236
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reopen_invoice reopen_invoice api documenation}
|
|
2209
2237
|
#
|
|
2210
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2211
|
-
# @param
|
|
2238
|
+
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2239
|
+
# @param params [Hash] Optional query string parameters:
|
|
2240
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2212
2241
|
#
|
|
2213
2242
|
# @return [Resources::Invoice] The updated invoice.
|
|
2214
2243
|
# @example
|
|
@@ -2228,10 +2257,11 @@ module Recurly
|
|
|
2228
2257
|
|
|
2229
2258
|
# Void a credit invoice.
|
|
2230
2259
|
#
|
|
2231
|
-
# {https://developers.recurly.com/api/
|
|
2260
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/void_invoice void_invoice api documenation}
|
|
2232
2261
|
#
|
|
2233
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2234
|
-
# @param
|
|
2262
|
+
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2263
|
+
# @param params [Hash] Optional query string parameters:
|
|
2264
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2235
2265
|
#
|
|
2236
2266
|
# @return [Resources::Invoice] The updated invoice.
|
|
2237
2267
|
# @example
|
|
@@ -2251,11 +2281,12 @@ module Recurly
|
|
|
2251
2281
|
|
|
2252
2282
|
# Record an external payment for a manual invoices.
|
|
2253
2283
|
#
|
|
2254
|
-
# {https://developers.recurly.com/api/
|
|
2284
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/record_external_transaction record_external_transaction api documenation}
|
|
2255
2285
|
#
|
|
2256
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2286
|
+
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2257
2287
|
# @param body [Requests::ExternalTransaction] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ExternalTransaction}
|
|
2258
|
-
# @param
|
|
2288
|
+
# @param params [Hash] Optional query string parameters:
|
|
2289
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2259
2290
|
#
|
|
2260
2291
|
# @return [Resources::Transaction] The recorded transaction.
|
|
2261
2292
|
#
|
|
@@ -2266,10 +2297,11 @@ module Recurly
|
|
|
2266
2297
|
|
|
2267
2298
|
# List an invoice's line items
|
|
2268
2299
|
#
|
|
2269
|
-
# {https://developers.recurly.com/api/
|
|
2300
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_line_items list_invoice_line_items api documenation}
|
|
2270
2301
|
#
|
|
2271
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2272
|
-
# @param
|
|
2302
|
+
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2303
|
+
# @param params [Hash] Optional query string parameters:
|
|
2304
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
2273
2305
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
2274
2306
|
#
|
|
2275
2307
|
# *Important notes:*
|
|
@@ -2281,28 +2313,31 @@ module Recurly
|
|
|
2281
2313
|
# * Records are returned in an arbitrary order. Since results are all
|
|
2282
2314
|
# returned at once you can sort the records yourself.
|
|
2283
2315
|
#
|
|
2284
|
-
#
|
|
2285
|
-
#
|
|
2286
|
-
#
|
|
2316
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
2317
|
+
# :order [String] Sort order.
|
|
2318
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
2287
2319
|
# order. In descending order updated records will move behind the cursor and could
|
|
2288
2320
|
# prevent some records from being returned.
|
|
2289
2321
|
#
|
|
2290
|
-
#
|
|
2322
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
2291
2323
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2292
2324
|
#
|
|
2293
|
-
#
|
|
2325
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
2294
2326
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2295
2327
|
#
|
|
2296
|
-
#
|
|
2297
|
-
#
|
|
2298
|
-
#
|
|
2299
|
-
#
|
|
2328
|
+
# :original [String] Filter by original field.
|
|
2329
|
+
# :state [String] Filter by state field.
|
|
2330
|
+
# :type [String] Filter by type field.
|
|
2331
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2300
2332
|
#
|
|
2301
2333
|
# @return [Pager<Resources::LineItem>] A list of the invoice's line items.
|
|
2302
2334
|
# @example
|
|
2335
|
+
# params = {
|
|
2336
|
+
# limit: 200
|
|
2337
|
+
# }
|
|
2303
2338
|
# line_items = @client.list_invoice_line_items(
|
|
2304
2339
|
# invoice_id: invoice_id,
|
|
2305
|
-
#
|
|
2340
|
+
# params: params
|
|
2306
2341
|
# )
|
|
2307
2342
|
# line_items.each do |line_item|
|
|
2308
2343
|
# puts "Line Item: #{line_item.id}"
|
|
@@ -2313,12 +2348,13 @@ module Recurly
|
|
|
2313
2348
|
pager(path, **options)
|
|
2314
2349
|
end
|
|
2315
2350
|
|
|
2316
|
-
#
|
|
2351
|
+
# Show the coupon redemptions applied to an invoice
|
|
2317
2352
|
#
|
|
2318
|
-
# {https://developers.recurly.com/api/
|
|
2353
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_coupon_redemptions list_invoice_coupon_redemptions api documenation}
|
|
2319
2354
|
#
|
|
2320
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2321
|
-
# @param
|
|
2355
|
+
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2356
|
+
# @param params [Hash] Optional query string parameters:
|
|
2357
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
2322
2358
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
2323
2359
|
#
|
|
2324
2360
|
# *Important notes:*
|
|
@@ -2330,23 +2366,26 @@ module Recurly
|
|
|
2330
2366
|
# * Records are returned in an arbitrary order. Since results are all
|
|
2331
2367
|
# returned at once you can sort the records yourself.
|
|
2332
2368
|
#
|
|
2333
|
-
#
|
|
2369
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
2334
2370
|
# order. In descending order updated records will move behind the cursor and could
|
|
2335
2371
|
# prevent some records from being returned.
|
|
2336
2372
|
#
|
|
2337
|
-
#
|
|
2373
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
2338
2374
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2339
2375
|
#
|
|
2340
|
-
#
|
|
2376
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
2341
2377
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2342
2378
|
#
|
|
2343
|
-
#
|
|
2379
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2344
2380
|
#
|
|
2345
2381
|
# @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions associated with the invoice.
|
|
2346
2382
|
# @example
|
|
2383
|
+
# params = {
|
|
2384
|
+
# limit: 200
|
|
2385
|
+
# }
|
|
2347
2386
|
# coupon_redemptions = @client.list_invoice_coupon_redemptions(
|
|
2348
2387
|
# invoice_id: invoice_id,
|
|
2349
|
-
#
|
|
2388
|
+
# params: params
|
|
2350
2389
|
# )
|
|
2351
2390
|
# coupon_redemptions.each do |redemption|
|
|
2352
2391
|
# puts "CouponRedemption: #{redemption.id}"
|
|
@@ -2359,16 +2398,20 @@ module Recurly
|
|
|
2359
2398
|
|
|
2360
2399
|
# List an invoice's related credit or charge invoices
|
|
2361
2400
|
#
|
|
2362
|
-
# {https://developers.recurly.com/api/
|
|
2401
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_related_invoices list_related_invoices api documenation}
|
|
2363
2402
|
#
|
|
2364
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2365
|
-
# @param
|
|
2403
|
+
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2404
|
+
# @param params [Hash] Optional query string parameters:
|
|
2405
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2366
2406
|
#
|
|
2367
2407
|
# @return [Pager<Resources::Invoice>] A list of the credit or charge invoices associated with the invoice.
|
|
2368
2408
|
# @example
|
|
2409
|
+
# params = {
|
|
2410
|
+
# limit: 200
|
|
2411
|
+
# }
|
|
2369
2412
|
# invoices = @client.list_related_invoices(
|
|
2370
2413
|
# invoice_id: invoice_id,
|
|
2371
|
-
#
|
|
2414
|
+
# params: params
|
|
2372
2415
|
# )
|
|
2373
2416
|
# invoices.each do |invoice|
|
|
2374
2417
|
# puts "Invoice: #{invoice.number}"
|
|
@@ -2381,11 +2424,12 @@ module Recurly
|
|
|
2381
2424
|
|
|
2382
2425
|
# Refund an invoice
|
|
2383
2426
|
#
|
|
2384
|
-
# {https://developers.recurly.com/api/
|
|
2427
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/refund_invoice refund_invoice api documenation}
|
|
2385
2428
|
#
|
|
2386
|
-
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2429
|
+
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
|
2387
2430
|
# @param body [Requests::InvoiceRefund] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceRefund}
|
|
2388
|
-
# @param
|
|
2431
|
+
# @param params [Hash] Optional query string parameters:
|
|
2432
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2389
2433
|
#
|
|
2390
2434
|
# @return [Resources::Invoice] Returns the new credit invoice.
|
|
2391
2435
|
# @example
|
|
@@ -2412,9 +2456,10 @@ module Recurly
|
|
|
2412
2456
|
|
|
2413
2457
|
# List a site's line items
|
|
2414
2458
|
#
|
|
2415
|
-
# {https://developers.recurly.com/api/
|
|
2459
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_line_items list_line_items api documenation}
|
|
2416
2460
|
#
|
|
2417
|
-
# @param
|
|
2461
|
+
# @param params [Hash] Optional query string parameters:
|
|
2462
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
2418
2463
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
2419
2464
|
#
|
|
2420
2465
|
# *Important notes:*
|
|
@@ -2426,43 +2471,47 @@ module Recurly
|
|
|
2426
2471
|
# * Records are returned in an arbitrary order. Since results are all
|
|
2427
2472
|
# returned at once you can sort the records yourself.
|
|
2428
2473
|
#
|
|
2429
|
-
#
|
|
2430
|
-
#
|
|
2431
|
-
#
|
|
2474
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
2475
|
+
# :order [String] Sort order.
|
|
2476
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
2432
2477
|
# order. In descending order updated records will move behind the cursor and could
|
|
2433
2478
|
# prevent some records from being returned.
|
|
2434
2479
|
#
|
|
2435
|
-
#
|
|
2480
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
2436
2481
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2437
2482
|
#
|
|
2438
|
-
#
|
|
2483
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
2439
2484
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2440
2485
|
#
|
|
2441
|
-
#
|
|
2442
|
-
#
|
|
2443
|
-
#
|
|
2444
|
-
#
|
|
2486
|
+
# :original [String] Filter by original field.
|
|
2487
|
+
# :state [String] Filter by state field.
|
|
2488
|
+
# :type [String] Filter by type field.
|
|
2489
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2445
2490
|
#
|
|
2446
2491
|
# @return [Pager<Resources::LineItem>] A list of the site's line items.
|
|
2447
2492
|
# @example
|
|
2448
|
-
#
|
|
2493
|
+
# params = {
|
|
2449
2494
|
# limit: 200
|
|
2495
|
+
# }
|
|
2496
|
+
# line_items = @client.list_line_items(
|
|
2497
|
+
# params: params
|
|
2450
2498
|
# )
|
|
2451
2499
|
# line_items.each do |line_item|
|
|
2452
2500
|
# puts "LineItem: #{line_item.id}"
|
|
2453
2501
|
# end
|
|
2454
2502
|
#
|
|
2455
2503
|
def list_line_items(**options)
|
|
2456
|
-
path = "/line_items"
|
|
2504
|
+
path = interpolate_path("/line_items")
|
|
2457
2505
|
pager(path, **options)
|
|
2458
2506
|
end
|
|
2459
2507
|
|
|
2460
2508
|
# Fetch a line item
|
|
2461
2509
|
#
|
|
2462
|
-
# {https://developers.recurly.com/api/
|
|
2510
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_line_item get_line_item api documenation}
|
|
2463
2511
|
#
|
|
2464
2512
|
# @param line_item_id [String] Line Item ID.
|
|
2465
|
-
# @param
|
|
2513
|
+
# @param params [Hash] Optional query string parameters:
|
|
2514
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2466
2515
|
#
|
|
2467
2516
|
# @return [Resources::LineItem] A line item.
|
|
2468
2517
|
# @example
|
|
@@ -2482,10 +2531,11 @@ module Recurly
|
|
|
2482
2531
|
|
|
2483
2532
|
# Delete an uninvoiced line item
|
|
2484
2533
|
#
|
|
2485
|
-
# {https://developers.recurly.com/api/
|
|
2534
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_line_item remove_line_item api documenation}
|
|
2486
2535
|
#
|
|
2487
2536
|
# @param line_item_id [String] Line Item ID.
|
|
2488
|
-
# @param
|
|
2537
|
+
# @param params [Hash] Optional query string parameters:
|
|
2538
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2489
2539
|
#
|
|
2490
2540
|
# @return [Resources::Empty] Line item deleted.
|
|
2491
2541
|
# @example
|
|
@@ -2507,9 +2557,10 @@ module Recurly
|
|
|
2507
2557
|
|
|
2508
2558
|
# List a site's plans
|
|
2509
2559
|
#
|
|
2510
|
-
# {https://developers.recurly.com/api/
|
|
2560
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_plans list_plans api documenation}
|
|
2511
2561
|
#
|
|
2512
|
-
# @param
|
|
2562
|
+
# @param params [Hash] Optional query string parameters:
|
|
2563
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
2513
2564
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
2514
2565
|
#
|
|
2515
2566
|
# *Important notes:*
|
|
@@ -2521,39 +2572,43 @@ module Recurly
|
|
|
2521
2572
|
# * Records are returned in an arbitrary order. Since results are all
|
|
2522
2573
|
# returned at once you can sort the records yourself.
|
|
2523
2574
|
#
|
|
2524
|
-
#
|
|
2525
|
-
#
|
|
2526
|
-
#
|
|
2575
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
2576
|
+
# :order [String] Sort order.
|
|
2577
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
2527
2578
|
# order. In descending order updated records will move behind the cursor and could
|
|
2528
2579
|
# prevent some records from being returned.
|
|
2529
2580
|
#
|
|
2530
|
-
#
|
|
2581
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
2531
2582
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2532
2583
|
#
|
|
2533
|
-
#
|
|
2584
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
2534
2585
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2535
2586
|
#
|
|
2536
|
-
#
|
|
2537
|
-
#
|
|
2587
|
+
# :state [String] Filter by state.
|
|
2588
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2538
2589
|
#
|
|
2539
2590
|
# @return [Pager<Resources::Plan>] A list of plans.
|
|
2540
2591
|
# @example
|
|
2541
|
-
#
|
|
2592
|
+
# params = {
|
|
2593
|
+
# limit: 200
|
|
2594
|
+
# }
|
|
2595
|
+
# plans = @client.list_plans(params: params)
|
|
2542
2596
|
# plans.each do |plan|
|
|
2543
2597
|
# puts "Plan: #{plan.code}"
|
|
2544
2598
|
# end
|
|
2545
2599
|
#
|
|
2546
2600
|
def list_plans(**options)
|
|
2547
|
-
path = "/plans"
|
|
2601
|
+
path = interpolate_path("/plans")
|
|
2548
2602
|
pager(path, **options)
|
|
2549
2603
|
end
|
|
2550
2604
|
|
|
2551
2605
|
# Create a plan
|
|
2552
2606
|
#
|
|
2553
|
-
# {https://developers.recurly.com/api/
|
|
2607
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_plan create_plan api documenation}
|
|
2554
2608
|
#
|
|
2555
2609
|
# @param body [Requests::PlanCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PlanCreate}
|
|
2556
|
-
# @param
|
|
2610
|
+
# @param params [Hash] Optional query string parameters:
|
|
2611
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2557
2612
|
#
|
|
2558
2613
|
# @return [Resources::Plan] A plan.
|
|
2559
2614
|
# @example
|
|
@@ -2584,16 +2639,17 @@ module Recurly
|
|
|
2584
2639
|
# end
|
|
2585
2640
|
#
|
|
2586
2641
|
def create_plan(body:, **options)
|
|
2587
|
-
path = "/plans"
|
|
2642
|
+
path = interpolate_path("/plans")
|
|
2588
2643
|
post(path, body, Requests::PlanCreate, **options)
|
|
2589
2644
|
end
|
|
2590
2645
|
|
|
2591
2646
|
# Fetch a plan
|
|
2592
2647
|
#
|
|
2593
|
-
# {https://developers.recurly.com/api/
|
|
2648
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_plan get_plan api documenation}
|
|
2594
2649
|
#
|
|
2595
2650
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
2596
|
-
# @param
|
|
2651
|
+
# @param params [Hash] Optional query string parameters:
|
|
2652
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2597
2653
|
#
|
|
2598
2654
|
# @return [Resources::Plan] A plan.
|
|
2599
2655
|
# @example
|
|
@@ -2613,11 +2669,12 @@ module Recurly
|
|
|
2613
2669
|
|
|
2614
2670
|
# Update a plan
|
|
2615
2671
|
#
|
|
2616
|
-
# {https://developers.recurly.com/api/
|
|
2672
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_plan update_plan api documenation}
|
|
2617
2673
|
#
|
|
2618
2674
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
2619
2675
|
# @param body [Requests::PlanUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PlanUpdate}
|
|
2620
|
-
# @param
|
|
2676
|
+
# @param params [Hash] Optional query string parameters:
|
|
2677
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2621
2678
|
#
|
|
2622
2679
|
# @return [Resources::Plan] A plan.
|
|
2623
2680
|
# @example
|
|
@@ -2640,10 +2697,11 @@ module Recurly
|
|
|
2640
2697
|
|
|
2641
2698
|
# Remove a plan
|
|
2642
2699
|
#
|
|
2643
|
-
# {https://developers.recurly.com/api/
|
|
2700
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_plan remove_plan api documenation}
|
|
2644
2701
|
#
|
|
2645
2702
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
2646
|
-
# @param
|
|
2703
|
+
# @param params [Hash] Optional query string parameters:
|
|
2704
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2647
2705
|
#
|
|
2648
2706
|
# @return [Resources::Plan] Plan deleted
|
|
2649
2707
|
# @example
|
|
@@ -2663,10 +2721,11 @@ module Recurly
|
|
|
2663
2721
|
|
|
2664
2722
|
# List a plan's add-ons
|
|
2665
2723
|
#
|
|
2666
|
-
# {https://developers.recurly.com/api/
|
|
2724
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_plan_add_ons list_plan_add_ons api documenation}
|
|
2667
2725
|
#
|
|
2668
2726
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
2669
|
-
# @param
|
|
2727
|
+
# @param params [Hash] Optional query string parameters:
|
|
2728
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
2670
2729
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
2671
2730
|
#
|
|
2672
2731
|
# *Important notes:*
|
|
@@ -2678,26 +2737,29 @@ module Recurly
|
|
|
2678
2737
|
# * Records are returned in an arbitrary order. Since results are all
|
|
2679
2738
|
# returned at once you can sort the records yourself.
|
|
2680
2739
|
#
|
|
2681
|
-
#
|
|
2682
|
-
#
|
|
2683
|
-
#
|
|
2740
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
2741
|
+
# :order [String] Sort order.
|
|
2742
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
2684
2743
|
# order. In descending order updated records will move behind the cursor and could
|
|
2685
2744
|
# prevent some records from being returned.
|
|
2686
2745
|
#
|
|
2687
|
-
#
|
|
2746
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
2688
2747
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2689
2748
|
#
|
|
2690
|
-
#
|
|
2749
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
2691
2750
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2692
2751
|
#
|
|
2693
|
-
#
|
|
2694
|
-
#
|
|
2752
|
+
# :state [String] Filter by state.
|
|
2753
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2695
2754
|
#
|
|
2696
2755
|
# @return [Pager<Resources::AddOn>] A list of add-ons.
|
|
2697
2756
|
# @example
|
|
2757
|
+
# params = {
|
|
2758
|
+
# limit: 200
|
|
2759
|
+
# }
|
|
2698
2760
|
# add_ons = @client.list_plan_add_ons(
|
|
2699
2761
|
# plan_id: plan_id,
|
|
2700
|
-
#
|
|
2762
|
+
# params: params
|
|
2701
2763
|
# )
|
|
2702
2764
|
# add_ons.each do |add_on|
|
|
2703
2765
|
# puts "AddOn: #{add_on.code}"
|
|
@@ -2710,11 +2772,12 @@ module Recurly
|
|
|
2710
2772
|
|
|
2711
2773
|
# Create an add-on
|
|
2712
2774
|
#
|
|
2713
|
-
# {https://developers.recurly.com/api/
|
|
2775
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_plan_add_on create_plan_add_on api documenation}
|
|
2714
2776
|
#
|
|
2715
2777
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
2716
2778
|
# @param body [Requests::AddOnCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnCreate}
|
|
2717
|
-
# @param
|
|
2779
|
+
# @param params [Hash] Optional query string parameters:
|
|
2780
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2718
2781
|
#
|
|
2719
2782
|
# @return [Resources::AddOn] An add-on.
|
|
2720
2783
|
# @example
|
|
@@ -2745,11 +2808,12 @@ module Recurly
|
|
|
2745
2808
|
|
|
2746
2809
|
# Fetch a plan's add-on
|
|
2747
2810
|
#
|
|
2748
|
-
# {https://developers.recurly.com/api/
|
|
2811
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_plan_add_on get_plan_add_on api documenation}
|
|
2749
2812
|
#
|
|
2750
2813
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
2751
2814
|
# @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
2752
|
-
# @param
|
|
2815
|
+
# @param params [Hash] Optional query string parameters:
|
|
2816
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2753
2817
|
#
|
|
2754
2818
|
# @return [Resources::AddOn] An add-on.
|
|
2755
2819
|
# @example
|
|
@@ -2771,12 +2835,13 @@ module Recurly
|
|
|
2771
2835
|
|
|
2772
2836
|
# Update an add-on
|
|
2773
2837
|
#
|
|
2774
|
-
# {https://developers.recurly.com/api/
|
|
2838
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_plan_add_on update_plan_add_on api documenation}
|
|
2775
2839
|
#
|
|
2776
2840
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
2777
2841
|
# @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
2778
2842
|
# @param body [Requests::AddOnUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnUpdate}
|
|
2779
|
-
# @param
|
|
2843
|
+
# @param params [Hash] Optional query string parameters:
|
|
2844
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2780
2845
|
#
|
|
2781
2846
|
# @return [Resources::AddOn] An add-on.
|
|
2782
2847
|
# @example
|
|
@@ -2803,11 +2868,12 @@ module Recurly
|
|
|
2803
2868
|
|
|
2804
2869
|
# Remove an add-on
|
|
2805
2870
|
#
|
|
2806
|
-
# {https://developers.recurly.com/api/
|
|
2871
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_plan_add_on remove_plan_add_on api documenation}
|
|
2807
2872
|
#
|
|
2808
2873
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
2809
2874
|
# @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
2810
|
-
# @param
|
|
2875
|
+
# @param params [Hash] Optional query string parameters:
|
|
2876
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2811
2877
|
#
|
|
2812
2878
|
# @return [Resources::AddOn] Add-on deleted
|
|
2813
2879
|
# @example
|
|
@@ -2830,9 +2896,10 @@ module Recurly
|
|
|
2830
2896
|
|
|
2831
2897
|
# List a site's add-ons
|
|
2832
2898
|
#
|
|
2833
|
-
# {https://developers.recurly.com/api/
|
|
2899
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_add_ons list_add_ons api documenation}
|
|
2834
2900
|
#
|
|
2835
|
-
# @param
|
|
2901
|
+
# @param params [Hash] Optional query string parameters:
|
|
2902
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
2836
2903
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
2837
2904
|
#
|
|
2838
2905
|
# *Important notes:*
|
|
@@ -2844,41 +2911,45 @@ module Recurly
|
|
|
2844
2911
|
# * Records are returned in an arbitrary order. Since results are all
|
|
2845
2912
|
# returned at once you can sort the records yourself.
|
|
2846
2913
|
#
|
|
2847
|
-
#
|
|
2848
|
-
#
|
|
2849
|
-
#
|
|
2914
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
2915
|
+
# :order [String] Sort order.
|
|
2916
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
2850
2917
|
# order. In descending order updated records will move behind the cursor and could
|
|
2851
2918
|
# prevent some records from being returned.
|
|
2852
2919
|
#
|
|
2853
|
-
#
|
|
2920
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
2854
2921
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2855
2922
|
#
|
|
2856
|
-
#
|
|
2923
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
2857
2924
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2858
2925
|
#
|
|
2859
|
-
#
|
|
2860
|
-
#
|
|
2926
|
+
# :state [String] Filter by state.
|
|
2927
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2861
2928
|
#
|
|
2862
2929
|
# @return [Pager<Resources::AddOn>] A list of add-ons.
|
|
2863
2930
|
# @example
|
|
2864
|
-
#
|
|
2931
|
+
# params = {
|
|
2865
2932
|
# limit: 200
|
|
2933
|
+
# }
|
|
2934
|
+
# add_ons = @client.list_add_ons(
|
|
2935
|
+
# params: params
|
|
2866
2936
|
# )
|
|
2867
2937
|
# add_ons.each do |add_on|
|
|
2868
2938
|
# puts "AddOn: #{add_on.code}"
|
|
2869
2939
|
# end
|
|
2870
2940
|
#
|
|
2871
2941
|
def list_add_ons(**options)
|
|
2872
|
-
path = "/add_ons"
|
|
2942
|
+
path = interpolate_path("/add_ons")
|
|
2873
2943
|
pager(path, **options)
|
|
2874
2944
|
end
|
|
2875
2945
|
|
|
2876
2946
|
# Fetch an add-on
|
|
2877
2947
|
#
|
|
2878
|
-
# {https://developers.recurly.com/api/
|
|
2948
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_add_on get_add_on api documenation}
|
|
2879
2949
|
#
|
|
2880
2950
|
# @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
2881
|
-
# @param
|
|
2951
|
+
# @param params [Hash] Optional query string parameters:
|
|
2952
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2882
2953
|
#
|
|
2883
2954
|
# @return [Resources::AddOn] An add-on.
|
|
2884
2955
|
# @example
|
|
@@ -2898,9 +2969,10 @@ module Recurly
|
|
|
2898
2969
|
|
|
2899
2970
|
# List a site's shipping methods
|
|
2900
2971
|
#
|
|
2901
|
-
# {https://developers.recurly.com/api/
|
|
2972
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_shipping_methods list_shipping_methods api documenation}
|
|
2902
2973
|
#
|
|
2903
|
-
# @param
|
|
2974
|
+
# @param params [Hash] Optional query string parameters:
|
|
2975
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
2904
2976
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
2905
2977
|
#
|
|
2906
2978
|
# *Important notes:*
|
|
@@ -2912,69 +2984,75 @@ module Recurly
|
|
|
2912
2984
|
# * Records are returned in an arbitrary order. Since results are all
|
|
2913
2985
|
# returned at once you can sort the records yourself.
|
|
2914
2986
|
#
|
|
2915
|
-
#
|
|
2916
|
-
#
|
|
2917
|
-
#
|
|
2987
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
2988
|
+
# :order [String] Sort order.
|
|
2989
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
2918
2990
|
# order. In descending order updated records will move behind the cursor and could
|
|
2919
2991
|
# prevent some records from being returned.
|
|
2920
2992
|
#
|
|
2921
|
-
#
|
|
2993
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
2922
2994
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2923
2995
|
#
|
|
2924
|
-
#
|
|
2996
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
2925
2997
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
2926
2998
|
#
|
|
2927
|
-
#
|
|
2999
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2928
3000
|
#
|
|
2929
3001
|
# @return [Pager<Resources::ShippingMethod>] A list of the site's shipping methods.
|
|
2930
3002
|
# @example
|
|
2931
|
-
#
|
|
3003
|
+
# params = {
|
|
2932
3004
|
# limit: 200
|
|
3005
|
+
# }
|
|
3006
|
+
# shipping_methods = @client.list_shipping_methods(
|
|
3007
|
+
# params: params
|
|
2933
3008
|
# )
|
|
2934
3009
|
# shipping_methods.each do |shipping_method|
|
|
2935
3010
|
# puts "Shipping Method: #{shipping_method.code}"
|
|
2936
3011
|
# end
|
|
2937
3012
|
#
|
|
2938
3013
|
def list_shipping_methods(**options)
|
|
2939
|
-
path = "/shipping_methods"
|
|
3014
|
+
path = interpolate_path("/shipping_methods")
|
|
2940
3015
|
pager(path, **options)
|
|
2941
3016
|
end
|
|
2942
3017
|
|
|
2943
3018
|
# Create a new shipping method
|
|
2944
3019
|
#
|
|
2945
|
-
# {https://developers.recurly.com/api/
|
|
3020
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_shipping_method create_shipping_method api documenation}
|
|
2946
3021
|
#
|
|
2947
3022
|
# @param body [Requests::ShippingMethodCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingMethodCreate}
|
|
2948
|
-
# @param
|
|
3023
|
+
# @param params [Hash] Optional query string parameters:
|
|
3024
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2949
3025
|
#
|
|
2950
3026
|
# @return [Resources::ShippingMethod] A new shipping method.
|
|
2951
3027
|
#
|
|
2952
3028
|
def create_shipping_method(body:, **options)
|
|
2953
|
-
path = "/shipping_methods"
|
|
3029
|
+
path = interpolate_path("/shipping_methods")
|
|
2954
3030
|
post(path, body, Requests::ShippingMethodCreate, **options)
|
|
2955
3031
|
end
|
|
2956
3032
|
|
|
2957
3033
|
# Fetch a shipping method
|
|
2958
3034
|
#
|
|
2959
|
-
# {https://developers.recurly.com/api/
|
|
3035
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_shipping_method get_shipping_method api documenation}
|
|
2960
3036
|
#
|
|
2961
|
-
# @param
|
|
2962
|
-
# @param
|
|
3037
|
+
# @param shipping_method_id [String] Shipping Method ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-usps_2-day+.
|
|
3038
|
+
# @param params [Hash] Optional query string parameters:
|
|
3039
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2963
3040
|
#
|
|
2964
3041
|
# @return [Resources::ShippingMethod] A shipping method.
|
|
2965
3042
|
#
|
|
2966
|
-
def get_shipping_method(
|
|
2967
|
-
path = interpolate_path("/shipping_methods/{
|
|
3043
|
+
def get_shipping_method(shipping_method_id:, **options)
|
|
3044
|
+
path = interpolate_path("/shipping_methods/{shipping_method_id}", shipping_method_id: shipping_method_id)
|
|
2968
3045
|
get(path, **options)
|
|
2969
3046
|
end
|
|
2970
3047
|
|
|
2971
3048
|
# Update an active Shipping Method
|
|
2972
3049
|
#
|
|
2973
|
-
# {https://developers.recurly.com/api/
|
|
3050
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_shipping_method update_shipping_method api documenation}
|
|
2974
3051
|
#
|
|
2975
3052
|
# @param shipping_method_id [String] Shipping Method ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-usps_2-day+.
|
|
2976
3053
|
# @param body [Requests::ShippingMethodUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingMethodUpdate}
|
|
2977
|
-
# @param
|
|
3054
|
+
# @param params [Hash] Optional query string parameters:
|
|
3055
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2978
3056
|
#
|
|
2979
3057
|
# @return [Resources::ShippingMethod] The updated shipping method.
|
|
2980
3058
|
#
|
|
@@ -2985,10 +3063,11 @@ module Recurly
|
|
|
2985
3063
|
|
|
2986
3064
|
# Deactivate a shipping method
|
|
2987
3065
|
#
|
|
2988
|
-
# {https://developers.recurly.com/api/
|
|
3066
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_shipping_method deactivate_shipping_method api documenation}
|
|
2989
3067
|
#
|
|
2990
3068
|
# @param shipping_method_id [String] Shipping Method ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-usps_2-day+.
|
|
2991
|
-
# @param
|
|
3069
|
+
# @param params [Hash] Optional query string parameters:
|
|
3070
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
2992
3071
|
#
|
|
2993
3072
|
# @return [Resources::ShippingMethod] A shipping method.
|
|
2994
3073
|
#
|
|
@@ -2999,9 +3078,10 @@ module Recurly
|
|
|
2999
3078
|
|
|
3000
3079
|
# List a site's subscriptions
|
|
3001
3080
|
#
|
|
3002
|
-
# {https://developers.recurly.com/api/
|
|
3081
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_subscriptions list_subscriptions api documenation}
|
|
3003
3082
|
#
|
|
3004
|
-
# @param
|
|
3083
|
+
# @param params [Hash] Optional query string parameters:
|
|
3084
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
3005
3085
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
3006
3086
|
#
|
|
3007
3087
|
# *Important notes:*
|
|
@@ -3013,44 +3093,48 @@ module Recurly
|
|
|
3013
3093
|
# * Records are returned in an arbitrary order. Since results are all
|
|
3014
3094
|
# returned at once you can sort the records yourself.
|
|
3015
3095
|
#
|
|
3016
|
-
#
|
|
3017
|
-
#
|
|
3018
|
-
#
|
|
3096
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
3097
|
+
# :order [String] Sort order.
|
|
3098
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
3019
3099
|
# order. In descending order updated records will move behind the cursor and could
|
|
3020
3100
|
# prevent some records from being returned.
|
|
3021
3101
|
#
|
|
3022
|
-
#
|
|
3102
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
3023
3103
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
3024
3104
|
#
|
|
3025
|
-
#
|
|
3105
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
3026
3106
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
3027
3107
|
#
|
|
3028
|
-
#
|
|
3108
|
+
# :state [String] Filter by state.
|
|
3029
3109
|
#
|
|
3030
3110
|
# - When +state=active+, +state=canceled+, +state=expired+, or +state=future+, subscriptions with states that match the query and only those subscriptions will be returned.
|
|
3031
3111
|
# - When +state=in_trial+, only subscriptions that have a trial_started_at date earlier than now and a trial_ends_at date later than now will be returned.
|
|
3032
3112
|
# - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
|
|
3033
3113
|
#
|
|
3034
|
-
#
|
|
3114
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3035
3115
|
#
|
|
3036
3116
|
# @return [Pager<Resources::Subscription>] A list of the site's subscriptions.
|
|
3037
3117
|
# @example
|
|
3038
|
-
#
|
|
3118
|
+
# params = {
|
|
3119
|
+
# limit: 200
|
|
3120
|
+
# }
|
|
3121
|
+
# subscriptions = @client.list_subscriptions(params: params)
|
|
3039
3122
|
# subscriptions.each do |subscription|
|
|
3040
3123
|
# puts "Subscription: #{subscription.uuid}"
|
|
3041
3124
|
# end
|
|
3042
3125
|
#
|
|
3043
3126
|
def list_subscriptions(**options)
|
|
3044
|
-
path = "/subscriptions"
|
|
3127
|
+
path = interpolate_path("/subscriptions")
|
|
3045
3128
|
pager(path, **options)
|
|
3046
3129
|
end
|
|
3047
3130
|
|
|
3048
3131
|
# Create a new subscription
|
|
3049
3132
|
#
|
|
3050
|
-
# {https://developers.recurly.com/api/
|
|
3133
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_subscription create_subscription api documenation}
|
|
3051
3134
|
#
|
|
3052
3135
|
# @param body [Requests::SubscriptionCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionCreate}
|
|
3053
|
-
# @param
|
|
3136
|
+
# @param params [Hash] Optional query string parameters:
|
|
3137
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3054
3138
|
#
|
|
3055
3139
|
# @return [Resources::Subscription] A subscription.
|
|
3056
3140
|
# @example
|
|
@@ -3058,7 +3142,8 @@ module Recurly
|
|
|
3058
3142
|
# subscription_create = {
|
|
3059
3143
|
# plan_code: plan_code,
|
|
3060
3144
|
# currency: "USD",
|
|
3061
|
-
# # This can be an existing account or
|
|
3145
|
+
# # This can be an existing account or
|
|
3146
|
+
# # a new acocunt
|
|
3062
3147
|
# account: {
|
|
3063
3148
|
# code: account_code,
|
|
3064
3149
|
# }
|
|
@@ -3074,16 +3159,17 @@ module Recurly
|
|
|
3074
3159
|
# end
|
|
3075
3160
|
#
|
|
3076
3161
|
def create_subscription(body:, **options)
|
|
3077
|
-
path = "/subscriptions"
|
|
3162
|
+
path = interpolate_path("/subscriptions")
|
|
3078
3163
|
post(path, body, Requests::SubscriptionCreate, **options)
|
|
3079
3164
|
end
|
|
3080
3165
|
|
|
3081
3166
|
# Fetch a subscription
|
|
3082
3167
|
#
|
|
3083
|
-
# {https://developers.recurly.com/api/
|
|
3168
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_subscription get_subscription api documenation}
|
|
3084
3169
|
#
|
|
3085
3170
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3086
|
-
# @param
|
|
3171
|
+
# @param params [Hash] Optional query string parameters:
|
|
3172
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3087
3173
|
#
|
|
3088
3174
|
# @return [Resources::Subscription] A subscription.
|
|
3089
3175
|
# @example
|
|
@@ -3103,13 +3189,14 @@ module Recurly
|
|
|
3103
3189
|
get(path, **options)
|
|
3104
3190
|
end
|
|
3105
3191
|
|
|
3106
|
-
#
|
|
3192
|
+
# Update a subscription
|
|
3107
3193
|
#
|
|
3108
|
-
# {https://developers.recurly.com/api/
|
|
3194
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_subscription update_subscription api documenation}
|
|
3109
3195
|
#
|
|
3110
3196
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3111
3197
|
# @param body [Requests::SubscriptionUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionUpdate}
|
|
3112
|
-
# @param
|
|
3198
|
+
# @param params [Hash] Optional query string parameters:
|
|
3199
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3113
3200
|
#
|
|
3114
3201
|
# @return [Resources::Subscription] A subscription.
|
|
3115
3202
|
# @example
|
|
@@ -3118,7 +3205,7 @@ module Recurly
|
|
|
3118
3205
|
# customer_notes: "New Notes",
|
|
3119
3206
|
# terms_and_conditions: "New ToC"
|
|
3120
3207
|
# }
|
|
3121
|
-
# subscription = @client.
|
|
3208
|
+
# subscription = @client.update_subscription(
|
|
3122
3209
|
# subscription_id: subscription_id,
|
|
3123
3210
|
# body: subscription_update
|
|
3124
3211
|
# )
|
|
@@ -3129,17 +3216,18 @@ module Recurly
|
|
|
3129
3216
|
# puts "ValidationError: #{e.recurly_error.params}"
|
|
3130
3217
|
# end
|
|
3131
3218
|
#
|
|
3132
|
-
def
|
|
3219
|
+
def update_subscription(subscription_id:, body:, **options)
|
|
3133
3220
|
path = interpolate_path("/subscriptions/{subscription_id}", subscription_id: subscription_id)
|
|
3134
3221
|
put(path, body, Requests::SubscriptionUpdate, **options)
|
|
3135
3222
|
end
|
|
3136
3223
|
|
|
3137
3224
|
# Terminate a subscription
|
|
3138
3225
|
#
|
|
3139
|
-
# {https://developers.recurly.com/api/
|
|
3226
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/terminate_subscription terminate_subscription api documenation}
|
|
3140
3227
|
#
|
|
3141
3228
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3142
|
-
# @param
|
|
3229
|
+
# @param params [Hash] Optional query string parameters:
|
|
3230
|
+
# :refund [String] The type of refund to perform:
|
|
3143
3231
|
#
|
|
3144
3232
|
# * +full+ - Performs a full refund of the last invoice for the current subscription term.
|
|
3145
3233
|
# * +partial+ - Prorates a refund based on the amount of time remaining in the current bill cycle.
|
|
@@ -3149,8 +3237,8 @@ module Recurly
|
|
|
3149
3237
|
#
|
|
3150
3238
|
# You may also terminate a subscription with no refund and then manually refund specific invoices.
|
|
3151
3239
|
#
|
|
3152
|
-
#
|
|
3153
|
-
#
|
|
3240
|
+
# :charge [Boolean] Applicable only if the subscription has usage based add-ons and unbilled usage logged for the current billing cycle. If true, current billing cycle unbilled usage is billed on the final invoice. If false, Recurly will create a negative usage record for current billing cycle usage that will zero out the final invoice line items.
|
|
3241
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3154
3242
|
#
|
|
3155
3243
|
# @return [Resources::Subscription] An expired subscription.
|
|
3156
3244
|
# @example
|
|
@@ -3172,11 +3260,12 @@ module Recurly
|
|
|
3172
3260
|
|
|
3173
3261
|
# Cancel a subscription
|
|
3174
3262
|
#
|
|
3175
|
-
# {https://developers.recurly.com/api/
|
|
3263
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/cancel_subscription cancel_subscription api documenation}
|
|
3176
3264
|
#
|
|
3177
3265
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3178
|
-
# @param
|
|
3179
|
-
#
|
|
3266
|
+
# @param params [Hash] Optional query string parameters:
|
|
3267
|
+
# :body [Requests::SubscriptionCancel] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionCancel}
|
|
3268
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3180
3269
|
#
|
|
3181
3270
|
# @return [Resources::Subscription] A canceled or failed subscription.
|
|
3182
3271
|
# @example
|
|
@@ -3198,10 +3287,11 @@ module Recurly
|
|
|
3198
3287
|
|
|
3199
3288
|
# Reactivate a canceled subscription
|
|
3200
3289
|
#
|
|
3201
|
-
# {https://developers.recurly.com/api/
|
|
3290
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_subscription reactivate_subscription api documenation}
|
|
3202
3291
|
#
|
|
3203
3292
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3204
|
-
# @param
|
|
3293
|
+
# @param params [Hash] Optional query string parameters:
|
|
3294
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3205
3295
|
#
|
|
3206
3296
|
# @return [Resources::Subscription] An active subscription.
|
|
3207
3297
|
# @example
|
|
@@ -3223,11 +3313,12 @@ module Recurly
|
|
|
3223
3313
|
|
|
3224
3314
|
# Pause subscription
|
|
3225
3315
|
#
|
|
3226
|
-
# {https://developers.recurly.com/api/
|
|
3316
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/pause_subscription pause_subscription api documenation}
|
|
3227
3317
|
#
|
|
3228
3318
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3229
3319
|
# @param body [Requests::SubscriptionPause] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionPause}
|
|
3230
|
-
# @param
|
|
3320
|
+
# @param params [Hash] Optional query string parameters:
|
|
3321
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3231
3322
|
#
|
|
3232
3323
|
# @return [Resources::Subscription] A subscription.
|
|
3233
3324
|
# @example
|
|
@@ -3253,10 +3344,11 @@ module Recurly
|
|
|
3253
3344
|
|
|
3254
3345
|
# Resume subscription
|
|
3255
3346
|
#
|
|
3256
|
-
# {https://developers.recurly.com/api/
|
|
3347
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/resume_subscription resume_subscription api documenation}
|
|
3257
3348
|
#
|
|
3258
3349
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3259
|
-
# @param
|
|
3350
|
+
# @param params [Hash] Optional query string parameters:
|
|
3351
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3260
3352
|
#
|
|
3261
3353
|
# @return [Resources::Subscription] A subscription.
|
|
3262
3354
|
# @example
|
|
@@ -3278,10 +3370,11 @@ module Recurly
|
|
|
3278
3370
|
|
|
3279
3371
|
# Convert trial subscription
|
|
3280
3372
|
#
|
|
3281
|
-
# {https://developers.recurly.com/api/
|
|
3373
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/convert_trial convert_trial api documenation}
|
|
3282
3374
|
#
|
|
3283
3375
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3284
|
-
# @param
|
|
3376
|
+
# @param params [Hash] Optional query string parameters:
|
|
3377
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3285
3378
|
#
|
|
3286
3379
|
# @return [Resources::Subscription] A subscription.
|
|
3287
3380
|
#
|
|
@@ -3290,26 +3383,13 @@ module Recurly
|
|
|
3290
3383
|
put(path, **options)
|
|
3291
3384
|
end
|
|
3292
3385
|
|
|
3293
|
-
# Fetch a preview of a subscription's renewal invoice(s)
|
|
3294
|
-
#
|
|
3295
|
-
# {https://developers.recurly.com/api/v2019-10-10#operation/get_preview_renewal get_preview_renewal api documentation}
|
|
3296
|
-
#
|
|
3297
|
-
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3298
|
-
# @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3299
|
-
#
|
|
3300
|
-
# @return [Resources::InvoiceCollection] A preview of the subscription's renewal invoice(s).
|
|
3301
|
-
#
|
|
3302
|
-
def get_preview_renewal(subscription_id:, **options)
|
|
3303
|
-
path = interpolate_path("/subscriptions/{subscription_id}/preview_renewal", subscription_id: subscription_id)
|
|
3304
|
-
get(path, **options)
|
|
3305
|
-
end
|
|
3306
|
-
|
|
3307
3386
|
# Fetch a subscription's pending change
|
|
3308
3387
|
#
|
|
3309
|
-
# {https://developers.recurly.com/api/
|
|
3388
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_subscription_change get_subscription_change api documenation}
|
|
3310
3389
|
#
|
|
3311
3390
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3312
|
-
# @param
|
|
3391
|
+
# @param params [Hash] Optional query string parameters:
|
|
3392
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3313
3393
|
#
|
|
3314
3394
|
# @return [Resources::SubscriptionChange] A subscription's pending change.
|
|
3315
3395
|
# @example
|
|
@@ -3331,11 +3411,12 @@ module Recurly
|
|
|
3331
3411
|
|
|
3332
3412
|
# Create a new subscription change
|
|
3333
3413
|
#
|
|
3334
|
-
# {https://developers.recurly.com/api/
|
|
3414
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_subscription_change create_subscription_change api documenation}
|
|
3335
3415
|
#
|
|
3336
3416
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3337
3417
|
# @param body [Requests::SubscriptionChangeCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionChangeCreate}
|
|
3338
|
-
# @param
|
|
3418
|
+
# @param params [Hash] Optional query string parameters:
|
|
3419
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3339
3420
|
#
|
|
3340
3421
|
# @return [Resources::SubscriptionChange] A subscription change.
|
|
3341
3422
|
# @example
|
|
@@ -3362,10 +3443,11 @@ module Recurly
|
|
|
3362
3443
|
|
|
3363
3444
|
# Delete the pending subscription change
|
|
3364
3445
|
#
|
|
3365
|
-
# {https://developers.recurly.com/api/
|
|
3446
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_subscription_change remove_subscription_change api documenation}
|
|
3366
3447
|
#
|
|
3367
3448
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3368
|
-
# @param
|
|
3449
|
+
# @param params [Hash] Optional query string parameters:
|
|
3450
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3369
3451
|
#
|
|
3370
3452
|
# @return [Resources::Empty] Subscription change was deleted.
|
|
3371
3453
|
# @example
|
|
@@ -3387,13 +3469,14 @@ module Recurly
|
|
|
3387
3469
|
|
|
3388
3470
|
# Preview a new subscription change
|
|
3389
3471
|
#
|
|
3390
|
-
# {https://developers.recurly.com/api/
|
|
3472
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/preview_subscription_change preview_subscription_change api documenation}
|
|
3391
3473
|
#
|
|
3392
3474
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3393
3475
|
# @param body [Requests::SubscriptionChangeCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionChangeCreate}
|
|
3394
|
-
# @param
|
|
3476
|
+
# @param params [Hash] Optional query string parameters:
|
|
3477
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3395
3478
|
#
|
|
3396
|
-
# @return [Resources::
|
|
3479
|
+
# @return [Resources::SubscriptionChange] A subscription change.
|
|
3397
3480
|
#
|
|
3398
3481
|
def preview_subscription_change(subscription_id:, body:, **options)
|
|
3399
3482
|
path = interpolate_path("/subscriptions/{subscription_id}/change/preview", subscription_id: subscription_id)
|
|
@@ -3402,10 +3485,11 @@ module Recurly
|
|
|
3402
3485
|
|
|
3403
3486
|
# List a subscription's invoices
|
|
3404
3487
|
#
|
|
3405
|
-
# {https://developers.recurly.com/api/
|
|
3488
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_invoices list_subscription_invoices api documenation}
|
|
3406
3489
|
#
|
|
3407
3490
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3408
|
-
# @param
|
|
3491
|
+
# @param params [Hash] Optional query string parameters:
|
|
3492
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
3409
3493
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
3410
3494
|
#
|
|
3411
3495
|
# *Important notes:*
|
|
@@ -3417,32 +3501,34 @@ module Recurly
|
|
|
3417
3501
|
# * Records are returned in an arbitrary order. Since results are all
|
|
3418
3502
|
# returned at once you can sort the records yourself.
|
|
3419
3503
|
#
|
|
3420
|
-
#
|
|
3421
|
-
#
|
|
3422
|
-
#
|
|
3423
|
-
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
3504
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
3505
|
+
# :order [String] Sort order.
|
|
3506
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
3424
3507
|
# order. In descending order updated records will move behind the cursor and could
|
|
3425
3508
|
# prevent some records from being returned.
|
|
3426
3509
|
#
|
|
3427
|
-
#
|
|
3510
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
3428
3511
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
3429
3512
|
#
|
|
3430
|
-
#
|
|
3513
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
3431
3514
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
3432
3515
|
#
|
|
3433
|
-
#
|
|
3516
|
+
# :type [String] Filter by type when:
|
|
3434
3517
|
# - +type=charge+, only charge invoices will be returned.
|
|
3435
3518
|
# - +type=credit+, only credit invoices will be returned.
|
|
3436
3519
|
# - +type=non-legacy+, only charge and credit invoices will be returned.
|
|
3437
3520
|
# - +type=legacy+, only legacy invoices will be returned.
|
|
3438
3521
|
#
|
|
3439
|
-
#
|
|
3522
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3440
3523
|
#
|
|
3441
3524
|
# @return [Pager<Resources::Invoice>] A list of the subscription's invoices.
|
|
3442
3525
|
# @example
|
|
3526
|
+
# params = {
|
|
3527
|
+
# limit: 200
|
|
3528
|
+
# }
|
|
3443
3529
|
# invoices = @client.list_subscription_invoices(
|
|
3444
3530
|
# subscription_id: subscription_id,
|
|
3445
|
-
#
|
|
3531
|
+
# params: params
|
|
3446
3532
|
# )
|
|
3447
3533
|
# invoices.each do |invoice|
|
|
3448
3534
|
# puts "Invoice: #{invoice.number}"
|
|
@@ -3455,10 +3541,11 @@ module Recurly
|
|
|
3455
3541
|
|
|
3456
3542
|
# List a subscription's line items
|
|
3457
3543
|
#
|
|
3458
|
-
# {https://developers.recurly.com/api/
|
|
3544
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_line_items list_subscription_line_items api documenation}
|
|
3459
3545
|
#
|
|
3460
3546
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3461
|
-
# @param
|
|
3547
|
+
# @param params [Hash] Optional query string parameters:
|
|
3548
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
3462
3549
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
3463
3550
|
#
|
|
3464
3551
|
# *Important notes:*
|
|
@@ -3470,28 +3557,31 @@ module Recurly
|
|
|
3470
3557
|
# * Records are returned in an arbitrary order. Since results are all
|
|
3471
3558
|
# returned at once you can sort the records yourself.
|
|
3472
3559
|
#
|
|
3473
|
-
#
|
|
3474
|
-
#
|
|
3475
|
-
#
|
|
3560
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
3561
|
+
# :order [String] Sort order.
|
|
3562
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
3476
3563
|
# order. In descending order updated records will move behind the cursor and could
|
|
3477
3564
|
# prevent some records from being returned.
|
|
3478
3565
|
#
|
|
3479
|
-
#
|
|
3566
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
3480
3567
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
3481
3568
|
#
|
|
3482
|
-
#
|
|
3569
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
3483
3570
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
3484
3571
|
#
|
|
3485
|
-
#
|
|
3486
|
-
#
|
|
3487
|
-
#
|
|
3488
|
-
#
|
|
3572
|
+
# :original [String] Filter by original field.
|
|
3573
|
+
# :state [String] Filter by state field.
|
|
3574
|
+
# :type [String] Filter by type field.
|
|
3575
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3489
3576
|
#
|
|
3490
3577
|
# @return [Pager<Resources::LineItem>] A list of the subscription's line items.
|
|
3491
3578
|
# @example
|
|
3579
|
+
# params = {
|
|
3580
|
+
# limit: 200
|
|
3581
|
+
# }
|
|
3492
3582
|
# line_items = @client.list_subscription_line_items(
|
|
3493
3583
|
# subscription_id: subscription_id,
|
|
3494
|
-
#
|
|
3584
|
+
# params: params
|
|
3495
3585
|
# )
|
|
3496
3586
|
# line_items.each do |line_item|
|
|
3497
3587
|
# puts "LineItem: #{line_item.id}"
|
|
@@ -3502,12 +3592,13 @@ module Recurly
|
|
|
3502
3592
|
pager(path, **options)
|
|
3503
3593
|
end
|
|
3504
3594
|
|
|
3505
|
-
#
|
|
3595
|
+
# Show the coupon redemptions for a subscription
|
|
3506
3596
|
#
|
|
3507
|
-
# {https://developers.recurly.com/api/
|
|
3597
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_coupon_redemptions list_subscription_coupon_redemptions api documenation}
|
|
3508
3598
|
#
|
|
3509
3599
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3510
|
-
# @param
|
|
3600
|
+
# @param params [Hash] Optional query string parameters:
|
|
3601
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
3511
3602
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
3512
3603
|
#
|
|
3513
3604
|
# *Important notes:*
|
|
@@ -3519,23 +3610,26 @@ module Recurly
|
|
|
3519
3610
|
# * Records are returned in an arbitrary order. Since results are all
|
|
3520
3611
|
# returned at once you can sort the records yourself.
|
|
3521
3612
|
#
|
|
3522
|
-
#
|
|
3613
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
3523
3614
|
# order. In descending order updated records will move behind the cursor and could
|
|
3524
3615
|
# prevent some records from being returned.
|
|
3525
3616
|
#
|
|
3526
|
-
#
|
|
3617
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
3527
3618
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
3528
3619
|
#
|
|
3529
|
-
#
|
|
3620
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
3530
3621
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
3531
3622
|
#
|
|
3532
|
-
#
|
|
3623
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3533
3624
|
#
|
|
3534
3625
|
# @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on a subscription.
|
|
3535
3626
|
# @example
|
|
3627
|
+
# params = {
|
|
3628
|
+
# limit: 200
|
|
3629
|
+
# }
|
|
3536
3630
|
# coupon_redemptions = @client.list_subscription_coupon_redemptions(
|
|
3537
3631
|
# subscription_id: subscription_id,
|
|
3538
|
-
#
|
|
3632
|
+
# params: params
|
|
3539
3633
|
# )
|
|
3540
3634
|
# coupon_redemptions.each do |redemption|
|
|
3541
3635
|
# puts "CouponRedemption: #{redemption.id}"
|
|
@@ -3548,11 +3642,12 @@ module Recurly
|
|
|
3548
3642
|
|
|
3549
3643
|
# List a subscription add-on's usage records
|
|
3550
3644
|
#
|
|
3551
|
-
# {https://developers.recurly.com/api/
|
|
3645
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_usage list_usage api documenation}
|
|
3552
3646
|
#
|
|
3553
3647
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3554
3648
|
# @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
3555
|
-
# @param
|
|
3649
|
+
# @param params [Hash] Optional query string parameters:
|
|
3650
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
3556
3651
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
3557
3652
|
#
|
|
3558
3653
|
# *Important notes:*
|
|
@@ -3564,20 +3659,20 @@ module Recurly
|
|
|
3564
3659
|
# * Records are returned in an arbitrary order. Since results are all
|
|
3565
3660
|
# returned at once you can sort the records yourself.
|
|
3566
3661
|
#
|
|
3567
|
-
#
|
|
3568
|
-
#
|
|
3569
|
-
#
|
|
3662
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
3663
|
+
# :order [String] Sort order.
|
|
3664
|
+
# :sort [String] Sort field. You *really* only want to sort by +usage_timestamp+ in ascending
|
|
3570
3665
|
# order. In descending order updated records will move behind the cursor and could
|
|
3571
3666
|
# prevent some records from being returned.
|
|
3572
3667
|
#
|
|
3573
|
-
#
|
|
3668
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=usage_timestamp+ or +sort=recorded_timestamp+.
|
|
3574
3669
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
3575
3670
|
#
|
|
3576
|
-
#
|
|
3671
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=usage_timestamp+ or +sort=recorded_timestamp+.
|
|
3577
3672
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
3578
3673
|
#
|
|
3579
|
-
#
|
|
3580
|
-
#
|
|
3674
|
+
# :billing_status [String] Filter by usage record's billing status
|
|
3675
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3581
3676
|
#
|
|
3582
3677
|
# @return [Pager<Resources::Usage>] A list of the subscription add-on's usage records.
|
|
3583
3678
|
#
|
|
@@ -3588,12 +3683,13 @@ module Recurly
|
|
|
3588
3683
|
|
|
3589
3684
|
# Log a usage record on this subscription add-on
|
|
3590
3685
|
#
|
|
3591
|
-
# {https://developers.recurly.com/api/
|
|
3686
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_usage create_usage api documenation}
|
|
3592
3687
|
#
|
|
3593
3688
|
# @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3594
3689
|
# @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
|
3595
3690
|
# @param body [Requests::UsageCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::UsageCreate}
|
|
3596
|
-
# @param
|
|
3691
|
+
# @param params [Hash] Optional query string parameters:
|
|
3692
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3597
3693
|
#
|
|
3598
3694
|
# @return [Resources::Usage] The created usage record.
|
|
3599
3695
|
#
|
|
@@ -3604,10 +3700,11 @@ module Recurly
|
|
|
3604
3700
|
|
|
3605
3701
|
# Get a usage record
|
|
3606
3702
|
#
|
|
3607
|
-
# {https://developers.recurly.com/api/
|
|
3703
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_usage get_usage api documenation}
|
|
3608
3704
|
#
|
|
3609
3705
|
# @param usage_id [String] Usage Record ID.
|
|
3610
|
-
# @param
|
|
3706
|
+
# @param params [Hash] Optional query string parameters:
|
|
3707
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3611
3708
|
#
|
|
3612
3709
|
# @return [Resources::Usage] The usage record.
|
|
3613
3710
|
#
|
|
@@ -3618,11 +3715,12 @@ module Recurly
|
|
|
3618
3715
|
|
|
3619
3716
|
# Update a usage record
|
|
3620
3717
|
#
|
|
3621
|
-
# {https://developers.recurly.com/api/
|
|
3718
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_usage update_usage api documenation}
|
|
3622
3719
|
#
|
|
3623
3720
|
# @param usage_id [String] Usage Record ID.
|
|
3624
3721
|
# @param body [Requests::UsageCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::UsageCreate}
|
|
3625
|
-
# @param
|
|
3722
|
+
# @param params [Hash] Optional query string parameters:
|
|
3723
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3626
3724
|
#
|
|
3627
3725
|
# @return [Resources::Usage] The updated usage record.
|
|
3628
3726
|
#
|
|
@@ -3633,10 +3731,11 @@ module Recurly
|
|
|
3633
3731
|
|
|
3634
3732
|
# Delete a usage record.
|
|
3635
3733
|
#
|
|
3636
|
-
# {https://developers.recurly.com/api/
|
|
3734
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_usage remove_usage api documenation}
|
|
3637
3735
|
#
|
|
3638
3736
|
# @param usage_id [String] Usage Record ID.
|
|
3639
|
-
# @param
|
|
3737
|
+
# @param params [Hash] Optional query string parameters:
|
|
3738
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3640
3739
|
#
|
|
3641
3740
|
# @return [Resources::Empty] Usage was successfully deleted.
|
|
3642
3741
|
#
|
|
@@ -3647,9 +3746,10 @@ module Recurly
|
|
|
3647
3746
|
|
|
3648
3747
|
# List a site's transactions
|
|
3649
3748
|
#
|
|
3650
|
-
# {https://developers.recurly.com/api/
|
|
3749
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_transactions list_transactions api documenation}
|
|
3651
3750
|
#
|
|
3652
|
-
# @param
|
|
3751
|
+
# @param params [Hash] Optional query string parameters:
|
|
3752
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
|
3653
3753
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
|
3654
3754
|
#
|
|
3655
3755
|
# *Important notes:*
|
|
@@ -3661,40 +3761,44 @@ module Recurly
|
|
|
3661
3761
|
# * Records are returned in an arbitrary order. Since results are all
|
|
3662
3762
|
# returned at once you can sort the records yourself.
|
|
3663
3763
|
#
|
|
3664
|
-
#
|
|
3665
|
-
#
|
|
3666
|
-
#
|
|
3764
|
+
# :limit [Integer] Limit number of records 1-200.
|
|
3765
|
+
# :order [String] Sort order.
|
|
3766
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
3667
3767
|
# order. In descending order updated records will move behind the cursor and could
|
|
3668
3768
|
# prevent some records from being returned.
|
|
3669
3769
|
#
|
|
3670
|
-
#
|
|
3770
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
|
3671
3771
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
3672
3772
|
#
|
|
3673
|
-
#
|
|
3773
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
|
3674
3774
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
|
3675
3775
|
#
|
|
3676
|
-
#
|
|
3677
|
-
#
|
|
3678
|
-
#
|
|
3776
|
+
# :type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions.
|
|
3777
|
+
# :success [String] Filter by success field.
|
|
3778
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3679
3779
|
#
|
|
3680
3780
|
# @return [Pager<Resources::Transaction>] A list of the site's transactions.
|
|
3681
3781
|
# @example
|
|
3682
|
-
#
|
|
3782
|
+
# params = {
|
|
3783
|
+
# limit: 200
|
|
3784
|
+
# }
|
|
3785
|
+
# transactions = @client.list_transactions(params: params)
|
|
3683
3786
|
# transactions.each do |transaction|
|
|
3684
3787
|
# puts "Transaction: #{transaction.uuid}"
|
|
3685
3788
|
# end
|
|
3686
3789
|
#
|
|
3687
3790
|
def list_transactions(**options)
|
|
3688
|
-
path = "/transactions"
|
|
3791
|
+
path = interpolate_path("/transactions")
|
|
3689
3792
|
pager(path, **options)
|
|
3690
3793
|
end
|
|
3691
3794
|
|
|
3692
3795
|
# Fetch a transaction
|
|
3693
3796
|
#
|
|
3694
|
-
# {https://developers.recurly.com/api/
|
|
3797
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_transaction get_transaction api documenation}
|
|
3695
3798
|
#
|
|
3696
3799
|
# @param transaction_id [String] Transaction ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
|
3697
|
-
# @param
|
|
3800
|
+
# @param params [Hash] Optional query string parameters:
|
|
3801
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3698
3802
|
#
|
|
3699
3803
|
# @return [Resources::Transaction] A transaction.
|
|
3700
3804
|
# @example
|
|
@@ -3714,10 +3818,11 @@ module Recurly
|
|
|
3714
3818
|
|
|
3715
3819
|
# Fetch a unique coupon code
|
|
3716
3820
|
#
|
|
3717
|
-
# {https://developers.recurly.com/api/
|
|
3821
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_unique_coupon_code get_unique_coupon_code api documenation}
|
|
3718
3822
|
#
|
|
3719
3823
|
# @param unique_coupon_code_id [String] Unique Coupon Code ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-abc-8dh2-def+.
|
|
3720
|
-
# @param
|
|
3824
|
+
# @param params [Hash] Optional query string parameters:
|
|
3825
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3721
3826
|
#
|
|
3722
3827
|
# @return [Resources::UniqueCouponCode] A unique coupon code.
|
|
3723
3828
|
#
|
|
@@ -3728,10 +3833,11 @@ module Recurly
|
|
|
3728
3833
|
|
|
3729
3834
|
# Deactivate a unique coupon code
|
|
3730
3835
|
#
|
|
3731
|
-
# {https://developers.recurly.com/api/
|
|
3836
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_unique_coupon_code deactivate_unique_coupon_code api documenation}
|
|
3732
3837
|
#
|
|
3733
3838
|
# @param unique_coupon_code_id [String] Unique Coupon Code ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-abc-8dh2-def+.
|
|
3734
|
-
# @param
|
|
3839
|
+
# @param params [Hash] Optional query string parameters:
|
|
3840
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3735
3841
|
#
|
|
3736
3842
|
# @return [Resources::UniqueCouponCode] A unique coupon code.
|
|
3737
3843
|
#
|
|
@@ -3742,10 +3848,11 @@ module Recurly
|
|
|
3742
3848
|
|
|
3743
3849
|
# Restore a unique coupon code
|
|
3744
3850
|
#
|
|
3745
|
-
# {https://developers.recurly.com/api/
|
|
3851
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_unique_coupon_code reactivate_unique_coupon_code api documenation}
|
|
3746
3852
|
#
|
|
3747
3853
|
# @param unique_coupon_code_id [String] Unique Coupon Code ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-abc-8dh2-def+.
|
|
3748
|
-
# @param
|
|
3854
|
+
# @param params [Hash] Optional query string parameters:
|
|
3855
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3749
3856
|
#
|
|
3750
3857
|
# @return [Resources::UniqueCouponCode] A unique coupon code.
|
|
3751
3858
|
#
|
|
@@ -3756,10 +3863,11 @@ module Recurly
|
|
|
3756
3863
|
|
|
3757
3864
|
# Create a new purchase
|
|
3758
3865
|
#
|
|
3759
|
-
# {https://developers.recurly.com/api/
|
|
3866
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_purchase create_purchase api documenation}
|
|
3760
3867
|
#
|
|
3761
3868
|
# @param body [Requests::PurchaseCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PurchaseCreate}
|
|
3762
|
-
# @param
|
|
3869
|
+
# @param params [Hash] Optional query string parameters:
|
|
3870
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3763
3871
|
#
|
|
3764
3872
|
# @return [Resources::InvoiceCollection] Returns the new invoices
|
|
3765
3873
|
# @example
|
|
@@ -3790,16 +3898,17 @@ module Recurly
|
|
|
3790
3898
|
# end
|
|
3791
3899
|
#
|
|
3792
3900
|
def create_purchase(body:, **options)
|
|
3793
|
-
path = "/purchases"
|
|
3901
|
+
path = interpolate_path("/purchases")
|
|
3794
3902
|
post(path, body, Requests::PurchaseCreate, **options)
|
|
3795
3903
|
end
|
|
3796
3904
|
|
|
3797
3905
|
# Preview a new purchase
|
|
3798
3906
|
#
|
|
3799
|
-
# {https://developers.recurly.com/api/
|
|
3907
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/preview_purchase preview_purchase api documenation}
|
|
3800
3908
|
#
|
|
3801
3909
|
# @param body [Requests::PurchaseCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PurchaseCreate}
|
|
3802
|
-
# @param
|
|
3910
|
+
# @param params [Hash] Optional query string parameters:
|
|
3911
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3803
3912
|
#
|
|
3804
3913
|
# @return [Resources::InvoiceCollection] Returns preview of the new invoices
|
|
3805
3914
|
# @example
|
|
@@ -3830,15 +3939,16 @@ module Recurly
|
|
|
3830
3939
|
# end
|
|
3831
3940
|
#
|
|
3832
3941
|
def preview_purchase(body:, **options)
|
|
3833
|
-
path = "/purchases/preview"
|
|
3942
|
+
path = interpolate_path("/purchases/preview")
|
|
3834
3943
|
post(path, body, Requests::PurchaseCreate, **options)
|
|
3835
3944
|
end
|
|
3836
3945
|
|
|
3837
3946
|
# List the dates that have an available export to download.
|
|
3838
3947
|
#
|
|
3839
|
-
# {https://developers.recurly.com/api/
|
|
3948
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_export_dates get_export_dates api documenation}
|
|
3840
3949
|
#
|
|
3841
|
-
# @param
|
|
3950
|
+
# @param params [Hash] Optional query string parameters:
|
|
3951
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3842
3952
|
#
|
|
3843
3953
|
# @return [Resources::ExportDates] Returns a list of dates.
|
|
3844
3954
|
# @example
|
|
@@ -3854,16 +3964,17 @@ module Recurly
|
|
|
3854
3964
|
# end
|
|
3855
3965
|
#
|
|
3856
3966
|
def get_export_dates(**options)
|
|
3857
|
-
path = "/export_dates"
|
|
3967
|
+
path = interpolate_path("/export_dates")
|
|
3858
3968
|
get(path, **options)
|
|
3859
3969
|
end
|
|
3860
3970
|
|
|
3861
3971
|
# List of the export files that are available to download.
|
|
3862
3972
|
#
|
|
3863
|
-
# {https://developers.recurly.com/api/
|
|
3973
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_export_files get_export_files api documenation}
|
|
3864
3974
|
#
|
|
3865
3975
|
# @param export_date [String] Date for which to get a list of available automated export files. Date must be in YYYY-MM-DD format.
|
|
3866
|
-
# @param
|
|
3976
|
+
# @param params [Hash] Optional query string parameters:
|
|
3977
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3867
3978
|
#
|
|
3868
3979
|
# @return [Resources::ExportFiles] Returns a list of export files to download.
|
|
3869
3980
|
# @example
|
|
@@ -3882,49 +3993,5 @@ module Recurly
|
|
|
3882
3993
|
path = interpolate_path("/export_dates/{export_date}/export_files", export_date: export_date)
|
|
3883
3994
|
get(path, **options)
|
|
3884
3995
|
end
|
|
3885
|
-
|
|
3886
|
-
# List the dunning campaigns for a site
|
|
3887
|
-
#
|
|
3888
|
-
# {https://developers.recurly.com/api/v2019-10-10#operation/list_dunning_campaigns list_dunning_campaigns api documentation}
|
|
3889
|
-
#
|
|
3890
|
-
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
|
3891
|
-
# order. In descending order updated records will move behind the cursor and could
|
|
3892
|
-
# prevent some records from being returned.
|
|
3893
|
-
#
|
|
3894
|
-
# @param site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
|
3895
|
-
#
|
|
3896
|
-
# @return [Pager<Resources::DunningCampaign>] A list of the the dunning_campaigns on an account.
|
|
3897
|
-
#
|
|
3898
|
-
def list_dunning_campaigns(**options)
|
|
3899
|
-
path = "/dunning_campaigns"
|
|
3900
|
-
pager(path, **options)
|
|
3901
|
-
end
|
|
3902
|
-
|
|
3903
|
-
# Fetch a dunning campaign
|
|
3904
|
-
#
|
|
3905
|
-
# {https://developers.recurly.com/api/v2019-10-10#operation/get_dunning_campaign get_dunning_campaign api documentation}
|
|
3906
|
-
#
|
|
3907
|
-
# @param dunning_campaign_id [String] Dunning Campaign ID, e.g. +e28zov4fw0v2+.
|
|
3908
|
-
#
|
|
3909
|
-
# @return [Resources::DunningCampaign] Settings for a dunning campaign.
|
|
3910
|
-
#
|
|
3911
|
-
def get_dunning_campaign(dunning_campaign_id:)
|
|
3912
|
-
path = interpolate_path("/dunning_campaigns/{dunning_campaign_id}", dunning_campaign_id: dunning_campaign_id)
|
|
3913
|
-
get(path)
|
|
3914
|
-
end
|
|
3915
|
-
|
|
3916
|
-
# Assign a dunning campaign to multiple plans
|
|
3917
|
-
#
|
|
3918
|
-
# {https://developers.recurly.com/api/v2019-10-10#operation/put_dunning_campaign_bulk_update put_dunning_campaign_bulk_update api documentation}
|
|
3919
|
-
#
|
|
3920
|
-
# @param dunning_campaign_id [String] Dunning Campaign ID, e.g. +e28zov4fw0v2+.
|
|
3921
|
-
# @param body [Requests::DunningCampaignsBulkUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::DunningCampaignsBulkUpdate}
|
|
3922
|
-
#
|
|
3923
|
-
# @return [Resources::DunningCampaignsBulkUpdateResponse] A list of updated plans.
|
|
3924
|
-
#
|
|
3925
|
-
def put_dunning_campaign_bulk_update(dunning_campaign_id:, body:)
|
|
3926
|
-
path = interpolate_path("/dunning_campaigns/{dunning_campaign_id}/bulk_update", dunning_campaign_id: dunning_campaign_id)
|
|
3927
|
-
put(path, body, Requests::DunningCampaignsBulkUpdate)
|
|
3928
|
-
end
|
|
3929
3996
|
end
|
|
3930
3997
|
end
|