recurly 3.0.0.beta.2 → 3.0.0.beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +1 -1
- data/lib/recurly/client.rb +39 -37
- data/lib/recurly/client/adapter.rb +46 -0
- data/lib/recurly/client/operations.rb +626 -170
- data/lib/recurly/errors.rb +1 -1
- data/lib/recurly/requests/{create_account.rb → account_create.rb} +5 -1
- data/lib/recurly/requests/{account_updatable.rb → account_update.rb} +5 -1
- data/lib/recurly/requests/add_on_create.rb +2 -2
- data/lib/recurly/requests/add_on_update.rb +2 -2
- data/lib/recurly/requests/coupon_bulk_create.rb +10 -0
- data/lib/recurly/requests/{create_coupon.rb → coupon_create.rb} +3 -3
- data/lib/recurly/requests/coupon_redemption_create.rb +14 -0
- data/lib/recurly/requests/{update_coupon.rb → coupon_update.rb} +1 -1
- data/lib/recurly/requests/invoice_refund.rb +2 -2
- data/lib/recurly/requests/line_item_refund.rb +18 -0
- data/lib/recurly/requests/plan_create.rb +8 -4
- data/lib/recurly/requests/plan_update.rb +8 -12
- data/lib/recurly/requests/subscription_add_on_create.rb +0 -4
- data/lib/recurly/requests/subscription_create.rb +21 -9
- data/lib/recurly/requests/subscription_pause.rb +10 -0
- data/lib/recurly/requests/subscription_update.rb +16 -4
- data/lib/recurly/resources/account.rb +4 -0
- data/lib/recurly/resources/account_acquisition.rb +2 -2
- data/lib/recurly/resources/account_balance.rb +2 -2
- data/lib/recurly/resources/add_on.rb +2 -2
- data/lib/recurly/resources/coupon.rb +2 -2
- data/lib/recurly/resources/coupon_discount.rb +2 -2
- data/lib/recurly/resources/coupon_redemption_mini.rb +2 -2
- data/lib/recurly/resources/credit_payment.rb +6 -6
- data/lib/recurly/resources/custom_field.rb +14 -0
- data/lib/recurly/resources/custom_field_definition.rb +46 -0
- data/lib/recurly/resources/error.rb +2 -2
- data/lib/recurly/resources/error_may_have_transaction.rb +2 -2
- data/lib/recurly/resources/invoice.rb +4 -4
- data/lib/recurly/resources/line_item.rb +3 -3
- data/lib/recurly/resources/line_item_list.rb +22 -0
- data/lib/recurly/resources/plan.rb +6 -2
- data/lib/recurly/resources/subscription.rb +37 -5
- data/lib/recurly/resources/subscription_add_on.rb +2 -2
- data/lib/recurly/resources/subscription_change.rb +2 -2
- data/lib/recurly/resources/transaction.rb +6 -6
- data/lib/recurly/version.rb +1 -1
- data/recurly.gemspec +1 -0
- metadata +28 -21
- data/bin/bundle +0 -105
- data/bin/coderay +0 -29
- data/bin/console +0 -14
- data/bin/htmldiff +0 -29
- data/bin/ldiff +0 -29
- data/bin/pry +0 -29
- data/bin/rake +0 -29
- data/bin/rspec +0 -29
- data/bin/setup +0 -8
- data/bin/yard +0 -29
- data/bin/yardoc +0 -29
- data/bin/yri +0 -29
- data/lib/recurly/requests/account_create_only.rb +0 -18
- data/lib/recurly/requests/coupon_create_only.rb +0 -66
- data/lib/recurly/requests/coupon_updatable.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c06a13da0a4a02efc0494087590ad6e050b7c21ee0e3539dc85184e7136f2444
|
4
|
+
data.tar.gz: aad797e4c85cfa7e8388755d86fc443b27b187169d65f4db225d73c26a9da6c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed00a71ff9a370d9ad98fdda0c224bd6c273b69bfd543d1e5f2b40c5aee9d69b79fc1c6a8fe965d4727615d4c06a61291767961659d88567f5ee8e8153c11beb
|
7
|
+
data.tar.gz: 44a44276941e20c12c0998db7b73fb195eaea121be054a6b978a9f3a22cdbef04bf0e9bf5373b1db78cb75f128fec697112907ee0daff2187d7bc5db2b442ee9
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -15,7 +15,7 @@ This contains everything in the README as well as code-level documentation. We s
|
|
15
15
|
This gem is a pre-release. In your Gemfile, add `recurly` as a dependency.
|
16
16
|
|
17
17
|
```ruby
|
18
|
-
gem 'recurly', '3.0.0.beta.
|
18
|
+
gem 'recurly', '3.0.0.beta.3'
|
19
19
|
```
|
20
20
|
|
21
21
|
It's important that you lock on a specific version as there may be breaking changes between releases.
|
data/lib/recurly/client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'logger'
|
3
3
|
require_relative './schema/json_parser'
|
4
|
+
require_relative './client/adapter'
|
4
5
|
|
5
6
|
module Recurly
|
6
7
|
class Client
|
@@ -42,58 +43,30 @@ module Recurly
|
|
42
43
|
# # Give a `site_id`
|
43
44
|
# client = Recurly::Client.new(api_key: API_KEY, site_id: SITE_ID)
|
44
45
|
# # Or use the subdomain
|
45
|
-
# client = Recurly::Client.new(api_key: API_KEY, subdomain: 'mysite-dev')
|
46
|
+
# client = Recurly::Client.new(api_key: API_KEY, subdomain: 'mysite-dev')
|
46
47
|
#
|
47
48
|
# sub = client.get_subscription(subscription_id: 'abcd123456')
|
48
49
|
#
|
49
50
|
# # you should create a new client to connect to another site
|
50
|
-
# client = Recurly::Client.new(api_key: API_KEY, subdomain: 'mysite-prod')
|
51
|
+
# client = Recurly::Client.new(api_key: API_KEY, subdomain: 'mysite-prod')
|
51
52
|
# sub = client.get_subscription(subscription_id: 'abcd7890')
|
52
53
|
#
|
53
54
|
# @param api_key [String] The private API key
|
54
55
|
# @param site_id [String] The site you wish to be scoped to.
|
55
56
|
# @param subdomain [String] Optional subdomain for the site you wish to be scoped to. Providing this makes all the `site_id` parameters optional.
|
56
57
|
def initialize(api_key:, site_id: nil, subdomain: nil, **options)
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
@site_id = "subdomain-#{subdomain}"
|
61
|
-
else
|
62
|
-
raise ArgumentError, "You must pass a site_id or subdomain argument to initialize the Client"
|
63
|
-
end
|
64
|
-
|
65
|
-
@log_level = options[:log_level] || Logger::WARN
|
66
|
-
@logger = Logger.new(STDOUT)
|
67
|
-
@logger.level = @log_level
|
68
|
-
|
69
|
-
@conn = Faraday.new(url: BASE_URL) do |faraday|
|
70
|
-
if @log_level == Logger::INFO
|
71
|
-
faraday.response :logger
|
72
|
-
end
|
73
|
-
faraday.basic_auth(api_key, '')
|
74
|
-
faraday.adapter :net_http do |http| # yields Net::HTTP
|
75
|
-
# Let's not use the bundled cert in production yet
|
76
|
-
# but we will use these certs for any other staging or dev environment
|
77
|
-
unless BASE_URL.end_with?('.recurly.com')
|
78
|
-
http.ca_file = File.join(File.dirname(__FILE__), '../data/ca-certificates.crt')
|
79
|
-
end
|
80
|
-
http.use_ssl = true
|
81
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
82
|
-
http.open_timeout = 50
|
83
|
-
http.read_timeout = 60
|
84
|
-
http.keep_alive_timeout = 60
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
# TODO this is undocumented until we finalize it
|
89
|
-
@extra_headers = options[:headers] || {}
|
58
|
+
set_site_id(site_id, subdomain)
|
59
|
+
set_options(options)
|
60
|
+
set_faraday_connection(api_key)
|
90
61
|
|
91
62
|
# execute block with this client if given
|
92
63
|
yield(self) if block_given?
|
93
64
|
end
|
94
65
|
|
95
66
|
def next_page(pager)
|
96
|
-
run_request(:get, pager.next, nil, headers)
|
67
|
+
run_request(:get, pager.next, nil, headers).tap do |response|
|
68
|
+
raise_api_error!(response) if response.status != 200
|
69
|
+
end
|
97
70
|
end
|
98
71
|
|
99
72
|
protected
|
@@ -133,7 +106,7 @@ module Recurly
|
|
133
106
|
end
|
134
107
|
|
135
108
|
def delete(path, **options)
|
136
|
-
response = run_request(:delete, path,
|
109
|
+
response = run_request(:delete, path, nil, headers)
|
137
110
|
raise_api_error!(response) if ![200, 201].include?(response.status)
|
138
111
|
JSONParser.parse(self, response.body)
|
139
112
|
rescue Faraday::ClientError => ex
|
@@ -194,5 +167,34 @@ module Recurly
|
|
194
167
|
path = path.gsub("{", "%{")
|
195
168
|
path % options
|
196
169
|
end
|
170
|
+
|
171
|
+
def set_site_id(site_id, subdomain)
|
172
|
+
if site_id
|
173
|
+
@site_id = site_id
|
174
|
+
elsif subdomain
|
175
|
+
@site_id = "subdomain-#{subdomain}"
|
176
|
+
else
|
177
|
+
raise ArgumentError, "You must pass a site_id or subdomain argument to initialize the Client"
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
def set_faraday_connection(api_key)
|
182
|
+
@conn = Faraday.new(url: BASE_URL) do |faraday|
|
183
|
+
if @log_level == Logger::INFO
|
184
|
+
faraday.response :logger
|
185
|
+
end
|
186
|
+
faraday.basic_auth(api_key, '')
|
187
|
+
configure_net_adapter(faraday)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
def set_options(options)
|
192
|
+
@log_level = options[:log_level] || Logger::WARN
|
193
|
+
@logger = Logger.new(STDOUT)
|
194
|
+
@logger.level = @log_level
|
195
|
+
|
196
|
+
# TODO this is undocumented until we finalize it
|
197
|
+
@extra_headers = options[:headers] || {}
|
198
|
+
end
|
197
199
|
end
|
198
200
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'openssl'
|
2
|
+
|
3
|
+
module Recurly
|
4
|
+
class Client
|
5
|
+
module NetHttpPersistentAdapter
|
6
|
+
protected
|
7
|
+
def configure_net_adapter(faraday)
|
8
|
+
faraday.adapter :net_http_persistent do |http| # yields Net::HTTP
|
9
|
+
# Let's not use the bundled cert in production yet
|
10
|
+
# but we will use these certs for any other staging or dev environment
|
11
|
+
unless BASE_URL.end_with?('.recurly.com')
|
12
|
+
http.ca_file = File.join(File.dirname(__FILE__), '../data/ca-certificates.crt')
|
13
|
+
end
|
14
|
+
http.open_timeout = 50
|
15
|
+
http.read_timeout = 60
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
module NetHttpAdapter
|
21
|
+
protected
|
22
|
+
def configure_net_adapter(faraday)
|
23
|
+
faraday.adapter :net_http do |http| # yields Net::HTTP
|
24
|
+
# Let's not use the bundled cert in production yet
|
25
|
+
# but we will use these certs for any other staging or dev environment
|
26
|
+
unless BASE_URL.end_with?('.recurly.com')
|
27
|
+
http.ca_file = File.join(File.dirname(__FILE__), '../data/ca-certificates.crt')
|
28
|
+
end
|
29
|
+
http.use_ssl = true
|
30
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
31
|
+
http.open_timeout = 50
|
32
|
+
http.read_timeout = 60
|
33
|
+
http.keep_alive_timeout = 60
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
include NetHttpAdapter
|
39
|
+
|
40
|
+
begin
|
41
|
+
require 'net/http/persistent'
|
42
|
+
include NetHttpPersistentAdapter
|
43
|
+
rescue LoadError
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -1,15 +1,28 @@
|
|
1
1
|
module Recurly
|
2
2
|
class Client
|
3
3
|
def api_version
|
4
|
-
"v2018-
|
4
|
+
"v2018-06-06"
|
5
5
|
end
|
6
6
|
|
7
7
|
# List sites
|
8
8
|
#
|
9
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
9
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
10
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
11
|
+
#
|
12
|
+
# *Important notes:*
|
13
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
14
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
15
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
16
|
+
# results correspond to your request.
|
17
|
+
# * Records are returned in an arbitrary order. Since results are all
|
18
|
+
# returned at once you can sort the records yourself.
|
19
|
+
#
|
10
20
|
# @param limit [Integer] Limit number of records 1-200.
|
11
21
|
# @param order [String] Sort order.
|
12
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
22
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
23
|
+
# order. In descending order updated records will move behind the cursor and could
|
24
|
+
# prevent some records from being returned.
|
25
|
+
#
|
13
26
|
# @return [Pager<Resources::Site>] A list of sites.
|
14
27
|
def list_sites(**options)
|
15
28
|
path = "/sites"
|
@@ -26,14 +39,33 @@ module Recurly
|
|
26
39
|
|
27
40
|
# List a site's accounts
|
28
41
|
#
|
29
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
42
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
43
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
44
|
+
#
|
45
|
+
# *Important notes:*
|
46
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
47
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
48
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
49
|
+
# results correspond to your request.
|
50
|
+
# * Records are returned in an arbitrary order. Since results are all
|
51
|
+
# returned at once you can sort the records yourself.
|
52
|
+
#
|
30
53
|
# @param limit [Integer] Limit number of records 1-200.
|
31
54
|
# @param order [String] Sort order.
|
32
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
# @param
|
55
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
56
|
+
# order. In descending order updated records will move behind the cursor and could
|
57
|
+
# prevent some records from being returned.
|
58
|
+
#
|
59
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
60
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
61
|
+
#
|
62
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
63
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
64
|
+
#
|
65
|
+
# @param subscriber [String] Filter accounts accounts with or without a subscription in the +active+,
|
66
|
+
# +canceled+, or +future+ state.
|
67
|
+
#
|
68
|
+
# @param past_due [String] Filter for accounts with an invoice in the +past_due+ state.
|
37
69
|
# @return [Pager<Resources::Account>] A list of the site's accounts.
|
38
70
|
def list_accounts(**options)
|
39
71
|
path = interpolate_path("/sites/{site_id}/accounts", site_id: site_id)
|
@@ -42,16 +74,16 @@ module Recurly
|
|
42
74
|
|
43
75
|
# Create an account
|
44
76
|
#
|
45
|
-
# @param body [Requests::
|
77
|
+
# @param body [Requests::AccountCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountCreate}
|
46
78
|
# @return [Resources::Account] An account.
|
47
79
|
def create_account(body:)
|
48
80
|
path = interpolate_path("/sites/{site_id}/accounts", site_id: site_id)
|
49
|
-
post(path, body, Requests::
|
81
|
+
post(path, body, Requests::AccountCreate)
|
50
82
|
end
|
51
83
|
|
52
84
|
# Fetch an account
|
53
85
|
#
|
54
|
-
# @param account_id [String] Account ID or code (use prefix:
|
86
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
55
87
|
# @return [Resources::Account] An account.
|
56
88
|
# @example
|
57
89
|
# begin
|
@@ -73,17 +105,17 @@ module Recurly
|
|
73
105
|
|
74
106
|
# Modify an account
|
75
107
|
#
|
76
|
-
# @param account_id [String] Account ID or code (use prefix:
|
77
|
-
# @param body [Requests::
|
108
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
109
|
+
# @param body [Requests::AccountUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountUpdate}
|
78
110
|
# @return [Resources::Account] An account.
|
79
111
|
def update_account(account_id:, body:)
|
80
112
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}", site_id: site_id, account_id: account_id)
|
81
|
-
put(path, body, Requests::
|
113
|
+
put(path, body, Requests::AccountUpdate)
|
82
114
|
end
|
83
115
|
|
84
116
|
# Deactivate an account
|
85
117
|
#
|
86
|
-
# @param account_id [String] Account ID or code (use prefix:
|
118
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
87
119
|
# @return [Resources::Account] An account.
|
88
120
|
def deactivate_account(account_id:)
|
89
121
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}", site_id: site_id, account_id: account_id)
|
@@ -92,7 +124,7 @@ module Recurly
|
|
92
124
|
|
93
125
|
# Fetch an account's acquisition data
|
94
126
|
#
|
95
|
-
# @param account_id [String] Account ID or code (use prefix:
|
127
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
96
128
|
# @return [Resources::AccountAcquisition] An account's acquisition data.
|
97
129
|
def get_account_acquisition(account_id:)
|
98
130
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/acquisition", site_id: site_id, account_id: account_id)
|
@@ -101,7 +133,7 @@ module Recurly
|
|
101
133
|
|
102
134
|
# Update an account's acquisition data
|
103
135
|
#
|
104
|
-
# @param account_id [String] Account ID or code (use prefix:
|
136
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
105
137
|
# @param body [Requests::AccountAcquisitionUpdatable] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountAcquisitionUpdatable}
|
106
138
|
# @return [Resources::AccountAcquisition] An account's updated acquisition data.
|
107
139
|
def update_account_acquisition(account_id:, body:)
|
@@ -111,7 +143,7 @@ module Recurly
|
|
111
143
|
|
112
144
|
# Remove an account's acquisition data
|
113
145
|
#
|
114
|
-
# @param account_id [String] Account ID or code (use prefix:
|
146
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
115
147
|
def remove_account_acquisition(account_id:)
|
116
148
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/acquisition", site_id: site_id, account_id: account_id)
|
117
149
|
delete(path)
|
@@ -119,7 +151,7 @@ module Recurly
|
|
119
151
|
|
120
152
|
# Reactivate an inactive account
|
121
153
|
#
|
122
|
-
# @param account_id [String] Account ID or code (use prefix:
|
154
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
123
155
|
# @return [Resources::Account] An account.
|
124
156
|
def reactivate_account(account_id:)
|
125
157
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/reactivate", site_id: site_id, account_id: account_id)
|
@@ -128,7 +160,7 @@ module Recurly
|
|
128
160
|
|
129
161
|
# Fetch an account's balance and past due status
|
130
162
|
#
|
131
|
-
# @param account_id [String] Account ID or code (use prefix:
|
163
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
132
164
|
# @return [Resources::AccountBalance] An account's balance.
|
133
165
|
def get_account_balance(account_id:)
|
134
166
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/balance", site_id: site_id, account_id: account_id)
|
@@ -137,7 +169,7 @@ module Recurly
|
|
137
169
|
|
138
170
|
# Fetch an account's billing information
|
139
171
|
#
|
140
|
-
# @param account_id [String] Account ID or code (use prefix:
|
172
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
141
173
|
# @return [Resources::BillingInfo] An account's billing information.
|
142
174
|
def get_billing_info(account_id:)
|
143
175
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/billing_info", site_id: site_id, account_id: account_id)
|
@@ -146,7 +178,7 @@ module Recurly
|
|
146
178
|
|
147
179
|
# Set an account's billing information
|
148
180
|
#
|
149
|
-
# @param account_id [String] Account ID or code (use prefix:
|
181
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
150
182
|
# @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
|
151
183
|
# @return [Resources::BillingInfo] Updated billing information.
|
152
184
|
def update_billing_info(account_id:, body:)
|
@@ -156,7 +188,7 @@ module Recurly
|
|
156
188
|
|
157
189
|
# Remove an account's billing information
|
158
190
|
#
|
159
|
-
# @param account_id [String] Account ID or code (use prefix:
|
191
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
160
192
|
def remove_billing_info(account_id:)
|
161
193
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/billing_info", site_id: site_id, account_id: account_id)
|
162
194
|
delete(path)
|
@@ -164,8 +196,18 @@ module Recurly
|
|
164
196
|
|
165
197
|
# Show the coupon redemptions for an account
|
166
198
|
#
|
167
|
-
# @param account_id [String] Account ID or code (use prefix:
|
168
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
199
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
200
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
201
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
202
|
+
#
|
203
|
+
# *Important notes:*
|
204
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
205
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
206
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
207
|
+
# results correspond to your request.
|
208
|
+
# * Records are returned in an arbitrary order. Since results are all
|
209
|
+
# returned at once you can sort the records yourself.
|
210
|
+
#
|
169
211
|
# @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on an account.
|
170
212
|
def list_account_coupon_redemptions(account_id:, **options)
|
171
213
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/coupon_redemptions", site_id: site_id, account_id: account_id)
|
@@ -174,7 +216,7 @@ module Recurly
|
|
174
216
|
|
175
217
|
# Show the coupon redemption that is active on an account
|
176
218
|
#
|
177
|
-
# @param account_id [String] Account ID or code (use prefix:
|
219
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
178
220
|
# @return [Resources::CouponRedemption] An active coupon redemption on an account.
|
179
221
|
def get_active_coupon_redemption(account_id:)
|
180
222
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/coupon_redemptions/active", site_id: site_id, account_id: account_id)
|
@@ -183,17 +225,17 @@ module Recurly
|
|
183
225
|
|
184
226
|
# Generate an active coupon redemption on an account
|
185
227
|
#
|
186
|
-
# @param account_id [String] Account ID or code (use prefix:
|
187
|
-
# @param body [Requests::
|
228
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
229
|
+
# @param body [Requests::CouponRedemptionCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponRedemptionCreate}
|
188
230
|
# @return [Resources::CouponRedemption] Returns the new coupon redemption.
|
189
231
|
def create_coupon_redemption(account_id:, body:)
|
190
232
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/coupon_redemptions/active", site_id: site_id, account_id: account_id)
|
191
|
-
post(path, body, Requests::
|
233
|
+
post(path, body, Requests::CouponRedemptionCreate)
|
192
234
|
end
|
193
235
|
|
194
236
|
# Delete the active coupon redemption from an account
|
195
237
|
#
|
196
|
-
# @param account_id [String] Account ID or code (use prefix:
|
238
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
197
239
|
# @return [Resources::CouponRedemption] Coupon redemption deleted.
|
198
240
|
def remove_coupon_redemption(account_id:)
|
199
241
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/coupon_redemptions/active", site_id: site_id, account_id: account_id)
|
@@ -202,12 +244,19 @@ module Recurly
|
|
202
244
|
|
203
245
|
# List an account's credit payments
|
204
246
|
#
|
205
|
-
# @param account_id [String] Account ID or code (use prefix:
|
247
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
206
248
|
# @param limit [Integer] Limit number of records 1-200.
|
207
249
|
# @param order [String] Sort order.
|
208
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
209
|
-
#
|
210
|
-
#
|
250
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
251
|
+
# order. In descending order updated records will move behind the cursor and could
|
252
|
+
# prevent some records from being returned.
|
253
|
+
#
|
254
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
255
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
256
|
+
#
|
257
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
258
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
259
|
+
#
|
211
260
|
# @return [Pager<Resources::CreditPayment>] A list of the account's credit payments.
|
212
261
|
def list_account_credit_payments(account_id:, **options)
|
213
262
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/credit_payments", site_id: site_id, account_id: account_id)
|
@@ -216,14 +265,36 @@ module Recurly
|
|
216
265
|
|
217
266
|
# List an account's invoices
|
218
267
|
#
|
219
|
-
# @param account_id [String] Account ID or code (use prefix:
|
220
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
268
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
269
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
270
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
271
|
+
#
|
272
|
+
# *Important notes:*
|
273
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
274
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
275
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
276
|
+
# results correspond to your request.
|
277
|
+
# * Records are returned in an arbitrary order. Since results are all
|
278
|
+
# returned at once you can sort the records yourself.
|
279
|
+
#
|
221
280
|
# @param limit [Integer] Limit number of records 1-200.
|
222
281
|
# @param order [String] Sort order.
|
223
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
224
|
-
#
|
225
|
-
#
|
226
|
-
#
|
282
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
283
|
+
# order. In descending order updated records will move behind the cursor and could
|
284
|
+
# prevent some records from being returned.
|
285
|
+
#
|
286
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
287
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
288
|
+
#
|
289
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
290
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
291
|
+
#
|
292
|
+
# @param type [String] Filter by type when:
|
293
|
+
# - +type=charge+, only charge invoices will be returned.
|
294
|
+
# - +type=credit+, only credit invoices will be returned.
|
295
|
+
# - +type=non-legacy+, only charge and credit invoices will be returned.
|
296
|
+
# - +type=legacy+, only legacy invoices will be returned.
|
297
|
+
#
|
227
298
|
# @return [Pager<Resources::Invoice>] A list of the account's invoices.
|
228
299
|
def list_account_invoices(account_id:, **options)
|
229
300
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/invoices", site_id: site_id, account_id: account_id)
|
@@ -232,7 +303,7 @@ module Recurly
|
|
232
303
|
|
233
304
|
# Create an invoice for pending line items
|
234
305
|
#
|
235
|
-
# @param account_id [String] Account ID or code (use prefix:
|
306
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
236
307
|
# @param body [Requests::InvoiceCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCreate}
|
237
308
|
# @return [Resources::InvoiceCollection] Returns the new invoices.
|
238
309
|
def create_invoice(account_id:, body:)
|
@@ -242,7 +313,7 @@ module Recurly
|
|
242
313
|
|
243
314
|
# Preview new invoice for pending line items
|
244
315
|
#
|
245
|
-
# @param account_id [String] Account ID or code (use prefix:
|
316
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
246
317
|
# @param body [Requests::InvoiceCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCreate}
|
247
318
|
# @return [Resources::InvoiceCollection] Returns the invoice previews.
|
248
319
|
def preview_invoice(account_id:, body:)
|
@@ -252,13 +323,30 @@ module Recurly
|
|
252
323
|
|
253
324
|
# List an account's line items
|
254
325
|
#
|
255
|
-
# @param account_id [String] Account ID or code (use prefix:
|
256
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
326
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
327
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
328
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
329
|
+
#
|
330
|
+
# *Important notes:*
|
331
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
332
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
333
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
334
|
+
# results correspond to your request.
|
335
|
+
# * Records are returned in an arbitrary order. Since results are all
|
336
|
+
# returned at once you can sort the records yourself.
|
337
|
+
#
|
257
338
|
# @param limit [Integer] Limit number of records 1-200.
|
258
339
|
# @param order [String] Sort order.
|
259
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
260
|
-
#
|
261
|
-
#
|
340
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
341
|
+
# order. In descending order updated records will move behind the cursor and could
|
342
|
+
# prevent some records from being returned.
|
343
|
+
#
|
344
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
345
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
346
|
+
#
|
347
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
348
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
349
|
+
#
|
262
350
|
# @param original [String] Filter by original field.
|
263
351
|
# @param state [String] Filter by state field.
|
264
352
|
# @param type [String] Filter by type field.
|
@@ -270,7 +358,7 @@ module Recurly
|
|
270
358
|
|
271
359
|
# Create a new line item for the account
|
272
360
|
#
|
273
|
-
# @param account_id [String] Account ID or code (use prefix:
|
361
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
274
362
|
# @param body [Requests::LineItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::LineItemCreate}
|
275
363
|
# @return [Resources::LineItem] Returns the new line item.
|
276
364
|
def create_line_item(account_id:, body:)
|
@@ -280,8 +368,18 @@ module Recurly
|
|
280
368
|
|
281
369
|
# Fetch a list of an account's notes
|
282
370
|
#
|
283
|
-
# @param account_id [String] Account ID or code (use prefix:
|
284
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
371
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
372
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
373
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
374
|
+
#
|
375
|
+
# *Important notes:*
|
376
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
377
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
378
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
379
|
+
# results correspond to your request.
|
380
|
+
# * Records are returned in an arbitrary order. Since results are all
|
381
|
+
# returned at once you can sort the records yourself.
|
382
|
+
#
|
285
383
|
# @return [Pager<Resources::AccountNote>] A list of an account's notes.
|
286
384
|
def list_account_notes(account_id:, **options)
|
287
385
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/notes", site_id: site_id, account_id: account_id)
|
@@ -290,7 +388,7 @@ module Recurly
|
|
290
388
|
|
291
389
|
# Fetch an account note
|
292
390
|
#
|
293
|
-
# @param account_id [String] Account ID or code (use prefix:
|
391
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
294
392
|
# @param account_note_id [String] Account Note ID.
|
295
393
|
# @return [Resources::AccountNote] An account note.
|
296
394
|
def get_account_note(account_id:, account_note_id:)
|
@@ -300,13 +398,30 @@ module Recurly
|
|
300
398
|
|
301
399
|
# Fetch a list of an account's shipping addresses
|
302
400
|
#
|
303
|
-
# @param account_id [String] Account ID or code (use prefix:
|
304
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
401
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
402
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
403
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
404
|
+
#
|
405
|
+
# *Important notes:*
|
406
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
407
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
408
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
409
|
+
# results correspond to your request.
|
410
|
+
# * Records are returned in an arbitrary order. Since results are all
|
411
|
+
# returned at once you can sort the records yourself.
|
412
|
+
#
|
305
413
|
# @param limit [Integer] Limit number of records 1-200.
|
306
414
|
# @param order [String] Sort order.
|
307
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
308
|
-
#
|
309
|
-
#
|
415
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
416
|
+
# order. In descending order updated records will move behind the cursor and could
|
417
|
+
# prevent some records from being returned.
|
418
|
+
#
|
419
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
420
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
421
|
+
#
|
422
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
423
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
424
|
+
#
|
310
425
|
# @return [Pager<Resources::ShippingAddress>] A list of an account's shipping addresses.
|
311
426
|
def list_shipping_addresses(account_id:, **options)
|
312
427
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/shipping_addresses", site_id: site_id, account_id: account_id)
|
@@ -315,7 +430,7 @@ module Recurly
|
|
315
430
|
|
316
431
|
# Create a new shipping address for the account
|
317
432
|
#
|
318
|
-
# @param account_id [String] Account ID or code (use prefix:
|
433
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
319
434
|
# @param body [Requests::ShippingAddressCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressCreate}
|
320
435
|
# @return [Resources::ShippingAddress] Returns the new shipping address.
|
321
436
|
def create_shipping_address(account_id:, body:)
|
@@ -325,7 +440,7 @@ module Recurly
|
|
325
440
|
|
326
441
|
# Fetch an account's shipping address
|
327
442
|
#
|
328
|
-
# @param account_id [String] Account ID or code (use prefix:
|
443
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
329
444
|
# @param shipping_address_id [String] Shipping Address ID.
|
330
445
|
# @return [Resources::ShippingAddress] A shipping address.
|
331
446
|
def get_shipping_address(account_id:, shipping_address_id:)
|
@@ -335,7 +450,7 @@ module Recurly
|
|
335
450
|
|
336
451
|
# Update an account's shipping address
|
337
452
|
#
|
338
|
-
# @param account_id [String] Account ID or code (use prefix:
|
453
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
339
454
|
# @param shipping_address_id [String] Shipping Address ID.
|
340
455
|
# @param body [Requests::ShippingAddressUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressUpdate}
|
341
456
|
# @return [Resources::ShippingAddress] The updated shipping address.
|
@@ -346,7 +461,7 @@ module Recurly
|
|
346
461
|
|
347
462
|
# Remove an account's shipping address
|
348
463
|
#
|
349
|
-
# @param account_id [String] Account ID or code (use prefix:
|
464
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
350
465
|
# @param shipping_address_id [String] Shipping Address ID.
|
351
466
|
def remove_shipping_address(account_id:, shipping_address_id:)
|
352
467
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/shipping_addresses/{shipping_address_id}", site_id: site_id, account_id: account_id, shipping_address_id: shipping_address_id)
|
@@ -355,14 +470,35 @@ module Recurly
|
|
355
470
|
|
356
471
|
# List an account's subscriptions
|
357
472
|
#
|
358
|
-
# @param account_id [String] Account ID or code (use prefix:
|
359
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
473
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
474
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
475
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
476
|
+
#
|
477
|
+
# *Important notes:*
|
478
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
479
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
480
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
481
|
+
# results correspond to your request.
|
482
|
+
# * Records are returned in an arbitrary order. Since results are all
|
483
|
+
# returned at once you can sort the records yourself.
|
484
|
+
#
|
360
485
|
# @param limit [Integer] Limit number of records 1-200.
|
361
486
|
# @param order [String] Sort order.
|
362
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
363
|
-
#
|
364
|
-
#
|
365
|
-
#
|
487
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
488
|
+
# order. In descending order updated records will move behind the cursor and could
|
489
|
+
# prevent some records from being returned.
|
490
|
+
#
|
491
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
492
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
493
|
+
#
|
494
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
495
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
496
|
+
#
|
497
|
+
# @param state [String] Filter by state.
|
498
|
+
# - When +state=active+, +state=canceled+, +state=expired+, or +state=future+, subscriptions with states that match the query and only those subscriptions will be returned.
|
499
|
+
# - 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.
|
500
|
+
# - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
|
501
|
+
#
|
366
502
|
# @return [Pager<Resources::Subscription>] A list of the account's subscriptions.
|
367
503
|
def list_account_subscriptions(account_id:, **options)
|
368
504
|
path = interpolate_path("/sites/{site_id}/accounts/{account_id}/subscriptions", site_id: site_id, account_id: account_id)
|
@@ -371,13 +507,30 @@ module Recurly
|
|
371
507
|
|
372
508
|
# List an account's transactions
|
373
509
|
#
|
374
|
-
# @param account_id [String] Account ID or code (use prefix:
|
375
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
510
|
+
# @param account_id [String] Account ID or code (use prefix: +code-+, e.g. +code-bob+).
|
511
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
512
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
513
|
+
#
|
514
|
+
# *Important notes:*
|
515
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
516
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
517
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
518
|
+
# results correspond to your request.
|
519
|
+
# * Records are returned in an arbitrary order. Since results are all
|
520
|
+
# returned at once you can sort the records yourself.
|
521
|
+
#
|
376
522
|
# @param limit [Integer] Limit number of records 1-200.
|
377
523
|
# @param order [String] Sort order.
|
378
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
379
|
-
#
|
380
|
-
#
|
524
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
525
|
+
# order. In descending order updated records will move behind the cursor and could
|
526
|
+
# prevent some records from being returned.
|
527
|
+
#
|
528
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
529
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
530
|
+
#
|
531
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
532
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
533
|
+
#
|
381
534
|
# @param type [String] Filter by type field.
|
382
535
|
# @param success [String] Filter by success field.
|
383
536
|
# @return [Pager<Resources::Transaction>] A list of the account's transactions.
|
@@ -388,12 +541,29 @@ module Recurly
|
|
388
541
|
|
389
542
|
# List a site's account acquisition data
|
390
543
|
#
|
391
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
544
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
545
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
546
|
+
#
|
547
|
+
# *Important notes:*
|
548
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
549
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
550
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
551
|
+
# results correspond to your request.
|
552
|
+
# * Records are returned in an arbitrary order. Since results are all
|
553
|
+
# returned at once you can sort the records yourself.
|
554
|
+
#
|
392
555
|
# @param limit [Integer] Limit number of records 1-200.
|
393
556
|
# @param order [String] Sort order.
|
394
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
395
|
-
#
|
396
|
-
#
|
557
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
558
|
+
# order. In descending order updated records will move behind the cursor and could
|
559
|
+
# prevent some records from being returned.
|
560
|
+
#
|
561
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
562
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
563
|
+
#
|
564
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
565
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
566
|
+
#
|
397
567
|
# @return [Resources::AccountAcquisition] A list of the site's account acquisition data.
|
398
568
|
def list_account_acquisition(**options)
|
399
569
|
path = interpolate_path("/sites/{site_id}/acquisitions", site_id: site_id)
|
@@ -402,12 +572,29 @@ module Recurly
|
|
402
572
|
|
403
573
|
# List a site's coupons
|
404
574
|
#
|
405
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
575
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
576
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
577
|
+
#
|
578
|
+
# *Important notes:*
|
579
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
580
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
581
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
582
|
+
# results correspond to your request.
|
583
|
+
# * Records are returned in an arbitrary order. Since results are all
|
584
|
+
# returned at once you can sort the records yourself.
|
585
|
+
#
|
406
586
|
# @param limit [Integer] Limit number of records 1-200.
|
407
587
|
# @param order [String] Sort order.
|
408
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
409
|
-
#
|
410
|
-
#
|
588
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
589
|
+
# order. In descending order updated records will move behind the cursor and could
|
590
|
+
# prevent some records from being returned.
|
591
|
+
#
|
592
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
593
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
594
|
+
#
|
595
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
596
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
597
|
+
#
|
411
598
|
# @return [Pager<Resources::Coupon>] A list of the site's coupons.
|
412
599
|
def list_coupons(**options)
|
413
600
|
path = interpolate_path("/sites/{site_id}/coupons", site_id: site_id)
|
@@ -416,16 +603,16 @@ module Recurly
|
|
416
603
|
|
417
604
|
# Create a new coupon
|
418
605
|
#
|
419
|
-
# @param body [Requests::
|
606
|
+
# @param body [Requests::CouponCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponCreate}
|
420
607
|
# @return [Resources::Coupon] A new coupon.
|
421
608
|
def create_coupon(body:)
|
422
609
|
path = interpolate_path("/sites/{site_id}/coupons", site_id: site_id)
|
423
|
-
post(path, body, Requests::
|
610
|
+
post(path, body, Requests::CouponCreate)
|
424
611
|
end
|
425
612
|
|
426
613
|
# Fetch a coupon
|
427
614
|
#
|
428
|
-
# @param coupon_id [String] Coupon ID or code (use prefix:
|
615
|
+
# @param coupon_id [String] Coupon ID or code (use prefix: +code-+, e.g. +code-10off+).
|
429
616
|
# @return [Resources::Coupon] A coupon.
|
430
617
|
def get_coupon(coupon_id:)
|
431
618
|
path = interpolate_path("/sites/{site_id}/coupons/{coupon_id}", site_id: site_id, coupon_id: coupon_id)
|
@@ -434,23 +621,40 @@ module Recurly
|
|
434
621
|
|
435
622
|
# Update an active coupon
|
436
623
|
#
|
437
|
-
# @param coupon_id [String] Coupon ID or code (use prefix:
|
438
|
-
# @param body [Requests::
|
624
|
+
# @param coupon_id [String] Coupon ID or code (use prefix: +code-+, e.g. +code-10off+).
|
625
|
+
# @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate}
|
439
626
|
# @return [Resources::Coupon] The updated coupon.
|
440
627
|
def update_coupon(coupon_id:, body:)
|
441
628
|
path = interpolate_path("/sites/{site_id}/coupons/{coupon_id}", site_id: site_id, coupon_id: coupon_id)
|
442
|
-
put(path, body, Requests::
|
629
|
+
put(path, body, Requests::CouponUpdate)
|
443
630
|
end
|
444
631
|
|
445
632
|
# List unique coupon codes associated with a bulk coupon
|
446
633
|
#
|
447
|
-
# @param coupon_id [String] Coupon ID or code (use prefix:
|
448
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
634
|
+
# @param coupon_id [String] Coupon ID or code (use prefix: +code-+, e.g. +code-10off+).
|
635
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
636
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
637
|
+
#
|
638
|
+
# *Important notes:*
|
639
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
640
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
641
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
642
|
+
# results correspond to your request.
|
643
|
+
# * Records are returned in an arbitrary order. Since results are all
|
644
|
+
# returned at once you can sort the records yourself.
|
645
|
+
#
|
449
646
|
# @param limit [Integer] Limit number of records 1-200.
|
450
647
|
# @param order [String] Sort order.
|
451
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
452
|
-
#
|
453
|
-
#
|
648
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
649
|
+
# order. In descending order updated records will move behind the cursor and could
|
650
|
+
# prevent some records from being returned.
|
651
|
+
#
|
652
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
653
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
654
|
+
#
|
655
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
656
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
657
|
+
#
|
454
658
|
# @return [Pager<Resources::UniqueCouponCode>] A list of unique coupon codes that were generated
|
455
659
|
def list_unique_coupon_codes(coupon_id:, **options)
|
456
660
|
path = interpolate_path("/sites/{site_id}/coupons/{coupon_id}/unique_coupon_codes", site_id: site_id, coupon_id: coupon_id)
|
@@ -461,9 +665,16 @@ module Recurly
|
|
461
665
|
#
|
462
666
|
# @param limit [Integer] Limit number of records 1-200.
|
463
667
|
# @param order [String] Sort order.
|
464
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
465
|
-
#
|
466
|
-
#
|
668
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
669
|
+
# order. In descending order updated records will move behind the cursor and could
|
670
|
+
# prevent some records from being returned.
|
671
|
+
#
|
672
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
673
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
674
|
+
#
|
675
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
676
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
677
|
+
#
|
467
678
|
# @return [Pager<Resources::CreditPayment>] A list of the site's credit payments.
|
468
679
|
def list_credit_payments(**options)
|
469
680
|
path = interpolate_path("/sites/{site_id}/credit_payments", site_id: site_id)
|
@@ -472,22 +683,84 @@ module Recurly
|
|
472
683
|
|
473
684
|
# Fetch a credit payment
|
474
685
|
#
|
475
|
-
# @param credit_payment_id [String] Credit Payment ID or UUID (use prefix:
|
686
|
+
# @param credit_payment_id [String] Credit Payment ID or UUID (use prefix: +uuid-+, e.g. +uuid-123457890+).
|
476
687
|
# @return [Resources::CreditPayment] A credit payment.
|
477
688
|
def get_credit_payment(credit_payment_id:)
|
478
689
|
path = interpolate_path("/sites/{site_id}/credit_payments/{credit_payment_id}", site_id: site_id, credit_payment_id: credit_payment_id)
|
479
690
|
get(path)
|
480
691
|
end
|
481
692
|
|
693
|
+
# List a site's custom field definitions
|
694
|
+
#
|
695
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
696
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
697
|
+
#
|
698
|
+
# *Important notes:*
|
699
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
700
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
701
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
702
|
+
# results correspond to your request.
|
703
|
+
# * Records are returned in an arbitrary order. Since results are all
|
704
|
+
# returned at once you can sort the records yourself.
|
705
|
+
#
|
706
|
+
# @param limit [Integer] Limit number of records 1-200.
|
707
|
+
# @param order [String] Sort order.
|
708
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
709
|
+
# order. In descending order updated records will move behind the cursor and could
|
710
|
+
# prevent some records from being returned.
|
711
|
+
#
|
712
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
713
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
714
|
+
#
|
715
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
716
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
717
|
+
#
|
718
|
+
# @return [Pager<Resources::CustomFieldDefinition>] A list of the site's custom field definitions.
|
719
|
+
def list_custom_field_definitions(**options)
|
720
|
+
path = interpolate_path("/sites/{site_id}/custom_field_definitions", site_id: site_id)
|
721
|
+
pager(path, **options)
|
722
|
+
end
|
723
|
+
|
724
|
+
# Fetch an custom field definition
|
725
|
+
#
|
726
|
+
# @param custom_field_definition_id [String] Custom Field Definition ID
|
727
|
+
# @return [Resources::CustomFieldDefinition] An custom field definition.
|
728
|
+
def get_custom_field_definition(custom_field_definition_id:)
|
729
|
+
path = interpolate_path("/sites/{site_id}/custom_field_definitions/{custom_field_definition_id}", site_id: site_id, custom_field_definition_id: custom_field_definition_id)
|
730
|
+
get(path)
|
731
|
+
end
|
732
|
+
|
482
733
|
# List a site's invoices
|
483
734
|
#
|
484
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
735
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
736
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
737
|
+
#
|
738
|
+
# *Important notes:*
|
739
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
740
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
741
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
742
|
+
# results correspond to your request.
|
743
|
+
# * Records are returned in an arbitrary order. Since results are all
|
744
|
+
# returned at once you can sort the records yourself.
|
745
|
+
#
|
485
746
|
# @param limit [Integer] Limit number of records 1-200.
|
486
747
|
# @param order [String] Sort order.
|
487
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
488
|
-
#
|
489
|
-
#
|
490
|
-
#
|
748
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
749
|
+
# order. In descending order updated records will move behind the cursor and could
|
750
|
+
# prevent some records from being returned.
|
751
|
+
#
|
752
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
753
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
754
|
+
#
|
755
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
756
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
757
|
+
#
|
758
|
+
# @param type [String] Filter by type when:
|
759
|
+
# - +type=charge+, only charge invoices will be returned.
|
760
|
+
# - +type=credit+, only credit invoices will be returned.
|
761
|
+
# - +type=non-legacy+, only charge and credit invoices will be returned.
|
762
|
+
# - +type=legacy+, only legacy invoices will be returned.
|
763
|
+
#
|
491
764
|
# @return [Pager<Resources::Invoice>] A list of the site's invoices.
|
492
765
|
def list_invoices(**options)
|
493
766
|
path = interpolate_path("/sites/{site_id}/invoices", site_id: site_id)
|
@@ -496,7 +769,7 @@ module Recurly
|
|
496
769
|
|
497
770
|
# Fetch an invoice
|
498
771
|
#
|
499
|
-
# @param invoice_id [String] Invoice ID or number (use prefix:
|
772
|
+
# @param invoice_id [String] Invoice ID or number (use prefix: +number-+, e.g. +number-1000+).
|
500
773
|
# @return [Resources::Invoice] An invoice.
|
501
774
|
def get_invoice(invoice_id:)
|
502
775
|
path = interpolate_path("/sites/{site_id}/invoices/{invoice_id}", site_id: site_id, invoice_id: invoice_id)
|
@@ -505,7 +778,7 @@ module Recurly
|
|
505
778
|
|
506
779
|
# Collect a pending or past due, automatic invoice
|
507
780
|
#
|
508
|
-
# @param invoice_id [String] Invoice ID or number (use prefix:
|
781
|
+
# @param invoice_id [String] Invoice ID or number (use prefix: +number-+, e.g. +number-1000+).
|
509
782
|
# @return [Resources::Invoice] The updated invoice.
|
510
783
|
def collect_invoice(invoice_id:)
|
511
784
|
path = interpolate_path("/sites/{site_id}/invoices/{invoice_id}/collect", site_id: site_id, invoice_id: invoice_id)
|
@@ -514,7 +787,7 @@ module Recurly
|
|
514
787
|
|
515
788
|
# Mark an open invoice as failed
|
516
789
|
#
|
517
|
-
# @param invoice_id [String] Invoice ID or number (use prefix:
|
790
|
+
# @param invoice_id [String] Invoice ID or number (use prefix: +number-+, e.g. +number-1000+).
|
518
791
|
# @return [Resources::Invoice] The updated invoice.
|
519
792
|
def fail_invoice(invoice_id:)
|
520
793
|
path = interpolate_path("/sites/{site_id}/invoices/{invoice_id}/mark_failed", site_id: site_id, invoice_id: invoice_id)
|
@@ -523,7 +796,7 @@ module Recurly
|
|
523
796
|
|
524
797
|
# Mark an open invoice as successful
|
525
798
|
#
|
526
|
-
# @param invoice_id [String] Invoice ID or number (use prefix:
|
799
|
+
# @param invoice_id [String] Invoice ID or number (use prefix: +number-+, e.g. +number-1000+).
|
527
800
|
# @return [Resources::Invoice] The updated invoice.
|
528
801
|
def mark_invoice_successful(invoice_id:)
|
529
802
|
path = interpolate_path("/sites/{site_id}/invoices/{invoice_id}/mark_successful", site_id: site_id, invoice_id: invoice_id)
|
@@ -532,7 +805,7 @@ module Recurly
|
|
532
805
|
|
533
806
|
# Reopen a closed, manual invoice
|
534
807
|
#
|
535
|
-
# @param invoice_id [String] Invoice ID or number (use prefix:
|
808
|
+
# @param invoice_id [String] Invoice ID or number (use prefix: +number-+, e.g. +number-1000+).
|
536
809
|
# @return [Resources::Invoice] The updated invoice.
|
537
810
|
def reopen_invoice(invoice_id:)
|
538
811
|
path = interpolate_path("/sites/{site_id}/invoices/{invoice_id}/reopen", site_id: site_id, invoice_id: invoice_id)
|
@@ -541,13 +814,30 @@ module Recurly
|
|
541
814
|
|
542
815
|
# List a invoice's line items
|
543
816
|
#
|
544
|
-
# @param invoice_id [String] Invoice ID or number (use prefix:
|
545
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
817
|
+
# @param invoice_id [String] Invoice ID or number (use prefix: +number-+, e.g. +number-1000+).
|
818
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
819
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
820
|
+
#
|
821
|
+
# *Important notes:*
|
822
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
823
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
824
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
825
|
+
# results correspond to your request.
|
826
|
+
# * Records are returned in an arbitrary order. Since results are all
|
827
|
+
# returned at once you can sort the records yourself.
|
828
|
+
#
|
546
829
|
# @param limit [Integer] Limit number of records 1-200.
|
547
830
|
# @param order [String] Sort order.
|
548
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
549
|
-
#
|
550
|
-
#
|
831
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
832
|
+
# order. In descending order updated records will move behind the cursor and could
|
833
|
+
# prevent some records from being returned.
|
834
|
+
#
|
835
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
836
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
837
|
+
#
|
838
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
839
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
840
|
+
#
|
551
841
|
# @param original [String] Filter by original field.
|
552
842
|
# @param state [String] Filter by state field.
|
553
843
|
# @param type [String] Filter by type field.
|
@@ -559,8 +849,18 @@ module Recurly
|
|
559
849
|
|
560
850
|
# Show the coupon redemptions applied to an invoice
|
561
851
|
#
|
562
|
-
# @param invoice_id [String] Invoice ID or number (use prefix:
|
563
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
852
|
+
# @param invoice_id [String] Invoice ID or number (use prefix: +number-+, e.g. +number-1000+).
|
853
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
854
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
855
|
+
#
|
856
|
+
# *Important notes:*
|
857
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
858
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
859
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
860
|
+
# results correspond to your request.
|
861
|
+
# * Records are returned in an arbitrary order. Since results are all
|
862
|
+
# returned at once you can sort the records yourself.
|
863
|
+
#
|
564
864
|
# @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions associated with the invoice.
|
565
865
|
def list_invoice_coupon_redemptions(invoice_id:, **options)
|
566
866
|
path = interpolate_path("/sites/{site_id}/invoices/{invoice_id}/coupon_redemptions", site_id: site_id, invoice_id: invoice_id)
|
@@ -569,7 +869,7 @@ module Recurly
|
|
569
869
|
|
570
870
|
# List an invoice's related credit or charge invoices
|
571
871
|
#
|
572
|
-
# @param invoice_id [String] Invoice ID or number (use prefix:
|
872
|
+
# @param invoice_id [String] Invoice ID or number (use prefix: +number-+, e.g. +number-1000+).
|
573
873
|
# @return [Pager<Resources::Invoice>] A list of the credit or charge invoices associated with the invoice.
|
574
874
|
def list_related_invoices(invoice_id:)
|
575
875
|
path = interpolate_path("/sites/{site_id}/invoices/{invoice_id}/related_invoices", site_id: site_id, invoice_id: invoice_id)
|
@@ -578,7 +878,7 @@ module Recurly
|
|
578
878
|
|
579
879
|
# Refund an invoice
|
580
880
|
#
|
581
|
-
# @param invoice_id [String] Invoice ID or number (use prefix:
|
881
|
+
# @param invoice_id [String] Invoice ID or number (use prefix: +number-+, e.g. +number-1000+).
|
582
882
|
# @param body [Requests::InvoiceRefund] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceRefund}
|
583
883
|
# @return [Resources::Invoice] Returns the new credit invoice.
|
584
884
|
def refund_invoice(invoice_id:, body:)
|
@@ -588,12 +888,29 @@ module Recurly
|
|
588
888
|
|
589
889
|
# List a site's line items
|
590
890
|
#
|
591
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
891
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
892
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
893
|
+
#
|
894
|
+
# *Important notes:*
|
895
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
896
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
897
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
898
|
+
# results correspond to your request.
|
899
|
+
# * Records are returned in an arbitrary order. Since results are all
|
900
|
+
# returned at once you can sort the records yourself.
|
901
|
+
#
|
592
902
|
# @param limit [Integer] Limit number of records 1-200.
|
593
903
|
# @param order [String] Sort order.
|
594
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
595
|
-
#
|
596
|
-
#
|
904
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
905
|
+
# order. In descending order updated records will move behind the cursor and could
|
906
|
+
# prevent some records from being returned.
|
907
|
+
#
|
908
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
909
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
910
|
+
#
|
911
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
912
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
913
|
+
#
|
597
914
|
# @param original [String] Filter by original field.
|
598
915
|
# @param state [String] Filter by state field.
|
599
916
|
# @param type [String] Filter by type field.
|
@@ -622,12 +939,29 @@ module Recurly
|
|
622
939
|
|
623
940
|
# List a site's plans
|
624
941
|
#
|
625
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
942
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
943
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
944
|
+
#
|
945
|
+
# *Important notes:*
|
946
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
947
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
948
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
949
|
+
# results correspond to your request.
|
950
|
+
# * Records are returned in an arbitrary order. Since results are all
|
951
|
+
# returned at once you can sort the records yourself.
|
952
|
+
#
|
626
953
|
# @param limit [Integer] Limit number of records 1-200.
|
627
954
|
# @param order [String] Sort order.
|
628
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
629
|
-
#
|
630
|
-
#
|
955
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
956
|
+
# order. In descending order updated records will move behind the cursor and could
|
957
|
+
# prevent some records from being returned.
|
958
|
+
#
|
959
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
960
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
961
|
+
#
|
962
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
963
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
964
|
+
#
|
631
965
|
# @param state [String] Filter by state.
|
632
966
|
# @return [Pager<Resources::Plan>] A list of plans.
|
633
967
|
def list_plans(**options)
|
@@ -646,7 +980,7 @@ module Recurly
|
|
646
980
|
|
647
981
|
# Fetch a plan
|
648
982
|
#
|
649
|
-
# @param plan_id [String] Plan ID or code (use prefix:
|
983
|
+
# @param plan_id [String] Plan ID or code (use prefix: +code-+, e.g. +code-gold+).
|
650
984
|
# @return [Resources::Plan] A plan.
|
651
985
|
def get_plan(plan_id:)
|
652
986
|
path = interpolate_path("/sites/{site_id}/plans/{plan_id}", site_id: site_id, plan_id: plan_id)
|
@@ -655,7 +989,7 @@ module Recurly
|
|
655
989
|
|
656
990
|
# Update a plan
|
657
991
|
#
|
658
|
-
# @param plan_id [String] Plan ID or code (use prefix:
|
992
|
+
# @param plan_id [String] Plan ID or code (use prefix: +code-+, e.g. +code-gold+).
|
659
993
|
# @param body [Requests::PlanUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PlanUpdate}
|
660
994
|
# @return [Resources::Plan] A plan.
|
661
995
|
def update_plan(plan_id:, body:)
|
@@ -665,7 +999,7 @@ module Recurly
|
|
665
999
|
|
666
1000
|
# Remove a plan
|
667
1001
|
#
|
668
|
-
# @param plan_id [String] Plan ID or code (use prefix:
|
1002
|
+
# @param plan_id [String] Plan ID or code (use prefix: +code-+, e.g. +code-gold+).
|
669
1003
|
# @return [Resources::Plan] Plan deleted
|
670
1004
|
def remove_plan(plan_id:)
|
671
1005
|
path = interpolate_path("/sites/{site_id}/plans/{plan_id}", site_id: site_id, plan_id: plan_id)
|
@@ -674,13 +1008,30 @@ module Recurly
|
|
674
1008
|
|
675
1009
|
# List a plan's add-ons
|
676
1010
|
#
|
677
|
-
# @param plan_id [String] Plan ID or code (use prefix:
|
678
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1011
|
+
# @param plan_id [String] Plan ID or code (use prefix: +code-+, e.g. +code-gold+).
|
1012
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1013
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
1014
|
+
#
|
1015
|
+
# *Important notes:*
|
1016
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
1017
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
1018
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
1019
|
+
# results correspond to your request.
|
1020
|
+
# * Records are returned in an arbitrary order. Since results are all
|
1021
|
+
# returned at once you can sort the records yourself.
|
1022
|
+
#
|
679
1023
|
# @param limit [Integer] Limit number of records 1-200.
|
680
1024
|
# @param order [String] Sort order.
|
681
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
682
|
-
#
|
683
|
-
#
|
1025
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1026
|
+
# order. In descending order updated records will move behind the cursor and could
|
1027
|
+
# prevent some records from being returned.
|
1028
|
+
#
|
1029
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1030
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1031
|
+
#
|
1032
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1033
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1034
|
+
#
|
684
1035
|
# @param state [String] Filter by state.
|
685
1036
|
# @return [Pager<Resources::AddOn>] A list of add-ons.
|
686
1037
|
def list_plan_add_ons(plan_id:, **options)
|
@@ -690,7 +1041,7 @@ module Recurly
|
|
690
1041
|
|
691
1042
|
# Create an add-on
|
692
1043
|
#
|
693
|
-
# @param plan_id [String] Plan ID or code (use prefix:
|
1044
|
+
# @param plan_id [String] Plan ID or code (use prefix: +code-+, e.g. +code-gold+).
|
694
1045
|
# @param body [Requests::AddOnCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnCreate}
|
695
1046
|
# @return [Resources::AddOn] An add-on.
|
696
1047
|
def create_plan_add_on(plan_id:, body:)
|
@@ -700,8 +1051,8 @@ module Recurly
|
|
700
1051
|
|
701
1052
|
# Fetch a plan's add-on
|
702
1053
|
#
|
703
|
-
# @param add_on_id [String] Add-on ID or code (use prefix:
|
704
|
-
# @param plan_id [String] Plan ID or code (use prefix:
|
1054
|
+
# @param add_on_id [String] Add-on ID or code (use prefix: +code-+, e.g. +code-gold+).
|
1055
|
+
# @param plan_id [String] Plan ID or code (use prefix: +code-+, e.g. +code-gold+).
|
705
1056
|
# @return [Resources::AddOn] An add-on.
|
706
1057
|
def get_plan_add_on(add_on_id:, plan_id:)
|
707
1058
|
path = interpolate_path("/sites/{site_id}/plans/{plan_id}/add_ons/{add_on_id}", site_id: site_id, add_on_id: add_on_id, plan_id: plan_id)
|
@@ -710,8 +1061,8 @@ module Recurly
|
|
710
1061
|
|
711
1062
|
# Update an add-on
|
712
1063
|
#
|
713
|
-
# @param add_on_id [String] Add-on ID or code (use prefix:
|
714
|
-
# @param plan_id [String] Plan ID or code (use prefix:
|
1064
|
+
# @param add_on_id [String] Add-on ID or code (use prefix: +code-+, e.g. +code-gold+).
|
1065
|
+
# @param plan_id [String] Plan ID or code (use prefix: +code-+, e.g. +code-gold+).
|
715
1066
|
# @param body [Requests::AddOnUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnUpdate}
|
716
1067
|
# @return [Resources::AddOn] An add-on.
|
717
1068
|
def update_plan_add_on(add_on_id:, plan_id:, body:)
|
@@ -721,8 +1072,8 @@ module Recurly
|
|
721
1072
|
|
722
1073
|
# Remove an add-on
|
723
1074
|
#
|
724
|
-
# @param add_on_id [String] Add-on ID or code (use prefix:
|
725
|
-
# @param plan_id [String] Plan ID or code (use prefix:
|
1075
|
+
# @param add_on_id [String] Add-on ID or code (use prefix: +code-+, e.g. +code-gold+).
|
1076
|
+
# @param plan_id [String] Plan ID or code (use prefix: +code-+, e.g. +code-gold+).
|
726
1077
|
# @return [Resources::AddOn] Add-on deleted
|
727
1078
|
def remove_plan_add_on(add_on_id:, plan_id:)
|
728
1079
|
path = interpolate_path("/sites/{site_id}/plans/{plan_id}/add_ons/{add_on_id}", site_id: site_id, add_on_id: add_on_id, plan_id: plan_id)
|
@@ -731,12 +1082,29 @@ module Recurly
|
|
731
1082
|
|
732
1083
|
# List a site's add-ons
|
733
1084
|
#
|
734
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1085
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1086
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
1087
|
+
#
|
1088
|
+
# *Important notes:*
|
1089
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
1090
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
1091
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
1092
|
+
# results correspond to your request.
|
1093
|
+
# * Records are returned in an arbitrary order. Since results are all
|
1094
|
+
# returned at once you can sort the records yourself.
|
1095
|
+
#
|
735
1096
|
# @param limit [Integer] Limit number of records 1-200.
|
736
1097
|
# @param order [String] Sort order.
|
737
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
738
|
-
#
|
739
|
-
#
|
1098
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1099
|
+
# order. In descending order updated records will move behind the cursor and could
|
1100
|
+
# prevent some records from being returned.
|
1101
|
+
#
|
1102
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1103
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1104
|
+
#
|
1105
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1106
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1107
|
+
#
|
740
1108
|
# @param state [String] Filter by state.
|
741
1109
|
# @return [Pager<Resources::AddOn>] A list of add-ons.
|
742
1110
|
def list_add_ons(**options)
|
@@ -746,7 +1114,7 @@ module Recurly
|
|
746
1114
|
|
747
1115
|
# Fetch an add-on
|
748
1116
|
#
|
749
|
-
# @param add_on_id [String] Add-on ID or code (use prefix:
|
1117
|
+
# @param add_on_id [String] Add-on ID or code (use prefix: +code-+, e.g. +code-gold+).
|
750
1118
|
# @return [Resources::AddOn] An add-on.
|
751
1119
|
def get_add_on(add_on_id:)
|
752
1120
|
path = interpolate_path("/sites/{site_id}/add_ons/{add_on_id}", site_id: site_id, add_on_id: add_on_id)
|
@@ -755,13 +1123,34 @@ module Recurly
|
|
755
1123
|
|
756
1124
|
# List a site's subscriptions
|
757
1125
|
#
|
758
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1126
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1127
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
1128
|
+
#
|
1129
|
+
# *Important notes:*
|
1130
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
1131
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
1132
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
1133
|
+
# results correspond to your request.
|
1134
|
+
# * Records are returned in an arbitrary order. Since results are all
|
1135
|
+
# returned at once you can sort the records yourself.
|
1136
|
+
#
|
759
1137
|
# @param limit [Integer] Limit number of records 1-200.
|
760
1138
|
# @param order [String] Sort order.
|
761
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
762
|
-
#
|
763
|
-
#
|
764
|
-
#
|
1139
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1140
|
+
# order. In descending order updated records will move behind the cursor and could
|
1141
|
+
# prevent some records from being returned.
|
1142
|
+
#
|
1143
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1144
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1145
|
+
#
|
1146
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1147
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1148
|
+
#
|
1149
|
+
# @param state [String] Filter by state.
|
1150
|
+
# - When +state=active+, +state=canceled+, +state=expired+, or +state=future+, subscriptions with states that match the query and only those subscriptions will be returned.
|
1151
|
+
# - 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.
|
1152
|
+
# - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned.
|
1153
|
+
#
|
765
1154
|
# @return [Pager<Resources::Subscription>] A list of the site's subscriptions.
|
766
1155
|
def list_subscriptions(**options)
|
767
1156
|
path = interpolate_path("/sites/{site_id}/subscriptions", site_id: site_id)
|
@@ -779,7 +1168,7 @@ module Recurly
|
|
779
1168
|
|
780
1169
|
# Fetch a subscription
|
781
1170
|
#
|
782
|
-
# @param subscription_id [String] Subscription ID or UUID (use prefix:
|
1171
|
+
# @param subscription_id [String] Subscription ID or UUID (use prefix: +uuid-+, e.g. +uuid-123457890+).
|
783
1172
|
# @return [Resources::Subscription] A subscription.
|
784
1173
|
# @example
|
785
1174
|
# begin
|
@@ -801,7 +1190,7 @@ module Recurly
|
|
801
1190
|
|
802
1191
|
# Modify a subscription
|
803
1192
|
#
|
804
|
-
# @param subscription_id [String] Subscription ID or UUID (use prefix:
|
1193
|
+
# @param subscription_id [String] Subscription ID or UUID (use prefix: +uuid-+, e.g. +uuid-123457890+).
|
805
1194
|
# @param body [Requests::SubscriptionUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionUpdate}
|
806
1195
|
# @return [Resources::Subscription] A subscription.
|
807
1196
|
def modify_subscription(subscription_id:, body:)
|
@@ -811,8 +1200,17 @@ module Recurly
|
|
811
1200
|
|
812
1201
|
# Terminate a subscription
|
813
1202
|
#
|
814
|
-
# @param subscription_id [String] Subscription ID or UUID (use prefix:
|
815
|
-
# @param refund [String] The type of refund to perform:
|
1203
|
+
# @param subscription_id [String] Subscription ID or UUID (use prefix: +uuid-+, e.g. +uuid-123457890+).
|
1204
|
+
# @param refund [String] The type of refund to perform:
|
1205
|
+
#
|
1206
|
+
# * +full+ - Performs a full refund of the last invoice for the current subscription term.
|
1207
|
+
# * +partial+ - Prorates a refund based on the amount of time remaining in the current bill cycle.
|
1208
|
+
# * +none+ - Terminates the subscription without a refund.
|
1209
|
+
#
|
1210
|
+
# In the event that the most recent invoice is a $0 invoice paid entirely by credit, Recurly will apply the credit back to the customer’s account.
|
1211
|
+
#
|
1212
|
+
# You may also terminate a subscription with no refund and then manually refund specific invoices.
|
1213
|
+
#
|
816
1214
|
# @return [Resources::Subscription] An expired subscription.
|
817
1215
|
def terminate_subscription(subscription_id:, **options)
|
818
1216
|
path = interpolate_path("/sites/{site_id}/subscriptions/{subscription_id}", site_id: site_id, subscription_id: subscription_id)
|
@@ -821,7 +1219,7 @@ module Recurly
|
|
821
1219
|
|
822
1220
|
# Cancel a subscription
|
823
1221
|
#
|
824
|
-
# @param subscription_id [String] Subscription ID or UUID (use prefix:
|
1222
|
+
# @param subscription_id [String] Subscription ID or UUID (use prefix: +uuid-+, e.g. +uuid-123457890+).
|
825
1223
|
# @return [Resources::Subscription] A canceled or failed subscription.
|
826
1224
|
def cancel_subscription(subscription_id:)
|
827
1225
|
path = interpolate_path("/sites/{site_id}/subscriptions/{subscription_id}/cancel", site_id: site_id, subscription_id: subscription_id)
|
@@ -830,16 +1228,35 @@ module Recurly
|
|
830
1228
|
|
831
1229
|
# Reactivate a canceled subscription
|
832
1230
|
#
|
833
|
-
# @param subscription_id [String] Subscription ID or UUID (use prefix:
|
1231
|
+
# @param subscription_id [String] Subscription ID or UUID (use prefix: +uuid-+, e.g. +uuid-123457890+).
|
834
1232
|
# @return [Resources::Subscription] An active subscription.
|
835
1233
|
def reactivate_subscription(subscription_id:)
|
836
1234
|
path = interpolate_path("/sites/{site_id}/subscriptions/{subscription_id}/reactivate", site_id: site_id, subscription_id: subscription_id)
|
837
1235
|
put(path)
|
838
1236
|
end
|
839
1237
|
|
1238
|
+
# Pause subscription
|
1239
|
+
#
|
1240
|
+
# @param subscription_id [String] Subscription ID or UUID (use prefix: +uuid-+, e.g. +uuid-123457890+).
|
1241
|
+
# @param body [Requests::SubscriptionPause] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionPause}
|
1242
|
+
# @return [Resources::Subscription] A subscription.
|
1243
|
+
def pause_subscription(subscription_id:, body:)
|
1244
|
+
path = interpolate_path("/sites/{site_id}/subscriptions/{subscription_id}/pause", site_id: site_id, subscription_id: subscription_id)
|
1245
|
+
put(path, body, Requests::SubscriptionPause)
|
1246
|
+
end
|
1247
|
+
|
1248
|
+
# Resume subscription
|
1249
|
+
#
|
1250
|
+
# @param subscription_id [String] Subscription ID or UUID (use prefix: +uuid-+, e.g. +uuid-123457890+).
|
1251
|
+
# @return [Resources::Subscription] A subscription.
|
1252
|
+
def resume_subscription(subscription_id:)
|
1253
|
+
path = interpolate_path("/sites/{site_id}/subscriptions/{subscription_id}/resume", site_id: site_id, subscription_id: subscription_id)
|
1254
|
+
put(path)
|
1255
|
+
end
|
1256
|
+
|
840
1257
|
# Fetch a subscription's pending change
|
841
1258
|
#
|
842
|
-
# @param subscription_id [String] Subscription ID or UUID (use prefix:
|
1259
|
+
# @param subscription_id [String] Subscription ID or UUID (use prefix: +uuid-+, e.g. +uuid-123457890+).
|
843
1260
|
# @return [Resources::SubscriptionChange] A subscription's pending change.
|
844
1261
|
def get_subscription_change(subscription_id:)
|
845
1262
|
path = interpolate_path("/sites/{site_id}/subscriptions/{subscription_id}/change", site_id: site_id, subscription_id: subscription_id)
|
@@ -848,7 +1265,7 @@ module Recurly
|
|
848
1265
|
|
849
1266
|
# Create a new subscription change
|
850
1267
|
#
|
851
|
-
# @param subscription_id [String] Subscription ID or UUID (use prefix:
|
1268
|
+
# @param subscription_id [String] Subscription ID or UUID (use prefix: +uuid-+, e.g. +uuid-123457890+).
|
852
1269
|
# @param body [Requests::SubscriptionChangeCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionChangeCreate}
|
853
1270
|
# @return [Resources::SubscriptionChange] A subscription change.
|
854
1271
|
def create_subscription_change(subscription_id:, body:)
|
@@ -858,7 +1275,7 @@ module Recurly
|
|
858
1275
|
|
859
1276
|
# Delete the pending subscription change
|
860
1277
|
#
|
861
|
-
# @param subscription_id [String] Subscription ID or UUID (use prefix:
|
1278
|
+
# @param subscription_id [String] Subscription ID or UUID (use prefix: +uuid-+, e.g. +uuid-123457890+).
|
862
1279
|
def remove_subscription_change(subscription_id:)
|
863
1280
|
path = interpolate_path("/sites/{site_id}/subscriptions/{subscription_id}/change", site_id: site_id, subscription_id: subscription_id)
|
864
1281
|
delete(path)
|
@@ -866,14 +1283,36 @@ module Recurly
|
|
866
1283
|
|
867
1284
|
# List a subscription's invoices
|
868
1285
|
#
|
869
|
-
# @param subscription_id [String] Subscription ID or UUID (use prefix:
|
870
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1286
|
+
# @param subscription_id [String] Subscription ID or UUID (use prefix: +uuid-+, e.g. +uuid-123457890+).
|
1287
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1288
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
1289
|
+
#
|
1290
|
+
# *Important notes:*
|
1291
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
1292
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
1293
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
1294
|
+
# results correspond to your request.
|
1295
|
+
# * Records are returned in an arbitrary order. Since results are all
|
1296
|
+
# returned at once you can sort the records yourself.
|
1297
|
+
#
|
871
1298
|
# @param limit [Integer] Limit number of records 1-200.
|
872
1299
|
# @param order [String] Sort order.
|
873
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
874
|
-
#
|
875
|
-
#
|
876
|
-
#
|
1300
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1301
|
+
# order. In descending order updated records will move behind the cursor and could
|
1302
|
+
# prevent some records from being returned.
|
1303
|
+
#
|
1304
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1305
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1306
|
+
#
|
1307
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1308
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1309
|
+
#
|
1310
|
+
# @param type [String] Filter by type when:
|
1311
|
+
# - +type=charge+, only charge invoices will be returned.
|
1312
|
+
# - +type=credit+, only credit invoices will be returned.
|
1313
|
+
# - +type=non-legacy+, only charge and credit invoices will be returned.
|
1314
|
+
# - +type=legacy+, only legacy invoices will be returned.
|
1315
|
+
#
|
877
1316
|
# @return [Pager<Resources::Invoice>] A list of the subscription's invoices.
|
878
1317
|
def list_subscription_invoices(subscription_id:, **options)
|
879
1318
|
path = interpolate_path("/sites/{site_id}/subscriptions/{subscription_id}/invoices", site_id: site_id, subscription_id: subscription_id)
|
@@ -882,12 +1321,29 @@ module Recurly
|
|
882
1321
|
|
883
1322
|
# List a site's transactions
|
884
1323
|
#
|
885
|
-
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1324
|
+
# @param ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
|
1325
|
+
# commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1+.
|
1326
|
+
#
|
1327
|
+
# *Important notes:*
|
1328
|
+
# * The +ids+ parameter cannot be used with any other ordering or filtering
|
1329
|
+
# parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
|
1330
|
+
# * Invalid or unknown IDs will be ignored, so you should check that the
|
1331
|
+
# results correspond to your request.
|
1332
|
+
# * Records are returned in an arbitrary order. Since results are all
|
1333
|
+
# returned at once you can sort the records yourself.
|
1334
|
+
#
|
886
1335
|
# @param limit [Integer] Limit number of records 1-200.
|
887
1336
|
# @param order [String] Sort order.
|
888
|
-
# @param sort [String] Sort field. You *really* only want to sort by
|
889
|
-
#
|
890
|
-
#
|
1337
|
+
# @param sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
|
1338
|
+
# order. In descending order updated records will move behind the cursor and could
|
1339
|
+
# prevent some records from being returned.
|
1340
|
+
#
|
1341
|
+
# @param begin_time [DateTime] Filter by begin_time when +sort=created_at+ or +sort=updated_at+.
|
1342
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1343
|
+
#
|
1344
|
+
# @param end_time [DateTime] Filter by end_time when +sort=created_at+ or +sort=updated_at+.
|
1345
|
+
# *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
|
1346
|
+
#
|
891
1347
|
# @param type [String] Filter by type field.
|
892
1348
|
# @param success [String] Filter by success field.
|
893
1349
|
# @return [Pager<Resources::Transaction>] A list of the site's transactions.
|
@@ -898,7 +1354,7 @@ module Recurly
|
|
898
1354
|
|
899
1355
|
# Fetch a transaction
|
900
1356
|
#
|
901
|
-
# @param transaction_id [String] Transaction ID or UUID (use prefix:
|
1357
|
+
# @param transaction_id [String] Transaction ID or UUID (use prefix: +uuid-+, e.g. +uuid-123457890+).
|
902
1358
|
# @return [Resources::Transaction] A transaction.
|
903
1359
|
def get_transaction(transaction_id:)
|
904
1360
|
path = interpolate_path("/sites/{site_id}/transactions/{transaction_id}", site_id: site_id, transaction_id: transaction_id)
|
@@ -907,7 +1363,7 @@ module Recurly
|
|
907
1363
|
|
908
1364
|
# Fetch a unique coupon code
|
909
1365
|
#
|
910
|
-
# @param unique_coupon_code_id [String] Unique Coupon Code ID or code (use prefix:
|
1366
|
+
# @param unique_coupon_code_id [String] Unique Coupon Code ID or code (use prefix: +code-+, e.g. +code-abc-8dh2-def+).
|
911
1367
|
# @return [Resources::UniqueCouponCode] A unique coupon code.
|
912
1368
|
def get_unique_coupon_code(unique_coupon_code_id:)
|
913
1369
|
path = interpolate_path("/sites/{site_id}/unique_coupon_codes/{unique_coupon_code_id}", site_id: site_id, unique_coupon_code_id: unique_coupon_code_id)
|
@@ -916,7 +1372,7 @@ module Recurly
|
|
916
1372
|
|
917
1373
|
# Deactivate a unique coupon code
|
918
1374
|
#
|
919
|
-
# @param unique_coupon_code_id [String] Unique Coupon Code ID or code (use prefix:
|
1375
|
+
# @param unique_coupon_code_id [String] Unique Coupon Code ID or code (use prefix: +code-+, e.g. +code-abc-8dh2-def+).
|
920
1376
|
# @return [Resources::UniqueCouponCode] A unique coupon code.
|
921
1377
|
def deactivate_unique_coupon_code(unique_coupon_code_id:)
|
922
1378
|
path = interpolate_path("/sites/{site_id}/unique_coupon_codes/{unique_coupon_code_id}", site_id: site_id, unique_coupon_code_id: unique_coupon_code_id)
|
@@ -925,7 +1381,7 @@ module Recurly
|
|
925
1381
|
|
926
1382
|
# Restore a unique coupon code
|
927
1383
|
#
|
928
|
-
# @param unique_coupon_code_id [String] Unique Coupon Code ID or code (use prefix:
|
1384
|
+
# @param unique_coupon_code_id [String] Unique Coupon Code ID or code (use prefix: +code-+, e.g. +code-abc-8dh2-def+).
|
929
1385
|
# @return [Resources::UniqueCouponCode] A unique coupon code.
|
930
1386
|
def reactivate_unique_coupon_code(unique_coupon_code_id:)
|
931
1387
|
path = interpolate_path("/sites/{site_id}/unique_coupon_codes/{unique_coupon_code_id}/restore", site_id: site_id, unique_coupon_code_id: unique_coupon_code_id)
|