recurly 3.18.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bumpversion.cfg +1 -1
- data/.github_changelog_generator +2 -2
- data/.travis.yml +1 -0
- data/CHANGELOG.md +121 -7
- data/GETTING_STARTED.md +20 -17
- data/lib/recurly/client.rb +41 -18
- data/lib/recurly/client/operations.rb +769 -548
- data/lib/recurly/errors.rb +5 -23
- data/lib/recurly/errors/api_errors.rb +3 -0
- data/lib/recurly/pager.rb +5 -15
- data/lib/recurly/requests/{account_acquisition_updatable.rb → account_acquisition_update.rb} +1 -1
- data/lib/recurly/requests/account_create.rb +2 -2
- data/lib/recurly/requests/account_purchase.rb +2 -2
- data/lib/recurly/requests/add_on_create.rb +2 -2
- data/lib/recurly/requests/add_on_pricing.rb +5 -1
- data/lib/recurly/requests/add_on_update.rb +2 -2
- data/lib/recurly/requests/address.rb +0 -8
- data/lib/recurly/requests/billing_info_create.rb +1 -25
- 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 +5 -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/tier.rb +2 -2
- 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/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 +5 -1
- data/lib/recurly/resources/subscription_change.rb +0 -4
- data/lib/recurly/resources/tier.rb +2 -2
- data/lib/recurly/resources/tier_pricing.rb +22 -0
- data/lib/recurly/resources/transaction.rb +2 -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 +1873 -1843
- data/scripts/build +2 -2
- data/scripts/changelog +1 -1
- data/scripts/format +2 -2
- metadata +9 -8
- data/lib/recurly/errors/network_errors.rb +0 -10
- data/lib/recurly/resources/line_item_list.rb +0 -26
- data/lib/recurly/resources/subscription_change_preview.rb +0 -78
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 363aee14af2df360e4440e215556f60535e2a5293c413b37204371e46dba7f30
|
4
|
+
data.tar.gz: 83bae016d349769eebe8206f4ba8e02d2cd072c6d1fccee519054fc433bbde62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99d4ee6a951df8b4714c56c31c35b0c6ae27f29c7dc77e22a6ddd57dd743174980a280d65013350fa89c18b14523a885c56e3214ea05bdf6388c5876b3d28ec1
|
7
|
+
data.tar.gz: 96584a101083b1d7b3678bed505fd1e91bf9c1747bc9a7834467c9e7d6fb2c4f1f18ce17af4f4ff366fe5f0c32f39996f87566f7ea6c15f7c62172fe2b6d3047
|
data/.bumpversion.cfg
CHANGED
data/.github_changelog_generator
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
user=recurly
|
2
2
|
project=recurly-client-ruby
|
3
3
|
unreleased=false
|
4
|
-
exclude-labels=question,bug?,duplicate,V2
|
5
|
-
exclude-tags-regex=^[^
|
4
|
+
exclude-labels=internal,question,bug?,duplicate,V2
|
5
|
+
exclude-tags-regex=^[^34]+\..*
|
6
6
|
issues-wo-labels=false
|
7
7
|
verbose=false
|
8
8
|
since-tag=3.0.0.beta.1
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,118 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [4.0.1](https://github.com/recurly/recurly-client-ruby/tree/4.0.1) (2021-03-19)
|
4
4
|
|
5
|
-
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/
|
5
|
+
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.0.0...4.0.1)
|
6
|
+
|
7
|
+
**Merged pull requests:**
|
8
|
+
|
9
|
+
- Release 4.0.1 [\#682](https://github.com/recurly/recurly-client-ruby/pull/682) ([douglasmiller](https://github.com/douglasmiller))
|
10
|
+
- More ruby 3.0 [\#680](https://github.com/recurly/recurly-client-ruby/pull/680) ([douglasmiller](https://github.com/douglasmiller))
|
11
|
+
- Additional fix for ruby 3.x [\#679](https://github.com/recurly/recurly-client-ruby/pull/679) ([douglasmiller](https://github.com/douglasmiller))
|
12
|
+
- Generated Latest Changes for v2021-02-25 [\#678](https://github.com/recurly/recurly-client-ruby/pull/678) ([recurly-integrations](https://github.com/recurly-integrations))
|
13
|
+
- Sync updates not ported from 3.x client [\#671](https://github.com/recurly/recurly-client-ruby/pull/671) ([douglasmiller](https://github.com/douglasmiller))
|
14
|
+
|
15
|
+
## [4.0.0](https://github.com/recurly/recurly-client-ruby/tree/4.0.0) (2021-03-01)
|
16
|
+
|
17
|
+
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.18.1...4.0.0)
|
18
|
+
|
19
|
+
# Major Version Release
|
20
|
+
|
21
|
+
The 4.x major version of the client pairs with the `v2021-02-25` API version. This version of the client and the API contain breaking changes that should be considered before upgrading your integration.
|
22
|
+
|
23
|
+
## Breaking Changes in the API
|
24
|
+
All changes to the core API are documented in the [Developer Portal changelog](https://developers.recurly.com/api/changelog.html#v2021-02-25---current-ga-version)
|
25
|
+
|
26
|
+
## Breaking Changes in Client
|
27
|
+
|
28
|
+
- Remove `site_id` and `subdomain` from client initializer. [#624]
|
29
|
+
- Remove `set_site_id` method from client. [#627]
|
30
|
+
- Classify unexpected error responses from Recurly API via an HTTP status code mapping provided in `Recurly::Errors::ERROR_MAP`. [#616]
|
31
|
+
- Remove `NetworkError` class. All error classes now extend the `APIError`. This means that the order of multiple rescue blocks will need to be re-considered. [#616]
|
32
|
+
|
33
|
+
### 3.x
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
rescue Recurly::Errors::ValidationError => ex
|
37
|
+
# catch a validation error
|
38
|
+
rescue Recurly::Errors::APIError => ex
|
39
|
+
# catch a generic api error
|
40
|
+
rescue Recurly::Errors::TimeoutError => ex
|
41
|
+
# catch a specific network error
|
42
|
+
```
|
43
|
+
|
44
|
+
### 4.x
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
rescue Recurly::Errors::ValidationError => ex
|
48
|
+
# catch a validation error
|
49
|
+
rescue Recurly::Errors::TimeoutError => ex
|
50
|
+
# catch a specific network error
|
51
|
+
rescue Recurly::Errors::APIError => ex
|
52
|
+
# catch a generic api error
|
53
|
+
```
|
54
|
+
|
55
|
+
- Rename `InvalidResponseError` to `InvalidContentTypeError`. [#616]
|
56
|
+
- Rename `UnavailableError` to `ServiceUnavailableError`. [#616]
|
57
|
+
- Reorganize top-level keys of the optional parameters hash to improve clarity and create space for additional options. [#619]
|
58
|
+
|
59
|
+
### 3.x
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
options = {
|
63
|
+
limit: 200,
|
64
|
+
headers: {
|
65
|
+
'Accept-Language' => 'fr'
|
66
|
+
}
|
67
|
+
}
|
68
|
+
accounts = @client.list_accounts(options)
|
69
|
+
```
|
70
|
+
|
71
|
+
### 4.x
|
72
|
+
|
73
|
+
```ruby
|
74
|
+
options = {
|
75
|
+
params: {
|
76
|
+
limit: 200
|
77
|
+
}
|
78
|
+
headers: {
|
79
|
+
'Accept-Language' => 'fr'
|
80
|
+
}
|
81
|
+
}
|
82
|
+
accounts = @client.list_accounts(options)
|
83
|
+
```
|
84
|
+
|
85
|
+
**Implemented enhancements:**
|
86
|
+
|
87
|
+
- Remove site\_id and subdomain from client initializer [\#624](https://github.com/recurly/recurly-client-ruby/pull/624) ([joannasese](https://github.com/joannasese))
|
88
|
+
|
89
|
+
**Fixed bugs:**
|
90
|
+
|
91
|
+
- Every method is returning wrong number of arguments [\#664](https://github.com/recurly/recurly-client-ruby/issues/664)
|
92
|
+
|
93
|
+
**Merged pull requests:**
|
94
|
+
|
95
|
+
- Release 4.0.0 [\#669](https://github.com/recurly/recurly-client-ruby/pull/669) ([douglasmiller](https://github.com/douglasmiller))
|
96
|
+
- Updating changelog script and changelog generator config for 4.x release [\#663](https://github.com/recurly/recurly-client-ruby/pull/663) ([douglasmiller](https://github.com/douglasmiller))
|
97
|
+
- Removing unused method 'set\_site\_id' [\#627](https://github.com/recurly/recurly-client-ruby/pull/627) ([douglasmiller](https://github.com/douglasmiller))
|
98
|
+
- Updating 4.x client to expect query string params as \['params'\] [\#619](https://github.com/recurly/recurly-client-ruby/pull/619) ([douglasmiller](https://github.com/douglasmiller))
|
99
|
+
- Updating error mapping based on status code [\#616](https://github.com/recurly/recurly-client-ruby/pull/616) ([douglasmiller](https://github.com/douglasmiller))
|
100
|
+
|
101
|
+
## [3.18.1](https://github.com/recurly/recurly-client-ruby/tree/3.18.1) (2021-02-22)
|
102
|
+
|
103
|
+
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.18.0...3.18.1)
|
104
|
+
|
105
|
+
**Fixed bugs:**
|
106
|
+
|
107
|
+
- Fixing issues with ruby 3.0 [\#665](https://github.com/recurly/recurly-client-ruby/pull/665) ([douglasmiller](https://github.com/douglasmiller))
|
108
|
+
|
109
|
+
**Merged pull requests:**
|
110
|
+
|
111
|
+
- Release 3.18.1 [\#666](https://github.com/recurly/recurly-client-ruby/pull/666) ([douglasmiller](https://github.com/douglasmiller))
|
112
|
+
|
113
|
+
## [3.18.0](https://github.com/recurly/recurly-client-ruby/tree/3.18.0) (2021-01-22)
|
114
|
+
|
115
|
+
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.17.0...3.18.0)
|
6
116
|
|
7
117
|
**Implemented enhancements:**
|
8
118
|
|
@@ -33,10 +143,6 @@
|
|
33
143
|
- Latest Changes for 2019-10-10 \(tax\_identifier / tax\_identifier\_type\) [\#654](https://github.com/recurly/recurly-client-ruby/pull/654) ([douglasmiller](https://github.com/douglasmiller))
|
34
144
|
- Latest Changes for 2019-10-10 [\#651](https://github.com/recurly/recurly-client-ruby/pull/651) ([douglasmiller](https://github.com/douglasmiller))
|
35
145
|
|
36
|
-
**Fixed bugs:**
|
37
|
-
|
38
|
-
- Refund API V2 Error Details [\#652](https://github.com/recurly/recurly-client-ruby/issues/652)
|
39
|
-
|
40
146
|
**Merged pull requests:**
|
41
147
|
|
42
148
|
- Release 3.16.0 [\#656](https://github.com/recurly/recurly-client-ruby/pull/656) ([douglasmiller](https://github.com/douglasmiller))
|
@@ -348,7 +454,7 @@
|
|
348
454
|
|
349
455
|
## [3.0.0.beta.4](https://github.com/recurly/recurly-client-ruby/tree/3.0.0.beta.4) (2019-04-04)
|
350
456
|
|
351
|
-
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.0.0.beta.
|
457
|
+
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.0.0.beta.3...3.0.0.beta.4)
|
352
458
|
|
353
459
|
**Merged pull requests:**
|
354
460
|
|
@@ -361,6 +467,14 @@
|
|
361
467
|
- \[V3\] Test more versions of ruby [\#397](https://github.com/recurly/recurly-client-ruby/pull/397) ([drewish](https://github.com/drewish))
|
362
468
|
- Allow faraday 0.12 for compatibility with oauth2 gem [\#396](https://github.com/recurly/recurly-client-ruby/pull/396) ([drewish](https://github.com/drewish))
|
363
469
|
|
470
|
+
## [3.0.0.beta.3](https://github.com/recurly/recurly-client-ruby/tree/3.0.0.beta.3) (2018-08-27)
|
471
|
+
|
472
|
+
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.0.0.beta.2...3.0.0.beta.3)
|
473
|
+
|
474
|
+
## [3.0.0.beta.2](https://github.com/recurly/recurly-client-ruby/tree/3.0.0.beta.2) (2018-07-17)
|
475
|
+
|
476
|
+
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/3.0.0.beta.1...3.0.0.beta.2)
|
477
|
+
|
364
478
|
|
365
479
|
|
366
480
|
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
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', '~>
|
8
|
+
gem 'recurly', '~> 4.0'
|
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,7 @@ 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
|
-
set_site_id(site_id, subdomain)
|
57
|
+
def initialize(api_key:, logger: nil)
|
52
58
|
set_api_key(api_key)
|
53
59
|
|
54
60
|
if logger.nil?
|
@@ -90,6 +96,7 @@ module Recurly
|
|
90
96
|
end
|
91
97
|
|
92
98
|
def head(path, **options)
|
99
|
+
validate_options!(**options)
|
93
100
|
request = Net::HTTP::Head.new build_url(path, options)
|
94
101
|
set_headers(request, options[:headers])
|
95
102
|
http_response = run_request(request, options)
|
@@ -97,6 +104,7 @@ module Recurly
|
|
97
104
|
end
|
98
105
|
|
99
106
|
def get(path, **options)
|
107
|
+
validate_options!(**options)
|
100
108
|
request = Net::HTTP::Get.new build_url(path, options)
|
101
109
|
set_headers(request, options[:headers])
|
102
110
|
http_response = run_request(request, options)
|
@@ -104,6 +112,7 @@ module Recurly
|
|
104
112
|
end
|
105
113
|
|
106
114
|
def post(path, request_data, request_class, **options)
|
115
|
+
validate_options!(**options)
|
107
116
|
request_class.new(request_data).validate!
|
108
117
|
request = Net::HTTP::Post.new build_url(path, options)
|
109
118
|
request.set_content_type(JSON_CONTENT_TYPE)
|
@@ -114,6 +123,7 @@ module Recurly
|
|
114
123
|
end
|
115
124
|
|
116
125
|
def put(path, request_data = nil, request_class = nil, **options)
|
126
|
+
validate_options!(**options)
|
117
127
|
request = Net::HTTP::Put.new build_url(path, options)
|
118
128
|
request.set_content_type(JSON_CONTENT_TYPE)
|
119
129
|
set_headers(request, options[:headers])
|
@@ -127,6 +137,7 @@ module Recurly
|
|
127
137
|
end
|
128
138
|
|
129
139
|
def delete(path, **options)
|
140
|
+
validate_options!(**options)
|
130
141
|
request = Net::HTTP::Delete.new build_url(path, options)
|
131
142
|
set_headers(request, options[:headers])
|
132
143
|
http_response = run_request(request, options)
|
@@ -240,7 +251,7 @@ module Recurly
|
|
240
251
|
elsif BINARY_TYPES.include?(http_response.content_type)
|
241
252
|
FileParser.parse(response.body)
|
242
253
|
else
|
243
|
-
raise Recurly::Errors::
|
254
|
+
raise Recurly::Errors::InvalidContentTypeError, "Unexpected content type: #{http_response.content_type}"
|
244
255
|
end
|
245
256
|
else
|
246
257
|
Resources::Empty.new
|
@@ -255,10 +266,10 @@ module Recurly
|
|
255
266
|
error = JSONParser.parse(self, response.body)
|
256
267
|
begin
|
257
268
|
error_class = Errors::APIError.error_class(error.type)
|
258
|
-
raise error_class.new(response, error)
|
269
|
+
raise error_class.new(error.message, response, error)
|
259
270
|
rescue NameError
|
260
271
|
error_class = Errors::APIError.from_response(http_response)
|
261
|
-
raise error_class.new(response, error)
|
272
|
+
raise error_class.new("Unknown Error", response, error)
|
262
273
|
end
|
263
274
|
end
|
264
275
|
|
@@ -266,7 +277,7 @@ module Recurly
|
|
266
277
|
|
267
278
|
if error_class <= Recurly::Errors::APIError
|
268
279
|
error = Recurly::Resources::Error.new(message: "#{http_response.code}: #{http_response.message}")
|
269
|
-
raise error_class.new(response, error)
|
280
|
+
raise error_class.new(error.message, response, error)
|
270
281
|
else
|
271
282
|
raise error_class, "#{http_response.code}: #{http_response.message}"
|
272
283
|
end
|
@@ -279,6 +290,17 @@ module Recurly
|
|
279
290
|
response
|
280
291
|
end
|
281
292
|
|
293
|
+
def validate_options!(**options)
|
294
|
+
invalid_options = options.keys.reject do |k|
|
295
|
+
ALLOWED_OPTIONS.include?(k)
|
296
|
+
end
|
297
|
+
if invalid_options.any?
|
298
|
+
joinedKeys = invalid_options.join(", ")
|
299
|
+
joinedOptions = ALLOWED_OPTIONS.join(", ")
|
300
|
+
raise ArgumentError, "Invalid options: '#{joinedKeys}'. Allowed options: '#{joinedOptions}'"
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
282
304
|
def validate_path_parameters!(**options)
|
283
305
|
# Check to see that we are passing the correct data types
|
284
306
|
# This prevents a confusing error if the user passes in a non-primitive by mistake
|
@@ -299,7 +321,7 @@ module Recurly
|
|
299
321
|
end
|
300
322
|
|
301
323
|
def interpolate_path(path, **options)
|
302
|
-
validate_path_parameters!(options)
|
324
|
+
validate_path_parameters!(**options)
|
303
325
|
options.each do |k, v|
|
304
326
|
# We need to encode the values for the url
|
305
327
|
options[k] = ERB::Util.url_encode(v.to_s)
|
@@ -308,21 +330,13 @@ module Recurly
|
|
308
330
|
path % options
|
309
331
|
end
|
310
332
|
|
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
333
|
def set_api_key(api_key)
|
320
334
|
@api_key = api_key
|
321
335
|
end
|
322
336
|
|
323
337
|
def build_url(path, options)
|
324
338
|
path = scope_by_site(path, options)
|
325
|
-
query_params = options.
|
339
|
+
query_params = map_array_params(options.fetch(:params, {}))
|
326
340
|
if query_params.any?
|
327
341
|
"#{path}?#{URI.encode_www_form(query_params)}"
|
328
342
|
else
|
@@ -330,7 +344,16 @@ module Recurly
|
|
330
344
|
end
|
331
345
|
end
|
332
346
|
|
333
|
-
|
347
|
+
# Converts array parameters to CSV strings to maintain consistency with
|
348
|
+
# how the server expects the request to be formatted while providing the
|
349
|
+
# developer with an array type to maintain developer happiness!
|
350
|
+
def map_array_params(params)
|
351
|
+
params.map do |key, param|
|
352
|
+
[key, param.is_a?(Array) ? param.join(",") : param]
|
353
|
+
end.to_h
|
354
|
+
end
|
355
|
+
|
356
|
+
def scope_by_site(path, options)
|
334
357
|
if site = site_id || options[:site_id]
|
335
358
|
# Ensure that we are only including the site_id once because the Pager operations
|
336
359
|
# will use the cursor returned from the API which may already have these components
|
@@ -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,28 +88,31 @@ module Recurly
|
|
82
88
|
# * Records are returned in an arbitrary order. Since results are all
|
83
89
|
# returned at once you can sort the records yourself.
|
84
90
|
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
91
|
+
# :limit [Integer] Limit number of records 1-200.
|
92
|
+
# :order [String] Sort order.
|
93
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
88
94
|
# order. In descending order updated records will move behind the cursor and could
|
89
95
|
# prevent some records from being returned.
|
90
96
|
#
|
91
|
-
#
|
97
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
92
98
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
93
99
|
#
|
94
|
-
#
|
100
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
95
101
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
96
102
|
#
|
97
|
-
#
|
98
|
-
#
|
103
|
+
# :email [String] Filter for accounts with this exact email address. A blank value will return accounts with both +null+ and +""+ email addresses. Note that multiple accounts can share one email address.
|
104
|
+
# :subscriber [Boolean] Filter for accounts with or without a subscription in the +active+,
|
99
105
|
# +canceled+, or +future+ state.
|
100
106
|
#
|
101
|
-
#
|
102
|
-
#
|
107
|
+
# :past_due [String] Filter for accounts with an invoice in the +past_due+ state.
|
108
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
103
109
|
#
|
104
110
|
# @return [Pager<Resources::Account>] A list of the site's accounts.
|
105
111
|
# @example
|
106
|
-
#
|
112
|
+
# params = {
|
113
|
+
# limit: 200
|
114
|
+
# }
|
115
|
+
# accounts = @client.list_accounts(params: params)
|
107
116
|
# accounts.each do |account|
|
108
117
|
# puts "Account: #{account.code}"
|
109
118
|
# end
|
@@ -115,10 +124,11 @@ module Recurly
|
|
115
124
|
|
116
125
|
# Create an account
|
117
126
|
#
|
118
|
-
# {https://developers.recurly.com/api/
|
127
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_account create_account api documenation}
|
119
128
|
#
|
120
129
|
# @param body [Requests::AccountCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountCreate}
|
121
|
-
# @param
|
130
|
+
# @param params [Hash] Optional query string parameters:
|
131
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
122
132
|
#
|
123
133
|
# @return [Resources::Account] An account.
|
124
134
|
# @example
|
@@ -164,10 +174,11 @@ module Recurly
|
|
164
174
|
|
165
175
|
# Fetch an account
|
166
176
|
#
|
167
|
-
# {https://developers.recurly.com/api/
|
177
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_account get_account api documenation}
|
168
178
|
#
|
169
179
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
170
|
-
# @param
|
180
|
+
# @param params [Hash] Optional query string parameters:
|
181
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
171
182
|
#
|
172
183
|
# @return [Resources::Account] An account.
|
173
184
|
# @example
|
@@ -185,13 +196,14 @@ module Recurly
|
|
185
196
|
get(path, **options)
|
186
197
|
end
|
187
198
|
|
188
|
-
#
|
199
|
+
# Update an account
|
189
200
|
#
|
190
|
-
# {https://developers.recurly.com/api/
|
201
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_account update_account api documenation}
|
191
202
|
#
|
192
203
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
193
204
|
# @param body [Requests::AccountUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountUpdate}
|
194
|
-
# @param
|
205
|
+
# @param params [Hash] Optional query string parameters:
|
206
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
195
207
|
#
|
196
208
|
# @return [Resources::Account] An account.
|
197
209
|
# @example
|
@@ -218,10 +230,11 @@ module Recurly
|
|
218
230
|
|
219
231
|
# Deactivate an account
|
220
232
|
#
|
221
|
-
# {https://developers.recurly.com/api/
|
233
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_account deactivate_account api documenation}
|
222
234
|
#
|
223
235
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
224
|
-
# @param
|
236
|
+
# @param params [Hash] Optional query string parameters:
|
237
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
225
238
|
#
|
226
239
|
# @return [Resources::Account] An account.
|
227
240
|
# @example
|
@@ -241,10 +254,11 @@ module Recurly
|
|
241
254
|
|
242
255
|
# Fetch an account's acquisition data
|
243
256
|
#
|
244
|
-
# {https://developers.recurly.com/api/
|
257
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_account_acquisition get_account_acquisition api documenation}
|
245
258
|
#
|
246
259
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
247
|
-
# @param
|
260
|
+
# @param params [Hash] Optional query string parameters:
|
261
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
248
262
|
#
|
249
263
|
# @return [Resources::AccountAcquisition] An account's acquisition data.
|
250
264
|
# @example
|
@@ -264,11 +278,12 @@ module Recurly
|
|
264
278
|
|
265
279
|
# Update an account's acquisition data
|
266
280
|
#
|
267
|
-
# {https://developers.recurly.com/api/
|
281
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_account_acquisition update_account_acquisition api documenation}
|
268
282
|
#
|
269
283
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
270
|
-
# @param body [Requests::
|
271
|
-
# @param
|
284
|
+
# @param body [Requests::AccountAcquisitionUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountAcquisitionUpdate}
|
285
|
+
# @param params [Hash] Optional query string parameters:
|
286
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
272
287
|
#
|
273
288
|
# @return [Resources::AccountAcquisition] An account's updated acquisition data.
|
274
289
|
# @example
|
@@ -295,15 +310,16 @@ module Recurly
|
|
295
310
|
#
|
296
311
|
def update_account_acquisition(account_id:, body:, **options)
|
297
312
|
path = interpolate_path("/accounts/{account_id}/acquisition", account_id: account_id)
|
298
|
-
put(path, body, Requests::
|
313
|
+
put(path, body, Requests::AccountAcquisitionUpdate, **options)
|
299
314
|
end
|
300
315
|
|
301
316
|
# Remove an account's acquisition data
|
302
317
|
#
|
303
|
-
# {https://developers.recurly.com/api/
|
318
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_account_acquisition remove_account_acquisition api documenation}
|
304
319
|
#
|
305
320
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
306
|
-
# @param
|
321
|
+
# @param params [Hash] Optional query string parameters:
|
322
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
307
323
|
#
|
308
324
|
# @return [Resources::Empty] Acquisition data was succesfully deleted.
|
309
325
|
# @example
|
@@ -323,10 +339,11 @@ module Recurly
|
|
323
339
|
|
324
340
|
# Reactivate an inactive account
|
325
341
|
#
|
326
|
-
# {https://developers.recurly.com/api/
|
342
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_account reactivate_account api documenation}
|
327
343
|
#
|
328
344
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
329
|
-
# @param
|
345
|
+
# @param params [Hash] Optional query string parameters:
|
346
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
330
347
|
#
|
331
348
|
# @return [Resources::Account] An account.
|
332
349
|
# @example
|
@@ -346,10 +363,11 @@ module Recurly
|
|
346
363
|
|
347
364
|
# Fetch an account's balance and past due status
|
348
365
|
#
|
349
|
-
# {https://developers.recurly.com/api/
|
366
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_account_balance get_account_balance api documenation}
|
350
367
|
#
|
351
368
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
352
|
-
# @param
|
369
|
+
# @param params [Hash] Optional query string parameters:
|
370
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
353
371
|
#
|
354
372
|
# @return [Resources::AccountBalance] An account's balance.
|
355
373
|
# @example
|
@@ -369,10 +387,11 @@ module Recurly
|
|
369
387
|
|
370
388
|
# Fetch an account's billing information
|
371
389
|
#
|
372
|
-
# {https://developers.recurly.com/api/
|
390
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_billing_info get_billing_info api documenation}
|
373
391
|
#
|
374
392
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
375
|
-
# @param
|
393
|
+
# @param params [Hash] Optional query string parameters:
|
394
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
376
395
|
#
|
377
396
|
# @return [Resources::BillingInfo] An account's billing information.
|
378
397
|
# @example
|
@@ -392,11 +411,12 @@ module Recurly
|
|
392
411
|
|
393
412
|
# Set an account's billing information
|
394
413
|
#
|
395
|
-
# {https://developers.recurly.com/api/
|
414
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_billing_info update_billing_info api documenation}
|
396
415
|
#
|
397
416
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
398
417
|
# @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
|
399
|
-
# @param
|
418
|
+
# @param params [Hash] Optional query string parameters:
|
419
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
400
420
|
#
|
401
421
|
# @return [Resources::BillingInfo] Updated billing information.
|
402
422
|
# @example
|
@@ -423,10 +443,11 @@ module Recurly
|
|
423
443
|
|
424
444
|
# Remove an account's billing information
|
425
445
|
#
|
426
|
-
# {https://developers.recurly.com/api/
|
446
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_billing_info remove_billing_info api documenation}
|
427
447
|
#
|
428
448
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
429
|
-
# @param
|
449
|
+
# @param params [Hash] Optional query string parameters:
|
450
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
430
451
|
#
|
431
452
|
# @return [Resources::Empty] Billing information deleted
|
432
453
|
# @example
|
@@ -446,10 +467,11 @@ module Recurly
|
|
446
467
|
|
447
468
|
# Get the list of billing information associated with an account
|
448
469
|
#
|
449
|
-
# {https://developers.recurly.com/api/
|
470
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_billing_infos list_billing_infos api documenation}
|
450
471
|
#
|
451
472
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
452
|
-
# @param
|
473
|
+
# @param params [Hash] Optional query string parameters:
|
474
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
453
475
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
454
476
|
#
|
455
477
|
# *Important notes:*
|
@@ -461,17 +483,17 @@ module Recurly
|
|
461
483
|
# * Records are returned in an arbitrary order. Since results are all
|
462
484
|
# returned at once you can sort the records yourself.
|
463
485
|
#
|
464
|
-
#
|
486
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
465
487
|
# order. In descending order updated records will move behind the cursor and could
|
466
488
|
# prevent some records from being returned.
|
467
489
|
#
|
468
|
-
#
|
490
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
469
491
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
470
492
|
#
|
471
|
-
#
|
493
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
472
494
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
473
495
|
#
|
474
|
-
#
|
496
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
475
497
|
#
|
476
498
|
# @return [Pager<Resources::BillingInfo>] A list of the the billing information for an account's
|
477
499
|
#
|
@@ -482,11 +504,12 @@ module Recurly
|
|
482
504
|
|
483
505
|
# Set an account's billing information when the wallet feature is enabled
|
484
506
|
#
|
485
|
-
# {https://developers.recurly.com/api/
|
507
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_billing_info create_billing_info api documenation}
|
486
508
|
#
|
487
509
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
488
510
|
# @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
|
489
|
-
# @param
|
511
|
+
# @param params [Hash] Optional query string parameters:
|
512
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
490
513
|
#
|
491
514
|
# @return [Resources::BillingInfo] Updated billing information.
|
492
515
|
#
|
@@ -497,11 +520,12 @@ module Recurly
|
|
497
520
|
|
498
521
|
# Fetch a billing info
|
499
522
|
#
|
500
|
-
# {https://developers.recurly.com/api/
|
523
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_a_billing_info get_a_billing_info api documenation}
|
501
524
|
#
|
502
525
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
503
526
|
# @param billing_info_id [String] Billing Info ID.
|
504
|
-
# @param
|
527
|
+
# @param params [Hash] Optional query string parameters:
|
528
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
505
529
|
#
|
506
530
|
# @return [Resources::BillingInfo] A billing info.
|
507
531
|
#
|
@@ -512,12 +536,13 @@ module Recurly
|
|
512
536
|
|
513
537
|
# Update an account's billing information
|
514
538
|
#
|
515
|
-
# {https://developers.recurly.com/api/
|
539
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_a_billing_info update_a_billing_info api documenation}
|
516
540
|
#
|
517
541
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
518
542
|
# @param billing_info_id [String] Billing Info ID.
|
519
543
|
# @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
|
520
|
-
# @param
|
544
|
+
# @param params [Hash] Optional query string parameters:
|
545
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
521
546
|
#
|
522
547
|
# @return [Resources::BillingInfo] Updated billing information.
|
523
548
|
#
|
@@ -528,11 +553,12 @@ module Recurly
|
|
528
553
|
|
529
554
|
# Remove an account's billing information
|
530
555
|
#
|
531
|
-
# {https://developers.recurly.com/api/
|
556
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_a_billing_info remove_a_billing_info api documenation}
|
532
557
|
#
|
533
558
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
534
559
|
# @param billing_info_id [String] Billing Info ID.
|
535
|
-
# @param
|
560
|
+
# @param params [Hash] Optional query string parameters:
|
561
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
536
562
|
#
|
537
563
|
# @return [Resources::Empty] Billing information deleted
|
538
564
|
#
|
@@ -543,10 +569,11 @@ module Recurly
|
|
543
569
|
|
544
570
|
# Show the coupon redemptions for an account
|
545
571
|
#
|
546
|
-
# {https://developers.recurly.com/api/
|
572
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_coupon_redemptions list_account_coupon_redemptions api documenation}
|
547
573
|
#
|
548
574
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
549
|
-
# @param
|
575
|
+
# @param params [Hash] Optional query string parameters:
|
576
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
550
577
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
551
578
|
#
|
552
579
|
# *Important notes:*
|
@@ -558,24 +585,27 @@ module Recurly
|
|
558
585
|
# * Records are returned in an arbitrary order. Since results are all
|
559
586
|
# returned at once you can sort the records yourself.
|
560
587
|
#
|
561
|
-
#
|
588
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
562
589
|
# order. In descending order updated records will move behind the cursor and could
|
563
590
|
# prevent some records from being returned.
|
564
591
|
#
|
565
|
-
#
|
592
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
566
593
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
567
594
|
#
|
568
|
-
#
|
595
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
569
596
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
570
597
|
#
|
571
|
-
#
|
572
|
-
#
|
598
|
+
# :state [String] Filter by state.
|
599
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
573
600
|
#
|
574
601
|
# @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on an account.
|
575
602
|
# @example
|
603
|
+
# params = {
|
604
|
+
# limit: 200
|
605
|
+
# }
|
576
606
|
# redemptions = @client.list_account_coupon_redemptions(
|
577
607
|
# account_id: account_id,
|
578
|
-
#
|
608
|
+
# params: params
|
579
609
|
# )
|
580
610
|
# redemptions.each do |redemption|
|
581
611
|
# puts "CouponRedemption: #{redemption.id}"
|
@@ -586,36 +616,37 @@ module Recurly
|
|
586
616
|
pager(path, **options)
|
587
617
|
end
|
588
618
|
|
589
|
-
# Show the coupon
|
619
|
+
# Show the coupon redemptions that are active on an account
|
590
620
|
#
|
591
|
-
# {https://developers.recurly.com/api/
|
621
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_active_coupon_redemptions list_active_coupon_redemptions api documenation}
|
592
622
|
#
|
593
623
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
594
|
-
# @param
|
624
|
+
# @param params [Hash] Optional query string parameters:
|
625
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
595
626
|
#
|
596
|
-
# @return [Resources::CouponRedemption]
|
627
|
+
# @return [Pager<Resources::CouponRedemption>] Active coupon redemptions on an account.
|
597
628
|
# @example
|
598
|
-
#
|
599
|
-
#
|
600
|
-
#
|
601
|
-
#
|
602
|
-
#
|
603
|
-
#
|
604
|
-
# puts "Resource Not Found"
|
629
|
+
# params = {
|
630
|
+
# limit: 200
|
631
|
+
# }
|
632
|
+
# redemptions = @client.list_active_coupon_redemptions(account_id: account_id, params: params)
|
633
|
+
# redemptions.each do |redemption|
|
634
|
+
# puts "Redemption: #{redemption.id}"
|
605
635
|
# end
|
606
636
|
#
|
607
|
-
def
|
637
|
+
def list_active_coupon_redemptions(account_id:, **options)
|
608
638
|
path = interpolate_path("/accounts/{account_id}/coupon_redemptions/active", account_id: account_id)
|
609
|
-
|
639
|
+
pager(path, **options)
|
610
640
|
end
|
611
641
|
|
612
642
|
# Generate an active coupon redemption on an account or subscription
|
613
643
|
#
|
614
|
-
# {https://developers.recurly.com/api/
|
644
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_coupon_redemption create_coupon_redemption api documenation}
|
615
645
|
#
|
616
646
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
617
647
|
# @param body [Requests::CouponRedemptionCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponRedemptionCreate}
|
618
|
-
# @param
|
648
|
+
# @param params [Hash] Optional query string parameters:
|
649
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
619
650
|
#
|
620
651
|
# @return [Resources::CouponRedemption] Returns the new coupon redemption.
|
621
652
|
# @example
|
@@ -642,10 +673,11 @@ module Recurly
|
|
642
673
|
|
643
674
|
# Delete the active coupon redemption from an account
|
644
675
|
#
|
645
|
-
# {https://developers.recurly.com/api/
|
676
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_coupon_redemption remove_coupon_redemption api documenation}
|
646
677
|
#
|
647
678
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
648
|
-
# @param
|
679
|
+
# @param params [Hash] Optional query string parameters:
|
680
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
649
681
|
#
|
650
682
|
# @return [Resources::CouponRedemption] Coupon redemption deleted.
|
651
683
|
# @example
|
@@ -665,28 +697,32 @@ module Recurly
|
|
665
697
|
|
666
698
|
# List an account's credit payments
|
667
699
|
#
|
668
|
-
# {https://developers.recurly.com/api/
|
700
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_credit_payments list_account_credit_payments api documenation}
|
669
701
|
#
|
670
702
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
671
|
-
# @param
|
672
|
-
#
|
673
|
-
#
|
703
|
+
# @param params [Hash] Optional query string parameters:
|
704
|
+
# :limit [Integer] Limit number of records 1-200.
|
705
|
+
# :order [String] Sort order.
|
706
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
674
707
|
# order. In descending order updated records will move behind the cursor and could
|
675
708
|
# prevent some records from being returned.
|
676
709
|
#
|
677
|
-
#
|
710
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
678
711
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
679
712
|
#
|
680
|
-
#
|
713
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
681
714
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
682
715
|
#
|
683
|
-
#
|
716
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
684
717
|
#
|
685
718
|
# @return [Pager<Resources::CreditPayment>] A list of the account's credit payments.
|
686
719
|
# @example
|
720
|
+
# params = {
|
721
|
+
# limit: 200
|
722
|
+
# }
|
687
723
|
# payments = @client.list_account_credit_payments(
|
688
724
|
# account_id: account_id,
|
689
|
-
#
|
725
|
+
# params: params
|
690
726
|
# )
|
691
727
|
# payments.each do |payment|
|
692
728
|
# puts "CreditPayment: #{payment.id}"
|
@@ -699,10 +735,11 @@ module Recurly
|
|
699
735
|
|
700
736
|
# List an account's invoices
|
701
737
|
#
|
702
|
-
# {https://developers.recurly.com/api/
|
738
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_invoices list_account_invoices api documenation}
|
703
739
|
#
|
704
740
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
705
|
-
# @param
|
741
|
+
# @param params [Hash] Optional query string parameters:
|
742
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
706
743
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
707
744
|
#
|
708
745
|
# *Important notes:*
|
@@ -714,31 +751,34 @@ module Recurly
|
|
714
751
|
# * Records are returned in an arbitrary order. Since results are all
|
715
752
|
# returned at once you can sort the records yourself.
|
716
753
|
#
|
717
|
-
#
|
718
|
-
#
|
719
|
-
#
|
754
|
+
# :limit [Integer] Limit number of records 1-200.
|
755
|
+
# :order [String] Sort order.
|
756
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
720
757
|
# order. In descending order updated records will move behind the cursor and could
|
721
758
|
# prevent some records from being returned.
|
722
759
|
#
|
723
|
-
#
|
760
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
724
761
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
725
762
|
#
|
726
|
-
#
|
763
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
727
764
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
728
765
|
#
|
729
|
-
#
|
766
|
+
# :type [String] Filter by type when:
|
730
767
|
# - +type=charge+, only charge invoices will be returned.
|
731
768
|
# - +type=credit+, only credit invoices will be returned.
|
732
769
|
# - +type=non-legacy+, only charge and credit invoices will be returned.
|
733
770
|
# - +type=legacy+, only legacy invoices will be returned.
|
734
771
|
#
|
735
|
-
#
|
772
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
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,12 @@ 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:
|
799
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
759
800
|
#
|
760
801
|
# @return [Resources::InvoiceCollection] Returns the new invoices.
|
761
802
|
# @example
|
@@ -782,11 +823,12 @@ module Recurly
|
|
782
823
|
|
783
824
|
# Preview new invoice for pending line items
|
784
825
|
#
|
785
|
-
# {https://developers.recurly.com/api/
|
826
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/preview_invoice preview_invoice api documenation}
|
786
827
|
#
|
787
828
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
788
829
|
# @param body [Requests::InvoiceCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCreate}
|
789
|
-
# @param
|
830
|
+
# @param params [Hash] Optional query string parameters:
|
831
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
790
832
|
#
|
791
833
|
# @return [Resources::InvoiceCollection] Returns the invoice previews.
|
792
834
|
# @example
|
@@ -813,10 +855,11 @@ module Recurly
|
|
813
855
|
|
814
856
|
# List an account's line items
|
815
857
|
#
|
816
|
-
# {https://developers.recurly.com/api/
|
858
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_line_items list_account_line_items api documenation}
|
817
859
|
#
|
818
860
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
819
|
-
# @param
|
861
|
+
# @param params [Hash] Optional query string parameters:
|
862
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
820
863
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
821
864
|
#
|
822
865
|
# *Important notes:*
|
@@ -828,28 +871,31 @@ module Recurly
|
|
828
871
|
# * Records are returned in an arbitrary order. Since results are all
|
829
872
|
# returned at once you can sort the records yourself.
|
830
873
|
#
|
831
|
-
#
|
832
|
-
#
|
833
|
-
#
|
874
|
+
# :limit [Integer] Limit number of records 1-200.
|
875
|
+
# :order [String] Sort order.
|
876
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
834
877
|
# order. In descending order updated records will move behind the cursor and could
|
835
878
|
# prevent some records from being returned.
|
836
879
|
#
|
837
|
-
#
|
880
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
838
881
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
839
882
|
#
|
840
|
-
#
|
883
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
841
884
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
842
885
|
#
|
843
|
-
#
|
844
|
-
#
|
845
|
-
#
|
846
|
-
#
|
886
|
+
# :original [String] Filter by original field.
|
887
|
+
# :state [String] Filter by state field.
|
888
|
+
# :type [String] Filter by type field.
|
889
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
847
890
|
#
|
848
891
|
# @return [Pager<Resources::LineItem>] A list of the account's line items.
|
849
892
|
# @example
|
893
|
+
# params = {
|
894
|
+
# limit: 200
|
895
|
+
# }
|
850
896
|
# line_items = @client.list_account_line_items(
|
851
897
|
# account_id: account_id,
|
852
|
-
#
|
898
|
+
# params: params
|
853
899
|
# )
|
854
900
|
# line_items.each do |line_item|
|
855
901
|
# puts "LineItem: #{line_item.id}"
|
@@ -862,11 +908,12 @@ module Recurly
|
|
862
908
|
|
863
909
|
# Create a new line item for the account
|
864
910
|
#
|
865
|
-
# {https://developers.recurly.com/api/
|
911
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_line_item create_line_item api documenation}
|
866
912
|
#
|
867
913
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
868
914
|
# @param body [Requests::LineItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::LineItemCreate}
|
869
|
-
# @param
|
915
|
+
# @param params [Hash] Optional query string parameters:
|
916
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
870
917
|
#
|
871
918
|
# @return [Resources::LineItem] Returns the new line item.
|
872
919
|
# @example
|
@@ -894,10 +941,11 @@ module Recurly
|
|
894
941
|
|
895
942
|
# Fetch a list of an account's notes
|
896
943
|
#
|
897
|
-
# {https://developers.recurly.com/api/
|
944
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_notes list_account_notes api documenation}
|
898
945
|
#
|
899
946
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
900
|
-
# @param
|
947
|
+
# @param params [Hash] Optional query string parameters:
|
948
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
901
949
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
902
950
|
#
|
903
951
|
# *Important notes:*
|
@@ -909,11 +957,14 @@ module Recurly
|
|
909
957
|
# * Records are returned in an arbitrary order. Since results are all
|
910
958
|
# returned at once you can sort the records yourself.
|
911
959
|
#
|
912
|
-
#
|
960
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
913
961
|
#
|
914
962
|
# @return [Pager<Resources::AccountNote>] A list of an account's notes.
|
915
963
|
# @example
|
916
|
-
#
|
964
|
+
# params = {
|
965
|
+
# limit: 200
|
966
|
+
# }
|
967
|
+
# account_notes = @client.list_account_notes(account_id: account_id, params: params)
|
917
968
|
# account_notes.each do |note|
|
918
969
|
# puts "AccountNote: #{note.message}"
|
919
970
|
# end
|
@@ -925,11 +976,12 @@ module Recurly
|
|
925
976
|
|
926
977
|
# Fetch an account note
|
927
978
|
#
|
928
|
-
# {https://developers.recurly.com/api/
|
979
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_account_note get_account_note api documenation}
|
929
980
|
#
|
930
981
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
931
982
|
# @param account_note_id [String] Account Note ID.
|
932
|
-
# @param
|
983
|
+
# @param params [Hash] Optional query string parameters:
|
984
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
933
985
|
#
|
934
986
|
# @return [Resources::AccountNote] An account note.
|
935
987
|
# @example
|
@@ -952,10 +1004,11 @@ module Recurly
|
|
952
1004
|
|
953
1005
|
# Fetch a list of an account's shipping addresses
|
954
1006
|
#
|
955
|
-
# {https://developers.recurly.com/api/
|
1007
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_shipping_addresses list_shipping_addresses api documenation}
|
956
1008
|
#
|
957
1009
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
958
|
-
# @param
|
1010
|
+
# @param params [Hash] Optional query string parameters:
|
1011
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
959
1012
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
960
1013
|
#
|
961
1014
|
# *Important notes:*
|
@@ -967,25 +1020,28 @@ module Recurly
|
|
967
1020
|
# * Records are returned in an arbitrary order. Since results are all
|
968
1021
|
# returned at once you can sort the records yourself.
|
969
1022
|
#
|
970
|
-
#
|
971
|
-
#
|
972
|
-
#
|
1023
|
+
# :limit [Integer] Limit number of records 1-200.
|
1024
|
+
# :order [String] Sort order.
|
1025
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
973
1026
|
# order. In descending order updated records will move behind the cursor and could
|
974
1027
|
# prevent some records from being returned.
|
975
1028
|
#
|
976
|
-
#
|
1029
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
977
1030
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
978
1031
|
#
|
979
|
-
#
|
1032
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
980
1033
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
981
1034
|
#
|
982
|
-
#
|
1035
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
983
1036
|
#
|
984
1037
|
# @return [Pager<Resources::ShippingAddress>] A list of an account's shipping addresses.
|
985
1038
|
# @example
|
1039
|
+
# params = {
|
1040
|
+
# limit: 200
|
1041
|
+
# }
|
986
1042
|
# shipping_addresses = @client.list_shipping_addresses(
|
987
1043
|
# account_id: account_id,
|
988
|
-
#
|
1044
|
+
# params: params
|
989
1045
|
# )
|
990
1046
|
# shipping_addresses.each do |addr|
|
991
1047
|
# puts "ShippingAddress: #{addr.nickname} - #{addr.street1}"
|
@@ -998,11 +1054,12 @@ module Recurly
|
|
998
1054
|
|
999
1055
|
# Create a new shipping address for the account
|
1000
1056
|
#
|
1001
|
-
# {https://developers.recurly.com/api/
|
1057
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_shipping_address create_shipping_address api documenation}
|
1002
1058
|
#
|
1003
1059
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
1004
1060
|
# @param body [Requests::ShippingAddressCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressCreate}
|
1005
|
-
# @param
|
1061
|
+
# @param params [Hash] Optional query string parameters:
|
1062
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1006
1063
|
#
|
1007
1064
|
# @return [Resources::ShippingAddress] Returns the new shipping address.
|
1008
1065
|
# @example
|
@@ -1032,11 +1089,12 @@ module Recurly
|
|
1032
1089
|
|
1033
1090
|
# Fetch an account's shipping address
|
1034
1091
|
#
|
1035
|
-
# {https://developers.recurly.com/api/
|
1092
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_shipping_address get_shipping_address api documenation}
|
1036
1093
|
#
|
1037
1094
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
1038
1095
|
# @param shipping_address_id [String] Shipping Address ID.
|
1039
|
-
# @param
|
1096
|
+
# @param params [Hash] Optional query string parameters:
|
1097
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1040
1098
|
#
|
1041
1099
|
# @return [Resources::ShippingAddress] A shipping address.
|
1042
1100
|
# @example
|
@@ -1059,12 +1117,13 @@ module Recurly
|
|
1059
1117
|
|
1060
1118
|
# Update an account's shipping address
|
1061
1119
|
#
|
1062
|
-
# {https://developers.recurly.com/api/
|
1120
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_shipping_address update_shipping_address api documenation}
|
1063
1121
|
#
|
1064
1122
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
1065
1123
|
# @param shipping_address_id [String] Shipping Address ID.
|
1066
1124
|
# @param body [Requests::ShippingAddressUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressUpdate}
|
1067
|
-
# @param
|
1125
|
+
# @param params [Hash] Optional query string parameters:
|
1126
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1068
1127
|
#
|
1069
1128
|
# @return [Resources::ShippingAddress] The updated shipping address.
|
1070
1129
|
# @example
|
@@ -1093,11 +1152,12 @@ module Recurly
|
|
1093
1152
|
|
1094
1153
|
# Remove an account's shipping address
|
1095
1154
|
#
|
1096
|
-
# {https://developers.recurly.com/api/
|
1155
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_shipping_address remove_shipping_address api documenation}
|
1097
1156
|
#
|
1098
1157
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
1099
1158
|
# @param shipping_address_id [String] Shipping Address ID.
|
1100
|
-
# @param
|
1159
|
+
# @param params [Hash] Optional query string parameters:
|
1160
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1101
1161
|
#
|
1102
1162
|
# @return [Resources::Empty] Shipping address deleted.
|
1103
1163
|
# @example
|
@@ -1120,10 +1180,11 @@ module Recurly
|
|
1120
1180
|
|
1121
1181
|
# List an account's subscriptions
|
1122
1182
|
#
|
1123
|
-
# {https://developers.recurly.com/api/
|
1183
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_subscriptions list_account_subscriptions api documenation}
|
1124
1184
|
#
|
1125
1185
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
1126
|
-
# @param
|
1186
|
+
# @param params [Hash] Optional query string parameters:
|
1187
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1127
1188
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1128
1189
|
#
|
1129
1190
|
# *Important notes:*
|
@@ -1135,31 +1196,34 @@ module Recurly
|
|
1135
1196
|
# * Records are returned in an arbitrary order. Since results are all
|
1136
1197
|
# returned at once you can sort the records yourself.
|
1137
1198
|
#
|
1138
|
-
#
|
1139
|
-
#
|
1140
|
-
#
|
1199
|
+
# :limit [Integer] Limit number of records 1-200.
|
1200
|
+
# :order [String] Sort order.
|
1201
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1141
1202
|
# order. In descending order updated records will move behind the cursor and could
|
1142
1203
|
# prevent some records from being returned.
|
1143
1204
|
#
|
1144
|
-
#
|
1205
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1145
1206
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1146
1207
|
#
|
1147
|
-
#
|
1208
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1148
1209
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1149
1210
|
#
|
1150
|
-
#
|
1211
|
+
# :state [String] Filter by state.
|
1151
1212
|
#
|
1152
1213
|
# - When +state=active+, +state=canceled+, +state=expired+, or +state=future+, subscriptions with states that match the query and only those subscriptions will be returned.
|
1153
1214
|
# - When +state=in_trial+, only subscriptions that have a trial_started_at date earlier than now and a trial_ends_at date later than now will be returned.
|
1154
1215
|
# - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
|
1155
1216
|
#
|
1156
|
-
#
|
1217
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1157
1218
|
#
|
1158
1219
|
# @return [Pager<Resources::Subscription>] A list of the account's subscriptions.
|
1159
1220
|
# @example
|
1221
|
+
# params = {
|
1222
|
+
# limit: 200
|
1223
|
+
# }
|
1160
1224
|
# subscriptions = @client.list_account_subscriptions(
|
1161
1225
|
# account_id: account_id,
|
1162
|
-
#
|
1226
|
+
# params: params
|
1163
1227
|
# )
|
1164
1228
|
# subscriptions.each do |subscription|
|
1165
1229
|
# puts "Subscription: #{subscription.uuid}"
|
@@ -1172,10 +1236,11 @@ module Recurly
|
|
1172
1236
|
|
1173
1237
|
# List an account's transactions
|
1174
1238
|
#
|
1175
|
-
# {https://developers.recurly.com/api/
|
1239
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_transactions list_account_transactions api documenation}
|
1176
1240
|
#
|
1177
1241
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
1178
|
-
# @param
|
1242
|
+
# @param params [Hash] Optional query string parameters:
|
1243
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1179
1244
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1180
1245
|
#
|
1181
1246
|
# *Important notes:*
|
@@ -1187,27 +1252,30 @@ module Recurly
|
|
1187
1252
|
# * Records are returned in an arbitrary order. Since results are all
|
1188
1253
|
# returned at once you can sort the records yourself.
|
1189
1254
|
#
|
1190
|
-
#
|
1191
|
-
#
|
1192
|
-
#
|
1255
|
+
# :limit [Integer] Limit number of records 1-200.
|
1256
|
+
# :order [String] Sort order.
|
1257
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1193
1258
|
# order. In descending order updated records will move behind the cursor and could
|
1194
1259
|
# prevent some records from being returned.
|
1195
1260
|
#
|
1196
|
-
#
|
1261
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1197
1262
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1198
1263
|
#
|
1199
|
-
#
|
1264
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1200
1265
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1201
1266
|
#
|
1202
|
-
#
|
1203
|
-
#
|
1204
|
-
#
|
1267
|
+
# :type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions.
|
1268
|
+
# :success [String] Filter by success field.
|
1269
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1205
1270
|
#
|
1206
1271
|
# @return [Pager<Resources::Transaction>] A list of the account's transactions.
|
1207
1272
|
# @example
|
1273
|
+
# params = {
|
1274
|
+
# limit: 200
|
1275
|
+
# }
|
1208
1276
|
# transactions = @client.list_account_transactions(
|
1209
1277
|
# account_id: account_id,
|
1210
|
-
#
|
1278
|
+
# params: params
|
1211
1279
|
# )
|
1212
1280
|
# transactions.each do |transaction|
|
1213
1281
|
# puts "Transaction: #{transaction.uuid}"
|
@@ -1220,10 +1288,11 @@ module Recurly
|
|
1220
1288
|
|
1221
1289
|
# List an account's child accounts
|
1222
1290
|
#
|
1223
|
-
# {https://developers.recurly.com/api/
|
1291
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_child_accounts list_child_accounts api documenation}
|
1224
1292
|
#
|
1225
1293
|
# @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
|
1226
|
-
# @param
|
1294
|
+
# @param params [Hash] Optional query string parameters:
|
1295
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1227
1296
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1228
1297
|
#
|
1229
1298
|
# *Important notes:*
|
@@ -1235,30 +1304,33 @@ module Recurly
|
|
1235
1304
|
# * Records are returned in an arbitrary order. Since results are all
|
1236
1305
|
# returned at once you can sort the records yourself.
|
1237
1306
|
#
|
1238
|
-
#
|
1239
|
-
#
|
1240
|
-
#
|
1307
|
+
# :limit [Integer] Limit number of records 1-200.
|
1308
|
+
# :order [String] Sort order.
|
1309
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1241
1310
|
# order. In descending order updated records will move behind the cursor and could
|
1242
1311
|
# prevent some records from being returned.
|
1243
1312
|
#
|
1244
|
-
#
|
1313
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1245
1314
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1246
1315
|
#
|
1247
|
-
#
|
1316
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1248
1317
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1249
1318
|
#
|
1250
|
-
#
|
1251
|
-
#
|
1319
|
+
# :email [String] Filter for accounts with this exact email address. A blank value will return accounts with both +null+ and +""+ email addresses. Note that multiple accounts can share one email address.
|
1320
|
+
# :subscriber [Boolean] Filter for accounts with or without a subscription in the +active+,
|
1252
1321
|
# +canceled+, or +future+ state.
|
1253
1322
|
#
|
1254
|
-
#
|
1255
|
-
#
|
1323
|
+
# :past_due [String] Filter for accounts with an invoice in the +past_due+ state.
|
1324
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1256
1325
|
#
|
1257
1326
|
# @return [Pager<Resources::Account>] A list of an account's child accounts.
|
1258
1327
|
# @example
|
1328
|
+
# params = {
|
1329
|
+
# limit: 200
|
1330
|
+
# }
|
1259
1331
|
# child_accounts = @client.list_child_accounts(
|
1260
1332
|
# account_id: account_id,
|
1261
|
-
#
|
1333
|
+
# params: params
|
1262
1334
|
# )
|
1263
1335
|
# child_accounts.each do |child|
|
1264
1336
|
# puts "Account: #{child.code}"
|
@@ -1271,9 +1343,10 @@ module Recurly
|
|
1271
1343
|
|
1272
1344
|
# List a site's account acquisition data
|
1273
1345
|
#
|
1274
|
-
# {https://developers.recurly.com/api/
|
1346
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_account_acquisition list_account_acquisition api documenation}
|
1275
1347
|
#
|
1276
|
-
# @param
|
1348
|
+
# @param params [Hash] Optional query string parameters:
|
1349
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1277
1350
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1278
1351
|
#
|
1279
1352
|
# *Important notes:*
|
@@ -1285,23 +1358,26 @@ module Recurly
|
|
1285
1358
|
# * Records are returned in an arbitrary order. Since results are all
|
1286
1359
|
# returned at once you can sort the records yourself.
|
1287
1360
|
#
|
1288
|
-
#
|
1289
|
-
#
|
1290
|
-
#
|
1361
|
+
# :limit [Integer] Limit number of records 1-200.
|
1362
|
+
# :order [String] Sort order.
|
1363
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1291
1364
|
# order. In descending order updated records will move behind the cursor and could
|
1292
1365
|
# prevent some records from being returned.
|
1293
1366
|
#
|
1294
|
-
#
|
1367
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1295
1368
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1296
1369
|
#
|
1297
|
-
#
|
1370
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1298
1371
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1299
1372
|
#
|
1300
|
-
#
|
1373
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1301
1374
|
#
|
1302
1375
|
# @return [Pager<Resources::AccountAcquisition>] A list of the site's account acquisition data.
|
1303
1376
|
# @example
|
1304
|
-
#
|
1377
|
+
# params = {
|
1378
|
+
# limit: 200
|
1379
|
+
# }
|
1380
|
+
# acquisitions = @client.list_account_acquisition(params: params)
|
1305
1381
|
# acquisitions.each do |acquisition|
|
1306
1382
|
# puts "AccountAcquisition: #{acquisition.cost}"
|
1307
1383
|
# end
|
@@ -1313,9 +1389,10 @@ module Recurly
|
|
1313
1389
|
|
1314
1390
|
# List a site's coupons
|
1315
1391
|
#
|
1316
|
-
# {https://developers.recurly.com/api/
|
1392
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_coupons list_coupons api documenation}
|
1317
1393
|
#
|
1318
|
-
# @param
|
1394
|
+
# @param params [Hash] Optional query string parameters:
|
1395
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1319
1396
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1320
1397
|
#
|
1321
1398
|
# *Important notes:*
|
@@ -1327,23 +1404,26 @@ module Recurly
|
|
1327
1404
|
# * Records are returned in an arbitrary order. Since results are all
|
1328
1405
|
# returned at once you can sort the records yourself.
|
1329
1406
|
#
|
1330
|
-
#
|
1331
|
-
#
|
1332
|
-
#
|
1407
|
+
# :limit [Integer] Limit number of records 1-200.
|
1408
|
+
# :order [String] Sort order.
|
1409
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1333
1410
|
# order. In descending order updated records will move behind the cursor and could
|
1334
1411
|
# prevent some records from being returned.
|
1335
1412
|
#
|
1336
|
-
#
|
1413
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1337
1414
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1338
1415
|
#
|
1339
|
-
#
|
1416
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1340
1417
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1341
1418
|
#
|
1342
|
-
#
|
1419
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1343
1420
|
#
|
1344
1421
|
# @return [Pager<Resources::Coupon>] A list of the site's coupons.
|
1345
1422
|
# @example
|
1346
|
-
#
|
1423
|
+
# params = {
|
1424
|
+
# limit: 200
|
1425
|
+
# }
|
1426
|
+
# coupons = @client.list_coupons(params: params)
|
1347
1427
|
# coupons.each do |coupon|
|
1348
1428
|
# puts "coupon: #{coupon.code}"
|
1349
1429
|
# end
|
@@ -1355,10 +1435,11 @@ module Recurly
|
|
1355
1435
|
|
1356
1436
|
# Create a new coupon
|
1357
1437
|
#
|
1358
|
-
# {https://developers.recurly.com/api/
|
1438
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_coupon create_coupon api documenation}
|
1359
1439
|
#
|
1360
1440
|
# @param body [Requests::CouponCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponCreate}
|
1361
|
-
# @param
|
1441
|
+
# @param params [Hash] Optional query string parameters:
|
1442
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1362
1443
|
#
|
1363
1444
|
# @return [Resources::Coupon] A new coupon.
|
1364
1445
|
# @example
|
@@ -1391,10 +1472,11 @@ module Recurly
|
|
1391
1472
|
|
1392
1473
|
# Fetch a coupon
|
1393
1474
|
#
|
1394
|
-
# {https://developers.recurly.com/api/
|
1475
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_coupon get_coupon api documenation}
|
1395
1476
|
#
|
1396
1477
|
# @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
|
1397
|
-
# @param
|
1478
|
+
# @param params [Hash] Optional query string parameters:
|
1479
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1398
1480
|
#
|
1399
1481
|
# @return [Resources::Coupon] A coupon.
|
1400
1482
|
# @example
|
@@ -1414,11 +1496,12 @@ module Recurly
|
|
1414
1496
|
|
1415
1497
|
# Update an active coupon
|
1416
1498
|
#
|
1417
|
-
# {https://developers.recurly.com/api/
|
1499
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_coupon update_coupon api documenation}
|
1418
1500
|
#
|
1419
1501
|
# @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
|
1420
1502
|
# @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
|
1421
|
-
# @param
|
1503
|
+
# @param params [Hash] Optional query string parameters:
|
1504
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1422
1505
|
#
|
1423
1506
|
# @return [Resources::Coupon] The updated coupon.
|
1424
1507
|
# @example
|
@@ -1441,10 +1524,11 @@ module Recurly
|
|
1441
1524
|
|
1442
1525
|
# Expire a coupon
|
1443
1526
|
#
|
1444
|
-
# {https://developers.recurly.com/api/
|
1527
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_coupon deactivate_coupon api documenation}
|
1445
1528
|
#
|
1446
1529
|
# @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
|
1447
|
-
# @param
|
1530
|
+
# @param params [Hash] Optional query string parameters:
|
1531
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1448
1532
|
#
|
1449
1533
|
# @return [Resources::Coupon] The expired Coupon
|
1450
1534
|
# @example
|
@@ -1462,26 +1546,32 @@ module Recurly
|
|
1462
1546
|
delete(path, **options)
|
1463
1547
|
end
|
1464
1548
|
|
1549
|
+
# Generate unique coupon codes
|
1550
|
+
#
|
1551
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/generate_unique_coupon_codes generate_unique_coupon_codes api documenation}
|
1552
|
+
#
|
1553
|
+
# @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
|
1554
|
+
# @param body [Requests::CouponBulkCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponBulkCreate}
|
1555
|
+
# @param params [Hash] Optional query string parameters:
|
1556
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1557
|
+
#
|
1558
|
+
# @return [Resources::UniqueCouponCodeParams] A set of parameters that can be passed to the `list_unique_coupon_codes` endpoint to obtain only the newly generated `UniqueCouponCodes`.
|
1559
|
+
#
|
1560
|
+
def generate_unique_coupon_codes(coupon_id:, body:, **options)
|
1561
|
+
path = interpolate_path("/coupons/{coupon_id}/generate", coupon_id: coupon_id)
|
1562
|
+
post(path, body, Requests::CouponBulkCreate, **options)
|
1563
|
+
end
|
1564
|
+
|
1465
1565
|
# Restore an inactive coupon
|
1466
1566
|
#
|
1467
|
-
# {https://developers.recurly.com/api/
|
1567
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/restore_coupon restore_coupon api documenation}
|
1468
1568
|
#
|
1469
1569
|
# @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
|
1470
1570
|
# @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
|
1471
|
-
# @param
|
1571
|
+
# @param params [Hash] Optional query string parameters:
|
1572
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1472
1573
|
#
|
1473
1574
|
# @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
1575
|
#
|
1486
1576
|
def restore_coupon(coupon_id:, body:, **options)
|
1487
1577
|
path = interpolate_path("/coupons/{coupon_id}/restore", coupon_id: coupon_id)
|
@@ -1490,10 +1580,11 @@ module Recurly
|
|
1490
1580
|
|
1491
1581
|
# List unique coupon codes associated with a bulk coupon
|
1492
1582
|
#
|
1493
|
-
# {https://developers.recurly.com/api/
|
1583
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_unique_coupon_codes list_unique_coupon_codes api documenation}
|
1494
1584
|
#
|
1495
1585
|
# @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+.
|
1496
|
-
# @param
|
1586
|
+
# @param params [Hash] Optional query string parameters:
|
1587
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1497
1588
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1498
1589
|
#
|
1499
1590
|
# *Important notes:*
|
@@ -1505,19 +1596,19 @@ module Recurly
|
|
1505
1596
|
# * Records are returned in an arbitrary order. Since results are all
|
1506
1597
|
# returned at once you can sort the records yourself.
|
1507
1598
|
#
|
1508
|
-
#
|
1509
|
-
#
|
1510
|
-
#
|
1599
|
+
# :limit [Integer] Limit number of records 1-200.
|
1600
|
+
# :order [String] Sort order.
|
1601
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1511
1602
|
# order. In descending order updated records will move behind the cursor and could
|
1512
1603
|
# prevent some records from being returned.
|
1513
1604
|
#
|
1514
|
-
#
|
1605
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1515
1606
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1516
1607
|
#
|
1517
|
-
#
|
1608
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1518
1609
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1519
1610
|
#
|
1520
|
-
#
|
1611
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1521
1612
|
#
|
1522
1613
|
# @return [Pager<Resources::UniqueCouponCode>] A list of unique coupon codes that were generated
|
1523
1614
|
#
|
@@ -1528,25 +1619,29 @@ module Recurly
|
|
1528
1619
|
|
1529
1620
|
# List a site's credit payments
|
1530
1621
|
#
|
1531
|
-
# {https://developers.recurly.com/api/
|
1622
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_credit_payments list_credit_payments api documenation}
|
1532
1623
|
#
|
1533
|
-
# @param
|
1534
|
-
#
|
1535
|
-
#
|
1624
|
+
# @param params [Hash] Optional query string parameters:
|
1625
|
+
# :limit [Integer] Limit number of records 1-200.
|
1626
|
+
# :order [String] Sort order.
|
1627
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1536
1628
|
# order. In descending order updated records will move behind the cursor and could
|
1537
1629
|
# prevent some records from being returned.
|
1538
1630
|
#
|
1539
|
-
#
|
1631
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1540
1632
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1541
1633
|
#
|
1542
|
-
#
|
1634
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1543
1635
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1544
1636
|
#
|
1545
|
-
#
|
1637
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1546
1638
|
#
|
1547
1639
|
# @return [Pager<Resources::CreditPayment>] A list of the site's credit payments.
|
1548
1640
|
# @example
|
1549
|
-
#
|
1641
|
+
# params = {
|
1642
|
+
# limit: 200
|
1643
|
+
# }
|
1644
|
+
# payments = @client.list_credit_payments(params: params)
|
1550
1645
|
# payments.each do |payment|
|
1551
1646
|
# puts "CreditPayment: #{payment.id}"
|
1552
1647
|
# end
|
@@ -1558,10 +1653,11 @@ module Recurly
|
|
1558
1653
|
|
1559
1654
|
# Fetch a credit payment
|
1560
1655
|
#
|
1561
|
-
# {https://developers.recurly.com/api/
|
1656
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_credit_payment get_credit_payment api documenation}
|
1562
1657
|
#
|
1563
1658
|
# @param credit_payment_id [String] Credit Payment ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
|
1564
|
-
# @param
|
1659
|
+
# @param params [Hash] Optional query string parameters:
|
1660
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1565
1661
|
#
|
1566
1662
|
# @return [Resources::CreditPayment] A credit payment.
|
1567
1663
|
#
|
@@ -1572,9 +1668,10 @@ module Recurly
|
|
1572
1668
|
|
1573
1669
|
# List a site's custom field definitions
|
1574
1670
|
#
|
1575
|
-
# {https://developers.recurly.com/api/
|
1671
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_custom_field_definitions list_custom_field_definitions api documenation}
|
1576
1672
|
#
|
1577
|
-
# @param
|
1673
|
+
# @param params [Hash] Optional query string parameters:
|
1674
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1578
1675
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1579
1676
|
#
|
1580
1677
|
# *Important notes:*
|
@@ -1586,24 +1683,27 @@ module Recurly
|
|
1586
1683
|
# * Records are returned in an arbitrary order. Since results are all
|
1587
1684
|
# returned at once you can sort the records yourself.
|
1588
1685
|
#
|
1589
|
-
#
|
1590
|
-
#
|
1591
|
-
#
|
1686
|
+
# :limit [Integer] Limit number of records 1-200.
|
1687
|
+
# :order [String] Sort order.
|
1688
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1592
1689
|
# order. In descending order updated records will move behind the cursor and could
|
1593
1690
|
# prevent some records from being returned.
|
1594
1691
|
#
|
1595
|
-
#
|
1692
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1596
1693
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1597
1694
|
#
|
1598
|
-
#
|
1695
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1599
1696
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1600
1697
|
#
|
1601
|
-
#
|
1602
|
-
#
|
1698
|
+
# :related_type [String] Filter by related type.
|
1699
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1603
1700
|
#
|
1604
1701
|
# @return [Pager<Resources::CustomFieldDefinition>] A list of the site's custom field definitions.
|
1605
1702
|
# @example
|
1606
|
-
#
|
1703
|
+
# params = {
|
1704
|
+
# limit: 200
|
1705
|
+
# }
|
1706
|
+
# custom_fields = @client.list_custom_field_definitions(params: params)
|
1607
1707
|
# custom_fields.each do |field|
|
1608
1708
|
# puts "CustomFieldDefinition: #{field.name}"
|
1609
1709
|
# end
|
@@ -1615,10 +1715,11 @@ module Recurly
|
|
1615
1715
|
|
1616
1716
|
# Fetch an custom field definition
|
1617
1717
|
#
|
1618
|
-
# {https://developers.recurly.com/api/
|
1718
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_custom_field_definition get_custom_field_definition api documenation}
|
1619
1719
|
#
|
1620
1720
|
# @param custom_field_definition_id [String] Custom Field Definition ID
|
1621
|
-
# @param
|
1721
|
+
# @param params [Hash] Optional query string parameters:
|
1722
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1622
1723
|
#
|
1623
1724
|
# @return [Resources::CustomFieldDefinition] An custom field definition.
|
1624
1725
|
# @example
|
@@ -1640,9 +1741,10 @@ module Recurly
|
|
1640
1741
|
|
1641
1742
|
# List a site's items
|
1642
1743
|
#
|
1643
|
-
# {https://developers.recurly.com/api/
|
1744
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_items list_items api documenation}
|
1644
1745
|
#
|
1645
|
-
# @param
|
1746
|
+
# @param params [Hash] Optional query string parameters:
|
1747
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1646
1748
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1647
1749
|
#
|
1648
1750
|
# *Important notes:*
|
@@ -1654,24 +1756,27 @@ module Recurly
|
|
1654
1756
|
# * Records are returned in an arbitrary order. Since results are all
|
1655
1757
|
# returned at once you can sort the records yourself.
|
1656
1758
|
#
|
1657
|
-
#
|
1658
|
-
#
|
1659
|
-
#
|
1759
|
+
# :limit [Integer] Limit number of records 1-200.
|
1760
|
+
# :order [String] Sort order.
|
1761
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1660
1762
|
# order. In descending order updated records will move behind the cursor and could
|
1661
1763
|
# prevent some records from being returned.
|
1662
1764
|
#
|
1663
|
-
#
|
1765
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1664
1766
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1665
1767
|
#
|
1666
|
-
#
|
1768
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1667
1769
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1668
1770
|
#
|
1669
|
-
#
|
1670
|
-
#
|
1771
|
+
# :state [String] Filter by state.
|
1772
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1671
1773
|
#
|
1672
1774
|
# @return [Pager<Resources::Item>] A list of the site's items.
|
1673
1775
|
# @example
|
1674
|
-
#
|
1776
|
+
# params = {
|
1777
|
+
# limit: 200
|
1778
|
+
# }
|
1779
|
+
# items = @client.list_items(params: params)
|
1675
1780
|
# items.each do |item|
|
1676
1781
|
# puts "Item: #{item.code}"
|
1677
1782
|
# end
|
@@ -1683,10 +1788,11 @@ module Recurly
|
|
1683
1788
|
|
1684
1789
|
# Create a new item
|
1685
1790
|
#
|
1686
|
-
# {https://developers.recurly.com/api/
|
1791
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_item create_item api documenation}
|
1687
1792
|
#
|
1688
1793
|
# @param body [Requests::ItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemCreate}
|
1689
|
-
# @param
|
1794
|
+
# @param params [Hash] Optional query string parameters:
|
1795
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1690
1796
|
#
|
1691
1797
|
# @return [Resources::Item] A new item.
|
1692
1798
|
# @example
|
@@ -1718,10 +1824,11 @@ module Recurly
|
|
1718
1824
|
|
1719
1825
|
# Fetch an item
|
1720
1826
|
#
|
1721
|
-
# {https://developers.recurly.com/api/
|
1827
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_item get_item api documenation}
|
1722
1828
|
#
|
1723
1829
|
# @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
|
1724
|
-
# @param
|
1830
|
+
# @param params [Hash] Optional query string parameters:
|
1831
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1725
1832
|
#
|
1726
1833
|
# @return [Resources::Item] An item.
|
1727
1834
|
# @example
|
@@ -1741,11 +1848,12 @@ module Recurly
|
|
1741
1848
|
|
1742
1849
|
# Update an active item
|
1743
1850
|
#
|
1744
|
-
# {https://developers.recurly.com/api/
|
1851
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_item update_item api documenation}
|
1745
1852
|
#
|
1746
1853
|
# @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
|
1747
1854
|
# @param body [Requests::ItemUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemUpdate}
|
1748
|
-
# @param
|
1855
|
+
# @param params [Hash] Optional query string parameters:
|
1856
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1749
1857
|
#
|
1750
1858
|
# @return [Resources::Item] The updated item.
|
1751
1859
|
# @example
|
@@ -1772,10 +1880,11 @@ module Recurly
|
|
1772
1880
|
|
1773
1881
|
# Deactivate an item
|
1774
1882
|
#
|
1775
|
-
# {https://developers.recurly.com/api/
|
1883
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_item deactivate_item api documenation}
|
1776
1884
|
#
|
1777
1885
|
# @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
|
1778
|
-
# @param
|
1886
|
+
# @param params [Hash] Optional query string parameters:
|
1887
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1779
1888
|
#
|
1780
1889
|
# @return [Resources::Item] An item.
|
1781
1890
|
# @example
|
@@ -1795,10 +1904,11 @@ module Recurly
|
|
1795
1904
|
|
1796
1905
|
# Reactivate an inactive item
|
1797
1906
|
#
|
1798
|
-
# {https://developers.recurly.com/api/
|
1907
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_item reactivate_item api documenation}
|
1799
1908
|
#
|
1800
1909
|
# @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+.
|
1801
|
-
# @param
|
1910
|
+
# @param params [Hash] Optional query string parameters:
|
1911
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1802
1912
|
#
|
1803
1913
|
# @return [Resources::Item] An item.
|
1804
1914
|
# @example
|
@@ -1818,9 +1928,10 @@ module Recurly
|
|
1818
1928
|
|
1819
1929
|
# List a site's measured units
|
1820
1930
|
#
|
1821
|
-
# {https://developers.recurly.com/api/
|
1931
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_measured_unit list_measured_unit api documenation}
|
1822
1932
|
#
|
1823
|
-
# @param
|
1933
|
+
# @param params [Hash] Optional query string parameters:
|
1934
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1824
1935
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1825
1936
|
#
|
1826
1937
|
# *Important notes:*
|
@@ -1832,20 +1943,20 @@ module Recurly
|
|
1832
1943
|
# * Records are returned in an arbitrary order. Since results are all
|
1833
1944
|
# returned at once you can sort the records yourself.
|
1834
1945
|
#
|
1835
|
-
#
|
1836
|
-
#
|
1837
|
-
#
|
1946
|
+
# :limit [Integer] Limit number of records 1-200.
|
1947
|
+
# :order [String] Sort order.
|
1948
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1838
1949
|
# order. In descending order updated records will move behind the cursor and could
|
1839
1950
|
# prevent some records from being returned.
|
1840
1951
|
#
|
1841
|
-
#
|
1952
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1842
1953
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1843
1954
|
#
|
1844
|
-
#
|
1955
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1845
1956
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1846
1957
|
#
|
1847
|
-
#
|
1848
|
-
#
|
1958
|
+
# :state [String] Filter by state.
|
1959
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1849
1960
|
#
|
1850
1961
|
# @return [Pager<Resources::MeasuredUnit>] A list of the site's measured units.
|
1851
1962
|
#
|
@@ -1856,10 +1967,11 @@ module Recurly
|
|
1856
1967
|
|
1857
1968
|
# Create a new measured unit
|
1858
1969
|
#
|
1859
|
-
# {https://developers.recurly.com/api/
|
1970
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_measured_unit create_measured_unit api documenation}
|
1860
1971
|
#
|
1861
1972
|
# @param body [Requests::MeasuredUnitCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::MeasuredUnitCreate}
|
1862
|
-
# @param
|
1973
|
+
# @param params [Hash] Optional query string parameters:
|
1974
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1863
1975
|
#
|
1864
1976
|
# @return [Resources::MeasuredUnit] A new measured unit.
|
1865
1977
|
#
|
@@ -1870,10 +1982,11 @@ module Recurly
|
|
1870
1982
|
|
1871
1983
|
# Fetch a measured unit
|
1872
1984
|
#
|
1873
|
-
# {https://developers.recurly.com/api/
|
1985
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_measured_unit get_measured_unit api documenation}
|
1874
1986
|
#
|
1875
1987
|
# @param measured_unit_id [String] Measured unit ID or name. For ID no prefix is used e.g. +e28zov4fw0v2+. For name use prefix +name-+, e.g. +name-Storage+.
|
1876
|
-
# @param
|
1988
|
+
# @param params [Hash] Optional query string parameters:
|
1989
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1877
1990
|
#
|
1878
1991
|
# @return [Resources::MeasuredUnit] An item.
|
1879
1992
|
#
|
@@ -1884,11 +1997,12 @@ module Recurly
|
|
1884
1997
|
|
1885
1998
|
# Update a measured unit
|
1886
1999
|
#
|
1887
|
-
# {https://developers.recurly.com/api/
|
2000
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_measured_unit update_measured_unit api documenation}
|
1888
2001
|
#
|
1889
2002
|
# @param measured_unit_id [String] Measured unit ID or name. For ID no prefix is used e.g. +e28zov4fw0v2+. For name use prefix +name-+, e.g. +name-Storage+.
|
1890
2003
|
# @param body [Requests::MeasuredUnitUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::MeasuredUnitUpdate}
|
1891
|
-
# @param
|
2004
|
+
# @param params [Hash] Optional query string parameters:
|
2005
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1892
2006
|
#
|
1893
2007
|
# @return [Resources::MeasuredUnit] The updated measured_unit.
|
1894
2008
|
#
|
@@ -1899,10 +2013,11 @@ module Recurly
|
|
1899
2013
|
|
1900
2014
|
# Remove a measured unit
|
1901
2015
|
#
|
1902
|
-
# {https://developers.recurly.com/api/
|
2016
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_measured_unit remove_measured_unit api documenation}
|
1903
2017
|
#
|
1904
2018
|
# @param measured_unit_id [String] Measured unit ID or name. For ID no prefix is used e.g. +e28zov4fw0v2+. For name use prefix +name-+, e.g. +name-Storage+.
|
1905
|
-
# @param
|
2019
|
+
# @param params [Hash] Optional query string parameters:
|
2020
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1906
2021
|
#
|
1907
2022
|
# @return [Resources::MeasuredUnit] A measured unit.
|
1908
2023
|
#
|
@@ -1913,9 +2028,10 @@ module Recurly
|
|
1913
2028
|
|
1914
2029
|
# List a site's invoices
|
1915
2030
|
#
|
1916
|
-
# {https://developers.recurly.com/api/
|
2031
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_invoices list_invoices api documenation}
|
1917
2032
|
#
|
1918
|
-
# @param
|
2033
|
+
# @param params [Hash] Optional query string parameters:
|
2034
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1919
2035
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
1920
2036
|
#
|
1921
2037
|
# *Important notes:*
|
@@ -1927,29 +2043,32 @@ module Recurly
|
|
1927
2043
|
# * Records are returned in an arbitrary order. Since results are all
|
1928
2044
|
# returned at once you can sort the records yourself.
|
1929
2045
|
#
|
1930
|
-
#
|
1931
|
-
#
|
1932
|
-
#
|
2046
|
+
# :limit [Integer] Limit number of records 1-200.
|
2047
|
+
# :order [String] Sort order.
|
2048
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1933
2049
|
# order. In descending order updated records will move behind the cursor and could
|
1934
2050
|
# prevent some records from being returned.
|
1935
2051
|
#
|
1936
|
-
#
|
2052
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1937
2053
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1938
2054
|
#
|
1939
|
-
#
|
2055
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1940
2056
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1941
2057
|
#
|
1942
|
-
#
|
2058
|
+
# :type [String] Filter by type when:
|
1943
2059
|
# - +type=charge+, only charge invoices will be returned.
|
1944
2060
|
# - +type=credit+, only credit invoices will be returned.
|
1945
2061
|
# - +type=non-legacy+, only charge and credit invoices will be returned.
|
1946
2062
|
# - +type=legacy+, only legacy invoices will be returned.
|
1947
2063
|
#
|
1948
|
-
#
|
2064
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1949
2065
|
#
|
1950
2066
|
# @return [Pager<Resources::Invoice>] A list of the site's invoices.
|
1951
2067
|
# @example
|
1952
|
-
#
|
2068
|
+
# params = {
|
2069
|
+
# limit: 200
|
2070
|
+
# }
|
2071
|
+
# invoices = @client.list_invoices(params: params)
|
1953
2072
|
# invoices.each do |invoice|
|
1954
2073
|
# puts "Invoice: #{invoice.number}"
|
1955
2074
|
# end
|
@@ -1961,10 +2080,11 @@ module Recurly
|
|
1961
2080
|
|
1962
2081
|
# Fetch an invoice
|
1963
2082
|
#
|
1964
|
-
# {https://developers.recurly.com/api/
|
2083
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_invoice get_invoice api documenation}
|
1965
2084
|
#
|
1966
2085
|
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
1967
|
-
# @param
|
2086
|
+
# @param params [Hash] Optional query string parameters:
|
2087
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1968
2088
|
#
|
1969
2089
|
# @return [Resources::Invoice] An invoice.
|
1970
2090
|
# @example
|
@@ -1984,11 +2104,12 @@ module Recurly
|
|
1984
2104
|
|
1985
2105
|
# Update an invoice
|
1986
2106
|
#
|
1987
|
-
# {https://developers.recurly.com/api/
|
2107
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_invoice update_invoice api documenation}
|
1988
2108
|
#
|
1989
2109
|
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
1990
|
-
# @param body [Requests::
|
1991
|
-
# @param
|
2110
|
+
# @param body [Requests::InvoiceUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceUpdate}
|
2111
|
+
# @param params [Hash] Optional query string parameters:
|
2112
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
1992
2113
|
#
|
1993
2114
|
# @return [Resources::Invoice] An invoice.
|
1994
2115
|
# @example
|
@@ -1997,7 +2118,7 @@ module Recurly
|
|
1997
2118
|
# customer_notes: "New Notes",
|
1998
2119
|
# terms_and_conditions: "New Terms and Conditions"
|
1999
2120
|
# }
|
2000
|
-
# invoice = @client.
|
2121
|
+
# invoice = @client.update_invoice(invoice_id: invoice_id, body: invoice_update)
|
2001
2122
|
# puts "Updated invoice #{invoice}"
|
2002
2123
|
# rescue Recurly::Errors::NotFoundError
|
2003
2124
|
# # If the resource was not found, you may want to alert the user or
|
@@ -2005,17 +2126,18 @@ module Recurly
|
|
2005
2126
|
# puts "Resource Not Found"
|
2006
2127
|
# end
|
2007
2128
|
#
|
2008
|
-
def
|
2129
|
+
def update_invoice(invoice_id:, body:, **options)
|
2009
2130
|
path = interpolate_path("/invoices/{invoice_id}", invoice_id: invoice_id)
|
2010
|
-
put(path, body, Requests::
|
2131
|
+
put(path, body, Requests::InvoiceUpdate, **options)
|
2011
2132
|
end
|
2012
2133
|
|
2013
2134
|
# Fetch an invoice as a PDF
|
2014
2135
|
#
|
2015
|
-
# {https://developers.recurly.com/api/
|
2136
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_invoice_pdf get_invoice_pdf api documenation}
|
2016
2137
|
#
|
2017
2138
|
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
2018
|
-
# @param
|
2139
|
+
# @param params [Hash] Optional query string parameters:
|
2140
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2019
2141
|
#
|
2020
2142
|
# @return [Resources::BinaryFile] An invoice as a PDF.
|
2021
2143
|
# @example
|
@@ -2038,11 +2160,12 @@ module Recurly
|
|
2038
2160
|
|
2039
2161
|
# Collect a pending or past due, automatic invoice
|
2040
2162
|
#
|
2041
|
-
# {https://developers.recurly.com/api/
|
2163
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/collect_invoice collect_invoice api documenation}
|
2042
2164
|
#
|
2043
2165
|
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
2044
|
-
# @param
|
2045
|
-
#
|
2166
|
+
# @param params [Hash] Optional query string parameters:
|
2167
|
+
# :body [Requests::InvoiceCollect] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCollect}
|
2168
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2046
2169
|
#
|
2047
2170
|
# @return [Resources::Invoice] The updated invoice.
|
2048
2171
|
# @example
|
@@ -2062,15 +2185,16 @@ module Recurly
|
|
2062
2185
|
|
2063
2186
|
# Mark an open invoice as failed
|
2064
2187
|
#
|
2065
|
-
# {https://developers.recurly.com/api/
|
2188
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/mark_invoice_failed mark_invoice_failed api documenation}
|
2066
2189
|
#
|
2067
2190
|
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
2068
|
-
# @param
|
2191
|
+
# @param params [Hash] Optional query string parameters:
|
2192
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2069
2193
|
#
|
2070
2194
|
# @return [Resources::Invoice] The updated invoice.
|
2071
2195
|
# @example
|
2072
2196
|
# begin
|
2073
|
-
# invoice = @client.
|
2197
|
+
# invoice = @client.mark_invoice_failed(invoice_id: invoice_id)
|
2074
2198
|
# puts "Failed invoice #{invoice}"
|
2075
2199
|
# rescue Recurly::Errors::NotFoundError
|
2076
2200
|
# # If the resource was not found, you may want to alert the user or
|
@@ -2078,17 +2202,18 @@ module Recurly
|
|
2078
2202
|
# puts "Resource Not Found"
|
2079
2203
|
# end
|
2080
2204
|
#
|
2081
|
-
def
|
2205
|
+
def mark_invoice_failed(invoice_id:, **options)
|
2082
2206
|
path = interpolate_path("/invoices/{invoice_id}/mark_failed", invoice_id: invoice_id)
|
2083
2207
|
put(path, **options)
|
2084
2208
|
end
|
2085
2209
|
|
2086
2210
|
# Mark an open invoice as successful
|
2087
2211
|
#
|
2088
|
-
# {https://developers.recurly.com/api/
|
2212
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/mark_invoice_successful mark_invoice_successful api documenation}
|
2089
2213
|
#
|
2090
2214
|
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
2091
|
-
# @param
|
2215
|
+
# @param params [Hash] Optional query string parameters:
|
2216
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2092
2217
|
#
|
2093
2218
|
# @return [Resources::Invoice] The updated invoice.
|
2094
2219
|
# @example
|
@@ -2108,10 +2233,11 @@ module Recurly
|
|
2108
2233
|
|
2109
2234
|
# Reopen a closed, manual invoice
|
2110
2235
|
#
|
2111
|
-
# {https://developers.recurly.com/api/
|
2236
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reopen_invoice reopen_invoice api documenation}
|
2112
2237
|
#
|
2113
2238
|
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
2114
|
-
# @param
|
2239
|
+
# @param params [Hash] Optional query string parameters:
|
2240
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2115
2241
|
#
|
2116
2242
|
# @return [Resources::Invoice] The updated invoice.
|
2117
2243
|
# @example
|
@@ -2131,10 +2257,11 @@ module Recurly
|
|
2131
2257
|
|
2132
2258
|
# Void a credit invoice.
|
2133
2259
|
#
|
2134
|
-
# {https://developers.recurly.com/api/
|
2260
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/void_invoice void_invoice api documenation}
|
2135
2261
|
#
|
2136
2262
|
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
2137
|
-
# @param
|
2263
|
+
# @param params [Hash] Optional query string parameters:
|
2264
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2138
2265
|
#
|
2139
2266
|
# @return [Resources::Invoice] The updated invoice.
|
2140
2267
|
# @example
|
@@ -2154,11 +2281,12 @@ module Recurly
|
|
2154
2281
|
|
2155
2282
|
# Record an external payment for a manual invoices.
|
2156
2283
|
#
|
2157
|
-
# {https://developers.recurly.com/api/
|
2284
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/record_external_transaction record_external_transaction api documenation}
|
2158
2285
|
#
|
2159
2286
|
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
2160
2287
|
# @param body [Requests::ExternalTransaction] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ExternalTransaction}
|
2161
|
-
# @param
|
2288
|
+
# @param params [Hash] Optional query string parameters:
|
2289
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2162
2290
|
#
|
2163
2291
|
# @return [Resources::Transaction] The recorded transaction.
|
2164
2292
|
#
|
@@ -2169,10 +2297,11 @@ module Recurly
|
|
2169
2297
|
|
2170
2298
|
# List an invoice's line items
|
2171
2299
|
#
|
2172
|
-
# {https://developers.recurly.com/api/
|
2300
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_line_items list_invoice_line_items api documenation}
|
2173
2301
|
#
|
2174
2302
|
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
2175
|
-
# @param
|
2303
|
+
# @param params [Hash] Optional query string parameters:
|
2304
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2176
2305
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2177
2306
|
#
|
2178
2307
|
# *Important notes:*
|
@@ -2184,28 +2313,31 @@ module Recurly
|
|
2184
2313
|
# * Records are returned in an arbitrary order. Since results are all
|
2185
2314
|
# returned at once you can sort the records yourself.
|
2186
2315
|
#
|
2187
|
-
#
|
2188
|
-
#
|
2189
|
-
#
|
2316
|
+
# :limit [Integer] Limit number of records 1-200.
|
2317
|
+
# :order [String] Sort order.
|
2318
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2190
2319
|
# order. In descending order updated records will move behind the cursor and could
|
2191
2320
|
# prevent some records from being returned.
|
2192
2321
|
#
|
2193
|
-
#
|
2322
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2194
2323
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2195
2324
|
#
|
2196
|
-
#
|
2325
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2197
2326
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2198
2327
|
#
|
2199
|
-
#
|
2200
|
-
#
|
2201
|
-
#
|
2202
|
-
#
|
2328
|
+
# :original [String] Filter by original field.
|
2329
|
+
# :state [String] Filter by state field.
|
2330
|
+
# :type [String] Filter by type field.
|
2331
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2203
2332
|
#
|
2204
2333
|
# @return [Pager<Resources::LineItem>] A list of the invoice's line items.
|
2205
2334
|
# @example
|
2335
|
+
# params = {
|
2336
|
+
# limit: 200
|
2337
|
+
# }
|
2206
2338
|
# line_items = @client.list_invoice_line_items(
|
2207
2339
|
# invoice_id: invoice_id,
|
2208
|
-
#
|
2340
|
+
# params: params
|
2209
2341
|
# )
|
2210
2342
|
# line_items.each do |line_item|
|
2211
2343
|
# puts "Line Item: #{line_item.id}"
|
@@ -2218,10 +2350,11 @@ module Recurly
|
|
2218
2350
|
|
2219
2351
|
# Show the coupon redemptions applied to an invoice
|
2220
2352
|
#
|
2221
|
-
# {https://developers.recurly.com/api/
|
2353
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_coupon_redemptions list_invoice_coupon_redemptions api documenation}
|
2222
2354
|
#
|
2223
2355
|
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
2224
|
-
# @param
|
2356
|
+
# @param params [Hash] Optional query string parameters:
|
2357
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2225
2358
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2226
2359
|
#
|
2227
2360
|
# *Important notes:*
|
@@ -2233,23 +2366,26 @@ module Recurly
|
|
2233
2366
|
# * Records are returned in an arbitrary order. Since results are all
|
2234
2367
|
# returned at once you can sort the records yourself.
|
2235
2368
|
#
|
2236
|
-
#
|
2369
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2237
2370
|
# order. In descending order updated records will move behind the cursor and could
|
2238
2371
|
# prevent some records from being returned.
|
2239
2372
|
#
|
2240
|
-
#
|
2373
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2241
2374
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2242
2375
|
#
|
2243
|
-
#
|
2376
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2244
2377
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2245
2378
|
#
|
2246
|
-
#
|
2379
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2247
2380
|
#
|
2248
2381
|
# @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions associated with the invoice.
|
2249
2382
|
# @example
|
2383
|
+
# params = {
|
2384
|
+
# limit: 200
|
2385
|
+
# }
|
2250
2386
|
# coupon_redemptions = @client.list_invoice_coupon_redemptions(
|
2251
2387
|
# invoice_id: invoice_id,
|
2252
|
-
#
|
2388
|
+
# params: params
|
2253
2389
|
# )
|
2254
2390
|
# coupon_redemptions.each do |redemption|
|
2255
2391
|
# puts "CouponRedemption: #{redemption.id}"
|
@@ -2262,16 +2398,20 @@ module Recurly
|
|
2262
2398
|
|
2263
2399
|
# List an invoice's related credit or charge invoices
|
2264
2400
|
#
|
2265
|
-
# {https://developers.recurly.com/api/
|
2401
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_related_invoices list_related_invoices api documenation}
|
2266
2402
|
#
|
2267
2403
|
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
2268
|
-
# @param
|
2404
|
+
# @param params [Hash] Optional query string parameters:
|
2405
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2269
2406
|
#
|
2270
2407
|
# @return [Pager<Resources::Invoice>] A list of the credit or charge invoices associated with the invoice.
|
2271
2408
|
# @example
|
2409
|
+
# params = {
|
2410
|
+
# limit: 200
|
2411
|
+
# }
|
2272
2412
|
# invoices = @client.list_related_invoices(
|
2273
2413
|
# invoice_id: invoice_id,
|
2274
|
-
#
|
2414
|
+
# params: params
|
2275
2415
|
# )
|
2276
2416
|
# invoices.each do |invoice|
|
2277
2417
|
# puts "Invoice: #{invoice.number}"
|
@@ -2284,11 +2424,12 @@ module Recurly
|
|
2284
2424
|
|
2285
2425
|
# Refund an invoice
|
2286
2426
|
#
|
2287
|
-
# {https://developers.recurly.com/api/
|
2427
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/refund_invoice refund_invoice api documenation}
|
2288
2428
|
#
|
2289
2429
|
# @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+.
|
2290
2430
|
# @param body [Requests::InvoiceRefund] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceRefund}
|
2291
|
-
# @param
|
2431
|
+
# @param params [Hash] Optional query string parameters:
|
2432
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2292
2433
|
#
|
2293
2434
|
# @return [Resources::Invoice] Returns the new credit invoice.
|
2294
2435
|
# @example
|
@@ -2315,9 +2456,10 @@ module Recurly
|
|
2315
2456
|
|
2316
2457
|
# List a site's line items
|
2317
2458
|
#
|
2318
|
-
# {https://developers.recurly.com/api/
|
2459
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_line_items list_line_items api documenation}
|
2319
2460
|
#
|
2320
|
-
# @param
|
2461
|
+
# @param params [Hash] Optional query string parameters:
|
2462
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2321
2463
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2322
2464
|
#
|
2323
2465
|
# *Important notes:*
|
@@ -2329,27 +2471,30 @@ module Recurly
|
|
2329
2471
|
# * Records are returned in an arbitrary order. Since results are all
|
2330
2472
|
# returned at once you can sort the records yourself.
|
2331
2473
|
#
|
2332
|
-
#
|
2333
|
-
#
|
2334
|
-
#
|
2474
|
+
# :limit [Integer] Limit number of records 1-200.
|
2475
|
+
# :order [String] Sort order.
|
2476
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2335
2477
|
# order. In descending order updated records will move behind the cursor and could
|
2336
2478
|
# prevent some records from being returned.
|
2337
2479
|
#
|
2338
|
-
#
|
2480
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2339
2481
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2340
2482
|
#
|
2341
|
-
#
|
2483
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2342
2484
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2343
2485
|
#
|
2344
|
-
#
|
2345
|
-
#
|
2346
|
-
#
|
2347
|
-
#
|
2486
|
+
# :original [String] Filter by original field.
|
2487
|
+
# :state [String] Filter by state field.
|
2488
|
+
# :type [String] Filter by type field.
|
2489
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2348
2490
|
#
|
2349
2491
|
# @return [Pager<Resources::LineItem>] A list of the site's line items.
|
2350
2492
|
# @example
|
2351
|
-
#
|
2493
|
+
# params = {
|
2352
2494
|
# limit: 200
|
2495
|
+
# }
|
2496
|
+
# line_items = @client.list_line_items(
|
2497
|
+
# params: params
|
2353
2498
|
# )
|
2354
2499
|
# line_items.each do |line_item|
|
2355
2500
|
# puts "LineItem: #{line_item.id}"
|
@@ -2362,10 +2507,11 @@ module Recurly
|
|
2362
2507
|
|
2363
2508
|
# Fetch a line item
|
2364
2509
|
#
|
2365
|
-
# {https://developers.recurly.com/api/
|
2510
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_line_item get_line_item api documenation}
|
2366
2511
|
#
|
2367
2512
|
# @param line_item_id [String] Line Item ID.
|
2368
|
-
# @param
|
2513
|
+
# @param params [Hash] Optional query string parameters:
|
2514
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2369
2515
|
#
|
2370
2516
|
# @return [Resources::LineItem] A line item.
|
2371
2517
|
# @example
|
@@ -2385,10 +2531,11 @@ module Recurly
|
|
2385
2531
|
|
2386
2532
|
# Delete an uninvoiced line item
|
2387
2533
|
#
|
2388
|
-
# {https://developers.recurly.com/api/
|
2534
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_line_item remove_line_item api documenation}
|
2389
2535
|
#
|
2390
2536
|
# @param line_item_id [String] Line Item ID.
|
2391
|
-
# @param
|
2537
|
+
# @param params [Hash] Optional query string parameters:
|
2538
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2392
2539
|
#
|
2393
2540
|
# @return [Resources::Empty] Line item deleted.
|
2394
2541
|
# @example
|
@@ -2410,9 +2557,10 @@ module Recurly
|
|
2410
2557
|
|
2411
2558
|
# List a site's plans
|
2412
2559
|
#
|
2413
|
-
# {https://developers.recurly.com/api/
|
2560
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_plans list_plans api documenation}
|
2414
2561
|
#
|
2415
|
-
# @param
|
2562
|
+
# @param params [Hash] Optional query string parameters:
|
2563
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2416
2564
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2417
2565
|
#
|
2418
2566
|
# *Important notes:*
|
@@ -2424,24 +2572,27 @@ module Recurly
|
|
2424
2572
|
# * Records are returned in an arbitrary order. Since results are all
|
2425
2573
|
# returned at once you can sort the records yourself.
|
2426
2574
|
#
|
2427
|
-
#
|
2428
|
-
#
|
2429
|
-
#
|
2575
|
+
# :limit [Integer] Limit number of records 1-200.
|
2576
|
+
# :order [String] Sort order.
|
2577
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2430
2578
|
# order. In descending order updated records will move behind the cursor and could
|
2431
2579
|
# prevent some records from being returned.
|
2432
2580
|
#
|
2433
|
-
#
|
2581
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2434
2582
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2435
2583
|
#
|
2436
|
-
#
|
2584
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2437
2585
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2438
2586
|
#
|
2439
|
-
#
|
2440
|
-
#
|
2587
|
+
# :state [String] Filter by state.
|
2588
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2441
2589
|
#
|
2442
2590
|
# @return [Pager<Resources::Plan>] A list of plans.
|
2443
2591
|
# @example
|
2444
|
-
#
|
2592
|
+
# params = {
|
2593
|
+
# limit: 200
|
2594
|
+
# }
|
2595
|
+
# plans = @client.list_plans(params: params)
|
2445
2596
|
# plans.each do |plan|
|
2446
2597
|
# puts "Plan: #{plan.code}"
|
2447
2598
|
# end
|
@@ -2453,10 +2604,11 @@ module Recurly
|
|
2453
2604
|
|
2454
2605
|
# Create a plan
|
2455
2606
|
#
|
2456
|
-
# {https://developers.recurly.com/api/
|
2607
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_plan create_plan api documenation}
|
2457
2608
|
#
|
2458
2609
|
# @param body [Requests::PlanCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PlanCreate}
|
2459
|
-
# @param
|
2610
|
+
# @param params [Hash] Optional query string parameters:
|
2611
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2460
2612
|
#
|
2461
2613
|
# @return [Resources::Plan] A plan.
|
2462
2614
|
# @example
|
@@ -2493,10 +2645,11 @@ module Recurly
|
|
2493
2645
|
|
2494
2646
|
# Fetch a plan
|
2495
2647
|
#
|
2496
|
-
# {https://developers.recurly.com/api/
|
2648
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_plan get_plan api documenation}
|
2497
2649
|
#
|
2498
2650
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
2499
|
-
# @param
|
2651
|
+
# @param params [Hash] Optional query string parameters:
|
2652
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2500
2653
|
#
|
2501
2654
|
# @return [Resources::Plan] A plan.
|
2502
2655
|
# @example
|
@@ -2516,11 +2669,12 @@ module Recurly
|
|
2516
2669
|
|
2517
2670
|
# Update a plan
|
2518
2671
|
#
|
2519
|
-
# {https://developers.recurly.com/api/
|
2672
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_plan update_plan api documenation}
|
2520
2673
|
#
|
2521
2674
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
2522
2675
|
# @param body [Requests::PlanUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PlanUpdate}
|
2523
|
-
# @param
|
2676
|
+
# @param params [Hash] Optional query string parameters:
|
2677
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2524
2678
|
#
|
2525
2679
|
# @return [Resources::Plan] A plan.
|
2526
2680
|
# @example
|
@@ -2543,10 +2697,11 @@ module Recurly
|
|
2543
2697
|
|
2544
2698
|
# Remove a plan
|
2545
2699
|
#
|
2546
|
-
# {https://developers.recurly.com/api/
|
2700
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_plan remove_plan api documenation}
|
2547
2701
|
#
|
2548
2702
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
2549
|
-
# @param
|
2703
|
+
# @param params [Hash] Optional query string parameters:
|
2704
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2550
2705
|
#
|
2551
2706
|
# @return [Resources::Plan] Plan deleted
|
2552
2707
|
# @example
|
@@ -2566,10 +2721,11 @@ module Recurly
|
|
2566
2721
|
|
2567
2722
|
# List a plan's add-ons
|
2568
2723
|
#
|
2569
|
-
# {https://developers.recurly.com/api/
|
2724
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_plan_add_ons list_plan_add_ons api documenation}
|
2570
2725
|
#
|
2571
2726
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
2572
|
-
# @param
|
2727
|
+
# @param params [Hash] Optional query string parameters:
|
2728
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2573
2729
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2574
2730
|
#
|
2575
2731
|
# *Important notes:*
|
@@ -2581,26 +2737,29 @@ module Recurly
|
|
2581
2737
|
# * Records are returned in an arbitrary order. Since results are all
|
2582
2738
|
# returned at once you can sort the records yourself.
|
2583
2739
|
#
|
2584
|
-
#
|
2585
|
-
#
|
2586
|
-
#
|
2740
|
+
# :limit [Integer] Limit number of records 1-200.
|
2741
|
+
# :order [String] Sort order.
|
2742
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2587
2743
|
# order. In descending order updated records will move behind the cursor and could
|
2588
2744
|
# prevent some records from being returned.
|
2589
2745
|
#
|
2590
|
-
#
|
2746
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2591
2747
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2592
2748
|
#
|
2593
|
-
#
|
2749
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2594
2750
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2595
2751
|
#
|
2596
|
-
#
|
2597
|
-
#
|
2752
|
+
# :state [String] Filter by state.
|
2753
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2598
2754
|
#
|
2599
2755
|
# @return [Pager<Resources::AddOn>] A list of add-ons.
|
2600
2756
|
# @example
|
2757
|
+
# params = {
|
2758
|
+
# limit: 200
|
2759
|
+
# }
|
2601
2760
|
# add_ons = @client.list_plan_add_ons(
|
2602
2761
|
# plan_id: plan_id,
|
2603
|
-
#
|
2762
|
+
# params: params
|
2604
2763
|
# )
|
2605
2764
|
# add_ons.each do |add_on|
|
2606
2765
|
# puts "AddOn: #{add_on.code}"
|
@@ -2613,11 +2772,12 @@ module Recurly
|
|
2613
2772
|
|
2614
2773
|
# Create an add-on
|
2615
2774
|
#
|
2616
|
-
# {https://developers.recurly.com/api/
|
2775
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_plan_add_on create_plan_add_on api documenation}
|
2617
2776
|
#
|
2618
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+.
|
2619
2778
|
# @param body [Requests::AddOnCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnCreate}
|
2620
|
-
# @param
|
2779
|
+
# @param params [Hash] Optional query string parameters:
|
2780
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2621
2781
|
#
|
2622
2782
|
# @return [Resources::AddOn] An add-on.
|
2623
2783
|
# @example
|
@@ -2648,11 +2808,12 @@ module Recurly
|
|
2648
2808
|
|
2649
2809
|
# Fetch a plan's add-on
|
2650
2810
|
#
|
2651
|
-
# {https://developers.recurly.com/api/
|
2811
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_plan_add_on get_plan_add_on api documenation}
|
2652
2812
|
#
|
2653
2813
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
2654
2814
|
# @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
2655
|
-
# @param
|
2815
|
+
# @param params [Hash] Optional query string parameters:
|
2816
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2656
2817
|
#
|
2657
2818
|
# @return [Resources::AddOn] An add-on.
|
2658
2819
|
# @example
|
@@ -2674,12 +2835,13 @@ module Recurly
|
|
2674
2835
|
|
2675
2836
|
# Update an add-on
|
2676
2837
|
#
|
2677
|
-
# {https://developers.recurly.com/api/
|
2838
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_plan_add_on update_plan_add_on api documenation}
|
2678
2839
|
#
|
2679
2840
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
2680
2841
|
# @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
2681
2842
|
# @param body [Requests::AddOnUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnUpdate}
|
2682
|
-
# @param
|
2843
|
+
# @param params [Hash] Optional query string parameters:
|
2844
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2683
2845
|
#
|
2684
2846
|
# @return [Resources::AddOn] An add-on.
|
2685
2847
|
# @example
|
@@ -2706,11 +2868,12 @@ module Recurly
|
|
2706
2868
|
|
2707
2869
|
# Remove an add-on
|
2708
2870
|
#
|
2709
|
-
# {https://developers.recurly.com/api/
|
2871
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_plan_add_on remove_plan_add_on api documenation}
|
2710
2872
|
#
|
2711
2873
|
# @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
2712
2874
|
# @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
2713
|
-
# @param
|
2875
|
+
# @param params [Hash] Optional query string parameters:
|
2876
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2714
2877
|
#
|
2715
2878
|
# @return [Resources::AddOn] Add-on deleted
|
2716
2879
|
# @example
|
@@ -2733,9 +2896,10 @@ module Recurly
|
|
2733
2896
|
|
2734
2897
|
# List a site's add-ons
|
2735
2898
|
#
|
2736
|
-
# {https://developers.recurly.com/api/
|
2899
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_add_ons list_add_ons api documenation}
|
2737
2900
|
#
|
2738
|
-
# @param
|
2901
|
+
# @param params [Hash] Optional query string parameters:
|
2902
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2739
2903
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2740
2904
|
#
|
2741
2905
|
# *Important notes:*
|
@@ -2747,25 +2911,28 @@ module Recurly
|
|
2747
2911
|
# * Records are returned in an arbitrary order. Since results are all
|
2748
2912
|
# returned at once you can sort the records yourself.
|
2749
2913
|
#
|
2750
|
-
#
|
2751
|
-
#
|
2752
|
-
#
|
2914
|
+
# :limit [Integer] Limit number of records 1-200.
|
2915
|
+
# :order [String] Sort order.
|
2916
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2753
2917
|
# order. In descending order updated records will move behind the cursor and could
|
2754
2918
|
# prevent some records from being returned.
|
2755
2919
|
#
|
2756
|
-
#
|
2920
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2757
2921
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2758
2922
|
#
|
2759
|
-
#
|
2923
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2760
2924
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2761
2925
|
#
|
2762
|
-
#
|
2763
|
-
#
|
2926
|
+
# :state [String] Filter by state.
|
2927
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2764
2928
|
#
|
2765
2929
|
# @return [Pager<Resources::AddOn>] A list of add-ons.
|
2766
2930
|
# @example
|
2767
|
-
#
|
2931
|
+
# params = {
|
2768
2932
|
# limit: 200
|
2933
|
+
# }
|
2934
|
+
# add_ons = @client.list_add_ons(
|
2935
|
+
# params: params
|
2769
2936
|
# )
|
2770
2937
|
# add_ons.each do |add_on|
|
2771
2938
|
# puts "AddOn: #{add_on.code}"
|
@@ -2778,10 +2945,11 @@ module Recurly
|
|
2778
2945
|
|
2779
2946
|
# Fetch an add-on
|
2780
2947
|
#
|
2781
|
-
# {https://developers.recurly.com/api/
|
2948
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_add_on get_add_on api documenation}
|
2782
2949
|
#
|
2783
2950
|
# @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+.
|
2784
|
-
# @param
|
2951
|
+
# @param params [Hash] Optional query string parameters:
|
2952
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2785
2953
|
#
|
2786
2954
|
# @return [Resources::AddOn] An add-on.
|
2787
2955
|
# @example
|
@@ -2801,9 +2969,10 @@ module Recurly
|
|
2801
2969
|
|
2802
2970
|
# List a site's shipping methods
|
2803
2971
|
#
|
2804
|
-
# {https://developers.recurly.com/api/
|
2972
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_shipping_methods list_shipping_methods api documenation}
|
2805
2973
|
#
|
2806
|
-
# @param
|
2974
|
+
# @param params [Hash] Optional query string parameters:
|
2975
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2807
2976
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2808
2977
|
#
|
2809
2978
|
# *Important notes:*
|
@@ -2815,24 +2984,27 @@ module Recurly
|
|
2815
2984
|
# * Records are returned in an arbitrary order. Since results are all
|
2816
2985
|
# returned at once you can sort the records yourself.
|
2817
2986
|
#
|
2818
|
-
#
|
2819
|
-
#
|
2820
|
-
#
|
2987
|
+
# :limit [Integer] Limit number of records 1-200.
|
2988
|
+
# :order [String] Sort order.
|
2989
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2821
2990
|
# order. In descending order updated records will move behind the cursor and could
|
2822
2991
|
# prevent some records from being returned.
|
2823
2992
|
#
|
2824
|
-
#
|
2993
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2825
2994
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2826
2995
|
#
|
2827
|
-
#
|
2996
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2828
2997
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2829
2998
|
#
|
2830
|
-
#
|
2999
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2831
3000
|
#
|
2832
3001
|
# @return [Pager<Resources::ShippingMethod>] A list of the site's shipping methods.
|
2833
3002
|
# @example
|
2834
|
-
#
|
3003
|
+
# params = {
|
2835
3004
|
# limit: 200
|
3005
|
+
# }
|
3006
|
+
# shipping_methods = @client.list_shipping_methods(
|
3007
|
+
# params: params
|
2836
3008
|
# )
|
2837
3009
|
# shipping_methods.each do |shipping_method|
|
2838
3010
|
# puts "Shipping Method: #{shipping_method.code}"
|
@@ -2845,10 +3017,11 @@ module Recurly
|
|
2845
3017
|
|
2846
3018
|
# Create a new shipping method
|
2847
3019
|
#
|
2848
|
-
# {https://developers.recurly.com/api/
|
3020
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_shipping_method create_shipping_method api documenation}
|
2849
3021
|
#
|
2850
3022
|
# @param body [Requests::ShippingMethodCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingMethodCreate}
|
2851
|
-
# @param
|
3023
|
+
# @param params [Hash] Optional query string parameters:
|
3024
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2852
3025
|
#
|
2853
3026
|
# @return [Resources::ShippingMethod] A new shipping method.
|
2854
3027
|
#
|
@@ -2859,25 +3032,27 @@ module Recurly
|
|
2859
3032
|
|
2860
3033
|
# Fetch a shipping method
|
2861
3034
|
#
|
2862
|
-
# {https://developers.recurly.com/api/
|
3035
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_shipping_method get_shipping_method api documenation}
|
2863
3036
|
#
|
2864
|
-
# @param
|
2865
|
-
# @param
|
3037
|
+
# @param shipping_method_id [String] Shipping Method ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-usps_2-day+.
|
3038
|
+
# @param params [Hash] Optional query string parameters:
|
3039
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2866
3040
|
#
|
2867
3041
|
# @return [Resources::ShippingMethod] A shipping method.
|
2868
3042
|
#
|
2869
|
-
def get_shipping_method(
|
2870
|
-
path = interpolate_path("/shipping_methods/{
|
3043
|
+
def get_shipping_method(shipping_method_id:, **options)
|
3044
|
+
path = interpolate_path("/shipping_methods/{shipping_method_id}", shipping_method_id: shipping_method_id)
|
2871
3045
|
get(path, **options)
|
2872
3046
|
end
|
2873
3047
|
|
2874
3048
|
# Update an active Shipping Method
|
2875
3049
|
#
|
2876
|
-
# {https://developers.recurly.com/api/
|
3050
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_shipping_method update_shipping_method api documenation}
|
2877
3051
|
#
|
2878
3052
|
# @param shipping_method_id [String] Shipping Method ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-usps_2-day+.
|
2879
3053
|
# @param body [Requests::ShippingMethodUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingMethodUpdate}
|
2880
|
-
# @param
|
3054
|
+
# @param params [Hash] Optional query string parameters:
|
3055
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2881
3056
|
#
|
2882
3057
|
# @return [Resources::ShippingMethod] The updated shipping method.
|
2883
3058
|
#
|
@@ -2888,10 +3063,11 @@ module Recurly
|
|
2888
3063
|
|
2889
3064
|
# Deactivate a shipping method
|
2890
3065
|
#
|
2891
|
-
# {https://developers.recurly.com/api/
|
3066
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_shipping_method deactivate_shipping_method api documenation}
|
2892
3067
|
#
|
2893
3068
|
# @param shipping_method_id [String] Shipping Method ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-usps_2-day+.
|
2894
|
-
# @param
|
3069
|
+
# @param params [Hash] Optional query string parameters:
|
3070
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2895
3071
|
#
|
2896
3072
|
# @return [Resources::ShippingMethod] A shipping method.
|
2897
3073
|
#
|
@@ -2902,9 +3078,10 @@ module Recurly
|
|
2902
3078
|
|
2903
3079
|
# List a site's subscriptions
|
2904
3080
|
#
|
2905
|
-
# {https://developers.recurly.com/api/
|
3081
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_subscriptions list_subscriptions api documenation}
|
2906
3082
|
#
|
2907
|
-
# @param
|
3083
|
+
# @param params [Hash] Optional query string parameters:
|
3084
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
2908
3085
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
2909
3086
|
#
|
2910
3087
|
# *Important notes:*
|
@@ -2916,29 +3093,32 @@ module Recurly
|
|
2916
3093
|
# * Records are returned in an arbitrary order. Since results are all
|
2917
3094
|
# returned at once you can sort the records yourself.
|
2918
3095
|
#
|
2919
|
-
#
|
2920
|
-
#
|
2921
|
-
#
|
3096
|
+
# :limit [Integer] Limit number of records 1-200.
|
3097
|
+
# :order [String] Sort order.
|
3098
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
2922
3099
|
# order. In descending order updated records will move behind the cursor and could
|
2923
3100
|
# prevent some records from being returned.
|
2924
3101
|
#
|
2925
|
-
#
|
3102
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
2926
3103
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2927
3104
|
#
|
2928
|
-
#
|
3105
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
2929
3106
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
2930
3107
|
#
|
2931
|
-
#
|
3108
|
+
# :state [String] Filter by state.
|
2932
3109
|
#
|
2933
3110
|
# - When +state=active+, +state=canceled+, +state=expired+, or +state=future+, subscriptions with states that match the query and only those subscriptions will be returned.
|
2934
3111
|
# - When +state=in_trial+, only subscriptions that have a trial_started_at date earlier than now and a trial_ends_at date later than now will be returned.
|
2935
3112
|
# - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
|
2936
3113
|
#
|
2937
|
-
#
|
3114
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2938
3115
|
#
|
2939
3116
|
# @return [Pager<Resources::Subscription>] A list of the site's subscriptions.
|
2940
3117
|
# @example
|
2941
|
-
#
|
3118
|
+
# params = {
|
3119
|
+
# limit: 200
|
3120
|
+
# }
|
3121
|
+
# subscriptions = @client.list_subscriptions(params: params)
|
2942
3122
|
# subscriptions.each do |subscription|
|
2943
3123
|
# puts "Subscription: #{subscription.uuid}"
|
2944
3124
|
# end
|
@@ -2950,10 +3130,11 @@ module Recurly
|
|
2950
3130
|
|
2951
3131
|
# Create a new subscription
|
2952
3132
|
#
|
2953
|
-
# {https://developers.recurly.com/api/
|
3133
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_subscription create_subscription api documenation}
|
2954
3134
|
#
|
2955
3135
|
# @param body [Requests::SubscriptionCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionCreate}
|
2956
|
-
# @param
|
3136
|
+
# @param params [Hash] Optional query string parameters:
|
3137
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
2957
3138
|
#
|
2958
3139
|
# @return [Resources::Subscription] A subscription.
|
2959
3140
|
# @example
|
@@ -2961,8 +3142,7 @@ module Recurly
|
|
2961
3142
|
# subscription_create = {
|
2962
3143
|
# plan_code: plan_code,
|
2963
3144
|
# currency: "USD",
|
2964
|
-
# # This can be an existing account or
|
2965
|
-
# # a new acocunt
|
3145
|
+
# # This can be an existing account or a new account
|
2966
3146
|
# account: {
|
2967
3147
|
# code: account_code,
|
2968
3148
|
# }
|
@@ -2984,10 +3164,11 @@ module Recurly
|
|
2984
3164
|
|
2985
3165
|
# Fetch a subscription
|
2986
3166
|
#
|
2987
|
-
# {https://developers.recurly.com/api/
|
3167
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_subscription get_subscription api documenation}
|
2988
3168
|
#
|
2989
3169
|
# @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
|
3170
|
+
# @param params [Hash] Optional query string parameters:
|
3171
|
+
# :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+.
|
2991
3172
|
#
|
2992
3173
|
# @return [Resources::Subscription] A subscription.
|
2993
3174
|
# @example
|
@@ -3007,13 +3188,14 @@ module Recurly
|
|
3007
3188
|
get(path, **options)
|
3008
3189
|
end
|
3009
3190
|
|
3010
|
-
#
|
3191
|
+
# Update a subscription
|
3011
3192
|
#
|
3012
|
-
# {https://developers.recurly.com/api/
|
3193
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_subscription update_subscription api documenation}
|
3013
3194
|
#
|
3014
3195
|
# @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
3196
|
# @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
|
3197
|
+
# @param params [Hash] Optional query string parameters:
|
3198
|
+
# :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+.
|
3017
3199
|
#
|
3018
3200
|
# @return [Resources::Subscription] A subscription.
|
3019
3201
|
# @example
|
@@ -3022,7 +3204,7 @@ module Recurly
|
|
3022
3204
|
# customer_notes: "New Notes",
|
3023
3205
|
# terms_and_conditions: "New ToC"
|
3024
3206
|
# }
|
3025
|
-
# subscription = @client.
|
3207
|
+
# subscription = @client.update_subscription(
|
3026
3208
|
# subscription_id: subscription_id,
|
3027
3209
|
# body: subscription_update
|
3028
3210
|
# )
|
@@ -3033,17 +3215,18 @@ module Recurly
|
|
3033
3215
|
# puts "ValidationError: #{e.recurly_error.params}"
|
3034
3216
|
# end
|
3035
3217
|
#
|
3036
|
-
def
|
3218
|
+
def update_subscription(subscription_id:, body:, **options)
|
3037
3219
|
path = interpolate_path("/subscriptions/{subscription_id}", subscription_id: subscription_id)
|
3038
3220
|
put(path, body, Requests::SubscriptionUpdate, **options)
|
3039
3221
|
end
|
3040
3222
|
|
3041
3223
|
# Terminate a subscription
|
3042
3224
|
#
|
3043
|
-
# {https://developers.recurly.com/api/
|
3225
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/terminate_subscription terminate_subscription api documenation}
|
3044
3226
|
#
|
3045
3227
|
# @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
|
3228
|
+
# @param params [Hash] Optional query string parameters:
|
3229
|
+
# :refund [String] The type of refund to perform:
|
3047
3230
|
#
|
3048
3231
|
# * +full+ - Performs a full refund of the last invoice for the current subscription term.
|
3049
3232
|
# * +partial+ - Prorates a refund based on the amount of time remaining in the current bill cycle.
|
@@ -3053,8 +3236,8 @@ module Recurly
|
|
3053
3236
|
#
|
3054
3237
|
# You may also terminate a subscription with no refund and then manually refund specific invoices.
|
3055
3238
|
#
|
3056
|
-
#
|
3057
|
-
#
|
3239
|
+
# :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.
|
3240
|
+
# :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+.
|
3058
3241
|
#
|
3059
3242
|
# @return [Resources::Subscription] An expired subscription.
|
3060
3243
|
# @example
|
@@ -3076,11 +3259,12 @@ module Recurly
|
|
3076
3259
|
|
3077
3260
|
# Cancel a subscription
|
3078
3261
|
#
|
3079
|
-
# {https://developers.recurly.com/api/
|
3262
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/cancel_subscription cancel_subscription api documenation}
|
3080
3263
|
#
|
3081
3264
|
# @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
|
-
#
|
3265
|
+
# @param params [Hash] Optional query string parameters:
|
3266
|
+
# :body [Requests::SubscriptionCancel] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionCancel}
|
3267
|
+
# :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+.
|
3084
3268
|
#
|
3085
3269
|
# @return [Resources::Subscription] A canceled or failed subscription.
|
3086
3270
|
# @example
|
@@ -3102,10 +3286,11 @@ module Recurly
|
|
3102
3286
|
|
3103
3287
|
# Reactivate a canceled subscription
|
3104
3288
|
#
|
3105
|
-
# {https://developers.recurly.com/api/
|
3289
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_subscription reactivate_subscription api documenation}
|
3106
3290
|
#
|
3107
3291
|
# @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
|
3292
|
+
# @param params [Hash] Optional query string parameters:
|
3293
|
+
# :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+.
|
3109
3294
|
#
|
3110
3295
|
# @return [Resources::Subscription] An active subscription.
|
3111
3296
|
# @example
|
@@ -3127,11 +3312,12 @@ module Recurly
|
|
3127
3312
|
|
3128
3313
|
# Pause subscription
|
3129
3314
|
#
|
3130
|
-
# {https://developers.recurly.com/api/
|
3315
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/pause_subscription pause_subscription api documenation}
|
3131
3316
|
#
|
3132
3317
|
# @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
3318
|
# @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
|
3319
|
+
# @param params [Hash] Optional query string parameters:
|
3320
|
+
# :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+.
|
3135
3321
|
#
|
3136
3322
|
# @return [Resources::Subscription] A subscription.
|
3137
3323
|
# @example
|
@@ -3157,10 +3343,11 @@ module Recurly
|
|
3157
3343
|
|
3158
3344
|
# Resume subscription
|
3159
3345
|
#
|
3160
|
-
# {https://developers.recurly.com/api/
|
3346
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/resume_subscription resume_subscription api documenation}
|
3161
3347
|
#
|
3162
3348
|
# @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
|
3349
|
+
# @param params [Hash] Optional query string parameters:
|
3350
|
+
# :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+.
|
3164
3351
|
#
|
3165
3352
|
# @return [Resources::Subscription] A subscription.
|
3166
3353
|
# @example
|
@@ -3182,10 +3369,11 @@ module Recurly
|
|
3182
3369
|
|
3183
3370
|
# Convert trial subscription
|
3184
3371
|
#
|
3185
|
-
# {https://developers.recurly.com/api/
|
3372
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/convert_trial convert_trial api documenation}
|
3186
3373
|
#
|
3187
3374
|
# @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
|
3375
|
+
# @param params [Hash] Optional query string parameters:
|
3376
|
+
# :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+.
|
3189
3377
|
#
|
3190
3378
|
# @return [Resources::Subscription] A subscription.
|
3191
3379
|
#
|
@@ -3196,10 +3384,11 @@ module Recurly
|
|
3196
3384
|
|
3197
3385
|
# Fetch a subscription's pending change
|
3198
3386
|
#
|
3199
|
-
# {https://developers.recurly.com/api/
|
3387
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_subscription_change get_subscription_change api documenation}
|
3200
3388
|
#
|
3201
3389
|
# @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
|
3390
|
+
# @param params [Hash] Optional query string parameters:
|
3391
|
+
# :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+.
|
3203
3392
|
#
|
3204
3393
|
# @return [Resources::SubscriptionChange] A subscription's pending change.
|
3205
3394
|
# @example
|
@@ -3221,11 +3410,12 @@ module Recurly
|
|
3221
3410
|
|
3222
3411
|
# Create a new subscription change
|
3223
3412
|
#
|
3224
|
-
# {https://developers.recurly.com/api/
|
3413
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_subscription_change create_subscription_change api documenation}
|
3225
3414
|
#
|
3226
3415
|
# @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
3416
|
# @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
|
3417
|
+
# @param params [Hash] Optional query string parameters:
|
3418
|
+
# :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+.
|
3229
3419
|
#
|
3230
3420
|
# @return [Resources::SubscriptionChange] A subscription change.
|
3231
3421
|
# @example
|
@@ -3252,10 +3442,11 @@ module Recurly
|
|
3252
3442
|
|
3253
3443
|
# Delete the pending subscription change
|
3254
3444
|
#
|
3255
|
-
# {https://developers.recurly.com/api/
|
3445
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_subscription_change remove_subscription_change api documenation}
|
3256
3446
|
#
|
3257
3447
|
# @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
|
3448
|
+
# @param params [Hash] Optional query string parameters:
|
3449
|
+
# :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+.
|
3259
3450
|
#
|
3260
3451
|
# @return [Resources::Empty] Subscription change was deleted.
|
3261
3452
|
# @example
|
@@ -3277,13 +3468,14 @@ module Recurly
|
|
3277
3468
|
|
3278
3469
|
# Preview a new subscription change
|
3279
3470
|
#
|
3280
|
-
# {https://developers.recurly.com/api/
|
3471
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/preview_subscription_change preview_subscription_change api documenation}
|
3281
3472
|
#
|
3282
3473
|
# @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
3474
|
# @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
|
3475
|
+
# @param params [Hash] Optional query string parameters:
|
3476
|
+
# :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+.
|
3285
3477
|
#
|
3286
|
-
# @return [Resources::
|
3478
|
+
# @return [Resources::SubscriptionChange] A subscription change.
|
3287
3479
|
#
|
3288
3480
|
def preview_subscription_change(subscription_id:, body:, **options)
|
3289
3481
|
path = interpolate_path("/subscriptions/{subscription_id}/change/preview", subscription_id: subscription_id)
|
@@ -3292,10 +3484,11 @@ module Recurly
|
|
3292
3484
|
|
3293
3485
|
# List a subscription's invoices
|
3294
3486
|
#
|
3295
|
-
# {https://developers.recurly.com/api/
|
3487
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_invoices list_subscription_invoices api documenation}
|
3296
3488
|
#
|
3297
3489
|
# @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
|
3490
|
+
# @param params [Hash] Optional query string parameters:
|
3491
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
3299
3492
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
3300
3493
|
#
|
3301
3494
|
# *Important notes:*
|
@@ -3307,31 +3500,34 @@ module Recurly
|
|
3307
3500
|
# * Records are returned in an arbitrary order. Since results are all
|
3308
3501
|
# returned at once you can sort the records yourself.
|
3309
3502
|
#
|
3310
|
-
#
|
3311
|
-
#
|
3312
|
-
#
|
3503
|
+
# :limit [Integer] Limit number of records 1-200.
|
3504
|
+
# :order [String] Sort order.
|
3505
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
3313
3506
|
# order. In descending order updated records will move behind the cursor and could
|
3314
3507
|
# prevent some records from being returned.
|
3315
3508
|
#
|
3316
|
-
#
|
3509
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
3317
3510
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3318
3511
|
#
|
3319
|
-
#
|
3512
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
3320
3513
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3321
3514
|
#
|
3322
|
-
#
|
3515
|
+
# :type [String] Filter by type when:
|
3323
3516
|
# - +type=charge+, only charge invoices will be returned.
|
3324
3517
|
# - +type=credit+, only credit invoices will be returned.
|
3325
3518
|
# - +type=non-legacy+, only charge and credit invoices will be returned.
|
3326
3519
|
# - +type=legacy+, only legacy invoices will be returned.
|
3327
3520
|
#
|
3328
|
-
#
|
3521
|
+
# :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
3522
|
#
|
3330
3523
|
# @return [Pager<Resources::Invoice>] A list of the subscription's invoices.
|
3331
3524
|
# @example
|
3525
|
+
# params = {
|
3526
|
+
# limit: 200
|
3527
|
+
# }
|
3332
3528
|
# invoices = @client.list_subscription_invoices(
|
3333
3529
|
# subscription_id: subscription_id,
|
3334
|
-
#
|
3530
|
+
# params: params
|
3335
3531
|
# )
|
3336
3532
|
# invoices.each do |invoice|
|
3337
3533
|
# puts "Invoice: #{invoice.number}"
|
@@ -3344,10 +3540,11 @@ module Recurly
|
|
3344
3540
|
|
3345
3541
|
# List a subscription's line items
|
3346
3542
|
#
|
3347
|
-
# {https://developers.recurly.com/api/
|
3543
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_line_items list_subscription_line_items api documenation}
|
3348
3544
|
#
|
3349
3545
|
# @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
|
3546
|
+
# @param params [Hash] Optional query string parameters:
|
3547
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
3351
3548
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
3352
3549
|
#
|
3353
3550
|
# *Important notes:*
|
@@ -3359,28 +3556,31 @@ module Recurly
|
|
3359
3556
|
# * Records are returned in an arbitrary order. Since results are all
|
3360
3557
|
# returned at once you can sort the records yourself.
|
3361
3558
|
#
|
3362
|
-
#
|
3363
|
-
#
|
3364
|
-
#
|
3559
|
+
# :limit [Integer] Limit number of records 1-200.
|
3560
|
+
# :order [String] Sort order.
|
3561
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
3365
3562
|
# order. In descending order updated records will move behind the cursor and could
|
3366
3563
|
# prevent some records from being returned.
|
3367
3564
|
#
|
3368
|
-
#
|
3565
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
3369
3566
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3370
3567
|
#
|
3371
|
-
#
|
3568
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
3372
3569
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3373
3570
|
#
|
3374
|
-
#
|
3375
|
-
#
|
3376
|
-
#
|
3377
|
-
#
|
3571
|
+
# :original [String] Filter by original field.
|
3572
|
+
# :state [String] Filter by state field.
|
3573
|
+
# :type [String] Filter by type field.
|
3574
|
+
# :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+.
|
3378
3575
|
#
|
3379
3576
|
# @return [Pager<Resources::LineItem>] A list of the subscription's line items.
|
3380
3577
|
# @example
|
3578
|
+
# params = {
|
3579
|
+
# limit: 200
|
3580
|
+
# }
|
3381
3581
|
# line_items = @client.list_subscription_line_items(
|
3382
3582
|
# subscription_id: subscription_id,
|
3383
|
-
#
|
3583
|
+
# params: params
|
3384
3584
|
# )
|
3385
3585
|
# line_items.each do |line_item|
|
3386
3586
|
# puts "LineItem: #{line_item.id}"
|
@@ -3393,10 +3593,11 @@ module Recurly
|
|
3393
3593
|
|
3394
3594
|
# Show the coupon redemptions for a subscription
|
3395
3595
|
#
|
3396
|
-
# {https://developers.recurly.com/api/
|
3596
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_coupon_redemptions list_subscription_coupon_redemptions api documenation}
|
3397
3597
|
#
|
3398
3598
|
# @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
|
3599
|
+
# @param params [Hash] Optional query string parameters:
|
3600
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
3400
3601
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
3401
3602
|
#
|
3402
3603
|
# *Important notes:*
|
@@ -3408,23 +3609,26 @@ module Recurly
|
|
3408
3609
|
# * Records are returned in an arbitrary order. Since results are all
|
3409
3610
|
# returned at once you can sort the records yourself.
|
3410
3611
|
#
|
3411
|
-
#
|
3612
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
3412
3613
|
# order. In descending order updated records will move behind the cursor and could
|
3413
3614
|
# prevent some records from being returned.
|
3414
3615
|
#
|
3415
|
-
#
|
3616
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
3416
3617
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3417
3618
|
#
|
3418
|
-
#
|
3619
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
3419
3620
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3420
3621
|
#
|
3421
|
-
#
|
3622
|
+
# :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
3623
|
#
|
3423
3624
|
# @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on a subscription.
|
3424
3625
|
# @example
|
3626
|
+
# params = {
|
3627
|
+
# limit: 200
|
3628
|
+
# }
|
3425
3629
|
# coupon_redemptions = @client.list_subscription_coupon_redemptions(
|
3426
3630
|
# subscription_id: subscription_id,
|
3427
|
-
#
|
3631
|
+
# params: params
|
3428
3632
|
# )
|
3429
3633
|
# coupon_redemptions.each do |redemption|
|
3430
3634
|
# puts "CouponRedemption: #{redemption.id}"
|
@@ -3437,11 +3641,12 @@ module Recurly
|
|
3437
3641
|
|
3438
3642
|
# List a subscription add-on's usage records
|
3439
3643
|
#
|
3440
|
-
# {https://developers.recurly.com/api/
|
3644
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_usage list_usage api documenation}
|
3441
3645
|
#
|
3442
3646
|
# @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
3647
|
# @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
|
3648
|
+
# @param params [Hash] Optional query string parameters:
|
3649
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
3445
3650
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
3446
3651
|
#
|
3447
3652
|
# *Important notes:*
|
@@ -3453,20 +3658,20 @@ module Recurly
|
|
3453
3658
|
# * Records are returned in an arbitrary order. Since results are all
|
3454
3659
|
# returned at once you can sort the records yourself.
|
3455
3660
|
#
|
3456
|
-
#
|
3457
|
-
#
|
3458
|
-
#
|
3661
|
+
# :limit [Integer] Limit number of records 1-200.
|
3662
|
+
# :order [String] Sort order.
|
3663
|
+
# :sort [String] Sort field. You *really* only want to sort by +usage_timestamp+ in ascending
|
3459
3664
|
# order. In descending order updated records will move behind the cursor and could
|
3460
3665
|
# prevent some records from being returned.
|
3461
3666
|
#
|
3462
|
-
#
|
3667
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=usage_timestamp+ or +sort=recorded_timestamp+.
|
3463
3668
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3464
3669
|
#
|
3465
|
-
#
|
3670
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=usage_timestamp+ or +sort=recorded_timestamp+.
|
3466
3671
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3467
3672
|
#
|
3468
|
-
#
|
3469
|
-
#
|
3673
|
+
# :billing_status [String] Filter by usage record's billing status
|
3674
|
+
# :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+.
|
3470
3675
|
#
|
3471
3676
|
# @return [Pager<Resources::Usage>] A list of the subscription add-on's usage records.
|
3472
3677
|
#
|
@@ -3477,12 +3682,13 @@ module Recurly
|
|
3477
3682
|
|
3478
3683
|
# Log a usage record on this subscription add-on
|
3479
3684
|
#
|
3480
|
-
# {https://developers.recurly.com/api/
|
3685
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_usage create_usage api documenation}
|
3481
3686
|
#
|
3482
3687
|
# @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
3688
|
# @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
3689
|
# @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
|
3690
|
+
# @param params [Hash] Optional query string parameters:
|
3691
|
+
# :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+.
|
3486
3692
|
#
|
3487
3693
|
# @return [Resources::Usage] The created usage record.
|
3488
3694
|
#
|
@@ -3493,10 +3699,11 @@ module Recurly
|
|
3493
3699
|
|
3494
3700
|
# Get a usage record
|
3495
3701
|
#
|
3496
|
-
# {https://developers.recurly.com/api/
|
3702
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_usage get_usage api documenation}
|
3497
3703
|
#
|
3498
3704
|
# @param usage_id [String] Usage Record ID.
|
3499
|
-
# @param
|
3705
|
+
# @param params [Hash] Optional query string parameters:
|
3706
|
+
# :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+.
|
3500
3707
|
#
|
3501
3708
|
# @return [Resources::Usage] The usage record.
|
3502
3709
|
#
|
@@ -3507,11 +3714,12 @@ module Recurly
|
|
3507
3714
|
|
3508
3715
|
# Update a usage record
|
3509
3716
|
#
|
3510
|
-
# {https://developers.recurly.com/api/
|
3717
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/update_usage update_usage api documenation}
|
3511
3718
|
#
|
3512
3719
|
# @param usage_id [String] Usage Record ID.
|
3513
3720
|
# @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
|
3721
|
+
# @param params [Hash] Optional query string parameters:
|
3722
|
+
# :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+.
|
3515
3723
|
#
|
3516
3724
|
# @return [Resources::Usage] The updated usage record.
|
3517
3725
|
#
|
@@ -3522,10 +3730,11 @@ module Recurly
|
|
3522
3730
|
|
3523
3731
|
# Delete a usage record.
|
3524
3732
|
#
|
3525
|
-
# {https://developers.recurly.com/api/
|
3733
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/remove_usage remove_usage api documenation}
|
3526
3734
|
#
|
3527
3735
|
# @param usage_id [String] Usage Record ID.
|
3528
|
-
# @param
|
3736
|
+
# @param params [Hash] Optional query string parameters:
|
3737
|
+
# :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+.
|
3529
3738
|
#
|
3530
3739
|
# @return [Resources::Empty] Usage was successfully deleted.
|
3531
3740
|
#
|
@@ -3536,9 +3745,10 @@ module Recurly
|
|
3536
3745
|
|
3537
3746
|
# List a site's transactions
|
3538
3747
|
#
|
3539
|
-
# {https://developers.recurly.com/api/
|
3748
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/list_transactions list_transactions api documenation}
|
3540
3749
|
#
|
3541
|
-
# @param
|
3750
|
+
# @param params [Hash] Optional query string parameters:
|
3751
|
+
# :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
3542
3752
|
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
|
3543
3753
|
#
|
3544
3754
|
# *Important notes:*
|
@@ -3550,25 +3760,28 @@ module Recurly
|
|
3550
3760
|
# * Records are returned in an arbitrary order. Since results are all
|
3551
3761
|
# returned at once you can sort the records yourself.
|
3552
3762
|
#
|
3553
|
-
#
|
3554
|
-
#
|
3555
|
-
#
|
3763
|
+
# :limit [Integer] Limit number of records 1-200.
|
3764
|
+
# :order [String] Sort order.
|
3765
|
+
# :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
3556
3766
|
# order. In descending order updated records will move behind the cursor and could
|
3557
3767
|
# prevent some records from being returned.
|
3558
3768
|
#
|
3559
|
-
#
|
3769
|
+
# :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
3560
3770
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3561
3771
|
#
|
3562
|
-
#
|
3772
|
+
# :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
3563
3773
|
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
3564
3774
|
#
|
3565
|
-
#
|
3566
|
-
#
|
3567
|
-
#
|
3775
|
+
# :type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions.
|
3776
|
+
# :success [String] Filter by success field.
|
3777
|
+
# :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+.
|
3568
3778
|
#
|
3569
3779
|
# @return [Pager<Resources::Transaction>] A list of the site's transactions.
|
3570
3780
|
# @example
|
3571
|
-
#
|
3781
|
+
# params = {
|
3782
|
+
# limit: 200
|
3783
|
+
# }
|
3784
|
+
# transactions = @client.list_transactions(params: params)
|
3572
3785
|
# transactions.each do |transaction|
|
3573
3786
|
# puts "Transaction: #{transaction.uuid}"
|
3574
3787
|
# end
|
@@ -3580,10 +3793,11 @@ module Recurly
|
|
3580
3793
|
|
3581
3794
|
# Fetch a transaction
|
3582
3795
|
#
|
3583
|
-
# {https://developers.recurly.com/api/
|
3796
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_transaction get_transaction api documenation}
|
3584
3797
|
#
|
3585
3798
|
# @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
|
3799
|
+
# @param params [Hash] Optional query string parameters:
|
3800
|
+
# :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+.
|
3587
3801
|
#
|
3588
3802
|
# @return [Resources::Transaction] A transaction.
|
3589
3803
|
# @example
|
@@ -3603,10 +3817,11 @@ module Recurly
|
|
3603
3817
|
|
3604
3818
|
# Fetch a unique coupon code
|
3605
3819
|
#
|
3606
|
-
# {https://developers.recurly.com/api/
|
3820
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_unique_coupon_code get_unique_coupon_code api documenation}
|
3607
3821
|
#
|
3608
3822
|
# @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
|
3823
|
+
# @param params [Hash] Optional query string parameters:
|
3824
|
+
# :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+.
|
3610
3825
|
#
|
3611
3826
|
# @return [Resources::UniqueCouponCode] A unique coupon code.
|
3612
3827
|
#
|
@@ -3617,10 +3832,11 @@ module Recurly
|
|
3617
3832
|
|
3618
3833
|
# Deactivate a unique coupon code
|
3619
3834
|
#
|
3620
|
-
# {https://developers.recurly.com/api/
|
3835
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_unique_coupon_code deactivate_unique_coupon_code api documenation}
|
3621
3836
|
#
|
3622
3837
|
# @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
|
3838
|
+
# @param params [Hash] Optional query string parameters:
|
3839
|
+
# :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+.
|
3624
3840
|
#
|
3625
3841
|
# @return [Resources::UniqueCouponCode] A unique coupon code.
|
3626
3842
|
#
|
@@ -3631,10 +3847,11 @@ module Recurly
|
|
3631
3847
|
|
3632
3848
|
# Restore a unique coupon code
|
3633
3849
|
#
|
3634
|
-
# {https://developers.recurly.com/api/
|
3850
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_unique_coupon_code reactivate_unique_coupon_code api documenation}
|
3635
3851
|
#
|
3636
3852
|
# @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
|
3853
|
+
# @param params [Hash] Optional query string parameters:
|
3854
|
+
# :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+.
|
3638
3855
|
#
|
3639
3856
|
# @return [Resources::UniqueCouponCode] A unique coupon code.
|
3640
3857
|
#
|
@@ -3645,10 +3862,11 @@ module Recurly
|
|
3645
3862
|
|
3646
3863
|
# Create a new purchase
|
3647
3864
|
#
|
3648
|
-
# {https://developers.recurly.com/api/
|
3865
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/create_purchase create_purchase api documenation}
|
3649
3866
|
#
|
3650
3867
|
# @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
|
3868
|
+
# @param params [Hash] Optional query string parameters:
|
3869
|
+
# :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+.
|
3652
3870
|
#
|
3653
3871
|
# @return [Resources::InvoiceCollection] Returns the new invoices
|
3654
3872
|
# @example
|
@@ -3685,10 +3903,11 @@ module Recurly
|
|
3685
3903
|
|
3686
3904
|
# Preview a new purchase
|
3687
3905
|
#
|
3688
|
-
# {https://developers.recurly.com/api/
|
3906
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/preview_purchase preview_purchase api documenation}
|
3689
3907
|
#
|
3690
3908
|
# @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
|
3909
|
+
# @param params [Hash] Optional query string parameters:
|
3910
|
+
# :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+.
|
3692
3911
|
#
|
3693
3912
|
# @return [Resources::InvoiceCollection] Returns preview of the new invoices
|
3694
3913
|
# @example
|
@@ -3725,9 +3944,10 @@ module Recurly
|
|
3725
3944
|
|
3726
3945
|
# List the dates that have an available export to download.
|
3727
3946
|
#
|
3728
|
-
# {https://developers.recurly.com/api/
|
3947
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_export_dates get_export_dates api documenation}
|
3729
3948
|
#
|
3730
|
-
# @param
|
3949
|
+
# @param params [Hash] Optional query string parameters:
|
3950
|
+
# :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+.
|
3731
3951
|
#
|
3732
3952
|
# @return [Resources::ExportDates] Returns a list of dates.
|
3733
3953
|
# @example
|
@@ -3749,10 +3969,11 @@ module Recurly
|
|
3749
3969
|
|
3750
3970
|
# List of the export files that are available to download.
|
3751
3971
|
#
|
3752
|
-
# {https://developers.recurly.com/api/
|
3972
|
+
# {https://developers.recurly.com/api/v2021-02-25#operation/get_export_files get_export_files api documenation}
|
3753
3973
|
#
|
3754
3974
|
# @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
|
3975
|
+
# @param params [Hash] Optional query string parameters:
|
3976
|
+
# :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+.
|
3756
3977
|
#
|
3757
3978
|
# @return [Resources::ExportFiles] Returns a list of export files to download.
|
3758
3979
|
# @example
|