recurly 3.12.0 → 3.17.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,6 +10,10 @@ module Recurly
10
10
  # @return [AccountPurchase]
11
11
  define_attribute :account, :AccountPurchase
12
12
 
13
+ # @!attribute billing_info_id
14
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
15
+ define_attribute :billing_info_id, String
16
+
13
17
  # @!attribute collection_method
14
18
  # @return [String] Must be set to manual in order to preview a purchase for an Account that does not have payment information associated with the Billing Info.
15
19
  define_attribute :collection_method, String
@@ -23,7 +23,7 @@ module Recurly
23
23
  define_attribute :revenue_schedule_type, String
24
24
 
25
25
  # @!attribute tiers
26
- # @return [Array[SubscriptionAddOnTier]] If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object must include one to many tiers with `ending_quantity` and `unit_amount`. There must be one tier with an `ending_quantity` of 999999999 which is the default if not provided.
26
+ # @return [Array[SubscriptionAddOnTier]] If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object must include one to many tiers with `ending_quantity` and `unit_amount`. There must be one tier with an `ending_quantity` of 999999999 which is the default if not provided. See our [Guide](https://developers.recurly.com/guides/item-addon-guide.html) for an overview of how to configure quantity-based pricing models.
27
27
  define_attribute :tiers, Array, { :item_type => :SubscriptionAddOnTier }
28
28
 
29
29
  # @!attribute unit_amount
@@ -31,7 +31,7 @@ module Recurly
31
31
  define_attribute :unit_amount, Float
32
32
 
33
33
  # @!attribute usage_percentage
34
- # @return [Float] The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is percentage. Must be omitted otherwise. `usage_percentage` does not support tiers.
34
+ # @return [Float] The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is percentage. Must be omitted otherwise. `usage_percentage` does not support tiers. See our [Guide](https://developers.recurly.com/guides/usage-based-billing-guide.html) for an overview of how to configure usage add-ons.
35
35
  define_attribute :usage_percentage, Float
36
36
  end
37
37
  end
@@ -18,6 +18,10 @@ module Recurly
18
18
  # @return [Boolean] Whether the subscription renews at the end of its term.
19
19
  define_attribute :auto_renew, :Boolean
20
20
 
21
+ # @!attribute billing_info_id
22
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
23
+ define_attribute :billing_info_id, String
24
+
21
25
  # @!attribute collection_method
22
26
  # @return [String] Collection method
23
27
  define_attribute :collection_method, String
@@ -10,6 +10,10 @@ module Recurly
10
10
  # @return [Boolean] Whether the subscription renews at the end of its term.
11
11
  define_attribute :auto_renew, :Boolean
12
12
 
13
+ # @!attribute billing_info_id
14
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
15
+ define_attribute :billing_info_id, String
16
+
13
17
  # @!attribute collection_method
14
18
  # @return [String] Change collection method
15
19
  define_attribute :collection_method, String
@@ -46,6 +46,10 @@ module Recurly
46
46
  # @return [PaymentMethod]
47
47
  define_attribute :payment_method, :PaymentMethod
48
48
 
49
+ # @!attribute primary_payment_method
50
+ # @return [Boolean] The `primary_payment_method` indicator is used to designate the primary billing info on the account. The first billing info created on an account will always become primary. Adding additional billing infos provides the flexibility to mark another billing info as primary, or adding additional non-primary billing infos. This can be accomplished by passing the `primary_payment_method` indicator. When adding billing infos via the billing_info and /accounts endpoints, this value is not permitted, and will return an error if provided.
51
+ define_attribute :primary_payment_method, :Boolean
52
+
49
53
  # @!attribute updated_at
50
54
  # @return [DateTime] When the billing information was last changed.
51
55
  define_attribute :updated_at, DateTime
@@ -6,6 +6,10 @@ module Recurly
6
6
  module Resources
7
7
  class Coupon < Resource
8
8
 
9
+ # @!attribute applies_to_all_items
10
+ # @return [Boolean] The coupon is valid for all items if true. If false then `items` will list the applicable items.
11
+ define_attribute :applies_to_all_items, :Boolean
12
+
9
13
  # @!attribute applies_to_all_plans
10
14
  # @return [Boolean] The coupon is valid for all plans if true. If false then `plans` and `plans_names` will list the applicable plans.
11
15
  define_attribute :applies_to_all_plans, :Boolean
@@ -14,6 +18,14 @@ module Recurly
14
18
  # @return [Boolean] The coupon is valid for one-time, non-plan charges if true.
15
19
  define_attribute :applies_to_non_plan_charges, :Boolean
16
20
 
21
+ # @!attribute bulk_coupon_code
22
+ # @return [String] The Coupon code of the parent Bulk Coupon
23
+ define_attribute :bulk_coupon_code, String
24
+
25
+ # @!attribute bulk_coupon_id
26
+ # @return [String] The Coupon ID of the parent Bulk Coupon
27
+ define_attribute :bulk_coupon_id, String
28
+
17
29
  # @!attribute code
18
30
  # @return [String] The code the customer enters to redeem the coupon.
19
31
  define_attribute :code, String
@@ -58,6 +70,10 @@ module Recurly
58
70
  # @return [String] Description of the coupon on the invoice.
59
71
  define_attribute :invoice_description, String
60
72
 
73
+ # @!attribute items
74
+ # @return [Array[ItemMini]] A list of items for which this coupon applies. This will be `null` if `applies_to_all_items=true`.
75
+ define_attribute :items, Array, { :item_type => :ItemMini }
76
+
61
77
  # @!attribute max_redemptions
62
78
  # @return [Integer] A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions.
63
79
  define_attribute :max_redemptions, Integer
@@ -79,7 +95,7 @@ module Recurly
79
95
  define_attribute :plans, Array, { :item_type => :PlanMini }
80
96
 
81
97
  # @!attribute plans_names
82
- # @return [Array[String]] TODO
98
+ # @return [Array[String]] A list of plan names for which this coupon applies.
83
99
  define_attribute :plans_names, Array, { :item_type => String }
84
100
 
85
101
  # @!attribute redeem_by
@@ -0,0 +1,18 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Resources
7
+ class ExportDates < Resource
8
+
9
+ # @!attribute dates
10
+ # @return [Array[String]] An array of dates that have available exports.
11
+ define_attribute :dates, Array, { :item_type => String }
12
+
13
+ # @!attribute object
14
+ # @return [String] Object type
15
+ define_attribute :object, String
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,22 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Resources
7
+ class ExportFile < Resource
8
+
9
+ # @!attribute href
10
+ # @return [String] A presigned link to download the export file.
11
+ define_attribute :href, String
12
+
13
+ # @!attribute md5sum
14
+ # @return [String] MD5 hash of the export file.
15
+ define_attribute :md5sum, String
16
+
17
+ # @!attribute name
18
+ # @return [String] Name of the export file.
19
+ define_attribute :name, String
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,18 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Resources
7
+ class ExportFiles < Resource
8
+
9
+ # @!attribute files
10
+ # @return [Array[ExportFile]]
11
+ define_attribute :files, Array, { :item_type => :ExportFile }
12
+
13
+ # @!attribute object
14
+ # @return [String] Object type
15
+ define_attribute :object, String
16
+ end
17
+ end
18
+ end
@@ -18,6 +18,10 @@ module Recurly
18
18
  # @return [Float] The outstanding balance remaining on this invoice.
19
19
  define_attribute :balance, Float
20
20
 
21
+ # @!attribute billing_info_id
22
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
23
+ define_attribute :billing_info_id, String
24
+
21
25
  # @!attribute closed_at
22
26
  # @return [DateTime] Date invoice was marked paid or failed.
23
27
  define_attribute :closed_at, DateTime
@@ -30,6 +30,10 @@ module Recurly
30
30
  # @return [DateTime] Recurring subscriptions paid with ACH will have this attribute set. This timestamp is used for alerting customers to reauthorize in 3 years in accordance with NACHA rules. If a subscription becomes inactive or the billing info is no longer a bank account, this timestamp is cleared.
