recurly 4.11.0 → 4.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/.bumpversion.cfg +1 -1
  3. data/CHANGELOG.md +35 -0
  4. data/GETTING_STARTED.md +9 -1
  5. data/lib/recurly/client/operations.rb +250 -134
  6. data/lib/recurly/client.rb +14 -2
  7. data/lib/recurly/errors/api_errors.rb +2 -0
  8. data/lib/recurly/requests/account_create.rb +5 -1
  9. data/lib/recurly/requests/account_purchase.rb +5 -1
  10. data/lib/recurly/requests/account_update.rb +5 -1
  11. data/lib/recurly/requests/add_on_create.rb +2 -2
  12. data/lib/recurly/requests/billing_info_create.rb +9 -1
  13. data/lib/recurly/requests/line_item_create.rb +2 -2
  14. data/lib/recurly/requests/plan_create.rb +1 -1
  15. data/lib/recurly/requests/plan_update.rb +1 -1
  16. data/lib/recurly/requests/subscription_add_on_tier.rb +1 -1
  17. data/lib/recurly/requests/tier.rb +1 -1
  18. data/lib/recurly/resources/account.rb +5 -1
  19. data/lib/recurly/resources/account_mini.rb +1 -1
  20. data/lib/recurly/resources/add_on.rb +4 -0
  21. data/lib/recurly/resources/invoice.rb +5 -1
  22. data/lib/recurly/resources/invoice_template.rb +34 -0
  23. data/lib/recurly/resources/line_item.rb +3 -3
  24. data/lib/recurly/resources/percentage_tier.rb +18 -0
  25. data/lib/recurly/resources/percentage_tiers_by_currency.rb +18 -0
  26. data/lib/recurly/resources/plan.rb +1 -1
  27. data/lib/recurly/resources/subscription_add_on.rb +4 -0
  28. data/lib/recurly/resources/subscription_add_on_percentage_tier.rb +18 -0
  29. data/lib/recurly/resources/subscription_add_on_tier.rb +1 -1
  30. data/lib/recurly/resources/tier.rb +1 -1
  31. data/lib/recurly/version.rb +1 -1
  32. data/openapi/api.yaml +573 -52
  33. metadata +7 -3
data/openapi/api.yaml CHANGED
@@ -232,7 +232,7 @@ tags:
232
232
  description: |-
233
233
  For merchants who sell the same things to many customers, documenting those offerings in a catalog allows for faster charge creation, easier management of offerings, and analytics about your offerings across all sales channels. Because your offerings can be physical, digital, or service-oriented, Recurly collectively calls these offerings "Items".
234
234
 
235
- Recurly's item catalog requires the Credit Invoices and Subscription Billing Terms features to be enabled.
235
+ Recurly's item catalog requires the Credit Invoices features to be enabled.
236
236
  - name: plan
237
237
  x-displayName: Plan
238
238
  description: A plan tells Recurly how often and how much to charge your customers.
@@ -6337,6 +6337,51 @@ paths:
6337
6337
  {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
6338
6338
  Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched Custom
6339
6339
  Field Definition: %s\", definition.Id)"
6340
+ "/invoice_templates/{invoice_template_id}/accounts":
6341
+ get:
6342
+ tags:
6343
+ - account
6344
+ operationId: list_invoice_template_accounts
6345
+ summary: List an invoice template's associated accounts
6346
+ description: See the [Pagination Guide](/guides/pagination.html) to learn how
6347
+ to use pagination in the API and Client Libraries.
6348
+ parameters:
6349
+ - "$ref": "#/components/parameters/invoice_template_id"
6350
+ - "$ref": "#/components/parameters/ids"
6351
+ - "$ref": "#/components/parameters/limit"
6352
+ - "$ref": "#/components/parameters/order"
6353
+ - "$ref": "#/components/parameters/sort_dates"
6354
+ - "$ref": "#/components/parameters/filter_begin_time"
6355
+ - "$ref": "#/components/parameters/filter_end_time"
6356
+ - "$ref": "#/components/parameters/filter_account_email"
6357
+ - "$ref": "#/components/parameters/filter_account_subscriber"
6358
+ - "$ref": "#/components/parameters/filter_account_past_due"
6359
+ responses:
6360
+ '200':
6361
+ description: A list of an invoice template's associated accounts.
6362
+ content:
6363
+ application/json:
6364
+ schema:
6365
+ "$ref": "#/components/schemas/AccountList"
6366
+ '400':
6367
+ description: Invalid or unpermitted parameter.
6368
+ content:
6369
+ application/json:
6370
+ schema:
6371
+ "$ref": "#/components/schemas/Error"
6372
+ '404':
6373
+ description: Incorrect site or invoice template ID.
6374
+ content:
6375
+ application/json:
6376
+ schema:
6377
+ "$ref": "#/components/schemas/Error"
6378
+ default:
6379
+ description: Unexpected error.
6380
+ content:
6381
+ application/json:
6382
+ schema:
6383
+ "$ref": "#/components/schemas/Error"
6384
+ x-code-samples: []
6340
6385
  "/items":
6341
6386
  get:
6342
6387
  tags:
@@ -14220,11 +14265,286 @@ paths:
14220
14265
  var_dump($e);
14221
14266
  }
