recurly 3.18.1 → 4.3.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/.changelog_config.yaml +11 -0
- data/.github/workflows/docs.yml +1 -1
- data/CHANGELOG.md +90 -348
- data/GETTING_STARTED.md +20 -17
- data/lib/recurly/client.rb +48 -21
- data/lib/recurly/client/operations.rb +691 -573
- data/lib/recurly/errors.rb +5 -22
- data/lib/recurly/errors/api_errors.rb +3 -0
- data/lib/recurly/errors/network_errors.rb +1 -4
- data/lib/recurly/pager.rb +4 -14
- data/lib/recurly/requests/{account_acquisition_updatable.rb → account_acquisition_update.rb} +1 -1
- data/lib/recurly/requests/account_create.rb +2 -2
- data/lib/recurly/requests/account_purchase.rb +2 -2
- data/lib/recurly/requests/add_on_create.rb +4 -4
- data/lib/recurly/requests/add_on_pricing.rb +5 -1
- data/lib/recurly/requests/add_on_update.rb +4 -4
- data/lib/recurly/requests/address.rb +0 -8
- data/lib/recurly/requests/billing_info_create.rb +6 -26
- data/lib/recurly/requests/billing_info_verify.rb +14 -0
- data/lib/recurly/requests/coupon_create.rb +1 -1
- data/lib/recurly/requests/external_transaction.rb +1 -1
- data/lib/recurly/requests/{invoice_updatable.rb → invoice_update.rb} +1 -1
- data/lib/recurly/requests/line_item_create.rb +1 -1
- data/lib/recurly/requests/subscription_add_on_create.rb +6 -2
- data/lib/recurly/requests/subscription_add_on_tier.rb +9 -1
- data/lib/recurly/requests/subscription_add_on_update.rb +6 -2
- data/lib/recurly/requests/subscription_change_create.rb +1 -1
- data/lib/recurly/requests/subscription_create.rb +3 -3
- data/lib/recurly/requests/subscription_purchase.rb +1 -1
- data/lib/recurly/requests/tier.rb +7 -3
- data/lib/recurly/requests/tier_pricing.rb +22 -0
- data/lib/recurly/resources/add_on.rb +1 -1
- data/lib/recurly/resources/add_on_pricing.rb +5 -1
- data/lib/recurly/resources/address.rb +0 -8
- data/lib/recurly/resources/address_with_name.rb +46 -0
- data/lib/recurly/resources/billing_info.rb +5 -1
- data/lib/recurly/resources/coupon.rb +5 -17
- data/lib/recurly/resources/invoice.rb +6 -2
- data/lib/recurly/resources/line_item.rb +4 -0
- data/lib/recurly/resources/plan.rb +1 -1
- data/lib/recurly/resources/subscription_add_on.rb +6 -2
- data/lib/recurly/resources/subscription_add_on_tier.rb +9 -1
- data/lib/recurly/resources/subscription_change.rb +0 -4
- data/lib/recurly/resources/tax_detail.rb +26 -0
- data/lib/recurly/resources/tax_info.rb +4 -0
- data/lib/recurly/resources/tier.rb +7 -3
- data/lib/recurly/resources/tier_pricing.rb +22 -0
- data/lib/recurly/resources/transaction.rb +6 -2
- data/lib/recurly/resources/unique_coupon_code_params.rb +26 -0
- data/lib/recurly/resources/usage.rb +5 -1
- data/lib/recurly/version.rb +1 -1
- data/openapi/api.yaml +2114 -2012
- data/scripts/build +2 -2
- data/scripts/format +2 -2
- data/scripts/prepare-release +43 -29
- data/scripts/release +5 -20
- metadata +15 -13
- data/.github_changelog_generator +0 -8
- data/lib/recurly/resources/line_item_list.rb +0 -26
- data/lib/recurly/resources/subscription_change_preview.rb +0 -78
- data/scripts/bump +0 -11
- data/scripts/changelog +0 -14
data/GETTING_STARTED.md
CHANGED
@@ -5,7 +5,7 @@ This repository houses the official ruby client for Recurly's V3 API.
|
|
5
5
|
In your Gemfile, add `recurly` as a dependency.
|
6
6
|
|
7
7
|
```ruby
|
8
|
-
gem 'recurly', '~> 3
|
8
|
+
gem 'recurly', '~> 4.3'
|
9
9
|
```
|
10
10
|
|
11
11
|
> *Note*: We try to follow [semantic versioning](https://semver.org/) and will only apply breaking changes to major versions.
|
@@ -106,17 +106,19 @@ plans.each_page.each_with_index do |data, page_num|
|
|
106
106
|
end
|
107
107
|
```
|
108
108
|
|
109
|
-
Pagination endpoints take a number of options to sort and filter the results. They can be passed in as keyword
|
109
|
+
Pagination endpoints take a number of options to sort and filter the results. They can be passed in as a hash provided by the `:params` keyword argument.
|
110
110
|
The names, types, and descriptions of these arguments are listed in the rubydocs for each method:
|
111
111
|
|
112
112
|
```ruby
|
113
113
|
options = {
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
114
|
+
params: {
|
115
|
+
limit: 200, # number of items per page
|
116
|
+
state: :active, # only active plans
|
117
|
+
sort: :updated_at,
|
118
|
+
order: :asc,
|
119
|
+
begin_time: DateTime.new(2017,1,1), # January 1st 2017,
|
120
|
+
end_time: DateTime.now
|
121
|
+
}
|
120
122
|
}
|
121
123
|
|
122
124
|
plans = client.list_plans(**options)
|
@@ -200,12 +202,11 @@ plan = client.create_plan(body: plan_data)
|
|
200
202
|
|
201
203
|
# Error Handling
|
202
204
|
|
203
|
-
|
205
|
+
All errors thrown by this library are based off of the `Recurly::Errors::APIError`. There
|
204
206
|
|
205
|
-
|
206
|
-
2. [Network Errors](./lib/recurly/errors/network_errors.rb)
|
207
|
+
This library throws one main type of exception, `Recurly::Errors::APIError`. There exists an additional hierarchy of errors to facilitate the process of rescuing various classes of errors. More detail can be found in the [Api Errors Module](./lib/recurly/errors/api_errors.rb).
|
207
208
|
|
208
|
-
You
|
209
|
+
You can catch specific or generic versions of these exceptions. Example:
|
209
210
|
|
210
211
|
```ruby
|
211
212
|
begin
|
@@ -233,15 +234,17 @@ rescue Recurly::Errors::ValidationError => ex
|
|
233
234
|
#=> #<Recurly::Error:0x007fbbdf8a32c8 @attributes={:type=>"validation", :message=>"Code 'iexistalready' already exists", :params=>[{"param"=>"code", "message"=>"'iexistalready' already exists"}]}>
|
234
235
|
puts ex.status_code
|
235
236
|
#=> 422
|
237
|
+
rescue Recurly::Errors::TimeoutError => ex
|
238
|
+
# catch a specific server error
|
239
|
+
rescue Recurly::Errors::ServerError => ex
|
240
|
+
# catch a generic server error
|
236
241
|
rescue Recurly::Errors::APIError => ex
|
237
242
|
# catch a generic api error
|
238
|
-
rescue Recurly::Errors::TimeoutError => ex
|
239
|
-
# catch a specific network error
|
240
|
-
rescue Recurly::Errors::NetworkError => ex
|
241
|
-
# catch a generic network error
|
242
243
|
end
|
243
244
|
```
|
244
245
|
|
246
|
+
`Recurly::Errors::APIError` instances provide access to the response via the `#get_response` method.
|
247
|
+
|
245
248
|
# HTTP Metadata
|
246
249
|
|
247
250
|
Sometimes you might want to get some additional information about the underlying HTTP request and response. Instead of
|
@@ -266,7 +269,7 @@ response = @client.remove_line_item(
|
|
266
269
|
line_item_id: "a959576b2b10b012"
|
267
270
|
).get_response
|
268
271
|
```
|
269
|
-
And it can be captured on exceptions through the {Recurly::
|
272
|
+
And it can be captured on exceptions through the {Recurly::APIError} object:
|
270
273
|
|
271
274
|
```ruby
|
272
275
|
begin
|
data/lib/recurly/client.rb
CHANGED
@@ -20,7 +20,14 @@ module Recurly
|
|
20
20
|
MAX_RETRIES = 3
|
21
21
|
LOG_LEVELS = %i(debug info warn error fatal).freeze
|
22
22
|
BASE36_ALPHABET = (("0".."9").to_a + ("a".."z").to_a).freeze
|
23
|
-
|
23
|
+
ALLOWED_OPTIONS = [
|
24
|
+
:site_id,
|
25
|
+
:open_timeout,
|
26
|
+
:read_timeout,
|
27
|
+
:body,
|
28
|
+
:params,
|
29
|
+
:headers,
|
30
|
+
].freeze
|
24
31
|
|
25
32
|
# Initialize a client. It requires an API key.
|
26
33
|
#
|
@@ -47,8 +54,9 @@ module Recurly
|
|
47
54
|
#
|
48
55
|
# @param api_key [String] The private API key
|
49
56
|
# @param logger [Logger] A logger to use. Defaults to creating a new STDOUT logger with level WARN.
|
50
|
-
def initialize(api_key:,
|
51
|
-
|
57
|
+
def initialize(api_key:, logger: nil)
|
58
|
+
raise ArgumentError, "'api_key' must be set to a non-nil value" if api_key.nil?
|
59
|
+
|
52
60
|
set_api_key(api_key)
|
53
61
|
|
54
62
|
if logger.nil?
|
@@ -90,6 +98,7 @@ module Recurly
|
|
90
98
|
end
|
91
99
|
|
92
100
|
def head(path, **options)
|
101
|
+
validate_options!(**options)
|
93
102
|
request = Net::HTTP::Head.new build_url(path, options)
|
94
103
|
set_headers(request, options[:headers])
|
95
104
|
http_response = run_request(request, options)
|
@@ -97,23 +106,28 @@ module Recurly
|
|
97
106
|
end
|
98
107
|
|
99
108
|
def get(path, **options)
|
109
|
+
validate_options!(**options)
|
100
110
|
request = Net::HTTP::Get.new build_url(path, options)
|
101
111
|
set_headers(request, options[:headers])
|
102
112
|
http_response = run_request(request, options)
|
103
113
|
handle_response! request, http_response
|
104
114
|
end
|
105
115
|
|
106
|
-
def post(path, request_data, request_class, **options)
|
107
|
-
|
116
|
+
def post(path, request_data = nil, request_class = nil, **options)
|
117
|
+
validate_options!(**options)
|
108
118
|
request = Net::HTTP::Post.new build_url(path, options)
|
109
119
|
request.set_content_type(JSON_CONTENT_TYPE)
|
110
120
|
set_headers(request, options[:headers])
|
111
|
-
|
121
|
+
if request_data
|
122
|
+
request_class.new(request_data).validate!
|
123
|
+
request.body = JSON.dump(request_data)
|
124
|
+
end
|
112
125
|
http_response = run_request(request, options)
|
113
126
|
handle_response! request, http_response
|
114
127
|
end
|
115
128
|
|
116
129
|
def put(path, request_data = nil, request_class = nil, **options)
|
130
|
+
validate_options!(**options)
|
117
131
|
request = Net::HTTP::Put.new build_url(path, options)
|
118
132
|
request.set_content_type(JSON_CONTENT_TYPE)
|
119
133
|
set_headers(request, options[:headers])
|
@@ -127,6 +141,7 @@ module Recurly
|
|
127
141
|
end
|
128
142
|
|
129
143
|
def delete(path, **options)
|
144
|
+
validate_options!(**options)
|
130
145
|
request = Net::HTTP::Delete.new build_url(path, options)
|
131
146
|
set_headers(request, options[:headers])
|
132
147
|
http_response = run_request(request, options)
|
@@ -194,7 +209,7 @@ module Recurly
|
|
194
209
|
end
|
195
210
|
|
196
211
|
raise Recurly::Errors::ConnectionFailedError, "Failed to connect to Recurly: #{ex.message}"
|
197
|
-
rescue
|
212
|
+
rescue Timeout::Error
|
198
213
|
raise Recurly::Errors::TimeoutError, "Request timed out"
|
199
214
|
rescue OpenSSL::SSL::SSLError => ex
|
200
215
|
raise Recurly::Errors::SSLError, ex.message
|
@@ -240,7 +255,7 @@ module Recurly
|
|
240
255
|
elsif BINARY_TYPES.include?(http_response.content_type)
|
241
256
|
FileParser.parse(response.body)
|
242
257
|
else
|
243
|
-
raise Recurly::Errors::
|
258
|
+
raise Recurly::Errors::InvalidContentTypeError, "Unexpected content type: #{http_response.content_type}"
|
244
259
|
end
|
245
260
|
else
|
246
261
|
Resources::Empty.new
|
@@ -255,10 +270,10 @@ module Recurly
|
|
255
270
|
error = JSONParser.parse(self, response.body)
|
256
271
|
begin
|
257
272
|
error_class = Errors::APIError.error_class(error.type)
|
258
|
-
raise error_class.new(response, error)
|
273
|
+
raise error_class.new(error.message, response, error)
|
259
274
|
rescue NameError
|
260
275
|
error_class = Errors::APIError.from_response(http_response)
|
261
|
-
raise error_class.new(response, error)
|
276
|
+
raise error_class.new("Unknown Error", response, error)
|
262
277
|
end
|
263
278
|
end
|
264
279
|
|
@@ -266,7 +281,7 @@ module Recurly
|
|
266
281
|
|
267
282
|
if error_class <= Recurly::Errors::APIError
|
268
283
|
error = Recurly::Resources::Error.new(message: "#{http_response.code}: #{http_response.message}")
|
269
|
-
raise error_class.new(response, error)
|
284
|
+
raise error_class.new(error.message, response, error)
|
270
285
|
else
|
271
286
|
raise error_class, "#{http_response.code}: #{http_response.message}"
|
272
287
|
end
|
@@ -279,6 +294,17 @@ module Recurly
|
|
279
294
|
response
|
280
295
|
end
|
281
296
|
|
297
|
+
def validate_options!(**options)
|
298
|
+
invalid_options = options.keys.reject do |k|
|
299
|
+
ALLOWED_OPTIONS.include?(k)
|
300
|
+
end
|
301
|
+
if invalid_options.any?
|
302
|
+
joinedKeys = invalid_options.join(", ")
|
303
|
+
joinedOptions = ALLOWED_OPTIONS.join(", ")
|
304
|
+
raise ArgumentError, "Invalid options: '#{joinedKeys}'. Allowed options: '#{joinedOptions}'"
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
282
308
|
def validate_path_parameters!(**options)
|
283
309
|
# Check to see that we are passing the correct data types
|
284
310
|
# This prevents a confusing error if the user passes in a non-primitive by mistake
|
@@ -308,21 +334,13 @@ module Recurly
|
|
308
334
|
path % options
|
309
335
|
end
|
310
336
|
|
311
|
-
def set_site_id(site_id, subdomain)
|
312
|
-
if site_id
|
313
|
-
@site_id = site_id
|
314
|
-
elsif subdomain
|
315
|
-
@site_id = "subdomain-#{subdomain}"
|
316
|
-
end
|
317
|
-
end
|
318
|
-
|
319
337
|
def set_api_key(api_key)
|
320
|
-
@api_key = api_key
|
338
|
+
@api_key = api_key.to_s
|
321
339
|
end
|
322
340
|
|
323
341
|
def build_url(path, options)
|
324
342
|
path = scope_by_site(path, options)
|
325
|
-
query_params = options.
|
343
|
+
query_params = map_array_params(options.fetch(:params, {}))
|
326
344
|
if query_params.any?
|
327
345
|
"#{path}?#{URI.encode_www_form(query_params)}"
|
328
346
|
else
|
@@ -330,6 +348,15 @@ module Recurly
|
|
330
348
|
end
|
331
349
|
end
|
332
350
|
|
351
|
+
# Converts array parameters to CSV strings to maintain consistency with
|
352
|
+
# how the server expects the request to be formatted while providing the
|
353
|
+
# developer with an array type to maintain developer happiness!
|
354
|
+
def map_array_params(params)
|
355
|
+
params.map do |key, param|
|
356
|
+
[key, param.is_a?(Array) ? param.join(",") : param]
|
357
|
+
end.to_h
|
358
|
+
end
|
359
|
+
|
333
360
|
def scope_by_site(path, options)
|
334
361
|
if site = site_id || options[:site_id]
|
335
362
|
# Ensure that we are only including the site_id once because the Pager operations
|
@@ -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,45 @@ 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
|
-
# @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+.
|
107
|
+
# :past_due [String] Filter for accounts with an invoice in the +past_due+ state.
|
103
108
|
#
|
104
109
|
# @return [Pager<Resources::Account>] A list of the site's accounts.
|
105
110
|
# @example
|
106
|
-
#
|
111
|
+
# params = {
|
112
|
+
# limit: 200
|
113
|
+
# }
|
114
|
+
# accounts = @client.list_accounts(params: params)
|
107
115
|
# accounts.each do |account|
|
108
116
|
# puts "Account: #{account.code}"
|
109
117
|
# end
|
110
118
|
#
|
111
119
|
def list_accounts(**options)
|
112
|
-
path =
|
120
|
+
path = "/accounts"
|
113
121
|
pager(path, **options)
|
114
122
|
end
|
115
123
|
|
116
124
|
# Create an account
|
117
125
|
#
|
118
|
-
# {https://developers.recurly.com/api/
|
126
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_account create_account api documenation}
|
119
127
|
#
|
120
128
|
# @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
|
129
|
+
# @param params [Hash] Optional query string parameters:
|
122
130
|
#
|
123
131
|
# @return [Resources::Account] An account.
|
124
132
|
# @example
|
@@ -158,16 +166,16 @@ module Recurly
|
|
158
166
|
# end
|
159
167
|
#
|
160
168
|
def create_account(body:, **options)
|
161
|
-
path =
|
169
|
+
path = "/accounts"
|
162
170
|
post(path, body, Requests::AccountCreate, **options)
|
163
171
|
end
|
164
172
|
|
165
173
|
# Fetch an account
|
166
174
|
#
|
167
|
-
# {https://developers.recurly.com/api/
|
175
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_account get_account api documenation}
|
168
176
|
#
|
169
177
|
# @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+.
|
170
|
-
# @param
|
178
|
+
# @param params [Hash] Optional query string parameters:
|
171
179
|
#
|
172
180
|
# @return [Resources::Account] An account.
|
173
181
|
# @example
|
@@ -185,13 +193,13 @@ module Recurly
|
|
185
193
|
get(path, **options)
|
186
194
|
end
|
187
195
|
|
188
|
-
#
|
196
|
+
# Update an account
|
189
197
|
#
|
190
|
-
# {https://developers.recurly.com/api/
|
198
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_account update_account api documenation}
|
191
199
|
#
|
192
200
|
# @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+.
|
193
201
|
# @param body [Requests::AccountUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountUpdate}
|
194
|
-
# @param
|
202
|
+
# @param params [Hash] Optional query string parameters:
|
195
203
|
#
|
196
204
|
# @return [Resources::Account] An account.
|
197
205
|
# @example
|
@@ -218,10 +226,10 @@ module Recurly
|
|
218
226
|
|
219
227
|
# Deactivate an account
|
220
228
|
#
|
221
|
-
# {https://developers.recurly.com/api/
|
229
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_account deactivate_account api documenation}
|
222
230
|
#
|
223
231
|
# @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+.
|
224
|
-
# @param
|
232
|
+
# @param params [Hash] Optional query string parameters:
|
225
233
|
#
|
226
234
|
# @return [Resources::Account] An account.
|
227
235
|
# @example
|
@@ -241,10 +249,10 @@ module Recurly
|
|
241
249
|
|
242
250
|
# Fetch an account's acquisition data
|
243
251
|
#
|
244
|
-
# {https://developers.recurly.com/api/
|
252
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_account_acquisition get_account_acquisition api documenation}
|
245
253
|
#
|
246
254
|
# @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+.
|
247
|
-
# @param
|
255
|
+
# @param params [Hash] Optional query string parameters:
|
248
256
|
#
|
249
257
|
# @return [Resources::AccountAcquisition] An account's acquisition data.
|
250
258
|
# @example
|
@@ -264,11 +272,11 @@ module Recurly
|
|
264
272
|
|
265
273
|
# Update an account's acquisition data
|
266
274
|
#
|
267
|
-
# {https://developers.recurly.com/api/
|
275
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_account_acquisition update_account_acquisition api documenation}
|
268
276
|
#
|
269
277
|
# @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+.
|
270
|
-
# @param body [Requests::
|
271
|
-
# @param
|
278
|
+
# @param body [Requests::AccountAcquisitionUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountAcquisitionUpdate}
|
279
|
+
# @param params [Hash] Optional query string parameters:
|
272
280
|
#
|
273
281
|
# @return [Resources::AccountAcquisition] An account's updated acquisition data.
|
274
282
|
# @example
|
@@ -295,15 +303,15 @@ module Recurly
|
|
295
303
|
#
|
296
304
|
def update_account_acquisition(account_id:, body:, **options)
|
297
305
|
path = interpolate_path("/accounts/{account_id}/acquisition", account_id: account_id)
|
298
|
-
put(path, body, Requests::
|
306
|
+
put(path, body, Requests::AccountAcquisitionUpdate, **options)
|
299
307
|
end
|
300
308
|
|
301
309
|
# Remove an account's acquisition data
|
302
310
|
#
|
303
|
-
# {https://developers.recurly.com/api/
|
311
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_account_acquisition remove_account_acquisition api documenation}
|
304
312
|
#
|
305
313
|
# @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+.
|
306
|
-
# @param
|
314
|
+
# @param params [Hash] Optional query string parameters:
|
307
315
|
#
|
308
316
|
# @return [Resources::Empty] Acquisition data was succesfully deleted.
|
309
317
|
# @example
|
@@ -323,10 +331,10 @@ module Recurly
|
|
323
331
|
|
324
332
|
# Reactivate an inactive account
|
325
333
|
#
|
326
|
-
# {https://developers.recurly.com/api/
|
334
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_account reactivate_account api documenation}
|
327
335
|
#
|
328
336
|
# @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+.
|
329
|
-
# @param
|
337
|
+
# @param params [Hash] Optional query string parameters:
|
330
338
|
#
|
331
339
|
# @return [Resources::Account] An account.
|
332
340
|
# @example
|
@@ -346,10 +354,10 @@ module Recurly
|
|
346
354
|
|
347
355
|
# Fetch an account's balance and past due status
|
348
356
|
#
|
349
|
-
# {https://developers.recurly.com/api/
|
357
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_account_balance get_account_balance api documenation}
|
350
358
|
#
|
351
359
|
# @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+.
|
352
|
-
# @param
|
360
|
+
# @param params [Hash] Optional query string parameters:
|
353
361
|
#
|
354
362
|
# @return [Resources::AccountBalance] An account's balance.
|
355
363
|
# @example
|
@@ -369,10 +377,10 @@ module Recurly
|
|
369
377
|
|
370
378
|
# Fetch an account's billing information
|
371
379
|
#
|
372
|
-
# {https://developers.recurly.com/api/
|
380
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_billing_info get_billing_info api documenation}
|
373
381
|
#
|
374
382
|
# @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+.
|
375
|
-
# @param
|
383
|
+
# @param params [Hash] Optional query string parameters:
|
376
384
|
#
|
377
385
|
# @return [Resources::BillingInfo] An account's billing information.
|
378
386
|
# @example
|
@@ -392,11 +400,11 @@ module Recurly
|
|
392
400
|
|
393
401
|
# Set an account's billing information
|
394
402
|
#
|
395
|
-
# {https://developers.recurly.com/api/
|
403
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_billing_info update_billing_info api documenation}
|
396
404
|
#
|
397
405
|
# @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+.
|
398
406
|
# @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
|
399
|
-
# @param
|
407
|
+
# @param params [Hash] Optional query string parameters:
|
400
408
|
#
|
401
409
|
# @return [Resources::BillingInfo] Updated billing information.
|
402
410
|
# @example
|
@@ -423,10 +431,10 @@ module Recurly
|
|
423
431
|
|
424
432
|
# Remove an account's billing information
|
425
433
|
#
|
426
|
-
# {https://developers.recurly.com/api/
|
434
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_billing_info remove_billing_info api documenation}
|
427
435
|
#
|
428
436
|
# @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+.
|
429
|
-
# @param
|
437
|
+
# @param params [Hash] Optional query string parameters:
|
430
438
|
#
|
431
439
|
# @return [Resources::Empty] Billing information deleted
|
432
440
|
# @example
|
@@ -444,12 +452,37 @@ module Recurly
|
|
444
452
|
delete(path, **options)
|
445
453
|
end
|
446
454
|
|
455
|
+
# Verify an account's credit card billing information
|
456
|
+
#
|
457
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/verify_billing_info verify_billing_info api documenation}
|
458
|
+
#
|
459
|
+
# @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+.
|
460
|
+
# @param params [Hash] Optional query string parameters:
|
461
|
+
# :body [Requests::BillingInfoVerify] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoVerify}
|
462
|
+
#
|
463
|
+
# @return [Resources::Transaction] Transaction information from verify.
|
464
|
+
# @example
|
465
|
+
# begin
|
466
|
+
# transaction = @client.verify_billing_info(account_id: account_id)
|
467
|
+
# puts "Got Transaction #{transaction}"
|
468
|
+
# rescue Recurly::Errors::NotFoundError
|
469
|
+
# # If the resource was not found, you may want to alert the user or
|
470
|
+
# # just return nil
|
471
|
+
# puts "Resource Not Found"
|
472
|
+
# end
|
473
|
+
#
|
474
|
+
def verify_billing_info(account_id:, **options)
|
475
|
+
path = interpolate_path("/accounts/{account_id}/billing_info/verify", account_id: account_id)
|
476
|
+
post(path, options[:body], Requests::BillingInfoVerify, **options)
|
477
|
+
end
|
478
|
+
|
447
479
|
# Get the list of billing information associated with an account
|
448
480
|
#
|
449
|
-
# {https://developers.recurly.com/api/
|
481
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_billing_infos list_billing_infos api documenation}
|
450
482
|
#
|
451
483
|
# @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+.
|
452
|
-
# @param
|
484
|
+
# @param params [Hash] Optional query string parameters:
|
485
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
453
486
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
454
487
|
#
|
455
488
|
# *Important notes:*
|
@@ -461,17 +494,16 @@ module Recurly
|
|
461
494
|
# * Records are returned in an arbitrary order. Since results are all
|
462
495
|
# returned at once you can sort the records yourself.
|
463
496
|
#
|
464
|
-
#
|
497
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
465
498
|
# order. In descending order updated records will move behind the cursor and could
|
466
499
|
# prevent some records from being returned.
|
467
500
|
#
|
468
|
-
#
|
501
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
469
502
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
470
503
|
#
|
471
|
-
#
|
504
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
472
505
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
473
506
|
#
|
474
|
-
# @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+.
|
475
507
|
#
|
476
508
|
# @return [Pager<Resources::BillingInfo>] A list of the the billing information for an account's
|
477
509
|
#
|
@@ -480,13 +512,13 @@ module Recurly
|
|
480
512
|
pager(path, **options)
|
481
513
|
end
|
482
514
|
|
483
|
-
#
|
515
|
+
# Add new billing information on an account
|
484
516
|
#
|
485
|
-
# {https://developers.recurly.com/api/
|
517
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_billing_info create_billing_info api documenation}
|
486
518
|
#
|
487
519
|
# @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+.
|
488
520
|
# @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
|
489
|
-
# @param
|
521
|
+
# @param params [Hash] Optional query string parameters:
|
490
522
|
#
|
491
523
|
# @return [Resources::BillingInfo] Updated billing information.
|
492
524
|
#
|
@@ -497,11 +529,11 @@ module Recurly
|
|
497
529
|
|
498
530
|
# Fetch a billing info
|
499
531
|
#
|
500
|
-
# {https://developers.recurly.com/api/
|
532
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_a_billing_info get_a_billing_info api documenation}
|
501
533
|
#
|
502
534
|
# @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+.
|
503
535
|
# @param billing_info_id [String] Billing Info ID.
|
504
|
-
# @param
|
536
|
+
# @param params [Hash] Optional query string parameters:
|
505
537
|
#
|
506
538
|
# @return [Resources::BillingInfo] A billing info.
|
507
539
|
#
|
@@ -512,12 +544,12 @@ module Recurly
|
|
512
544
|
|
513
545
|
# Update an account's billing information
|
514
546
|
#
|
515
|
-
# {https://developers.recurly.com/api/
|
547
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_a_billing_info update_a_billing_info api documenation}
|
516
548
|
#
|
517
549
|
# @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+.
|
518
550
|
# @param billing_info_id [String] Billing Info ID.
|
519
551
|
# @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
|
520
|
-
# @param
|
552
|
+
# @param params [Hash] Optional query string parameters:
|
521
553
|
#
|
522
554
|
# @return [Resources::BillingInfo] Updated billing information.
|
523
555
|
#
|
@@ -528,11 +560,11 @@ module Recurly
|
|
528
560
|
|
529
561
|
# Remove an account's billing information
|
530
562
|
#
|
531
|
-
# {https://developers.recurly.com/api/
|
563
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_a_billing_info remove_a_billing_info api documenation}
|
532
564
|
#
|
533
565
|
# @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+.
|
534
566
|
# @param billing_info_id [String] Billing Info ID.
|
535
|
-
# @param
|
567
|
+
# @param params [Hash] Optional query string parameters:
|
536
568
|
#
|
537
569
|
# @return [Resources::Empty] Billing information deleted
|
538
570
|
#
|
@@ -543,10 +575,11 @@ module Recurly
|
|
543
575
|
|
544
576
|
# Show the coupon redemptions for an account
|
545
577
|
#
|
546
|
-
# {https://developers.recurly.com/api/
|
578
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_coupon_redemptions list_account_coupon_redemptions api documenation}
|
547
579
|
#
|
548
580
|
# @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+.
|
549
|
-
# @param
|
581
|
+
# @param params [Hash] Optional query string parameters:
|
582
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
550
583
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
551
584
|
#
|
552
585
|
# *Important notes:*
|
@@ -558,24 +591,26 @@ module Recurly
|
|
558
591
|
# * Records are returned in an arbitrary order. Since results are all
|
559
592
|
# returned at once you can sort the records yourself.
|
560
593
|
#
|
561
|
-
#
|
594
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
562
595
|
# order. In descending order updated records will move behind the cursor and could
|
563
596
|
# prevent some records from being returned.
|
564
597
|
#
|
565
|
-
#
|
598
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
566
599
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
567
600
|
#
|
568
|
-
#
|
601
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
569
602
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
570
603
|
#
|
571
|
-
#
|
572
|
-
# @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+.
|
604
|
+
# :state [String] Filter by state.
|
573
605
|
#
|
574
606
|
# @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on an account.
|
575
607
|
# @example
|
608
|
+
# params = {
|
609
|
+
# limit: 200
|
610
|
+
# }
|
576
611
|
# redemptions = @client.list_account_coupon_redemptions(
|
577
612
|
# account_id: account_id,
|
578
|
-
#
|
613
|
+
# params: params
|
579
614
|
# )
|
580
615
|
# redemptions.each do |redemption|
|
581
616
|
# puts "CouponRedemption: #{redemption.id}"
|
@@ -586,36 +621,35 @@ module Recurly
|
|
586
621
|
pager(path, **options)
|
587
622
|
end
|
588
623
|
|
589
|
-
# Show the coupon
|
624
|
+
# Show the coupon redemptions that are active on an account
|
590
625
|
#
|
591
|
-
# {https://developers.recurly.com/api/
|
626
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_active_coupon_redemptions list_active_coupon_redemptions api documenation}
|
592
627
|
#
|
593
628
|
# @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+.
|
594
|
-
# @param
|
629
|
+
# @param params [Hash] Optional query string parameters:
|
595
630
|
#
|
596
|
-
# @return [Resources::CouponRedemption]
|
631
|
+
# @return [Pager<Resources::CouponRedemption>] Active coupon redemptions on an account.
|
597
632
|
# @example
|
598
|
-
#
|
599
|
-
#
|
600
|
-
#
|
601
|
-
#
|
602
|
-
#
|
603
|
-
#
|
604
|
-
# puts "Resource Not Found"
|
633
|
+
# params = {
|
634
|
+
# limit: 200
|
635
|
+
# }
|
636
|
+
# redemptions = @client.list_active_coupon_redemptions(account_id: account_id, params: params)
|
637
|
+
# redemptions.each do |redemption|
|
638
|
+
# puts "Redemption: #{redemption.id}"
|
605
639
|
# end
|
606
640
|
#
|
607
|
-
def
|
641
|
+
def list_active_coupon_redemptions(account_id:, **options)
|
608
642
|
path = interpolate_path("/accounts/{account_id}/coupon_redemptions/active", account_id: account_id)
|
609
|
-
|
643
|
+
pager(path, **options)
|
610
644
|
end
|
611
645
|
|
612
646
|
# Generate an active coupon redemption on an account or subscription
|
613
647
|
#
|
614
|
-
# {https://developers.recurly.com/api/
|
648
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_coupon_redemption create_coupon_redemption api documenation}
|
615
649
|
#
|
616
650
|
# @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+.
|
617
651
|
# @param body [Requests::CouponRedemptionCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponRedemptionCreate}
|
618
|
-
# @param
|
652
|
+
# @param params [Hash] Optional query string parameters:
|
619
653
|
#
|
620
654
|
# @return [Resources::CouponRedemption] Returns the new coupon redemption.
|
621
655
|
# @example
|
@@ -642,10 +676,10 @@ module Recurly
|
|
642
676
|
|
643
677
|
# Delete the active coupon redemption from an account
|
644
678
|
#
|
645
|
-
# {https://developers.recurly.com/api/
|
679
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_coupon_redemption remove_coupon_redemption api documenation}
|
646
680
|
#
|
647
681
|
# @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+.
|
648
|
-
# @param
|
682
|
+
# @param params [Hash] Optional query string parameters:
|
649
683
|
#
|
650
684
|
# @return [Resources::CouponRedemption] Coupon redemption deleted.
|
651
685
|
# @example
|
@@ -665,28 +699,31 @@ module Recurly
|
|
665
699
|
|
666
700
|
# List an account's credit payments
|
667
701
|
#
|
668
|
-
# {https://developers.recurly.com/api/
|
702
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_credit_payments list_account_credit_payments api documenation}
|
669
703
|
#
|
670
704
|
# @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+.
|
671
|
-
# @param
|
672
|
-
#
|
673
|
-
#
|
705
|
+
# @param params [Hash] Optional query string parameters:
|
706
|
+
# :limit [Integer] Limit number of records 1-200.
|
707
|
+
# :order [String] Sort order.
|
708
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
674
709
|
# order. In descending order updated records will move behind the cursor and could
|
675
710
|
# prevent some records from being returned.
|
676
711
|
#
|
677
|
-
#
|
712
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
678
713
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
679
714
|
#
|
680
|
-
#
|
715
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
681
716
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
682
717
|
#
|
683
|
-
# @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+.
|
684
718
|
#
|
685
719
|
# @return [Pager<Resources::CreditPayment>] A list of the account's credit payments.
|
686
720
|
# @example
|
721
|
+
# params = {
|
722
|
+
# limit: 200
|
723
|
+
# }
|
687
724
|
# payments = @client.list_account_credit_payments(
|
688
725
|
# account_id: account_id,
|
689
|
-
#
|
726
|
+
# params: params
|
690
727
|
# )
|
691
728
|
# payments.each do |payment|
|
692
729
|
# puts "CreditPayment: #{payment.id}"
|
@@ -699,10 +736,11 @@ module Recurly
|
|
699
736
|
|
700
737
|
# List an account's invoices
|
701
738
|
#
|
702
|
-
# {https://developers.recurly.com/api/
|
739
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_invoices list_account_invoices api documenation}
|
703
740
|
#
|
704
741
|
# @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+.
|
705
|
-
# @param
|
742
|
+
# @param params [Hash] Optional query string parameters:
|
743
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
706
744
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
707
745
|
#
|
708
746
|
# *Important notes:*
|
@@ -714,31 +752,33 @@ module Recurly
|
|
714
752
|
# * Records are returned in an arbitrary order. Since results are all
|
715
753
|
# returned at once you can sort the records yourself.
|
716
754
|
#
|
717
|
-
#
|
718
|
-
#
|
719
|
-
#
|
755
|
+
# :limit [Integer] Limit number of records 1-200.
|
756
|
+
# :order [String] Sort order.
|
757
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
720
758
|
# order. In descending order updated records will move behind the cursor and could
|
721
759
|
# prevent some records from being returned.
|
722
760
|
#
|
723
|
-
#
|
761
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
724
762
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
725
763
|
#
|
726
|
-
#
|
764
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
727
765
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
728
766
|
#
|
729
|
-
#
|
767
|
+
# :type [String] Filter by type when:
|
730
768
|
# - +type=charge+, only charge invoices will be returned.
|
731
769
|
# - +type=credit+, only credit invoices will be returned.
|
732
770
|
# - +type=non-legacy+, only charge and credit invoices will be returned.
|
733
771
|
# - +type=legacy+, only legacy invoices will be returned.
|
734
772
|
#
|
735
|
-
# @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+.
|
736
773
|
#
|
737
774
|
# @return [Pager<Resources::Invoice>] A list of the account's invoices.
|
738
775
|
# @example
|
776
|
+
# params = {
|
777
|
+
# limit: 200
|
778
|
+
# }
|
739
779
|
# invoices = @client.list_account_invoices(
|
740
780
|
# account_id: account_id,
|
741
|
-
#
|
781
|
+
# params: params
|
742
782
|
# )
|
743
783
|
# invoices.each do |invoice|
|
744
784
|
# puts "Invoice: #{invoice.number}"
|
@@ -751,11 +791,11 @@ module Recurly
|
|
751
791
|
|
752
792
|
# Create an invoice for pending line items
|
753
793
|
#
|
754
|
-
# {https://developers.recurly.com/api/
|
794
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_invoice create_invoice api documenation}
|
755
795
|
#
|
756
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+.
|
757
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}
|
758
|
-
# @param
|
798
|
+
# @param params [Hash] Optional query string parameters:
|
759
799
|
#
|
760
800
|
# @return [Resources::InvoiceCollection] Returns the new invoices.
|
761
801
|
# @example
|
@@ -782,11 +822,11 @@ module Recurly
|
|
782
822
|
|
783
823
|
# Preview new invoice for pending line items
|
784
824
|
#
|
785
|
-
# {https://developers.recurly.com/api/
|
825
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/preview_invoice preview_invoice api documenation}
|
786
826
|
#
|
787
827
|
# @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+.
|
788
828
|
# @param body [Requests::InvoiceCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCreate}
|
789
|
-
# @param
|
829
|
+
# @param params [Hash] Optional query string parameters:
|
790
830
|
#
|
791
831
|
# @return [Resources::InvoiceCollection] Returns the invoice previews.
|
792
832
|
# @example
|
@@ -813,10 +853,11 @@ module Recurly
|
|
813
853
|
|
814
854
|
# List an account's line items
|
815
855
|
#
|
816
|
-
# {https://developers.recurly.com/api/
|
856
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_line_items list_account_line_items api documenation}
|
817
857
|
#
|
818
858
|
# @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+.
|
819
|
-
# @param
|
859
|
+
# @param params [Hash] Optional query string parameters:
|
860
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
820
861
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
821
862
|
#
|
822
863
|
# *Important notes:*
|
@@ -828,28 +869,30 @@ module Recurly
|
|
828
869
|
# * Records are returned in an arbitrary order. Since results are all
|
829
870
|
# returned at once you can sort the records yourself.
|
830
871
|
#
|
831
|
-
#
|
832
|
-
#
|
833
|
-
#
|
872
|
+
# :limit [Integer] Limit number of records 1-200.
|
873
|
+
# :order [String] Sort order.
|
874
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
834
875
|
# order. In descending order updated records will move behind the cursor and could
|
835
876
|
# prevent some records from being returned.
|
836
877
|
#
|
837
|
-
#
|
878
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
838
879
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
839
880
|
#
|
840
|
-
#
|
881
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
841
882
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
842
883
|
#
|
843
|
-
#
|
844
|
-
#
|
845
|
-
#
|
846
|
-
# @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+.
|
884
|
+
# :original [String] Filter by original field.
|
885
|
+
# :state [String] Filter by state field.
|
886
|
+
# :type [String] Filter by type field.
|
847
887
|
#
|
848
888
|
# @return [Pager<Resources::LineItem>] A list of the account's line items.
|
849
889
|
# @example
|
890
|
+
# params = {
|
891
|
+
# limit: 200
|
892
|
+
# }
|
850
893
|
# line_items = @client.list_account_line_items(
|
851
894
|
# account_id: account_id,
|
852
|
-
#
|
895
|
+
# params: params
|
853
896
|
# )
|
854
897
|
# line_items.each do |line_item|
|
855
898
|
# puts "LineItem: #{line_item.id}"
|
@@ -862,11 +905,11 @@ module Recurly
|
|
862
905
|
|
863
906
|
# Create a new line item for the account
|
864
907
|
#
|
865
|
-
# {https://developers.recurly.com/api/
|
908
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_line_item create_line_item api documenation}
|
866
909
|
#
|
867
910
|
# @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+.
|
868
911
|
# @param body [Requests::LineItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::LineItemCreate}
|
869
|
-
# @param
|
912
|
+
# @param params [Hash] Optional query string parameters:
|
870
913
|
#
|
871
914
|
# @return [Resources::LineItem] Returns the new line item.
|
872
915
|
# @example
|
@@ -894,10 +937,11 @@ module Recurly
|
|
894
937
|
|
895
938
|
# Fetch a list of an account's notes
|
896
939
|
#
|
897
|
-
# {https://developers.recurly.com/api/
|
940
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_notes list_account_notes api documenation}
|
898
941
|
#
|
899
942
|
# @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+.
|
900
|
-
# @param
|
943
|
+
# @param params [Hash] Optional query string parameters:
|
944
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
901
945
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
902
946
|
#
|
903
947
|
# *Important notes:*
|
@@ -909,11 +953,13 @@ module Recurly
|
|
909
953
|
# * Records are returned in an arbitrary order. Since results are all
|
910
954
|
# returned at once you can sort the records yourself.
|
911
955
|
#
|
912
|
-
# @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+.
|
913
956
|
#
|
914
957
|
# @return [Pager<Resources::AccountNote>] A list of an account's notes.
|
915
958
|
# @example
|
916
|
-
#
|
959
|
+
# params = {
|
960
|
+
# limit: 200
|
961
|
+
# }
|
962
|
+
# account_notes = @client.list_account_notes(account_id: account_id, params: params)
|
917
963
|
# account_notes.each do |note|
|
918
964
|
# puts "AccountNote: #{note.message}"
|
919
965
|
# end
|
@@ -925,11 +971,11 @@ module Recurly
|
|
925
971
|
|
926
972
|
# Fetch an account note
|
927
973
|
#
|
928
|
-
# {https://developers.recurly.com/api/
|
974
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_account_note get_account_note api documenation}
|
929
975
|
#
|
930
976
|
# @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+.
|
931
977
|
# @param account_note_id [String] Account Note ID.
|
932
|
-
# @param
|
978
|
+
# @param params [Hash] Optional query string parameters:
|
933
979
|
#
|
934
980
|
# @return [Resources::AccountNote] An account note.
|
935
981
|
# @example
|
@@ -952,10 +998,11 @@ module Recurly
|
|
952
998
|
|
953
999
|
# Fetch a list of an account's shipping addresses
|
954
1000
|
#
|
955
|
-
# {https://developers.recurly.com/api/
|
1001
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_shipping_addresses list_shipping_addresses api documenation}
|
956
1002
|
#
|
957
1003
|
# @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+.
|
958
|
-
# @param
|
1004
|
+
# @param params [Hash] Optional query string parameters:
|
1005
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
959
1006
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
960
1007
|
#
|
961
1008
|
# *Important notes:*
|
@@ -967,25 +1014,27 @@ module Recurly
|
|
967
1014
|
# * Records are returned in an arbitrary order. Since results are all
|
968
1015
|
# returned at once you can sort the records yourself.
|
969
1016
|
#
|
970
|
-
#
|
971
|
-
#
|
972
|
-
#
|
1017
|
+
# :limit [Integer] Limit number of records 1-200.
|
1018
|
+
# :order [String] Sort order.
|
1019
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
973
1020
|
# order. In descending order updated records will move behind the cursor and could
|
974
1021
|
# prevent some records from being returned.
|
975
1022
|
#
|
976
|
-
#
|
1023
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
977
1024
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
978
1025
|
#
|
979
|
-
#
|
1026
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
980
1027
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
981
1028
|
#
|
982
|
-
# @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+.
|
983
1029
|
#
|
984
1030
|
# @return [Pager<Resources::ShippingAddress>] A list of an account's shipping addresses.
|
985
1031
|
# @example
|
1032
|
+
# params = {
|
1033
|
+
# limit: 200
|
1034
|
+
# }
|
986
1035
|
# shipping_addresses = @client.list_shipping_addresses(
|
987
1036
|
# account_id: account_id,
|
988
|
-
#
|
1037
|
+
# params: params
|
989
1038
|
# )
|
990
1039
|
# shipping_addresses.each do |addr|
|
991
1040
|
# puts "ShippingAddress: #{addr.nickname} - #{addr.street1}"
|
@@ -998,11 +1047,11 @@ module Recurly
|
|
998
1047
|
|
999
1048
|
# Create a new shipping address for the account
|
1000
1049
|
#
|
1001
|
-
# {https://developers.recurly.com/api/
|
1050
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_shipping_address create_shipping_address api documenation}
|
1002
1051
|
#
|
1003
1052
|
# @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
1053
|
# @param body [Requests::ShippingAddressCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressCreate}
|
1005
|
-
# @param
|
1054
|
+
# @param params [Hash] Optional query string parameters:
|
1006
1055
|
#
|
1007
1056
|
# @return [Resources::ShippingAddress] Returns the new shipping address.
|
1008
1057
|
# @example
|
@@ -1032,11 +1081,11 @@ module Recurly
|
|
1032
1081
|
|
1033
1082
|
# Fetch an account's shipping address
|
1034
1083
|
#
|
1035
|
-
# {https://developers.recurly.com/api/
|
1084
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_shipping_address get_shipping_address api documenation}
|
1036
1085
|
#
|
1037
1086
|
# @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+.
|
1038
1087
|
# @param shipping_address_id [String] Shipping Address ID.
|
1039
|
-
# @param
|
1088
|
+
# @param params [Hash] Optional query string parameters:
|
1040
1089
|
#
|
1041
1090
|
# @return [Resources::ShippingAddress] A shipping address.
|
1042
1091
|
# @example
|
@@ -1059,12 +1108,12 @@ module Recurly
|
|
1059
1108
|
|
1060
1109
|
# Update an account's shipping address
|
1061
1110
|
#
|
1062
|
-
# {https://developers.recurly.com/api/
|
1111
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_shipping_address update_shipping_address api documenation}
|
1063
1112
|
#
|
1064
1113
|
# @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+.
|
1065
1114
|
# @param shipping_address_id [String] Shipping Address ID.
|
1066
1115
|
# @param body [Requests::ShippingAddressUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressUpdate}
|
1067
|
-
# @param
|
1116
|
+
# @param params [Hash] Optional query string parameters:
|
1068
1117
|
#
|
1069
1118
|
# @return [Resources::ShippingAddress] The updated shipping address.
|
1070
1119
|
# @example
|
@@ -1093,11 +1142,11 @@ module Recurly
|
|
1093
1142
|
|
1094
1143
|
# Remove an account's shipping address
|
1095
1144
|
#
|
1096
|
-
# {https://developers.recurly.com/api/
|
1145
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_shipping_address remove_shipping_address api documenation}
|
1097
1146
|
#
|
1098
1147
|
# @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+.
|
1099
1148
|
# @param shipping_address_id [String] Shipping Address ID.
|
1100
|
-
# @param
|
1149
|
+
# @param params [Hash] Optional query string parameters:
|
1101
1150
|
#
|
1102
1151
|
# @return [Resources::Empty] Shipping address deleted.
|
1103
1152
|
# @example
|
@@ -1120,10 +1169,11 @@ module Recurly
|
|
1120
1169
|
|
1121
1170
|
# List an account's subscriptions
|
1122
1171
|
#
|
1123
|
-
# {https://developers.recurly.com/api/
|
1172
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_subscriptions list_account_subscriptions api documenation}
|
1124
1173
|
#
|
1125
1174
|
# @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+.
|
1126
|
-
# @param
|
1175
|
+
# @param params [Hash] Optional query string parameters:
|
1176
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1127
1177
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1128
1178
|
#
|
1129
1179
|
# *Important notes:*
|
@@ -1135,31 +1185,33 @@ module Recurly
|
|
1135
1185
|
# * Records are returned in an arbitrary order. Since results are all
|
1136
1186
|
# returned at once you can sort the records yourself.
|
1137
1187
|
#
|
1138
|
-
#
|
1139
|
-
#
|
1140
|
-
#
|
1188
|
+
# :limit [Integer] Limit number of records 1-200.
|
1189
|
+
# :order [String] Sort order.
|
1190
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1141
1191
|
# order. In descending order updated records will move behind the cursor and could
|
1142
1192
|
# prevent some records from being returned.
|
1143
1193
|
#
|
1144
|
-
#
|
1194
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1145
1195
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1146
1196
|
#
|
1147
|
-
#
|
1197
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1148
1198
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1149
1199
|
#
|
1150
|
-
#
|
1200
|
+
# :state [String] Filter by state.
|
1151
1201
|
#
|
1152
1202
|
# - When +state=active+, +state=canceled+, +state=expired+, or +state=future+, subscriptions with states that match the query and only those subscriptions will be returned.
|
1153
1203
|
# - 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.
|
1154
1204
|
# - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
|
1155
1205
|
#
|
1156
|
-
# @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+.
|
1157
1206
|
#
|
1158
1207
|
# @return [Pager<Resources::Subscription>] A list of the account's subscriptions.
|
1159
1208
|
# @example
|
1209
|
+
# params = {
|
1210
|
+
# limit: 200
|
1211
|
+
# }
|
1160
1212
|
# subscriptions = @client.list_account_subscriptions(
|
1161
1213
|
# account_id: account_id,
|
1162
|
-
#
|
1214
|
+
# params: params
|
1163
1215
|
# )
|
1164
1216
|
# subscriptions.each do |subscription|
|
1165
1217
|
# puts "Subscription: #{subscription.uuid}"
|
@@ -1172,10 +1224,11 @@ module Recurly
|
|
1172
1224
|
|
1173
1225
|
# List an account's transactions
|
1174
1226
|
#
|
1175
|
-
# {https://developers.recurly.com/api/
|
1227
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_transactions list_account_transactions api documenation}
|
1176
1228
|
#
|
1177
1229
|
# @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+.
|
1178
|
-
# @param
|
1230
|
+
# @param params [Hash] Optional query string parameters:
|
1231
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1179
1232
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1180
1233
|
#
|
1181
1234
|
# *Important notes:*
|
@@ -1187,27 +1240,29 @@ module Recurly
|
|
1187
1240
|
# * Records are returned in an arbitrary order. Since results are all
|
1188
1241
|
# returned at once you can sort the records yourself.
|
1189
1242
|
#
|
1190
|
-
#
|
1191
|
-
#
|
1192
|
-
#
|
1243
|
+
# :limit [Integer] Limit number of records 1-200.
|
1244
|
+
# :order [String] Sort order.
|
1245
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1193
1246
|
# order. In descending order updated records will move behind the cursor and could
|
1194
1247
|
# prevent some records from being returned.
|
1195
1248
|
#
|
1196
|
-
#
|
1249
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1197
1250
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1198
1251
|
#
|
1199
|
-
#
|
1252
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1200
1253
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1201
1254
|
#
|
1202
|
-
#
|
1203
|
-
#
|
1204
|
-
# @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+.
|
1255
|
+
# :type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions.
|
1256
|
+
# :success [String] Filter by success field.
|
1205
1257
|
#
|
1206
1258
|
# @return [Pager<Resources::Transaction>] A list of the account's transactions.
|
1207
1259
|
# @example
|
1260
|
+
# params = {
|
1261
|
+
# limit: 200
|
1262
|
+
# }
|
1208
1263
|
# transactions = @client.list_account_transactions(
|
1209
1264
|
# account_id: account_id,
|
1210
|
-
#
|
1265
|
+
# params: params
|
1211
1266
|
# )
|
1212
1267
|
# transactions.each do |transaction|
|
1213
1268
|
# puts "Transaction: #{transaction.uuid}"
|
@@ -1220,10 +1275,11 @@ module Recurly
|
|
1220
1275
|
|
1221
1276
|
# List an account's child accounts
|
1222
1277
|
#
|
1223
|
-
# {https://developers.recurly.com/api/
|
1278
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_child_accounts list_child_accounts api documenation}
|
1224
1279
|
#
|
1225
1280
|
# @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+.
|
1226
|
-
# @param
|
1281
|
+
# @param params [Hash] Optional query string parameters:
|
1282
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1227
1283
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1228
1284
|
#
|
1229
1285
|
# *Important notes:*
|
@@ -1235,30 +1291,32 @@ module Recurly
|
|
1235
1291
|
# * Records are returned in an arbitrary order. Since results are all
|
1236
1292
|
# returned at once you can sort the records yourself.
|
1237
1293
|
#
|
1238
|
-
#
|
1239
|
-
#
|
1240
|
-
#
|
1294
|
+
# :limit [Integer] Limit number of records 1-200.
|
1295
|
+
# :order [String] Sort order.
|
1296
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1241
1297
|
# order. In descending order updated records will move behind the cursor and could
|
1242
1298
|
# prevent some records from being returned.
|
1243
1299
|
#
|
1244
|
-
#
|
1300
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1245
1301
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1246
1302
|
#
|
1247
|
-
#
|
1303
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1248
1304
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1249
1305
|
#
|
1250
|
-
#
|
1251
|
-
#
|
1306
|
+
# :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.
|
1307
|
+
# :subscriber [Boolean] Filter for accounts with or without a subscription in the +active+,
|
1252
1308
|
# +canceled+, or +future+ state.
|
1253
1309
|
#
|
1254
|
-
#
|
1255
|
-
# @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+.
|
1310
|
+
# :past_due [String] Filter for accounts with an invoice in the +past_due+ state.
|
1256
1311
|
#
|
1257
1312
|
# @return [Pager<Resources::Account>] A list of an account's child accounts.
|
1258
1313
|
# @example
|
1314
|
+
# params = {
|
1315
|
+
# limit: 200
|
1316
|
+
# }
|
1259
1317
|
# child_accounts = @client.list_child_accounts(
|
1260
1318
|
# account_id: account_id,
|
1261
|
-
#
|
1319
|
+
# params: params
|
1262
1320
|
# )
|
1263
1321
|
# child_accounts.each do |child|
|
1264
1322
|
# puts "Account: #{child.code}"
|
@@ -1271,9 +1329,10 @@ module Recurly
|
|
1271
1329
|
|
1272
1330
|
# List a site's account acquisition data
|
1273
1331
|
#
|
1274
|
-
# {https://developers.recurly.com/api/
|
1332
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_acquisition list_account_acquisition api documenation}
|
1275
1333
|
#
|
1276
|
-
# @param
|
1334
|
+
# @param params [Hash] Optional query string parameters:
|
1335
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1277
1336
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1278
1337
|
#
|
1279
1338
|
# *Important notes:*
|
@@ -1285,37 +1344,40 @@ module Recurly
|
|
1285
1344
|
# * Records are returned in an arbitrary order. Since results are all
|
1286
1345
|
# returned at once you can sort the records yourself.
|
1287
1346
|
#
|
1288
|
-
#
|
1289
|
-
#
|
1290
|
-
#
|
1347
|
+
# :limit [Integer] Limit number of records 1-200.
|
1348
|
+
# :order [String] Sort order.
|
1349
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1291
1350
|
# order. In descending order updated records will move behind the cursor and could
|
1292
1351
|
# prevent some records from being returned.
|
1293
1352
|
#
|
1294
|
-
#
|
1353
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1295
1354
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1296
1355
|
#
|
1297
|
-
#
|
1356
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1298
1357
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1299
1358
|
#
|
1300
|
-
# @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+.
|
1301
1359
|
#
|
1302
1360
|
# @return [Pager<Resources::AccountAcquisition>] A list of the site's account acquisition data.
|
1303
1361
|
# @example
|
1304
|
-
#
|
1362
|
+
# params = {
|
1363
|
+
# limit: 200
|
1364
|
+
# }
|
1365
|
+
# acquisitions = @client.list_account_acquisition(params: params)
|
1305
1366
|
# acquisitions.each do |acquisition|
|
1306
1367
|
# puts "AccountAcquisition: #{acquisition.cost}"
|
1307
1368
|
# end
|
1308
1369
|
#
|
1309
1370
|
def list_account_acquisition(**options)
|
1310
|
-
path =
|
1371
|
+
path = "/acquisitions"
|
1311
1372
|
pager(path, **options)
|
1312
1373
|
end
|
1313
1374
|
|
1314
1375
|
# List a site's coupons
|
1315
1376
|
#
|
1316
|
-
# {https://developers.recurly.com/api/
|
1377
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_coupons list_coupons api documenation}
|
1317
1378
|
#
|
1318
|
-
# @param
|
1379
|
+
# @param params [Hash] Optional query string parameters:
|
1380
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1319
1381
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1320
1382
|
#
|
1321
1383
|
# *Important notes:*
|
@@ -1327,38 +1389,40 @@ module Recurly
|
|
1327
1389
|
# * Records are returned in an arbitrary order. Since results are all
|
1328
1390
|
# returned at once you can sort the records yourself.
|
1329
1391
|
#
|
1330
|
-
#
|
1331
|
-
#
|
1332
|
-
#
|
1392
|
+
# :limit [Integer] Limit number of records 1-200.
|
1393
|
+
# :order [String] Sort order.
|
1394
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1333
1395
|
# order. In descending order updated records will move behind the cursor and could
|
1334
1396
|
# prevent some records from being returned.
|
1335
1397
|
#
|
1336
|
-
#
|
1398
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1337
1399
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1338
1400
|
#
|
1339
|
-
#
|
1401
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1340
1402
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1341
1403
|
#
|
1342
|
-
# @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+.
|
1343
1404
|
#
|
1344
1405
|
# @return [Pager<Resources::Coupon>] A list of the site's coupons.
|
1345
1406
|
# @example
|
1346
|
-
#
|
1407
|
+
# params = {
|
1408
|
+
# limit: 200
|
1409
|
+
# }
|
1410
|
+
# coupons = @client.list_coupons(params: params)
|
1347
1411
|
# coupons.each do |coupon|
|
1348
1412
|
# puts "coupon: #{coupon.code}"
|
1349
1413
|
# end
|
1350
1414
|
#
|
1351
1415
|
def list_coupons(**options)
|
1352
|
-
path =
|
1416
|
+
path = "/coupons"
|
1353
1417
|
pager(path, **options)
|
1354
1418
|
end
|
1355
1419
|
|
1356
1420
|
# Create a new coupon
|
1357
1421
|
#
|
1358
|
-
# {https://developers.recurly.com/api/
|
1422
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_coupon create_coupon api documenation}
|
1359
1423
|
#
|
1360
1424
|
# @param body [Requests::CouponCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponCreate}
|
1361
|
-
# @param
|
1425
|
+
# @param params [Hash] Optional query string parameters:
|
1362
1426
|
#
|
1363
1427
|
# @return [Resources::Coupon] A new coupon.
|
1364
1428
|
# @example
|
@@ -1385,16 +1449,16 @@ module Recurly
|
|
1385
1449
|
# end
|
1386
1450
|
#
|
1387
1451
|
def create_coupon(body:, **options)
|
1388
|
-
path =
|
1452
|
+
path = "/coupons"
|
1389
1453
|
post(path, body, Requests::CouponCreate, **options)
|
1390
1454
|
end
|
1391
1455
|
|
1392
1456
|
# Fetch a coupon
|
1393
1457
|
#
|
1394
|
-
# {https://developers.recurly.com/api/
|
1458
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_coupon get_coupon api documenation}
|
1395
1459
|
#
|
1396
1460
|
# @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+.
|
1397
|
-
# @param
|
1461
|
+
# @param params [Hash] Optional query string parameters:
|
1398
1462
|
#
|
1399
1463
|
# @return [Resources::Coupon] A coupon.
|
1400
1464
|
# @example
|
@@ -1414,11 +1478,11 @@ module Recurly
|
|
1414
1478
|
|
1415
1479
|
# Update an active coupon
|
1416
1480
|
#
|
1417
|
-
# {https://developers.recurly.com/api/
|
1481
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_coupon update_coupon api documenation}
|
1418
1482
|
#
|
1419
1483
|
# @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+.
|
1420
1484
|
# @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
|
1421
|
-
# @param
|
1485
|
+
# @param params [Hash] Optional query string parameters:
|
1422
1486
|
#
|
1423
1487
|
# @return [Resources::Coupon] The updated coupon.
|
1424
1488
|
# @example
|
@@ -1441,10 +1505,10 @@ module Recurly
|
|
1441
1505
|
|
1442
1506
|
# Expire a coupon
|
1443
1507
|
#
|
1444
|
-
# {https://developers.recurly.com/api/
|
1508
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_coupon deactivate_coupon api documenation}
|
1445
1509
|
#
|
1446
1510
|
# @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+.
|
1447
|
-
# @param
|
1511
|
+
# @param params [Hash] Optional query string parameters:
|
1448
1512
|
#
|
1449
1513
|
# @return [Resources::Coupon] The expired Coupon
|
1450
1514
|
# @example
|
@@ -1462,26 +1526,30 @@ module Recurly
|
|
1462
1526
|
delete(path, **options)
|
1463
1527
|
end
|
1464
1528
|
|
1529
|
+
# Generate unique coupon codes
|
1530
|
+
#
|
1531
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/generate_unique_coupon_codes generate_unique_coupon_codes api documenation}
|
1532
|
+
#
|
1533
|
+
# @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+.
|
1534
|
+
# @param body [Requests::CouponBulkCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponBulkCreate}
|
1535
|
+
# @param params [Hash] Optional query string parameters:
|
1536
|
+
#
|
1537
|
+
# @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`.
|
1538
|
+
#
|
1539
|
+
def generate_unique_coupon_codes(coupon_id:, body:, **options)
|
1540
|
+
path = interpolate_path("/coupons/{coupon_id}/generate", coupon_id: coupon_id)
|
1541
|
+
post(path, body, Requests::CouponBulkCreate, **options)
|
1542
|
+
end
|
1543
|
+
|
1465
1544
|
# Restore an inactive coupon
|
1466
1545
|
#
|
1467
|
-
# {https://developers.recurly.com/api/
|
1546
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/restore_coupon restore_coupon api documenation}
|
1468
1547
|
#
|
1469
1548
|
# @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
1549
|
# @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
|
1471
|
-
# @param
|
1550
|
+
# @param params [Hash] Optional query string parameters:
|
1472
1551
|
#
|
1473
1552
|
# @return [Resources::Coupon] The restored coupon.
|
1474
|
-
# @example
|
1475
|
-
# begin
|
1476
|
-
# coupon = @client.restore_coupon(coupon_id: coupon_id, body: {
|
1477
|
-
# name: "New Coupon Name"
|
1478
|
-
# })
|
1479
|
-
# puts "Restored coupon #{coupon}"
|
1480
|
-
# rescue Recurly::Errors::NotFoundError
|
1481
|
-
# # If the resource was not found, you may want to alert the user or
|
1482
|
-
# # just return nil
|
1483
|
-
# puts "Resource Not Found"
|
1484
|
-
# end
|
1485
1553
|
#
|
1486
1554
|
def restore_coupon(coupon_id:, body:, **options)
|
1487
1555
|
path = interpolate_path("/coupons/{coupon_id}/restore", coupon_id: coupon_id)
|
@@ -1490,10 +1558,11 @@ module Recurly
|
|
1490
1558
|
|
1491
1559
|
# List unique coupon codes associated with a bulk coupon
|
1492
1560
|
#
|
1493
|
-
# {https://developers.recurly.com/api/
|
1561
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_unique_coupon_codes list_unique_coupon_codes api documenation}
|
1494
1562
|
#
|
1495
1563
|
# @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+.
|
1496
|
-
# @param
|
1564
|
+
# @param params [Hash] Optional query string parameters:
|
1565
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1497
1566
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1498
1567
|
#
|
1499
1568
|
# *Important notes:*
|
@@ -1505,19 +1574,18 @@ module Recurly
|
|
1505
1574
|
# * Records are returned in an arbitrary order. Since results are all
|
1506
1575
|
# returned at once you can sort the records yourself.
|
1507
1576
|
#
|
1508
|
-
#
|
1509
|
-
#
|
1510
|
-
#
|
1577
|
+
# :limit [Integer] Limit number of records 1-200.
|
1578
|
+
# :order [String] Sort order.
|
1579
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1511
1580
|
# order. In descending order updated records will move behind the cursor and could
|
1512
1581
|
# prevent some records from being returned.
|
1513
1582
|
#
|
1514
|
-
#
|
1583
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1515
1584
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1516
1585
|
#
|
1517
|
-
#
|
1586
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1518
1587
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1519
1588
|
#
|
1520
|
-
# @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+.
|
1521
1589
|
#
|
1522
1590
|
# @return [Pager<Resources::UniqueCouponCode>] A list of unique coupon codes that were generated
|
1523
1591
|
#
|
@@ -1528,40 +1596,43 @@ module Recurly
|
|
1528
1596
|
|
1529
1597
|
# List a site's credit payments
|
1530
1598
|
#
|
1531
|
-
# {https://developers.recurly.com/api/
|
1599
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_credit_payments list_credit_payments api documenation}
|
1532
1600
|
#
|
1533
|
-
# @param
|
1534
|
-
#
|
1535
|
-
#
|
1601
|
+
# @param params [Hash] Optional query string parameters:
|
1602
|
+
# :limit [Integer] Limit number of records 1-200.
|
1603
|
+
# :order [String] Sort order.
|
1604
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1536
1605
|
# order. In descending order updated records will move behind the cursor and could
|
1537
1606
|
# prevent some records from being returned.
|
1538
1607
|
#
|
1539
|
-
#
|
1608
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1540
1609
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1541
1610
|
#
|
1542
|
-
#
|
1611
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1543
1612
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1544
1613
|
#
|
1545
|
-
# @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+.
|
1546
1614
|
#
|
1547
1615
|
# @return [Pager<Resources::CreditPayment>] A list of the site's credit payments.
|
1548
1616
|
# @example
|
1549
|
-
#
|
1617
|
+
# params = {
|
1618
|
+
# limit: 200
|
1619
|
+
# }
|
1620
|
+
# payments = @client.list_credit_payments(params: params)
|
1550
1621
|
# payments.each do |payment|
|
1551
1622
|
# puts "CreditPayment: #{payment.id}"
|
1552
1623
|
# end
|
1553
1624
|
#
|
1554
1625
|
def list_credit_payments(**options)
|
1555
|
-
path =
|
1626
|
+
path = "/credit_payments"
|
1556
1627
|
pager(path, **options)
|
1557
1628
|
end
|
1558
1629
|
|
1559
1630
|
# Fetch a credit payment
|
1560
1631
|
#
|
1561
|
-
# {https://developers.recurly.com/api/
|
1632
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_credit_payment get_credit_payment api documenation}
|
1562
1633
|
#
|
1563
1634
|
# @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+.
|
1564
|
-
# @param
|
1635
|
+
# @param params [Hash] Optional query string parameters:
|
1565
1636
|
#
|
1566
1637
|
# @return [Resources::CreditPayment] A credit payment.
|
1567
1638
|
#
|
@@ -1572,9 +1643,10 @@ module Recurly
|
|
1572
1643
|
|
1573
1644
|
# List a site's custom field definitions
|
1574
1645
|
#
|
1575
|
-
# {https://developers.recurly.com/api/
|
1646
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_custom_field_definitions list_custom_field_definitions api documenation}
|
1576
1647
|
#
|
1577
|
-
# @param
|
1648
|
+
# @param params [Hash] Optional query string parameters:
|
1649
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1578
1650
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1579
1651
|
#
|
1580
1652
|
# *Important notes:*
|
@@ -1586,39 +1658,41 @@ module Recurly
|
|
1586
1658
|
# * Records are returned in an arbitrary order. Since results are all
|
1587
1659
|
# returned at once you can sort the records yourself.
|
1588
1660
|
#
|
1589
|
-
#
|
1590
|
-
#
|
1591
|
-
#
|
1661
|
+
# :limit [Integer] Limit number of records 1-200.
|
1662
|
+
# :order [String] Sort order.
|
1663
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1592
1664
|
# order. In descending order updated records will move behind the cursor and could
|
1593
1665
|
# prevent some records from being returned.
|
1594
1666
|
#
|
1595
|
-
#
|
1667
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1596
1668
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1597
1669
|
#
|
1598
|
-
#
|
1670
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1599
1671
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1600
1672
|
#
|
1601
|
-
#
|
1602
|
-
# @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+.
|
1673
|
+
# :related_type [String] Filter by related type.
|
1603
1674
|
#
|
1604
1675
|
# @return [Pager<Resources::CustomFieldDefinition>] A list of the site's custom field definitions.
|
1605
1676
|
# @example
|
1606
|
-
#
|
1677
|
+
# params = {
|
1678
|
+
# limit: 200
|
1679
|
+
# }
|
1680
|
+
# custom_fields = @client.list_custom_field_definitions(params: params)
|
1607
1681
|
# custom_fields.each do |field|
|
1608
1682
|
# puts "CustomFieldDefinition: #{field.name}"
|
1609
1683
|
# end
|
1610
1684
|
#
|
1611
1685
|
def list_custom_field_definitions(**options)
|
1612
|
-
path =
|
1686
|
+
path = "/custom_field_definitions"
|
1613
1687
|
pager(path, **options)
|
1614
1688
|
end
|
1615
1689
|
|
1616
1690
|
# Fetch an custom field definition
|
1617
1691
|
#
|
1618
|
-
# {https://developers.recurly.com/api/
|
1692
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_custom_field_definition get_custom_field_definition api documenation}
|
1619
1693
|
#
|
1620
1694
|
# @param custom_field_definition_id [String] Custom Field Definition ID
|
1621
|
-
# @param
|
1695
|
+
# @param params [Hash] Optional query string parameters:
|
1622
1696
|
#
|
1623
1697
|
# @return [Resources::CustomFieldDefinition] An custom field definition.
|
1624
1698
|
# @example
|
@@ -1640,9 +1714,10 @@ module Recurly
|
|
1640
1714
|
|
1641
1715
|
# List a site's items
|
1642
1716
|
#
|
1643
|
-
# {https://developers.recurly.com/api/
|
1717
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_items list_items api documenation}
|
1644
1718
|
#
|
1645
|
-
# @param
|
1719
|
+
# @param params [Hash] Optional query string parameters:
|
1720
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1646
1721
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1647
1722
|
#
|
1648
1723
|
# *Important notes:*
|
@@ -1654,39 +1729,41 @@ module Recurly
|
|
1654
1729
|
# * Records are returned in an arbitrary order. Since results are all
|
1655
1730
|
# returned at once you can sort the records yourself.
|
1656
1731
|
#
|
1657
|
-
#
|
1658
|
-
#
|
1659
|
-
#
|
1732
|
+
# :limit [Integer] Limit number of records 1-200.
|
1733
|
+
# :order [String] Sort order.
|
1734
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1660
1735
|
# order. In descending order updated records will move behind the cursor and could
|
1661
1736
|
# prevent some records from being returned.
|
1662
1737
|
#
|
1663
|
-
#
|
1738
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1664
1739
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1665
1740
|
#
|
1666
|
-
#
|
1741
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1667
1742
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1668
1743
|
#
|
1669
|
-
#
|
1670
|
-
# @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+.
|
1744
|
+
# :state [String] Filter by state.
|
1671
1745
|
#
|
1672
1746
|
# @return [Pager<Resources::Item>] A list of the site's items.
|
1673
1747
|
# @example
|
1674
|
-
#
|
1748
|
+
# params = {
|
1749
|
+
# limit: 200
|
1750
|
+
# }
|
1751
|
+
# items = @client.list_items(params: params)
|
1675
1752
|
# items.each do |item|
|
1676
1753
|
# puts "Item: #{item.code}"
|
1677
1754
|
# end
|
1678
1755
|
#
|
1679
1756
|
def list_items(**options)
|
1680
|
-
path =
|
1757
|
+
path = "/items"
|
1681
1758
|
pager(path, **options)
|
1682
1759
|
end
|
1683
1760
|
|
1684
1761
|
# Create a new item
|
1685
1762
|
#
|
1686
|
-
# {https://developers.recurly.com/api/
|
1763
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_item create_item api documenation}
|
1687
1764
|
#
|
1688
1765
|
# @param body [Requests::ItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemCreate}
|
1689
|
-
# @param
|
1766
|
+
# @param params [Hash] Optional query string parameters:
|
1690
1767
|
#
|
1691
1768
|
# @return [Resources::Item] A new item.
|
1692
1769
|
# @example
|
@@ -1712,16 +1789,16 @@ module Recurly
|
|
1712
1789
|
# end
|
1713
1790
|
#
|
1714
1791
|
def create_item(body:, **options)
|
1715
|
-
path =
|
1792
|
+
path = "/items"
|
1716
1793
|
post(path, body, Requests::ItemCreate, **options)
|
1717
1794
|
end
|
1718
1795
|
|
1719
1796
|
# Fetch an item
|
1720
1797
|
#
|
1721
|
-
# {https://developers.recurly.com/api/
|
1798
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_item get_item api documenation}
|
1722
1799
|
#
|
1723
1800
|
# @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+.
|
1724
|
-
# @param
|
1801
|
+
# @param params [Hash] Optional query string parameters:
|
1725
1802
|
#
|
1726
1803
|
# @return [Resources::Item] An item.
|
1727
1804
|
# @example
|
@@ -1741,11 +1818,11 @@ module Recurly
|
|
1741
1818
|
|
1742
1819
|
# Update an active item
|
1743
1820
|
#
|
1744
|
-
# {https://developers.recurly.com/api/
|
1821
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_item update_item api documenation}
|
1745
1822
|
#
|
1746
1823
|
# @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+.
|
1747
1824
|
# @param body [Requests::ItemUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemUpdate}
|
1748
|
-
# @param
|
1825
|
+
# @param params [Hash] Optional query string parameters:
|
1749
1826
|
#
|
1750
1827
|
# @return [Resources::Item] The updated item.
|
1751
1828
|
# @example
|
@@ -1772,10 +1849,10 @@ module Recurly
|
|
1772
1849
|
|
1773
1850
|
# Deactivate an item
|
1774
1851
|
#
|
1775
|
-
# {https://developers.recurly.com/api/
|
1852
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_item deactivate_item api documenation}
|
1776
1853
|
#
|
1777
1854
|
# @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+.
|
1778
|
-
# @param
|
1855
|
+
# @param params [Hash] Optional query string parameters:
|
1779
1856
|
#
|
1780
1857
|
# @return [Resources::Item] An item.
|
1781
1858
|
# @example
|
@@ -1795,10 +1872,10 @@ module Recurly
|
|
1795
1872
|
|
1796
1873
|
# Reactivate an inactive item
|
1797
1874
|
#
|
1798
|
-
# {https://developers.recurly.com/api/
|
1875
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_item reactivate_item api documenation}
|
1799
1876
|
#
|
1800
1877
|
# @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+.
|
1801
|
-
# @param
|
1878
|
+
# @param params [Hash] Optional query string parameters:
|
1802
1879
|
#
|
1803
1880
|
# @return [Resources::Item] An item.
|
1804
1881
|
# @example
|
@@ -1818,9 +1895,10 @@ module Recurly
|
|
1818
1895
|
|
1819
1896
|
# List a site's measured units
|
1820
1897
|
#
|
1821
|
-
# {https://developers.recurly.com/api/
|
1898
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_measured_unit list_measured_unit api documenation}
|
1822
1899
|
#
|
1823
|
-
# @param
|
1900
|
+
# @param params [Hash] Optional query string parameters:
|
1901
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1824
1902
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1825
1903
|
#
|
1826
1904
|
# *Important notes:*
|
@@ -1832,48 +1910,47 @@ module Recurly
|
|
1832
1910
|
# * Records are returned in an arbitrary order. Since results are all
|
1833
1911
|
# returned at once you can sort the records yourself.
|
1834
1912
|
#
|
1835
|
-
#
|
1836
|
-
#
|
1837
|
-
#
|
1913
|
+
# :limit [Integer] Limit number of records 1-200.
|
1914
|
+
# :order [String] Sort order.
|
1915
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1838
1916
|
# order. In descending order updated records will move behind the cursor and could
|
1839
1917
|
# prevent some records from being returned.
|
1840
1918
|
#
|
1841
|
-
#
|
1919
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1842
1920
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1843
1921
|
#
|
1844
|
-
#
|
1922
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1845
1923
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1846
1924
|
#
|
1847
|
-
#
|
1848
|
-
# @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+.
|
1925
|
+
# :state [String] Filter by state.
|
1849
1926
|
#
|
1850
1927
|
# @return [Pager<Resources::MeasuredUnit>] A list of the site's measured units.
|
1851
1928
|
#
|
1852
1929
|
def list_measured_unit(**options)
|
1853
|
-
path =
|
1930
|
+
path = "/measured_units"
|
1854
1931
|
pager(path, **options)
|
1855
1932
|
end
|
1856
1933
|
|
1857
1934
|
# Create a new measured unit
|
1858
1935
|
#
|
1859
|
-
# {https://developers.recurly.com/api/
|
1936
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_measured_unit create_measured_unit api documenation}
|
1860
1937
|
#
|
1861
1938
|
# @param body [Requests::MeasuredUnitCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::MeasuredUnitCreate}
|
1862
|
-
# @param
|
1939
|
+
# @param params [Hash] Optional query string parameters:
|
1863
1940
|
#
|
1864
1941
|
# @return [Resources::MeasuredUnit] A new measured unit.
|
1865
1942
|
#
|
1866
1943
|
def create_measured_unit(body:, **options)
|
1867
|
-
path =
|
1944
|
+
path = "/measured_units"
|
1868
1945
|
post(path, body, Requests::MeasuredUnitCreate, **options)
|
1869
1946
|
end
|
1870
1947
|
|
1871
1948
|
# Fetch a measured unit
|
1872
1949
|
#
|
1873
|
-
# {https://developers.recurly.com/api/
|
1950
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_measured_unit get_measured_unit api documenation}
|
1874
1951
|
#
|
1875
1952
|
# @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+.
|
1876
|
-
# @param
|
1953
|
+
# @param params [Hash] Optional query string parameters:
|
1877
1954
|
#
|
1878
1955
|
# @return [Resources::MeasuredUnit] An item.
|
1879
1956
|
#
|
@@ -1884,11 +1961,11 @@ module Recurly
|
|
1884
1961
|
|
1885
1962
|
# Update a measured unit
|
1886
1963
|
#
|
1887
|
-
# {https://developers.recurly.com/api/
|
1964
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_measured_unit update_measured_unit api documenation}
|
1888
1965
|
#
|
1889
1966
|
# @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+.
|
1890
1967
|
# @param body [Requests::MeasuredUnitUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::MeasuredUnitUpdate}
|
1891
|
-
# @param
|
1968
|
+
# @param params [Hash] Optional query string parameters:
|
1892
1969
|
#
|
1893
1970
|
# @return [Resources::MeasuredUnit] The updated measured_unit.
|
1894
1971
|
#
|
@@ -1899,10 +1976,10 @@ module Recurly
|
|
1899
1976
|
|
1900
1977
|
# Remove a measured unit
|
1901
1978
|
#
|
1902
|
-
# {https://developers.recurly.com/api/
|
1979
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_measured_unit remove_measured_unit api documenation}
|
1903
1980
|
#
|
1904
1981
|
# @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+.
|
1905
|
-
# @param
|
1982
|
+
# @param params [Hash] Optional query string parameters:
|
1906
1983
|
#
|
1907
1984
|
# @return [Resources::MeasuredUnit] A measured unit.
|
1908
1985
|
#
|
@@ -1913,9 +1990,10 @@ module Recurly
|
|
1913
1990
|
|
1914
1991
|
# List a site's invoices
|
1915
1992
|
#
|
1916
|
-
# {https://developers.recurly.com/api/
|
1993
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_invoices list_invoices api documenation}
|
1917
1994
|
#
|
1918
|
-
# @param
|
1995
|
+
# @param params [Hash] Optional query string parameters:
|
1996
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1919
1997
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1920
1998
|
#
|
1921
1999
|
# *Important notes:*
|
@@ -1927,44 +2005,46 @@ module Recurly
|
|
1927
2005
|
# * Records are returned in an arbitrary order. Since results are all
|
1928
2006
|
# returned at once you can sort the records yourself.
|
1929
2007
|
#
|
1930
|
-
#
|
1931
|
-
#
|
1932
|
-
#
|
2008
|
+
# :limit [Integer] Limit number of records 1-200.
|
2009
|
+
# :order [String] Sort order.
|
2010
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1933
2011
|
# order. In descending order updated records will move behind the cursor and could
|
1934
2012
|
# prevent some records from being returned.
|
1935
2013
|
#
|
1936
|
-
#
|
2014
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1937
2015
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1938
2016
|
#
|
1939
|
-
#
|
2017
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1940
2018
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1941
2019
|
#
|
1942
|
-
#
|
2020
|
+
# :type [String] Filter by type when:
|
1943
2021
|
# - +type=charge+, only charge invoices will be returned.
|
1944
2022
|
# - +type=credit+, only credit invoices will be returned.
|
1945
2023
|
# - +type=non-legacy+, only charge and credit invoices will be returned.
|
1946
2024
|
# - +type=legacy+, only legacy invoices will be returned.
|
1947
2025
|
#
|
1948
|
-
# @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+.
|
1949
2026
|
#
|
1950
2027
|
# @return [Pager<Resources::Invoice>] A list of the site's invoices.
|
1951
2028
|
# @example
|
1952
|
-
#
|
2029
|
+
# params = {
|
2030
|
+
# limit: 200
|
2031
|
+
# }
|
2032
|
+
# invoices = @client.list_invoices(params: params)
|
1953
2033
|
# invoices.each do |invoice|
|
1954
2034
|
# puts "Invoice: #{invoice.number}"
|
1955
2035
|
# end
|
1956
2036
|
#
|
1957
2037
|
def list_invoices(**options)
|
1958
|
-
path =
|
2038
|
+
path = "/invoices"
|
1959
2039
|
pager(path, **options)
|
1960
2040
|
end
|
1961
2041
|
|
1962
2042
|
# Fetch an invoice
|
1963
2043
|
#
|
1964
|
-
# {https://developers.recurly.com/api/
|
2044
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_invoice get_invoice api documenation}
|
1965
2045
|
#
|
1966
2046
|
# @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+.
|
1967
|
-
# @param
|
2047
|
+
# @param params [Hash] Optional query string parameters:
|
1968
2048
|
#
|
1969
2049
|
# @return [Resources::Invoice] An invoice.
|
1970
2050
|
# @example
|
@@ -1984,11 +2064,11 @@ module Recurly
|
|
1984
2064
|
|
1985
2065
|
# Update an invoice
|
1986
2066
|
#
|
1987
|
-
# {https://developers.recurly.com/api/
|
2067
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_invoice update_invoice api documenation}
|
1988
2068
|
#
|
1989
2069
|
# @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+.
|
1990
|
-
# @param body [Requests::
|
1991
|
-
# @param
|
2070
|
+
# @param body [Requests::InvoiceUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceUpdate}
|
2071
|
+
# @param params [Hash] Optional query string parameters:
|
1992
2072
|
#
|
1993
2073
|
# @return [Resources::Invoice] An invoice.
|
1994
2074
|
# @example
|
@@ -1997,7 +2077,7 @@ module Recurly
|
|
1997
2077
|
# customer_notes: "New Notes",
|
1998
2078
|
# terms_and_conditions: "New Terms and Conditions"
|
1999
2079
|
# }
|
2000
|
-
# invoice = @client.
|
2080
|
+
# invoice = @client.update_invoice(invoice_id: invoice_id, body: invoice_update)
|
2001
2081
|
# puts "Updated invoice #{invoice}"
|
2002
2082
|
# rescue Recurly::Errors::NotFoundError
|
2003
2083
|
# # If the resource was not found, you may want to alert the user or
|
@@ -2005,17 +2085,17 @@ module Recurly
|
|
2005
2085
|
# puts "Resource Not Found"
|
2006
2086
|
# end
|
2007
2087
|
#
|
2008
|
-
def
|
2088
|
+
def update_invoice(invoice_id:, body:, **options)
|
2009
2089
|
path = interpolate_path("/invoices/{invoice_id}", invoice_id: invoice_id)
|
2010
|
-
put(path, body, Requests::
|
2090
|
+
put(path, body, Requests::InvoiceUpdate, **options)
|
2011
2091
|
end
|
2012
2092
|
|
2013
2093
|
# Fetch an invoice as a PDF
|
2014
2094
|
#
|
2015
|
-
# {https://developers.recurly.com/api/
|
2095
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_invoice_pdf get_invoice_pdf api documenation}
|
2016
2096
|
#
|
2017
2097
|
# @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+.
|
2018
|
-
# @param
|
2098
|
+
# @param params [Hash] Optional query string parameters:
|
2019
2099
|
#
|
2020
2100
|
# @return [Resources::BinaryFile] An invoice as a PDF.
|
2021
2101
|
# @example
|
@@ -2038,11 +2118,11 @@ module Recurly
|
|
2038
2118
|
|
2039
2119
|
# Collect a pending or past due, automatic invoice
|
2040
2120
|
#
|
2041
|
-
# {https://developers.recurly.com/api/
|
2121
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/collect_invoice collect_invoice api documenation}
|
2042
2122
|
#
|
2043
2123
|
# @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+.
|
2044
|
-
# @param
|
2045
|
-
#
|
2124
|
+
# @param params [Hash] Optional query string parameters:
|
2125
|
+
# :body [Requests::InvoiceCollect] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCollect}
|
2046
2126
|
#
|
2047
2127
|
# @return [Resources::Invoice] The updated invoice.
|
2048
2128
|
# @example
|
@@ -2062,15 +2142,15 @@ module Recurly
|
|
2062
2142
|
|
2063
2143
|
# Mark an open invoice as failed
|
2064
2144
|
#
|
2065
|
-
# {https://developers.recurly.com/api/
|
2145
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/mark_invoice_failed mark_invoice_failed api documenation}
|
2066
2146
|
#
|
2067
2147
|
# @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+.
|
2068
|
-
# @param
|
2148
|
+
# @param params [Hash] Optional query string parameters:
|
2069
2149
|
#
|
2070
2150
|
# @return [Resources::Invoice] The updated invoice.
|
2071
2151
|
# @example
|
2072
2152
|
# begin
|
2073
|
-
# invoice = @client.
|
2153
|
+
# invoice = @client.mark_invoice_failed(invoice_id: invoice_id)
|
2074
2154
|
# puts "Failed invoice #{invoice}"
|
2075
2155
|
# rescue Recurly::Errors::NotFoundError
|
2076
2156
|
# # If the resource was not found, you may want to alert the user or
|
@@ -2078,17 +2158,17 @@ module Recurly
|
|
2078
2158
|
# puts "Resource Not Found"
|
2079
2159
|
# end
|
2080
2160
|
#
|
2081
|
-
def
|
2161
|
+
def mark_invoice_failed(invoice_id:, **options)
|
2082
2162
|
path = interpolate_path("/invoices/{invoice_id}/mark_failed", invoice_id: invoice_id)
|
2083
2163
|
put(path, **options)
|
2084
2164
|
end
|
2085
2165
|
|
2086
2166
|
# Mark an open invoice as successful
|
2087
2167
|
#
|
2088
|
-
# {https://developers.recurly.com/api/
|
2168
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/mark_invoice_successful mark_invoice_successful api documenation}
|
2089
2169
|
#
|
2090
2170
|
# @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+.
|
2091
|
-
# @param
|
2171
|
+
# @param params [Hash] Optional query string parameters:
|
2092
2172
|
#
|
2093
2173
|
# @return [Resources::Invoice] The updated invoice.
|
2094
2174
|
# @example
|
@@ -2108,10 +2188,10 @@ module Recurly
|
|
2108
2188
|
|
2109
2189
|
# Reopen a closed, manual invoice
|
2110
2190
|
#
|
2111
|
-
# {https://developers.recurly.com/api/
|
2191
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reopen_invoice reopen_invoice api documenation}
|
2112
2192
|
#
|
2113
2193
|
# @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+.
|
2114
|
-
# @param
|
2194
|
+
# @param params [Hash] Optional query string parameters:
|
2115
2195
|
#
|
2116
2196
|
# @return [Resources::Invoice] The updated invoice.
|
2117
2197
|
# @example
|
@@ -2131,10 +2211,10 @@ module Recurly
|
|
2131
2211
|
|
2132
2212
|
# Void a credit invoice.
|
2133
2213
|
#
|
2134
|
-
# {https://developers.recurly.com/api/
|
2214
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/void_invoice void_invoice api documenation}
|
2135
2215
|
#
|
2136
2216
|
# @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+.
|
2137
|
-
# @param
|
2217
|
+
# @param params [Hash] Optional query string parameters:
|
2138
2218
|
#
|
2139
2219
|
# @return [Resources::Invoice] The updated invoice.
|
2140
2220
|
# @example
|
@@ -2154,11 +2234,11 @@ module Recurly
|
|
2154
2234
|
|
2155
2235
|
# Record an external payment for a manual invoices.
|
2156
2236
|
#
|
2157
|
-
# {https://developers.recurly.com/api/
|
2237
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/record_external_transaction record_external_transaction api documenation}
|
2158
2238
|
#
|
2159
2239
|
# @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+.
|
2160
2240
|
# @param body [Requests::ExternalTransaction] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ExternalTransaction}
|
2161
|
-
# @param
|
2241
|
+
# @param params [Hash] Optional query string parameters:
|
2162
2242
|
#
|
2163
2243
|
# @return [Resources::Transaction] The recorded transaction.
|
2164
2244
|
#
|
@@ -2169,10 +2249,11 @@ module Recurly
|
|
2169
2249
|
|
2170
2250
|
# List an invoice's line items
|
2171
2251
|
#
|
2172
|
-
# {https://developers.recurly.com/api/
|
2252
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_line_items list_invoice_line_items api documenation}
|
2173
2253
|
#
|
2174
2254
|
# @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+.
|
2175
|
-
# @param
|
2255
|
+
# @param params [Hash] Optional query string parameters:
|
2256
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2176
2257
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2177
2258
|
#
|
2178
2259
|
# *Important notes:*
|
@@ -2184,28 +2265,30 @@ module Recurly
|
|
2184
2265
|
# * Records are returned in an arbitrary order. Since results are all
|
2185
2266
|
# returned at once you can sort the records yourself.
|
2186
2267
|
#
|
2187
|
-
#
|
2188
|
-
#
|
2189
|
-
#
|
2268
|
+
# :limit [Integer] Limit number of records 1-200.
|
2269
|
+
# :order [String] Sort order.
|
2270
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2190
2271
|
# order. In descending order updated records will move behind the cursor and could
|
2191
2272
|
# prevent some records from being returned.
|
2192
2273
|
#
|
2193
|
-
#
|
2274
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2194
2275
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2195
2276
|
#
|
2196
|
-
#
|
2277
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2197
2278
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2198
2279
|
#
|
2199
|
-
#
|
2200
|
-
#
|
2201
|
-
#
|
2202
|
-
# @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+.
|
2280
|
+
# :original [String] Filter by original field.
|
2281
|
+
# :state [String] Filter by state field.
|
2282
|
+
# :type [String] Filter by type field.
|
2203
2283
|
#
|
2204
2284
|
# @return [Pager<Resources::LineItem>] A list of the invoice's line items.
|
2205
2285
|
# @example
|
2286
|
+
# params = {
|
2287
|
+
# limit: 200
|
2288
|
+
# }
|
2206
2289
|
# line_items = @client.list_invoice_line_items(
|
2207
2290
|
# invoice_id: invoice_id,
|
2208
|
-
#
|
2291
|
+
# params: params
|
2209
2292
|
# )
|
2210
2293
|
# line_items.each do |line_item|
|
2211
2294
|
# puts "Line Item: #{line_item.id}"
|
@@ -2218,10 +2301,11 @@ module Recurly
|
|
2218
2301
|
|
2219
2302
|
# Show the coupon redemptions applied to an invoice
|
2220
2303
|
#
|
2221
|
-
# {https://developers.recurly.com/api/
|
2304
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_coupon_redemptions list_invoice_coupon_redemptions api documenation}
|
2222
2305
|
#
|
2223
2306
|
# @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+.
|
2224
|
-
# @param
|
2307
|
+
# @param params [Hash] Optional query string parameters:
|
2308
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2225
2309
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2226
2310
|
#
|
2227
2311
|
# *Important notes:*
|
@@ -2233,23 +2317,25 @@ module Recurly
|
|
2233
2317
|
# * Records are returned in an arbitrary order. Since results are all
|
2234
2318
|
# returned at once you can sort the records yourself.
|
2235
2319
|
#
|
2236
|
-
#
|
2320
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2237
2321
|
# order. In descending order updated records will move behind the cursor and could
|
2238
2322
|
# prevent some records from being returned.
|
2239
2323
|
#
|
2240
|
-
#
|
2324
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2241
2325
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2242
2326
|
#
|
2243
|
-
#
|
2327
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2244
2328
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2245
2329
|
#
|
2246
|
-
# @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+.
|
2247
2330
|
#
|
2248
2331
|
# @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions associated with the invoice.
|
2249
2332
|
# @example
|
2333
|
+
# params = {
|
2334
|
+
# limit: 200
|
2335
|
+
# }
|
2250
2336
|
# coupon_redemptions = @client.list_invoice_coupon_redemptions(
|
2251
2337
|
# invoice_id: invoice_id,
|
2252
|
-
#
|
2338
|
+
# params: params
|
2253
2339
|
# )
|
2254
2340
|
# coupon_redemptions.each do |redemption|
|
2255
2341
|
# puts "CouponRedemption: #{redemption.id}"
|
@@ -2262,16 +2348,19 @@ module Recurly
|
|
2262
2348
|
|
2263
2349
|
# List an invoice's related credit or charge invoices
|
2264
2350
|
#
|
2265
|
-
# {https://developers.recurly.com/api/
|
2351
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_related_invoices list_related_invoices api documenation}
|
2266
2352
|
#
|
2267
2353
|
# @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+.
|
2268
|
-
# @param
|
2354
|
+
# @param params [Hash] Optional query string parameters:
|
2269
2355
|
#
|
2270
2356
|
# @return [Pager<Resources::Invoice>] A list of the credit or charge invoices associated with the invoice.
|
2271
2357
|
# @example
|
2358
|
+
# params = {
|
2359
|
+
# limit: 200
|
2360
|
+
# }
|
2272
2361
|
# invoices = @client.list_related_invoices(
|
2273
2362
|
# invoice_id: invoice_id,
|
2274
|
-
#
|
2363
|
+
# params: params
|
2275
2364
|
# )
|
2276
2365
|
# invoices.each do |invoice|
|
2277
2366
|
# puts "Invoice: #{invoice.number}"
|
@@ -2284,11 +2373,11 @@ module Recurly
|
|
2284
2373
|
|
2285
2374
|
# Refund an invoice
|
2286
2375
|
#
|
2287
|
-
# {https://developers.recurly.com/api/
|
2376
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/refund_invoice refund_invoice api documenation}
|
2288
2377
|
#
|
2289
2378
|
# @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+.
|
2290
2379
|
# @param body [Requests::InvoiceRefund] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceRefund}
|
2291
|
-
# @param
|
2380
|
+
# @param params [Hash] Optional query string parameters:
|
2292
2381
|
#
|
2293
2382
|
# @return [Resources::Invoice] Returns the new credit invoice.
|
2294
2383
|
# @example
|
@@ -2315,9 +2404,10 @@ module Recurly
|
|
2315
2404
|
|
2316
2405
|
# List a site's line items
|
2317
2406
|
#
|
2318
|
-
# {https://developers.recurly.com/api/
|
2407
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_line_items list_line_items api documenation}
|
2319
2408
|
#
|
2320
|
-
# @param
|
2409
|
+
# @param params [Hash] Optional query string parameters:
|
2410
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2321
2411
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2322
2412
|
#
|
2323
2413
|
# *Important notes:*
|
@@ -2329,43 +2419,45 @@ module Recurly
|
|
2329
2419
|
# * Records are returned in an arbitrary order. Since results are all
|
2330
2420
|
# returned at once you can sort the records yourself.
|
2331
2421
|
#
|
2332
|
-
#
|
2333
|
-
#
|
2334
|
-
#
|
2422
|
+
# :limit [Integer] Limit number of records 1-200.
|
2423
|
+
# :order [String] Sort order.
|
2424
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2335
2425
|
# order. In descending order updated records will move behind the cursor and could
|
2336
2426
|
# prevent some records from being returned.
|
2337
2427
|
#
|
2338
|
-
#
|
2428
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2339
2429
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2340
2430
|
#
|
2341
|
-
#
|
2431
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2342
2432
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2343
2433
|
#
|
2344
|
-
#
|
2345
|
-
#
|
2346
|
-
#
|
2347
|
-
# @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+.
|
2434
|
+
# :original [String] Filter by original field.
|
2435
|
+
# :state [String] Filter by state field.
|
2436
|
+
# :type [String] Filter by type field.
|
2348
2437
|
#
|
2349
2438
|
# @return [Pager<Resources::LineItem>] A list of the site's line items.
|
2350
2439
|
# @example
|
2351
|
-
#
|
2440
|
+
# params = {
|
2352
2441
|
# limit: 200
|
2442
|
+
# }
|
2443
|
+
# line_items = @client.list_line_items(
|
2444
|
+
# params: params
|
2353
2445
|
# )
|
2354
2446
|
# line_items.each do |line_item|
|
2355
2447
|
# puts "LineItem: #{line_item.id}"
|
2356
2448
|
# end
|
2357
2449
|
#
|
2358
2450
|
def list_line_items(**options)
|
2359
|
-
path =
|
2451
|
+
path = "/line_items"
|
2360
2452
|
pager(path, **options)
|
2361
2453
|
end
|
2362
2454
|
|
2363
2455
|
# Fetch a line item
|
2364
2456
|
#
|
2365
|
-
# {https://developers.recurly.com/api/
|
2457
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_line_item get_line_item api documenation}
|
2366
2458
|
#
|
2367
2459
|
# @param line_item_id [String] Line Item ID.
|
2368
|
-
# @param
|
2460
|
+
# @param params [Hash] Optional query string parameters:
|
2369
2461
|
#
|
2370
2462
|
# @return [Resources::LineItem] A line item.
|
2371
2463
|
# @example
|
@@ -2385,10 +2477,10 @@ module Recurly
|
|
2385
2477
|
|
2386
2478
|
# Delete an uninvoiced line item
|
2387
2479
|
#
|
2388
|
-
# {https://developers.recurly.com/api/
|
2480
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_line_item remove_line_item api documenation}
|
2389
2481
|
#
|
2390
2482
|
# @param line_item_id [String] Line Item ID.
|
2391
|
-
# @param
|
2483
|
+
# @param params [Hash] Optional query string parameters:
|
2392
2484
|
#
|
2393
2485
|
# @return [Resources::Empty] Line item deleted.
|
2394
2486
|
# @example
|
@@ -2410,9 +2502,10 @@ module Recurly
|
|
2410
2502
|
|
2411
2503
|
# List a site's plans
|
2412
2504
|
#
|
2413
|
-
# {https://developers.recurly.com/api/
|
2505
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_plans list_plans api documenation}
|
2414
2506
|
#
|
2415
|
-
# @param
|
2507
|
+
# @param params [Hash] Optional query string parameters:
|
2508
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2416
2509
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2417
2510
|
#
|
2418
2511
|
# *Important notes:*
|
@@ -2424,39 +2517,41 @@ module Recurly
|
|
2424
2517
|
# * Records are returned in an arbitrary order. Since results are all
|
2425
2518
|
# returned at once you can sort the records yourself.
|
2426
2519
|
#
|
2427
|
-
#
|
2428
|
-
#
|
2429
|
-
#
|
2520
|
+
# :limit [Integer] Limit number of records 1-200.
|
2521
|
+
# :order [String] Sort order.
|
2522
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2430
2523
|
# order. In descending order updated records will move behind the cursor and could
|
2431
2524
|
# prevent some records from being returned.
|
2432
2525
|
#
|
2433
|
-
#
|
2526
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2434
2527
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2435
2528
|
#
|
2436
|
-
#
|
2529
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2437
2530
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2438
2531
|
#
|
2439
|
-
#
|
2440
|
-
# @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+.
|
2532
|
+
# :state [String] Filter by state.
|
2441
2533
|
#
|
2442
2534
|
# @return [Pager<Resources::Plan>] A list of plans.
|
2443
2535
|
# @example
|
2444
|
-
#
|
2536
|
+
# params = {
|
2537
|
+
# limit: 200
|
2538
|
+
# }
|
2539
|
+
# plans = @client.list_plans(params: params)
|
2445
2540
|
# plans.each do |plan|
|
2446
2541
|
# puts "Plan: #{plan.code}"
|
2447
2542
|
# end
|
2448
2543
|
#
|
2449
2544
|
def list_plans(**options)
|
2450
|
-
path =
|
2545
|
+
path = "/plans"
|
2451
2546
|
pager(path, **options)
|
2452
2547
|
end
|
2453
2548
|
|
2454
2549
|
# Create a plan
|
2455
2550
|
#
|
2456
|
-
# {https://developers.recurly.com/api/
|
2551
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_plan create_plan api documenation}
|
2457
2552
|
#
|
2458
2553
|
# @param body [Requests::PlanCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PlanCreate}
|
2459
|
-
# @param
|
2554
|
+
# @param params [Hash] Optional query string parameters:
|
2460
2555
|
#
|
2461
2556
|
# @return [Resources::Plan] A plan.
|
2462
2557
|
# @example
|
@@ -2487,16 +2582,16 @@ module Recurly
|
|
2487
2582
|
# end
|
2488
2583
|
#
|
2489
2584
|
def create_plan(body:, **options)
|
2490
|
-
path =
|
2585
|
+
path = "/plans"
|
2491
2586
|
post(path, body, Requests::PlanCreate, **options)
|
2492
2587
|
end
|
2493
2588
|
|
2494
2589
|
# Fetch a plan
|
2495
2590
|
#
|
2496
|
-
# {https://developers.recurly.com/api/
|
2591
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_plan get_plan api documenation}
|
2497
2592
|
#
|
2498
2593
|
# @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+.
|
2499
|
-
# @param
|
2594
|
+
# @param params [Hash] Optional query string parameters:
|
2500
2595
|
#
|
2501
2596
|
# @return [Resources::Plan] A plan.
|
2502
2597
|
# @example
|
@@ -2516,11 +2611,11 @@ module Recurly
|
|
2516
2611
|
|
2517
2612
|
# Update a plan
|
2518
2613
|
#
|
2519
|
-
# {https://developers.recurly.com/api/
|
2614
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_plan update_plan api documenation}
|
2520
2615
|
#
|
2521
2616
|
# @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+.
|
2522
2617
|
# @param body [Requests::PlanUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PlanUpdate}
|
2523
|
-
# @param
|
2618
|
+
# @param params [Hash] Optional query string parameters:
|
2524
2619
|
#
|
2525
2620
|
# @return [Resources::Plan] A plan.
|
2526
2621
|
# @example
|
@@ -2543,10 +2638,10 @@ module Recurly
|
|
2543
2638
|
|
2544
2639
|
# Remove a plan
|
2545
2640
|
#
|
2546
|
-
# {https://developers.recurly.com/api/
|
2641
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_plan remove_plan api documenation}
|
2547
2642
|
#
|
2548
2643
|
# @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+.
|
2549
|
-
# @param
|
2644
|
+
# @param params [Hash] Optional query string parameters:
|
2550
2645
|
#
|
2551
2646
|
# @return [Resources::Plan] Plan deleted
|
2552
2647
|
# @example
|
@@ -2566,10 +2661,11 @@ module Recurly
|
|
2566
2661
|
|
2567
2662
|
# List a plan's add-ons
|
2568
2663
|
#
|
2569
|
-
# {https://developers.recurly.com/api/
|
2664
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_plan_add_ons list_plan_add_ons api documenation}
|
2570
2665
|
#
|
2571
2666
|
# @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+.
|
2572
|
-
# @param
|
2667
|
+
# @param params [Hash] Optional query string parameters:
|
2668
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2573
2669
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2574
2670
|
#
|
2575
2671
|
# *Important notes:*
|
@@ -2581,26 +2677,28 @@ module Recurly
|
|
2581
2677
|
# * Records are returned in an arbitrary order. Since results are all
|
2582
2678
|
# returned at once you can sort the records yourself.
|
2583
2679
|
#
|
2584
|
-
#
|
2585
|
-
#
|
2586
|
-
#
|
2680
|
+
# :limit [Integer] Limit number of records 1-200.
|
2681
|
+
# :order [String] Sort order.
|
2682
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2587
2683
|
# order. In descending order updated records will move behind the cursor and could
|
2588
2684
|
# prevent some records from being returned.
|
2589
2685
|
#
|
2590
|
-
#
|
2686
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2591
2687
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2592
2688
|
#
|
2593
|
-
#
|
2689
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2594
2690
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2595
2691
|
#
|
2596
|
-
#
|
2597
|
-
# @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+.
|
2692
|
+
# :state [String] Filter by state.
|
2598
2693
|
#
|
2599
2694
|
# @return [Pager<Resources::AddOn>] A list of add-ons.
|
2600
2695
|
# @example
|
2696
|
+
# params = {
|
2697
|
+
# limit: 200
|
2698
|
+
# }
|
2601
2699
|
# add_ons = @client.list_plan_add_ons(
|
2602
2700
|
# plan_id: plan_id,
|
2603
|
-
#
|
2701
|
+
# params: params
|
2604
2702
|
# )
|
2605
2703
|
# add_ons.each do |add_on|
|
2606
2704
|
# puts "AddOn: #{add_on.code}"
|
@@ -2613,11 +2711,11 @@ module Recurly
|
|
2613
2711
|
|
2614
2712
|
# Create an add-on
|
2615
2713
|
#
|
2616
|
-
# {https://developers.recurly.com/api/
|
2714
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_plan_add_on create_plan_add_on api documenation}
|
2617
2715
|
#
|
2618
2716
|
# @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
2717
|
# @param body [Requests::AddOnCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnCreate}
|
2620
|
-
# @param
|
2718
|
+
# @param params [Hash] Optional query string parameters:
|
2621
2719
|
#
|
2622
2720
|
# @return [Resources::AddOn] An add-on.
|
2623
2721
|
# @example
|
@@ -2648,11 +2746,11 @@ module Recurly
|
|
2648
2746
|
|
2649
2747
|
# Fetch a plan's add-on
|
2650
2748
|
#
|
2651
|
-
# {https://developers.recurly.com/api/
|
2749
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_plan_add_on get_plan_add_on api documenation}
|
2652
2750
|
#
|
2653
2751
|
# @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+.
|
2654
2752
|
# @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+.
|
2655
|
-
# @param
|
2753
|
+
# @param params [Hash] Optional query string parameters:
|
2656
2754
|
#
|
2657
2755
|
# @return [Resources::AddOn] An add-on.
|
2658
2756
|
# @example
|
@@ -2674,12 +2772,12 @@ module Recurly
|
|
2674
2772
|
|
2675
2773
|
# Update an add-on
|
2676
2774
|
#
|
2677
|
-
# {https://developers.recurly.com/api/
|
2775
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_plan_add_on update_plan_add_on api documenation}
|
2678
2776
|
#
|
2679
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+.
|
2680
2778
|
# @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+.
|
2681
2779
|
# @param body [Requests::AddOnUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnUpdate}
|
2682
|
-
# @param
|
2780
|
+
# @param params [Hash] Optional query string parameters:
|
2683
2781
|
#
|
2684
2782
|
# @return [Resources::AddOn] An add-on.
|
2685
2783
|
# @example
|
@@ -2706,11 +2804,11 @@ module Recurly
|
|
2706
2804
|
|
2707
2805
|
# Remove an add-on
|
2708
2806
|
#
|
2709
|
-
# {https://developers.recurly.com/api/
|
2807
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_plan_add_on remove_plan_add_on api documenation}
|
2710
2808
|
#
|
2711
2809
|
# @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+.
|
2712
2810
|
# @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+.
|
2713
|
-
# @param
|
2811
|
+
# @param params [Hash] Optional query string parameters:
|
2714
2812
|
#
|
2715
2813
|
# @return [Resources::AddOn] Add-on deleted
|
2716
2814
|
# @example
|
@@ -2733,9 +2831,10 @@ module Recurly
|
|
2733
2831
|
|
2734
2832
|
# List a site's add-ons
|
2735
2833
|
#
|
2736
|
-
# {https://developers.recurly.com/api/
|
2834
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_add_ons list_add_ons api documenation}
|
2737
2835
|
#
|
2738
|
-
# @param
|
2836
|
+
# @param params [Hash] Optional query string parameters:
|
2837
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2739
2838
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2740
2839
|
#
|
2741
2840
|
# *Important notes:*
|
@@ -2747,41 +2846,43 @@ module Recurly
|
|
2747
2846
|
# * Records are returned in an arbitrary order. Since results are all
|
2748
2847
|
# returned at once you can sort the records yourself.
|
2749
2848
|
#
|
2750
|
-
#
|
2751
|
-
#
|
2752
|
-
#
|
2849
|
+
# :limit [Integer] Limit number of records 1-200.
|
2850
|
+
# :order [String] Sort order.
|
2851
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2753
2852
|
# order. In descending order updated records will move behind the cursor and could
|
2754
2853
|
# prevent some records from being returned.
|
2755
2854
|
#
|
2756
|
-
#
|
2855
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2757
2856
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2758
2857
|
#
|
2759
|
-
#
|
2858
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2760
2859
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2761
2860
|
#
|
2762
|
-
#
|
2763
|
-
# @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+.
|
2861
|
+
# :state [String] Filter by state.
|
2764
2862
|
#
|
2765
2863
|
# @return [Pager<Resources::AddOn>] A list of add-ons.
|
2766
2864
|
# @example
|
2767
|
-
#
|
2865
|
+
# params = {
|
2768
2866
|
# limit: 200
|
2867
|
+
# }
|
2868
|
+
# add_ons = @client.list_add_ons(
|
2869
|
+
# params: params
|
2769
2870
|
# )
|
2770
2871
|
# add_ons.each do |add_on|
|
2771
2872
|
# puts "AddOn: #{add_on.code}"
|
2772
2873
|
# end
|
2773
2874
|
#
|
2774
2875
|
def list_add_ons(**options)
|
2775
|
-
path =
|
2876
|
+
path = "/add_ons"
|
2776
2877
|
pager(path, **options)
|
2777
2878
|
end
|
2778
2879
|
|
2779
2880
|
# Fetch an add-on
|
2780
2881
|
#
|
2781
|
-
# {https://developers.recurly.com/api/
|
2882
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_add_on get_add_on api documenation}
|
2782
2883
|
#
|
2783
2884
|
# @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+.
|
2784
|
-
# @param
|
2885
|
+
# @param params [Hash] Optional query string parameters:
|
2785
2886
|
#
|
2786
2887
|
# @return [Resources::AddOn] An add-on.
|
2787
2888
|
# @example
|
@@ -2801,9 +2902,10 @@ module Recurly
|
|
2801
2902
|
|
2802
2903
|
# List a site's shipping methods
|
2803
2904
|
#
|
2804
|
-
# {https://developers.recurly.com/api/
|
2905
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_shipping_methods list_shipping_methods api documenation}
|
2805
2906
|
#
|
2806
|
-
# @param
|
2907
|
+
# @param params [Hash] Optional query string parameters:
|
2908
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2807
2909
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2808
2910
|
#
|
2809
2911
|
# *Important notes:*
|
@@ -2815,69 +2917,71 @@ module Recurly
|
|
2815
2917
|
# * Records are returned in an arbitrary order. Since results are all
|
2816
2918
|
# returned at once you can sort the records yourself.
|
2817
2919
|
#
|
2818
|
-
#
|
2819
|
-
#
|
2820
|
-
#
|
2920
|
+
# :limit [Integer] Limit number of records 1-200.
|
2921
|
+
# :order [String] Sort order.
|
2922
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2821
2923
|
# order. In descending order updated records will move behind the cursor and could
|
2822
2924
|
# prevent some records from being returned.
|
2823
2925
|
#
|
2824
|
-
#
|
2926
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2825
2927
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2826
2928
|
#
|
2827
|
-
#
|
2929
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2828
2930
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2829
2931
|
#
|
2830
|
-
# @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+.
|
2831
2932
|
#
|
2832
2933
|
# @return [Pager<Resources::ShippingMethod>] A list of the site's shipping methods.
|
2833
2934
|
# @example
|
2834
|
-
#
|
2935
|
+
# params = {
|
2835
2936
|
# limit: 200
|
2937
|
+
# }
|
2938
|
+
# shipping_methods = @client.list_shipping_methods(
|
2939
|
+
# params: params
|
2836
2940
|
# )
|
2837
2941
|
# shipping_methods.each do |shipping_method|
|
2838
2942
|
# puts "Shipping Method: #{shipping_method.code}"
|
2839
2943
|
# end
|
2840
2944
|
#
|
2841
2945
|
def list_shipping_methods(**options)
|
2842
|
-
path =
|
2946
|
+
path = "/shipping_methods"
|
2843
2947
|
pager(path, **options)
|
2844
2948
|
end
|
2845
2949
|
|
2846
2950
|
# Create a new shipping method
|
2847
2951
|
#
|
2848
|
-
# {https://developers.recurly.com/api/
|
2952
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_shipping_method create_shipping_method api documenation}
|
2849
2953
|
#
|
2850
2954
|
# @param body [Requests::ShippingMethodCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingMethodCreate}
|
2851
|
-
# @param
|
2955
|
+
# @param params [Hash] Optional query string parameters:
|
2852
2956
|
#
|
2853
2957
|
# @return [Resources::ShippingMethod] A new shipping method.
|
2854
2958
|
#
|
2855
2959
|
def create_shipping_method(body:, **options)
|
2856
|
-
path =
|
2960
|
+
path = "/shipping_methods"
|
2857
2961
|
post(path, body, Requests::ShippingMethodCreate, **options)
|
2858
2962
|
end
|
2859
2963
|
|
2860
2964
|
# Fetch a shipping method
|
2861
2965
|
#
|
2862
|
-
# {https://developers.recurly.com/api/
|
2966
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_shipping_method get_shipping_method api documenation}
|
2863
2967
|
#
|
2864
|
-
# @param
|
2865
|
-
# @param
|
2968
|
+
# @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+.
|
2969
|
+
# @param params [Hash] Optional query string parameters:
|
2866
2970
|
#
|
2867
2971
|
# @return [Resources::ShippingMethod] A shipping method.
|
2868
2972
|
#
|
2869
|
-
def get_shipping_method(
|
2870
|
-
path = interpolate_path("/shipping_methods/{
|
2973
|
+
def get_shipping_method(shipping_method_id:, **options)
|
2974
|
+
path = interpolate_path("/shipping_methods/{shipping_method_id}", shipping_method_id: shipping_method_id)
|
2871
2975
|
get(path, **options)
|
2872
2976
|
end
|
2873
2977
|
|
2874
2978
|
# Update an active Shipping Method
|
2875
2979
|
#
|
2876
|
-
# {https://developers.recurly.com/api/
|
2980
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_shipping_method update_shipping_method api documenation}
|
2877
2981
|
#
|
2878
2982
|
# @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+.
|
2879
2983
|
# @param body [Requests::ShippingMethodUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingMethodUpdate}
|
2880
|
-
# @param
|
2984
|
+
# @param params [Hash] Optional query string parameters:
|
2881
2985
|
#
|
2882
2986
|
# @return [Resources::ShippingMethod] The updated shipping method.
|
2883
2987
|
#
|
@@ -2888,10 +2992,10 @@ module Recurly
|
|
2888
2992
|
|
2889
2993
|
# Deactivate a shipping method
|
2890
2994
|
#
|
2891
|
-
# {https://developers.recurly.com/api/
|
2995
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_shipping_method deactivate_shipping_method api documenation}
|
2892
2996
|
#
|
2893
2997
|
# @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+.
|
2894
|
-
# @param
|
2998
|
+
# @param params [Hash] Optional query string parameters:
|
2895
2999
|
#
|
2896
3000
|
# @return [Resources::ShippingMethod] A shipping method.
|
2897
3001
|
#
|
@@ -2902,9 +3006,10 @@ module Recurly
|
|
2902
3006
|
|
2903
3007
|
# List a site's subscriptions
|
2904
3008
|
#
|
2905
|
-
# {https://developers.recurly.com/api/
|
3009
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_subscriptions list_subscriptions api documenation}
|
2906
3010
|
#
|
2907
|
-
# @param
|
3011
|
+
# @param params [Hash] Optional query string parameters:
|
3012
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2908
3013
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2909
3014
|
#
|
2910
3015
|
# *Important notes:*
|
@@ -2916,44 +3021,46 @@ module Recurly
|
|
2916
3021
|
# * Records are returned in an arbitrary order. Since results are all
|
2917
3022
|
# returned at once you can sort the records yourself.
|
2918
3023
|
#
|
2919
|
-
#
|
2920
|
-
#
|
2921
|
-
#
|
3024
|
+
# :limit [Integer] Limit number of records 1-200.
|
3025
|
+
# :order [String] Sort order.
|
3026
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2922
3027
|
# order. In descending order updated records will move behind the cursor and could
|
2923
3028
|
# prevent some records from being returned.
|
2924
3029
|
#
|
2925
|
-
#
|
3030
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2926
3031
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2927
3032
|
#
|
2928
|
-
#
|
3033
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2929
3034
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2930
3035
|
#
|
2931
|
-
#
|
3036
|
+
# :state [String] Filter by state.
|
2932
3037
|
#
|
2933
3038
|
# - When +state=active+, +state=canceled+, +state=expired+, or +state=future+, subscriptions with states that match the query and only those subscriptions will be returned.
|
2934
3039
|
# - 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.
|
2935
3040
|
# - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
|
2936
3041
|
#
|
2937
|
-
# @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+.
|
2938
3042
|
#
|
2939
3043
|
# @return [Pager<Resources::Subscription>] A list of the site's subscriptions.
|
2940
3044
|
# @example
|
2941
|
-
#
|
3045
|
+
# params = {
|
3046
|
+
# limit: 200
|
3047
|
+
# }
|
3048
|
+
# subscriptions = @client.list_subscriptions(params: params)
|
2942
3049
|
# subscriptions.each do |subscription|
|
2943
3050
|
# puts "Subscription: #{subscription.uuid}"
|
2944
3051
|
# end
|
2945
3052
|
#
|
2946
3053
|
def list_subscriptions(**options)
|
2947
|
-
path =
|
3054
|
+
path = "/subscriptions"
|
2948
3055
|
pager(path, **options)
|
2949
3056
|
end
|
2950
3057
|
|
2951
3058
|
# Create a new subscription
|
2952
3059
|
#
|
2953
|
-
# {https://developers.recurly.com/api/
|
3060
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_subscription create_subscription api documenation}
|
2954
3061
|
#
|
2955
3062
|
# @param body [Requests::SubscriptionCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionCreate}
|
2956
|
-
# @param
|
3063
|
+
# @param params [Hash] Optional query string parameters:
|
2957
3064
|
#
|
2958
3065
|
# @return [Resources::Subscription] A subscription.
|
2959
3066
|
# @example
|
@@ -2961,8 +3068,7 @@ module Recurly
|
|
2961
3068
|
# subscription_create = {
|
2962
3069
|
# plan_code: plan_code,
|
2963
3070
|
# currency: "USD",
|
2964
|
-
# # This can be an existing account or
|
2965
|
-
# # a new acocunt
|
3071
|
+
# # This can be an existing account or a new account
|
2966
3072
|
# account: {
|
2967
3073
|
# code: account_code,
|
2968
3074
|
# }
|
@@ -2978,16 +3084,16 @@ module Recurly
|
|
2978
3084
|
# end
|
2979
3085
|
#
|
2980
3086
|
def create_subscription(body:, **options)
|
2981
|
-
path =
|
3087
|
+
path = "/subscriptions"
|
2982
3088
|
post(path, body, Requests::SubscriptionCreate, **options)
|
2983
3089
|
end
|
2984
3090
|
|
2985
3091
|
# Fetch a subscription
|
2986
3092
|
#
|
2987
|
-
# {https://developers.recurly.com/api/
|
3093
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_subscription get_subscription api documenation}
|
2988
3094
|
#
|
2989
3095
|
# @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+.
|
2990
|
-
# @param
|
3096
|
+
# @param params [Hash] Optional query string parameters:
|
2991
3097
|
#
|
2992
3098
|
# @return [Resources::Subscription] A subscription.
|
2993
3099
|
# @example
|
@@ -3007,13 +3113,13 @@ module Recurly
|
|
3007
3113
|
get(path, **options)
|
3008
3114
|
end
|
3009
3115
|
|
3010
|
-
#
|
3116
|
+
# Update a subscription
|
3011
3117
|
#
|
3012
|
-
# {https://developers.recurly.com/api/
|
3118
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_subscription update_subscription api documenation}
|
3013
3119
|
#
|
3014
3120
|
# @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+.
|
3015
3121
|
# @param body [Requests::SubscriptionUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionUpdate}
|
3016
|
-
# @param
|
3122
|
+
# @param params [Hash] Optional query string parameters:
|
3017
3123
|
#
|
3018
3124
|
# @return [Resources::Subscription] A subscription.
|
3019
3125
|
# @example
|
@@ -3022,7 +3128,7 @@ module Recurly
|
|
3022
3128
|
# customer_notes: "New Notes",
|
3023
3129
|
# terms_and_conditions: "New ToC"
|
3024
3130
|
# }
|
3025
|
-
# subscription = @client.
|
3131
|
+
# subscription = @client.update_subscription(
|
3026
3132
|
# subscription_id: subscription_id,
|
3027
3133
|
# body: subscription_update
|
3028
3134
|
# )
|
@@ -3033,17 +3139,18 @@ module Recurly
|
|
3033
3139
|
# puts "ValidationError: #{e.recurly_error.params}"
|
3034
3140
|
# end
|
3035
3141
|
#
|
3036
|
-
def
|
3142
|
+
def update_subscription(subscription_id:, body:, **options)
|
3037
3143
|
path = interpolate_path("/subscriptions/{subscription_id}", subscription_id: subscription_id)
|
3038
3144
|
put(path, body, Requests::SubscriptionUpdate, **options)
|
3039
3145
|
end
|
3040
3146
|
|
3041
3147
|
# Terminate a subscription
|
3042
3148
|
#
|
3043
|
-
# {https://developers.recurly.com/api/
|
3149
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/terminate_subscription terminate_subscription api documenation}
|
3044
3150
|
#
|
3045
3151
|
# @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+.
|
3046
|
-
# @param
|
3152
|
+
# @param params [Hash] Optional query string parameters:
|
3153
|
+
# :refund [String] The type of refund to perform:
|
3047
3154
|
#
|
3048
3155
|
# * +full+ - Performs a full refund of the last invoice for the current subscription term.
|
3049
3156
|
# * +partial+ - Prorates a refund based on the amount of time remaining in the current bill cycle.
|
@@ -3053,8 +3160,7 @@ module Recurly
|
|
3053
3160
|
#
|
3054
3161
|
# You may also terminate a subscription with no refund and then manually refund specific invoices.
|
3055
3162
|
#
|
3056
|
-
#
|
3057
|
-
# @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+.
|
3163
|
+
# :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.
|
3058
3164
|
#
|
3059
3165
|
# @return [Resources::Subscription] An expired subscription.
|
3060
3166
|
# @example
|
@@ -3076,11 +3182,11 @@ module Recurly
|
|
3076
3182
|
|
3077
3183
|
# Cancel a subscription
|
3078
3184
|
#
|
3079
|
-
# {https://developers.recurly.com/api/
|
3185
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/cancel_subscription cancel_subscription api documenation}
|
3080
3186
|
#
|
3081
3187
|
# @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+.
|
3082
|
-
# @param
|
3083
|
-
#
|
3188
|
+
# @param params [Hash] Optional query string parameters:
|
3189
|
+
# :body [Requests::SubscriptionCancel] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionCancel}
|
3084
3190
|
#
|
3085
3191
|
# @return [Resources::Subscription] A canceled or failed subscription.
|
3086
3192
|
# @example
|
@@ -3102,10 +3208,10 @@ module Recurly
|
|
3102
3208
|
|
3103
3209
|
# Reactivate a canceled subscription
|
3104
3210
|
#
|
3105
|
-
# {https://developers.recurly.com/api/
|
3211
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_subscription reactivate_subscription api documenation}
|
3106
3212
|
#
|
3107
3213
|
# @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+.
|
3108
|
-
# @param
|
3214
|
+
# @param params [Hash] Optional query string parameters:
|
3109
3215
|
#
|
3110
3216
|
# @return [Resources::Subscription] An active subscription.
|
3111
3217
|
# @example
|
@@ -3127,11 +3233,11 @@ module Recurly
|
|
3127
3233
|
|
3128
3234
|
# Pause subscription
|
3129
3235
|
#
|
3130
|
-
# {https://developers.recurly.com/api/
|
3236
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/pause_subscription pause_subscription api documenation}
|
3131
3237
|
#
|
3132
3238
|
# @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+.
|
3133
3239
|
# @param body [Requests::SubscriptionPause] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionPause}
|
3134
|
-
# @param
|
3240
|
+
# @param params [Hash] Optional query string parameters:
|
3135
3241
|
#
|
3136
3242
|
# @return [Resources::Subscription] A subscription.
|
3137
3243
|
# @example
|
@@ -3157,10 +3263,10 @@ module Recurly
|
|
3157
3263
|
|
3158
3264
|
# Resume subscription
|
3159
3265
|
#
|
3160
|
-
# {https://developers.recurly.com/api/
|
3266
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/resume_subscription resume_subscription api documenation}
|
3161
3267
|
#
|
3162
3268
|
# @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+.
|
3163
|
-
# @param
|
3269
|
+
# @param params [Hash] Optional query string parameters:
|
3164
3270
|
#
|
3165
3271
|
# @return [Resources::Subscription] A subscription.
|
3166
3272
|
# @example
|
@@ -3182,10 +3288,10 @@ module Recurly
|
|
3182
3288
|
|
3183
3289
|
# Convert trial subscription
|
3184
3290
|
#
|
3185
|
-
# {https://developers.recurly.com/api/
|
3291
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/convert_trial convert_trial api documenation}
|
3186
3292
|
#
|
3187
3293
|
# @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+.
|
3188
|
-
# @param
|
3294
|
+
# @param params [Hash] Optional query string parameters:
|
3189
3295
|
#
|
3190
3296
|
# @return [Resources::Subscription] A subscription.
|
3191
3297
|
#
|
@@ -3196,10 +3302,10 @@ module Recurly
|
|
3196
3302
|
|
3197
3303
|
# Fetch a subscription's pending change
|
3198
3304
|
#
|
3199
|
-
# {https://developers.recurly.com/api/
|
3305
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_subscription_change get_subscription_change api documenation}
|
3200
3306
|
#
|
3201
3307
|
# @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+.
|
3202
|
-
# @param
|
3308
|
+
# @param params [Hash] Optional query string parameters:
|
3203
3309
|
#
|
3204
3310
|
# @return [Resources::SubscriptionChange] A subscription's pending change.
|
3205
3311
|
# @example
|
@@ -3221,11 +3327,11 @@ module Recurly
|
|
3221
3327
|
|
3222
3328
|
# Create a new subscription change
|
3223
3329
|
#
|
3224
|
-
# {https://developers.recurly.com/api/
|
3330
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_subscription_change create_subscription_change api documenation}
|
3225
3331
|
#
|
3226
3332
|
# @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+.
|
3227
3333
|
# @param body [Requests::SubscriptionChangeCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionChangeCreate}
|
3228
|
-
# @param
|
3334
|
+
# @param params [Hash] Optional query string parameters:
|
3229
3335
|
#
|
3230
3336
|
# @return [Resources::SubscriptionChange] A subscription change.
|
3231
3337
|
# @example
|
@@ -3252,10 +3358,10 @@ module Recurly
|
|
3252
3358
|
|
3253
3359
|
# Delete the pending subscription change
|
3254
3360
|
#
|
3255
|
-
# {https://developers.recurly.com/api/
|
3361
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_subscription_change remove_subscription_change api documenation}
|
3256
3362
|
#
|
3257
3363
|
# @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+.
|
3258
|
-
# @param
|
3364
|
+
# @param params [Hash] Optional query string parameters:
|
3259
3365
|
#
|
3260
3366
|
# @return [Resources::Empty] Subscription change was deleted.
|
3261
3367
|
# @example
|
@@ -3277,13 +3383,13 @@ module Recurly
|
|
3277
3383
|
|
3278
3384
|
# Preview a new subscription change
|
3279
3385
|
#
|
3280
|
-
# {https://developers.recurly.com/api/
|
3386
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/preview_subscription_change preview_subscription_change api documenation}
|
3281
3387
|
#
|
3282
3388
|
# @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+.
|
3283
3389
|
# @param body [Requests::SubscriptionChangeCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionChangeCreate}
|
3284
|
-
# @param
|
3390
|
+
# @param params [Hash] Optional query string parameters:
|
3285
3391
|
#
|
3286
|
-
# @return [Resources::
|
3392
|
+
# @return [Resources::SubscriptionChange] A subscription change.
|
3287
3393
|
#
|
3288
3394
|
def preview_subscription_change(subscription_id:, body:, **options)
|
3289
3395
|
path = interpolate_path("/subscriptions/{subscription_id}/change/preview", subscription_id: subscription_id)
|
@@ -3292,10 +3398,11 @@ module Recurly
|
|
3292
3398
|
|
3293
3399
|
# List a subscription's invoices
|
3294
3400
|
#
|
3295
|
-
# {https://developers.recurly.com/api/
|
3401
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_invoices list_subscription_invoices api documenation}
|
3296
3402
|
#
|
3297
3403
|
# @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
|
3404
|
+
# @param params [Hash] Optional query string parameters:
|
3405
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
3299
3406
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
3300
3407
|
#
|
3301
3408
|
# *Important notes:*
|
@@ -3307,31 +3414,33 @@ module Recurly
|
|
3307
3414
|
# * Records are returned in an arbitrary order. Since results are all
|
3308
3415
|
# returned at once you can sort the records yourself.
|
3309
3416
|
#
|
3310
|
-
#
|
3311
|
-
#
|
3312
|
-
#
|
3417
|
+
# :limit [Integer] Limit number of records 1-200.
|
3418
|
+
# :order [String] Sort order.
|
3419
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
3313
3420
|
# order. In descending order updated records will move behind the cursor and could
|
3314
3421
|
# prevent some records from being returned.
|
3315
3422
|
#
|
3316
|
-
#
|
3423
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
3317
3424
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3318
3425
|
#
|
3319
|
-
#
|
3426
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
3320
3427
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3321
3428
|
#
|
3322
|
-
#
|
3429
|
+
# :type [String] Filter by type when:
|
3323
3430
|
# - +type=charge+, only charge invoices will be returned.
|
3324
3431
|
# - +type=credit+, only credit invoices will be returned.
|
3325
3432
|
# - +type=non-legacy+, only charge and credit invoices will be returned.
|
3326
3433
|
# - +type=legacy+, only legacy invoices will be returned.
|
3327
3434
|
#
|
3328
|
-
# @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+.
|
3329
3435
|
#
|
3330
3436
|
# @return [Pager<Resources::Invoice>] A list of the subscription's invoices.
|
3331
3437
|
# @example
|
3438
|
+
# params = {
|
3439
|
+
# limit: 200
|
3440
|
+
# }
|
3332
3441
|
# invoices = @client.list_subscription_invoices(
|
3333
3442
|
# subscription_id: subscription_id,
|
3334
|
-
#
|
3443
|
+
# params: params
|
3335
3444
|
# )
|
3336
3445
|
# invoices.each do |invoice|
|
3337
3446
|
# puts "Invoice: #{invoice.number}"
|
@@ -3344,10 +3453,11 @@ module Recurly
|
|
3344
3453
|
|
3345
3454
|
# List a subscription's line items
|
3346
3455
|
#
|
3347
|
-
# {https://developers.recurly.com/api/
|
3456
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_line_items list_subscription_line_items api documenation}
|
3348
3457
|
#
|
3349
3458
|
# @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+.
|
3350
|
-
# @param
|
3459
|
+
# @param params [Hash] Optional query string parameters:
|
3460
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
3351
3461
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
3352
3462
|
#
|
3353
3463
|
# *Important notes:*
|
@@ -3359,28 +3469,30 @@ module Recurly
|
|
3359
3469
|
# * Records are returned in an arbitrary order. Since results are all
|
3360
3470
|
# returned at once you can sort the records yourself.
|
3361
3471
|
#
|
3362
|
-
#
|
3363
|
-
#
|
3364
|
-
#
|
3472
|
+
# :limit [Integer] Limit number of records 1-200.
|
3473
|
+
# :order [String] Sort order.
|
3474
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
3365
3475
|
# order. In descending order updated records will move behind the cursor and could
|
3366
3476
|
# prevent some records from being returned.
|
3367
3477
|
#
|
3368
|
-
#
|
3478
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
3369
3479
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3370
3480
|
#
|
3371
|
-
#
|
3481
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
3372
3482
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3373
3483
|
#
|
3374
|
-
#
|
3375
|
-
#
|
3376
|
-
#
|
3377
|
-
# @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+.
|
3484
|
+
# :original [String] Filter by original field.
|
3485
|
+
# :state [String] Filter by state field.
|
3486
|
+
# :type [String] Filter by type field.
|
3378
3487
|
#
|
3379
3488
|
# @return [Pager<Resources::LineItem>] A list of the subscription's line items.
|
3380
3489
|
# @example
|
3490
|
+
# params = {
|
3491
|
+
# limit: 200
|
3492
|
+
# }
|
3381
3493
|
# line_items = @client.list_subscription_line_items(
|
3382
3494
|
# subscription_id: subscription_id,
|
3383
|
-
#
|
3495
|
+
# params: params
|
3384
3496
|
# )
|
3385
3497
|
# line_items.each do |line_item|
|
3386
3498
|
# puts "LineItem: #{line_item.id}"
|
@@ -3393,10 +3505,11 @@ module Recurly
|
|
3393
3505
|
|
3394
3506
|
# Show the coupon redemptions for a subscription
|
3395
3507
|
#
|
3396
|
-
# {https://developers.recurly.com/api/
|
3508
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_coupon_redemptions list_subscription_coupon_redemptions api documenation}
|
3397
3509
|
#
|
3398
3510
|
# @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+.
|
3399
|
-
# @param
|
3511
|
+
# @param params [Hash] Optional query string parameters:
|
3512
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
3400
3513
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
3401
3514
|
#
|
3402
3515
|
# *Important notes:*
|
@@ -3408,23 +3521,25 @@ module Recurly
|
|
3408
3521
|
# * Records are returned in an arbitrary order. Since results are all
|
3409
3522
|
# returned at once you can sort the records yourself.
|
3410
3523
|
#
|
3411
|
-
#
|
3524
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
3412
3525
|
# order. In descending order updated records will move behind the cursor and could
|
3413
3526
|
# prevent some records from being returned.
|
3414
3527
|
#
|
3415
|
-
#
|
3528
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
3416
3529
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3417
3530
|
#
|
3418
|
-
#
|
3531
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
3419
3532
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3420
3533
|
#
|
3421
|
-
# @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+.
|
3422
3534
|
#
|
3423
3535
|
# @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on a subscription.
|
3424
3536
|
# @example
|
3537
|
+
# params = {
|
3538
|
+
# limit: 200
|
3539
|
+
# }
|
3425
3540
|
# coupon_redemptions = @client.list_subscription_coupon_redemptions(
|
3426
3541
|
# subscription_id: subscription_id,
|
3427
|
-
#
|
3542
|
+
# params: params
|
3428
3543
|
# )
|
3429
3544
|
# coupon_redemptions.each do |redemption|
|
3430
3545
|
# puts "CouponRedemption: #{redemption.id}"
|
@@ -3437,11 +3552,12 @@ module Recurly
|
|
3437
3552
|
|
3438
3553
|
# List a subscription add-on's usage records
|
3439
3554
|
#
|
3440
|
-
# {https://developers.recurly.com/api/
|
3555
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_usage list_usage api documenation}
|
3441
3556
|
#
|
3442
3557
|
# @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+.
|
3443
3558
|
# @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+.
|
3444
|
-
# @param
|
3559
|
+
# @param params [Hash] Optional query string parameters:
|
3560
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
3445
3561
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
3446
3562
|
#
|
3447
3563
|
# *Important notes:*
|
@@ -3453,20 +3569,19 @@ module Recurly
|
|
3453
3569
|
# * Records are returned in an arbitrary order. Since results are all
|
3454
3570
|
# returned at once you can sort the records yourself.
|
3455
3571
|
#
|
3456
|
-
#
|
3457
|
-
#
|
3458
|
-
#
|
3572
|
+
# :limit [Integer] Limit number of records 1-200.
|
3573
|
+
# :order [String] Sort order.
|
3574
|
+
# :sort [String] Sort field. You *really* only want to sort by +usage_timestamp+ in ascending
|
3459
3575
|
# order. In descending order updated records will move behind the cursor and could
|
3460
3576
|
# prevent some records from being returned.
|
3461
3577
|
#
|
3462
|
-
#
|
3578
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=usage_timestamp+ or +sort=recorded_timestamp+.
|
3463
3579
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3464
3580
|
#
|
3465
|
-
#
|
3581
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=usage_timestamp+ or +sort=recorded_timestamp+.
|
3466
3582
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3467
3583
|
#
|
3468
|
-
#
|
3469
|
-
# @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+.
|
3584
|
+
# :billing_status [String] Filter by usage record's billing status
|
3470
3585
|
#
|
3471
3586
|
# @return [Pager<Resources::Usage>] A list of the subscription add-on's usage records.
|
3472
3587
|
#
|
@@ -3477,12 +3592,12 @@ module Recurly
|
|
3477
3592
|
|
3478
3593
|
# Log a usage record on this subscription add-on
|
3479
3594
|
#
|
3480
|
-
# {https://developers.recurly.com/api/
|
3595
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_usage create_usage api documenation}
|
3481
3596
|
#
|
3482
3597
|
# @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+.
|
3483
3598
|
# @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+.
|
3484
3599
|
# @param body [Requests::UsageCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::UsageCreate}
|
3485
|
-
# @param
|
3600
|
+
# @param params [Hash] Optional query string parameters:
|
3486
3601
|
#
|
3487
3602
|
# @return [Resources::Usage] The created usage record.
|
3488
3603
|
#
|
@@ -3493,10 +3608,10 @@ module Recurly
|
|
3493
3608
|
|
3494
3609
|
# Get a usage record
|
3495
3610
|
#
|
3496
|
-
# {https://developers.recurly.com/api/
|
3611
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_usage get_usage api documenation}
|
3497
3612
|
#
|
3498
3613
|
# @param usage_id [String] Usage Record ID.
|
3499
|
-
# @param
|
3614
|
+
# @param params [Hash] Optional query string parameters:
|
3500
3615
|
#
|
3501
3616
|
# @return [Resources::Usage] The usage record.
|
3502
3617
|
#
|
@@ -3507,11 +3622,11 @@ module Recurly
|
|
3507
3622
|
|
3508
3623
|
# Update a usage record
|
3509
3624
|
#
|
3510
|
-
# {https://developers.recurly.com/api/
|
3625
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_usage update_usage api documenation}
|
3511
3626
|
#
|
3512
3627
|
# @param usage_id [String] Usage Record ID.
|
3513
3628
|
# @param body [Requests::UsageCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::UsageCreate}
|
3514
|
-
# @param
|
3629
|
+
# @param params [Hash] Optional query string parameters:
|
3515
3630
|
#
|
3516
3631
|
# @return [Resources::Usage] The updated usage record.
|
3517
3632
|
#
|
@@ -3522,10 +3637,10 @@ module Recurly
|
|
3522
3637
|
|
3523
3638
|
# Delete a usage record.
|
3524
3639
|
#
|
3525
|
-
# {https://developers.recurly.com/api/
|
3640
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_usage remove_usage api documenation}
|
3526
3641
|
#
|
3527
3642
|
# @param usage_id [String] Usage Record ID.
|
3528
|
-
# @param
|
3643
|
+
# @param params [Hash] Optional query string parameters:
|
3529
3644
|
#
|
3530
3645
|
# @return [Resources::Empty] Usage was successfully deleted.
|
3531
3646
|
#
|
@@ -3536,9 +3651,10 @@ module Recurly
|
|
3536
3651
|
|
3537
3652
|
# List a site's transactions
|
3538
3653
|
#
|
3539
|
-
# {https://developers.recurly.com/api/
|
3654
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_transactions list_transactions api documenation}
|
3540
3655
|
#
|
3541
|
-
# @param
|
3656
|
+
# @param params [Hash] Optional query string parameters:
|
3657
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
3542
3658
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
3543
3659
|
#
|
3544
3660
|
# *Important notes:*
|
@@ -3550,40 +3666,42 @@ module Recurly
|
|
3550
3666
|
# * Records are returned in an arbitrary order. Since results are all
|
3551
3667
|
# returned at once you can sort the records yourself.
|
3552
3668
|
#
|
3553
|
-
#
|
3554
|
-
#
|
3555
|
-
#
|
3669
|
+
# :limit [Integer] Limit number of records 1-200.
|
3670
|
+
# :order [String] Sort order.
|
3671
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
3556
3672
|
# order. In descending order updated records will move behind the cursor and could
|
3557
3673
|
# prevent some records from being returned.
|
3558
3674
|
#
|
3559
|
-
#
|
3675
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
3560
3676
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3561
3677
|
#
|
3562
|
-
#
|
3678
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
3563
3679
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3564
3680
|
#
|
3565
|
-
#
|
3566
|
-
#
|
3567
|
-
# @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+.
|
3681
|
+
# :type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions.
|
3682
|
+
# :success [String] Filter by success field.
|
3568
3683
|
#
|
3569
3684
|
# @return [Pager<Resources::Transaction>] A list of the site's transactions.
|
3570
3685
|
# @example
|
3571
|
-
#
|
3686
|
+
# params = {
|
3687
|
+
# limit: 200
|
3688
|
+
# }
|
3689
|
+
# transactions = @client.list_transactions(params: params)
|
3572
3690
|
# transactions.each do |transaction|
|
3573
3691
|
# puts "Transaction: #{transaction.uuid}"
|
3574
3692
|
# end
|
3575
3693
|
#
|
3576
3694
|
def list_transactions(**options)
|
3577
|
-
path =
|
3695
|
+
path = "/transactions"
|
3578
3696
|
pager(path, **options)
|
3579
3697
|
end
|
3580
3698
|
|
3581
3699
|
# Fetch a transaction
|
3582
3700
|
#
|
3583
|
-
# {https://developers.recurly.com/api/
|
3701
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_transaction get_transaction api documenation}
|
3584
3702
|
#
|
3585
3703
|
# @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+.
|
3586
|
-
# @param
|
3704
|
+
# @param params [Hash] Optional query string parameters:
|
3587
3705
|
#
|
3588
3706
|
# @return [Resources::Transaction] A transaction.
|
3589
3707
|
# @example
|
@@ -3603,10 +3721,10 @@ module Recurly
|
|
3603
3721
|
|
3604
3722
|
# Fetch a unique coupon code
|
3605
3723
|
#
|
3606
|
-
# {https://developers.recurly.com/api/
|
3724
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_unique_coupon_code get_unique_coupon_code api documenation}
|
3607
3725
|
#
|
3608
3726
|
# @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+.
|
3609
|
-
# @param
|
3727
|
+
# @param params [Hash] Optional query string parameters:
|
3610
3728
|
#
|
3611
3729
|
# @return [Resources::UniqueCouponCode] A unique coupon code.
|
3612
3730
|
#
|
@@ -3617,10 +3735,10 @@ module Recurly
|
|
3617
3735
|
|
3618
3736
|
# Deactivate a unique coupon code
|
3619
3737
|
#
|
3620
|
-
# {https://developers.recurly.com/api/
|
3738
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_unique_coupon_code deactivate_unique_coupon_code api documenation}
|
3621
3739
|
#
|
3622
3740
|
# @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+.
|
3623
|
-
# @param
|
3741
|
+
# @param params [Hash] Optional query string parameters:
|
3624
3742
|
#
|
3625
3743
|
# @return [Resources::UniqueCouponCode] A unique coupon code.
|
3626
3744
|
#
|
@@ -3631,10 +3749,10 @@ module Recurly
|
|
3631
3749
|
|
3632
3750
|
# Restore a unique coupon code
|
3633
3751
|
#
|
3634
|
-
# {https://developers.recurly.com/api/
|
3752
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_unique_coupon_code reactivate_unique_coupon_code api documenation}
|
3635
3753
|
#
|
3636
3754
|
# @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+.
|
3637
|
-
# @param
|
3755
|
+
# @param params [Hash] Optional query string parameters:
|
3638
3756
|
#
|
3639
3757
|
# @return [Resources::UniqueCouponCode] A unique coupon code.
|
3640
3758
|
#
|
@@ -3645,10 +3763,10 @@ module Recurly
|
|
3645
3763
|
|
3646
3764
|
# Create a new purchase
|
3647
3765
|
#
|
3648
|
-
# {https://developers.recurly.com/api/
|
3766
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_purchase create_purchase api documenation}
|
3649
3767
|
#
|
3650
3768
|
# @param body [Requests::PurchaseCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PurchaseCreate}
|
3651
|
-
# @param
|
3769
|
+
# @param params [Hash] Optional query string parameters:
|
3652
3770
|
#
|
3653
3771
|
# @return [Resources::InvoiceCollection] Returns the new invoices
|
3654
3772
|
# @example
|
@@ -3679,16 +3797,16 @@ module Recurly
|
|
3679
3797
|
# end
|
3680
3798
|
#
|
3681
3799
|
def create_purchase(body:, **options)
|
3682
|
-
path =
|
3800
|
+
path = "/purchases"
|
3683
3801
|
post(path, body, Requests::PurchaseCreate, **options)
|
3684
3802
|
end
|
3685
3803
|
|
3686
3804
|
# Preview a new purchase
|
3687
3805
|
#
|
3688
|
-
# {https://developers.recurly.com/api/
|
3806
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/preview_purchase preview_purchase api documenation}
|
3689
3807
|
#
|
3690
3808
|
# @param body [Requests::PurchaseCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PurchaseCreate}
|
3691
|
-
# @param
|
3809
|
+
# @param params [Hash] Optional query string parameters:
|
3692
3810
|
#
|
3693
3811
|
# @return [Resources::InvoiceCollection] Returns preview of the new invoices
|
3694
3812
|
# @example
|
@@ -3719,15 +3837,15 @@ module Recurly
|
|
3719
3837
|
# end
|
3720
3838
|
#
|
3721
3839
|
def preview_purchase(body:, **options)
|
3722
|
-
path =
|
3840
|
+
path = "/purchases/preview"
|
3723
3841
|
post(path, body, Requests::PurchaseCreate, **options)
|
3724
3842
|
end
|
3725
3843
|
|
3726
3844
|
# List the dates that have an available export to download.
|
3727
3845
|
#
|
3728
|
-
# {https://developers.recurly.com/api/
|
3846
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_export_dates get_export_dates api documenation}
|
3729
3847
|
#
|
3730
|
-
# @param
|
3848
|
+
# @param params [Hash] Optional query string parameters:
|
3731
3849
|
#
|
3732
3850
|
# @return [Resources::ExportDates] Returns a list of dates.
|
3733
3851
|
# @example
|
@@ -3743,16 +3861,16 @@ module Recurly
|
|
3743
3861
|
# end
|
3744
3862
|
#
|
3745
3863
|
def get_export_dates(**options)
|
3746
|
-
path =
|
3864
|
+
path = "/export_dates"
|
3747
3865
|
get(path, **options)
|
3748
3866
|
end
|
3749
3867
|
|
3750
3868
|
# List of the export files that are available to download.
|
3751
3869
|
#
|
3752
|
-
# {https://developers.recurly.com/api/
|
3870
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_export_files get_export_files api documenation}
|
3753
3871
|
#
|
3754
3872
|
# @param export_date [String] Date for which to get a list of available automated export files. Date must be in YYYY-MM-DD format.
|
3755
|
-
# @param
|
3873
|
+
# @param params [Hash] Optional query string parameters:
|
3756
3874
|
#
|
3757
3875
|
# @return [Resources::ExportFiles] Returns a list of export files to download.
|
3758
3876
|
# @example
|