31
31
  define_attribute :bank_account_authorized_at, DateTime
32
32
 
33
+ # @!attribute billing_info_id
34
+ # @return [String] Billing Info ID.
35
+ define_attribute :billing_info_id, String
36
+
33
37
  # @!attribute canceled_at
34
38
  # @return [DateTime] Canceled at
35
39
  define_attribute :canceled_at, DateTime
@@ -39,7 +43,7 @@ module Recurly
39
43
  define_attribute :collection_method, String
40
44
 
41
45
  # @!attribute coupon_redemptions
42
- # @return [Array[CouponRedemptionMini]] Coupon redemptions
46
+ # @return [Array[CouponRedemptionMini]] Returns subscription level coupon redemptions that are tied to this subscription.
43
47
  define_attribute :coupon_redemptions, Array, { :item_type => :CouponRedemptionMini }
44
48
 
45
49
  # @!attribute created_at
@@ -6,6 +6,14 @@ module Recurly
6
6
  module Resources
7
7
  class UniqueCouponCode < Resource
8
8
 
9
+ # @!attribute bulk_coupon_code
10
+ # @return [String] The Coupon code of the parent Bulk Coupon
11
+ define_attribute :bulk_coupon_code, String
12
+
13
+ # @!attribute bulk_coupon_id
14
+ # @return [String] The Coupon ID of the parent Bulk Coupon
15
+ define_attribute :bulk_coupon_id, String
16
+
9
17
  # @!attribute code
10
18
  # @return [String] The code the customer enters to redeem the coupon.
11
19
  define_attribute :code, String
@@ -46,10 +46,18 @@ module Recurly
46
46
  # @return [Array[SubscriptionAddOnTier]] The tiers and prices of the subscription based on the usage_timestamp. If tier_type = flat, tiers = null
47
47
  define_attribute :tiers, Array, { :item_type => :SubscriptionAddOnTier }
48
48
 
49
+ # @!attribute unit_amount
50
+ # @return [Float] Unit price
51
+ define_attribute :unit_amount, Float
52
+
49
53
  # @!attribute updated_at
50
54
  # @return [DateTime] When the usage record was billed on an invoice.
51
55
  define_attribute :updated_at, DateTime
52
56
 
57
+ # @!attribute usage_percentage
58
+ # @return [Float] The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0.
59
+ define_attribute :usage_percentage, Float
60
+
53
61
  # @!attribute usage_timestamp
54
62
  # @return [DateTime] When the usage actually happened. This will define the line item dates this usage is billed under and is important for revenue recognition.
55
63
  define_attribute :usage_timestamp, DateTime
@@ -1,3 +1,3 @@
1
1
  module Recurly
2
- VERSION = "3.12.0"
2
+ VERSION = "3.17.0"
3
3
  end
@@ -158,6 +158,7 @@ x-tagGroups:
158
158
  - shipping_address
159
159
  - purchase
160
160
  - usage
161
+ - automated_exports
161
162
  - name: Products and Promotions
162
163
  tags:
163
164
  - item
@@ -282,6 +283,9 @@ tags:
282
283
  - name: shipping_method
283
284
  x-displayName: Shipping Method
284
285
  description: Shipping methods offered to send products to customers.
286
+ - name: automated_exports
287
+ x-displayName: Automated Exports
288
+ description: Automated exports of customer data.
285
289
  paths:
286
290
  "/sites":
287
291
  get:
@@ -1138,14 +1142,11 @@ paths:
1138
1142
  const account = await client.deactivateAccount(accountId)
1139
1143
  console.log('Deleted account: ', account.code)