14222
14267
  - lang: Go
14223
- source: "collection, err := client.PreviewPurchase(purchaseReq)\nif e, ok
14224
- := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation
14225
- {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
14268
+ source: "purchaseReq := &recurly.PurchaseCreate{\n\tCurrency: recurly.String(\"USD\"),\n\tAccount:
14269
+ &recurly.AccountPurchase{\n\t\tCode: recurly.String(account.Code),\n\t},\n\tSubscriptions:
14270
+ []recurly.SubscriptionPurchase{\n\t\t{\n\t\t\tPlanCode: recurly.String(plan.Code),\n\t\t\tNextBillDate:
14271
+ recurly.Time(time.Date(2078, time.November, 10, 23, 0, 0, 0, time.UTC)),\n\t\t},\n\t},\n\tShipping:
14272
+ &recurly.ShippingPurchase{\n\t\tAddressId: recurly.String(shippingAddressID),\n\t},\n}\ncollection,
14273
+ err := client.PreviewPurchase(purchaseReq)\nif e, ok := err.(*recurly.Error);
14274
+ ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed
14275
+ validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
14226
14276
  Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Preview Charge
14227
14277
  Invoice %v\", collection.ChargeInvoice)"
14278
+ "/purchases/pending":
14279
+ post:
14280
+ tags:
14281
+ - purchase
14282
+ operationId: create_pending_purchase
14283
+ summary: Create a pending purchase
14284
+ description: |-
14285
+ A purchase is a hybrid checkout containing at least one or more subscriptions or one-time charges (adjustments) and supports both coupon and gift card redemptions. All items purchased will be on one invoice and paid for with one transaction. A purchase is only a request data type and is not persistent in Recurly and an invoice collection will be the returned type.
14286
+
14287
+ Use for **Adyen HPP** and **Online Banking** transaction requests.
14288
+ This runs the validations but not the transactions.
14289
+ The API request allows the inclusion of one of the following fields: **external_hpp_type** with `'adyen'` and **online_banking_payment_type** with `'ideal'` or `'sofort'` in the **billing_info** object.
14290
+
14291
+ For additional information regarding shipping fees, please see https://docs.recurly.com/docs/shipping
14292
+ requestBody:
14293
+ content:
14294
+ application/json:
14295
+ schema:
14296
+ "$ref": "#/components/schemas/PurchaseCreate"
14297
+ required: true
14298
+ responses:
14299
+ '200':
14300
+ description: Returns the pending invoice
14301
+ content:
14302
+ application/json:
14303
+ schema:
14304
+ "$ref": "#/components/schemas/InvoiceCollection"
14305
+ '400':
14306
+ description: Bad request; perhaps missing or invalid parameters.
14307
+ content:
14308
+ application/json:
14309
+ schema:
14310
+ "$ref": "#/components/schemas/Error"
14311
+ '422':
14312
+ description: Pending purchase cannot be completed for the specified reason.
14313
+ content:
14314
+ application/json:
14315
+ schema:
14316
+ "$ref": "#/components/schemas/Error"
14317
+ default:
14318
+ description: Unexpected error.
14319
+ content:
14320
+ application/json:
14321
+ schema:
14322
+ "$ref": "#/components/schemas/Error"
14323
+ x-code-samples:
14324
+ - lang: Node.js
14325
+ source: |
14326
+ try {
14327
+ const purchaseReq = {
14328
+ currency: 'EUR',
14329
+ account: {
14330
+ code: accountCode,
14331
+ email: 'example@recurly.com',
14332
+ billingInfo: {
14333
+ firstName: 'Benjamin',
14334
+ lastName: 'Du Monde',
14335
+ onlineBankingPaymentType: 'ideal'
14336
+ },
14337
+ },
14338
+ lineItems: [
14339
+ {
14340
+ currency: 'EUR',
14341
+ unitAmount: 1000,
14342
+ type: 'charge'
14343
+ }
14344
+ ]
14345
+ };
14346
+ const invoiceCollection = await client.createPendingPurchase(purchaseReq)
14347
+ console.log('Created ChargeInvoice with UUID: ', invoiceCollection.chargeInvoice.uuid)
14348
+ } catch (err) {
14349
+ if (err instanceof recurly.errors.ValidationError) {
14350
+ // If the request was not valid, you may want to tell your user
14351
+ // why. You can find the invalid params and reasons in err.params
14352
+ console.log('Failed validation', err.params)
14353
+ } else {
14354
+ // If we don't know what to do with the err, we should
14355
+ // probably re-raise and let our web framework and logger handle it
14356
+ console.log('Unknown Error: ', err)
14357
+ }
14358
+ }
14359
+ - lang: Python
14360
+ source: |
14361
+ try:
14362
+ purchase = {
14363
+ "currency": "EUR",
14364
+ "account": {
14365
+ "code": account_code,
14366
+ "email": "benjamin@example.com",
14367
+ "billing_info": {
14368
+ "first_name": "Benjamin",
14369
+ "last_name": "Du Monde",
14370
+ "online_banking_payment_type": "ideal"
14371
+ }
14372
+ },
14373
+ "line_items": [
14374
+ {
14375
+ "currency": "EUR",
14376
+ "unit_amount": 1000,
14377
+ "type": "charge"
14378
+ }
14379
+ ],
14380
+ }
14381
+ invoice_collection = client.create_pending_purchase(purchase)
14382
+ print("Created ChargeInvoice with UUID %s" % invoice_collection.charge_invoice.uuid)
14383
+ except recurly.errors.ValidationError as e:
14384
+ # If the request was invalid, you may want to tell your user
14385
+ # why. You can find the invalid params and reasons in e.error.params
14386
+ print("ValidationError: %s" % e.error.message)
14387
+ print(e.error.params)
14388
+ - lang: ".NET"
14389
+ source: |
14390
+ try
14391
+ {
14392
+ var purchaseReq = new PurchaseCreate()
14393
+ {
14394
+ Currency = "EUR",
14395
+ Account = new AccountPurchase()
14396
+ {
14397
+ Code = accountCode,
14398
+ Email = "benjamin@example.com",
14399
+ BillingInfo = new BillingInfoCreate()
14400
+ {
14401
+ FirstName = "Benjamin",
14402
+ LastName = "Du Monde",
14403
+ OnlineBankingPaymentType = OnlineBankingPaymentType.Ideal
14404
+ }
14405
+ },
14406
+ LineItems = new List<LineItemCreate>()
14407
+ {
14408
+ new LineItemCreate()
14409
+ {
14410
+ Currency = "EUR",
14411
+ UnitAmount = 1000,
14412
+ Type = LineItemType.Charge
14413
+ }
14414
+ }
14415
+ };
14416
+ InvoiceCollection collection = client.CreatePendingPurchase(purchaseReq);
14417
+ Console.WriteLine($"Created ChargeInvoice with UUID: {collection.ChargeInvoice.Uuid}");
14418
+ }
14419
+ catch (Recurly.Errors.Validation ex)
14420
+ {
14421
+ // If the request was not valid, you may want to tell your user
14422
+ // why. You can find the invalid params and reasons in ex.Error.Params
14423
+ Console.WriteLine($"Failed validation: {ex.Error.Message}");
14424
+ }
14425
+ catch (Recurly.Errors.ApiError ex)
14426
+ {
14427
+ // Use ApiError to catch a generic error from the API
14428
+ Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}");
14429
+ }
14430
+ - lang: Ruby
14431
+ source: |
14432
+ begin
14433
+ purchase = {
14434
+ currency: 'EUR',
14435
+ account: {
14436
+ code: account_code,
14437
+ email: 'benjamin@example.com',
14438
+ billing_info: {
14439
+ first_name: 'Benjamin',
14440
+ last_name: 'Du Monde',
14441
+ online_banking_payment_type: 'ideal'
14442
+ },
14443
+ },
14444
+ line_items: [
14445
+ {
14446
+ currency: 'EUR',
14447
+ unit_amount: 1000,
14448
+ type: 'charge'
14449
+ }
14450
+ ]
14451
+ }
14452
+ invoice_collection = @client.create_pending_purchase(body: purchase)
14453
+ puts "Created ChargeInvoice with UUID: #{invoice_collection.charge_invoice.uuid}"
14454
+ rescue Recurly::Errors::ValidationError => e
14455
+ # If the request was invalid, you may want to tell your user
14456
+ # why. You can find the invalid params and reasons in e.recurly_error.params
14457
+ puts "ValidationError: #{e.recurly_error.params}"
14458
+ end
14459
+ - lang: Java
14460
+ source: |
14461
+ try {
14462
+ AccountPurchase account = new AccountPurchase();
14463
+ account.setCode(accountCode);
14464
+ account.setEmail("benjamin@example.com");
14465
+
14466
+ BillingInfoCreate billingInfo = new BillingInfoCreate();
14467
+ billingInfo.setFirstName("Benjamin");
14468
+ billingInfo.setLastName("Du Monde");
14469
+ billingInfo.setOnlineBankingPaymentType(Constants.OnlineBankingPaymentType.IDEAL);
14470
+ account.setBillingInfo(billingInfo);
14471
+
14472
+ List<LineItemCreate> lineItems = new ArrayList<LineItemCreate>();
14473
+ LineItemCreate lineItem = new LineItemCreate();
14474
+ lineItem.setCurrency("EUR");
14475
+ lineItem.setUnitAmount(new BigDecimal("1000.0"));
14476
+ lineItem.setType(Constants.LineItemType.CHARGE);
14477
+ lineItems.add(lineItem);
14478
+
14479
+ PurchaseCreate purchase = new PurchaseCreate();
14480
+ purchase.setCurrency("EUR");
14481
+ purchase.setAccount(account);
14482
+ purchase.setLineItems(lineItems);
14483
+
14484
+ InvoiceCollection collection = client.createPendingPurchase(purchase);
14485
+ System.out.println("Created ChargeInvoice with UUID: " + collection.getChargeInvoice().getUuid());
14486
+ } catch (ValidationException e) {
14487
+ // If the request was not valid, you may want to tell your user
14488
+ // why. You can find the invalid params and reasons in e.getError().getParams()
14489
+ System.out.println("Failed validation: " + e.getError().getMessage());
14490
+ System.out.println("Params: " + e.getError().getParams());
14491
+ } catch (TransactionException e) {
14492
+ TransactionError tError = e.getError().getTransactionError();
14493
+ if (tError.getCategory() == Constants.ErrorCategory.THREE_D_SECURE_ACTION_REQUIRED) {
14494
+ String actionTokenId = tError.getThreeDSecureActionTokenId();
14495
+ System.out.println("Got 3DSecure TransactionError token: " + actionTokenId);
14496
+ }
14497
+ }
14498
+ catch (ApiException e) {
14499
+ // Use ApiException to catch a generic error from the API
14500
+ System.out.println("Unexpected Recurly Error: " + e.getError().getMessage());
14501
+ }
14502
+ - lang: PHP
14503
+ source: |
14504
+ try {
14505
+ $purchase_create = [
14506
+ "currency" => "EUR",
14507
+ "account" => [
14508
+ "code" => $account_code,
14509
+ "email" => "benjamin@example.com",
14510
+ "billing_info" => [
14511
+ "first_name" => "Benjamin",
14512
+ "last_name" => "Du Monde",
14513
+ "online_banking_payment_type" => "ideal"
14514
+ ],
14515
+ ],
14516
+ "line_items" => [
14517
+ [
14518
+ "currency" => "EUR",
14519
+ "unit_amount" => 1000,
14520
+ "type" => "charge",
14521
+ ]
14522
+ ]
14523
+ ];
14524
+ $invoice_collection = $client->createPendingPurchase($purchase_create);
14525
+ echo 'Created ChargeInvoice with UUID' . $invoice_collection->getChargeInvoice()->getUuid() . PHP_EOL;
14526
+ } catch (\Recurly\Errors\Validation $e) {
14527
+ // If the request was not valid, you may want to tell your user
14528
+ // why. You can find the invalid params and reasons in err.params
14529
+ var_dump($e);
14530
+ } catch (\Recurly\RecurlyError $e) {
14531
+ // If we don't know what to do with the err, we should
14532
+ // probably re-raise and let our web framework and logger handle it
14533
+ var_dump($e);
14534
+ }
14535
+ - lang: Go
14536
+ source: "purchaseReq := &recurly.PurchaseCreate{\n\tCurrency: recurly.String(\"EUR\"),\n\tAccount:
14537
+ &recurly.AccountPurchase{\n\t\tCode: recurly.String(accountCode),\n\t\tEmail:
14538
+ recurly.String(\"benjamin@example.com\"),\n\t\tBillingInfo: &recurly.BillingInfoCreate{\n\t\t\tFirstName:
14539
+ \ recurly.String(\"Benjamin\"),\n\t\t\tLastName: recurly.String(\"Du
14540
+ Monde\"),\n\t\t\tOnlineBankingPaymentType: recurly.String(\"ideal\"),\n\t\t},\n\t},\n\tLineItems:
14541
+ []recurly.LineItemCreate{\n\t\t{\n\t\t\tCurrency: recurly.String(\"EUR\"),\n\t\t\tUnitAmount:
14542
+ recurly.Float(1000),\n\t\t\tType: recurly.String(\"charge\"),\n\t\t},\n\t},\n}\ncollection,
14543
+ err := client.CreatePendingPurchase(purchaseReq)\nif e, ok := err.(*recurly.Error);
14544
+ ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed
14545
+ validation: %v\", e)\n\t\treturn nil, err\n\t}\n\n\tfmt.Printf(\"Unexpected
14546
+ Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Created ChargeInvoice
14547
+ with UUID: %s.\\n\", collection.ChargeInvoice.Uuid)\n"
14228
14548
  "/export_dates":
14229
14549
  get:
14230
14550
  tags:
@@ -14548,8 +14868,73 @@ paths:
14548
14868
  schema:
14549
14869
  "$ref": "#/components/schemas/Error"
14550
14870
  x-code-samples: []
14871
+ "/invoice_templates":
14872
+ get:
14873
+ tags:
14874
+ - invoice_templates
14875
+ operationId: list_invoice_templates
14876
+ summary: Show the invoice templates for a site
14877
+ description: See the [Pagination Guide](/guides/pagination.html) to learn how
14878
+ to use pagination in the API and Client Libraries.
14879
+ parameters:
14880
+ - "$ref": "#/components/parameters/sort_dates"
14881
+ responses:
14882
+ '200':
14883
+ description: A list of the the invoice templates on a site.
14884
+ content:
14885
+ application/json:
14886
+ schema:
14887
+ "$ref": "#/components/schemas/InvoiceTemplateList"
14888
+ '404':
14889
+ description: Incorrect site.
14890
+ content:
14891
+ application/json:
14892
+ schema:
14893
+ "$ref": "#/components/schemas/Error"
14894
+ default:
14895
+ description: Unexpected error.
14896
+ content:
14897
+ application/json:
14898
+ schema:
14899
+ "$ref": "#/components/schemas/Error"
14900
+ x-code-samples: []
14901
+ "/invoice_templates/{invoice_template_id}":
14902
+ parameters:
14903
+ - "$ref": "#/components/parameters/invoice_template_id"
14904
+ get:
14905
+ tags:
14906
+ - invoice_templates
14907
+ operationId: get_invoice_template
14908
+ summary: Show the settings for an invoice template
14909
+ responses:
14910
+ '200':
14911
+ description: Settings for an invoice template.
14912
+ content:
14913
+ application/json:
14914
+ schema:
14915
+ "$ref": "#/components/schemas/InvoiceTemplate"
14916
+ '400':
14917
+ description: Bad request; perhaps missing or invalid parameters.
14918
+ content:
14919
+ application/json:
14920
+ schema:
14921
+ "$ref": "#/components/schemas/Error"
14922
+ '404':
14923
+ description: Incorrect site or invoice template ID.
14924
+ content:
14925
+ application/json:
14926
+ schema:
14927
+ "$ref": "#/components/schemas/Error"
14928
+ default:
14929
+ description: Unexpected error.
14930
+ content:
14931
+ application/json:
14932
+ schema:
14933
+ "$ref": "#/components/schemas/Error"
14934
+ x-code-samples: []
14551
14935
  servers:
14552
14936
  - url: https://v3.recurly.com
14937
+ - url: https://v3.eu.recurly.com
14553
14938
  components:
14554
14939
  parameters:
14555
14940
  site_id:
@@ -14614,6 +14999,14 @@ components:
14614
14999
  required: true
14615
15000
  schema:
14616
15001
  type: string
15002
+ invoice_template_id:
15003
+ name: invoice_template_id
15004
+ in: path
15005
+ description: Invoice template ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`.
15006
+ For code use prefix `code-`, e.g. `code-bob`.
15007
+ required: true
15008
+ schema:
15009
+ type: string
14617
15010
  item_id:
14618
15011
  name: item_id
14619
15012
  in: path
@@ -15451,11 +15844,16 @@ components:
15451
15844
  dunning_campaign_id:
15452
15845
  type: string
15453
15846
  title: Dunning Campaign ID
15454
- description: Unique ID to identify a dunning campaign. Available when the
15455
- Dunning Campaigns feature is enabled. Used to specify if a non-default
15456
- dunning campaign should be assigned to this account. For sites without
15457
- multiple dunning campaigns enabled, the default dunning campaign will
15458
- always be used.
15847
+ description: Unique ID to identify a dunning campaign. Used to specify if
15848
+ a non-default dunning campaign should be assigned to this account. For
15849
+ sites without multiple dunning campaigns enabled, the default dunning
15850
+ campaign will always be used.
15851
+ invoice_template_id:
15852
+ type: string
15853
+ title: Invoice Template ID
15854
+ description: Unique ID to identify an invoice template. Available when
15855
+ the Invoice Customization feature is enabled. Used to specify which invoice
15856
+ template, if any, should be used to generate invoices for the account.
15459
15857
  address:
15460
15858
  "$ref": "#/components/schemas/Address"
15461
15859
  billing_info:
@@ -15529,11 +15927,18 @@ components:
15529
15927
  dunning_campaign_id:
15530
15928
  type: string
15531
15929
  title: Dunning Campaign ID
15532
- description: Unique ID to identify a dunning campaign. Available when the
15533
- Dunning Campaigns feature is enabled. Used to specify if a non-default
15534
- dunning campaign should be assigned to this account. For sites without
15535
- multiple dunning campaigns enabled, the default dunning campaign will
15536
- always be used.
15930
+ description: Unique ID to identify a dunning campaign. Used to specify if
15931
+ a non-default dunning campaign should be assigned to this account. For
15932
+ sites without multiple dunning campaigns enabled, the default dunning
15933
+ campaign will always be used.
15934
+ invoice_template_id:
15935
+ type: string
15936
+ title: Invoice Template ID
15937
+ description: Unique ID to identify an invoice template. Available when the
15938
+ Invoice Customization feature is enabled. Used to specify if a non-default
15939
+ invoice template will be used to generate invoices for the account. For
15940
+ sites without multiple invoice templates enabled, the default template
15941
+ will always be used.
15537
15942
  address:
15538
15943
  "$ref": "#/components/schemas/Address"
15539
15944
  billing_info:
@@ -15602,11 +16007,10 @@ components:
15602
16007
  dunning_campaign_id:
15603
16008
  type: string
15604
16009
  title: Dunning Campaign ID
15605
- description: Unique ID to identify a dunning campaign. Available when the
15606
- Dunning Campaigns feature is enabled. Used to specify if a non-default
15607
- dunning campaign should be assigned to this account. For sites without
15608
- multiple dunning campaigns enabled, the default dunning campaign will
15609
- always be used.
16010
+ description: Unique ID to identify a dunning campaign. Used to specify if
16011
+ a non-default dunning campaign should be assigned to this account. For
16012
+ sites without multiple dunning campaigns enabled, the default dunning
16013
+ campaign will always be used.
15610
16014
  AccountBalance:
15611
16015
  type: object
15612
16016
  properties:
@@ -15866,6 +16270,11 @@ components:
15866
16270
  title: Tiers
15867
16271
  items:
15868
16272
  "$ref": "#/components/schemas/Tier"
16273
+ percentage_tiers:
16274
+ type: array
16275
+ title: Percentage Tiers
16276
+ items:
16277
+ "$ref": "#/components/schemas/PercentageTiersByCurrency"
15869
16278
  external_sku:
15870
16279
  type: string
15871
16280
  title: External SKU
@@ -15900,16 +16309,16 @@ components:
15900
16309
  type: string
15901
16310
  title: Item Code
15902
16311
  description: Unique code to identify an item. Available when the `Credit
15903
- Invoices` and `Subscription Billing Terms` features are enabled. If `item_id`
15904
- and `item_code` are both present, `item_id` will be used.
16312
+ Invoices` feature are enabled. If `item_id` and `item_code` are both present,
16313
+ `item_id` will be used.
15905
16314
  pattern: "/^[a-z0-9_+-]+$/"
15906
16315
  maxLength: 50
15907
16316
  item_id:
15908
16317
  type: string
15909
16318
  title: Item ID
15910
16319
  description: System-generated unique identifier for an item. Available when
15911
- the `Credit Invoices` and `Subscription Billing Terms` features are enabled.
15912
- If `item_id` and `item_code` are both present, `item_id` will be used.
16320
+ the `Credit Invoices` feature is enabled. If `item_id` and `item_code`
16321
+ are both present, `item_id` will be used.
15913
16322
  maxLength: 13
15914
16323
  code:
15915
16324
  type: string
@@ -16397,6 +16806,10 @@ components:
16397
16806
  billing info marked `primary_payment_method` can be set as a backup. An
16398
16807
  account can have a maximum of 1 backup, if a user sets a different payment
16399
16808
  method as a backup, the existing backup will no longer be marked as such.
16809
+ external_hpp_type:
16810
+ "$ref": "#/components/schemas/ExternalHppTypeEnum"
16811
+ online_banking_payment_type:
16812
+ "$ref": "#/components/schemas/OnlineBankingPaymentTypeEnum"
16400
16813
  BillingInfoVerify:
16401
16814
  type: object
16402
16815
  properties:
@@ -17355,6 +17768,10 @@ components:
17355
17768
  type: string
17356
17769
  title: Invoice ID
17357
17770
  readOnly: true
17771
+ uuid:
17772
+ type: string
17773
+ title: Invoice UUID
17774
+ readOnly: true
17358
17775
  object:
17359
17776
  type: string
17360
17777
  title: Object type
@@ -17550,9 +17967,8 @@ components:
17550
17967
  type: string
17551
17968
  title: Dunning Campaign ID
17552
17969
  description: Unique ID to identify the dunning campaign used when dunning
17553
- the invoice. Available when the Dunning Campaigns feature is enabled.
17554
- For sites without multiple dunning campaigns enabled, this will always
17555
- be the default dunning campaign.
17970
+ the invoice. For sites without multiple dunning campaigns enabled, this
17971
+ will always be the default dunning campaign.
17556
17972
  InvoiceCreate:
17557
17973
  type: object
17558
17974
  properties:
@@ -17888,20 +18304,20 @@ components:
17888
18304
  type: string
17889
18305
  title: Item Code
17890
18306
  description: Unique code to identify an item. Available when the Credit
17891
- Invoices and Subscription Billing Terms features are enabled.
18307
+ Invoices feature is enabled.
17892
18308
  pattern: "/^[a-z0-9_+-]+$/"
17893
18309
  maxLength: 50
17894
18310
  item_id:
17895
18311
  type: string
17896
18312
  title: Item ID
17897
18313
  description: System-generated unique identifier for an item. Available when
17898
- the Credit Invoices and Subscription Billing Terms features are enabled.
18314
+ the Credit Invoices feature is enabled.
17899
18315
  maxLength: 13
17900
18316
  external_sku:
17901
18317
  type: string
17902
18318
  title: External SKU
17903
18319
  description: Optional Stock Keeping Unit assigned to an item. Available
17904
- when the Credit Invoices and Subscription Billing Terms features are enabled.
18320
+ when the Credit Invoices feature is enabled.
17905
18321
  maxLength: 50
17906
18322
  revenue_schedule_type:
17907
18323
  title: Revenue schedule type
@@ -18204,14 +18620,14 @@ components:
18204
18620
  type: string
18205
18621
  title: Item Code
18206
18622
  description: Unique code to identify an item. Available when the Credit
18207
- Invoices and Subscription Billing Terms features are enabled.
18623
+ Invoices feature is enabled.
18208
18624
  pattern: "/^[a-z0-9_+-]+$/"
18209
18625
  maxLength: 50
18210
18626
  item_id:
18211
18627
  type: string
18212
18628
  title: Item ID
18213
18629
  description: System-generated unique identifier for an item. Available when
18214
- the Credit Invoices and Subscription Billing Terms features are enabled.
18630
+ the Credit Invoices feature is enabled.
18215
18631
  maxLength: 13
18216
18632
  revenue_schedule_type:
18217
18633
  title: Revenue schedule type
@@ -18482,11 +18898,10 @@ components:
18482
18898
  dunning_campaign_id:
18483
18899
  type: string
18484
18900
  title: Dunning Campaign ID
18485
- description: Unique ID to identify a dunning campaign. Available when the
18486
- Dunning Campaigns feature is enabled. Used to specify if a non-default
18487
- dunning campaign should be assigned to this plan. For sites without multiple
18488
- dunning campaigns enabled, the default dunning campaign will always be
18489
- used.
18901
+ description: Unique ID to identify a dunning campaign. Used to specify if
18902
+ a non-default dunning campaign should be assigned to this plan. For sites
18903
+ without multiple dunning campaigns enabled, the default dunning campaign
18904
+ will always be used.
18490
18905
  created_at:
18491
18906
  type: string
18492
18907
  format: date-time
@@ -18646,11 +19061,10 @@ components:
18646
19061
  dunning_campaign_id:
18647
19062
  type: string
18648
19063
  title: Dunning Campaign ID
18649
- description: Unique ID to identify a dunning campaign. Available when the
18650
- Dunning Campaigns feature is enabled. Used to specify if a non-default
18651
- dunning campaign should be assigned to this plan. For sites without multiple
18652
- dunning campaigns enabled, the default dunning campaign will always be
18653
- used.
19064
+ description: Unique ID to identify a dunning campaign. Used to specify if
19065
+ a non-default dunning campaign should be assigned to this plan. For sites
19066
+ without multiple dunning campaigns enabled, the default dunning campaign
19067
+ will always be used.
18654
19068
  required:
18655
19069
  - code
18656
19070
  - name
@@ -18837,11 +19251,10 @@ components:
18837
19251
  dunning_campaign_id:
18838
19252
  type: string
18839
19253
  title: Dunning Campaign ID
18840
- description: Unique ID to identify a dunning campaign. Available when the
18841
- Dunning Campaigns feature is enabled. Used to specify if a non-default
18842
- dunning campaign should be assigned to this plan. For sites without multiple
18843
- dunning campaigns enabled, the default dunning campaign will always be
18844
- used.
19254
+ description: Unique ID to identify a dunning campaign. Used to specify if
19255
+ a non-default dunning campaign should be assigned to this plan. For sites
19256
+ without multiple dunning campaigns enabled, the default dunning campaign
19257
+ will always be used.
18845
19258
  AddOnPricing:
18846
19259
  type: object
18847
19260
  properties:
@@ -18940,13 +19353,44 @@ components:
18940
19353
  usage_percentage:
18941
19354
  type: string
18942
19355
  title: Usage Percentage
18943
- description: Decimal usage percentage.
19356
+ description: This field is deprecated. Do not used it anymore for percentage
19357
+ tiers add ons. Use the percentage_tiers object instead.
19358
+ deprecated: true
18944
19359
  currencies:
18945
19360
  type: array
18946
19361
  title: Tier pricing
18947
19362
  items:
18948
19363
  "$ref": "#/components/schemas/TierPricing"
18949
19364
  minItems: 1
19365
+ PercentageTiersByCurrency:
19366
+ type: object
19367
+ properties:
19368
+ currency:
19369
+ type: string
19370
+ title: Currency
19371
+ description: 3-letter ISO 4217 currency code.
19372
+ maxLength: 3
19373
+ tiers:
19374
+ type: array
19375
+ title: Tiers
19376
+ items:
19377
+ "$ref": "#/components/schemas/PercentageTier"
19378
+ minItems: 1
19379
+ PercentageTier:
19380
+ type: object
19381
+ properties:
19382
+ ending_amount:
19383
+ type: number
19384
+ format: float
19385
+ title: Ending amount
19386
+ minimum: 0.1
19387
+ maximum: 9999999999999
19388
+ description: Ending amount for the tier. Allows up to 2 decimal places.
19389
+ The last tier ending_amount is null.
19390
+ usage_percentage:
19391
+ type: string
19392
+ title: Usage Percentage
19393
+ description: Decimal usage percentage.
18950
19394
  Settings:
18951
19395
  type: object
18952
19396
  properties:
@@ -19640,6 +20084,15 @@ components:
19640
20084
  description: |
19641
20085
  If tiers are provided in the request, all existing tiers on the Subscription Add-on will be
19642
20086
  removed and replaced by the tiers in the request.
20087
+ percentage_tiers:
20088
+ type: array
20089
+ title: Percentage Tiers
20090
+ items:
20091
+ "$ref": "#/components/schemas/SubscriptionAddOnPercentageTier"
20092
+ minItems: 1
20093
+ description: |
20094
+ If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
20095
+ removed and replaced by the percentage tiers in the request.
19643
20096
  usage_percentage:
19644
20097
  type: number
19645
20098
  format: float
@@ -19814,11 +20267,26 @@ components:
19814
20267
  usage_percentage:
19815
20268
  type: string
19816
20269
  title: Usage Percentage
19817
- description: The percentage taken of the monetary amount of usage tracked.
20270
+ description: This field is deprecated. Do not used it anymore for percentage
20271
+ tiers subscription add ons. Use the percentage_tiers object instead.
20272
+ deprecated: true
20273
+ SubscriptionAddOnPercentageTier:
20274
+ type: object
20275
+ properties:
20276
+ ending_amount:
20277
+ type: number
20278
+ format: float
20279
+ title: Ending amount
20280
+ minimum: 1
20281
+ maximum: 9999999999999.99
20282
+ default:
20283
+ usage_percentage:
20284
+ type: string
20285
+ title: Usage Percentage
20286
+ description: |
20287
+ The percentage taken of the monetary amount of usage tracked.
19818
20288
  This can be up to 4 decimal places represented as a string. A value between
19819
- 0.0 and 100.0. Optionally, override tiers' default usage percentage. Required
19820
- if add-on's `add_on_type` is `usage` and `usage_type` is `percentage`.
19821
- Must be omitted otherwise.
20289
+ 0.0 and 100.0.
19822
20290
  SubscriptionCancel:
19823
20291
  type: object
19824
20292
  properties:
@@ -21253,6 +21721,46 @@ components:
21253
21721
  maxItems: 200
21254
21722
  items:
21255
21723
  "$ref": "#/components/schemas/Plan"
21724
+ InvoiceTemplateList:
21725
+ type: object
21726
+ properties:
21727
+ object:
21728
+ type: string
21729
+ title: Object type
21730
+ description: Will always be List.
21731
+ has_more:
21732
+ type: boolean
21733
+ description: Indicates there are more results on subsequent pages.
21734
+ next:
21735
+ type: string
21736
+ description: Path to subsequent page of results.
21737
+ data:
21738
+ type: array
21739
+ items:
21740
+ "$ref": "#/components/schemas/InvoiceTemplate"
21741
+ InvoiceTemplate:
21742
+ type: object
21743
+ description: Settings for an invoice template.
21744
+ properties:
21745
+ id:
21746
+ type: string
21747
+ code:
21748
+ type: string
21749
+ description: Invoice template code.
21750
+ name:
21751
+ type: string
21752
+ description: Invoice template name.
21753
+ description:
21754
+ type: string
21755
+ description: Invoice template description.
21756
+ created_at:
21757
+ type: string
21758
+ format: date-time
21759
+ description: When the invoice template was created in Recurly.
21760
+ updated_at:
21761
+ type: string
21762
+ format: date-time
21763
+ description: When the invoice template was updated in Recurly.
21256
21764
  PaymentMethod:
21257
21765
  properties:
21258
21766
  object:
@@ -21927,6 +22435,7 @@ components:
21927
22435
  - rate_limited
21928
22436
  - service_not_available
21929
22437
  - simultaneous_request
22438
+ - tax_service_error
21930
22439
  - transaction
21931
22440
  - unauthorized
21932
22441
  - unavailable_in_api_version
@@ -22160,12 +22669,24 @@ components:
22160
22669
  AchTypeEnum:
22161
22670
  type: string
22162
22671
  description: The payment method type for a non-credit card based billing info.
22163
- The value of `bacs` is the only accepted value (Bacs only)
22672
+ `bacs` and `becs` are the only accepted values.
22164
22673
  enum:
22165
22674
  - bacs
22675
+ - becs
22166
22676
  AchAccountTypeEnum:
22167
22677
  type: string
22168
22678
  description: The bank account type. (ACH only)
22169
22679
  enum:
22170
22680
  - checking
22171
22681
  - savings
22682
+ ExternalHppTypeEnum:
22683
+ type: string
22684
+ description: Use for Adyen HPP billing info.
22685
+ enum:
22686
+ - adyen
22687
+ OnlineBankingPaymentTypeEnum:
22688
+ type: string
22689
+ description: Use for Online Banking billing info.
22690
+ enum:
22691
+ - ideal
22692
+ - sofort