1140
1144
  } catch (err) {
1141
- if (err && err.type === 'not-found') {
1145
+ if (err instanceof recurly.errors.NotFoundError) {
1142
1146
  // If the request was not found, you may want to alert the user or
1143
1147
  // just return null
1144
1148
  console.log('Resource Not Found')
1145
1149
  }
1146
- // If we don't know what to do with the err, we should
1147
- // probably re-raise and let our web framework and logger handle it
1148
- throw err
1149
1150
  }
1150
1151
  - lang: Python
1151
1152
  source: |
@@ -1645,14 +1646,11 @@ paths:
1645
1646
  const account = await client.reactivateAccount(accountId)
1646
1647
  console.log('Reactivated account: ', account.code)
1647
1648
  } catch (err) {
1648
- if (err && err.type === 'not_found') {
1649
+ if (err instanceof recurly.errors.NotFoundError) {
1649
1650
  // If the request was not found, you may want to alert the user or
1650
1651
  // just return null
1651
1652
  console.log('Resource Not Found')
1652
1653
  }
1653
- // If we don't know what to do with the err, we should
1654
- // probably re-raise and let our web framework and logger handle it
1655
- throw err
1656
1654
  }
1657
1655
  - lang: Python
1658
1656
  source: |
@@ -1970,8 +1968,8 @@ paths:
1970
1968
  summary: Set an account's billing information
1971
1969
  description: |
1972
1970
  If you're using Recurly.js to securely submit data from webforms without sending it through your server,
1973
- you can associate the billing information with an account by passing in the `token_id`. Be sure to only
1974
- set this field.
1971
+ you can associate the billing information with an account by passing in the `token_id`. The only other
1972
+ field permitted with `token_id` is `primary_payment_method`.
1975
1973
 
1976
1974
  For credit card payments you'll need the following required fields:
1977
1975
 
@@ -2246,6 +2244,221 @@ paths:
2246
2244
  {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
2247
2245
  Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Removed Billing
2248
2246
  Info: %v\", billingInfo)"
2247
+ "/sites/{site_id}/accounts/{account_id}/billing_infos":
2248
+ get:
2249
+ tags:
2250
+ - account
2251
+ - billing_info
2252
+ operationId: list_billing_infos
2253
+ summary: Get the list of billing information associated with an account
2254
+ description: See the [Pagination Guide](/guides/pagination.html) to learn how
2255
+ to use pagination in the API and Client Libraries.
2256
+ parameters:
2257
+ - "$ref": "#/components/parameters/site_id"
2258
+ - "$ref": "#/components/parameters/account_id"
2259
+ - "$ref": "#/components/parameters/ids"
2260
+ - "$ref": "#/components/parameters/sort_dates"
2261
+ - "$ref": "#/components/parameters/filter_begin_time"
2262
+ - "$ref": "#/components/parameters/filter_end_time"
2263
+ responses:
2264
+ '200':
2265
+ description: A list of the the billing information for an account's
2266
+ content:
2267
+ application/json:
2268
+ schema:
2269
+ "$ref": "#/components/schemas/BillingInfoList"
2270
+ '400':
2271
+ description: Invalid or unpermitted parameter
2272
+ content:
2273
+ application/json:
2274
+ schema:
2275
+ "$ref": "#/components/schemas/Error"
2276
+ '404':
2277
+ description: Incorrect site or account
2278
+ content:
2279
+ application/json:
2280
+ schema:
2281
+ "$ref": "#/components/schemas/Error"
2282
+ x-code-samples: []
2283
+ post:
2284
+ tags:
2285
+ - account
2286
+ - billing_info
2287
+ operationId: create_billing_info
2288
+ summary: Set an account's billing information when the wallet feature is enabled
2289
+ description: |
2290
+ If you're using Recurly.js to securely submit data from webforms without sending it through your server,
2291
+ you can associate the billing information with an account by passing in the `token_id`. The only other
2292
+ field permitted with `token_id` is `primary_payment_method`.
2293
+
2294
+ For credit card payments you'll need the following required fields:
2295
+
2296
+ - first_name
2297
+ - last_name
2298
+ - number
2299
+ - month
2300
+ - year
2301
+
2302
+ For external (not Recurly.js) tokenized payments you'll need the following required fields:
2303
+
2304
+ - first_name
2305
+ - last_name
2306
+ - gateway_token
2307
+ - gateway_code
2308
+ parameters:
2309
+ - "$ref": "#/components/parameters/site_id"
2310
+ - "$ref": "#/components/parameters/account_id"
2311
+ requestBody:
2312
+ content:
2313
+ application/json:
2314
+ schema:
2315
+ "$ref": "#/components/schemas/BillingInfoCreate"
2316
+ required: true
2317
+ responses:
2318
+ '200':
2319
+ description: Updated billing information.
2320
+ content:
2321
+ application/json:
2322
+ schema:
2323
+ "$ref": "#/components/schemas/BillingInfo"
2324
+ '400':
2325
+ description: Bad request, perhaps invalid JSON?
2326
+ content:
2327
+ application/json:
2328
+ schema:
2329
+ "$ref": "#/components/schemas/Error"
2330
+ '404':
2331
+ description: Incorrect site or account ID.
2332
+ content:
2333
+ application/json:
2334
+ schema:
2335
+ "$ref": "#/components/schemas/Error"
2336
+ '422':
2337
+ description: Invalid billing information, or error running the verification
2338
+ transaction.
2339
+ content:
2340
+ application/json:
2341
+ schema:
2342
+ "$ref": "#/components/schemas/ErrorMayHaveTransaction"
2343
+ x-code-samples: []
2344
+ "/sites/{site_id}/accounts/{account_id}/billing_infos/{billing_info_id}":
2345
+ get:
2346
+ tags:
2347
+ - account
2348
+ - billing_info
2349
+ operationId: get_a_billing_info
2350
+ summary: Fetch a billing info
2351
+ parameters:
2352
+ - "$ref": "#/components/parameters/site_id"
2353
+ - "$ref": "#/components/parameters/account_id"
2354
+ - "$ref": "#/components/parameters/billing_info_id"
2355
+ responses:
2356
+ '200':
2357
+ description: A billing info.
2358
+ content:
2359
+ application/json:
2360
+ schema:
2361
+ "$ref": "#/components/schemas/BillingInfo"
2362
+ '404':
2363
+ description: Incorrect site, account, or billing info ID.
2364
+ content:
2365
+ application/json:
2366
+ schema:
2367
+ "$ref": "#/components/schemas/Error"
2368
+ x-code-samples: []
2369
+ put:
2370
+ tags:
2371
+ - account
2372
+ - billing_info
2373
+ operationId: update_a_billing_info
2374
+ summary: Update an account's billing information
2375
+ description: |
2376
+ If you're using Recurly.js to securely submit data from webforms without sending it through your server,
2377
+ you can associate the billing information with an account by passing in the `token_id`. The only other
2378
+ field permitted with `token_id` is `primary_payment_method`.
2379
+
2380
+ For credit card payments you'll need the following required fields:
2381
+
2382
+ - first_name
2383
+ - last_name
2384
+ - number
2385
+ - month
2386
+ - year
2387
+
2388
+ For external (not Recurly.js) tokenized payments you'll need the following required fields:
2389
+
2390
+ - first_name
2391
+ - last_name
2392
+ - gateway_token
2393
+ - gateway_code
2394
+ parameters:
2395
+ - "$ref": "#/components/parameters/site_id"
2396
+ - "$ref": "#/components/parameters/account_id"
2397
+ - "$ref": "#/components/parameters/billing_info_id"
2398
+ requestBody:
2399
+ content:
2400
+ application/json:
2401
+ schema:
2402
+ "$ref": "#/components/schemas/BillingInfoCreate"
2403
+ required: true
2404
+ responses:
2405
+ '200':
2406
+ description: Updated billing information.
2407
+ content:
2408
+ application/json:
2409
+ schema:
2410
+ "$ref": "#/components/schemas/BillingInfo"
2411
+ '400':
2412
+ description: Bad request, perhaps invalid JSON?
2413
+ content:
2414
+ application/json:
2415
+ schema:
2416
+ "$ref": "#/components/schemas/Error"
2417
+ '404':
2418
+ description: Incorrect site or account ID.
2419
+ content:
2420
+ application/json:
2421
+ schema:
2422
+ "$ref": "#/components/schemas/Error"
2423
+ '422':
2424
+ description: Invalid billing information, or error running the verification
2425
+ transaction.
2426
+ content:
2427
+ application/json:
2428
+ schema:
2429
+ "$ref": "#/components/schemas/ErrorMayHaveTransaction"
2430
+ x-code-samples: []
2431
+ delete:
2432
+ tags:
2433
+ - account
2434
+ - billing_info
2435
+ operationId: remove_a_billing_info
2436
+ summary: Remove an account's billing information
2437
+ parameters:
2438
+ - "$ref": "#/components/parameters/site_id"
2439
+ - "$ref": "#/components/parameters/account_id"
2440
+ - "$ref": "#/components/parameters/billing_info_id"
2441
+ description: You may remove any stored billing information for an account. If
2442
+ the account has a subscription, the renewal will go into dunning unless the
2443
+ billing information is updated before the renewal occurs.
2444
+ responses:
2445
+ '204':
2446
+ description: Billing information deleted
2447
+ '404':
2448
+ description: Account has no billing information, or incorrect site or account
2449
+ ID.
2450
+ content:
2451
+ application/json:
2452
+ schema:
2453
+ "$ref": "#/components/schemas/Error"
2454
+ '422':
2455
+ description: Billing info cannot be deleted. Please set a new primary billing
2456
+ info before deleting this billing info
2457
+ content:
2458
+ application/json:
2459
+ schema:
2460
+ "$ref": "#/components/schemas/Error"
2461
+ x-code-samples: []
2249
2462
  "/sites/{site_id}/accounts/{account_id}/coupon_redemptions":
2250
2463
  get:
2251
2464
  tags:
@@ -2262,6 +2475,7 @@ paths:
2262
2475
  - "$ref": "#/components/parameters/sort_dates"
2263
2476
  - "$ref": "#/components/parameters/filter_begin_time"
2264
2477
  - "$ref": "#/components/parameters/filter_end_time"
2478
+ - "$ref": "#/components/parameters/filter_state"
2265
2479
  responses:
2266
2480
  '200':
2267
2481
  description: A list of the the coupon redemptions on an account.
@@ -5475,6 +5689,156 @@ paths:
5475
5689
  schema:
5476
5690
  "$ref": "#/components/schemas/Error"
5477
5691
  x-code-samples: []
5692
+ "/sites/{site_id}/coupons/{coupon_id}/restore":
5693
+ put:
5694
+ tags:
5695
+ - coupon
5696
+ operationId: restore_coupon
5697
+ summary: Restore an inactive coupon
5698
+ description: Make an expired coupon redeemable again. You can change editable
5699
+ fields in this call.
5700
+ parameters:
5701
+ - "$ref": "#/components/parameters/site_id"
5702
+ - "$ref": "#/components/parameters/coupon_id"
5703
+ requestBody:
5704
+ content:
5705
+ application/json:
5706
+ schema:
5707
+ "$ref": "#/components/schemas/CouponUpdate"
5708
+ required: true
5709
+ responses:
5710
+ '200':
5711
+ description: The restored coupon.
5712
+ content:
5713
+ application/json:
5714
+ schema:
5715
+ "$ref": "#/components/schemas/Coupon"
5716
+ '400':
5717
+ description: Bad request, perhaps invalid JSON?
5718
+ content:
5719
+ application/json:
5720
+ schema:
5721
+ "$ref": "#/components/schemas/Error"
5722
+ '404':
5723
+ description: Incorrect site or coupon ID.
5724
+ content:
5725
+ application/json:
5726
+ schema:
5727
+ "$ref": "#/components/schemas/Error"
5728
+ '422':
5729
+ description: Invalid request parameters
5730
+ content:
5731
+ application/json:
5732
+ schema:
5733
+ "$ref": "#/components/schemas/Error"
5734
+ default:
5735
+ description: Unexpected error.
5736
+ content:
5737
+ application/json:
5738
+ schema:
5739
+ "$ref": "#/components/schemas/Error"
5740
+ x-code-samples:
5741
+ - lang: Node.js
5742
+ source: |
5743
+ try {
5744
+ const coupon = await client.restoreCoupon(couponId, {
5745
+ name: "New Coupon Name"
5746
+ })
5747
+ console.log('Restored coupon: ', coupon.code)
5748
+ } catch (err) {
5749
+ if (err instanceof recurly.errors.NotFoundError) {
5750
+ // If the request was not found, you may want to alert the user or
5751
+ // just return null
5752
+ console.log('Resource Not Found')
5753
+ }
5754
+
5755
+ }
5756
+ - lang: Python
5757
+ source: |
5758
+ try:
5759
+ coupon = client.restore_coupon(coupon_id, {
5760
+ "name": "New Coupon Name"
5761
+ })
5762
+ print("Restored Coupon %s" % coupon)
5763
+ except recurly.errors.NotFoundError:
5764
+ # If the resource was not found, you may want to alert the user or
5765
+ # just return nil
5766
+ print("Resource Not Found")
5767
+ - lang: ".NET"
5768
+ source: |
5769
+ try
5770
+ {
5771
+ var couponReq = new CouponUpdate() {
5772
+ Name = "New Coupon Name"
5773
+ };
5774
+ Coupon coupon = client.RestoreCoupon(couponId, couponReq);
5775
+ Console.WriteLine($"Restored coupon {coupon.Code}");
5776
+ }
5777
+ catch (Recurly.Errors.Validation ex)
5778
+ {
5779
+ // If the request was not valid, you may want to tell your user
5780
+ // why. You can find the invalid params and reasons in ex.Error.Params
5781
+ Console.WriteLine($"Failed validation: {ex.Error.Message}");
5782
+ }
5783
+ catch (Recurly.Errors.ApiError ex)
5784
+ {
5785
+ // Use ApiError to catch a generic error from the API
5786
+ Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}");
5787
+ }
5788
+ - lang: Ruby
5789
+ source: |
5790
+ begin
5791
+ coupon = @client.restore_coupon(coupon_id: coupon_id, body: {
5792
+ name: "New Coupon Name"
5793
+ })
5794
+ puts "Restored coupon #{coupon}"
5795
+ rescue Recurly::Errors::NotFoundError
5796
+ # If the resource was not found, you may want to alert the user or
5797
+ # just return nil
5798
+ puts "Resource Not Found"
5799
+ end
5800
+ - lang: Java
5801
+ source: |
5802
+ try {
5803
+ final CouponUpdate couponUpdate = new CouponUpdate();
5804
+ couponUpdate.setName("New Coupon Name");
5805
+
5806
+ final Coupon coupon = client.restoreCoupon(couponId, couponUpdate);
5807
+ System.out.println("Restored coupon: " + coupon.getCode());
5808
+ } catch (ValidationException e) {
5809
+ // If the request was not valid, you may want to tell your user
5810
+ // why. You can find the invalid params and reasons in e.getError().getParams()
5811
+ System.out.println("Failed validation: " + e.getError().getMessage());
5812
+ } catch (ApiException e) {
5813
+ // Use ApiException to catch a generic error from the API
5814
+ System.out.println("Unexpected Recurly Error: " + e.getError().getMessage());
5815
+ }
5816
+ - lang: PHP
5817
+ source: |
5818
+ try {
5819
+ $coupon_update = [
5820
+ "name" => "New Coupon Name"
5821
+ ];
5822
+ $coupon = $client->restoreCoupon($coupon_id, $coupon_update);
5823
+
5824
+ echo 'Restored Coupon:' . PHP_EOL;
5825
+ var_dump($coupon);
5826
+ } catch (\Recurly\Errors\NotFound $e) {
5827
+ // Could not find the resource, you may want to inform the user
5828
+ // or just return a NULL
5829
+ echo 'Could not find resource.' . PHP_EOL;
5830
+ var_dump($e);
5831
+ } catch (\Recurly\RecurlyError $e) {
5832
+ // Something bad happened... tell the user so that they can fix it?
5833
+ echo 'Some unexpected Recurly error happened. Try again later.' . PHP_EOL;
5834
+ }
5835
+ - lang: Go
5836
+ source: "updateReq := &recurly.CouponUpdate{\n\tName: recurly.String(\"New
5837
+ Coupon Name\"),\n}\ncoupon, err := client.RestoreCoupon(couponId, updateReq)\nif
5838
+ e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation
5839
+ {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
5840
+ Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Restored Coupon:
5841
+ %s\", coupon.Id)"
5478
5842
  "/sites/{site_id}/coupons/{coupon_id}/unique_coupon_codes":
5479
5843
  get:
5480
5844
  tags:
@@ -6473,14 +6837,11 @@ paths:
6473
6837
  const item = await client.deactivateItem(itemId)
6474
6838
  console.log('Deleted item: ', item.code)
6475
6839
  } catch (err) {
6476
- if (err && err.type === 'not-found') {
6840
+ if (err instanceof recurly.errors.NotFoundError) {
6477
6841
  // If the request was not found, you may want to alert the user or
6478
6842
  // just return null
6479
6843
  console.log('Resource Not Found')
6480
6844
  }
6481
- // If we don't know what to do with the err, we should
6482
- // probably re-raise and let our web framework and logger handle it
6483
- throw err
6484
6845
  }
6485
6846
  - lang: Python
6486
6847
  source: |
@@ -6597,14 +6958,11 @@ paths:
6597
6958
  const item = await client.reactivateItem(itemId)
6598
6959
  console.log('Reactivated item: ', item.code)
6599
6960
  } catch (err) {
6600
- if (err && err.type === 'not_found') {
6961
+ if (err instanceof recurly.errors.NotFoundError) {
6601
6962
  // If the request was not found, you may want to alert the user or
6602
6963
  // just return null
6603
6964
  console.log('Resource Not Found')
6604
6965
  }
6605
- // If we don't know what to do with the err, we should
6606
- // probably re-raise and let our web framework and logger handle it
6607
- throw err
6608
6966
  }
6609
6967
  - lang: Python
6610
6968
  source: |
@@ -11183,6 +11541,16 @@ paths:
11183
11541
  - partial
11184
11542
  - none
11185
11543
  default: none
11544
+ - name: charge
11545
+ in: query
11546
+ description: Applicable only if the subscription has usage based add-ons and
11547
+ unbilled usage logged for the current billing cycle. If true, current billing
11548
+ cycle unbilled usage is billed on the final invoice. If false, Recurly will
11549
+ create a negative usage record for current billing cycle usage that will
11550
+ zero out the final invoice line items.
11551
+ schema:
11552
+ default: true
11553
+ type: boolean
11186
11554
  responses:
11187
11555
  '200':
11188
11556
  description: An expired subscription.
@@ -13627,6 +13995,231 @@ paths:
13627
13995
  {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
13628
13996
  Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Preview Charge
13629
13997
  Invoice %v\", collection.ChargeInvoice)"
13998
+ "/sites/{site_id}/export_dates":
13999
+ parameters:
14000
+ - "$ref": "#/components/parameters/site_id"
14001
+ get:
14002
+ tags:
14003
+ - automated_exports
14004
+ operationId: get_export_dates
14005
+ summary: List the dates that have an available export to download.
14006
+ description: Returns a list of dates for which export files are available for
14007
+ download.
14008
+ responses:
14009
+ '200':
14010
+ description: Returns a list of dates.
14011
+ content:
14012
+ application/json:
14013
+ schema:
14014
+ "$ref": "#/components/schemas/ExportDates"
14015
+ '400':
14016
+ description: Invalid or unpermitted parameter.
14017
+ content:
14018
+ application/json:
14019
+ schema:
14020
+ "$ref": "#/components/schemas/Error"
14021
+ '404':
14022
+ description: Incorrect site ID.
14023
+ content:
14024
+ application/json:
14025
+ schema:
14026
+ "$ref": "#/components/schemas/Error"
14027
+ default:
14028
+ description: Unexpected error.
14029
+ content:
14030
+ application/json:
14031
+ schema:
14032
+ "$ref": "#/components/schemas/Error"
14033
+ x-code-samples:
14034
+ - lang: Node.js
14035
+ source: |
14036
+ try {
14037
+ const export_dates = await client.getExportDates()
14038
+ export_dates.dates.forEach(date => {
14039
+ console.log(`Exports are available for: ${date}`)
14040
+ })
14041
+ } catch (err) {
14042
+ if (err instanceof recurly.ApiError) {
14043
+ console.log('Unexpected error', err)
14044
+ }
14045
+ }
14046
+ - lang: Python
14047
+ source: |
14048
+ try:
14049
+ export_dates = client.get_export_dates()
14050
+ for date in export_dates.dates:
14051
+ print( "Exports are available for: %s" % date)
14052
+ except recurly.errors.NotFoundError:
14053
+ # If the resource was not found, you may want to alert the user or
14054
+ # just return nil
14055
+ print("Resource Not Found")
14056
+ - lang: ".NET"
14057
+ source: |
14058
+ try
14059
+ {
14060
+ ExportDates exportDates = client.GetExportDates();
14061
+ foreach (var date in exportDates.Dates)
14062
+ {
14063
+ System.Console.WriteLine($"Exports are available for: {date}");
14064
+ }
14065
+ }
14066
+ catch (Recurly.Errors.ApiError ex)
14067
+ {
14068
+ // Use ApiError to catch a generic error from the API
14069
+ Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}");
14070
+ }
14071
+ - lang: Ruby
14072
+ source: |
14073
+ begin
14074
+ export_dates = @client.get_export_dates()
14075
+ export_dates.dates.each do |date|
14076
+ puts "Exports are available for: #{date}"
14077
+ end
14078
+ rescue Recurly::Errors::NotFoundError
14079
+ # If the resource was not found, you may want to alert the user or
14080
+ # just return nil
14081
+ puts "Resource Not Found"
14082
+ end
14083
+ - lang: Java
14084
+ source: |
14085
+ try {
14086
+ ExportDates exportDates = client.getExportDates();
14087
+ for (String date : exportDates.getDates()) {
14088
+ System.out.println("Exports are available for: " + date);
14089
+ }
14090
+ } catch (ApiException e) {
14091
+ // Use ApiException to catch a generic error from the API
14092
+ System.out.println("Unexpected Recurly Error: " + e.getError().getMessage());
14093
+ }
14094
+ - lang: PHP
14095
+ source: |
14096
+ try {
14097
+ $export_dates = $client->getExportDates();
14098
+ foreach($export_dates->getDates() as $date)
14099
+ {
14100
+ echo "Exports are available for: {$date}" . PHP_EOL;
14101
+ }
14102
+ } catch (\Recurly\RecurlyError $e) {
14103
+ echo 'Some unexpected Recurly error happened. Try again later.' . PHP_EOL;
14104
+ }
14105
+ - lang: Go
14106
+ source: "exportDates, err := client.GetExportDates()\nif e, ok := err.(*recurly.Error);
14107
+ ok {\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfor
14108
+ _, date := range exportDates.Dates {\n\tfmt.Println(\"Exports are available
14109
+ for: \", date)\n}"
14110
+ "/sites/{site_id}/export_dates/{export_date}/export_files":
14111
+ parameters:
14112
+ - "$ref": "#/components/parameters/site_id"
14113
+ - "$ref": "#/components/parameters/export_date"
14114
+ get:
14115
+ tags:
14116
+ - automated_exports
14117
+ operationId: get_export_files
14118
+ summary: List of the export files that are available to download.
14119
+ description: Returns a list of presigned URLs to download export files for the
14120
+ given date, with their MD5 sums.
14121
+ responses:
14122
+ '200':
14123
+ description: Returns a list of export files to download.
14124
+ content:
14125
+ application/json:
14126
+ schema:
14127
+ "$ref": "#/components/schemas/ExportFiles"
14128
+ '400':
14129
+ description: Invalid or unpermitted parameter.
14130
+ content:
14131
+ application/json:
14132
+ schema:
14133
+ "$ref": "#/components/schemas/Error"
14134
+ '404':
14135
+ description: Incorrect site ID or date.
14136
+ content:
14137
+ application/json:
14138
+ schema:
14139
+ "$ref": "#/components/schemas/Error"
14140
+ default:
14141
+ description: Unexpected error.
14142
+ content:
14143
+ application/json:
14144
+ schema:
14145
+ "$ref": "#/components/schemas/Error"
14146
+ x-code-samples:
14147
+ - lang: Node.js
14148
+ source: |
14149
+ try {
14150
+ const export_files = await client.getExportFiles(export_date)
14151
+ export_files.files.forEach(file => {
14152
+ console.log(`Export file download URL: ${file.href}`)
14153
+ })
14154
+ } catch (err) {
14155
+ if (err instanceof recurly.ApiError) {
14156
+ console.log('Unexpected error', err)
14157
+ }
14158
+ }
14159
+ - lang: Python
14160
+ source: |
14161
+ try:
14162
+ export_files = client.get_export_files(export_date)
14163
+ for file in export_files.files:
14164
+ print( "Export file download URL: %s" % file.href)
14165
+ except recurly.errors.NotFoundError:
14166
+ # If the resource was not found, you may want to alert the user or
14167
+ # just return nil
14168
+ print("Resource Not Found")
14169
+ - lang: ".NET"
14170
+ source: |
14171
+ try
14172
+ {
14173
+ ExportFiles exportFiles = client.GetExportFiles(exportDate: exportDate);
14174
+ foreach (var file in exportFiles.Files)
14175
+ {
14176
+ System.Console.WriteLine($"Export file download URL: {file.Href}");
14177
+ }
14178
+ }
14179
+ catch (Recurly.Errors.ApiError ex)
14180
+ {
14181
+ // Use ApiError to catch a generic error from the API
14182
+ Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}");
14183
+ }
14184
+ - lang: Ruby
14185
+ source: |
14186
+ begin
14187
+ export_files = @client.get_export_files(export_date: export_date)
14188
+ export_files.files.each do |file|
14189
+ puts "Export file download URL: #{file.href}"
14190
+ end
14191
+ rescue Recurly::Errors::NotFoundError
14192
+ # If the resource was not found, you may want to alert the user or
14193
+ # just return nil
14194
+ puts "Resource Not Found"
14195
+ end
14196
+ - lang: Java
14197
+ source: |
14198
+ try {
14199
+ ExportFiles exportFiles = client.getExportFiles(exportDate);
14200
+ for (ExportFile file : exportFiles.getFiles()) {
14201
+ System.out.println("Export file download URL: " + file.getHref());
14202
+ }
14203
+ } catch (ApiException e) {
14204
+ // Use ApiException to catch a generic error from the API
14205
+ System.out.println("Unexpected Recurly Error: " + e.getError());
14206
+ }
14207
+ - lang: PHP
14208
+ source: |
14209
+ try {
14210
+ $export_files = $client->getExportFiles($export_date);
14211
+ foreach($export_files->getFiles() as $file)
14212
+ {
14213
+ echo "Export file download URL: {$file->getHref()}" . PHP_EOL;
14214
+ }
14215
+ } catch (\Recurly\RecurlyError $e) {
14216
+ echo 'Some unexpected Recurly error happened. Try again later.' . PHP_EOL;
14217
+ }
14218
+ - lang: Go
14219
+ source: "exportFiles, err := client.GetExportFiles(exportDate)\nif e, ok :=
14220
+ err.(*recurly.Error); ok {\n\tfmt.Printf(\"Unexpected Recurly error: %v\",
14221
+ e)\n\treturn nil, err\n}\n\nfor _, file := range exportFiles.Files {\n\tfmt.Println(\"Export
14222
+ file download URL: \", file.Href)\n}"
13630
14223
  servers:
13631
14224
  - url: https://v3.recurly.com
13632
14225
  components:
@@ -13655,6 +14248,13 @@ components:
13655
14248
  required: true
13656
14249
  schema:
13657
14250
  type: string
14251
+ billing_info_id:
14252
+ name: billing_info_id
14253
+ in: path
14254
+ description: Billing Info ID.
14255
+ required: true
14256
+ schema:
14257
+ type: string
13658
14258
  usage_id:
13659
14259
  name: usage_id
13660
14260
  in: path
@@ -13991,6 +14591,14 @@ components:
13991
14591
  - credit
13992
14592
  - non-legacy
13993
14593
  - legacy
14594
+ export_date:
14595
+ name: export_date
14596
+ in: path
14597
+ description: Date for which to get a list of available automated export files.
14598
+ Date must be in YYYY-MM-DD format.
14599
+ required: true
14600
+ schema:
14601
+ type: string
13994
14602
  securitySchemes:
13995
14603
  api_key:
13996
14604
  type: http
@@ -14074,6 +14682,23 @@ components:
14074
14682
  type: array
14075
14683
  items:
14076
14684
  "$ref": "#/components/schemas/AddOn"
14685
+ BillingInfoList:
14686
+ type: object
14687
+ properties:
14688
+ object:
14689
+ type: string
14690
+ title: Object type
14691
+ description: Will always be List.
14692
+ has_more:
14693
+ type: boolean
14694
+ description: Indicates there are more results on subsequent pages.
14695
+ next:
14696
+ type: string
14697
+ description: Path to subsequent page of results.
14698
+ data:
14699
+ type: array
14700
+ items:
14701
+ "$ref": "#/components/schemas/BillingInfo"
14077
14702
  CreditPaymentList:
14078
14703
  type: object
14079
14704
  properties:
@@ -14529,7 +15154,7 @@ components:
14529
15154
  maxLength: 255
14530
15155
  company:
14531
15156
  type: string
14532
- maxLength: 50
15157
+ maxLength: 100
14533
15158
  vat_number:
14534
15159
  type: string
14535
15160
  description: The VAT number of the account (to avoid having the VAT applied).
@@ -15103,7 +15728,10 @@ components:
15103
15728
  - price
15104
15729
  - percentage
15105
15730
  title: Usage Type
15106
- description: Type of usage, required if `add_on_type` is `usage`.
15731
+ description: |
15732
+ Type of usage, required if `add_on_type` is `usage`. See our
15733
+ [Guide](https://developers.recurly.com/guides/usage-based-billing-guide.html)
15734
+ for an overview of how to configure usage add-ons.
15107
15735
  usage_percentage:
15108
15736
  type: number
15109
15737
  format: float
@@ -15216,7 +15844,9 @@ components:
15216
15844
  title: Tier type
15217
15845
  description: |
15218
15846
  The pricing model for the add-on. For more information,
15219
- [click here](https://docs.recurly.com/docs/billing-models#section-quantity-based).
15847
+ [click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). See
15848
+ our [Guide](https://developers.recurly.com/guides/item-addon-guide.html) for an overview
15849
+ of how to configure quantity-based pricing models.
15220
15850
  default: flat
15221
15851
  enum:
15222
15852
  - flat
@@ -15426,6 +16056,16 @@ components:
15426
16056
  risk_rules_triggered:
15427
16057
  type: object
15428
16058
  title: Kount rules
16059
+ primary_payment_method:
16060
+ type: boolean
16061
+ description: The `primary_payment_method` indicator is used to designate
16062
+ the primary billing info on the account. The first billing info created
16063
+ on an account will always become primary. Adding additional billing infos
16064
+ provides the flexibility to mark another billing info as primary, or adding
16065
+ additional non-primary billing infos. This can be accomplished by passing
16066
+ the `primary_payment_method` indicator. When adding billing infos via
16067
+ the billing_info and /accounts endpoints, this value is not permitted,
16068
+ and will return an error if provided.
15429
16069
  created_at:
15430
16070
  type: string
15431
16071
  format: date-time
@@ -15566,6 +16206,28 @@ components:
15566
16206
  - checking
15567
16207
  - savings
15568
16208
  description: The bank account type. (ACH only)
16209
+ tax_identifier:
16210
+ type: string
16211
+ description: Tax identifier is required if adding a billing info that is
16212
+ a consumer card in Brazil. This would be the customer's CPF, CPF is a
16213
+ Brazilian tax identifier for all tax paying residents.
16214
+ tax_identifier_type:
16215
+ type: string
16216
+ enum:
16217
+ - cpf
16218
+ description: this field and a value of 'cpf' are required if adding a billing
16219
+ info that is an elo or hipercard type in Brazil.
16220
+ primary_payment_method:
16221
+ type: boolean
16222
+ title: Primary Payment Method
16223
+ description: The `primary_payment_method` indicator is used to designate
16224
+ the primary billing info on the account. The first billing info created
16225
+ on an account will always become primary. Adding additional billing infos
16226
+ provides the flexibility to mark another billing info as primary, or adding
16227
+ additional non-primary billing infos. This can be accomplished by passing
16228
+ the `primary_payment_method` indicator. When adding billing infos via
16229
+ the billing_info and /accounts endpoints, this value is not permitted,
16230
+ and will return an error if provided.
15569
16231
  Coupon:
15570
16232
  type: object
15571
16233
  properties:
@@ -15664,6 +16326,13 @@ components:
15664
16326
  description: The coupon is valid for all plans if true. If false then `plans`
15665
16327
  and `plans_names` will list the applicable plans.
15666
16328
  default: true
16329
+ applies_to_all_items:
16330
+ type: boolean
16331
+ title: Applies to all items?
16332
+ description: |
16333
+ The coupon is valid for all items if true. If false then `items`
16334
+ will list the applicable items.
16335
+ default: false
15667
16336
  applies_to_non_plan_charges:
15668
16337
  type: boolean
15669
16338
  title: Applied to all non-plan charges?
@@ -15671,8 +16340,8 @@ components:
15671
16340
  default: false
15672
16341
  plans_names:
15673
16342
  type: array
15674
- title: 'Plan names (TODO: decide if this duplicates `plans`)'
15675
- description: TODO
16343
+ title: Plan names
16344
+ description: A list of plan names for which this coupon applies.
15676
16345
  items:
15677
16346
  type: string
15678
16347
  plans:
@@ -15682,6 +16351,14 @@ components:
15682
16351
  `null` if `applies_to_all_plans=true`.
15683
16352
  items:
15684
16353
  "$ref": "#/components/schemas/PlanMini"
16354
+ items:
16355
+ type: array
16356
+ title: Items
16357
+ description: |
16358
+ A list of items for which this coupon applies. This will be
16359
+ `null` if `applies_to_all_items=true`.
16360
+ items:
16361
+ "$ref": "#/components/schemas/ItemMini"
15685
16362
  redemption_resource:
15686
16363
  type: string
15687
16364
  title: Redemption resource
@@ -15695,7 +16372,7 @@ components:
15695
16372
  "$ref": "#/components/schemas/CouponDiscount"
15696
16373
  coupon_type:
15697
16374
  type: string
15698
- title: 'Coupon type (TODO: implement coupon generation)'
16375
+ title: Coupon type
15699
16376
  description: Whether the coupon is "single_code" or "bulk". Bulk coupons
15700
16377
  will require a `unique_code_template` and will generate unique codes through
15701
16378
  the `/generate` endpoint.
@@ -15719,6 +16396,15 @@ components:
15719
16396
  description: The date and time the coupon will expire and can no longer
15720
16397
  be redeemed. Time is always 11:59:59, the end-of-day Pacific time.
15721
16398
  format: date-time
16399
+ bulk_coupon_id:
16400
+ type: string
16401
+ title: Bulk Coupon ID
16402
+ description: The Coupon ID of the parent Bulk Coupon
16403
+ readOnly: true
16404
+ bulk_coupon_code:
16405
+ type: string
16406
+ title: Bulk Coupon code
16407
+ description: The Coupon code of the parent Bulk Coupon
15722
16408
  redeemed_at:
15723
16409
  type: string
15724
16410
  title: Redeemed at
@@ -15801,6 +16487,16 @@ components:
15801
16487
  The coupon is valid for all plans if true. If false then
15802
16488
  `plans` and `plans_names` will list the applicable plans.
15803
16489
  default: true
16490
+ applies_to_all_items:
16491
+ type: boolean
16492
+ title: Applies to all items?
16493
+ description: |
16494
+ To apply coupon to Items in your Catalog, include a list
16495
+ of `item_codes` in the request that the coupon will apply to. Or set value
16496
+ to true to apply to all Items in your Catalog. The following values
16497
+ are not permitted when `applies_to_all_items` is included: `free_trial_amount`
16498
+ and `free_trial_unit`.
16499
+ default: false
15804
16500
  plan_codes:
15805
16501
  type: array
15806
16502
  title: Plan codes
@@ -15810,6 +16506,16 @@ components:
15810
16506
  when `applies_to_all_plans` is true.
15811
16507
  items:
15812
16508
  type: string
16509
+ item_codes:
16510
+ type: array
16511
+ title: Item codes
16512
+ description: |
16513
+ List of item codes to which this coupon applies. Sending
16514
+ `item_codes` is only permitted when `applies_to_all_items` is set to false.
16515
+ The following values are not permitted when `item_codes` is included:
16516
+ `free_trial_amount` and `free_trial_unit`.
16517
+ items:
16518
+ type: string
15813
16519
  duration:
15814
16520
  type: string
15815
16521
  title: Duration
@@ -15974,7 +16680,7 @@ components:
15974
16680
  "$ref": "#/components/schemas/CouponDiscount"
15975
16681
  coupon_type:
15976
16682
  type: string
15977
- title: 'Coupon type (TODO: implement coupon generation)'
16683
+ title: Coupon type
15978
16684
  description: Whether the coupon is "single_code" or "bulk". Bulk coupons
15979
16685
  will require a `unique_code_template` and will generate unique codes through
15980
16686
  the `/generate` endpoint.
@@ -16611,6 +17317,7 @@ components:
16611
17317
  - credit
16612
17318
  - gift_card
16613
17319
  - write_off
17320
+ - prepayment
16614
17321
  state:
16615
17322
  type: string
16616
17323
  title: Invoice state
@@ -16625,6 +17332,13 @@ components:
16625
17332
  - voided
16626
17333
  account:
16627
17334
  "$ref": "#/components/schemas/AccountMini"
17335
+ billing_info_id:
17336
+ type: string
17337
+ title: Billing info ID
17338
+ description: The `billing_info_id` is the value that represents a specific
17339
+ billing info for an end customer. When `billing_info_id` is used to assign
17340
+ billing info to the subscription, all future billing events for the subscription
17341
+ will bill to the specified billing info.
16628
17342
  subscription_ids:
16629
17343
  type: array
16630
17344
  title: Subscription IDs
@@ -16866,6 +17580,13 @@ components:
16866
17580
  mail order and telephone transactions.
16867
17581
  enum:
16868
17582
  - moto
17583
+ billing_info_id:
17584
+ type: string
17585
+ title: Billing Info ID
17586
+ description: The `billing_info_id` is the value that represents a specific
17587
+ billing info for an end customer. When `billing_info_id` is used to assign
17588
+ billing info to the subscription, all future billing events for the subscription
17589
+ will bill to the specified billing info.
16869
17590
  InvoiceCollection:
16870
17591
  type: object
16871
17592
  title: Invoice collection
@@ -17579,12 +18300,16 @@ components:
17579
18300
  origin:
17580
18301
  type: string
17581
18302
  title: Origin
17582
- description: Only allowed if the Gift Cards feature is enabled on your site
17583
- and `type` is `credit`. Can only have a value of `external_gift_card`.
17584
- Set this value in order to track gift card credits from external gift
17585
- cards (like InComm). It also skips billing information requirements.
18303
+ description: Origin `external_gift_card` is allowed if the Gift Cards feature
18304
+ is enabled on your site and `type` is `credit`. Set this value in order
18305
+ to track gift card credits from external gift cards (like InComm). It
18306
+ also skips billing information requirements. Origin `prepayment` is only
18307
+ allowed if `type` is `charge` and `tax_exempt` is left blank or set to
18308
+ true. This origin creates a charge and opposite credit on the account
18309
+ to be used for future invoices.
17586
18310
  enum:
17587
18311
  - external_gift_card
18312
+ - prepayment
17588
18313
  start_date:
17589
18314
  type: string
17590
18315
  format: date-time
@@ -18006,13 +18731,13 @@ components:
18006
18731
  the setup fee will be charged at the time of signup. Setup fees do not
18007
18732
  increase with the quantity of a subscription plan.
18008
18733
  minimum: 0
18009
- maximum: 100000
18734
+ maximum: 1000000
18010
18735
  unit_amount:
18011
18736
  type: number
18012
18737
  format: float
18013
18738
  title: Unit price
18014
18739
  minimum: 0
18015
- maximum: 100000
18740
+ maximum: 1000000
18016
18741
  PlanUpdate:
18017
18742
  type: object
18018
18743
  properties:
@@ -18145,11 +18870,6 @@ components:
18145
18870
  type: object
18146
18871
  title: Hosted pages settings
18147
18872
  "$ref": "#/components/schemas/PlanHostedPages"
18148
- add_ons:
18149
- type: array
18150
- title: Add Ons
18151
- items:
18152
- "$ref": "#/components/schemas/AddOnCreate"
18153
18873
  allow_any_item_on_subscriptions:
18154
18874
  type: boolean
18155
18875
  title: Allow any item on subscriptions
@@ -18170,7 +18890,7 @@ components:
18170
18890
  format: float
18171
18891
  title: Unit price
18172
18892
  minimum: 0
18173
- maximum: 100000
18893
+ maximum: 1000000
18174
18894
  required:
18175
18895
  - currency
18176
18896
  - unit_amount
@@ -18187,7 +18907,7 @@ components:
18187
18907
  format: float
18188
18908
  title: Unit price
18189
18909
  minimum: 0
18190
- maximum: 100000
18910
+ maximum: 1000000
18191
18911
  required:
18192
18912
  - currency
18193
18913
  - unit_amount
@@ -18696,6 +19416,8 @@ components:
18696
19416
  coupon_redemptions:
18697
19417
  type: array
18698
19418
  title: Coupon redemptions
19419
+ description: Returns subscription level coupon redemptions that are tied
19420
+ to this subscription.
18699
19421
  items:
18700
19422
  "$ref": "#/components/schemas/CouponRedemptionMini"
18701
19423
  pending_change:
@@ -18860,6 +19582,10 @@ components:
18860
19582
  set. This timestamp is used for alerting customers to reauthorize in 3
18861
19583
  years in accordance with NACHA rules. If a subscription becomes inactive
18862
19584
  or the billing info is no longer a bank account, this timestamp is cleared.
19585
+ billing_info_id:
19586
+ type: string
19587
+ title: Billing Info ID
19588
+ description: Billing Info ID.
18863
19589
  SubscriptionAddOn:
18864
19590
  type: object
18865
19591
  title: Subscription Add-on
@@ -18980,6 +19706,7 @@ components:
18980
19706
  * Optionally, override the add-on's default unit amount.
18981
19707
  * If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` must be absent.
18982
19708
  minimum: 0
19709
+ maximum: 1000000
18983
19710
  tiers:
18984
19711
  type: array
18985
19712
  title: Tiers
@@ -18990,7 +19717,8 @@ components:
18990
19717
  If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object
18991
19718
  must include one to many tiers with `ending_quantity` and `unit_amount`.
18992
19719
  There must be one tier with an `ending_quantity` of 999999999 which is the
18993
- default if not provided.
19720
+ default if not provided. See our [Guide](https://developers.recurly.com/guides/item-addon-guide.html)
19721
+ for an overview of how to configure quantity-based pricing models.
18994
19722
  usage_percentage:
18995
19723
  type: number
18996
19724
  format: float
@@ -18998,7 +19726,8 @@ components:
18998
19726
  description: The percentage taken of the monetary amount of usage tracked.
18999
19727
  This can be up to 4 decimal places. A value between 0.0 and 100.0. Required
19000
19728
  if `add_on_type` is usage and `usage_type` is percentage. Must be omitted
19001
- otherwise. `usage_percentage` does not support tiers.
19729
+ otherwise. `usage_percentage` does not support tiers. See our [Guide](https://developers.recurly.com/guides/usage-based-billing-guide.html)
19730
+ for an overview of how to configure usage add-ons.
19002
19731
  revenue_schedule_type:
19003
19732
  type: string
19004
19733
  title: Revenue schedule type
@@ -19051,6 +19780,7 @@ components:
19051
19780
  title: Unit amount
19052
19781
  description: Optionally, override the add-on's default unit amount.
19053
19782
  minimum: 0
19783
+ maximum: 1000000
19054
19784
  tiers:
19055
19785
  type: array
19056
19786
  title: Tiers
@@ -19091,6 +19821,7 @@ components:
19091
19821
  format: float
19092
19822
  title: Unit amount
19093
19823
  minimum: 0
19824
+ maximum: 1000000
19094
19825
  SubscriptionCancel:
19095
19826
  type: object
19096
19827
  properties:
@@ -19223,7 +19954,7 @@ components:
19223
19954
  the plan's default unit amount. The subscription's current currency will
19224
19955
  be used.
19225
19956
  minimum: 0
19226
- maximum: 100000
19957
+ maximum: 1000000
19227
19958
  quantity:
19228
19959
  type: integer
19229
19960
  title: Quantity
@@ -19348,6 +20079,13 @@ components:
19348
20079
  are provided the `plan_id` will be used.
19349
20080
  account:
19350
20081
  "$ref": "#/components/schemas/AccountCreate"
20082
+ billing_info_id:
20083
+ type: string
20084
+ title: Billing Info ID
20085
+ description: The `billing_info_id` is the value that represents a specific
20086
+ billing info for an end customer. When `billing_info_id` is used to assign
20087
+ billing info to the subscription, all future billing events for the subscription
20088
+ will bill to the specified billing info.
19351
20089
  shipping:
19352
20090
  title: Shipping address
19353
20091
  description: Create a shipping address on the account and assign it to the
@@ -19373,7 +20111,7 @@ components:
19373
20111
  this value. If not provided, the subscription will inherit the price from
19374
20112
  the subscription plan for the provided currency.
19375
20113
  minimum: 0
19376
- maximum: 100000
20114
+ maximum: 1000000
19377
20115
  quantity:
19378
20116
  type: integer
19379
20117
  title: Quantity
@@ -19507,7 +20245,7 @@ components:
19507
20245
  this value in cents. If not provided, the subscription will inherit the
19508
20246
  price from the subscription plan for the provided currency.
19509
20247
  minimum: 0
19510
- maximum: 100000
20248
+ maximum: 1000000
19511
20249
  quantity:
19512
20250
  type: integer
19513
20251
  title: Quantity
@@ -19650,6 +20388,13 @@ components:
19650
20388
  default: 0
19651
20389
  shipping:
19652
20390
  "$ref": "#/components/schemas/SubscriptionShippingUpdate"
20391
+ billing_info_id:
20392
+ type: string
20393
+ title: Billing Info ID
20394
+ description: The `billing_info_id` is the value that represents a specific
20395
+ billing info for an end customer. When `billing_info_id` is used to assign
20396
+ billing info to the subscription, all future billing events for the subscription
20397
+ will bill to the specified billing info.
19653
20398
  SubscriptionPause:
19654
20399
  type: object
19655
20400
  properties:
@@ -20042,6 +20787,7 @@ components:
20042
20787
  to current datetime.
20043
20788
  UniqueCouponCode:
20044
20789
  type: object
20790
+ description: A unique coupon code for a bulk coupon.
20045
20791
  properties:
20046
20792
  id:
20047
20793
  type: string
@@ -20064,6 +20810,15 @@ components:
20064
20810
  - maxed_out
20065
20811
  - expired
20066
20812
  - inactive
20813
+ bulk_coupon_id:
20814
+ type: string
20815
+ title: Bulk Coupon ID
20816
+ description: The Coupon ID of the parent Bulk Coupon
20817
+ readOnly: true
20818
+ bulk_coupon_code:
20819
+ type: string
20820
+ title: Bulk Coupon code
20821
+ description: The Coupon code of the parent Bulk Coupon
20067
20822
  created_at:
20068
20823
  type: string
20069
20824
  title: Created at
@@ -20162,6 +20917,16 @@ components:
20162
20917
  format: date-time
20163
20918
  description: When the usage actually happened. This will define the line
20164
20919
  item dates this usage is billed under and is important for revenue recognition.
20920
+ usage_percentage:
20921
+ type: number
20922
+ format: float
20923
+ title: Usage Percentage
20924
+ description: The percentage taken of the monetary amount of usage tracked.
20925
+ This can be up to 4 decimal places. A value between 0.0 and 100.0.
20926
+ unit_amount:
20927
+ type: number
20928
+ format: float
20929
+ title: Unit price
20165
20930
  billed_at:
20166
20931
  type: string
20167
20932
  format: date-time
@@ -20254,6 +21019,13 @@ components:
20254
21019
  maxLength: 3
20255
21020
  account:
20256
21021
  "$ref": "#/components/schemas/AccountPurchase"
21022
+ billing_info_id:
21023
+ type: string
21024
+ title: Billing info ID
21025
+ description: The `billing_info_id` is the value that represents a specific
21026
+ billing info for an end customer. When `billing_info_id` is used to assign
21027
+ billing info to the subscription, all future billing events for the subscription
21028
+ will bill to the specified billing info.
20257
21029
  collection_method:
20258
21030
  type: string
20259
21031
  title: Collection method
@@ -20462,6 +21234,7 @@ components:
20462
21234
  - invalid_permissions
20463
21235
  - invalid_token
20464
21236
  - not_found
21237
+ - service_not_available
20465
21238
  - simultaneous_request
20466
21239
  - transaction
20467
21240
  - unauthorized
@@ -20657,3 +21430,41 @@ components:
20657
21430
  a transaction. Pass this value to Recurly.js so it can continue
20658
21431
  the challenge flow.
20659
21432
  maxLength: 22
21433
+ ExportDates:
21434
+ type: object
21435
+ properties:
21436
+ object:
21437
+ type: string
21438
+ title: Object type
21439
+ readOnly: true
21440
+ dates:
21441
+ type: array
21442
+ items:
21443
+ type: string
21444
+ title: An array of dates that have available exports.
21445
+ ExportFiles:
21446
+ type: object
21447
+ properties:
21448
+ object:
21449
+ type: string
21450
+ title: Object type
21451
+ readOnly: true
21452
+ files:
21453
+ type: array
21454
+ items:
21455
+ "$ref": "#/components/schemas/ExportFile"
21456
+ ExportFile:
21457
+ type: object
21458
+ properties:
21459
+ name:
21460
+ type: string
21461
+ title: Filename
21462
+ description: Name of the export file.
21463
+ md5sum:
21464
+ type: string
21465
+ title: MD5 hash of the export file
21466
+ description: MD5 hash of the export file.
21467
+ href:
21468
+ type: string
21469
+ title: A link to the export file
21470
+ description: A presigned link to download the export file.