openapi/api.yaml in recurly-3.28.0 vs openapi/api.yaml in recurly-4.0.0

- old
+ new

@@ -8,60 +8,24 @@ ## Versioning The V3 API is versioned to allow stability for integrators and flexibility for Recurly to continue making improvements. The versions follow a format that incorporates the approximate date the - changes were released in a YYYY-MM-DD format, e.g. `v2019-10-10`. + changes were released in a YYYY-MM-DD format, e.g. `v2021-02-25`. > *WARNING*: Specifying a version is required to get a successful response. Each request should specify a version using the `Accept` header: - * `Accept: application/vnd.recurly.v2019-10-10` - * `Accept: application/vnd.recurly.v2019-10-10+json` + * `Accept: application/vnd.recurly.v2021-02-25` + * `Accept: application/vnd.recurly.v2021-02-25+json` All responses will include a `Recurly-Version` header with the API version used to process the request: ``` - Recurly-Version: recurly.v2019-10-10 + Recurly-Version: recurly.v2021-02-25 ``` - Recurly's client libraries correspond with API versions as listed below. - - <table> - <tr> - <th>API Version</th> - <th>Client Library Version</th> - </tr> - <tr> - <td>v2021-02-25</td> - <td>4.x</td> - </tr> - <tr> - <td>v2019-10-10</td> - <td>3.x</td> - </tr> - </table> - - Client library releases: - - * [Node.js](https://github.com/recurly/recurly-client-node/releases) - * [Python](https://github.com/recurly/recurly-client-python/releases) - * [.NET](https://github.com/recurly/recurly-client-dotnet/releases) - * [Ruby](https://github.com/recurly/recurly-client-ruby/releases) - * [Java](https://github.com/recurly/recurly-client-java/releases) - * [PHP](https://github.com/recurly/recurly-client-php/releases) - * [Go](https://github.com/recurly/recurly-client-go/releases) - - Client libraries follow semantic versioning. For example, [Ruby client library - version 3.18.1](https://github.com/recurly/recurly-client-ruby/releases/tag/3.18.1) - represents major version `3`, minor version `18` with patch `1`. - - We encourage you to update to the latest version of the API and corresponding client library, - as most recent versions are more performant than their predecessors. See the - [changelog](https://recurly.com/developers/api/changelog.html) for a comprehensive list of changes - introduced in the latest API version. - ### Default Versions Specifying a version is required to get a successful response. If you wish to receive the latest version and are willing to accept the risk of breaking changes, you may specify a version of `latest`. @@ -97,11 +61,12 @@ "application/vnd.recurly.v2017-09-30", "application/vnd.recurly.v2018-01-24", "application/vnd.recurly.v2018-05-10", "application/vnd.recurly.v2018-06-06", "application/vnd.recurly.v2018-08-09", - "application/vnd.recurly.v2019-10-10" + "application/vnd.recurly.v2019-10-10", + "application/vnd.recurly.v2021-02-25" ] } } ``` @@ -111,12 +76,10 @@ API and passing error messages to target systems, be mindful that these messages may not make sense in the context of the target system. Please consider changing these messages in target system to be better suited to the audience of the system. - Please see [transaction error codes](https://recurly.com/developers/pages/api-transaction-errors.html) for more details. - ## Pagination ### Response Schema Every GET listing endpoint returns a response with the same schema: ``` @@ -178,22 +141,21 @@ header contains an integer value representing the time, measured in seconds since the UNIX Epoch, at which the request count will be reset. ## Change Log - A list of changes for this version can be found [in the changelog](https://recurly.com/developers/api/changelog.html#v2019-10-10). - version: v2019-10-10 + A list of changes for this version can be found [in the changelog](https://developers.recurly.com/api/changelog.html#v2021-02-25---current-ga-version). + version: v2021-02-25 security: - api_key: [] x-tagGroups: - name: Customers tags: - account - note - account_acquisition - billing_info - - billing_infos - subscription - subscription_change - shipping_address - purchase - usage @@ -216,24 +178,23 @@ - name: Configuration tags: - site - custom_field_definition - shipping_method - - dunning_campaigns tags: - name: site x-displayName: Site - name: custom_field_definition x-displayName: Custom Field Definition - description: Describes the fields that can be used as custom fields on accounts, - items, line-items (one time charges), plans, or subscriptions. + description: Describes the fields that can use used as custom fields on accounts + or subscriptions. - name: item x-displayName: Item description: |- 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". - Recurly's item catalog requires the Credit Invoices feature to be enabled. + Recurly's item catalog requires the Credit Invoices and Subscription Billing Terms features to be enabled. - name: plan x-displayName: Plan description: A plan tells Recurly how often and how much to charge your customers. Plans can be created with free trials, optional products (called add-ons), setup fees, and more. @@ -261,19 +222,13 @@ x-displayName: Account Acquisition Info description: Recurly offers the ability to record marketing data on customer accounts to match this data with revenue and billing data events in Recurly. - name: billing_info x-displayName: Billing Info - description: Without the premium Wallet feature, an account can only have one stored - payment method at a time. Examples include credit cards, PayPal, or bank accounts. - Billing info is filled out by the customer upon purchase or when they update their - information. -- name: billing_infos - x-displayName: Billing Infos - description: If the premium Wallet feature is enabled, an account can have multiple - payment methods stored. Examples include credit cards, PayPal, or bank accounts. - Primary or backup billing infos can be designated from these endpoints. + description: An account can have one stored payment method at a time. This can be + a credit card, PayPal, or bank account. Billing info is usually filled out by + the customer upon purchase or when they update their information. - name: subscription x-displayName: Subscription description: Subscriptions are created when your customers subscribe to one of your plans. The customer's subscription tells Recurly when and how much to bill the customer. @@ -302,12 +257,10 @@ - name: purchase x-displayName: Purchase description: A purchase is a checkout containing at least one or more subscriptions or one-time charges (line items) and supports both coupon and gift card redemptions. All items purchased will be on one invoice and paid for with one transaction. - The purchases endpoint can also be used to immediately create a credit invoice - on an account, when Credit Invoices is enabled on your site. - name: usage x-displayName: Usage description: Send Recurly your customer usage and we will automatically bill them in arrears at the end of the billing cycle. For more info on usage-based billing, [click here](https://docs.recurly.com/docs/usage-based-billing). @@ -332,22 +285,19 @@ x-displayName: Shipping Method description: Shipping methods offered to send products to customers. - name: automated_exports x-displayName: Automated Exports description: Automated exports of customer data. -- name: dunning_campaigns - x-displayName: Dunning Campaigns - description: Settings used when attempting to dun customers whose payments are declined. paths: "/sites": get: operationId: list_sites summary: List sites description: | This route is most useful for finding a site's ID for subsequent requests. - See the [Pagination Guide](/developers/guides/pagination.html) to learn how to use pagination in the API and Client Libraries. + See the [Pagination Guide](/guides/pagination.html) to learn how to use pagination in the API and Client Libraries. tags: - site parameters: - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" @@ -374,30 +324,38 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const sites = client.listSites({ limit: 200 }) + const sites = client.listSites({ params: { limit: 200 } }) for await (const site of sites.each()) { console.log(site.subdomain) } - lang: Python source: | - sites = client.list_sites(limit=200).items() + params = {"limit": 200} + sites = client.list_sites(params=params).items() for site in sites: print(site.subdomain) - lang: ".NET" source: | - var sites = client.ListSites(limit: 200); + var optionalParams = new ListSitesParams() + { + Limit = 200 + }; + var sites = client.ListSites(optionalParams); foreach(Site site in sites) { Console.WriteLine(site.Subdomain); } - lang: Ruby source: | - sites = @client.list_sites(limit: 200) + params = { + limit: 200 + } + sites = @client.list_sites(params: params) sites.each do |site| puts "Site: #{site.subdomain}" end - lang: Java source: | @@ -408,22 +366,28 @@ for (Site site : sites) { System.out.println(site.getSubdomain()); } - lang: PHP source: | - $params = ['limit' => 200]; - $sites = $client->listSites($params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $sites = $client->listSites($options); foreach($sites as $site) { echo 'Site: ' . $site->getSubdomain() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListSitesParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"asc\"),\n\tLimit: recurly.Int(200),\n}\n\nsites := client.ListSites(listParams)\n\nfor - sites.HasMore {\n\terr := sites.Fetch()\n\tif e, ok := err.(*recurly.Error); - ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, site := range sites.Data {\n\t\tfmt.Printf(\"Site %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tsite.Id,\n\t\t\tsite.Subdomain,\n\t\t)\n\t}\n}" + recurly.String(\"asc\"),\n\tLimit: recurly.Int(200),\n}\n\nsites, err := + client.ListSites(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor sites.HasMore() {\n\terr := sites.Fetch()\n\tif + e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, site := range sites.Data() + {\n\t\tfmt.Printf(\"Site %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tsite.Id,\n\t\t\tsite.Subdomain,\n\t\t)\n\t}\n}" "/sites/{site_id}": get: operationId: get_site summary: Fetch a site tags: @@ -536,18 +500,18 @@ source: "site, err := client.GetSite(siteID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched Site: %s\", site.Id)" - "/sites/{site_id}/accounts": + "/accounts": get: tags: - account operationId: list_accounts summary: List a site's accounts - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -583,30 +547,38 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const accounts = client.listAccounts({ limit: 200 }) + const accounts = client.listAccounts({ params: { limit: 200 } }) for await (const account of accounts.each()) { console.log(account.code) } - lang: Python source: | - accounts = client.list_accounts(limit=200).items() + params = {"limit": 200} + accounts = client.list_accounts(params=params).items() for account in accounts: print(account.code) - lang: ".NET" source: | - var accounts = client.ListAccounts(limit: 200); + var optionalParams = new ListAccountsParams() + { + Limit = 200 + }; + var accounts = client.ListAccounts(optionalParams); foreach(Account account in accounts) { Console.WriteLine(account.Code); } - lang: Ruby source: | - accounts = @client.list_accounts(limit: 200) + params = { + limit: 200 + } + accounts = @client.list_accounts(params: params) accounts.each do |account| puts "Account: #{account.code}" end - lang: Java source: | @@ -617,24 +589,28 @@ for (Account acct : accounts) { System.out.println(acct.getCode()); } - lang: PHP source: | - $params = [ - 'limit' => 200, + $options = [ + 'params' => [ + 'limit' => 200 + ] ]; - $accounts = $client->listAccounts($params); + $accounts = $client->listAccounts($options); foreach($accounts as $account) { - echo 'Account code: ' . $account->getCode() . PHP_EOL; + echo 'Account code: ' . $account->getCode() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListAccountsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naccounts := client.ListAccounts(listParams)\n\nfor - accounts.HasMore {\n\terr := accounts.Fetch()\n\tif e, ok := err.(*recurly.Error); - ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, account := range accounts.Data {\n\t\tfmt.Printf(\"Account %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\taccount.Id,\n\t\t\taccount.Code,\n\t\t)\n\t}\n}" + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naccounts, err + := client.ListAccounts(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor accounts.HasMore() {\n\terr := accounts.Fetch()\n\tif + e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, account := range accounts.Data() + {\n\t\tfmt.Printf(\"Account %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\taccount.Id,\n\t\t\taccount.Code,\n\t\t)\n\t}\n}" post: tags: - account operationId: create_account summary: Create an account @@ -684,11 +660,10 @@ try { const accountCreate = { code: accountCode, firstName: 'Benjamin', lastName: 'Du Monde', - preferredTimeZone: 'America/Chicago', address: { street1: '900 Camp St', city: 'New Orleans', region: 'LA', postalCode: '70115', @@ -713,11 +688,10 @@ try: account_create = { "code": account_code, "first_name": "Benjamin", "last_name": "Du Monde", - "preferred_time_zone": "America/Chicago", "acquisition": { "campaign": "podcast-marketing", "channel": "social_media", "subchannel": "twitter", "cost": {"currency": "USD", "amount": 0.50}, @@ -749,11 +723,10 @@ var accountReq = new AccountCreate() { Code = accountCode, FirstName = "Benjamin", LastName = "Du Monde", - PreferredTimeZone = "America/Chicago", Address = new Address() { City = "New Orleans", Region = "LA", Country = "US", @@ -780,11 +753,10 @@ begin account_create = { code: account_code, first_name: "Benjamin", last_name: "Du Monde", - preferred_time_zone: "America/Chicago", acquisition: { campaign: "podcast-marketing", channel: "social_media", subchannel: "twitter", cost: { @@ -819,11 +791,10 @@ Address address = new Address(); accountReq.setCode(accountCode); accountReq.setFirstName("Aaron"); accountReq.setLastName("Du Monde"); - accountReq.setPreferredTimeZone("America/Chicago"); address.setStreet1("900 Camp St."); address.setCity("New Orleans"); address.setRegion("LA"); address.setCountry("US"); @@ -846,11 +817,10 @@ try { $account_create = [ "code" => $account_code, "first_name" => "Douglas", "last_name" => "DuMonde", - "preferred_time_zone" => "America/Chicago", "shipping_addresses" => [ [ "first_name" => "Douglas", "last_name" => "DuMonde", "nickname" => "nola", @@ -876,24 +846,24 @@ var_dump($e); } - lang: Go source: "accountReq := &recurly.AccountCreate{\n\tCode: &accountCode,\n\tFirstName: recurly.String(\"Isaac\"),\n\tLastName: recurly.String(\"Du Monde\"),\n\tEmail: - \ recurly.String(\"isaac@example.com\"),\n\tPreferredTimeZone: recurly.String(\"America/Los_Angeles\"),\n\tBillingInfo: - &recurly.BillingInfoCreate{\n\t\tFirstName: recurly.String(\"Isaac\"),\n\t\tLastName: - \ recurly.String(\"Du Monde\"),\n\t\tAddress: &recurly.AddressCreate{\n\t\t\tPhone: - \ recurly.String(\"415-555-5555\"),\n\t\t\tStreet1: recurly.String(\"400 - Alabama St.\"),\n\t\t\tCity: recurly.String(\"San Francisco\"),\n\t\t\tPostalCode: - recurly.String(\"94110\"),\n\t\t\tCountry: recurly.String(\"US\"),\n\t\t\tRegion: - \ recurly.String(\"CA\"),\n\t\t},\n\t\tNumber: recurly.String(\"4111111111111111\"),\n\t\tMonth: - \ recurly.String(\"12\"),\n\t\tYear: recurly.String(\"22\"),\n\t\tCvv: - \ recurly.String(\"123\"),\n\t},\n}\n\naccount, err := client.CreateAccount(accountReq)\nif - e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation - {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected + \ recurly.String(\"isaac@example.com\"),\n\tBillingInfo: &recurly.BillingInfoCreate{\n\t\tFirstName: + recurly.String(\"Isaac\"),\n\t\tLastName: recurly.String(\"Du Monde\"),\n\t\tAddress: + &recurly.AddressCreate{\n\t\t\tPhone: recurly.String(\"415-555-5555\"),\n\t\t\tStreet1: + \ recurly.String(\"400 Alabama St.\"),\n\t\t\tCity: recurly.String(\"San + Francisco\"),\n\t\t\tPostalCode: recurly.String(\"94110\"),\n\t\t\tCountry: + \ recurly.String(\"US\"),\n\t\t\tRegion: recurly.String(\"CA\"),\n\t\t},\n\t\tNumber: + recurly.String(\"4111111111111111\"),\n\t\tMonth: recurly.String(\"12\"),\n\t\tYear: + \ recurly.String(\"22\"),\n\t\tCvv: recurly.String(\"123\"),\n\t},\n}\n\naccount, + err := client.CreateAccount(accountReq)\nif e, ok := err.(*recurly.Error); + ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed + validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Created Account: %s\", account.Id)" - "/sites/{site_id}/accounts/{account_id}": + "/accounts/{account_id}": parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" get: tags: @@ -1004,11 +974,11 @@ \", account.Id)" put: tags: - account operationId: update_account - summary: Modify an account + summary: Update an account requestBody: content: application/json: schema: "$ref": "#/components/schemas/AccountUpdate" @@ -1197,15 +1167,18 @@ source: | try { const account = await client.deactivateAccount(accountId) console.log('Deleted account: ', account.code) } catch (err) { - if (err instanceof recurly.errors.NotFoundError) { + if (err && err.type === 'not-found') { // If the request was not found, you may want to alert the user or // just return null console.log('Resource Not Found') } + // If we don't know what to do with the err, we should + // probably re-raise and let our web framework and logger handle it + throw err } - lang: Python source: | try: account = client.deactivate_account(account_id) @@ -1275,16 +1248,17 @@ source: "account, err := client.DeactivateAccount(accountID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Deactivated Account: %s\", account.Id)" - "/sites/{site_id}/accounts/{account_id}/acquisition": + "/accounts/{account_id}/acquisition": parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" get: tags: + - account - account_acquisition operationId: get_account_acquisition summary: Fetch an account's acquisition data responses: '200': @@ -1389,18 +1363,19 @@ {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched Account Acquisition: %v\", accountAcq.Id)" put: tags: + - account - account_acquisition operationId: update_account_acquisition summary: Update an account's acquisition data requestBody: content: application/json: schema: - "$ref": "#/components/schemas/AccountAcquisitionUpdatable" + "$ref": "#/components/schemas/AccountAcquisitionUpdate" required: true responses: '200': description: An account's updated acquisition data. content: @@ -1465,14 +1440,14 @@ print(e.error.params) - lang: ".NET" source: | try { - var acquisitionReq = new AccountAcquisitionUpdatable() + var acquisitionReq = new AccountAcquisitionUpdate() { Campaign = "big-event-campaign", - Channel = "social_media", + Channel = Channel.SocialMedia, Subchannel = "twitter" }; AccountAcquisition accountAcquisition = client.UpdateAccountAcquisition(accountId, acquisitionReq); Console.WriteLine(accountAcquisition); } @@ -1510,13 +1485,13 @@ puts "ValidationError: #{e.recurly_error.params}" end - lang: Java source: | try { - final AccountAcquisitionUpdatable acqUpdate = new AccountAcquisitionUpdatable(); + final AccountAcquisitionUpdate acqUpdate = new AccountAcquisitionUpdate(); acqUpdate.setCampaign("big-event-campaign"); - acqUpdate.setChannel("social_media"); + acqUpdate.setChannel(Constants.Channel.SOCIAL_MEDIA); acqUpdate.setSubchannel("twitter"); final AccountAcquisition accountAcquisition = client.updateAccountAcquisition(accountId, acqUpdate); System.out.println(accountAcquisition); } catch (ValidationException e) { @@ -1547,19 +1522,20 @@ // If we don't know what to do with the err, we should // probably re-raise and let our web framework and logger handle it var_dump($e); } - lang: Go - source: "updateReq := &recurly.AccountAcquisitionUpdatable{\n\tCampaign: recurly.String(\"big-event-campaign\"),\n\tChannel: + source: "updateReq := &recurly.AccountAcquisitionUpdate{\n\tCampaign: recurly.String(\"big-event-campaign\"),\n\tChannel: \ recurly.String(\"social_media\"),\n\tSubchannel: recurly.String(\"twitter\"),\n}\naccount, err := client.UpdateAccountAcquisition(accountID, updateReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Updated Account Acquisition: %s\", account.Id)" delete: tags: + - account - account_acquisition operationId: remove_account_acquisition summary: Remove an account's acquisition data responses: '204': @@ -1655,11 +1631,11 @@ source: "client.RemoveAccountAcquisition(accountID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Removed Account Acquisition: %s\", accountAcquisition.Id)" - "/sites/{site_id}/accounts/{account_id}/reactivate": + "/accounts/{account_id}/reactivate": parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" put: tags: @@ -1698,15 +1674,18 @@ source: | try { const account = await client.reactivateAccount(accountId) console.log('Reactivated account: ', account.code) } catch (err) { - if (err instanceof recurly.errors.NotFoundError) { + if (err && err.type === 'not_found') { // If the request was not found, you may want to alert the user or // just return null console.log('Resource Not Found') } + // If we don't know what to do with the err, we should + // probably re-raise and let our web framework and logger handle it + throw err } - lang: Python source: | try: account = client.reactivate_account(account_id) @@ -1776,11 +1755,11 @@ source: "account, err := client.ReactivateAccount(accountID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Reactivated Account: %s\", account.Id)" - "/sites/{site_id}/accounts/{account_id}/balance": + "/accounts/{account_id}/balance": parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" get: tags: @@ -1893,13 +1872,14 @@ source: "accountBalance, err := client.GetAccountBalance(accountID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched Account Balance: %v\", accountBalance)" - "/sites/{site_id}/accounts/{account_id}/billing_info": + "/accounts/{account_id}/billing_info": get: tags: + - account - billing_info operationId: get_billing_info summary: Fetch an account's billing information parameters: - "$ref": "#/components/parameters/site_id" @@ -2013,17 +1993,18 @@ not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Fetched Billing Info: %v\", billingInfo)" put: tags: + - account - billing_info operationId: update_billing_info summary: Set an account's billing information description: | If you're using Recurly.js to securely submit data from webforms without sending it through your server, you can associate the billing information with an account by passing in the `token_id`. The only other - fields permitted with `token_id` are `primary_payment_method` and/or `backup_payment_method`. + field permitted with `token_id` is `primary_payment_method`. For credit card payments you'll need the following required fields: - first_name - last_name @@ -2187,10 +2168,11 @@ {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Updated Billing Info: %s\", billingInfo)" delete: tags: + - account - billing_info operationId: remove_billing_info summary: Remove an account's billing information parameters: - "$ref": "#/components/parameters/site_id" @@ -2293,150 +2275,19 @@ source: "billingInfo, err := client.RemoveBillingInfo(accountID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Removed Billing Info: %v\", billingInfo)" - "/sites/{site_id}/accounts/{account_id}/billing_info/verify": - post: - tags: - - billing_info - operationId: verify_billing_info - summary: Verify an account's credit card billing information - parameters: - - "$ref": "#/components/parameters/site_id" - - "$ref": "#/components/parameters/account_id" - requestBody: - content: - application/json: - schema: - "$ref": "#/components/schemas/BillingInfoVerify" - required: false - responses: - '200': - description: Transaction information from verify. - content: - application/json: - schema: - "$ref": "#/components/schemas/Transaction" - '404': - description: Account has no billing information, or incorrect site or account - ID. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - default: - description: Unexpected error. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - '422': - description: Invalid billing information, or error running the verification - transaction. - content: - application/json: - schema: - "$ref": "#/components/schemas/ErrorMayHaveTransaction" - x-code-samples: - - lang: Node.js - source: | - try { - const transaction = await client.verifyBillingInfo(accountId) - console.log('Fetched Transaction: ', transaction.id) - } catch (err) { - if (err instanceof recurly.errors.NotFoundError) { - // If the request was not found, you may want to alert the user or - // just return null - console.log('Resource Not Found') - } else { - // If we don't know what to do with the err, we should - // probably re-raise and let our web framework and logger handle it - console.log('Unknown Error: ', err) - } - } - - lang: Python - source: | - try: - transaction = client.verify_billing_info(account_id) - print("Got Transaction %s" % transaction) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - - lang: ".NET" - source: | - try - { - Transaction transaction = client.VerifyBillingInfo(accountId); - Console.WriteLine($"Fetched transaction {transaction.Id}"); - } - catch (Recurly.Errors.NotFound ex) - { - // If the resource was not found - // we may want to alert the user or just return null - Console.WriteLine($"Resource Not Found: {ex.Error.Message}"); - } - catch (Recurly.Errors.ApiError ex) - { - // Use ApiError to catch a generic error from the API - Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); - } - - lang: Ruby - source: | - begin - transaction = @client.verify_billing_info(account_id: account_id) - puts "Got Transaction #{transaction}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end - - lang: Java - source: | - try { - final Transaction transaction = client.verifyBillingInfo(accountId); - System.out.println("Fetched transaction " + transaction.getId()); - } catch (NotFoundException e) { - // If the resource was not found - // we may want to alert the user or just return null - System.out.println("Resource Not Found: " + e.getError().getMessage()); - } catch (ApiException e) { - // Use ApiException to catch a generic error from the API - System.out.println("Unexpected Recurly Error: " + e.getError().getMessage()); - } - - lang: PHP - source: | - try { - $transaction = $client->verifyBillingInfo($account_id); - - echo 'Got Transaction:' . PHP_EOL; - var_dump($transaction); - } catch (\Recurly\Errors\NotFound $e) { - // Could not find the resource, you may want to inform the user - // or just return a NULL - echo 'Could not find resource.' . PHP_EOL; - var_dump($e); - } catch (\Recurly\RecurlyError $e) { - // Something bad happened... tell the user so that they can fix it? - echo 'Some unexpected Recurly error happened. Try again later.' . PHP_EOL; - } - - lang: Go - source: "verifyBillingInfoParams := &recurly.VerifyBillingInfoParams{}\ntransaction, - err := client.VerifyBillingInfo(accountID, verifyBillingInfoParams)\nif - e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound - {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected - Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Fetched Transaction: - %v\", transaction)" - "/sites/{site_id}/accounts/{account_id}/billing_infos": + "/accounts/{account_id}/billing_infos": get: tags: - - billing_infos + - account + - billing_info operationId: list_billing_infos summary: Get the list of billing information associated with an account - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/sort_dates" @@ -2462,17 +2313,18 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: [] post: tags: - - billing_infos + - account + - billing_info operationId: create_billing_info - summary: Add new billing information on an account + summary: Set an account's billing information when the wallet feature is enabled description: | If you're using Recurly.js to securely submit data from webforms without sending it through your server, you can associate the billing information with an account by passing in the `token_id`. The only other - fields permitted with `token_id` are `primary_payment_method` and/or `backup_payment_method`. + field permitted with `token_id` is `primary_payment_method`. For credit card payments you'll need the following required fields: - first_name - last_name @@ -2520,14 +2372,15 @@ content: application/json: schema: "$ref": "#/components/schemas/ErrorMayHaveTransaction" x-code-samples: [] - "/sites/{site_id}/accounts/{account_id}/billing_infos/{billing_info_id}": + "/accounts/{account_id}/billing_infos/{billing_info_id}": get: tags: - - billing_infos + - account + - billing_info operationId: get_a_billing_info summary: Fetch a billing info parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" @@ -2546,17 +2399,18 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: [] put: tags: - - billing_infos + - account + - billing_info operationId: update_a_billing_info summary: Update an account's billing information description: | If you're using Recurly.js to securely submit data from webforms without sending it through your server, you can associate the billing information with an account by passing in the `token_id`. The only other - fields permitted with `token_id` are `primary_payment_method` and/or `backup_payment_method`. + field permitted with `token_id` is `primary_payment_method`. For credit card payments you'll need the following required fields: - first_name - last_name @@ -2607,11 +2461,12 @@ schema: "$ref": "#/components/schemas/ErrorMayHaveTransaction" x-code-samples: [] delete: tags: - - billing_infos + - account + - billing_info operationId: remove_a_billing_info summary: Remove an account's billing information parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" @@ -2635,18 +2490,19 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/accounts/{account_id}/coupon_redemptions": + "/accounts/{account_id}/coupon_redemptions": get: tags: + - account - coupon_redemption operationId: list_account_coupon_redemptions - summary: List the coupon redemptions for an account - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + summary: Show the coupon redemptions for an account + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/sort_dates" @@ -2673,18 +2529,19 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const redemptions = client.listAccountCouponRedemptions(accountId, { limit: 200 }) + const redemptions = client.listAccountCouponRedemptions(accountId, { params: { limit: 200 } }) for await (const redemption of redemptions.each()) { console.log(redemption.id) } - lang: Python source: | - redemptions = client.list_account_coupon_redemptions(account_id, limit=200).items() + params = {"limit": 200} + redemptions = client.list_account_coupon_redemptions(account_id, params=params).items() for redemption in redemptions: print(redemption.id) - lang: ".NET" source: | var redemptions = client.ListAccountCouponRedemptions(accountId); @@ -2692,13 +2549,16 @@ { Console.WriteLine(redemption.Id); } - lang: Ruby source: | + params = { + limit: 200 + } redemptions = @client.list_account_coupon_redemptions( account_id: account_id, - limit: 200 + params: params ) redemptions.each do |redemption| puts "CouponRedemption: #{redemption.id}" end - lang: Java @@ -2710,40 +2570,48 @@ for (CouponRedemption redemption : redemptions) { System.out.println(redemption.getId()); } - lang: PHP source: | - $params = ['limit' => 200]; - $account_coupon_redemptions = $client->listAccountCouponRedemptions($account->getId(), $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $account_coupon_redemptions = $client->listAccountCouponRedemptions($account->getId(), $options); foreach($account_coupon_redemptions as $coupon_redemption) { echo 'Coupon redemption: ' . $coupon_redemption->getId() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListAccountCouponRedemptionsParams{\n\tSort: - recurly.String(\"created_at\"),\n}\naccountCouponRedemptions := client.ListAccountCouponRedemptions(accountID, - listParams)\n\nfor accountCouponRedemptions.HasMore {\n\terr := accountCouponRedemptions.Fetch()\n\tif + recurly.String(\"created_at\"),\n}\naccountCouponRedemptions, err := client.ListAccountCouponRedemptions(accountID, + listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor + accountCouponRedemptions.HasMore() {\n\terr := accountCouponRedemptions.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, couponRedemption := range - accountCouponRedemptions.Data {\n\t\tfmt.Printf(\"Account Coupon Redemption + accountCouponRedemptions.Data() {\n\t\tfmt.Printf(\"Account Coupon Redemption %3d: %s\\n\",\n\t\t\ti,\n\t\t\tcouponRedemption.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/accounts/{account_id}/coupon_redemptions/active": + "/accounts/{account_id}/coupon_redemptions/active": get: tags: + - account - coupon_redemption - operationId: get_active_coupon_redemption - summary: Fetch the coupon redemption that is active on an account + operationId: list_active_coupon_redemptions + summary: Show the coupon redemptions that are active on an account + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" responses: '200': - description: An active coupon redemption on an account. + description: Active coupon redemptions on an account. content: application/json: schema: - "$ref": "#/components/schemas/CouponRedemption" + "$ref": "#/components/schemas/CouponRedemptionList" '404': description: Incorrect site or account ID. content: application/json: schema: @@ -2755,39 +2623,30 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - try { - const redemption = await client.getActiveCouponRedemption(accountId) + const redemptions = await client.listActiveCouponRedemptions(accountId, { params: { limit: 200 } }) + + for await (const redemption of redemptions.each()) { console.log('Fetched coupon redemption: ', redemption.id) - } catch (err) { - if (err instanceof recurly.errors.NotFoundError) { - // If the request was not found, you may want to alert the user or - // just return null - console.log('Resource Not Found') - } else { - // If we don't know what to do with the err, we should - // probably re-raise and let our web framework and logger handle it - console.log('Unknown Error: ', err) - } } - lang: Python source: | - try: - redemption = client.get_active_coupon_redemption(account_id) - print("Got Redemption %s" % redemption) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") + params = {"limit": 200} + redemptions = client.list_active_coupon_redemptions(account_id, params=params).items() + for redemption in redemptions: + print(redemption.id) - lang: ".NET" source: | try { - CouponRedemption redemption = client.GetActiveCouponRedemption(accountId); - Console.WriteLine($"Fetched coupon redemption {redemption.Id}"); + var redemptions = client.ListActiveCouponRedemptions(accountId); + foreach(CouponRedemption redemption in redemptions) + { + Console.WriteLine($"Fetched coupon redemption {redemption.Id}"); + } } catch (Recurly.Errors.NotFound ex) { // If the resource was not found // we may want to alert the user or just return null @@ -2798,55 +2657,32 @@ // Use ApiError to catch a generic error from the API Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } - lang: Ruby source: | - begin - redemption = @client.get_active_coupon_redemption(account_id: account_id) - puts "Got CouponRedemption #{redemption}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end - - lang: Java - source: | - try { - final CouponRedemption redemption = client.getActiveCouponRedemption(accountId); - System.out.println("Fetched coupon redemption " + redemption.getId()); - } catch (NotFoundException e) { - // If the resource was not found - // we may want to alert the user or just return null - System.out.println("Resource Not Found: " + e.getError().getMessage()); - } catch (ApiException e) { - // Use ApiException to catch a generic error from the API - System.out.println("Unexpected Recurly Error: " + e.getError().getMessage()); + params = { + limit: 200 } + redemptions = @client.list_active_coupon_redemptions(account_id: account_id, params: params) + redemptions.each do |redemption| + puts "Redemption: #{redemption.id}" + end - lang: PHP source: | - try { - $redemption = $client->getActiveCouponRedemption($account_id); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $redemptions = $client->listActiveCouponRedemptions($account_id, $options); - echo 'Got Redemption:' . PHP_EOL; - var_dump($redemption); - } catch (\Recurly\Errors\NotFound $e) { - // Could not find the resource, you may want to inform the user - // or just return a NULL - echo 'Could not find resource.' . PHP_EOL; - var_dump($e); - } catch (\Recurly\RecurlyError $e) { - // Something bad happened... tell the user so that they can fix it? - echo 'Some unexpected Recurly error happened. Try again later.' . PHP_EOL; + foreach($redemptions as $redemption) { + echo 'Got Redemption: ' . $redemption->getId() . PHP_EOL; } - - lang: Go - source: "couponRedemption, err := client.GetActiveCouponRedemption(accountID)\nif - e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound - {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected - Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Fetched Active - Coupon Redemption: %v\", couponRedemption.Id)" post: tags: + - account - coupon_redemption operationId: create_coupon_redemption summary: Generate an active coupon redemption on an account or subscription parameters: - "$ref": "#/components/parameters/site_id" @@ -2974,10 +2810,11 @@ {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Created Coupon Redemption: %v\", couponRedemption)" delete: tags: + - account - coupon_redemption operationId: remove_coupon_redemption summary: Delete the active coupon redemption from an account parameters: - "$ref": "#/components/parameters/site_id" @@ -3086,18 +2923,19 @@ source: "couponRedemption, err := client.RemoveCouponRedemption(accountID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Removed Coupon Redemption: %v\", couponRedemption.Id)" - "/sites/{site_id}/accounts/{account_id}/credit_payments": + "/accounts/{account_id}/credit_payments": get: tags: + - account - credit_payment operationId: list_account_credit_payments summary: List an account's credit payments - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -3130,32 +2968,40 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const payments = client.listAccountCreditPayments(accountId, { limit: 200 }) + const payments = client.listAccountCreditPayments(accountId, { params: { limit: 200 } }) for await (const payment of payments.each()) { console.log(payment.uuid) } - lang: Python source: | - payments = client.list_account_credit_payments(account_id, limit=200).items() + params = {"limit": 200} + payments = client.list_account_credit_payments(account_id, params=params).items() for payment in payments: print(payment.id) - lang: ".NET" source: | - var payments = client.ListAccountCreditPayments(accountId, limit: 200); + var optionalParams = new ListAccountCreditPaymentsParams() + { + Limit = 200 + }; + var payments = client.ListAccountCreditPayments(accountId, optionalParams); foreach(CreditPayment payment in payments) { Console.WriteLine(payment.Uuid); } - lang: Ruby source: | + params = { + limit: 200 + } payments = @client.list_account_credit_payments( account_id: account_id, - limit: 200 + params: params ) payments.each do |payment| puts "CreditPayment: #{payment.id}" end - lang: Java @@ -3167,32 +3013,38 @@ for (CreditPayment payment : payments) { System.out.println(payment.getUuid()); } - lang: PHP source: | - $params = ['limit' => 200]; - $credit_payments = $client->listAccountCreditPayments($account->getId(), $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $credit_payments = $client->listAccountCreditPayments($account->getId(), $options); foreach($credit_payments as $payment) { echo 'Credit Payment: ' . $payment->getId() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListAccountCreditPaymentsParams{\n\tSort: \ recurly.String(\"created_at\"),\n\tOrder: recurly.String(\"desc\"),\n\tLimit: - recurly.Int(200),\n}\ncreditPayments := client.ListAccountCreditPayments(accountID, - listParams)\n\nfor creditPayments.HasMore {\n\terr := creditPayments.Fetch()\n\tif - e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve - next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, creditPayment := range creditPayments.Data + recurly.Int(200),\n}\ncreditPayments, err := client.ListAccountCreditPayments(accountID, + listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor + creditPayments.HasMore() {\n\terr := creditPayments.Fetch()\n\tif e, ok + := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next + page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, creditPayment := range creditPayments.Data() {\n\t\tfmt.Printf(\"Account Credit Payment %3d: %s\\n\",\n\t\t\ti,\n\t\t\tcreditPayment.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/accounts/{account_id}/invoices": + "/accounts/{account_id}/invoices": get: tags: - invoice + - account operationId: list_account_invoices summary: List an account's invoices - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" @@ -3227,18 +3079,19 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const invoices = client.listAccountInvoices(accountId, { limit: 200 }) + const invoices = client.listAccountInvoices(accountId, { params: { limit: 200 } }) for await (const invoice of invoices.each()) { console.log(invoice.number) } - lang: Python source: | - invoices = client.list_account_invoices(account_id, limit=200).items() + params = {"limit": 200} + invoices = client.list_account_invoices(account_id, params=params).items() for invoice in invoices: print(invoice.number) - lang: ".NET" source: | var invoices = client.ListAccountInvoices(accountId); @@ -3246,13 +3099,16 @@ { Console.WriteLine(invoice.Id); } - lang: Ruby source: | + params = { + limit: 200 + } invoices = @client.list_account_invoices( account_id: account_id, - limit: 200 + params: params ) invoices.each do |invoice| puts "Invoice: #{invoice.number}" end - lang: Java @@ -3264,26 +3120,32 @@ for (Invoice invoice : invoices) { System.out.println(invoice.getNumber()); } - lang: PHP source: | - $params = ['limit' => 10]; - $invoices = $client->listAccountInvoices($account->getId(), $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $invoices = $client->listAccountInvoices($account->getId(), $options); foreach($invoices as $invoice) { echo 'Account invoice: ' . $invoice->getNumber() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListAccountInvoicesParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naccountInvoices - := client.ListAccountInvoices(accountID, listParams)\n\nfor accountInvoices.HasMore + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naccountInvoices, + err := client.ListAccountInvoices(accountID, listParams)\nif err != nil + {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor accountInvoices.HasMore() {\n\terr := accountInvoices.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, invoice := range accountInvoices.Data {\n\t\tfmt.Printf(\"Account Invoice + i, invoice := range accountInvoices.Data() {\n\t\tfmt.Printf(\"Account Invoice %3d: %s\\n\",\n\t\t\ti,\n\t\t\tinvoice.Id,\n\t\t)\n\t}\n}" post: tags: - invoice + - account operationId: create_invoice summary: Create an invoice for pending line items parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" @@ -3365,11 +3227,11 @@ { // creates an invoice based on pending charges or credits on account var collection = client.CreateInvoice(accountId, new InvoiceCreate() { Currency = "USD", - CollectionMethod = "automatic" + CollectionMethod = CollectionMethod.Automatic }); Console.WriteLine("Created Invoice"); Console.WriteLine(collection.ChargeInvoice); Console.WriteLine(collection.CreditInvoices); } @@ -3404,11 +3266,11 @@ - lang: Java source: | try { InvoiceCreate invoiceCreate = new InvoiceCreate(); invoiceCreate.setCurrency("USD"); - invoiceCreate.setCollectionMethod("automatic"); + invoiceCreate.setCollectionMethod(Constants.CollectionMethod.AUTOMATIC); InvoiceCollection collection = client.createInvoice(accountId, invoiceCreate); System.out.println("Created Invoice"); System.out.println(collection.getChargeInvoice()); System.out.println(collection.getCreditInvoices()); @@ -3447,14 +3309,15 @@ recurly.String(\"automatic\"),\n}\n\ncollection, err := client.CreateInvoice(accountID, invoiceReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Created Invoice Collection: %v\", collection)" - "/sites/{site_id}/accounts/{account_id}/invoices/preview": + "/accounts/{account_id}/invoices/preview": post: tags: - invoice + - account operationId: preview_invoice summary: Preview new invoice for pending line items parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" @@ -3535,11 +3398,11 @@ { // creates a preview invoice based on pending charges or credits on account var collection = client.PreviewInvoice(accountId, new InvoiceCreate() { Currency = "USD", - CollectionMethod = "automatic" + CollectionMethod = CollectionMethod.Automatic }); Console.WriteLine($"Previewed invoice DueAt {collection.ChargeInvoice.DueAt}"); Console.WriteLine(collection.ChargeInvoice); Console.WriteLine(collection.CreditInvoices); } @@ -3574,11 +3437,11 @@ - lang: Java source: | try { InvoiceCreate invoiceCreate = new InvoiceCreate(); invoiceCreate.setCurrency("USD"); - invoiceCreate.setCollectionMethod("automatic"); + invoiceCreate.setCollectionMethod(Constants.CollectionMethod.AUTOMATIC); InvoiceCollection collection = client.previewInvoice(accountId, invoiceCreate); System.out.println("Previewed Invoice due at " + collection.getChargeInvoice().getDueAt()); System.out.println(collection.getChargeInvoice()); System.out.println(collection.getCreditInvoices()); @@ -3617,18 +3480,19 @@ err := client.PreviewInvoice(accountID, invoiceReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Preview Invoice %v\", collection.ChargeInvoice)" - "/sites/{site_id}/accounts/{account_id}/line_items": + "/accounts/{account_id}/line_items": get: tags: + - account - line_item operationId: list_account_line_items summary: List an account's line items - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" @@ -3665,18 +3529,19 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const lineItems = client.listAccountLineItems(accountId, { limit: 200 }) + const lineItems = client.listAccountLineItems(accountId, { params: { limit: 200 } }) for await (const lineItem of lineItems.each()) { console.log(lineItem.id) } - lang: Python source: | - line_items = client.list_account_line_items(account_id, limit=200).items() + params = {"limit": 200} + line_items = client.list_account_line_items(account_id, params=params).items() for line_item in line_items: print(line_item.id) - lang: ".NET" source: | var lineItems = client.ListAccountLineItems(accountId); @@ -3684,13 +3549,16 @@ { Console.WriteLine(lineItem.Id); } - lang: Ruby source: | + params = { + limit: 200 + } line_items = @client.list_account_line_items( account_id: account_id, - limit: 200 + params: params ) line_items.each do |line_item| puts "LineItem: #{line_item.id}" end - lang: Java @@ -3702,31 +3570,35 @@ for (LineItem lineItem : lineItems) { System.out.println(lineItem.getId()); } - lang: PHP source: | - $params = ['limit' => 200]; - $account_line_items = $client->listAccountLineItems($account_id, $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $account_line_items = $client->listAccountLineItems($account_id, $options); foreach($account_line_items as $line_item) { echo 'Account line item: ' . $line_item->getId() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListAccountLineItemsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naccountLineItems - := client.ListAccountLineItems(accountID, listParams)\n\nfor accountLineItems.HasMore + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naccountLineItems, + err := client.ListAccountLineItems(accountID, listParams)\nif err != nil + {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor accountLineItems.HasMore() {\n\terr := accountLineItems.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, lineItem := range accountLineItems.Data {\n\t\tfmt.Printf(\"Account Line - Item %3d: %s\\n\",\n\t\t\ti,\n\t\t\tlineItem.Id,\n\t\t)\n\t}\n}" + i, lineItem := range accountLineItems.Data() {\n\t\tfmt.Printf(\"Account + Line Item %3d: %s\\n\",\n\t\t\ti,\n\t\t\tlineItem.Id,\n\t\t)\n\t}\n}" post: tags: + - account - line_item operationId: create_line_item summary: Create a new line item for the account - description: When using the Credit Invoices feature, utilize the purchases endpoint - in order to immediately post credit to a credit invoice. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" requestBody: content: @@ -3803,11 +3675,11 @@ // creates a pending charge or credit on the account var lineItemReq = new LineItemCreate() { Currency = "USD", UnitAmount = 1000, - Type = "charge" // choose "credit" for a credit + Type = LineItemType.Charge // choose "credit" for a credit }; LineItem lineItem = client.CreateLineItem(accountId, lineItemReq); Console.WriteLine($"Created line item {lineItem.Uuid}"); } catch (Recurly.Errors.Validation ex) @@ -3843,11 +3715,11 @@ source: | try { LineItemCreate lineItemCreate = new LineItemCreate(); lineItemCreate.setCurrency("USD"); lineItemCreate.setUnitAmount(1000.0f); - lineItemCreate.setType("charge"); // choose "credit" for a credit + lineItemCreate.setType(Constants.LineItemType.CHARGE); // choose "credit" for a credit LineItem lineItem = client.createLineItem(accountId, lineItemCreate); System.out.println("Created line item " + lineItem.getUuid()); } catch (ValidationException e) { // If the request was not valid, you may want to tell your user @@ -3886,18 +3758,19 @@ err := client.CreateLineItem(accountID, lineItemReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Created Line Item: %v\", lineItem)" - "/sites/{site_id}/accounts/{account_id}/notes": + "/accounts/{account_id}/notes": get: tags: + - account - note operationId: list_account_notes - summary: List an account's notes - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + summary: Fetch a list of an account's notes + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" - "$ref": "#/components/parameters/ids" responses: @@ -3920,18 +3793,19 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const notes = client.listAccountNotes(accountId, { limit: 200 }) + const notes = client.listAccountNotes(accountId, { params: { limit: 200 } }) for await (const note of notes.each()) { console.log(note.message) } - lang: Python source: | - line_items = client.list_account_line_items(account_id, limit=200).items() + params = {"limit": 200} + line_items = client.list_account_line_items(account_id, params=params).items() for line_item in line_items: print(line_item.id) - lang: ".NET" source: | var notes = client.ListAccountNotes(accountId); @@ -3939,11 +3813,14 @@ { Console.WriteLine(note.Message); } - lang: Ruby source: | - account_notes = @client.list_account_notes(account_id: account_id, limit: 200) + params = { + limit: 200 + } + account_notes = @client.list_account_notes(account_id: account_id, params: params) account_notes.each do |note| puts "AccountNote: #{note.message}" end - lang: Java source: | @@ -3954,26 +3831,31 @@ for (AccountNote note : notes) { System.out.println(note.getMessage()); } - lang: PHP source: | - $params = ['limit' => 200]; - $account_notes = $client->listAccountNotes($account_id, $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $account_notes = $client->listAccountNotes($account_id, $options); foreach($account_notes as $note) { echo 'Account note: ' . $note->getMessage() . PHP_EOL; } - lang: Go - source: "listParams := &recurly.ListAccountNotesParams{}\naccountNotes := - client.ListAccountNotes(accountID, listParams)\n\nfor accountNotes.HasMore - {\n\terr := accountNotes.Fetch()\n\tif e, ok := err.(*recurly.Error); ok - {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, note := range accountNotes.Data {\n\t\tfmt.Printf(\"Account Note %3d: - %s\\n\",\n\t\t\ti,\n\t\t\tnote.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/accounts/{account_id}/notes/{account_note_id}": + source: "listParams := &recurly.ListAccountNotesParams{}\naccountNotes, err + := client.ListAccountNotes(accountID, listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor accountNotes.HasMore() {\n\terr := + accountNotes.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed + to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, note := range + accountNotes.Data() {\n\t\tfmt.Printf(\"Account Note %3d: %s\\n\",\n\t\t\ti,\n\t\t\tnote.Id,\n\t\t)\n\t}\n}" + "/accounts/{account_id}/notes/{account_note_id}": get: tags: + - account - note operationId: get_account_note summary: Fetch an account note parameters: - "$ref": "#/components/parameters/site_id" @@ -4094,18 +3976,19 @@ source: "accountNote, err := client.GetAccountNote(accountID, accountNoteID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched Account Note: %v\", accountNote)" - "/sites/{site_id}/accounts/{account_id}/shipping_addresses": + "/accounts/{account_id}/shipping_addresses": get: tags: + - account - shipping_address operationId: list_shipping_addresses summary: Fetch a list of an account's shipping addresses - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" @@ -4133,11 +4016,11 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const addresses = client.listShippingAddresses(accountId, { limit: 200 }) + const addresses = client.listShippingAddresses(accountId, { params: { limit: 200 } }) for await (const address of addresses.each()) { console.log(address.street1) } - lang: Python @@ -4152,13 +4035,16 @@ { Console.WriteLine(address.Street1); } - lang: Ruby source: | + params = { + limit: 200 + } shipping_addresses = @client.list_shipping_addresses( account_id: account_id, - limit: 200 + params: params ) shipping_addresses.each do |addr| puts "ShippingAddress: #{addr.nickname} - #{addr.street1}" end - lang: Java @@ -4170,26 +4056,32 @@ for (ShippingAddress address : addresses) { System.out.println(address.getStreet1()); } - lang: PHP source: | - $params = ['limit' => 200]; - $shippingAddresses = $client->listShippingAddresses($account_id, $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $shippingAddresses = $client->listShippingAddresses($account_id, $options); foreach($shippingAddresses as $address) { echo 'Shipping Address: ' . $address->getId() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListShippingAddressesParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nshippingAddresses - := client.ListShippingAddresses(accountID, listParams)\n\nfor shippingAddresses.HasMore + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nshippingAddresses, + err := client.ListShippingAddresses(accountID, listParams)\nif err != nil + {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor shippingAddresses.HasMore() {\n\terr := shippingAddresses.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, shippingAddress := range shippingAddresses.Data {\n\t\tfmt.Printf(\"Shipping + i, shippingAddress := range shippingAddresses.Data() {\n\t\tfmt.Printf(\"Shipping Address %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tshippingAddress.Id,\n\t\t\tshippingAddress.Street1,\n\t\t)\n\t}\n}" post: tags: + - account - shipping_address operationId: create_shipping_address summary: Create a new shipping address for the account parameters: - "$ref": "#/components/parameters/site_id" @@ -4373,13 +4265,14 @@ \ recurly.String(\"Du Monde\"),\n}\n\nshippingAddress, err := client.CreateShippingAddress(accountID, shippingReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Created Shipping Address: %v\", shippingAddress.Id)" - "/sites/{site_id}/accounts/{account_id}/shipping_addresses/{shipping_address_id}": + "/accounts/{account_id}/shipping_addresses/{shipping_address_id}": get: tags: + - account - shipping_address operationId: get_shipping_address summary: Fetch an account's shipping address parameters: - "$ref": "#/components/parameters/site_id" @@ -4496,10 +4389,11 @@ {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched Shipping Address: %v\", shippingAddress)" put: tags: + - account - shipping_address operationId: update_shipping_address summary: Update an account's shipping address parameters: - "$ref": "#/components/parameters/site_id" @@ -4667,10 +4561,11 @@ %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Updated Shipping Address: %v\", shippingAddress)" delete: tags: + - account - shipping_address operationId: remove_shipping_address summary: Remove an account's shipping address parameters: - "$ref": "#/components/parameters/site_id" @@ -4773,18 +4668,19 @@ source: "shippingAddress, err := client.RemoveShippingAddress(accountID, shippingAddressID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Removed Shipping Address: %v\", shippingAddress)" - "/sites/{site_id}/accounts/{account_id}/subscriptions": + "/accounts/{account_id}/subscriptions": get: tags: - subscription + - account operationId: list_account_subscriptions summary: List an account's subscriptions - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" @@ -4819,31 +4715,35 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const subscriptions = client.listAccountSubscriptions(accountId, { limit: 200 }) + const subscriptions = client.listAccountSubscriptions(accountId, { params: { limit: 200 } }) for await (const subscription of subscriptions.each()) { console.log(subscription.uuid) } - lang: Python source: | - subscriptions = client.list_account_subscriptions(account.id, limit=200).items() + params = {"limit": 200} + subscriptions = client.list_account_subscriptions(account.id, params=params).items() for subscription in subscriptions: print(subscription.uuid) - lang: ".NET" source: | var subscriptions = client.ListAccountSubscriptions(accountId); foreach(Subscription subscription in subscriptions) { Console.WriteLine(subscription.Id); } - lang: Ruby source: | + params = { + limit: 200 + } subscriptions = @client.list_account_subscriptions( account_id: account_id, - limit: 200 + params: params ) subscriptions.each do |subscription| puts "Subscription: #{subscription.uuid}" end - lang: Java @@ -4855,32 +4755,38 @@ for (Subscription subscription : subscriptions) { System.out.println(subscription.getUuid()); } - lang: PHP source: | - $params = ['limit' => 200]; - $account_subscriptions = $client->listAccountSubscriptions($account_id, $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $account_subscriptions = $client->listAccountSubscriptions($account_id, $options); foreach($account_subscriptions as $sub) { - echo 'Account subscription: ' . $sub->getUuid() . PHP_EOL; + echo 'Account subscription: ' . $sub->getUuid() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListAccountSubscriptionsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naccountSubscriptions - := client.ListAccountSubscriptions(accountID, listParams)\n\nfor accountSubscriptions.HasMore - {\n\terr := accountSubscriptions.Fetch()\n\tif e, ok := err.(*recurly.Error); - ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, sub := range accountSubscriptions.Data {\n\t\tfmt.Printf(\"Account Subscription - %3d: %s\\n\",\n\t\t\ti,\n\t\t\tsub.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/accounts/{account_id}/transactions": + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naccountSubscriptions, + err := client.ListAccountSubscriptions(accountID, listParams)\nif err != + nil {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor + accountSubscriptions.HasMore() {\n\terr := accountSubscriptions.Fetch()\n\tif + e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, sub := range accountSubscriptions.Data() + {\n\t\tfmt.Printf(\"Account Subscription %3d: %s\\n\",\n\t\t\ti,\n\t\t\tsub.Id,\n\t\t)\n\t}\n}" + "/accounts/{account_id}/transactions": get: tags: + - account - transaction operationId: list_account_transactions summary: List an account's transactions - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" @@ -4916,18 +4822,19 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const transactions = client.listAccountTransactions(accountId, { limit: 200 }) + const transactions = client.listAccountTransactions(accountId, { params: { limit: 200 } }) for await (const transaction of transactions.each()) { console.log(transaction.uuid) } - lang: Python source: | - transactions = client.list_account_transactions(account_id, limit=200).items() + params = {"limit": 200} + transactions = client.list_account_transactions(account_id, params=params).items() for transaction in transactions: print("Transaction %s" % transaction.id) - lang: ".NET" source: | var transactions = client.ListAccountTransactions(accountId); @@ -4935,13 +4842,16 @@ { Console.WriteLine(transaction.Id); } - lang: Ruby source: | + params = { + limit: 200 + } transactions = @client.list_account_transactions( account_id: account_id, - limit: 200 + params: params ) transactions.each do |transaction| puts "Transaction: #{transaction.uuid}" end - lang: Java @@ -4953,32 +4863,37 @@ for (Transaction transaction : transactions) { System.out.println(transaction.getUuid()); } - lang: PHP source: | - $params = ['limit' => 200]; - $account_transactions = $client->listAccountTransactions($account_id, $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $account_transactions = $client->listAccountTransactions($account_id, $options); foreach($account_transactions as $transaction) { echo 'Account transactions: ' . $transaction->getUuid() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListAccountTransactionsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naccountTransactions - := client.ListAccountTransactions(accountID, listParams)\n\nfor accountTransactions.HasMore - {\n\terr := accountTransactions.Fetch()\n\tif e, ok := err.(*recurly.Error); - ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, transaction := range accountTransactions.Data {\n\t\tfmt.Printf(\"Account - Transaction %3d: %s\\n\",\n\t\t\ti,\n\t\t\ttransaction.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/accounts/{account_id}/accounts": + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naccountTransactions, + err := client.ListAccountTransactions(accountID, listParams)\nif err != + nil {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor + accountTransactions.HasMore() {\n\terr := accountTransactions.Fetch()\n\tif + e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, transaction := range accountTransactions.Data() + {\n\t\tfmt.Printf(\"Account Transaction %3d: %s\\n\",\n\t\t\ti,\n\t\t\ttransaction.Id,\n\t\t)\n\t}\n}" + "/accounts/{account_id}/accounts": get: tags: - account operationId: list_child_accounts summary: List an account's child accounts - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/account_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" @@ -5015,45 +4930,54 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Python source: | - child_accounts = client.list_child_accounts(account_id, limit=200).items() + params = {"limit": 200} + child_accounts = client.list_child_accounts(account_id, params=params).items() for account in child_accounts: print("Child Account %s" % account.code) - lang: Ruby source: | + params = { + limit: 200 + } child_accounts = @client.list_child_accounts( account_id: account_id, - limit: 200 + params: params ) child_accounts.each do |child| puts "Account: #{child.code}" end - lang: PHP source: | - $params = ['limit' => 200]; - $child_accounts = $client->listChildAccounts($account_id, $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $child_accounts = $client->listChildAccounts($account_id, $options); foreach($child_accounts as $child_account) { echo 'Child Account: ' . $child_account->getId() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListChildAccountsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naccounts := client.ListChildAccounts(accountID, - listParams)\n\nfor accounts.HasMore {\n\terr := accounts.Fetch()\n\tif e, - ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next - page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, account := range accounts.Data + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naccounts, err + := client.ListChildAccounts(accountID, listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor accounts.HasMore() {\n\terr := accounts.Fetch()\n\tif + e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, account := range accounts.Data() {\n\t\tfmt.Printf(\"Child Account %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\taccount.Id,\n\t\t\taccount.Code,\n\t\t)\n\t}\n}" - "/sites/{site_id}/acquisitions": + "/acquisitions": get: tags: - account_acquisition operationId: list_account_acquisition summary: List a site's account acquisition data - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -5086,18 +5010,19 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const acquisitions = client.listAccountAcquisition({ limit: 200 }) + const acquisitions = client.listAccountAcquisition({ params: { limit: 200 } }) for await (const acquisition of acquisitions.each()) { console.log(acquisition.id) } - lang: Python source: | - acquisitions = client.list_account_acquisition(limit=200).items() + params = {"limit": 200} + acquisitions = client.list_account_acquisition(params=params).items() for acquisition in acquisitions: print(acquisition.id) - lang: ".NET" source: | var acquisitions = client.ListAccountAcquisition(); @@ -5105,11 +5030,14 @@ { Console.WriteLine(acquisition.Id); } - lang: Ruby source: | - acquisitions = @client.list_account_acquisition(limit: 200) + params = { + limit: 200 + } + acquisitions = @client.list_account_acquisition(params: params) acquisitions.each do |acquisition| puts "AccountAcquisition: #{acquisition.cost}" end - lang: Java source: | @@ -5120,32 +5048,36 @@ for (AccountAcquisition acquisition : acquisitions) { System.out.println(acquisition.getId()); } - lang: PHP source: | - $params = ['limit' => 200]; - $account_acquisition = $client->listAccountAcquisition($params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $account_acquisition = $client->listAccountAcquisition($options); foreach($account_acquisition as $aa) { echo 'Account acquisition: ' . $aa->getId() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListAccountAcquisitionParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"asc\"),\n\tLimit: recurly.Int(200),\n}\naccountAcquisition - := client.ListAccountAcquisition(listParams)\n\nfor accountAcquisition.HasMore - {\n\terr := accountAcquisition.Fetch()\n\tif e, ok := err.(*recurly.Error); - ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, a := range accountAcquisition.Data {\n\t\tfmt.Printf(\"Account Acquisition - %3d: %s\\n\",\n\t\t\ti,\n\t\t\ta.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/coupons": + recurly.String(\"asc\"),\n\tLimit: recurly.Int(200),\n}\naccountAcquisition, + err := client.ListAccountAcquisition(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor accountAcquisition.HasMore() {\n\terr + := accountAcquisition.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed + to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, a := range accountAcquisition.Data() + {\n\t\tfmt.Printf(\"Account Acquisition %3d: %s\\n\",\n\t\t\ti,\n\t\t\ta.Id,\n\t\t)\n\t}\n}" + "/coupons": get: tags: - coupon operationId: list_coupons summary: List a site's coupons - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -5178,30 +5110,38 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const coupons = client.listCoupons({ limit: 200 }) + const coupons = client.listCoupons({ params: { limit: 200 } }) for await (const coupon of coupons.each()) { console.log(coupon.code) } - lang: Python source: | - coupons = client.list_coupons(limit=200).items() + params = {"limit": 200} + coupons = client.list_coupons(params=params).items() for coupon in coupons: print(coupon.code) - lang: ".NET" source: | - var coupons = client.ListCoupons(limit: 200); + var optionalParams = new ListCouponsParams() + { + Limit = 200 + }; + var coupons = client.ListCoupons(optionalParams); foreach(Coupon coupon in coupons) { Console.WriteLine(coupon.Code); } - lang: Ruby source: | - coupons = @client.list_coupons(limit: 200) + params = { + limit: 200 + } + coupons = @client.list_coupons(params: params) coupons.each do |coupon| puts "coupon: #{coupon.code}" end - lang: Java source: | @@ -5212,22 +5152,28 @@ for (Coupon coupon : coupons) { System.out.println(coupon.getCode()); } - lang: PHP source: | - $params = ['limit' => 200]; - $coupons = $client->listCoupons($params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $coupons = $client->listCoupons($options); foreach($coupons as $coupon) { echo 'Coupon: ' . $coupon->getCode() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListCouponsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\ncoupons := client.ListCoupons(listParams)\n\nfor - coupons.HasMore {\n\terr := coupons.Fetch()\n\tif e, ok := err.(*recurly.Error); - ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, coupon := range coupons.Data {\n\t\tfmt.Printf(\"Coupon %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tcoupon.Id,\n\t\t\tcoupon.Code,\n\t\t)\n\t}\n}" + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\ncoupons, err := + client.ListCoupons(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor coupons.HasMore() {\n\terr := coupons.Fetch()\n\tif + e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, coupon := range coupons.Data() + {\n\t\tfmt.Printf(\"Coupon %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tcoupon.Id,\n\t\t\tcoupon.Code,\n\t\t)\n\t}\n}" post: tags: - coupon operationId: create_coupon summary: Create a new coupon @@ -5315,11 +5261,11 @@ { var couponReq = new CouponCreate() { Name = "Promotional Coupon", Code = couponCode, - DiscountType = "fixed", + DiscountType = DiscountType.Fixed, Currencies = new List<CouponPricing>() { new CouponPricing() { Currency = "USD", Discount = 1000 } @@ -5375,10 +5321,11 @@ couponPrice.setCurrency("USD"); couponPrice.setDiscount(10.0f); currencies.add(couponPrice); couponCreate.setCurrencies(currencies); + couponCreate.setDiscountType(Constants.DiscountType.FIXED); Coupon coupon = client.createCoupon(couponCreate); System.out.println("Created coupon " + coupon.getCode()); } catch (ValidationException e) { // If the request was not valid, you may want to tell your user @@ -5422,11 +5369,11 @@ err := client.CreateCoupon(couponReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Created Coupon: %v\", coupon.Id)" - "/sites/{site_id}/coupons/{coupon_id}": + "/coupons/{coupon_id}": get: tags: - coupon operationId: get_coupon summary: Fetch a coupon @@ -5715,16 +5662,10 @@ description: Incorrect site or coupon ID. content: application/json: schema: "$ref": "#/components/schemas/Error" - default: - description: Unexpected error. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | try { const coupon = await client.deactivateCoupon(couponId) @@ -5804,13 +5745,14 @@ var_dump($e); } catch (\Recurly\RecurlyError $e) { // Something bad happened... tell the user so that they can fix it? echo 'Some unexpected Recurly error happened. Try again later.' . PHP_EOL; } - "/sites/{site_id}/coupons/{coupon_id}/generate": + "/coupons/{coupon_id}/generate": post: tags: + - coupon - unique_coupon_code operationId: generate_unique_coupon_codes summary: Generate unique coupon codes parameters: - "$ref": "#/components/parameters/site_id" @@ -5821,16 +5763,17 @@ schema: "$ref": "#/components/schemas/CouponBulkCreate" required: true responses: '201': - description: The `Location` header will specify the location created coupon - codes + description: | + A set of parameters that can be passed to the `list_unique_coupon_codes` + endpoint to obtain only the newly generated `UniqueCouponCodes`. content: application/json: schema: - "$ref": "#/components/schemas/Empty" + "$ref": "#/components/schemas/UniqueCouponCodeParams" '400': description: Invalid or unpermitted parameter; perhaps you tried to generate more than 200 codes at a time? content: application/json: @@ -5847,11 +5790,11 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/coupons/{coupon_id}/restore": + "/coupons/{coupon_id}/restore": put: tags: - coupon operationId: restore_coupon summary: Restore an inactive coupon @@ -5895,120 +5838,20 @@ description: Unexpected error. content: application/json: schema: "$ref": "#/components/schemas/Error" - x-code-samples: - - lang: Node.js - source: | - try { - const coupon = await client.restoreCoupon(couponId, { - name: "New Coupon Name" - }) - console.log('Restored coupon: ', coupon.code) - } catch (err) { - if (err instanceof recurly.errors.NotFoundError) { - // If the request was not found, you may want to alert the user or - // just return null - console.log('Resource Not Found') - } - - } - - lang: Python - source: | - try: - coupon = client.restore_coupon(coupon_id, { - "name": "New Coupon Name" - }) - print("Restored Coupon %s" % coupon) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - - lang: ".NET" - source: | - try - { - var couponReq = new CouponUpdate() { - Name = "New Coupon Name" - }; - Coupon coupon = client.RestoreCoupon(couponId, couponReq); - Console.WriteLine($"Restored coupon {coupon.Code}"); - } - catch (Recurly.Errors.Validation ex) - { - // If the request was not valid, you may want to tell your user - // why. You can find the invalid params and reasons in ex.Error.Params - Console.WriteLine($"Failed validation: {ex.Error.Message}"); - } - catch (Recurly.Errors.ApiError ex) - { - // Use ApiError to catch a generic error from the API - Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); - } - - lang: Ruby - source: | - begin - coupon = @client.restore_coupon(coupon_id: coupon_id, body: { - name: "New Coupon Name" - }) - puts "Restored coupon #{coupon}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end - - lang: Java - source: | - try { - final CouponUpdate couponUpdate = new CouponUpdate(); - couponUpdate.setName("New Coupon Name"); - - final Coupon coupon = client.restoreCoupon(couponId, couponUpdate); - System.out.println("Restored coupon: " + coupon.getCode()); - } catch (ValidationException e) { - // If the request was not valid, you may want to tell your user - // why. You can find the invalid params and reasons in e.getError().getParams() - System.out.println("Failed validation: " + e.getError().getMessage()); - } catch (ApiException e) { - // Use ApiException to catch a generic error from the API - System.out.println("Unexpected Recurly Error: " + e.getError().getMessage()); - } - - lang: PHP - source: | - try { - $coupon_update = [ - "name" => "New Coupon Name" - ]; - $coupon = $client->restoreCoupon($coupon_id, $coupon_update); - - echo 'Restored Coupon:' . PHP_EOL; - var_dump($coupon); - } catch (\Recurly\Errors\NotFound $e) { - // Could not find the resource, you may want to inform the user - // or just return a NULL - echo 'Could not find resource.' . PHP_EOL; - var_dump($e); - } catch (\Recurly\RecurlyError $e) { - // Something bad happened... tell the user so that they can fix it? - echo 'Some unexpected Recurly error happened. Try again later.' . PHP_EOL; - } - - lang: Go - source: "updateReq := &recurly.CouponUpdate{\n\tName: recurly.String(\"New - Coupon Name\"),\n}\ncoupon, err := client.RestoreCoupon(couponId, updateReq)\nif - e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation - {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected - Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Restored Coupon: - %s\", coupon.Id)" - "/sites/{site_id}/coupons/{coupon_id}/unique_coupon_codes": + x-code-samples: [] + "/coupons/{coupon_id}/unique_coupon_codes": get: tags: + - coupon - unique_coupon_code operationId: list_unique_coupon_codes summary: List unique coupon codes associated with a bulk coupon - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/coupon_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" @@ -6034,18 +5877,18 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/credit_payments": + "/credit_payments": get: tags: - credit_payment operationId: list_credit_payments summary: List a site's credit payments - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" - "$ref": "#/components/parameters/sort_dates" @@ -6077,30 +5920,38 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const payments = client.listCreditPayments({ limit: 200 }) + const payments = client.listCreditPayments({ params: { limit: 200 } }) for await (const payment of payments.each()) { console.log(payment.uuid) } - lang: Python source: | - payments = client.list_credit_payments(limit=200).items() + params = {"limit": 200} + payments = client.list_credit_payments(params=params).items() for payment in payments: print("Credit Payment %s" % payment.id) - lang: ".NET" source: | - var payments = client.ListCreditPayments(limit: 200); + var optionalParams = new ListCreditPaymentsParams() + { + Limit = 200 + }; + var payments = client.ListCreditPayments(optionalParams); foreach(CreditPayment payment in payments) { Console.WriteLine(payment.Uuid); } - lang: Ruby source: | - payments = @client.list_credit_payments(limit: 200) + params = { + limit: 200 + } + payments = @client.list_credit_payments(params: params) payments.each do |payment| puts "CreditPayment: #{payment.id}" end - lang: Java source: | @@ -6111,24 +5962,29 @@ for (CreditPayment payment : payments) { System.out.println(payment.getUuid()); } - lang: PHP source: | - $params = ['limit' => 200]; - $credit_payments = $client->listCreditPayments($params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $credit_payments = $client->listCreditPayments($options); foreach($credit_payments as $payment) { echo 'Credit Payment: ' . $payment->getId() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListCreditPaymentsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\ncreditPayments - := client.ListCreditPayments(listParams)\n\nfor creditPayments.HasMore {\n\terr + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\ncreditPayments, + err := client.ListCreditPayments(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor creditPayments.HasMore() {\n\terr := creditPayments.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, creditPayment - := range creditPayments.Data {\n\t\tfmt.Printf(\"Credit Payment %3d: %s\\n\",\n\t\t\ti,\n\t\t\tcreditPayment.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/credit_payments/{credit_payment_id}": + := range creditPayments.Data() {\n\t\tfmt.Printf(\"Credit Payment %3d: %s\\n\",\n\t\t\ti,\n\t\t\tcreditPayment.Id,\n\t\t)\n\t}\n}" + "/credit_payments/{credit_payment_id}": get: tags: - credit_payment operationId: get_credit_payment summary: Fetch a credit payment @@ -6153,18 +6009,18 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/custom_field_definitions": + "/custom_field_definitions": get: tags: - custom_field_definition operationId: list_custom_field_definitions summary: List a site's custom field definitions - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -6173,17 +6029,11 @@ - "$ref": "#/components/parameters/filter_end_time" - name: related_type in: query description: Filter by related type. schema: - type: string - enum: - - account - - item - - plan - - subscription - - charge + "$ref": "#/components/schemas/RelatedTypeEnum" responses: '200': description: A list of the site's custom field definitions. content: application/json: @@ -6208,30 +6058,38 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const definitions = client.listCustomFieldDefinitions({ limit: 200 }) + const definitions = client.listCustomFieldDefinitions({ params: { limit: 200 } }) for await (const definition of definitions.each()) { console.log(definition.displayName) } - lang: Python source: | - custom_fields = client.list_custom_field_definitions(limit=200).items() + params = {"limit": 200} + custom_fields = client.list_custom_field_definitions(params=params).items() for custom_field in custom_fields: print(custom_field.name) - lang: ".NET" source: | - var fields = client.ListCustomFieldDefinitions(limit: 200); + var optionalParams = new ListCustomFieldDefinitionsParams() + { + Limit = 200 + }; + var fields = client.ListCustomFieldDefinitions(optionalParams); foreach(CustomFieldDefinition def in fields) { Console.WriteLine(def.DisplayName); } - lang: Ruby source: | - custom_fields = @client.list_custom_field_definitions(limit: 200) + params = { + limit: 200 + } + custom_fields = @client.list_custom_field_definitions(params: params) custom_fields.each do |field| puts "CustomFieldDefinition: #{field.name}" end - lang: Java source: | @@ -6242,25 +6100,30 @@ for (CustomFieldDefinition field : fields) { System.out.println(field.getDisplayName()); } - lang: PHP source: | - $params = ['limit' => 200]; - $custom_field_definitions = $client->listCustomFieldDefinitions($params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $custom_field_definitions = $client->listCustomFieldDefinitions($options); foreach($custom_field_definitions as $definition) { echo 'Custom Field Definition: ' . $definition->getName() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListCustomFieldDefinitionsParams{\n\tSort: \ recurly.String(\"created_at\"),\n\tOrder: recurly.String(\"desc\"),\n\tLimit: - recurly.Int(200),\n}\ncustomFieldDefinitions := client.ListCustomFieldDefinitions(listParams)\n\nfor - customFieldDefinitions.HasMore {\n\terr := customFieldDefinitions.Fetch()\n\tif + recurly.Int(200),\n}\ncustomFieldDefinitions, err := client.ListCustomFieldDefinitions(listParams)\nif + err != nil {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor + customFieldDefinitions.HasMore() {\n\terr := customFieldDefinitions.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve - next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, definition := range customFieldDefinitions.Data + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, definition := range customFieldDefinitions.Data() {\n\t\tfmt.Printf(\"Custom Field Definition %3d: %s\\n\",\n\t\t\ti,\n\t\t\tdefinition.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/custom_field_definitions/{custom_field_definition_id}": + "/custom_field_definitions/{custom_field_definition_id}": get: tags: - custom_field_definition operationId: get_custom_field_definition summary: Fetch an custom field definition @@ -6373,18 +6236,18 @@ source: "definition, err := client.GetCustomFieldDefinition(customFieldDefinitionID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched Custom Field Definition: %s\", definition.Id)" - "/sites/{site_id}/items": + "/items": get: tags: - item operationId: list_items summary: List a site's items - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -6418,30 +6281,38 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const items = client.listItems({ limit: 200 }) + const items = client.listItems({ params: { limit: 200 } }) for await (const item of items.each()) { console.log(item.code) } - lang: Python source: | - items = client.list_items(limit=200).items() + params = {"limit": 200} + items = client.list_items(params=params).items() for item in items: print(item.code) - lang: ".NET" source: | - var items = client.ListItems(limit: 200); + var optionalParams = new ListItemsParams() + { + Limit = 200 + }; + var items = client.ListItems(optionalParams); foreach(Item item in items) { Console.WriteLine(item.Code); } - lang: Ruby source: | - items = @client.list_items(limit: 200) + params = { + limit: 200 + } + items = @client.list_items(params: params) items.each do |item| puts "Item: #{item.code}" end - lang: Java source: | @@ -6452,22 +6323,28 @@ for (Item item : items) { System.out.println(item.getCode()); } - lang: PHP source: | - $params = ['limit' => 200]; - $items = $client->listItems($params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $items = $client->listItems($options); foreach($items as $item) { echo 'Item: ' . $item->getCode() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListItemsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nitems := client.ListItems(listParams)\n\nfor - items.HasMore {\n\terr := items.Fetch()\n\tif e, ok := err.(*recurly.Error); - ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, item := range items.Data {\n\t\tfmt.Printf(\"Item %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\titem.Id,\n\t\t\titem.Code,\n\t\t)\n\t}\n}" + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nitems, err := + client.ListItems(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor items.HasMore() {\n\terr := items.Fetch()\n\tif + e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, item := range items.Data() + {\n\t\tfmt.Printf(\"Item %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\titem.Id,\n\t\t\titem.Code,\n\t\t)\n\t}\n}" post: tags: - item operationId: create_item summary: Create a new item @@ -6570,11 +6447,11 @@ Code = itemCode, Name = "Item Name", Description = "Item Description", ExternalSku = "a35JE-44", AccountingCode = "item-code-127", - RevenueScheduleType = "at_range_end", + RevenueScheduleType = RevenueScheduleType.AtRangeEnd, CustomFields = new List<CustomField>() { new CustomField() { Name = "custom-field-1", Value = "Custom Field 1 value" } @@ -6624,11 +6501,11 @@ itemReq.setCode(itemCode); itemReq.setName("Item Name"); itemReq.setDescription("Item Description"); itemReq.setExternalSku("a35JE-44"); itemReq.setAccountingCode("item-code-127"); - itemReq.setRevenueScheduleType("at_range_end"); + itemReq.setRevenueScheduleType(Constants.RevenueScheduleType.AT_RANGE_END); List<CustomField> customFields = new ArrayList<>(); CustomField customField = new CustomField(); customField.setName("custom-field-1"); customField.setValue("Custom Field 1 value"); @@ -6676,11 +6553,11 @@ err := client.CreateItem(itemReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Created Item: %v\", item.Id)" - "/sites/{site_id}/items/{item_id}": + "/items/{item_id}": get: tags: - item operationId: get_item summary: Fetch an item @@ -6996,15 +6873,18 @@ source: | try { const item = await client.deactivateItem(itemId) console.log('Deleted item: ', item.code) } catch (err) { - if (err instanceof recurly.errors.NotFoundError) { + if (err && err.type === 'not-found') { // If the request was not found, you may want to alert the user or // just return null console.log('Resource Not Found') } + // If we don't know what to do with the err, we should + // probably re-raise and let our web framework and logger handle it + throw err } - lang: Python source: | try: item = client.deactivate_item(item_id) @@ -7074,11 +6954,11 @@ source: "deactivatedItem, err := client.DeactivateItem(itemID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Item deactivated: %s\", deactivatedItem.Code)" - "/sites/{site_id}/items/{item_id}/reactivate": + "/items/{item_id}/reactivate": parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/item_id" put: tags: @@ -7117,15 +6997,18 @@ source: | try { const item = await client.reactivateItem(itemId) console.log('Reactivated item: ', item.code) } catch (err) { - if (err instanceof recurly.errors.NotFoundError) { + if (err && err.type === 'not_found') { // If the request was not found, you may want to alert the user or // just return null console.log('Resource Not Found') } + // If we don't know what to do with the err, we should + // probably re-raise and let our web framework and logger handle it + throw err } - lang: Python source: | try: item = client.reactivate_item(item_id) @@ -7195,18 +7078,18 @@ source: "item, err := client.ReactivateItem(itemID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Reactivated Item: %s\", item.Id)" - "/sites/{site_id}/measured_units": + "/measured_units": get: tags: - measured_unit operationId: list_measured_unit summary: List a site's measured units - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -7277,11 +7160,11 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/measured_units/{measured_unit_id}": + "/measured_units/{measured_unit_id}": get: tags: - measured_unit operationId: get_measured_unit summary: Fetch a measured unit @@ -7381,18 +7264,18 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/invoices": + "/invoices": get: tags: - invoice operationId: list_invoices summary: List a site's invoices - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -7426,30 +7309,38 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const invoices = client.listInvoices({ limit: 200 }) + const invoices = client.listInvoices({ params: { limit: 200 } }) for await (const invoice of invoices.each()) { console.log(invoice.number) } - lang: Python source: | - invoices = client.list_invoices(limit=200).items() + params = {"limit": 200} + invoices = client.list_invoices(params=params).items() for invoice in invoices: print(invoice.number) - lang: ".NET" source: | - var invoices = client.ListInvoices(limit: 200); + var optionalParams = new ListInvoicesParams() + { + Limit = 200 + }; + var invoices = client.ListInvoices(optionalParams); foreach(Invoice invoice in invoices) { Console.WriteLine(invoice.Number); } - lang: Ruby source: | - invoices = @client.list_invoices(limit: 200) + params = { + limit: 200 + } + invoices = @client.list_invoices(params: params) invoices.each do |invoice| puts "Invoice: #{invoice.number}" end - lang: Java source: | @@ -7460,23 +7351,29 @@ for (Invoice invoice : invoices) { System.out.println(invoice.getNumber()); } - lang: PHP source: | - $params = ['limit' => '200']; - $invoices = $client->listInvoices($params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $invoices = $client->listInvoices($options); foreach($invoices as $invoice) { echo 'Invoice: ' . $invoice->getNumber() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListInvoicesParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\ninvoices := client.ListInvoices(listParams)\n\nfor - invoices.HasMore {\n\terr := invoices.Fetch()\n\tif e, ok := err.(*recurly.Error); - ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, invoice := range invoices.Data {\n\t\tfmt.Printf(\"Invoice %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tinvoice.Id,\n\t\t\tinvoice.Number,\n\t\t)\n\t}\n}" - "/sites/{site_id}/invoices/{invoice_id}": + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\ninvoices, err + := client.ListInvoices(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor invoices.HasMore() {\n\terr := invoices.Fetch()\n\tif + e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, invoice := range invoices.Data() + {\n\t\tfmt.Printf(\"Invoice %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tinvoice.Id,\n\t\t\tinvoice.Number,\n\t\t)\n\t}\n}" + "/invoices/{invoice_id}": get: tags: - invoice operationId: get_invoice summary: Fetch an invoice @@ -7592,20 +7489,20 @@ Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Fetched Invoice: %v\", invoice)" put: tags: - invoice - operationId: put_invoice + operationId: update_invoice summary: Update an invoice parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/invoice_id" requestBody: content: application/json: schema: - "$ref": "#/components/schemas/InvoiceUpdatable" + "$ref": "#/components/schemas/InvoiceUpdate" required: true responses: '200': description: An invoice. content: @@ -7631,11 +7528,11 @@ const invoiceUpdate = { customerNotes: "New notes", termsAndConditions: "New terms and conditions" } - const invoice = await client.putInvoice(invoiceId, invoiceUpdate) + const invoice = await client.updateInvoice(invoiceId, invoiceUpdate) console.log('Edited invoice: ', invoice.number) } catch(err) { if (err instanceof recurly.errors.ValidationError) { // If the request was not valid, you may want to tell your user @@ -7652,26 +7549,26 @@ try: invoice_update = { "customer_notes": "New Notes", "terms_and_conditions": "New Terms and Conditions", } - invoice = client.put_invoice(invoice_id, invoice_update) + invoice = client.update_invoice(invoice_id, invoice_update) print("Updated Invoice %s" % invoice.id) except recurly.errors.NotFoundError: # If the resource was not found, you may want to alert the user or # just return nil print("Resource Not Found") - lang: ".NET" source: | try { - var invoiceReq = new InvoiceUpdatable() + var invoiceReq = new InvoiceUpdate() { CustomerNotes = "New Notes", TermsAndConditions = "New Terms and Conditions" }; - Invoice invoice = client.PutInvoice(invoiceId, invoiceReq); + Invoice invoice = client.UpdateInvoice(invoiceId, invoiceReq); Console.WriteLine($"Edited invoice #{invoice.Number}"); } catch (Recurly.Errors.Validation ex) { // If the request was not valid, you may want to tell your user @@ -7688,25 +7585,25 @@ begin invoice_update = { customer_notes: "New Notes", terms_and_conditions: "New Terms and Conditions" } - invoice = @client.put_invoice(invoice_id: invoice_id, body: invoice_update) + invoice = @client.update_invoice(invoice_id: invoice_id, body: invoice_update) puts "Updated invoice #{invoice}" rescue Recurly::Errors::NotFoundError # If the resource was not found, you may want to alert the user or # just return nil puts "Resource Not Found" end - lang: Java source: | try { - final InvoiceUpdatable invoiceUpdate = new InvoiceUpdatable(); + final InvoiceUpdate invoiceUpdate = new InvoiceUpdate(); invoiceUpdate.setCustomerNotes("New notes"); invoiceUpdate.setTermsAndConditions("New terms and conditions"); - final Invoice invoice = client.putInvoice(invoiceId, invoiceUpdate); + final Invoice invoice = client.updateInvoice(invoiceId, invoiceUpdate); System.out.println("Edited invoice " + invoice.getNumber()); } catch (ValidationException e) { // If the request was not valid, you may want to tell your user // why. You can find the invalid params and reasons in e.getError().getParams() System.out.println("Failed validation: " + e.getError().getMessage()); @@ -7719,11 +7616,11 @@ try { $invoice_update = [ "customer_notes" => "New Notes", "terms_and_conditions" => "New terms and conditions", ]; - $invoice = $client->putInvoice($invoice_id, $invoice_update); + $invoice = $client->updateInvoice($invoice_id, $invoice_update); echo 'Updated Invoice:' . PHP_EOL; var_dump($invoice); } catch (\Recurly\Errors\Validation $e) { // If the request was not valid, you may want to tell your user @@ -7733,18 +7630,18 @@ // If we don't know what to do with the err, we should // probably re-raise and let our web framework and logger handle it var_dump($e); } - lang: Go - source: "updateReq := &recurly.InvoiceUpdatable{\n\tCustomerNotes: recurly.String(\"New + source: "updateReq := &recurly.InvoiceUpdate{\n\tCustomerNotes: recurly.String(\"New Notes\"),\n\tTermsAndConditions: recurly.String(\"New Terms and Conditions\"),\n}\ninvoice, - err := client.PutInvoice(invoiceID, updateReq)\nif e, ok := err.(*recurly.Error); + err := client.UpdateInvoice(invoiceID, updateReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Updated Invoice: %s\", invoice.Id)" - "/sites/{site_id}/invoices/{invoice_id}.pdf": + "/invoices/{invoice_id}.pdf": get: tags: - invoice operationId: get_invoice_pdf summary: Fetch an invoice as a PDF @@ -7878,143 +7775,14 @@ var_dump($e); } catch (\Recurly\RecurlyError $e) { // Something bad happened... tell the user so that they can fix it? echo 'Some unexpected Recurly error happened. Try again later.' . PHP_EOL; } - "/sites/{site_id}/invoices/{invoice_id}/apply_credit_balance": + "/invoices/{invoice_id}/collect": put: tags: - invoice - operationId: apply_credit_balance - summary: Apply available credit to a pending or past due charge invoice - description: Apply credit payment to the outstanding balance on an existing - charge invoice from an account’s available balance from existing credit invoices. - Credit that was refunded from the invoice cannot be applied back to the invoice - as payment. - parameters: - - "$ref": "#/components/parameters/site_id" - - "$ref": "#/components/parameters/invoice_id" - responses: - '200': - description: The updated invoice. - content: - application/json: - schema: - "$ref": "#/components/schemas/Invoice" - '404': - description: Incorrect site or invoice ID. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - '422': - description: Tried applying credit to a legacy or closed invoice or there - was an error processing the credit payment, such as no available credit - on the account. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - default: - description: Unexpected error. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - x-code-samples: - - lang: Node.js - source: | - try { - const invoice = await client.applyCreditBalance(invoiceId) - console.log('Applied credit balance to invoice: ', invoice) - } catch (err) { - if (err instanceof recurly.errors.ValidationError) { - // If the request was not valid, you may want to tell your user - // why. You can find the invalid params and reasons in err.params - console.log('Failed validation', err.params) - } else { - // If we don't know what to do with the err, we should - // probably re-raise and let our web framework and logger handle it - console.log('Unknown Error: ', err) - } - } - - lang: Python - source: | - try: - invoice = client.apply_credit_balance(invoice_id) - print("Applied credit balance to invoice %s" % invoice.id) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") - - lang: ".NET" - source: | - try - { - Invoice invoice = client.ApplyCreditBalance(invoiceId); - Console.WriteLine($"Applied credit balance to invoice #{invoice.Number}"); - } - catch (Recurly.Errors.Validation ex) - { - // If the request was not valid, you may want to tell your user - // why. You can find the invalid params and reasons in ex.Error.Params - Console.WriteLine($"Failed validation: {ex.Error.Message}"); - } - catch (Recurly.Errors.ApiError ex) - { - // Use ApiError to catch a generic error from the API - Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); - } - - lang: Ruby - source: | - begin - invoice = @client.apply_credit_balance(invoice_id: invoice_id) - puts "Applied credit balance to invoice #{invoice}" - rescue Recurly::Errors::NotFoundError - # If the resource was not found, you may want to alert the user or - # just return nil - puts "Resource Not Found" - end - - lang: Java - source: | - try { - final Invoice invoice = client.applyCreditBalance(invoiceId); - System.out.println("Applied credit balance to invoice " + invoice.getId()); - } catch (final ValidationException e) { - // If the request was not valid, you may want to tell your user - // why. You can find the invalid params and reasons in e.getError().getParams() - System.out.println("Failed validation: " + e.getError().getMessage()); - } catch (final ApiException e) { - // Use ApiException to catch a generic error from the API - System.out.println("Unexpected Recurly Error: " + e.getError().getMessage()); - } - - lang: PHP - source: | - try { - $invoice = $client->applyCreditBalance($invoice_id); - - echo 'Applied credit balance to invoice:' . PHP_EOL; - var_dump($invoice); - } catch (\Recurly\Errors\Validation $e) { - // If the request was not valid, you may want to tell your user - // why. You can find the invalid params and reasons in err.params - var_dump($e); - } catch (\Recurly\RecurlyError $e) { - // If we don't know what to do with the err, we should - // probably re-raise and let our web framework and logger handle it - var_dump($e); - } - - lang: Go - source: "invoice, err := client.ApplyCreditBalance(invoiceID)\nif e, ok := - err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed - validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected - Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Applied credit - balance to invoice: %v\", invoice)" - "/sites/{site_id}/invoices/{invoice_id}/collect": - put: - tags: - - invoice operationId: collect_invoice summary: Collect a pending or past due, automatic invoice description: Force a collection attempt using the stored billing information. This will trigger a transaction outside of Recurly's normal retry logic. parameters: @@ -8138,15 +7906,15 @@ recurly.String(\"moto\"),\n\t},\n}\n\ncollectedInvoice, err := client.CollectInvoice(invoiceID, collectInvoiceParams)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Collected Invoice: %v\", collectedInvoice)" - "/sites/{site_id}/invoices/{invoice_id}/mark_failed": + "/invoices/{invoice_id}/mark_failed": put: tags: - invoice - operationId: fail_invoice + operationId: mark_invoice_failed summary: Mark an open invoice as failed description: | Indicates that the invoice was not successfully paid for and that collection attempts should stop. This functionality is mostly used to halt the dunning procedures for an invoice. Only invoices with the `pending`, `processing` or `past_due` states can be marked as failed. @@ -8180,11 +7948,11 @@ "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | try { - const invoice = await client.failInvoice(invoiceId) + const invoice = await client.markInvoiceFailed(invoiceId) console.log('Failed invoice: ', invoice.number) } catch (err) { if (err instanceof recurly.errors.ValidationError) { // If the request was not valid, you may want to tell your user // why. You can find the invalid params and reasons in err.params @@ -8196,21 +7964,21 @@ } } - lang: Python source: | try: - invoice = client.fail_invoice(invoice_id) + invoice = client.mark_invoice_failed(invoice_id) print("Failed Invoice %s" % invoice.id) except recurly.errors.NotFoundError: # If the resource was not found, you may want to alert the user or # just return nil print("Resource Not Found") - lang: ".NET" source: | try { - Invoice invoice = client.FailInvoice(invoiceId); + Invoice invoice = client.MarkInvoiceFailed(invoiceId); Console.WriteLine($"Failed invoice #{invoice.Number}"); } catch (Recurly.Errors.Validation ex) { // If the request was not valid, you may want to tell your user @@ -8223,21 +7991,21 @@ Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}"); } - lang: Ruby source: | begin - invoice = @client.fail_invoice(invoice_id: invoice_id) + invoice = @client.mark_invoice_failed(invoice_id: invoice_id) puts "Failed invoice #{invoice}" rescue Recurly::Errors::NotFoundError # If the resource was not found, you may want to alert the user or # just return nil puts "Resource Not Found" end - lang: Java source: | try { - final Invoice invoice = client.failInvoice(invoiceId); + final Invoice invoice = client.markInvoiceFailed(invoiceId); System.out.println("Failed invoice: " + invoice.getNumber()); } catch (ValidationException e) { // If the request was not valid, you may want to tell your user // why. You can find the invalid params and reasons in e.getError().getParams() System.out.println("Failed validation: " + e.getError().getMessage()); @@ -8246,11 +8014,11 @@ System.out.println("Unexpected Recurly Error: " + e.getError().getMessage()); } - lang: PHP source: | try { - $invoice = $client->failInvoice($invoice_id); + $invoice = $client->markInvoiceFailed($invoice_id); echo 'Failed Invoice:' . PHP_EOL; var_dump($invoice); } catch (\Recurly\Errors\NotFound $e) { // Could not find the resource, you may want to inform the user @@ -8260,16 +8028,16 @@ } catch (\Recurly\RecurlyError $e) { // Something bad happened... tell the user so that they can fix it? echo 'Some unexpected Recurly error happened. Try again later.' . PHP_EOL; } - lang: Go - source: "invoice, err := client.FailInvoice(invoiceID)\nif e, ok := err.(*recurly.Error); - ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed + source: "invoice, err := client.MarkInvoiceFailed(invoiceID)\nif e, ok := + err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Invoice failed: %v\", invoice)" - "/sites/{site_id}/invoices/{invoice_id}/mark_successful": + "/invoices/{invoice_id}/mark_successful": put: tags: - invoice operationId: mark_invoice_successful summary: Mark an open invoice as successful @@ -8324,11 +8092,12 @@ } } - lang: Python source: | try: - invoice = client.mark_invoice_successful(invoice_id) + params = {"limit": 200} + invoice = client.mark_invoice_successful(invoice_id, params=params) print("Marked Invoice successful %s" % invoice) except recurly.errors.ValidationError as e: # If the request was invalid, you may want to tell your user # why. You can find the invalid params and reasons in e.error.params print("ValidationError: %s" % e.error.message) @@ -8394,11 +8163,11 @@ source: "invoice, err := client.MarkInvoiceSuccessful(invoiceID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Marked Invoice Successful: %v\", invoice)" - "/sites/{site_id}/invoices/{invoice_id}/reopen": + "/invoices/{invoice_id}/reopen": put: tags: - invoice operationId: reopen_invoice summary: Reopen a closed, manual invoice @@ -8518,11 +8287,11 @@ source: "invoice, err := client.ReopenInvoice(invoiceID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Reopened Invoice: %v\", invoice)" - "/sites/{site_id}/invoices/{invoice_id}/void": + "/invoices/{invoice_id}/void": put: tags: - invoice operationId: void_invoice summary: Void a credit invoice. @@ -8625,11 +8394,11 @@ source: "invoice, err := client.VoidInvoice(invoiceID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Voided Invoice: %v\", invoice)" - "/sites/{site_id}/invoices/{invoice_id}/transactions": + "/invoices/{invoice_id}/transactions": post: tags: - invoice operationId: record_external_transaction summary: Record an external payment for a manual invoices. @@ -8690,18 +8459,19 @@ // If we don't know what to do with the err, we should // probably re-raise and let our web framework and logger handle it console.log('Unknown Error: ', err) } } - "/sites/{site_id}/invoices/{invoice_id}/line_items": + "/invoices/{invoice_id}/line_items": get: tags: + - invoice - line_item operationId: list_invoice_line_items summary: List an invoice's line items - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/invoice_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" @@ -8738,21 +8508,22 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const lineItems = client.listInvoiceLineItems(invoiceId, { limit: 200 }) + const lineItems = client.listInvoiceLineItems(invoiceId, { params: { limit: 200 } }) for await (const lineItem of lineItems.each()) { console.log(lineItem.id) } - lang: Python source: | try: - line_items = client.list_invoice_line_items(invoice_id, limit=200).items() + params = {"limit": 200} + line_items = client.list_invoice_line_items(invoice_id, params=params).items() for item in line_items: - print("Invoice Line Items %s" % item.id) + print("Invoice Line Items %s" % item.id) except recurly.errors.NotFoundError: # If the resource was not found, you may want to alert the user or # just return nil print("Resource Not Found") - lang: ".NET" @@ -8762,13 +8533,16 @@ { Console.WriteLine(lineItem.Id); } - lang: Ruby source: | + params = { + limit: 200 + } line_items = @client.list_invoice_line_items( invoice_id: invoice_id, - limit: 200 + params: params ) line_items.each do |line_item| puts "Line Item: #{line_item.id}" end - lang: Java @@ -8780,30 +8554,36 @@ for (LineItem lineItem : lineItems) { System.out.println(lineItem.getId()); } - lang: PHP source: | - $params = ['limit' => 200]; - $invoice_line_items = $client->listInvoiceLineItems($invoice_id, $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $invoice_line_items = $client->listInvoiceLineItems($invoice_id, $options); foreach($invoice_line_items as $line_item) { echo 'Invoice Line Item: ' . $line_item->getId() . PHP_EOL; } - lang: Go - source: "listParams := &recurly.ListInvoiceLineItemsParams{\n\tSort: recurly.String(\"created_at\"),\n}\nlineItems - := client.ListInvoiceLineItems(invoiceID, listParams)\n\nfor lineItems.HasMore + source: "listParams := &recurly.ListInvoiceLineItemsParams{\n\tSort: recurly.String(\"created_at\"),\n}\nlineItems, + err := client.ListInvoiceLineItems(invoiceID, listParams)\nif err != nil + {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor lineItems.HasMore() {\n\terr := lineItems.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, lineItem := range - lineItems.Data {\n\t\tfmt.Printf(\"Invoice Line Item %3d: %s\\n\",\n\t\t\ti,\n\t\t\tlineItem.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/invoices/{invoice_id}/coupon_redemptions": + lineItems.Data() {\n\t\tfmt.Printf(\"Invoice Line Item %3d: %s\\n\",\n\t\t\ti,\n\t\t\tlineItem.Id,\n\t\t)\n\t}\n}" + "/invoices/{invoice_id}/coupon_redemptions": get: tags: + - invoice - coupon_redemption operationId: list_invoice_coupon_redemptions - summary: List the coupon redemptions applied to an invoice - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + summary: Show the coupon redemptions applied to an invoice + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/invoice_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/sort_dates" @@ -8829,37 +8609,36 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const redemptions = client.listInvoiceCouponRedemptions(invoiceId, { limit: 200 }) + const redemptions = client.listInvoiceCouponRedemptions(invoiceId, { params: { limit: 200 } }) for await (const redemption of redemptions.each()) { console.log(redemption.id) } - lang: Python source: | - try: - redemptions = client.list_invoice_coupon_redemptions(invoice_id, limit=200).items() - for redemption in redemptions: - print("Invoice Coupon Redemption %s" % redemption) - except recurly.errors.NotFoundError: - # If the resource was not found, you may want to alert the user or - # just return nil - print("Resource Not Found") + params = {"limit": 200} + redemptions = client.list_invoice_coupon_redemptions(invoice_id, params=params).items() + for redemption in redemptions: + print("Invoice Coupon Redemption %s" % redemption) - lang: ".NET" source: | var couponRedemptions = client.ListInvoiceCouponRedemptions(invoiceId); foreach(CouponRedemption redemption in couponRedemptions) { Console.WriteLine(redemption.Id); } - lang: Ruby source: | + params = { + limit: 200 + } coupon_redemptions = @client.list_invoice_coupon_redemptions( invoice_id: invoice_id, - limit: 200 + params: params ) coupon_redemptions.each do |redemption| puts "CouponRedemption: #{redemption.id}" end - lang: Java @@ -8871,35 +8650,40 @@ for (CouponRedemption redemption : redemptions) { System.out.println(redemption.getId()); } - lang: PHP source: | - $params = ['limit' => 200]; - $invoice_coupon_redemptions = $client->listInvoiceCouponRedemptions($invoice_id, $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $invoice_coupon_redemptions = $client->listInvoiceCouponRedemptions($invoice_id, $options); foreach($invoice_coupon_redemptions as $redemption) { echo 'Invoice Coupon Redemption: ' . $redemption->getId() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListInvoiceCouponRedemptionsParams{\n\tSort: - recurly.String(\"created_at\"),\n}\nredemptions := client.ListInvoiceCouponRedemptions(invoiceID, - listParams)\n\nfor redemptions.HasMore {\n\terr := redemptions.Fetch()\n\tif - e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve - next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, redemption := range redemptions.Data - {\n\t\tfmt.Printf(\"Invoice Coupon Redemption %3d: %s\\n\",\n\t\t\ti,\n\t\t\tredemption.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/invoices/{invoice_id}/related_invoices": + recurly.String(\"created_at\"),\n}\nredemptions, err := client.ListInvoiceCouponRedemptions(invoiceID, + listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor + redemptions.HasMore() {\n\terr := redemptions.Fetch()\n\tif e, ok := err.(*recurly.Error); + ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor + i, redemption := range redemptions.Data() {\n\t\tfmt.Printf(\"Invoice Coupon + Redemption %3d: %s\\n\",\n\t\t\ti,\n\t\t\tredemption.Id,\n\t\t)\n\t}\n}" + "/invoices/{invoice_id}/related_invoices": get: tags: - invoice operationId: list_related_invoices summary: List an invoice's related credit or charge invoices description: | Related invoices provide a link between credit invoices and the charge invoices that they are refunding. For a charge invoice the related invoices will be credit invoices. For a credit invoice the related invoices will be charge invoices. - See the [Pagination Guide](/developers/guides/pagination.html) to learn how to use pagination in the API and Client Libraries. + See the [Pagination Guide](/guides/pagination.html) to learn how to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/invoice_id" responses: '200': @@ -8922,21 +8706,22 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const invoices = client.listRelatedInvoices(invoiceId, { limit: 200 }) + const invoices = client.listRelatedInvoices(invoiceId, { params: { limit: 200 } }) for await (const invoice of invoices.each()) { console.log(invoice.number) } - lang: Python source: | try: - related_invoices = client.list_related_invoices(invoice_id, limit=200).items() + params = {"limit": 200} + related_invoices = client.list_related_invoices(invoice_id, params=params).items() for invoice in related_invoices: - print("Related invoice %s" % invoice.id) + print("Related invoice %s" % invoice.id) except recurly.errors.NotFoundError: # If the resource was not found, you may want to alert the user or # just return nil print("Resource Not Found") - lang: ".NET" @@ -8946,13 +8731,16 @@ { Console.WriteLine(invoice.Number); } - lang: Ruby source: | + params = { + limit: 200 + } invoices = @client.list_related_invoices( invoice_id: invoice_id, - limit: 200 + params: params ) invoices.each do |invoice| puts "Invoice: #{invoice.number}" end - lang: Java @@ -8968,15 +8756,17 @@ foreach($related_invoices as $invoice) { echo 'Related Invoice: ' . $invoice->getId() . PHP_EOL; } - lang: Go - source: "invoices := client.ListRelatedInvoices(invoiceID)\n\nfor invoices.HasMore - {\n\terr := invoices.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed - to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, invoice := range - invoices.Data {\n\t\tfmt.Printf(\"Related Invoice %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tinvoice.Id,\n\t\t\tinvoice.Number,\n\t\t)\n\t}\n}" - "/sites/{site_id}/invoices/{invoice_id}/refund": + source: "invoices, err := client.ListRelatedInvoices(invoiceID)\nif err != + nil {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor + invoices.HasMore() {\n\terr := invoices.Fetch()\n\tif e, ok := err.(*recurly.Error); + ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor + i, invoice := range invoices.Data() {\n\t\tfmt.Printf(\"Related Invoice + %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tinvoice.Id,\n\t\t\tinvoice.Number,\n\t\t)\n\t}\n}" + "/invoices/{invoice_id}/refund": post: tags: - invoice operationId: refund_invoice summary: Refund an invoice @@ -9059,11 +8849,11 @@ source: | try { var refundReq = new InvoiceRefund() { CreditCustomerNotes = "Notes on credits", - Type = "amount", // could also be "line_items" + Type = InvoiceRefundType.Amount, // could also be "line_items" Amount = 100 }; Invoice invoice = client.RefundInvoice(invoiceId, refundReq); Console.WriteLine($"Refunded Invoice #{invoice.Number}"); } @@ -9098,11 +8888,11 @@ - lang: Java source: | try { final InvoiceRefund invoiceRefund = new InvoiceRefund(); invoiceRefund.setCreditCustomerNotes("Notes on credits"); - invoiceRefund.setType("amount"); // could also be "line_items" + invoiceRefund.setType(Constants.InvoiceRefundType.AMOUNT); // could also be "line_items" invoiceRefund.setAmount(100f); final Invoice invoice = client.refundInvoice(invoiceId, invoiceRefund); System.out.println("Refunded invoice " + invoice.getNumber()); } catch (ValidationException e) { @@ -9139,18 +8929,18 @@ recurly.String(\"credit_card\"),\n\t},\n}\ninvoice, err := client.RefundInvoice(invoiceID, refundReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Refunded Invoice: %v\", invoice)" - "/sites/{site_id}/line_items": + "/line_items": get: tags: - line_item operationId: list_line_items summary: List a site's line items - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -9186,31 +8976,39 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const lineItems = client.listLineItems({ limit: 200 }) + const lineItems = client.listLineItems({ params: { limit: 200 } }) for await (const item of lineItems.each()) { console.log(`Item ${item.id} for ${item.amount}`) } - lang: Python source: | - line_items = client.list_line_items(limit=200).items() + params = {"limit": 200} + line_items = client.list_line_items(params=params).items() for line_item in line_items: print(line_item.id) - lang: ".NET" source: | - var lineItems = client.ListLineItems(limit: 200); + var optionalParams = new ListLineItemsParams() + { + Limit = 200 + }; + var lineItems = client.ListLineItems(optionalParams); foreach(LineItem item in lineItems) { Console.WriteLine($"Item {item.Uuid} for {item.Amount}"); } - lang: Ruby source: | - line_items = @client.list_line_items( + params = { limit: 200 + } + line_items = @client.list_line_items( + params: params ) line_items.each do |line_item| puts "LineItem: #{line_item.id}" end - lang: Java @@ -9222,23 +9020,29 @@ for (LineItem lineItem : lineItems) { System.out.println("Item " + lineItem.getUuid() + " for " + lineItem.getAmount()); } - lang: PHP source: | - $params = ['limit' => 200]; - $line_items = $client->listLineItems($params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $line_items = $client->listLineItems($options); foreach($line_items as $line_item) { echo 'Line item: ' . $line_item->getId() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListLineItemsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nlineItems := client.ListLineItems(listParams)\n\nfor - lineItems.HasMore {\n\terr := lineItems.Fetch()\n\tif e, ok := err.(*recurly.Error); - ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, lineItem := range lineItems.Data {\n\t\tfmt.Printf(\"Line Item %3d: %s\\n\",\n\t\t\ti,\n\t\t\tlineItem.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/line_items/{line_item_id}": + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nlineItems, err + := client.ListLineItems(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor lineItems.HasMore() {\n\terr := lineItems.Fetch()\n\tif + e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, lineItem := range lineItems.Data() + {\n\t\tfmt.Printf(\"Line Item %3d: %s\\n\",\n\t\t\ti,\n\t\t\tlineItem.Id,\n\t\t)\n\t}\n}" + "/line_items/{line_item_id}": get: tags: - line_item operationId: get_line_item summary: Fetch a line item @@ -9469,18 +9273,18 @@ source: "lineItem, err := client.RemoveLineItem(lineItemID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Removed Line Item: %v\", lineItem)" - "/sites/{site_id}/plans": + "/plans": get: tags: - plan operationId: list_plans summary: List a site's plans - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -9514,30 +9318,38 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const plans = client.listPlans({ limit: 200 }) + const plans = client.listPlans({ params: { limit: 200 } }) for await (const plan of plans.each()) { console.log(plan.code) } - lang: Python source: | - plans = client.list_plans(limit=200).items() + params = {"limit": 200} + plans = client.list_plans(params=params).items() for plan in plans: print(plan.code) - lang: ".NET" source: | - var plans = client.ListPlans(limit: 200); + var optionalParams = new ListPlansParams() + { + Limit = 200 + }; + var plans = client.ListPlans(optionalParams); foreach(Plan plan in plans) { Console.WriteLine(plan.Code); } - lang: Ruby source: | - plans = @client.list_plans(limit: 200) + params = { + limit: 200 + } + plans = @client.list_plans(params: params) plans.each do |plan| puts "Plan: #{plan.code}" end - lang: Java source: | @@ -9548,22 +9360,28 @@ for (Plan plan : plans) { System.out.println(plan.getCode()); } - lang: PHP source: | - $params = ['limit' => 200]; - $plans = $client->listPlans($params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $plans = $client->listPlans($options); foreach($plans as $plan) { echo 'Plan: ' . $plan->getCode() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListPlansParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nplans := client.ListPlans(listParams)\n\nfor - plans.HasMore {\n\terr := plans.Fetch()\n\tif e, ok := err.(*recurly.Error); - ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, plan := range plans.Data {\n\t\tfmt.Printf(\"Plan %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tplan.Id,\n\t\t\tplan.Code,\n\t\t)\n\t}\n}" + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nplans, err := + client.ListPlans(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor plans.HasMore() {\n\terr := plans.Fetch()\n\tif + e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, plan := range plans.Data() + {\n\t\tfmt.Printf(\"Plan %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tplan.Id,\n\t\t\tplan.Code,\n\t\t)\n\t}\n}" post: tags: - plan operationId: create_plan summary: Create a plan @@ -9758,11 +9576,11 @@ err := client.CreatePlan(planReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Created Plan: %v\", plan.Id)" - "/sites/{site_id}/plans/{plan_id}": + "/plans/{plan_id}": get: tags: - plan operationId: get_plan summary: Fetch a plan @@ -10130,18 +9948,19 @@ source: "plan, err := client.RemovePlan(planID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Removed Plan: %s\", plan.Id)" - "/sites/{site_id}/plans/{plan_id}/add_ons": + "/plans/{plan_id}/add_ons": get: tags: - add-on + - plan operationId: list_plan_add_ons summary: List a plan's add-ons - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/plan_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" @@ -10176,18 +9995,19 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const addOns = client.listPlanAddOns(planId, { limit: 200 }) + const addOns = client.listPlanAddOns(planId, { params: { limit: 200 } }) for await (const addOn of addOns.each()) { console.log(addOn.code) } - lang: Python source: | - add_ons = client.list_plan_add_ons(plan_id).items() + params = {"limit": 200} + add_ons = client.list_plan_add_ons(plan_id, params=params).items() for add_on in add_ons: print(add_on.code) - lang: ".NET" source: | var addOns = client.ListPlanAddOns(planId); @@ -10195,13 +10015,16 @@ { Console.WriteLine(addOn.Code); } - lang: Ruby source: | + params = { + limit: 200 + } add_ons = @client.list_plan_add_ons( plan_id: plan_id, - limit: 200 + params: params ) add_ons.each do |add_on| puts "AddOn: #{add_on.code}" end - lang: Java @@ -10213,26 +10036,32 @@ for (AddOn addOn : addOns) { System.out.println(addOn.getCode()); } - lang: PHP source: | - $params = ['limit' => 200]; - $plan_add_ons = $client->listPlanAddOns($plan_id, $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $plan_add_ons = $client->listPlanAddOns($plan_id, $options); foreach($plan_add_ons as $add_on) { echo 'Plan add-on: ' . $add_on->getCode() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListPlanAddOnsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naddOns := client.ListPlanAddOns(planID, - listParams)\n\nfor addOns.HasMore {\n\terr := addOns.Fetch()\n\tif e, ok - := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next - page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, addOn := range addOns.Data {\n\t\tfmt.Printf(\"Add-On - %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\taddOn.Id,\n\t\t\taddOn.Code,\n\t\t)\n\t}\n}" + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naddOns, err := + client.ListPlanAddOns(planID, listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor addOns.HasMore() {\n\terr := addOns.Fetch()\n\tif + e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, addOn := range addOns.Data() + {\n\t\tfmt.Printf(\"Add-On %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\taddOn.Id,\n\t\t\taddOn.Code,\n\t\t)\n\t}\n}" post: tags: - add-on + - plan operationId: create_plan_add_on summary: Create an add-on parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/plan_id" @@ -10423,13 +10252,14 @@ err := client.CreatePlanAddOn(planID, addOnReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Created Plan Add-On: %v\", planAddOn.Id)" - "/sites/{site_id}/plans/{plan_id}/add_ons/{add_on_id}": + "/plans/{plan_id}/add_ons/{add_on_id}": get: tags: + - plan - add-on operationId: get_plan_add_on summary: Fetch a plan's add-on parameters: - "$ref": "#/components/parameters/site_id" @@ -10545,10 +10375,11 @@ {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched Plan Add-On: %v\", planAddOn)" put: tags: + - plan - add-on operationId: update_plan_add_on summary: Update an add-on parameters: - "$ref": "#/components/parameters/site_id" @@ -10688,10 +10519,11 @@ {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Updated Plan Add-On: %v\", planAddOn)" delete: tags: + - plan - add-on operationId: remove_plan_add_on summary: Remove an add-on parameters: - "$ref": "#/components/parameters/site_id" @@ -10792,18 +10624,18 @@ source: "planAddOn, err := client.RemovePlanAddOn(planID, planAddOnID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Removed Plan Add-On: %v\", planAddOn)" - "/sites/{site_id}/add_ons": + "/add_ons": get: tags: - add-on operationId: list_add_ons summary: List a site's add-ons - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -10837,18 +10669,19 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const addOns = client.listAddOns({ limit: 200 }) + const addOns = client.listAddOns({ params: { limit: 200 } }) for await (const addOn of addOns.each()) { console.log(addOn.code) } - lang: Python source: | - add_ons = client.list_add_ons().items() + params = {"limit": 200} + add_ons = client.list_add_ons(params=params).items() for add_on in add_ons: print("Add-On %s" % add_on.code) - lang: ".NET" source: | var addOns = client.ListAddOns(); @@ -10856,12 +10689,15 @@ { Console.WriteLine(addOn.Code); } - lang: Ruby source: | - add_ons = @client.list_add_ons( + params = { limit: 200 + } + add_ons = @client.list_add_ons( + params: params ) add_ons.each do |add_on| puts "AddOn: #{add_on.code}" end - lang: Java @@ -10873,23 +10709,29 @@ for (AddOn addOn : addOns) { System.out.println(addOn.getCode()); } - lang: PHP source: | - $params = ['limit' => 200]; - $add_ons = $client->listAddOns($params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $add_ons = $client->listAddOns($options); foreach($add_ons as $addon) { echo 'Add-on: ' . $addon->getCode() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListAddOnsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naddOns := client.ListAddOns(listParams)\n\nfor - addOns.HasMore {\n\terr := addOns.Fetch()\n\tif e, ok := err.(*recurly.Error); - ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, addOn := range addOns.Data {\n\t\tfmt.Printf(\"Add On %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\taddOn.Id,\n\t\t\taddOn.Code,\n\t\t)\n\t}\n}" - "/sites/{site_id}/add_ons/{add_on_id}": + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\naddOns, err := + client.ListAddOns(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor addOns.HasMore() {\n\terr := addOns.Fetch()\n\tif + e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, addOn := range addOns.Data() + {\n\t\tfmt.Printf(\"Add On %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\taddOn.Id,\n\t\t\taddOn.Code,\n\t\t)\n\t}\n}" + "/add_ons/{add_on_id}": get: tags: - add-on operationId: get_add_on summary: Fetch an add-on @@ -11002,18 +10844,18 @@ source: "addOn, err := client.GetAddOn(planAddOnID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Fetched Add-On: %s\", addOn.Id)" - "/sites/{site_id}/shipping_methods": + "/shipping_methods": get: tags: - shipping_method operationId: list_shipping_methods summary: List a site's shipping methods - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -11046,31 +10888,35 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const methods = client.listShippingMethods({ limit: 200 }) + const methods = client.listShippingMethods({ params: { limit: 200 } }) for await (const method of methods.each()) { console.log(method.code) } - lang: Python source: | - shipping_methods = client.list_shipping_methods(limit=200).items() + params = {"limit": 200} + shipping_methods = client.list_shipping_methods(params=params).items() for shipping_method in shipping_methods: - print("Shipping Method %s" % shipping_method.code) + print("Shipping Method %s" % shipping_method.code) - lang: ".NET" source: | var shippingMethods = client.ListShippingMethods(); foreach(ShippingMethod shippingMethod in shippingMethods) { Console.WriteLine(shippingMethod.Code); } - lang: Ruby source: | - shipping_methods = @client.list_shipping_methods( + params = { limit: 200 + } + shipping_methods = @client.list_shipping_methods( + params: params ) shipping_methods.each do |shipping_method| puts "Shipping Method: #{shipping_method.code}" end - lang: Java @@ -11082,24 +10928,28 @@ for (ShippingMethod shippingMethod : shippingMethods) { System.out.println(shippingMethod.getCode()); } - lang: PHP source: | - $params = ['limit' => 200]; - $shipping_methods = $client->listShippingMethods($params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $shipping_methods = $client->listShippingMethods($options); foreach($shipping_methods as $shipping_method) { echo 'Shipping Method: ' . $shipping_method->getCode() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListShippingMethodsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nshippingMethods - := client.ListShippingMethods(listParams)\n\nfor shippingMethods.HasMore - {\n\terr := shippingMethods.Fetch()\n\tif e, ok := err.(*recurly.Error); - ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, method := range shippingMethods.Data {\n\t\tfmt.Printf(\"Shipping Method - %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tmethod.Id,\n\t\t\tmethod.Code,\n\t\t)\n\t}\n}" + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nshippingMethods, + err := client.ListShippingMethods(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor shippingMethods.HasMore() {\n\terr + := shippingMethods.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed + to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, method := range + shippingMethods.Data() {\n\t\tfmt.Printf(\"Shipping Method %3d: %s, %s\\n\",\n\t\t\ti,\n\t\t\tmethod.Id,\n\t\t\tmethod.Code,\n\t\t)\n\t}\n}" post: tags: - shipping_method operationId: create_shipping_method summary: Create a new shipping method @@ -11141,25 +10991,19 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/shipping_methods/{id}": + "/shipping_methods/{shipping_method_id}": get: tags: - shipping_method operationId: get_shipping_method summary: Fetch a shipping method parameters: - "$ref": "#/components/parameters/site_id" - - name: id - in: path - description: Shipping Method ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. - For code use prefix `code-`, e.g. `code-usps_2-day`. - required: true - schema: - type: string + - "$ref": "#/components/parameters/shipping_method_id" responses: '200': description: A shipping method. content: application/json: @@ -11176,11 +11020,10 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/shipping_methods/{shipping_method_id}": put: tags: - shipping_method operationId: update_shipping_method summary: Update an active Shipping Method @@ -11253,18 +11096,18 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/subscriptions": + "/subscriptions": get: tags: - subscription operationId: list_subscriptions summary: List a site's subscriptions - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -11298,30 +11141,38 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const subscriptions = client.listSubscriptions({ limit: 200 }) + const subscriptions = client.listSubscriptions({ params: { limit: 200 } }) for await (const subscription of subscriptions.each()) { console.log(subscription.uuid) } - lang: Python source: | - subscriptions = client.list_subscriptions(limit=200).items() + params = {"limit": 200} + subscriptions = client.list_subscriptions(params=params).items() for subscription in subscriptions: print(subscription.uuid) - lang: ".NET" source: | - var subscriptions = client.ListSubscriptions(limit: 200); + var optionalParams = new ListSubscriptionsParams() + { + Limit = 200 + }; + var subscriptions = client.ListSubscriptions(optionalParams); foreach(Subscription subscription in subscriptions) { Console.WriteLine(subscription.Uuid); } - lang: Ruby source: | - subscriptions = @client.list_subscriptions(limit: 200) + params = { + limit: 200 + } + subscriptions = @client.list_subscriptions(params: params) subscriptions.each do |subscription| puts "Subscription: #{subscription.uuid}" end - lang: Java source: | @@ -11332,23 +11183,28 @@ for (Subscription subscription : subscriptions) { System.out.println(subscription.getUuid()); } - lang: PHP source: | - $params = ['limit' => 200]; - $subscriptions = $client->listSubscriptions($params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $subscriptions = $client->listSubscriptions($options); foreach($subscriptions as $sub) { echo 'Subscription: ' . $sub->getUuid() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListSubscriptionsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nsubscriptions - := client.ListSubscriptions(listParams)\n\nfor subscriptions.HasMore {\n\terr - := subscriptions.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nsubscriptions, + err := client.ListSubscriptions(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor subscriptions.HasMore() {\n\terr := + subscriptions.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, subscription := - range subscriptions.Data {\n\t\tfmt.Printf(\"Subscription %3d: %s\\n\",\n\t\t\ti,\n\t\t\tsubscription.Id,\n\t\t)\n\t}\n}" + range subscriptions.Data() {\n\t\tfmt.Printf(\"Subscription %3d: %s\\n\",\n\t\t\ti,\n\t\t\tsubscription.Id,\n\t\t)\n\t}\n}" post: tags: - subscription operationId: create_subscription summary: Create a new subscription @@ -11456,11 +11312,12 @@ source: | begin subscription_create = { plan_code: plan_code, currency: "USD", - # This can be an existing account or a new account + # This can be an existing account or + # a new acocunt account: { code: account_code, } } subscription = @client.create_subscription( @@ -11523,11 +11380,11 @@ recurly.String(\"USD\"),\n}\n\nsubscription, err := client.CreateSubscription(subReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Created Subscription: %s\", subscription.Id)" - "/sites/{site_id}/subscriptions/{subscription_id}": + "/subscriptions/{subscription_id}": get: tags: - subscription operationId: get_subscription summary: Fetch a subscription @@ -11645,12 +11502,12 @@ Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched Subscription: %s\", sub.Id)" put: tags: - subscription - operationId: modify_subscription - summary: Modify a subscription + operationId: update_subscription + summary: Update a subscription description: This only lets you change the subscription settings that have no impact on the billed amount. Use the [Create Subscription Change](#operation/create_subscription_change) endpoint to make those changes. parameters: - "$ref": "#/components/parameters/site_id" @@ -11680,11 +11537,11 @@ try { const update = { termsAndConditions: "Some new terms and conditions", customerNotes: "Some new customer notes" } - const subscription = await client.modifySubscription(subscriptionId, update) + const subscription = await client.updateSubscription(subscriptionId, update) console.log('Modified subscription: ', subscription.uuid) } catch(err) { if (err instanceof recurly.errors.ValidationError) { // If the request was not valid, you may want to tell your user @@ -11698,11 +11555,11 @@ } - lang: Python source: | try: sub_update = {"customer_notes": "New Notes", "terms_and_conditions": "New TaC"} - subscription = client.modify_subscription(subscription_id, sub_update) + subscription = client.update_subscription(subscription_id, sub_update) print("Modified Subscription %s" % subscription) except recurly.errors.ValidationError as e: # If the request was invalid, you may want to tell your user # why. You can find the invalid params and reasons in e.error.params print("ValidationError: %s" % e.error.message) @@ -11714,11 +11571,11 @@ var updateReq = new SubscriptionUpdate() { TermsAndConditions = "Some New Terms and Conditions", CustomerNotes = "Some New Customer Notes" }; - Subscription subscription = client.ModifySubscription(subscriptionId, updateReq); + Subscription subscription = client.UpdateSubscription(subscriptionId, updateReq); Console.WriteLine($"Modified Subscription {subscription.Uuid}"); } catch (Recurly.Errors.Validation ex) { // If the request was not valid, you may want to tell your user @@ -11735,11 +11592,11 @@ begin subscription_update = { customer_notes: "New Notes", terms_and_conditions: "New ToC" } - subscription = @client.modify_subscription( + subscription = @client.update_subscription( subscription_id: subscription_id, body: subscription_update ) puts "Modified Subscription #{subscription}" rescue Recurly::Errors::ValidationError => e @@ -11751,11 +11608,11 @@ source: | try { final SubscriptionUpdate subUpdate = new SubscriptionUpdate(); subUpdate.setTermsAndConditions("Some new terms and conditions"); subUpdate.setCustomerNotes("Some new customer notes"); - final Subscription subscription = client.modifySubscription(subscriptionId, subUpdate); + final Subscription subscription = client.updateSubscription(subscriptionId, subUpdate); System.out.println("Modified Subscription: " + subscription.getUuid()); } catch (ValidationException e) { // If the request was not valid, you may want to tell your user // why. You can find the invalid params and reasons in e.getError().getParams() System.out.println("Failed validation: " + e.getError().getMessage()); @@ -11769,11 +11626,11 @@ $changes = [ "terms_and_conditions" => "Some new terms and conditions", "customer_notes" => "Some new customer notes" ]; - $subscription = $client->modifySubscription($subscription_id, $changes); + $subscription = $client->updateSubscription($subscription_id, $changes); echo 'Modified Subscription:' . PHP_EOL; var_dump($subscription); } catch (\Recurly\Errors\Validation $e) { // If the request was not valid, you may want to tell your user @@ -11785,11 +11642,11 @@ var_dump($e); } - lang: Go source: "updateReq := &recurly.SubscriptionUpdate{\n\tTermsAndConditions: recurly.String(\"Some new terms and conditions\"),\n\tCustomerNotes: recurly.String(\"Some - new customer notes\"),\n}\nsub, err := client.ModifySubscription(subID, + new customer notes\"),\n}\nsub, err := client.UpdateSubscription(subID, updateReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Modified Subscription: %s\", sub.Id)" delete: @@ -11815,16 +11672,12 @@ In the event that the most recent invoice is a $0 invoice paid entirely by credit, Recurly will apply the credit back to the customer’s account. You may also terminate a subscription with no refund and then manually refund specific invoices. schema: - type: string - enum: - - full - - partial - - none default: none + "$ref": "#/components/schemas/RefundTypeEnum" - name: charge in: query description: Applicable only if the subscription has usage based add-ons and unbilled usage logged for the current billing cycle. If true, current billing cycle unbilled usage is billed on the final invoice. If false, Recurly will @@ -11887,11 +11740,15 @@ print("Resource Not Found") - lang: ".NET" source: | try { - Subscription subscription = client.TerminateSubscription(subscriptionId); + var optionalParams = new TerminateSubscriptionParams() + { + Refund = RefundType.None + }; + Subscription subscription = client.TerminateSubscription(subscriptionId, optionalParams); Console.WriteLine($"Terminated Subscription {subscription.Uuid}"); } catch (Recurly.Errors.Validation ex) { // If the request was not valid, you may want to tell your user @@ -11917,11 +11774,11 @@ end - lang: Java source: | try { QueryParams queryParams = new QueryParams(); - queryParams.setRefund("none"); // "full" for a full refund, "partial" for prorated refund + queryParams.setRefund(Constants.RefundType.NONE); // "full" for a full refund, "partial" for prorated refund client.terminateSubscription(subscriptionId, queryParams); System.out.println("Terminated Subscription: " + subscriptionId); } catch (ValidationException e) { // If the request was not valid, you may want to tell your user // why. You can find the invalid params and reasons in e.getError().getParams() @@ -11951,11 +11808,11 @@ err := client.TerminateSubscription(subID, terminateParams)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Terminated Subscription: %v\", subscription)" - "/sites/{site_id}/subscriptions/{subscription_id}/cancel": + "/subscriptions/{subscription_id}/cancel": put: tags: - subscription operationId: cancel_subscription summary: Cancel a subscription @@ -12089,11 +11946,11 @@ recurly.String(\"bill_date\"),\n\t},\n}\n\nsubscription, err := client.CancelSubscription(subID, cancelParams)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Canceled Subscription: %s\", subscription.Id)" - "/sites/{site_id}/subscriptions/{subscription_id}/reactivate": + "/subscriptions/{subscription_id}/reactivate": put: tags: - subscription operationId: reactivate_subscription summary: Reactivate a canceled subscription @@ -12220,11 +12077,11 @@ source: "sub, err := client.ReactivateSubscription(subID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Reactivated Subscription: %s\", sub.Id)" - "/sites/{site_id}/subscriptions/{subscription_id}/pause": + "/subscriptions/{subscription_id}/pause": put: tags: - subscription operationId: pause_subscription summary: Pause subscription @@ -12375,11 +12232,11 @@ recurly.Int(1),\n}\nsub, err := client.PauseSubscription(subID, pauseReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Paused Subscription: %s\", sub.Id)" - "/sites/{site_id}/subscriptions/{subscription_id}/resume": + "/subscriptions/{subscription_id}/resume": put: tags: - subscription operationId: resume_subscription summary: Resume subscription @@ -12507,11 +12364,11 @@ source: "sub, err := client.ResumeSubscription(subID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Resumed Subscription: %s\", sub.Id)" - "/sites/{site_id}/subscriptions/{subscription_id}/convert_trial": + "/subscriptions/{subscription_id}/convert_trial": put: tags: - subscription operationId: convert_trial summary: Convert trial subscription @@ -12548,50 +12405,14 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/subscriptions/{subscription_id}/preview_renewal": + "/subscriptions/{subscription_id}/change": get: tags: - subscription - operationId: get_preview_renewal - summary: Fetch a preview of a subscription's renewal invoice(s) - description: The subscriptions's renewal invoice(s) will be returned if they - exist; if they don't (for example, if the subscription is not set to renew), - it will return an result with no invoices. - parameters: - - "$ref": "#/components/parameters/subscription_id" - responses: - '200': - description: A preview of the subscription's renewal invoice(s). - content: - application/json: - schema: - "$ref": "#/components/schemas/InvoiceCollection" - '400': - description: Invalid or unpermitted parameter. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - '404': - description: Incorrect site ID or subscription ID. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - default: - description: Unexpected error. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - x-code-samples: [] - "/sites/{site_id}/subscriptions/{subscription_id}/change": - get: - tags: - subscription_change operationId: get_subscription_change summary: Fetch a subscription's pending change parameters: - "$ref": "#/components/parameters/site_id" @@ -12719,23 +12540,15 @@ {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched subscription change: %s\", subscriptionChange.Id)" post: tags: + - subscription - subscription_change operationId: create_subscription_change summary: Create a new subscription change - description: | - Calling this will overwrite an existing, pending subscription change. - - If a subscription has a pending change, and a change is submitted which matches - the subscription as it currently exists, the pending change will be deleted, - and you will receive a 204 No Content response. - - If a subscription has no pending - change, and a change is submitted which matches the subscription as it currently - exists, a 422 Unprocessable Entity validation error will be returned. + description: Calling this will overwrite an existing, pending subscription change. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/subscription_id" requestBody: content: @@ -12748,12 +12561,10 @@ description: A subscription change. content: application/json: schema: "$ref": "#/components/schemas/SubscriptionChange" - '204': - description: The previous pending change was reverted. '404': description: Incorrect site ID. content: application/json: schema: @@ -12809,11 +12620,11 @@ try { var changeReq = new SubscriptionChangeCreate() { PlanCode = newPlanCode, - Timeframe = "now" // choose "now" or "renewal" + Timeframe = ChangeTimeframe.Now // choose "now" or "renewal" }; SubscriptionChange change = client.CreateSubscriptionChange(subscriptionId, changeReq); Console.WriteLine($"Created subscription change {change.Id}"); } catch (Recurly.Errors.Validation ex) @@ -12848,11 +12659,11 @@ source: | try { SubscriptionChangeCreate changeCreate = new SubscriptionChangeCreate(); changeCreate.setPlanCode(newPlanCode); - changeCreate.setTimeframe("now"); // choose "now" or "renewal" + changeCreate.setTimeframe(Constants.ChangeTimeframe.NOW); // choose "now" or "renewal" SubscriptionChange change = client.createSubscriptionChange(subscriptionId, changeCreate); System.out.println("Created subscription " + change.getId()); } catch (ValidationException e) { // If the request was not valid, you may want to tell your user @@ -12889,10 +12700,11 @@ {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Subscription changed: %s\", subscriptionChange.Id)" delete: tags: + - subscription - subscription_change operationId: remove_subscription_change summary: Delete the pending subscription change parameters: - "$ref": "#/components/parameters/site_id" @@ -13001,13 +12813,14 @@ source: "subscriptionChange, err := client.RemoveSubscriptionChange(subID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Removed Subscription Change: %v\", subscriptionChange)" - "/sites/{site_id}/subscriptions/{subscription_id}/change/preview": + "/subscriptions/{subscription_id}/change/preview": post: tags: + - subscription - subscription_change operationId: preview_subscription_change summary: Preview a new subscription change description: Calling this will not save the subscription change or overwrite an existing change. @@ -13024,11 +12837,11 @@ '200': description: A subscription change. content: application/json: schema: - "$ref": "#/components/schemas/SubscriptionChangePreview" + "$ref": "#/components/schemas/SubscriptionChange" '404': description: Incorrect site ID. content: application/json: schema: @@ -13045,18 +12858,19 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/subscriptions/{subscription_id}/invoices": + "/subscriptions/{subscription_id}/invoices": get: tags: - invoice + - subscription operationId: list_subscription_invoices summary: List a subscription's invoices - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/subscription_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" @@ -13091,18 +12905,19 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const invoices = client.listSubscriptionInvoices(subscriptionId, { limit: 200 }) + const invoices = client.listSubscriptionInvoices(subscriptionId, { params: { limit: 200 } }) for await (const invoice of invoices.each()) { console.log(invoice.number) } - lang: Python source: | - invoices = client.list_subscription_invoices(subscription_id).items() + params = {"limit": 200} + invoices = client.list_subscription_invoices(subscription_id, params=params).items() for invoice in invoices: print(invoice.number) - lang: ".NET" source: | var subscriptionInvoices = client.ListSubscriptionInvoices(subscriptionId); @@ -13110,13 +12925,16 @@ { Console.WriteLine(invoice.Number); } - lang: Ruby source: | + params = { + limit: 200 + } invoices = @client.list_subscription_invoices( subscription_id: subscription_id, - limit: 200 + params: params ) invoices.each do |invoice| puts "Invoice: #{invoice.number}" end - lang: Java @@ -13128,32 +12946,36 @@ for (Invoice invoice : invoices) { System.out.println(invoice.getNumber()); } - lang: PHP source: | - $params = ['limit' => 200]; - $subscription_invoices = $client->listSubscriptionInvoices($subscription_id, $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $subscription_invoices = $client->listSubscriptionInvoices($subscription_id, $options); foreach($subscription_invoices as $sub_invoice) { echo 'Subscription Invoice: ' . $sub_invoice->getNumber() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListSubscriptionInvoicesParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nsubInvoices := - client.ListSubscriptionInvoices(subID, listParams)\n\nfor subInvoices.HasMore - {\n\terr := subInvoices.Fetch()\n\tif e, ok := err.(*recurly.Error); ok - {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor - i, invoice := range subInvoices.Data {\n\t\tfmt.Printf(\"Subscription Invoice - %3d: %s\\n\",\n\t\t\ti,\n\t\t\tinvoice.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/subscriptions/{subscription_id}/line_items": + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\nsubInvoices, err + := client.ListSubscriptionInvoices(subID, listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor subInvoices.HasMore() {\n\terr := + subInvoices.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed + to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, invoice := range + subInvoices.Data() {\n\t\tfmt.Printf(\"Subscription Invoice %3d: %s\\n\",\n\t\t\ti,\n\t\t\tinvoice.Id,\n\t\t)\n\t}\n}" + "/subscriptions/{subscription_id}/line_items": get: tags: - - line_item + - subscription operationId: list_subscription_line_items summary: List a subscription's line items - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/subscription_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" @@ -13190,18 +13012,19 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const lineItems = client.listSubscriptionLineItems(subscriptionId, { limit: 200 }) + const lineItems = client.listSubscriptionLineItems(subscriptionId, { params: { limit: 200 } }) for await (const lineItem of lineItems.each()) { console.log(lineItem.id) } - lang: Python source: | - line_items = client.list_subscription_line_items(subscription_id).items() + params = {"limit": 200} + line_items = client.list_subscription_line_items(subscription_id, params=params).items() for line_item in line_items: print(line_item.id) - lang: ".NET" source: | var subscriptionLineItems = client.ListSubscriptionLineItems(subscriptionId); @@ -13209,13 +13032,16 @@ { Console.WriteLine(lineItem.Id); } - lang: Ruby source: | + params = { + limit: 200 + } line_items = @client.list_subscription_line_items( subscription_id: subscription_id, - limit: 200 + params: params ) line_items.each do |line_item| puts "LineItem: #{line_item.id}" end - lang: Java @@ -13227,32 +13053,38 @@ for (LineItem lineItem : lineItems) { System.out.println(lineItem.getId()); } - lang: PHP source: | - $params = ['limit' => 200]; - $subscription_line_items = $client->listSubscriptionLineItems($subscription_id, $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $subscription_line_items = $client->listSubscriptionLineItems($subscription_id, $options); foreach($subscription_line_items as $line_item) { echo 'Subscription Invoice: ' . $line_item->getId() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListSubscriptionLineItemsParams{\n\tSort: \ recurly.String(\"created_at\"),\n\tOrder: recurly.String(\"desc\"),\n\tLimit: - recurly.Int(200),\n}\nsubLineItems := client.ListSubscriptionLineItems(subID, - listParams)\n\nfor subLineItems.HasMore {\n\terr := subLineItems.Fetch()\n\tif - e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve - next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, lineItem := range subLineItems.Data - {\n\t\tfmt.Printf(\"Subscription Line Item %3d: %s\\n\",\n\t\t\ti,\n\t\t\tlineItem.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/subscriptions/{subscription_id}/coupon_redemptions": + recurly.Int(200),\n}\nsubLineItems, err := client.ListSubscriptionLineItems(subID, + listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor + subLineItems.HasMore() {\n\terr := subLineItems.Fetch()\n\tif e, ok := err.(*recurly.Error); + ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor + i, lineItem := range subLineItems.Data() {\n\t\tfmt.Printf(\"Subscription + Line Item %3d: %s\\n\",\n\t\t\ti,\n\t\t\tlineItem.Id,\n\t\t)\n\t}\n}" + "/subscriptions/{subscription_id}/coupon_redemptions": get: tags: + - subscription - coupon_redemption operationId: list_subscription_coupon_redemptions - summary: List the coupon redemptions for a subscription - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + summary: Show the coupon redemptions for a subscription + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/subscription_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/sort_dates" @@ -13278,18 +13110,21 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const redemptions = client.listSubscriptionCouponRedemptions(subscriptionId, { limit: 200 }) + const redemptions = client.listSubscriptionCouponRedemptions(subscriptionId, { params: { limit: 200 } }) for await (const redemption of redemptions.each()) { console.log(redemption.id) } - lang: Python source: | - redemptions = client.list_subscription_coupon_redemptions(subscription_id).items() + params = {"limit": 200} + redemptions = client.list_subscription_coupon_redemptions( + subscription_id, params=params + ).items() for redemption in redemptions: print(redemption.uuid) - lang: ".NET" source: | var subscriptionCouponRedemptions = client.ListSubscriptionCouponRedemptions(subscriptionId); @@ -13297,13 +13132,16 @@ { Console.WriteLine(redemption.Id); } - lang: Ruby source: | + params = { + limit: 200 + } coupon_redemptions = @client.list_subscription_coupon_redemptions( subscription_id: subscription_id, - limit: 200 + params: params ) coupon_redemptions.each do |redemption| puts "CouponRedemption: #{redemption.id}" end - lang: Java @@ -13315,26 +13153,33 @@ for (CouponRedemption redemption : redemptions) { System.out.println(redemption.getId()); } - lang: PHP source: | - $params = ['limit' => 200]; - $subscription_coupon_redemptions = $client->listSubscriptionCouponRedemptions($subscription_id, $params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $subscription_coupon_redemptions = $client->listSubscriptionCouponRedemptions($subscription_id, $options); foreach($subscription_coupon_redemptions as $redemption) { echo 'Subscription Coupon Redemption: ' . $redemption->getId() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListSubscriptionCouponRedemptionsParams{\n\tSort: - recurly.String(\"created_at\"),\n}\nsubCouponRedemptions := client.ListSubscriptionCouponRedemptions(subID, - listParams)\n\nfor subCouponRedemptions.HasMore {\n\terr := subCouponRedemptions.Fetch()\n\tif + recurly.String(\"created_at\"),\n}\nsubCouponRedemptions, err := client.ListSubscriptionCouponRedemptions(subID, + listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected error: %v\", err)\n\treturn\n}\n\nfor + subCouponRedemptions.HasMore() {\n\terr := subCouponRedemptions.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve - next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, redemption := range subCouponRedemptions.Data + next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, redemption := range subCouponRedemptions.Data() {\n\t\tfmt.Printf(\"Subscription Coupon Redemption %3d: %s\\n\",\n\t\t\ti,\n\t\t\tredemption.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/subscriptions/{subscription_id}/add_ons/{add_on_id}/usage": + "/subscriptions/{subscription_id}/add_ons/{add_on_id}/usage": get: tags: + - invoice + - subscription - usage operationId: list_usage summary: List a subscription add-on's usage records parameters: - "$ref": "#/components/parameters/site_id" @@ -13373,10 +13218,12 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: [] post: tags: + - invoice + - subscription - usage operationId: create_usage summary: Log a usage record on this subscription add-on parameters: - "$ref": "#/components/parameters/site_id" @@ -13418,13 +13265,15 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/usage/{usage_id}": + "/usage/{usage_id}": get: tags: + - invoice + - subscription - usage operationId: get_usage summary: Get a usage record parameters: - "$ref": "#/components/parameters/site_id" @@ -13455,10 +13304,12 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: [] put: tags: + - invoice + - subscription - usage operationId: update_usage summary: Update a usage record parameters: - "$ref": "#/components/parameters/site_id" @@ -13501,10 +13352,12 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: [] delete: tags: + - invoice + - subscription - usage operationId: remove_usage summary: Delete a usage record. parameters: - "$ref": "#/components/parameters/site_id" @@ -13535,18 +13388,18 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/transactions": + "/transactions": get: tags: - transaction operationId: list_transactions summary: List a site's transactions - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/ids" - "$ref": "#/components/parameters/limit" - "$ref": "#/components/parameters/order" @@ -13581,30 +13434,38 @@ schema: "$ref": "#/components/schemas/Error" x-code-samples: - lang: Node.js source: | - const transactions = client.listTransactions({ limit: 200 }) + const transactions = client.listTransactions({ params: { limit: 200 } }) for await (const transaction of transactions.each()) { console.log(transaction.uuid) } - lang: Python source: | - transactions = client.list_transactions(limit=200).items() + params = {"limit": 200} + transactions = client.list_transactions(params=params).items() for transaction in transactions: print(transaction.uuid) - lang: ".NET" source: | - var transactions = client.ListTransactions(limit: 200); + var optionalParams = new ListTransactionsParams() + { + Limit = 200 + }; + var transactions = client.ListTransactions(optionalParams); foreach(Transaction transaction in transactions) { Console.WriteLine(transaction.Uuid); } - lang: Ruby source: | - transactions = @client.list_transactions(limit: 200) + params = { + limit: 200 + } + transactions = @client.list_transactions(params: params) transactions.each do |transaction| puts "Transaction: #{transaction.uuid}" end - lang: Java source: | @@ -13615,24 +13476,29 @@ for (Transaction transaction : transactions) { System.out.println(transaction.getUuid()); } - lang: PHP source: | - $params = ['limit' => 200]; - $transactions = $client->listTransactions($params); + $options = [ + 'params' => [ + 'limit' => 200 + ] + ]; + $transactions = $client->listTransactions($options); foreach($transactions as $transaction) { echo 'Transaction: ' . $transaction->getUuid() . PHP_EOL; } - lang: Go source: "listParams := &recurly.ListTransactionsParams{\n\tSort: recurly.String(\"created_at\"),\n\tOrder: - recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\ntransactions := - client.ListTransactions(listParams)\n\nfor transactions.HasMore {\n\terr - := transactions.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed + recurly.String(\"desc\"),\n\tLimit: recurly.Int(200),\n}\ntransactions, + err := client.ListTransactions(listParams)\nif err != nil {\n\tfmt.Println(\"Unexpected + error: %v\", err)\n\treturn\n}\n\nfor transactions.HasMore() {\n\terr := + transactions.Fetch()\n\tif e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, transaction := - range transactions.Data {\n\t\tfmt.Printf(\"Transaction %3d: %s\\n\",\n\t\t\ti,\n\t\t\ttransaction.Id,\n\t\t)\n\t}\n}" - "/sites/{site_id}/transactions/{transaction_id}": + range transactions.Data() {\n\t\tfmt.Printf(\"Transaction %3d: %s\\n\",\n\t\t\ti,\n\t\t\ttransaction.Id,\n\t\t)\n\t}\n}" + "/transactions/{transaction_id}": get: tags: - transaction operationId: get_transaction summary: Fetch a transaction @@ -13745,11 +13611,11 @@ source: "transaction, err := client.GetTransaction(transactionID)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched Transaction: %v\", transaction.Id)" - "/sites/{site_id}/unique_coupon_codes/{unique_coupon_code_id}": + "/unique_coupon_codes/{unique_coupon_code_id}": parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/unique_coupon_code_id" get: tags: @@ -13807,11 +13673,11 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/unique_coupon_codes/{unique_coupon_code_id}/restore": + "/unique_coupon_codes/{unique_coupon_code_id}/restore": parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/unique_coupon_code_id" put: tags: @@ -13842,11 +13708,11 @@ content: application/json: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] - "/sites/{site_id}/purchases": + "/purchases": post: tags: - purchase operationId: create_purchase summary: Create a new purchase @@ -14076,11 +13942,11 @@ err := client.CreatePurchase(purchaseReq)\nif e, ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Created Purchase: %s\", collection.ChargeInvoice.Number)" - "/sites/{site_id}/purchases/preview": + "/purchases/preview": post: tags: - purchase operationId: preview_purchase summary: Preview a new purchase @@ -14302,21 +14168,16 @@ // If we don't know what to do with the err, we should // probably re-raise and let our web framework and logger handle it var_dump($e); } - lang: Go - source: "purchaseReq := &recurly.PurchaseCreate{\n\tCurrency: recurly.String(\"USD\"),\n\tAccount: - &recurly.AccountPurchase{\n\t\tCode: recurly.String(account.Code),\n\t},\n\tSubscriptions: - []recurly.SubscriptionPurchase{\n\t\t{\n\t\t\tPlanCode: recurly.String(plan.Code),\n\t\t\tNextBillDate: - recurly.Time(time.Date(2078, time.November, 10, 23, 0, 0, 0, time.UTC)),\n\t\t},\n\t},\n\tShipping: - &recurly.ShippingPurchase{\n\t\tAddressId: recurly.String(shippingAddressID),\n\t},\n}\ncollection, - err := client.PreviewPurchase(purchaseReq)\nif e, ok := err.(*recurly.Error); - ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed - validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected + source: "collection, err := client.PreviewPurchase(purchaseReq)\nif e, ok + := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation + {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Preview Charge Invoice %v\", collection.ChargeInvoice)" - "/sites/{site_id}/export_dates": + "/export_dates": parameters: - "$ref": "#/components/parameters/site_id" get: tags: - automated_exports @@ -14424,11 +14285,11 @@ - lang: Go source: "exportDates, err := client.GetExportDates()\nif e, ok := err.(*recurly.Error); ok {\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfor _, date := range exportDates.Dates {\n\tfmt.Println(\"Exports are available for: \", date)\n}" - "/sites/{site_id}/export_dates/{export_date}/export_files": + "/export_dates/{export_date}/export_files": parameters: - "$ref": "#/components/parameters/site_id" - "$ref": "#/components/parameters/export_date" get: tags: @@ -14537,113 +14398,10 @@ - lang: Go source: "exportFiles, err := client.GetExportFiles(exportDate)\nif e, ok := err.(*recurly.Error); ok {\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfor _, file := range exportFiles.Files {\n\tfmt.Println(\"Export file download URL: \", file.Href)\n}" - "/sites/{site_id}/dunning_campaigns": - get: - tags: - - dunning_campaigns - operationId: list_dunning_campaigns - summary: List the dunning campaigns for a site - description: See the [Pagination Guide](/developers/guides/pagination.html) - to learn how to use pagination in the API and Client Libraries. - parameters: - - "$ref": "#/components/parameters/sort_dates" - responses: - '200': - description: A list of the the dunning_campaigns on an account. - content: - application/json: - schema: - "$ref": "#/components/schemas/DunningCampaignList" - '404': - description: Incorrect site. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - default: - description: Unexpected error. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - x-code-samples: [] - "/dunning_campaigns/{dunning_campaign_id}": - parameters: - - "$ref": "#/components/parameters/dunning_campaign_id" - get: - tags: - - dunning_campaigns - operationId: get_dunning_campaign - summary: Fetch a dunning campaign - responses: - '200': - description: Settings for a dunning campaign. - content: - application/json: - schema: - "$ref": "#/components/schemas/DunningCampaign" - '400': - description: Bad request; perhaps missing or invalid parameters. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - '404': - description: Incorrect site or campaign ID. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - default: - description: Unexpected error. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - x-code-samples: [] - "/dunning_campaigns/{dunning_campaign_id}/bulk_update": - parameters: - - "$ref": "#/components/parameters/dunning_campaign_id" - put: - tags: - - dunning_campaigns - operationId: put_dunning_campaign_bulk_update - summary: Assign a dunning campaign to multiple plans - requestBody: - content: - application/json: - schema: - "$ref": "#/components/schemas/DunningCampaignsBulkUpdate" - responses: - '200': - description: A list of updated plans. - content: - application/json: - schema: - "$ref": "#/components/schemas/DunningCampaignsBulkUpdateResponse" - '400': - description: Bad request; perhaps missing or invalid parameters. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - '404': - description: Incorrect site or campaign ID. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - default: - description: Unexpected error. - content: - application/json: - schema: - "$ref": "#/components/schemas/Error" - x-code-samples: [] servers: - url: https://v3.recurly.com components: parameters: site_id: @@ -14671,12 +14429,11 @@ schema: type: string billing_info_id: name: billing_info_id in: path - description: Billing Info ID. Can ONLY be used for sites utilizing the Wallet - feature. + description: Billing Info ID. required: true schema: type: string usage_id: name: usage_id @@ -14784,17 +14541,10 @@ description: Unique Coupon Code ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-abc-8dh2-def`. required: true schema: type: string - dunning_campaign_id: - name: dunning_campaign_id - in: path - description: Dunning Campaign ID, e.g. `e28zov4fw0v2`. - required: true - schema: - type: string ids: name: ids in: query description: | Filter results by their IDs. Up to 200 IDs can be passed at once using @@ -14826,79 +14576,56 @@ order: name: order in: query description: Sort order. schema: - type: string - enum: - - asc - - desc default: desc + "$ref": "#/components/schemas/AlphanumericSortEnum" sort_dates: name: sort in: query description: | Sort field. You *really* only want to sort by `updated_at` in ascending order. In descending order updated records will move behind the cursor and could prevent some records from being returned. schema: - type: string - enum: - - created_at - - updated_at default: created_at + "$ref": "#/components/schemas/TimestampSortEnum" usage_sort_dates: name: sort in: query description: | Sort field. You *really* only want to sort by `usage_timestamp` in ascending order. In descending order updated records will move behind the cursor and could prevent some records from being returned. schema: type: string - default: usage_timestamp - enum: - - recorded_timestamp - - usage_timestamp + "$ref": "#/components/schemas/UsageSortEnum" billing_status: name: billing_status in: query description: Filter by usage record's billing status schema: type: string - default: unbilled - enum: - - unbilled - - billed - - all + "$ref": "#/components/schemas/BillingStatusEnum" filter_state: name: state in: query description: Filter by state. schema: - type: string - enum: - - active - - inactive + "$ref": "#/components/schemas/ActiveStateEnum" filter_subscription_state: name: state in: query description: | Filter by state. - When `state=active`, `state=canceled`, `state=expired`, or `state=future`, subscriptions with states that match the query and only those subscriptions will be returned. - When `state=in_trial`, only subscriptions that have a trial_started_at date earlier than now and a trial_ends_at date later than now will be returned. - When `state=live`, only subscriptions that are in an active, canceled, or future state or are in trial will be returned. schema: - type: string - enum: - - active - - canceled - - expired - - future - - in_trial - - live + "$ref": "#/components/schemas/FilterSubscriptionStateEnum" filter_begin_time: name: begin_time in: query description: | Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`. @@ -14952,77 +14679,53 @@ filter_account_past_due: name: past_due in: query description: Filter for accounts with an invoice in the `past_due` state. schema: - type: string - enum: - - true + "$ref": "#/components/schemas/TrueEnum" filter_line_item_original: name: original in: query description: Filter by original field. schema: - type: string - enum: - - true + "$ref": "#/components/schemas/TrueEnum" filter_line_item_state: name: state in: query description: Filter by state field. schema: - type: string - enum: - - invoiced - - pending + "$ref": "#/components/schemas/LineItemStateEnum" filter_line_item_type: name: type in: query description: Filter by type field. schema: - type: string - enum: - - charge - - credit + "$ref": "#/components/schemas/LineItemTypeEnum" filter_transaction_type: name: type in: query description: Filter by type field. The value `payment` will return both `purchase` and `capture` transactions. schema: - type: string - enum: - - verify - - authorization - - capture - - purchase - - refund - - payment + "$ref": "#/components/schemas/FilterTransactionTypeEnum" filter_transaction_success: name: success in: query description: Filter by success field. schema: - type: string - enum: - - true + "$ref": "#/components/schemas/TrueEnum" filter_invoice_type: name: type in: query description: | Filter by type when: - `type=charge`, only charge invoices will be returned. - `type=credit`, only credit invoices will be returned. - `type=non-legacy`, only charge and credit invoices will be returned. - `type=legacy`, only legacy invoices will be returned. schema: - type: string - enum: - - charge - - credit - - non-legacy - - legacy + "$ref": "#/components/schemas/FilterInvoiceTypeEnum" export_date: name: export_date in: path description: Date for which to get a list of available automated export files. Date must be in YYYY-MM-DD format. @@ -15354,13 +15057,13 @@ allOf: - "$ref": "#/components/schemas/AccountReadOnly" - "$ref": "#/components/schemas/AccountResponse" AccountAcquisition: allOf: - - "$ref": "#/components/schemas/AccountAcquisitionUpdatable" + - "$ref": "#/components/schemas/AccountAcquisitionUpdate" - "$ref": "#/components/schemas/AccountAcquisitionReadOnly" - AccountAcquisitionUpdatable: + AccountAcquisitionUpdate: type: object properties: cost: type: object x-class-name: AccountAcquisitionCost @@ -15378,26 +15081,12 @@ format: float title: Amount description: The amount of the corresponding currency used to acquire the account. channel: - type: string description: The channel through which the account was acquired. - enum: - - referral - - social_media - - email - - paid_search - - organic_search - - direct_traffic - - marketing_content - - blog - - events - - outbound_sales - - advertising - - public_relations - - other + "$ref": "#/components/schemas/ChannelEnum" subchannel: type: string description: An arbitrary subchannel string representing a distinction/subcategory within a broader channel. campaign: @@ -15437,16 +15126,13 @@ object: type: string title: Object type readOnly: true state: - type: string description: Accounts can be either active or inactive. readOnly: true - enum: - - active - - inactive + "$ref": "#/components/schemas/ActiveStateEnum" hosted_login_token: type: string description: 'The unique token for automatically logging the account in to the hosted management pages. You may automatically log the user into their hosted management pages by directing the user to: `https://{subdomain}.recurly.com/account/{hosted_login_token}`.' @@ -15499,11 +15185,11 @@ type: string description: The unique identifier of the account. This cannot be changed once the account is created. maxLength: 50 acquisition: - "$ref": "#/components/schemas/AccountAcquisitionUpdatable" + "$ref": "#/components/schemas/AccountAcquisitionUpdate" shipping_addresses: type: array items: "$ref": "#/components/schemas/ShippingAddressCreate" required: @@ -15522,11 +15208,11 @@ type: string description: The unique identifier of the account. This cannot be changed once the account is created. maxLength: 50 acquisition: - "$ref": "#/components/schemas/AccountAcquisitionUpdatable" + "$ref": "#/components/schemas/AccountAcquisitionUpdate" required: - code - "$ref": "#/components/schemas/AccountUpdate" AccountUpdate: type: object @@ -15541,52 +15227,14 @@ description: The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique. maxLength: 255 preferred_locale: - type: string description: Used to determine the language and locale of emails sent on behalf of the merchant to the customer. The list of locales is restricted to those the merchant has enabled on the site. - enum: - - da-DK - - de-CH - - de-DE - - en-AU - - en-CA - - en-GB - - en-IE - - en-NZ - - en-US - - es-ES - - es-MX - - es-US - - fi-FI - - fr-BE - - fr-CA - - fr-CH - - fr-FR - - hi-IN - - it-IT - - ja-JP - - ko-KR - - nl-BE - - nl-NL - - pl-PL - - pt-BR - - pt-PT - - ro-RO - - ru-RU - - sk-SK - - sv-SE - - tr-TR - - zh-CN - preferred_time_zone: - type: string - example: America/Los_Angeles - description: Used to determine the time zone of emails sent on behalf of - the merchant to the customer. Must be a [supported IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names) + "$ref": "#/components/schemas/PreferredLocaleEnum" cc_emails: type: string description: Additional email address that should receive account correspondence. These should be separated only by commas. These CC emails will receive all emails that the `email` field also receives. @@ -15632,32 +15280,20 @@ account. If both `parent_account_code` and `parent_account_id` are passed, the non-blank value in `parent_account_id` will be used. Only one level of parent child relationship is allowed. You cannot assign a parent account that itself has a parent account. bill_to: - type: string maxLength: 6 description: An enumerable describing the billing behavior of the account, specifically whether the account is self-paying or will rely on the parent account to pay. - enum: - - self - - parent + "$ref": "#/components/schemas/BillToEnum" transaction_type: - type: string description: An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions. - enum: - - moto - dunning_campaign_id: - type: string - title: Dunning Campaign ID - description: Unique ID to identify a dunning campaign. Used to specify if - a non-default dunning campaign should be assigned to this account. For - sites without multiple dunning campaigns enabled, the default dunning - campaign will always be used. + "$ref": "#/components/schemas/GatewayTransactionTypeEnum" address: "$ref": "#/components/schemas/Address" billing_info: "$ref": "#/components/schemas/BillingInfoCreate" custom_fields: @@ -15681,52 +15317,13 @@ description: The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique. maxLength: 255 preferred_locale: - type: string description: Used to determine the language and locale of emails sent on behalf of the merchant to the customer. - enum: - - da-DK - - de-CH - - de-DE - - en-AU - - en-CA - - en-GB - - en-IE - - en-NZ - - en-US - - es-ES - - es-MX - - es-US - - fi-FI - - fr-BE - - fr-CA - - fr-CH - - fr-FR - - hi-IN - - it-IT - - ja-JP - - ko-KR - - nl-BE - - nl-NL - - pl-PL - - pt-BR - - pt-PT - - ro-RO - - ru-RU - - sk-SK - - sv-SE - - tr-TR - - zh-CN - preferred_time_zone: - type: string - example: America/Los_Angeles - description: The [IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names) - used to determine the time zone of emails sent on behalf of the merchant - to the customer. + "$ref": "#/components/schemas/PreferredLocaleEnum" cc_emails: type: string description: Additional email address that should receive account correspondence. These should be separated only by commas. These CC emails will receive all emails that the `email` field also receives. @@ -15758,25 +15355,15 @@ parent_account_id: type: string maxLength: 13 description: The UUID of the parent account associated with this account. bill_to: - type: string maxLength: 6 description: An enumerable describing the billing behavior of the account, specifically whether the account is self-paying or will rely on the parent account to pay. - enum: - - self - - parent - dunning_campaign_id: - type: string - title: Dunning Campaign ID - description: Unique ID to identify a dunning campaign. Used to specify if - a non-default dunning campaign should be assigned to this account. For - sites without multiple dunning campaigns enabled, the default dunning - campaign will always be used. + "$ref": "#/components/schemas/BillToEnum" address: "$ref": "#/components/schemas/Address" billing_info: "$ref": "#/components/schemas/BillingInfo" custom_fields: @@ -15838,17 +15425,10 @@ type: string maxLength: 13 bill_to: type: string maxLength: 6 - dunning_campaign_id: - type: string - title: Dunning Campaign ID - description: Unique ID to identify a dunning campaign. Used to specify if - a non-default dunning campaign should be assigned to this account. For - sites without multiple dunning campaigns enabled, the default dunning - campaign will always be used. AccountBalance: type: object properties: object: type: string @@ -15874,25 +15454,14 @@ amount: type: number format: float title: Amount description: Total amount the account is past due. - processing_prepayment_amount: - type: number - format: float - title: Processing Prepayment Amount - description: Total amount for the prepayment credit invoices in a `processing` - state on the account. - available_credit_amount: - type: number - format: float - title: Available Credit Amount - description: Total amount of the open balances on credit invoices for the - account. InvoiceAddress: allOf: - "$ref": "#/components/schemas/Address" + - "$ref": "#/components/schemas/AddressWithName" type: object properties: name_on_account: type: string title: Name on account @@ -15900,16 +15469,10 @@ type: string title: Company Address: type: object properties: - first_name: - type: string - title: First name - last_name: - type: string - title: Last name phone: type: string title: Phone number street1: type: string @@ -15929,11 +15492,22 @@ title: Zip/Postal code description: Zip or postal code. country: type: string title: Country - description: Country, 2-letter ISO 3166-1 alpha-2 code. + description: Country, 2-letter ISO code. + AddressWithName: + allOf: + - "$ref": "#/components/schemas/Address" + type: object + properties: + first_name: + type: string + title: First name + last_name: + type: string + title: Last name AddOnMini: type: object title: Add-on mini details description: Just the important parts. properties: @@ -15955,23 +15529,13 @@ type: string title: Name description: Describes your add-on and will appear in subscribers' invoices. maxLength: 255 add_on_type: - type: string - enum: - - fixed - - usage - title: Add-on Type - description: Whether the add-on type is fixed, or usage-based. + "$ref": "#/components/schemas/AddOnTypeEnum" usage_type: - type: string - enum: - - price - - percentage - title: Usage Type - description: Type of usage, returns usage type if `add_on_type` is `usage`. + "$ref": "#/components/schemas/UsageTypeEnum" usage_percentage: type: number format: float title: Usage Percentage description: The percentage taken of the monetary amount of usage tracked. @@ -16024,36 +15588,23 @@ type: string title: Add-on code description: The unique identifier for the add-on within its plan. maxLength: 50 state: - type: string title: State description: Add-ons can be either active or inactive. readOnly: true - enum: - - active - - inactive + "$ref": "#/components/schemas/ActiveStateEnum" name: type: string title: Name description: Describes your add-on and will appear in subscribers' invoices. maxLength: 255 add_on_type: - type: string - enum: - - fixed - - usage - title: Add-on Type - description: Whether the add-on type is fixed, or usage-based. + "$ref": "#/components/schemas/AddOnTypeEnum" usage_type: - type: string - enum: - - price - - percentage - title: Usage Type - description: Type of usage, returns usage type if `add_on_type` is `usage`. + "$ref": "#/components/schemas/UsageTypeEnum" usage_percentage: type: number format: float title: Usage Percentage description: The percentage taken of the monetary amount of usage tracked. @@ -16070,20 +15621,15 @@ description: Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code. pattern: "/^[a-z0-9_+-]+$/" maxLength: 20 revenue_schedule_type: - type: string title: Revenue schedule type description: When this add-on is invoiced, the line item will use this revenue schedule. If `item_code`/`item_id` is part of the request then `revenue_schedule_type` must be absent in the request as the value will be set from the item. - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" avalara_transaction_type: type: integer title: Avalara Transaction Type description: Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. @@ -16132,19 +15678,11 @@ minItems: 1 item: "$ref": "#/components/schemas/ItemMini" readOnly: true tier_type: - type: string - title: Tier type - description: The type of tiering used by the Add-on. - default: flat - enum: - - flat - - tiered - - stairstep - - volume + "$ref": "#/components/schemas/TierTypeEnum" tiers: type: array title: Tiers items: "$ref": "#/components/schemas/Tier" @@ -16179,21 +15717,21 @@ description: Full add-on details. properties: item_code: type: string title: Item Code - description: Unique code to identify an item. Avaliable when the `Credit - Invoices` feature is enabled. If `item_id` and `item_code` are both present, - `item_id` will be used. + description: Unique code to identify an item. Available when the `Credit + Invoices` and `Subscription Billing Terms` features are enabled. If `item_id` + and `item_code` are both present, `item_id` will be used. pattern: "/^[a-z0-9_+-]+$/" maxLength: 50 item_id: type: string title: Item ID description: System-generated unique identifier for an item. Available when - the `Credit Invoices` feature is enabled. If `item_id` and `item_code` - are both present, `item_id` will be used. + the `Credit Invoices` and `Subscription Billing Terms` features are enabled. + If `item_id` and `item_code` are both present, `item_id` will be used. maxLength: 13 code: type: string title: Add-on code description: The unique identifier for the add-on within its plan. If `item_code`/`item_id` @@ -16206,27 +15744,13 @@ description: Describes your add-on and will appear in subscribers' invoices. If `item_code`/`item_id` is part of the request then `name` must be absent. If `item_code`/`item_id` is not present `name` is required. maxLength: 255 add_on_type: - type: string - enum: - - fixed - - usage - title: Add-on Type - description: Whether the add-on type is fixed, or usage-based. - default: fixed + "$ref": "#/components/schemas/AddOnTypeCreateEnum" usage_type: - type: string - enum: - - price - - percentage - title: Usage Type - description: | - Type of usage, required if `add_on_type` is `usage`. See our - [Guide](https://recurly.com/developers/guides/usage-based-billing-guide.html) - for an overview of how to configure usage add-ons. + "$ref": "#/components/schemas/UsageTypeCreateEnum" usage_percentage: type: number format: float title: Usage Percentage description: The percentage taken of the monetary amount of usage tracked. @@ -16260,20 +15784,15 @@ no value is provided, it defaults to add-on's code. If `item_code`/`item_id` is part of the request then `accounting_code` must be absent. pattern: "/^[a-z0-9_+-]+$/" maxLength: 20 revenue_schedule_type: - type: string title: Revenue schedule type description: When this add-on is invoiced, the line item will use this revenue schedule. If `item_code`/`item_id` is part of the request then `revenue_schedule_type` must be absent in the request as the value will be set from the item. - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" display_quantity: type: boolean title: Display quantity? description: Determines if the quantity field is displayed on the hosted pages for the add-on. @@ -16332,33 +15851,21 @@ is not present `currencies` is required. * If the add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `currencies` must be absent. * Must be absent if `add_on_type` is `usage` and `usage_type` is `percentage`. tier_type: - type: string - title: Tier type - description: | - The pricing model for the add-on. For more information, - [click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). See - our [Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an overview - of how to configure quantity-based pricing models. - default: flat - enum: - - flat - - tiered - - stairstep - - volume + "$ref": "#/components/schemas/TierTypeEnum" tiers: type: array title: Tiers items: "$ref": "#/components/schemas/Tier" description: | If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object must include one to many tiers with `ending_quantity` and `unit_amount` for - the desired `currencies`. There must be one tier with an `ending_quantity` of - 999999999 which is the default if not provided. + the desired `currencies`. There must be one tier with an `ending_quantity` + of 999999999 which is the default if not provided. required: - code - name AddOnUpdate: type: object @@ -16412,20 +15919,15 @@ no value is provided, it defaults to add-on's code. If an `Item` is associated to the `AddOn` then `accounting code` must be absent. pattern: "/^[a-z0-9_+-]+$/" maxLength: 20 revenue_schedule_type: - type: string title: Revenue schedule type description: When this add-on is invoiced, the line item will use this revenue - schedule. If an `Item` is associated to the `AddOn` then `revenue_schedule_type` + schedule. If `item_code`/`item_id` is part of the request then `revenue_schedule_type` must be absent in the request as the value will be set from the item. - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" avalara_transaction_type: type: integer title: Avalara Transaction Type description: Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. @@ -16476,23 +15978,23 @@ title: Add-on pricing items: "$ref": "#/components/schemas/AddOnPricing" minItems: 1 description: | - If the add-on's `tier_type` is `tiered`, `volume` or `stairstep`, - then `currencies` must be absent. Must also be absent if `add_on_type` is + If the add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, + then currencies must be absent. Must also be absent if `add_on_type` is `usage` and `usage_type` is `percentage`. tiers: type: array title: Tiers items: "$ref": "#/components/schemas/Tier" description: | If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object must include one to many tiers with `ending_quantity` and `unit_amount` for - the desired `currencies`. There must be one tier with an `ending_quantity` of - 999999999 which is the default if not provided. + the desired `currencies`. There must be one tier with an `ending_quantity` + of 999999999 which is the default if not provided. BillingInfo: type: object properties: id: type: string @@ -16537,31 +16039,26 @@ type: integer title: Kount score minimum: 1 maximum: 99 decision: - type: string title: Kount decision - enum: - - approve - - review - - decline - - escalate maxLength: 10 + "$ref": "#/components/schemas/KountDecisionEnum" risk_rules_triggered: type: object title: Kount rules primary_payment_method: type: boolean - description: The `primary_payment_method` field is used to indicate the - primary billing info on the account. The first billing info created on - an account will always become primary. This payment method will be used - backup_payment_method: - type: boolean - description: The `backup_payment_method` field is used to indicate a billing - info as a backup on the account that will be tried if the initial billing - info used for an invoice is declined. + description: 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. created_at: type: string format: date-time description: When the billing information was created. readOnly: true @@ -16579,20 +16076,19 @@ type: string description: Customer's IP address when updating their billing information. maxLength: 20 country: type: string - description: Country, 2-letter ISO 3166-1 alpha-2 code matching the - origin IP address, if known by Recurly. + description: Country of IP address, if known by Recurly. maxLength: 2 BillingInfoCreate: type: object properties: token_id: type: string title: Token ID - description: A token [generated by Recurly.js](https://recurly.com/developers/reference/recurly-js/#getting-a-token). + description: A token [generated by Recurly.js](https://developers.recurly.com/reference/recurly-js/#getting-a-token). maxLength: 22 first_name: type: string title: First name maxLength: 50 @@ -16621,13 +16117,10 @@ cvv: type: string title: Security code or CVV description: "*STRONGLY RECOMMENDED*" maxLength: 4 - currency: - type: string - description: 3-letter ISO 4217 currency code. vat_number: type: string title: VAT number ip_address: type: string @@ -16643,37 +16136,24 @@ gateway_code: type: string title: An identifier for a specific payment gateway. Must be used in conjunction with `gateway_token`. maxLength: 12 - gateway_attributes: - type: object - description: Additional attributes to send to the gateway. - x-class-name: GatewayAttributes - properties: - account_reference: - type: string - description: Used by Adyen gateways. The Shopper Reference value used - when the external token was created. Must be used in conjunction with - gateway_token and gateway_code. - maxLength: 264 amazon_billing_agreement_id: type: string title: Amazon billing agreement ID paypal_billing_agreement_id: type: string title: PayPal billing agreement ID fraud_session_id: type: string title: Fraud Session ID transaction_type: - type: string description: An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions. - enum: - - moto + "$ref": "#/components/schemas/GatewayTransactionTypeEnum" three_d_secure_action_result_token_id: type: string title: 3-D Secure action result token ID description: A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge. @@ -16682,79 +16162,33 @@ type: string maxLength: 34 description: The International Bank Account Number, up to 34 alphanumeric characters comprising a country code; two check digits; and a number that includes the domestic bank account number, branch identifier, and potential - routing information. (SEPA only) - name_on_account: - type: string - maxLength: 255 - description: The name associated with the bank account (ACH, SEPA, Bacs - only) - account_number: - type: string - maxLength: 255 - description: The bank account number. (ACH, Bacs only) - routing_number: - type: string - maxLength: 15 - description: The bank's rounting number. (ACH only) - sort_code: - type: string - maxLength: 15 - description: Bank identifier code for UK based banks. Required for Bacs - based billing infos. (Bacs only) - type: - type: string - enum: - - bacs - - becs - description: The payment method type for a non-credit card based billing - info. `bacs` and `becs` are the only accepted values. - account_type: - type: string - enum: - - checking - - savings - description: The bank account type. (ACH only) + routing information tax_identifier: type: string description: Tax identifier is required if adding a billing info that is a consumer card in Brazil. This would be the customer's CPF, CPF is a Brazilian tax identifier for all tax paying residents. tax_identifier_type: type: string enum: - - cpf + "$ref": "#/components/schemas/TaxIdentifierTypeEnum" description: this field and a value of 'cpf' are required if adding a billing info that is an elo or hipercard type in Brazil. primary_payment_method: type: boolean title: Primary Payment Method - description: The `primary_payment_method` field 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 + description: 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` with a value of `true`. When adding billing - infos via the billing_info and /accounts endpoints, this value is not - permitted, and will return an error if provided. - backup_payment_method: - type: boolean - description: The `backup_payment_method` field is used to designate a billing - info as a backup on the account that will be tried if the initial billing - info used for an invoice is declined. All payment methods, including the - billing info marked `primary_payment_method` can be set as a backup. An - account can have a maximum of 1 backup, if a user sets a different payment - method as a backup, the existing backup will no longer be marked as such. - BillingInfoVerify: - type: object - properties: - gateway_code: - type: string - description: An identifier for a specific payment gateway. - maxLength: 13 + 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. Coupon: type: object properties: id: type: string @@ -16771,17 +16205,13 @@ name: type: string title: Name description: The internal name for the coupon. state: - type: string title: State description: Indicates if the coupon is redeemable, and if it is not, why. - enum: - - redeemable - - maxed_out - - expired + "$ref": "#/components/schemas/CouponStateEnum" max_redemptions: type: integer title: Max redemptions description: A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions. @@ -16801,57 +16231,49 @@ unique_code_template: type: string title: Unique code template description: On a bulk coupon, the template from which unique coupon codes are generated. + unique_coupon_code: + allOf: + - "$ref": "#/components/schemas/UniqueCouponCode" + type: object + description: Will be populated when the Coupon being returned is a `UniqueCouponCode`. duration: - type: string title: Duration description: | - "single_use" coupons applies to the first invoice only. - "temporal" coupons will apply to invoices for the duration determined by the `temporal_unit` and `temporal_amount` attributes. - enum: - - forever - - single_use - - temporal + "$ref": "#/components/schemas/CouponDurationEnum" temporal_amount: type: integer title: Temporal amount description: If `duration` is "temporal" than `temporal_amount` is an integer which is multiplied by `temporal_unit` to define the duration that the coupon will be applied to invoices for. temporal_unit: - type: string title: Temporal unit description: If `duration` is "temporal" than `temporal_unit` is multiplied by `temporal_amount` to define the duration that the coupon will be applied to invoices for. - enum: - - day - - week - - month - - year + "$ref": "#/components/schemas/TemporalUnitEnum" free_trial_unit: - type: string title: Free trial unit description: Description of the unit of time the coupon is for. Used with `free_trial_amount` to determine the duration of time the coupon is for. - enum: - - day - - week - - month + "$ref": "#/components/schemas/FreeTrialUnitEnum" free_trial_amount: type: integer title: Free trial amount description: Sets the duration of time the `free_trial_unit` is for. minimum: 1 maximum: 9999 applies_to_all_plans: type: boolean title: Applies to all plans? description: The coupon is valid for all plans if true. If false then `plans` - and `plans_names` will list the applicable plans. + will list the applicable plans. default: true applies_to_all_items: type: boolean title: Applies to all items? description: | @@ -16861,16 +16283,10 @@ applies_to_non_plan_charges: type: boolean title: Applied to all non-plan charges? description: The coupon is valid for one-time, non-plan charges if true. default: false - plans_names: - type: array - title: Plan names - description: A list of plan names for which this coupon applies. - items: - type: string plans: type: array title: Plans description: A list of plans for which this coupon applies. This will be `null` if `applies_to_all_plans=true`. @@ -16883,29 +16299,23 @@ A list of items for which this coupon applies. This will be `null` if `applies_to_all_items=true`. items: "$ref": "#/components/schemas/ItemMini" redemption_resource: - type: string title: Redemption resource description: Whether the discount is for all eligible charges on the account, or only a specific subscription. - enum: - - account - - subscription default: account + "$ref": "#/components/schemas/RedemptionResourceEnum" discount: "$ref": "#/components/schemas/CouponDiscount" coupon_type: - type: string - title: Coupon type + title: 'Coupon type (TODO: implement coupon generation)' description: Whether the coupon is "single_code" or "bulk". Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint. - enum: - - single_code - - bulk + "$ref": "#/components/schemas/CouponTypeEnum" hosted_page_description: type: string title: Hosted Payment Pages description description: This description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description @@ -16919,26 +16329,10 @@ type: string title: Redeem by description: The date and time the coupon will expire and can no longer be redeemed. Time is always 11:59:59, the end-of-day Pacific time. format: date-time - bulk_coupon_id: - type: string - title: Bulk Coupon ID - description: The Coupon ID of the parent Bulk Coupon - readOnly: true - bulk_coupon_code: - type: string - title: Bulk Coupon code - description: The Coupon code of the parent Bulk Coupon - redeemed_at: - type: string - title: Redeemed at - description: The date and time the unique coupon code was redeemed. This - is only present for bulk coupons. - format: date-time - readOnly: true created_at: type: string title: Created at format: date-time readOnly: true @@ -16961,33 +16355,25 @@ code: type: string title: Coupon code description: The code the customer enters to redeem the coupon. discount_type: - type: string title: Discount type description: The type of discount provided by the coupon (how the amount discounted is calculated) - enum: - - percent - - fixed - - free_trial + "$ref": "#/components/schemas/DiscountTypeEnum" discount_percent: type: integer title: Discount percent description: The percent of the price discounted by the coupon. Required if `discount_type` is `percent`. free_trial_unit: - type: string title: Free trial unit description: Description of the unit of time the coupon is for. Used with `free_trial_amount` to determine the duration of time the coupon is for. Required if `discount_type` is `free_trial`. - enum: - - day - - week - - month + "$ref": "#/components/schemas/FreeTrialUnitEnum" free_trial_amount: type: integer title: Free trial amount description: Sets the duration of time the `free_trial_unit` is for. Required if `discount_type` is `free_trial`. @@ -17006,13 +16392,12 @@ description: The coupon is valid for one-time, non-plan charges if true. default: false applies_to_all_plans: type: boolean title: Applies to all plans? - description: | - The coupon is valid for all plans if true. If false then - `plans` and `plans_names` will list the applicable plans. + description: The coupon is valid for all plans if true. If false then + `plans` will list the applicable plans. default: true applies_to_all_items: type: boolean title: Applies to all items? description: | @@ -17040,48 +16425,36 @@ The following values are not permitted when `item_codes` is included: `free_trial_amount` and `free_trial_unit`. items: type: string duration: - type: string title: Duration description: | This field does not apply when the discount_type is `free_trial`. - "single_use" coupons applies to the first invoice only. - "temporal" coupons will apply to invoices for the duration determined by the `temporal_unit` and `temporal_amount` attributes. - "forever" coupons will apply to invoices forever. - enum: - - forever - - single_use - - temporal default: forever + "$ref": "#/components/schemas/CouponDurationEnum" temporal_amount: type: integer title: Temporal amount description: If `duration` is "temporal" than `temporal_amount` is an integer which is multiplied by `temporal_unit` to define the duration that the coupon will be applied to invoices for. temporal_unit: - type: string title: Temporal unit description: If `duration` is "temporal" than `temporal_unit` is multiplied by `temporal_amount` to define the duration that the coupon will be applied to invoices for. - enum: - - day - - week - - month - - year + "$ref": "#/components/schemas/TemporalUnitEnum" coupon_type: - type: string title: Coupon type description: Whether the coupon is "single_code" or "bulk". Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint. - enum: - - single_code - - bulk + "$ref": "#/components/schemas/CouponTypeEnum" unique_code_template: type: string title: Unique code template description: | On a bulk coupon, the template from which unique coupon codes are generated. @@ -17090,18 +16463,15 @@ - Outside of single quotes, use an "x" for a character that you want to be a random letter. - Outside of single quotes, use an * for a character that you want to be a random number or letter. - Use single quotes ' ' for characters that you want to remain static. These strings can be alphanumeric and may contain a - _ or +. For example: "'abc-'****'-def'" redemption_resource: - type: string title: Redemption resource description: Whether the discount is for all eligible charges on the account, or only a specific subscription. - enum: - - account - - subscription default: account + "$ref": "#/components/schemas/RedemptionResourceEnum" required: - code - discount_type - name CouponPricing: @@ -17119,15 +16489,11 @@ description: | Details of the discount a coupon applies. Will contain a `type` property and one of the following properties: `percent`, `fixed`, `trial`. properties: type: - type: string - enum: - - percent - - fixed - - free_trial + "$ref": "#/components/schemas/DiscountTypeEnum" percent: description: This is only present when `type=percent`. type: integer currencies: type: array @@ -17138,17 +16504,13 @@ type: object x-class-name: CouponDiscountTrial description: This is only present when `type=free_trial`. properties: unit: - type: string title: Trial unit description: Temporal unit of the free trial - enum: - - day - - week - - month + "$ref": "#/components/schemas/FreeTrialUnitEnum" length: type: integer title: Trial length description: Trial length measured in the units specified by the sibling `unit` property @@ -17192,28 +16554,21 @@ name: type: string title: Name description: The internal name for the coupon. state: - type: string title: State description: Indicates if the coupon is redeemable, and if it is not, why. - enum: - - redeemable - - maxed_out - - expired + "$ref": "#/components/schemas/CouponStateEnum" discount: "$ref": "#/components/schemas/CouponDiscount" coupon_type: - type: string - title: Coupon type + title: 'Coupon type (TODO: implement coupon generation)' description: Whether the coupon is "single_code" or "bulk". Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint. - enum: - - single_code - - bulk + "$ref": "#/components/schemas/CouponTypeEnum" expired_at: type: string title: Expired at description: The date and time the coupon was expired early or reached its `max_redemptions`. @@ -17237,19 +16592,17 @@ readOnly: true "$ref": "#/components/schemas/AccountMini" subscription_id: type: string title: Subscription ID + readOnly: true coupon: "$ref": "#/components/schemas/Coupon" state: - type: string title: Coupon Redemption state - enum: - - active - - inactive default: active + "$ref": "#/components/schemas/ActiveStateEnum" currency: type: string title: Currency description: 3-letter ISO 4217 currency code. maxLength: 3 @@ -17304,15 +16657,12 @@ description: Will always be `coupon`. readOnly: true coupon: "$ref": "#/components/schemas/CouponMini" state: - type: string title: Invoice state - enum: - - active - - inactive + "$ref": "#/components/schemas/ActiveStateEnum" discounted: type: number format: float title: Amount Discounted description: The amount that was discounted upon the application of the @@ -17372,18 +16722,13 @@ title: Recurly UUID description: The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI. maxLength: 32 action: - type: string title: Action description: The action for which the credit was created. - enum: - - payment - - refund - - reduction - - write_off + "$ref": "#/components/schemas/CreditPaymentActionEnum" account: "$ref": "#/components/schemas/AccountMini" applied_to_invoice: "$ref": "#/components/schemas/InvoiceMini" original_invoice: @@ -17435,11 +16780,11 @@ value: type: string title: Field value description: Any values that resemble a credit card number or security code (CVV/CVC) will be rejected. - maxLength: 255 + maxLength: 100 required: - name - value CustomFields: type: array @@ -17460,40 +16805,28 @@ object: type: string title: Object type readOnly: true related_type: - type: string title: Related Recurly object type - enum: - - account - - item - - plan - - subscription - - charge + "$ref": "#/components/schemas/RelatedTypeEnum" name: type: string title: Name description: Used by the API to identify the field or reading and writing. The name can only be used once per Recurly object type. pattern: "/^[a-z0-9_-]+$/i" maxLength: 50 user_access: - type: string title: User access description: | The access control applied inside Recurly's admin UI: - `api_only` - No one will be able to view or edit this field's data via the admin UI. - `read_only` - Users with the Customers role will be able to view this field's data via the admin UI, but editing will only be available via the API. - `write` - Users with the Customers role will be able to view and edit this field's data via the admin UI. - - `set_only` - Users with the Customers role will be able to set this field's data via the admin console. - enum: - - api_only - - read_only - - write - - set_only + "$ref": "#/components/schemas/UserAccessEnum" display_name: type: string title: Display name description: Used to label the field when viewing and editing the field in Recurly's admin UI. @@ -17542,17 +16875,14 @@ title: Item code description: Unique code to identify the item. pattern: "/^[a-z0-9_+-]+$/" maxLength: 50 state: - type: string title: State description: The current state of the item. readOnly: true - enum: - - active - - inactive + "$ref": "#/components/schemas/ActiveStateEnum" name: type: string title: Name description: This name describes your item and will appear on the invoice when it's purchased on a one time basis. @@ -17579,17 +16909,14 @@ title: Item code description: Unique code to identify the item. pattern: "/^[a-z0-9_+-]+$/" maxLength: 50 state: - type: string title: State description: The current state of the item. readOnly: true - enum: - - active - - inactive + "$ref": "#/components/schemas/ActiveStateEnum" name: type: string title: Name description: This name describes your item and will appear on the invoice when it's purchased on a one time basis. @@ -17609,17 +16936,12 @@ title: Item accounting code description: Accounting code for invoice line items. pattern: "/^[a-z0-9_+-]+$/" maxLength: 20 revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" avalara_transaction_type: type: integer title: Avalara Transaction Type description: Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer @@ -17698,17 +17020,12 @@ title: Item accounting code description: Accounting code for invoice line items. pattern: "/^[a-z0-9_+-]+$/" maxLength: 20 revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" avalara_transaction_type: type: integer title: Avalara Transaction Type description: Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer @@ -17775,17 +17092,12 @@ title: Item accounting code description: Accounting code for invoice line items. pattern: "/^[a-z0-9_+-]+$/" maxLength: 20 revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" avalara_transaction_type: type: integer title: Avalara Transaction Type description: Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer @@ -17829,60 +17141,29 @@ object: type: string title: Object type readOnly: true type: - type: string title: Invoice type description: Invoices are either charge, credit, or legacy invoices. - enum: - - charge - - credit - - legacy + "$ref": "#/components/schemas/InvoiceTypeEnum" origin: - type: string title: Origin description: The event that created the invoice. - enum: - - purchase - - line_item_refund - - open_amount_refund - - renewal - - immediate_change - - termination - - credit - - gift_card - - write_off - - prepayment - - refund - - external_refund - - carryforward_credit - - carryforward_gift_credit - - usage_correction - - import + "$ref": "#/components/schemas/OriginEnum" state: - type: string title: Invoice state - enum: - - open - - pending - - processing - - past_due - - paid - - closed - - failed - - voided + "$ref": "#/components/schemas/InvoiceStateEnum" account: "$ref": "#/components/schemas/AccountMini" billing_info_id: type: string title: Billing info ID description: 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. `billing_info_id` can ONLY be - used for sites utilizing the Wallet feature. + will bill to the specified billing info. subscription_ids: type: array title: Subscription IDs description: If the invoice is charging or refunding for one or more subscriptions, these are their IDs. @@ -17892,36 +17173,29 @@ maxLength: 13 previous_invoice_id: type: string title: Previous invoice ID description: On refund invoices, this value will exist and show the invoice - ID of the purchase invoice the refund was created from. This field is - only populated for sites without the [Only Bill What Changed](https://docs.recurly.com/docs/only-bill-what-changed) - feature enabled. Sites with Only Bill What Changed enabled should use - the [related_invoices endpoint](https://recurly.com/developers/api/v2019-10-10/index.html#operation/list_related_invoices) - to see purchase invoices refunded by this invoice. + ID of the purchase invoice the refund was created from. maxLength: 13 number: type: string title: Invoice number description: 'If VAT taxation and the Country Invoice Sequencing feature are enabled, invoices will have country-specific invoice numbers for invoices billed to EU countries (ex: FR1001). Non-EU invoices will continue to use the site-level invoice number sequence.' collection_method: - type: string title: Collection method description: An automatic invoice means a corresponding transaction is run using the account's billing information at the same time the invoice is created. Manual invoices are created without a corresponding transaction. The merchant must enter a manual payment transaction or have the customer pay the invoice with an automatic method, like credit card, PayPal, Amazon, or ACH bank payment. - enum: - - automatic - - manual default: automatic + "$ref": "#/components/schemas/CollectionMethodEnum" po_number: type: string title: Purchase order number description: For manual invoicing, this identifies the PO number associated with the subscription. @@ -17952,12 +17226,11 @@ description: Total discounts applied to this invoice. subtotal: type: number format: float title: Subtotal - description: The summation of charges and credits, before discounts and - taxes. + description: The summation of charges, discounts, and credits, before tax. tax: type: number format: float title: Tax description: The total tax on this invoice. @@ -17984,17 +17257,10 @@ format: float title: Balance description: The outstanding balance remaining on this invoice. tax_info: "$ref": "#/components/schemas/TaxInfo" - used_tax_service: - type: boolean - title: Used Tax Service? - description: Will be `true` when the invoice had a successful response from - the tax service and `false` when the invoice was not sent to tax service - due to a lack of address or enabled jurisdiction or was processed without - tax due to a non-blocking error returned from the tax service. vat_number: type: string title: VAT number description: VAT registration number for the customer on this invoice. This will come from the VAT Number field in the Billing Info or the Account @@ -18019,11 +17285,20 @@ type: string title: Customer notes description: This will default to the Customer Notes text specified on the Invoice Settings. Specify custom notes to add or override Customer Notes. line_items: - "$ref": "#/components/schemas/LineItemList" + type: array + title: Line Items + items: + "$ref": "#/components/schemas/LineItem" + has_more_line_items: + type: boolean + title: Has more Line Items + description: Identifies if the invoice has more line items than are returned + in `line_items`. If `has_more_line_items` is `true`, then a request needs + to be made to the `list_invoice_line_items` endpoint. transactions: type: array title: Transactions items: "$ref": "#/components/schemas/Transaction" @@ -18050,37 +17325,28 @@ closed_at: type: string format: date-time title: Closed at description: Date invoice was marked paid or failed. - dunning_campaign_id: - type: string - title: Dunning Campaign ID - description: Unique ID to identify the dunning campaign used when dunning - the invoice. For sites without multiple dunning campaigns enabled, this - will always be the default dunning campaign. InvoiceCreate: type: object properties: currency: type: string title: Currency description: 3-letter ISO 4217 currency code. maxLength: 3 collection_method: - type: string title: Collection method description: An automatic invoice means a corresponding transaction is run using the account's billing information at the same time the invoice is created. Manual invoices are created without a corresponding transaction. The merchant must enter a manual payment transaction or have the customer pay the invoice with an automatic method, like credit card, PayPal, Amazon, or ACH bank payment. - enum: - - automatic - - manual default: automatic + "$ref": "#/components/schemas/CollectionMethodEnum" charge_customer_notes: type: string title: Charge customer notes description: This will default to the Customer Notes text specified on the Invoice Settings for charge invoices. Specify custom notes to add or override @@ -18132,24 +17398,21 @@ title: 3-D Secure action result token ID description: A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge. maxLength: 22 transaction_type: - type: string description: An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions. - enum: - - moto + "$ref": "#/components/schemas/GatewayTransactionTypeEnum" billing_info_id: type: string title: Billing Info ID description: 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. `billing_info_id` can ONLY be - used for sites utilizing the Wallet feature. + will bill to the specified billing info. InvoiceCollection: type: object title: Invoice collection properties: object: @@ -18160,11 +17423,11 @@ credit_invoices: type: array title: Credit invoices items: "$ref": "#/components/schemas/Invoice" - InvoiceUpdatable: + InvoiceUpdate: type: object properties: po_number: type: string title: Purchase order number @@ -18208,40 +17471,24 @@ title: Object type number: type: string title: Invoice number type: - type: string title: Invoice type - enum: - - charge - - credit - - legacy + "$ref": "#/components/schemas/InvoiceTypeEnum" state: - type: string title: Invoice state - enum: - - open - - pending - - processing - - past_due - - paid - - closed - - failed - - voided + "$ref": "#/components/schemas/InvoiceStateEnum" InvoiceRefund: type: object title: Invoice refund properties: type: - type: string title: Type description: The type of refund. Amount and line items cannot both be specified in the request. - enum: - - amount - - line_items + "$ref": "#/components/schemas/InvoiceRefundTypeEnum" amount: type: number format: float title: Amount description: | @@ -18252,24 +17499,19 @@ title: Line items description: The line items to be refunded. This is required when `type=line_items`. items: "$ref": "#/components/schemas/LineItemRefund" refund_method: - type: string title: Refund method description: | Indicates how the invoice should be refunded when both a credit and transaction are present on the invoice: - `transaction_first` – Refunds the transaction first, then any amount is issued as credit back to the account. Default value when Credit Invoices feature is enabled. - `credit_first` – Issues credit back to the account first, then refunds any remaining amount back to the transaction. Default value when Credit Invoices feature is not enabled. - `all_credit` – Issues credit to the account for the entire amount of the refund. Only available when the Credit Invoices feature is enabled. - `all_transaction` – Refunds the entire amount back to transactions, using transactions from previous invoices if necessary. Only available when the Credit Invoices feature is enabled. - enum: - - transaction_first - - credit_first - - all_credit - - all_transaction default: credit_first + "$ref": "#/components/schemas/RefuneMethodEnum" credit_customer_notes: type: string title: Credit customer notes description: | Used as the Customer Notes on the credit invoice. @@ -18287,26 +17529,13 @@ - refunding a credit invoice for a partial amount This field can only be included when the Credit Invoices feature is enabled. properties: payment_method: - type: string title: Payment Method description: Payment method used for external refund transaction. - enum: - - credit_card - - paypal - - amazon - - roku - - ach - - apple_pay - - sepadirectdebit - - eft - - wire_transfer - - money_order - - check - - other + "$ref": "#/components/schemas/ExternalPaymentMethodEnum" description: type: string title: Description description: Used as the refund transactions' description. maxLength: 50 @@ -18345,14 +17574,11 @@ maxLength: 50 state: title: State description: The current state of the measured unit. readOnly: true - type: string - enum: - - active - - inactive + "$ref": "#/components/schemas/ActiveStateEnum" description: type: string title: Description description: Optional internal description. created_at: @@ -18425,76 +17651,53 @@ title: UUID description: The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI. maxLength: 32 type: - type: string title: Line item type description: Charges are positive line items that debit the account. Credits are negative line items that credit the account. - enum: - - charge - - credit + "$ref": "#/components/schemas/LineItemTypeEnum" item_code: type: string title: Item Code description: Unique code to identify an item. Available when the Credit - Invoices feature is enabled. + Invoices and Subscription Billing Terms features are enabled. pattern: "/^[a-z0-9_+-]+$/" maxLength: 50 item_id: type: string title: Item ID description: System-generated unique identifier for an item. Available when - the Credit Invoices feature is enabled. + the Credit Invoices and Subscription Billing Terms features are enabled. maxLength: 13 external_sku: type: string title: External SKU description: Optional Stock Keeping Unit assigned to an item. Available - when the Credit Invoices feature is enabled. + when the Credit Invoices and Subscription Billing Terms features are enabled. maxLength: 50 revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start - - at_invoice + "$ref": "#/components/schemas/LineItemRevenueScheduleTypeEnum" state: - type: string title: Current state of the line item description: Pending line items are charges or credits on an account that have not been applied to an invoice yet. Invoiced line items will always have an `invoice_id` value. - enum: - - pending - - invoiced + "$ref": "#/components/schemas/LineItemStateEnum" legacy_category: - type: string title: Legacy category description: | Category to describe the role of a line item on a legacy invoice: - "charges" refers to charges being billed for on this invoice. - "credits" refers to refund or proration credits. This portion of the invoice can be considered a credit memo. - "applied_credits" refers to previous credits applied to this invoice. See their original_line_item_id to determine where the credit first originated. - "carryforwards" can be ignored. They exist to consume any remaining credit balance. A new credit with the same amount will be created and placed back on the account. - enum: - - charge - - credit - - applied_credit - - carryforward + "$ref": "#/components/schemas/LegacyCategoryEnum" account: "$ref": "#/components/schemas/AccountMini" - bill_for_account_id: - type: string - title: Bill For Account ID - maxLength: 13 - description: The UUID of the account responsible for originating the line - item. subscription_id: type: string title: Subscription ID description: If the line item is a charge or credit for a subscription, this is its ID. @@ -18549,25 +17752,14 @@ description: The invoice where the credit originated. Will only have a value if the line item is a credit created from a previous credit, or if the credit was created from a charge refund. maxLength: 13 origin: - type: string title: Origin of line item description: A credit created from an original charge will have the value of the charge's origin. - enum: - - plan - - plan_trial - - setup_fee - - add_on_trial - - add_on - - debit - - one_time - - credit - - coupon - - carryforward + "$ref": "#/components/schemas/LineItemOriginEnum" accounting_code: type: string title: Accounting code description: Internal accounting code to help you reconcile your revenue to the correct ledger. Line items created as part of a subscription invoice @@ -18581,21 +17773,14 @@ description: For plan-related line items this will be the plan's code, for add-on related line items it will be the add-on's code. For item-related line items it will be the item's `external_sku`. maxLength: 50 credit_reason_code: - type: string title: Credit reason code description: The reason the credit was given when line item is `type=credit`. - enum: - - general - - service - - promotional - - refund - - gift_card - - write_off default: general + "$ref": "#/components/schemas/FullCreditReasonCodeEnum" currency: type: string title: Currency description: 3-letter ISO 4217 currency code. maxLength: 3 @@ -18614,29 +17799,19 @@ type: integer title: Quantity description: This number will be multiplied by the unit amount to compute the subtotal before any discounts or taxes. default: 1 - quantity_decimal: - type: string - title: Quantity Decimal - description: A floating-point alternative to Quantity. If this value is - present, it will be used in place of Quantity for calculations, and Quantity - will be the rounded integer value of this number. This field supports - up to 9 decimal places. The Decimal Quantity feature must be enabled to - utilize this field. unit_amount: type: number format: float title: Unit amount description: Positive amount for a charge, negative amount for a credit. - tax_inclusive: - type: boolean - title: Tax Inclusive? - description: Determines whether or not tax is included in the unit amount. - The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing - feature) must be enabled to utilize this flag. + unit_amount_decimal: + type: string + title: Unit amount decimal + description: Positive amount for a charge, negative amount for a credit. subtotal: type: number format: float title: Total before discounts and taxes description: "`quantity * unit_amount`" @@ -18702,17 +17877,10 @@ refunded_quantity: type: integer title: Refunded Quantity description: For refund charges, the quantity being refunded. For non-refund charges, the total quantity refunded (possibly over multiple refunds). - refunded_quantity_decimal: - type: string - title: Refunded Quantity Decimal - description: A floating-point alternative to Refunded Quantity. For refund - charges, the quantity being refunded. For non-refund charges, the total - quantity refunded (possibly over multiple refunds). The Decimal Quantity - feature must be enabled to utilize this field. credit_applied: type: number format: float title: Credit Applied description: The amount of credit from this line item that was applied to @@ -18729,12 +17897,10 @@ end_date: type: string format: date-time title: End date description: If this date is provided, it indicates the end of a time range. - custom_fields: - "$ref": "#/components/schemas/CustomFields" created_at: type: string format: date-time title: Created at description: When the line item was created. @@ -18752,18 +17918,10 @@ maxLength: 13 quantity: type: integer title: Quantity description: Line item quantity to be refunded. - quantity_decimal: - type: string - title: Quantity Decimal - description: A floating-point alternative to Quantity. If this value is - present, it will be used in place of Quantity for calculations, and Quantity - will be the rounded integer value of this number. This field supports - up to 9 decimal places. The Decimal Quantity feature must be enabled to - utilize this field. prorate: type: boolean title: Prorate description: | Set to `true` if the line item should be prorated; set to `false` if not. @@ -18786,19 +17944,12 @@ format: float title: Unit amount description: | A positive or negative amount with `type=charge` will result in a positive `unit_amount`. A positive or negative amount with `type=credit` will result in a negative `unit_amount`. - If `item_code`/`item_id` is present, `unit_amount` can be passed in, to override the `Item`'s - `unit_amount`. If `item_code`/`item_id` is not present then `unit_amount` is required. - tax_inclusive: - type: boolean - title: Tax Inclusive? - default: false - description: Determines whether or not tax is included in the unit amount. - The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing - feature) must be enabled to use this flag. + If `item_code`/`item_id` is present, `unit_amount` can be passed in, to override the + `Item`'s `unit_amount`. If `item_code`/`item_id` is not present then `unit_amount` is required. quantity: type: integer title: Quantity description: This number will be multiplied by the unit amount to compute the subtotal before any discounts or taxes. @@ -18810,50 +17961,37 @@ is part of the request then `description` must be absent. maxLength: 255 item_code: type: string title: Item Code - description: Unique code to identify an item. Avaliable when the Credit - Invoices feature is enabled. + description: Unique code to identify an item. Available when the Credit + Invoices and Subscription Billing Terms features are enabled. pattern: "/^[a-z0-9_+-]+$/" maxLength: 50 item_id: type: string title: Item ID description: System-generated unique identifier for an item. Available when - the Credit Invoices feature is enabled. + the Credit Invoices and Subscription Billing Terms features are enabled. maxLength: 13 revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start - - at_invoice + "$ref": "#/components/schemas/LineItemRevenueScheduleTypeEnum" type: - type: string title: Type description: Line item type. If `item_code`/`item_id` is present then `type` should not be present. If `item_code`/`item_id` is not present then `type` is required. - enum: - - charge - - credit + "$ref": "#/components/schemas/LineItemTypeEnum" credit_reason_code: - type: string title: Credit reason code description: The reason the credit was given when line item is `type=credit`. When the Credit Invoices feature is enabled, the value can be set and will default to `general`. When the Credit Invoices feature is not enabled, the value will always be `null`. - enum: - - general - - service - - promotional default: general + "$ref": "#/components/schemas/PartialCreditReasonCodeEnum" accounting_code: type: string title: Accounting Code description: Accounting Code for the `LineItem`. If `item_code`/`item_id` is part of the request then `accounting_code` must be absent. @@ -18901,22 +18039,19 @@ tax calculations, this field will be used as the Vertex `product` field. If `item_code`/`item_id` is part of the request then `product_code` must be absent. maxLength: 50 origin: - type: string title: Origin description: Origin `external_gift_card` is allowed if the Gift Cards feature is enabled on your site and `type` is `credit`. Set this value in order to track gift card credits from external gift cards (like InComm). It also skips billing information requirements. Origin `prepayment` is only allowed if `type` is `charge` and `tax_exempt` is left blank or set to true. This origin creates a charge and opposite credit on the account to be used for future invoices. - enum: - - external_gift_card - - prepayment + "$ref": "#/components/schemas/LineItemCreateOriginEnum" start_date: type: string format: date-time title: Start date description: If an end date is present, this is value indicates the beginning @@ -18925,12 +18060,10 @@ end_date: type: string format: date-time title: End date description: If this date is provided, it indicates the end of a time range. - custom_fields: - "$ref": "#/components/schemas/CustomFields" required: - currency - unit_amount - type PlanMini: @@ -18979,17 +18112,14 @@ description: Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports. pattern: "/^[a-z0-9_+-]+$/i" maxLength: 50 state: - type: string title: State description: The current state of the plan. readOnly: true - enum: - - active - - inactive + "$ref": "#/components/schemas/ActiveStateEnum" name: type: string title: Name description: This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice. @@ -18997,31 +18127,25 @@ description: type: string title: Description description: Optional description, not displayed. interval_unit: - type: string title: Interval unit description: Unit for the plan's billing interval. - enum: - - days - - months default: months + "$ref": "#/components/schemas/IntervalUnitEnum" interval_length: type: integer title: Interval length description: Length of the plan's billing interval in `interval_unit`. default: 1 minimum: 1 trial_unit: - type: string title: Trial unit description: Units for the plan's trial period. - enum: - - days - - months default: months + "$ref": "#/components/schemas/IntervalUnitEnum" trial_length: type: integer title: Trial length description: Length of plan's trial period in `trial_units`. `0` means `no trial`. @@ -19029,11 +18153,13 @@ minimum: 0 trial_requires_billing_info: type: boolean title: Trial Requires BillingInfo description: Allow free trial subscriptions to be created without billing - info. + info. Should not be used if billing info is needed for initial invoice + due to existing uninvoiced charges or setup fee. + default: true total_billing_cycles: type: integer title: Total billing cycles description: Automatically terminate subscriptions after a defined number of billing cycles. Number of billing cycles before the plan automatically @@ -19046,51 +18172,23 @@ description: Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself. - pricing_model: - title: Pricing Model - type: string - enum: - - fixed - - ramp - default: fixed - description: | - A fixed pricing model has the same price for each billing period. - A ramp pricing model defines a set of Ramp Intervals, where a subscription changes price on - a specified cadence of billing periods. The price change could be an increase or decrease. - ramp_intervals: - type: array - title: Ramp Intervals - items: - "$ref": "#/components/schemas/PlanRampInterval" - custom_fields: - "$ref": "#/components/schemas/CustomFields" + revenue_schedule_type: + title: Revenue schedule type + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" + setup_fee_revenue_schedule_type: + title: Setup fee revenue schedule type + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" accounting_code: type: string title: Plan accounting code description: Accounting code for invoice line items for the plan. If no value is provided, it defaults to plan's code. pattern: "/^[a-z0-9_+-]+$/" maxLength: 20 - revenue_schedule_type: - type: string - title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start - setup_fee_revenue_schedule_type: - type: string - title: Setup fee revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start setup_fee_accounting_code: type: string title: Setup fee accounting code description: Accounting code for invoice line items for the plan's setup fee. If no value is provided, it defaults to plan's accounting code. @@ -19139,17 +18237,10 @@ title: Allow any item on subscriptions description: | Used to determine whether items can be assigned as add-ons to individual subscriptions. If `true`, items can be assigned as add-ons to individual subscription add-ons. If `false`, only plan add-ons can be used. - dunning_campaign_id: - type: string - title: Dunning Campaign ID - description: Unique ID to identify a dunning campaign. Used to specify if - a non-default dunning campaign should be assigned to this plan. For sites - without multiple dunning campaigns enabled, the default dunning campaign - will always be used. created_at: type: string format: date-time title: Created at readOnly: true @@ -19192,31 +18283,25 @@ description: Accounting code for invoice line items for the plan. If no value is provided, it defaults to plan's code. pattern: "/^[a-z0-9_+-]+$/" maxLength: 20 interval_unit: - type: string title: Interval unit description: Unit for the plan's billing interval. - enum: - - days - - months default: months + "$ref": "#/components/schemas/IntervalUnitEnum" interval_length: type: integer title: Interval length description: Length of the plan's billing interval in `interval_unit`. default: 1 minimum: 1 trial_unit: - type: string title: Trial unit description: Units for the plan's trial period. - enum: - - days - - months default: months + "$ref": "#/components/schemas/IntervalUnitEnum" trial_length: type: integer title: Trial length description: Length of plan's trial period in `trial_units`. `0` means `no trial`. @@ -19242,44 +18327,16 @@ description: Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself. - pricing_model: - title: Pricing Model - type: string - enum: - - fixed - - ramp - default: fixed - description: | - A fixed pricing model has the same price for each billing period. - A ramp pricing model defines a set of Ramp Intervals, where a subscription changes price on - a specified cadence of billing periods. The price change could be an increase or decrease. - ramp_intervals: - type: array - title: Ramp Intervals - items: - "$ref": "#/components/schemas/PlanRampInterval" - custom_fields: - "$ref": "#/components/schemas/CustomFields" revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" setup_fee_revenue_schedule_type: - type: string title: Setup fee revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" setup_fee_accounting_code: type: string title: Setup fee accounting code description: Accounting code for invoice line items for the plan's setup fee. If no value is provided, it defaults to plan's accounting code. @@ -19336,17 +18393,10 @@ default: false description: | Used to determine whether items can be assigned as add-ons to individual subscriptions. If `true`, items can be assigned as add-ons to individual subscription add-ons. If `false`, only plan add-ons can be used. - dunning_campaign_id: - type: string - title: Dunning Campaign ID - description: Unique ID to identify a dunning campaign. Used to specify if - a non-default dunning campaign should be assigned to this plan. For sites - without multiple dunning campaigns enabled, the default dunning campaign - will always be used. required: - code - name - currencies PlanHostedPages: @@ -19391,19 +18441,12 @@ maximum: 1000000 unit_amount: type: number format: float title: Unit price - description: This field should not be sent when the pricing model is 'ramp'. minimum: 0 maximum: 1000000 - tax_inclusive: - type: boolean - title: Tax Inclusive? - default: false - description: This field is deprecated. Please do not use it. - deprecated: true PlanUpdate: type: object properties: id: type: string @@ -19433,17 +18476,14 @@ description: Accounting code for invoice line items for the plan. If no value is provided, it defaults to plan's code. pattern: "/^[a-z0-9_+-]+$/" maxLength: 20 trial_unit: - type: string title: Trial unit description: Units for the plan's trial period. - enum: - - days - - months default: months + "$ref": "#/components/schemas/IntervalUnitEnum" trial_length: type: integer title: Trial length description: Length of plan's trial period in `trial_units`. `0` means `no trial`. @@ -19469,33 +18509,16 @@ description: Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself. - ramp_intervals: - type: array - title: Ramp Intervals - items: - "$ref": "#/components/schemas/PlanRampInterval" - custom_fields: - "$ref": "#/components/schemas/CustomFields" revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" setup_fee_revenue_schedule_type: - type: string title: Setup fee revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" setup_fee_accounting_code: type: string title: Setup fee accounting code description: Accounting code for invoice line items for the plan's setup fee. If no value is provided, it defaults to plan's accounting code. @@ -19546,30 +18569,10 @@ title: Allow any item on subscriptions description: | Used to determine whether items can be assigned as add-ons to individual subscriptions. If `true`, items can be assigned as add-ons to individual subscription add-ons. If `false`, only plan add-ons can be used. - dunning_campaign_id: - type: string - title: Dunning Campaign ID - description: Unique ID to identify a dunning campaign. Used to specify if - a non-default dunning campaign should be assigned to this plan. For sites - without multiple dunning campaigns enabled, the default dunning campaign - will always be used. - PlanRampInterval: - type: object - title: Plan Ramp Interval - properties: - starting_billing_cycle: - type: integer - description: Represents the billing cycle where a ramp interval starts. - default: 1 - currencies: - type: array - description: Represents the price for the ramp interval. - items: - "$ref": "#/components/schemas/PlanRampPricing" AddOnPricing: type: object properties: currency: type: string @@ -19580,20 +18583,23 @@ type: number format: float title: Unit price minimum: 0 maximum: 1000000 - tax_inclusive: - type: boolean - title: Tax Inclusive? - default: false - description: This field is deprecated. Please do not use it. - deprecated: true + description: Allows up to 2 decimal places. Required unless `unit_amount_decimal` + is provided. + unit_amount_decimal: + type: string + title: Unit Amount Decimal + minimum: 0 + maximum: 1000000 + description: | + Allows up to 9 decimal places. Only supported when `add_on_type` = `usage`. + If `unit_amount_decimal` is provided, `unit_amount` cannot be provided. required: - currency - - unit_amount - PlanRampPricing: + TierPricing: type: object properties: currency: type: string title: Currency @@ -19601,16 +18607,24 @@ maxLength: 3 unit_amount: type: number format: float title: Unit price - description: Represents the price for the Ramp Interval. minimum: 0 maximum: 1000000 + description: Allows up to 2 decimal places. Required unless `unit_amount_decimal` + is provided. + unit_amount_decimal: + type: string + title: Unit Amount Decimal + minimum: 0 + maximum: 1000000 + description: | + Allows up to 9 decimal places. Only supported when `add_on_type` = `usage`. + If `unit_amount_decimal` is provided, `unit_amount` cannot be provided. required: - currency - - unit_amount Pricing: type: object properties: currency: type: string @@ -19621,16 +18635,10 @@ type: number format: float title: Unit price minimum: 0 maximum: 1000000 - tax_inclusive: - type: boolean - title: Tax Inclusive? - default: false - description: This field is deprecated. Please do not use it. - deprecated: true required: - currency - unit_amount Tier: type: object @@ -19643,30 +18651,25 @@ default: 999999999 currencies: type: array title: Tier pricing items: - "$ref": "#/components/schemas/Pricing" + "$ref": "#/components/schemas/TierPricing" minItems: 1 required: - currencies Settings: type: object properties: billing_address_requirement: - type: string description: | - full: Full Address (Street, City, State, Postal Code and Country) - streetzip: Street and Postal Code only - zip: Postal Code only - none: No Address - enum: - - full - - streetzip - - zip - - none readOnly: true + "$ref": "#/components/schemas/AddressRequirementEnum" accepted_currencies: type: array items: type: string description: 3-letter ISO 4217 currency code. @@ -19731,11 +18734,11 @@ maxLength: 20 description: Zip or postal code. country: type: string maxLength: 50 - description: Country, 2-letter ISO 3166-1 alpha-2 code. + description: Country, 2-letter ISO code. created_at: type: string title: Created at format: date-time readOnly: true @@ -19786,11 +18789,11 @@ maxLength: 20 description: Zip or postal code. country: type: string maxLength: 50 - description: Country, 2-letter ISO 3166-1 alpha-2 code. + description: Country, 2-letter ISO code. required: - first_name - last_name - street1 - city @@ -20036,11 +19039,11 @@ maxLength: 20 description: Zip or postal code. country: type: string maxLength: 50 - description: Country, 2-letter ISO 3166-1 alpha-2 code. + description: Country, 2-letter ISO code. Site: type: object properties: id: type: string @@ -20061,34 +19064,25 @@ readOnly: true maxLength: 50 description: This value is used to configure RecurlyJS to submit tokenized billing information. mode: - type: string title: Mode - enum: - - development - - production - - sandbox maxLength: 15 readOnly: true + "$ref": "#/components/schemas/SiteModeEnum" address: "$ref": "#/components/schemas/Address" settings: "$ref": "#/components/schemas/Settings" features: type: array title: Features description: A list of features enabled for the site. items: - type: string - enum: - - credit_memos - - manual_invoicing - - only_bill_what_changed - - subscription_terms readOnly: true + "$ref": "#/components/schemas/FeaturesEnum" created_at: type: string format: date-time title: Created at readOnly: true @@ -20121,19 +19115,12 @@ account: "$ref": "#/components/schemas/AccountMini" plan: "$ref": "#/components/schemas/PlanMini" state: - type: string title: State - enum: - - active - - canceled - - expired - - failed - - future - - paused + "$ref": "#/components/schemas/SubscriptionStateEnum" shipping: "$ref": "#/components/schemas/SubscriptionShipping" coupon_redemptions: type: array title: Coupon redemptions @@ -20192,17 +19179,10 @@ auto_renew: type: boolean default: true title: Auto renew description: Whether the subscription renews at the end of its term. - ramp_intervals: - type: array - title: Ramp Intervals - description: The ramp intervals representing the pricing schedule for the - subscription. - items: - "$ref": "#/components/schemas/SubscriptionRampIntervalResponse" paused_at: type: string format: date-time title: Paused at description: Null unless subscription is paused or will pause at the end @@ -20216,27 +19196,16 @@ type: string title: Currency description: 3-letter ISO 4217 currency code. maxLength: 3 revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" unit_amount: type: number format: float title: Subscription unit price - tax_inclusive: - type: boolean - title: Tax Inclusive? - description: Determines whether or not tax is included in the unit amount. - The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing - feature) must be enabled to utilize this flag. quantity: type: integer title: Subscription quantity minimum: 0 add_ons: @@ -20253,16 +19222,13 @@ type: number format: float title: Estimated total, before tax. minimum: 0 collection_method: - type: string title: Collection method - enum: - - automatic - - manual default: automatic + "$ref": "#/components/schemas/CollectionMethodEnum" po_number: type: string title: Purchase order number description: For manual invoicing, this identifies the PO number associated with the subscription. @@ -20318,17 +19284,10 @@ or the billing info is no longer a bank account, this timestamp is cleared. billing_info_id: type: string title: Billing Info ID description: Billing Info ID. - active_invoice_id: - type: string - title: Active invoice ID - description: The invoice ID of the latest invoice created for an active - subscription. - maxLength: 13 - readOnly: true SubscriptionAddOn: type: object title: Subscription Add-on description: This links an Add-on to a specific Subscription. properties: @@ -20344,48 +19303,30 @@ title: Subscription ID maxLength: 13 add_on: "$ref": "#/components/schemas/AddOnMini" add_on_source: - type: string - title: Add-on source - description: | - Used to determine where the associated add-on data is pulled from. If this value is set to - `plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated - `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then - the associated add-on data will be pulled from the site's item catalog. - default: plan_add_on - enum: - - plan_add_on - - item + "$ref": "#/components/schemas/AddOnSourceEnum" quantity: type: integer title: Add-on quantity minimum: 0 unit_amount: type: number format: float title: Add-on unit price - description: This is priced in the subscription's currency. - revenue_schedule_type: + description: Supports up to 2 decimal places. + unit_amount_decimal: type: string + format: decimal + title: Add-on unit in decimal price + description: Supports up to 9 decimal places. + revenue_schedule_type: title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" tier_type: - type: string - title: Tier type - description: The type of tiering used by the Add-on. - default: flat - enum: - - flat - - tiered - - stairstep - - volume + "$ref": "#/components/schemas/TierTypeEnum" tiers: type: array title: Tiers items: "$ref": "#/components/schemas/SubscriptionAddOnTier" @@ -20421,64 +19362,60 @@ maxLength: 50 description: | If `add_on_source` is set to `plan_add_on` or left blank, then plan's add-on `code` should be used. If `add_on_source` is set to `item`, then the `code` from the associated item should be used. add_on_source: - type: string - title: Add-on source - description: | - Used to determine where the associated add-on data is pulled from. If this value is set to - `plan_add_on` or left blank, then add_on data will be pulled from the plan's add-ons. If the associated - `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then - the associated add-on data will be pulled from the site's item catalog. - default: plan_add_on - enum: - - plan_add_on - - item + "$ref": "#/components/schemas/AddOnSourceEnum" quantity: type: integer title: Quantity minimum: 0 default: 1 unit_amount: type: number format: float title: Unit amount description: | - * Optionally, override the add-on's default unit amount. - * If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` must be absent. + Allows up to 2 decimal places. Optionally, override the add-on's default unit amount. + If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` cannot be provided. minimum: 0 maximum: 1000000 + unit_amount_decimal: + type: string + format: decimal + title: Unit Amount Decimal + description: | + Allows up to 9 decimal places. Optionally, override the add-on's default unit amount. + If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount_decimal` cannot be provided. + Only supported when the plan add-on's `add_on_type` = `usage`. + If `unit_amount_decimal` is provided, `unit_amount` cannot be provided. + minimum: 0 + maximum: 1000000 tiers: type: array title: Tiers items: "$ref": "#/components/schemas/SubscriptionAddOnTier" minItems: 1 description: | 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://recurly.com/developers/guides/item-addon-guide.html) + 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. usage_percentage: type: number format: float title: Usage Percentage description: 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://recurly.com/developers/guides/usage-based-billing-guide.html) + 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. revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" required: - code SubscriptionAddOnUpdate: type: object properties: @@ -20498,32 +19435,32 @@ will be set to the current value for those attributes on the plan add-on unless provided in the request. If `add_on_source` is set to `plan_add_on` or left blank, then plan's add-on `code` should be used. If `add_on_source` is set to `item`, then the `code` from the associated item should be used. add_on_source: - type: string - title: Add-on source - description: | - Used to determine where the associated add-on data is pulled from. If this value is set to - `plan_add_on` or left blank, then add_on data will be pulled from the plan's add-ons. If the associated - `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then - the associated add-on data will be pulled from the site's item catalog. - default: plan_add_on - enum: - - plan_add_on - - item + "$ref": "#/components/schemas/AddOnSourceEnum" quantity: type: integer title: Quantity minimum: 0 unit_amount: type: number format: float title: Unit amount - description: Optionally, override the add-on's default unit amount. + description: | + Allows up to 2 decimal places. Optionally, override the add-on's default unit amount. + If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` cannot be provided. minimum: 0 maximum: 1000000 + unit_amount_decimal: + type: string + title: Unit amount decimal + description: | + Allows up to 9 decimal places. Optionally, override the add-on's default unit amount. + If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount_decimal` cannot be provided. + Only supported when the plan add-on's `add_on_type` = `usage`. + If `unit_amount_decimal` is provided, `unit_amount` cannot be provided. tiers: type: array title: Tiers items: "$ref": "#/components/schemas/SubscriptionAddOnTier" @@ -20539,17 +19476,12 @@ title: Usage Percentage description: 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. revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" SubscriptionAddOnTier: type: object properties: ending_quantity: type: integer @@ -20561,25 +19493,30 @@ type: number format: float title: Unit amount minimum: 0 maximum: 1000000 + description: Allows up to 2 decimal places. Optionally, override the tiers' + default unit amount. + unit_amount_decimal: + type: string + title: Unit amount decimal + description: | + Allows up to 9 decimal places. Optionally, override tiers' default unit amount. + If `unit_amount_decimal` is provided, `unit_amount` cannot be provided. SubscriptionCancel: type: object properties: timeframe: - type: string title: Timeframe description: The timeframe parameter controls when the expiration takes place. The `bill_date` timeframe causes the subscription to expire when the subscription is scheduled to bill next. The `term_end` timeframe causes the subscription to continue to bill until the end of the subscription term, then expire. default: term_end - enum: - - bill_date - - term_end + "$ref": "#/components/schemas/TimeframeEnum" SubscriptionChange: type: object title: Subscription Change properties: id: @@ -20604,16 +19541,10 @@ "$ref": "#/components/schemas/SubscriptionAddOn" unit_amount: type: number format: float title: Unit amount - tax_inclusive: - type: boolean - title: Tax Inclusive? - default: false - description: This field is deprecated. Please do not use it. - deprecated: true quantity: type: integer title: Subscription quantity shipping: "$ref": "#/components/schemas/SubscriptionShipping" @@ -20625,25 +19556,12 @@ activated: type: boolean title: Activated? description: Returns `true` if the subscription change is activated. revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start - setup_fee_revenue_schedule_type: - type: string - title: Setup fee revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" invoice_collection: title: Invoice Collection "$ref": "#/components/schemas/InvoiceCollection" custom_fields: "$ref": "#/components/schemas/CustomFields" @@ -20660,51 +19578,24 @@ deleted_at: type: string format: date-time title: Deleted at readOnly: true - billing_info: - "$ref": "#/components/schemas/SubscriptionChangeBillingInfo" - ramp_intervals: - type: array - title: Ramp Intervals - description: The ramp intervals representing the pricing schedule for the - subscription. - items: - "$ref": "#/components/schemas/SubscriptionRampIntervalResponse" - SubscriptionChangeBillingInfo: - type: object - description: Accept nested attributes for three_d_secure_action_result_token_id - properties: - three_d_secure_action_result_token_id: - type: string - title: 3-D Secure action result token ID - description: A token generated by Recurly.js after completing a 3-D Secure - device fingerprinting or authentication challenge. - maxLength: 22 - SubscriptionChangeBillingInfoCreate: - allOf: - - "$ref": "#/components/schemas/SubscriptionChangeBillingInfo" SubscriptionChangeCreate: type: object properties: timeframe: - type: string title: Timeframe description: The timeframe parameter controls when the upgrade or downgrade takes place. The subscription change can occur now, when the subscription is next billed, or when the subscription term ends. Generally, if you're performing an upgrade, you will want the change to occur immediately (now). If you're performing a downgrade, you should set the timeframe to `term_end` or `bill_date` so the change takes effect at a scheduled billing date. The `renewal` timeframe option is accepted as an alias for `term_end`. default: now - enum: - - now - - bill_date - - term_end - - renewal + "$ref": "#/components/schemas/ChangeTimeframeEnum" plan_id: type: string title: Plan ID maxLength: 13 description: If you want to change to a new plan, you can provide the plan's @@ -20722,16 +19613,10 @@ description: Optionally, sets custom pricing for the subscription, overriding the plan's default unit amount. The subscription's current currency will be used. minimum: 0 maximum: 1000000 - tax_inclusive: - type: boolean - title: Tax Inclusive? - default: false - description: This field is deprecated. Please do not use it. - deprecated: true quantity: type: integer title: Quantity description: Optionally override the default quantity of 1. default: 1 @@ -20748,15 +19633,16 @@ type: string add_ons: type: array title: Add-ons description: | - If this value is omitted your existing add-ons will be removed. If you provide - a value for this field it will replace any existing add-ons. So, when adding or - modifying an add-on, you need to include the existing subscription add-ons. - Unchanged add-ons can be included just using the subscription add-on's ID: - `{"id": "abc123"}`. + If you provide a value for this field it will replace any + existing add-ons. So, when adding or modifying an add-on, you need to + include the existing subscription add-ons. Unchanged add-ons can be included + just using the subscription add-on''s ID: `{"id": "abc123"}`. If this + value is omitted your existing add-ons will be unaffected. To remove all + existing add-ons, this value should be an empty array.' If a subscription add-on's `code` is supplied without the `id`, `{"code": "def456"}`, the subscription add-on attributes will be set to the current values of the plan add-on unless provided in the request. @@ -20767,24 +19653,16 @@ - Attributes passed in as part of the request will override either of the above scenarios items: "$ref": "#/components/schemas/SubscriptionAddOnUpdate" collection_method: - type: string title: Collection method - enum: - - automatic - - manual default: automatic + "$ref": "#/components/schemas/CollectionMethodEnum" revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" custom_fields: "$ref": "#/components/schemas/CustomFields" po_number: type: string title: Purchase order number @@ -20800,28 +19678,14 @@ after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly. minimum: 0 default: 0 transaction_type: - type: string description: An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions. - enum: - - moto - billing_info: - "$ref": "#/components/schemas/SubscriptionChangeBillingInfoCreate" - ramp_intervals: - type: array - title: Ramp Intervals - description: The new set of ramp intervals for the subscription. - items: - "$ref": "#/components/schemas/SubscriptionRampInterval" - SubscriptionChangePreview: - type: object - allOf: - - "$ref": "#/components/schemas/SubscriptionChange" + "$ref": "#/components/schemas/GatewayTransactionTypeEnum" SubscriptionChangeShippingCreate: type: object title: Shipping details that will be changed on a subscription description: The shipping address can currently only be changed immediately, using SubscriptionUpdate. @@ -20866,24 +19730,20 @@ type: string title: Billing Info ID description: 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. `billing_info_id` can ONLY be - used for sites utilizing the Wallet feature. + will bill to the specified billing info. shipping: title: Shipping address description: Create a shipping address on the account and assign it to the subscription. "$ref": "#/components/schemas/SubscriptionShippingCreate" collection_method: - type: string title: Collection method - enum: - - automatic - - manual default: automatic + "$ref": "#/components/schemas/CollectionMethodEnum" currency: type: string title: Currency description: 3-letter ISO 4217 currency code. maxLength: 3 @@ -20894,17 +19754,10 @@ description: Override the unit amount of the subscription plan by setting this value. If not provided, the subscription will inherit the price from the subscription plan for the provided currency. minimum: 0 maximum: 1000000 - tax_inclusive: - type: boolean - title: Tax Inclusive? - default: false - description: Determines whether or not tax is included in the unit amount. - The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing - feature) must be enabled to use this flag. quantity: type: integer title: Quantity description: Optionally override the default quantity of 1. default: 1 @@ -20912,27 +19765,25 @@ add_ons: type: array title: Add-ons items: "$ref": "#/components/schemas/SubscriptionAddOnCreate" - coupon_code: - type: string - title: Redeem a coupon and discount the subscription - description: Optional coupon code to redeem on the account and discount - the subscription. Please note, the subscription request will fail if the - coupon is invalid. + coupon_codes: + type: array + title: Coupon codes + description: A list of coupon_codes to be redeemed on the subscription or + account during the purchase. + items: + type: string custom_fields: "$ref": "#/components/schemas/CustomFields" trial_ends_at: type: string format: date-time title: Trial ends at - description: IIf set, overrides the default trial behavior for the subscription. - When the current date time or a past date time is provided the subscription - will begin with no trial phase (overriding any plan default trial). When - a future date time is provided the subscription will begin with a trial - phase ending at the specified date time. + description: If set, overrides the default trial behavior for the subscription. + The date must be in the future. starts_at: type: string format: date-time title: Start date description: If set, the subscription will begin in the future on this date. @@ -20965,24 +19816,13 @@ auto_renew: type: boolean default: true title: Auto renew description: Whether the subscription renews at the end of its term. - ramp_intervals: - type: array - title: Ramp Intervals - description: The new set of ramp intervals for the subscription. - items: - "$ref": "#/components/schemas/SubscriptionRampInterval" revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" terms_and_conditions: type: string title: Terms and conditions description: This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes @@ -21015,16 +19855,14 @@ after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly. minimum: 0 default: 0 transaction_type: - type: string description: An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions. - enum: - - moto + "$ref": "#/components/schemas/GatewayTransactionTypeEnum" required: - plan_code - currency - account SubscriptionPurchase: @@ -21040,21 +19878,14 @@ unit_amount: type: number format: float title: Custom subscription pricing description: Override the unit amount of the subscription plan by setting - this value. If not provided, the subscription will inherit the price from - the subscription plan for the provided currency. + this value in cents. If not provided, the subscription will inherit the + price from the subscription plan for the provided currency. minimum: 0 maximum: 1000000 - tax_inclusive: - type: boolean - title: Tax Inclusive? - default: false - description: Determines whether or not tax is included in the unit amount. - The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing - feature) must be enabled to use this flag. quantity: type: integer title: Quantity description: Optionally override the default quantity of 1. default: 1 @@ -21074,14 +19905,11 @@ trial_ends_at: type: string format: date-time title: Trial ends at description: If set, overrides the default trial behavior for the subscription. - When the current date time or a past date time is provided the subscription - will begin with no trial phase (overriding any plan default trial). When - a future date time is provided the subscription will begin with a trial - phase ending at the specified date time. + The date must be in the future. starts_at: type: string format: date-time title: Start date description: If set, the subscription will begin in the future on this date. @@ -21115,34 +19943,20 @@ type: boolean default: true title: Auto renew description: Whether the subscription renews at the end of its term. revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start - ramp_intervals: - type: array - title: Ramp Intervals - description: The new set of ramp intervals for the subscription. - items: - "$ref": "#/components/schemas/SubscriptionRampInterval" + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" required: - plan_code SubscriptionUpdate: type: object properties: collection_method: - type: string title: Change collection method - enum: - - automatic - - manual + "$ref": "#/components/schemas/CollectionMethodEnum" custom_fields: "$ref": "#/components/schemas/CustomFields" remaining_billing_cycles: type: integer title: Remaining billing cycles @@ -21167,17 +19981,12 @@ the subscription’s billing to a specific day of the month. For a subscription in a trial period, this will change when the trial expires. This parameter is useful for postponement of a subscription to change its billing date without proration. revenue_schedule_type: - type: string title: Revenue schedule type - enum: - - never - - evenly - - at_range_end - - at_range_start + "$ref": "#/components/schemas/RevenueScheduleTypeEnum" terms_and_conditions: type: string title: Terms and conditions description: Specify custom notes to add or override Terms and Conditions. Custom notes will stay with a subscription on all renewals. @@ -21200,34 +20009,26 @@ are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly. minimum: 0 default: 0 - tax_inclusive: - type: boolean - title: Tax Inclusive? - default: false - description: This field is deprecated. Please do not use it. - deprecated: true shipping: "$ref": "#/components/schemas/SubscriptionShippingUpdate" billing_info_id: type: string title: Billing Info ID description: 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. `billing_info_id` can ONLY be - used for sites utilizing the Wallet feature. + will bill to the specified billing info. SubscriptionPause: type: object properties: remaining_pause_cycles: type: integer title: Remaining pause cycles - description: Number of billing cycles to pause the subscriptions. A value - of 0 will cancel any pending pauses on the subscription. + description: Number of billing cycles to pause the subscriptions. required: - remaining_pause_cycles SubscriptionShipping: type: object title: Subscription shipping details @@ -21311,111 +20112,31 @@ amount: type: number format: float title: Assigns the subscription's shipping cost. If this is greater than zero then a `method_id` or `method_code` is required. - SubscriptionRampInterval: - type: object - title: Subscription Ramp Interval - properties: - starting_billing_cycle: - type: integer - description: Represents the billing cycle where a ramp interval starts. - default: 1 - unit_amount: - type: integer - description: Represents the price for the ramp interval. - SubscriptionRampIntervalResponse: - type: object - title: Subscription Ramp Interval - properties: - starting_billing_cycle: - type: integer - description: Represents the billing cycle where a ramp interval starts. - remaining_billing_cycles: - type: integer - description: Represents how many billing cycles are left in a ramp interval. - unit_amount: - type: integer - description: Represents the price for the ramp interval. TaxInfo: type: object title: Tax info properties: type: type: string title: Type description: Provides the tax type as "vat" for EU VAT, "usst" for U.S. Sales Tax, or the 2 letter country code for country level tax types like Canada, Australia, New Zealand, Israel, and all non-EU European countries. - Not present when Avalara for Communications is enabled. region: type: string title: Region description: Provides the tax region applied on an invoice. For U.S. Sales Tax, this will be the 2 letter state code. For EU VAT this will be the 2 letter country code. For all country level tax types, this will display - the regional tax, like VAT, GST, or PST. Not present when Avalara for - Communications is enabled. + the regional tax, like VAT, GST, or PST. rate: type: number format: float title: Rate - description: The combined tax rate. Not present when Avalara for Communications - is enabled. - tax_details: - type: array - description: Provides additional tax details for Communications taxes when - Avalara for Communications is enabled or Canadian Sales Tax when there - is tax applied at both the country and province levels. This will only - be populated for the Invoice response when fetching a single invoice and - not for the InvoiceList or LineItemList. Only populated for a single LineItem - fetch when Avalara for Communications is enabled. - items: - "$ref": "#/components/schemas/TaxDetail" - TaxDetail: - type: object - title: Tax detail - properties: - type: - type: string - title: Type - description: Provides the tax type for the region or type of Comminications - tax when Avalara for Communications is enabled. For Canadian Sales Tax, - this will be GST, HST, QST or PST. - region: - type: string - title: Region - description: Provides the tax region applied on an invoice. For Canadian - Sales Tax, this will be either the 2 letter province code or country code. - Not present when Avalara for Communications is enabled. - rate: - type: number - format: float - title: Rate - description: Provides the tax rate for the region. - tax: - type: number - format: float - title: Tax - description: The total tax applied for this tax type. - name: - type: string - title: Name - description: Provides the name of the Communications tax applied. Present - only when Avalara for Communications is enabled. - level: - type: string - title: Level - description: Provides the jurisdiction level for the Communications tax - applied. Example values include city, state and federal. Present only - when Avalara for Communications is enabled. - billable: - type: boolean - title: Billable - description: Whether or not the line item is taxable. Only populated for - a single LineItem fetch when Avalara for Communications is enabled. Transaction: type: object properties: id: type: string @@ -21450,40 +20171,22 @@ items: type: string title: Subscription ID maxLength: 13 type: - type: string title: Transaction type description: | - `authorization` – verifies billing information and places a hold on money in the customer's account. - `capture` – captures funds held by an authorization and completes a purchase. - `purchase` – combines the authorization and capture in one transaction. - `refund` – returns all or a portion of the money collected in a previous transaction to the customer. - `verify` – a $0 or $1 transaction used to verify billing information which is immediately voided. - enum: - - authorization - - capture - - purchase - - refund - - verify + "$ref": "#/components/schemas/TransactionTypeEnum" origin: - type: string title: Origin of transaction description: Describes how the transaction was triggered. - enum: - - api - - hpp - - merchant - - recurly_admin - - recurlyjs - - recurring - - transparent - - force_collect - - refunded_externally - - chargeback - - external_recovery + "$ref": "#/components/schemas/TransactionOriginEnum" currency: type: string title: Currency description: 3-letter ISO 4217 currency code. maxLength: 3 @@ -21491,44 +20194,28 @@ type: number format: float title: Amount description: Total transaction amount sent to the payment gateway. status: - type: string title: Transaction status description: The current transaction status. Note that the status may change, e.g. a `pending` transaction may become `declined` or `success` may later become `void`. - enum: - - pending - - scheduled - - processing - - success - - void - - declined - - error - - chargeback + "$ref": "#/components/schemas/TransactionStatusEnum" success: type: boolean title: Success? description: Did this transaction complete successfully? - backup_payment_method_used: - type: boolean - title: Backup Payment Method Used? - description: Indicates if the transaction was completed using a backup payment refunded: type: boolean title: Refunded? description: Indicates if part or all of this transaction was refunded. billing_address: - "$ref": "#/components/schemas/Address" + "$ref": "#/components/schemas/AddressWithName" collection_method: - type: string description: The method by which the payment was collected. - enum: - - automatic - - manual + "$ref": "#/components/schemas/CollectionMethodEnum" payment_method: "$ref": "#/components/schemas/PaymentMethod" ip_address_v4: type: string title: IP address @@ -21538,12 +20225,11 @@ - When the customer enters billing information into the Recurly.js or Hosted Payment Pages, Recurly records the IP address. - When the merchant enters billing information using the API, the merchant may provide an IP address. - When the merchant enters billing information using the UI, no IP address is recorded. ip_address_country: type: string - title: Origin IP address country, 2-letter ISO 3166-1 alpha-2 code, if known - by Recurly. + title: IP address's country status_code: type: string title: Status code status_message: type: string @@ -21594,55 +20280,19 @@ gateway_response_values: type: object title: Gateway response values description: The values in this field will vary from gateway to gateway. cvv_check: - type: string title: CVV check description: When processed, result from checking the CVV/CVC value on the transaction. - enum: - - D - - I - - M - - N - - P - - S - - U - - X + "$ref": "#/components/schemas/CvvCheckEnum" avs_check: - type: string title: AVS check description: When processed, result from checking the overall AVS on the transaction. - enum: - - A - - B - - C - - D - - E - - F - - G - - H - - I - - J - - K - - L - - M - - N - - O - - P - - Q - - R - - S - - T - - U - - V - - W - - X - - Y - - Z + "$ref": "#/components/schemas/AvsCheckEnum" created_at: type: string format: date-time title: Created at updated_at: @@ -21662,24 +20312,12 @@ type: object properties: payment_method: type: string title: Payment Method - description: Payment method used for the external transaction. - enum: - - credit_card - - paypal - - amazon - - roku - - ach - - apple_pay - - sepadirectdebit - - eft - - wire_transfer - - money_order - - check - - other + description: Payment method used for external transaction. + "$ref": "#/components/schemas/ExternalPaymentMethodEnum" description: type: string title: Description description: Used as the transaction's description. maxLength: 50 @@ -21710,18 +20348,13 @@ code: type: string title: Coupon code description: The code the customer enters to redeem the coupon. state: - type: string title: State description: Indicates if the unique coupon code is redeemable or why not. - enum: - - redeemable - - maxed_out - - expired - - inactive + "$ref": "#/components/schemas/CouponCodeStateEnum" bulk_coupon_id: type: string title: Bulk Coupon ID description: The Coupon ID of the parent Bulk Coupon readOnly: true @@ -21766,10 +20399,31 @@ description: Path to subsequent page of results. data: type: array items: "$ref": "#/components/schemas/UniqueCouponCode" + UniqueCouponCodeParams: + type: object + description: Parameters to be passed to the `list_unique_coupon_codes` endpoint + to obtain the newly generated codes. + properties: + limit: + type: integer + title: The number of UniqueCouponCodes that will be generated + order: + type: string + title: Sort order to list newly generated UniqueCouponCodes (should always + be `asc`) + sort: + type: string + title: Sort field to list newly generated UniqueCouponCodes (should always + be `created_at`) + begin_time: + type: string + title: Begin time query parameter + description: The date-time to be included when listing UniqueCouponCodes + format: date-time Usage: type: object properties: id: type: string @@ -21782,34 +20436,18 @@ with the usage, so you can provide auditable usage displays to your customers using a GET on this endpoint. amount: type: number format: float - description: The amount of usage. Can be positive, negative, or 0. If the - Decimal Quantity feature is enabled, this value will be rounded to nine - decimal places. Otherwise, all digits after the decimal will be stripped. - If the usage-based add-on is billed with a percentage, your usage should - be a monetary amount formatted in cents (e.g., $5.00 is "500"). + description: The amount of usage. Can be positive, negative, or 0. No decimals + allowed, we will strip them. If the usage-based add-on is billed with + a percentage, your usage will be a monetary amount you will want to format + in cents. (e.g., $5.00 is "500"). usage_type: - type: string - enum: - - price - - percentage - title: Usage Type - description: Type of usage, returns usage type if `add_on_type` is `usage`. + "$ref": "#/components/schemas/UsageTypeEnum" tier_type: - type: string - title: Tier type - description: | - The pricing model for the add-on. For more information, - [click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). - default: flat - enum: - - flat - - tiered - - stairstep - - volume + "$ref": "#/components/schemas/TierTypeEnum" tiers: type: array title: Tiers items: "$ref": "#/components/schemas/SubscriptionAddOnTier" @@ -21836,10 +20474,16 @@ This can be up to 4 decimal places. A value between 0.0 and 100.0. unit_amount: type: number format: float title: Unit price + unit_amount_decimal: + type: string + title: Unit Amount Decimal + minimum: 0 + maximum: 1000000 + description: Unit price that can optionally support a sub-cent value. billed_at: type: string format: date-time description: When the usage record was billed on an invoice. created_at: @@ -21859,15 +20503,14 @@ with the usage, so you can provide auditable usage displays to your customers using a GET on this endpoint. amount: type: number format: float - description: The amount of usage. Can be positive, negative, or 0. If the - Decimal Quantity feature is enabled, this value will be rounded to nine - decimal places. Otherwise, all digits after the decimal will be stripped. - If the usage-based add-on is billed with a percentage, your usage should - be a monetary amount formatted in cents (e.g., $5.00 is "500"). + description: The amount of usage. Can be positive, negative, or 0. No decimals + allowed, we will strip them. If the usage-based add-on is billed with + a percentage, your usage will be a monetary amount you will want to format + in cents. (e.g., $5.00 is "500"). recording_timestamp: type: string format: date-time description: When the usage was recorded in your system. usage_timestamp: @@ -21931,26 +20574,21 @@ maxLength: 3 account: "$ref": "#/components/schemas/AccountPurchase" billing_info_id: type: string - title: Billing info ID description: 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. `billing_info_id` can ONLY be - used for sites utilizing the Wallet feature. + will bill to the specified billing info. collection_method: - type: string title: Collection method description: 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. - enum: - - automatic - - manual default: automatic + "$ref": "#/components/schemas/CollectionMethodEnum" po_number: type: string title: Purchase order number description: For manual invoicing, this identifies the PO number associated with the subscription. @@ -22032,209 +20670,24 @@ type: string title: Gift card redemption code description: A gift card redemption code to be redeemed on the purchase invoice. transaction_type: - type: string description: An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions. - enum: - - moto + "$ref": "#/components/schemas/GatewayTransactionTypeEnum" required: - currency - account - DunningCampaign: - type: object - description: Settings for a dunning campaign. - properties: - id: - type: string - object: - type: string - title: Object type - code: - type: string - description: Campaign code. - name: - type: string - description: Campaign name. - description: - type: string - description: Campaign description. - default_campaign: - type: boolean - description: Whether or not this is the default campaign for accounts or - plans without an assigned dunning campaign. - dunning_cycles: - type: array - description: Dunning Cycle settings. - items: - "$ref": "#/components/schemas/DunningCycle" - created_at: - type: string - format: date-time - description: When the current campaign was created in Recurly. - updated_at: - type: string - format: date-time - description: When the current campaign was updated in Recurly. - deleted_at: - type: string - format: date-time - description: When the current campaign was deleted in Recurly. - DunningCampaignList: - type: object - properties: - object: - type: string - title: Object type - description: Will always be List. - has_more: - type: boolean - description: Indicates there are more results on subsequent pages. - next: - type: string - description: Path to subsequent page of results. - data: - type: array - items: - "$ref": "#/components/schemas/DunningCampaign" - DunningCycle: - type: object - properties: - type: - type: string - description: The type of invoice this cycle applies to. - enum: - - automatic - - manual - - trial - applies_to_manual_trial: - type: boolean - description: Whether the dunning settings will be applied to manual trials. - Only applies to trial cycles. - first_communication_interval: - type: integer - description: The number of days after a transaction failure before the first - dunning email is sent. - send_immediately_on_hard_decline: - type: boolean - description: Whether or not to send an extra email immediately to customers - whose initial payment attempt fails with either a hard decline or invalid - billing info. - intervals: - type: array - description: Dunning intervals. - items: - "$ref": "#/components/schemas/DunningInterval" - expire_subscription: - type: boolean - description: Whether the subscription(s) should be cancelled at the end - of the dunning cycle. - fail_invoice: - type: boolean - description: Whether the invoice should be failed at the end of the dunning - cycle. - total_dunning_days: - type: integer - description: The number of days between the first dunning email being sent - and the end of the dunning cycle. - total_recycling_days: - type: integer - description: The number of days between a transaction failure and the end - of the dunning cycle. - version: - type: integer - description: Current campaign version. - created_at: - type: string - format: date-time - description: When the current settings were created in Recurly. - updated_at: - type: string - format: date-time - description: When the current settings were updated in Recurly. - DunningInterval: - properties: - days: - type: integer - description: Number of days before sending the next email. - email_template: - type: string - description: Email template being used. - DunningCampaignsBulkUpdate: - properties: - plan_codes: - type: array - maxItems: 200 - description: List of `plan_codes` associated with the Plans for which the - dunning campaign should be updated. Required unless `plan_ids` is present. - items: - type: string - plan_ids: - type: array - maxItems: 200 - description: List of `plan_ids` associated with the Plans for which the - dunning campaign should be updated. Required unless `plan_codes` is present. - items: - type: string - DunningCampaignsBulkUpdateResponse: - properties: - object: - type: string - title: Object type - readOnly: true - plans: - type: array - title: Plans - description: An array containing all of the `Plan` resources that have been - updated. - maxItems: 200 - items: - "$ref": "#/components/schemas/Plan" PaymentMethod: properties: object: - type: string - enum: - - bacs - - credit_card - - paypal - - amazon - - roku - - bank_account_info - - apple_pay - - sepadirectdebit - - eft - - wire_transfer - - money_order - - check - - amazon_billing_agreement - - paypal_billing_agreement - - gateway_token - - iban_bank_account - - other - - braintree_v_zero + "$ref": "#/components/schemas/PaymentMethodEnum" card_type: - type: string description: Visa, MasterCard, American Express, Discover, JCB, etc. - enum: - - American Express - - Dankort - - Diners Club - - Discover - - Forbrugsforeningen - - JCB - - Laser - - Maestro - - MasterCard - - Test Card - - Union Pay - - Unknown - - Visa - - Tarjeta Naranja + "$ref": "#/components/schemas/CardTypeEnum" first_six: type: string description: Credit card number's first six digits. maxLength: 6 last_four: @@ -22257,42 +20710,24 @@ gateway_token: type: string description: A token used in place of a credit card in order to perform transactions. maxLength: 50 - cc_bin_country: - type: string - description: The 2-letter ISO 3166-1 alpha-2 country code associated with - the credit card BIN, if known by Recurly. Available on the BillingInfo - object only. Available when the BIN country lookup feature is enabled. gateway_code: type: string description: An identifier for a specific payment gateway. maxLength: 13 - gateway_attributes: - type: object - description: Gateway specific attributes associated with this PaymentMethod - x-class-name: GatewayAttributes - properties: - account_reference: - type: string - description: Used by Adyen gateways. The Shopper Reference value used - when the external token was created. - maxLength: 264 billing_agreement_id: type: string description: Billing Agreement identifier. Only present for Amazon or Paypal payment methods. name_on_account: type: string description: The name associated with the bank account. account_type: - type: string description: The bank account type. Only present for ACH payment methods. - enum: - - checking - - savings + "$ref": "#/components/schemas/AccountTypeEnum" routing_number: type: string description: The bank account's routing number. Only present for ACH payment methods. routing_number_bank: @@ -22300,32 +20735,12 @@ description: The bank name of this routing number. Error: type: object properties: type: - type: string title: Type - enum: - - bad_request - - internal_server_error - - immutable_subscription - - invalid_api_key - - invalid_api_version - - invalid_content_type - - invalid_permissions - - invalid_token - - not_found - - service_not_available - - simultaneous_request - - transaction - - unauthorized - - unavailable_in_api_version - - unknown_api_version - - validation - - missing_feature - - rate_limited - - tax_service_error + "$ref": "#/components/schemas/ErrorTypeEnum" message: type: string title: Message params: type: array @@ -22352,157 +20767,15 @@ transaction_id: type: string title: Transaction ID maxLength: 13 category: - type: string title: Category - enum: - - 3d_secure_required - - 3d_secure_action_required - - amazon - - api_error - - approved - - communication - - configuration - - duplicate - - fraud - - hard - - invalid - - not_enabled - - not_supported - - recurly - - referral - - skles - - soft - - unknown + "$ref": "#/components/schemas/ErrorCategoryEnum" code: - type: string title: Code - enum: - - ach_cancel - - ach_chargeback - - ach_credit_return - - ach_exception - - ach_return - - ach_transactions_not_supported - - ach_validation_exception - - amazon_amount_exceeded - - amazon_invalid_authorization_status - - amazon_invalid_close_attempt - - amazon_invalid_create_order_reference - - amazon_invalid_order_status - - amazon_not_authorized - - amazon_order_not_modifiable - - amazon_transaction_count_exceeded - - api_error - - approved - - approved_fraud_review - - authorization_already_captured - - authorization_amount_depleted - - authorization_expired - - batch_processing_error - - billing_agreement_already_accepted - - billing_agreement_not_accepted - - billing_agreement_not_found - - billing_agreement_replaced - - call_issuer - - call_issuer_update_cardholder_data - - cannot_refund_unsettled_transactions - - card_not_activated - - card_type_not_accepted - - cardholder_requested_stop - - contact_gateway - - currency_not_supported - - customer_canceled_transaction - - cvv_required - - declined - - declined_card_number - - declined_exception - - declined_expiration_date - - declined_missing_data - - declined_saveable - - declined_security_code - - deposit_referenced_chargeback - - duplicate_transaction - - exceeds_daily_limit - - expired_card - - finbot_unavailable - - fraud_address - - fraud_address_recurly - - fraud_advanced_verification - - fraud_gateway - - fraud_generic - - fraud_ip_address - - fraud_risk_check - - fraud_security_code - - fraud_stolen_card - - fraud_too_many_attempts - - fraud_velocity - - gateway_error - - gateway_rate_limited - - gateway_timeout - - gateway_token_not_found - - gateway_unavailable - - insufficient_funds - - invalid_account_number - - invalid_amount - - invalid_card_number - - invalid_data - - invalid_email - - invalid_gateway_configuration - - invalid_gateway_access_token - - invalid_issuer - - invalid_login - - invalid_merchant_type - - invalid_transaction - - issuer_unavailable - - merch_max_transaction_limit_exceeded - - moneybot_unavailable - - no_billing_information - - no_gateway - - no_gateway_found_for_transaction_amount - - partial_approval - - partial_credits_not_supported - - payment_cannot_void_authorization - - payment_not_accepted - - paypal_account_issue - - paypal_cannot_pay_self - - paypal_declined_use_alternate - - paypal_expired_reference_id - - paypal_hard_decline - - paypal_invalid_billing_agreement - - paypal_primary_declined - - processor_unavailable - - recurly_error - - recurly_failed_to_get_token - - recurly_token_mismatch - - recurly_token_not_found - - reference_transactions_not_enabled - - restricted_card - - restricted_card_chargeback - - simultaneous - - ssl_error - - temporary_hold - - three_d_secure_authentication - - three_d_secure_not_supported - - too_many_attempts - - total_credit_exceeds_capture - - transaction_already_refunded - - transaction_already_voided - - transaction_cannot_be_authorized - - transaction_cannot_be_refunded - - transaction_cannot_be_refunded_currently - - transaction_cannot_be_voided - - transaction_failed_to_settle - - transaction_not_found - - transaction_settled - - transaction_stale_at_gateway - - try_again - - unknown - - vaultly_service_unavailable - - zero_dollar_auth_not_supported + "$ref": "#/components/schemas/ErrorCodeEnum" message: type: string title: Customer message merchant_advice: type: string @@ -22512,10 +20785,705 @@ title: 3-D Secure action token id description: Returned when 3-D Secure authentication is required for a transaction. Pass this value to Recurly.js so it can continue the challenge flow. maxLength: 22 + RelatedTypeEnum: + type: string + enum: + - account + - item + - subscription + RefundTypeEnum: + type: string + enum: + - full + - none + - partial + AlphanumericSortEnum: + type: string + enum: + - asc + - desc + UsageSortEnum: + type: string + default: usage_timestamp + enum: + - recorded_timestamp + - usage_timestamp + UsageTypeEnum: + type: string + enum: + - price + - percentage + title: Usage Type + description: Type of usage, returns usage type if `add_on_type` is `usage`. + BillingStatusEnum: + type: string + default: unbilled + enum: + - unbilled + - billed + - all + TimestampSortEnum: + type: string + enum: + - created_at + - updated_at + ActiveStateEnum: + type: string + enum: + - active + - inactive + FilterSubscriptionStateEnum: + type: string + enum: + - active + - canceled + - expired + - future + - in_trial + - live + TrueEnum: + type: string + enum: + - true + LineItemStateEnum: + type: string + enum: + - invoiced + - pending + LineItemTypeEnum: + type: string + enum: + - charge + - credit + FilterTransactionTypeEnum: + type: string + enum: + - authorization + - capture + - payment + - purchase + - refund + - verify + FilterInvoiceTypeEnum: + type: string + enum: + - charge + - credit + - legacy + - non-legacy + ChannelEnum: + type: string + enum: + - advertising + - blog + - direct_traffic + - email + - events + - marketing_content + - organic_search + - other + - outbound_sales + - paid_search + - public_relations + - referral + - social_media + PreferredLocaleEnum: + type: string + enum: + - da-DK + - de-CH + - de-DE + - en-AU + - en-CA + - en-GB + - en-NZ + - en-US + - es-ES + - es-MX + - es-US + - fr-CA + - fr-FR + - hi-IN + - ja-JP + - nl-BE + - nl-NL + - pt-BR + - pt-PT + - ru-RU + - tr-TR + - zh-CN + BillToEnum: + type: string + enum: + - parent + - self + GatewayTransactionTypeEnum: + type: string + enum: + - moto + KountDecisionEnum: + type: string + enum: + - approve + - decline + - escalate + - review + CouponStateEnum: + type: string + enum: + - expired + - maxed_out + - redeemable + CouponDurationEnum: + type: string + enum: + - forever + - single_use + - temporal + TemporalUnitEnum: + type: string + enum: + - day + - month + - week + - year + FreeTrialUnitEnum: + type: string + enum: + - day + - month + - week + RedemptionResourceEnum: + type: string + enum: + - account + - subscription + CouponTypeEnum: + type: string + enum: + - bulk + - single_code + DiscountTypeEnum: + type: string + enum: + - fixed + - free_trial + - percent + AddOnSourceEnum: + type: string + title: Add-on source + description: | + Used to determine where the associated add-on data is pulled from. If this value is set to + `plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated + `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then + the associated add-on data will be pulled from the site's item catalog. + default: plan_add_on + enum: + - plan_add_on + - item + AddOnTypeEnum: + type: string + enum: + - fixed + - usage + title: Add-on Type + description: Whether the add-on type is fixed, or usage-based. + AddOnTypeCreateEnum: + type: string + enum: + - fixed + - usage + title: Add-on Type + description: Whether the add-on type is fixed, or usage-based. + default: fixed + UsageTypeCreateEnum: + type: string + enum: + - price + - percentage + title: Usage Type + description: | + Type of usage, required if `add_on_type` is `usage`. See our + [Guide](https://developers.recurly.com/guides/usage-based-billing-guide.html) for an + overview of how to configure usage add-ons. + TierTypeEnum: + type: string + title: Tier type + description: | + The pricing model for the add-on. For more information, + [click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). See our + [Guide](https://developers.recurly.com/guides/item-addon-guide.html) for an overview of how + to configure quantity-based pricing models. + default: flat + enum: + - flat + - tiered + - stairstep + - volume + CreditPaymentActionEnum: + type: string + enum: + - payment + - reduction + - refund + - write_off + UserAccessEnum: + type: string + enum: + - api_only + - read_only + - write + RevenueScheduleTypeEnum: + type: string + enum: + - at_range_end + - at_range_start + - evenly + - never + InvoiceTypeEnum: + type: string + enum: + - charge + - credit + - legacy + OriginEnum: + type: string + enum: + - credit + - gift_card + - immediate_change + - line_item_refund + - open_amount_refund + - purchase + - renewal + - termination + - write_off + - prepayment + InvoiceStateEnum: + type: string + enum: + - open + - pending + - processing + - past_due + - paid + - closed + - failed + - voided + CollectionMethodEnum: + type: string + enum: + - automatic + - manual + InvoiceRefundTypeEnum: + type: string + enum: + - amount + - line_items + RefuneMethodEnum: + type: string + enum: + - all_credit + - all_transaction + - credit_first + - transaction_first + ExternalPaymentMethodEnum: + type: string + enum: + - ach + - amazon + - apple_pay + - check + - credit_card + - eft + - money_order + - other + - paypal + - roku + - sepadirectdebit + - wire_transfer + LineItemRevenueScheduleTypeEnum: + type: string + enum: + - at_invoice + - at_range_end + - at_range_start + - evenly + - never + LegacyCategoryEnum: + type: string + enum: + - applied_credit + - carryforward + - charge + - credit + LineItemOriginEnum: + type: string + enum: + - add_on + - add_on_trial + - carryforward + - coupon + - credit + - debit + - one_time + - plan + - plan_trial + - setup_fee + - prepayment + FullCreditReasonCodeEnum: + type: string + enum: + - general + - gift_card + - promotional + - refund + - service + - write_off + PartialCreditReasonCodeEnum: + type: string + enum: + - general + - promotional + - service + LineItemCreateOriginEnum: + type: string + enum: + - external_gift_card + - prepayment + IntervalUnitEnum: + type: string + enum: + - days + - months + AddressRequirementEnum: + type: string + enum: + - full + - none + - streetzip + - zip + SiteModeEnum: + type: string + enum: + - development + - production + - sandbox + FeaturesEnum: + type: string + enum: + - credit_memos + - manual_invoicing + - only_bill_what_changed + - subscription_terms + SubscriptionStateEnum: + type: string + enum: + - active + - canceled + - expired + - failed + - future + - paused + TimeframeEnum: + type: string + enum: + - bill_date + - term_end + ChangeTimeframeEnum: + type: string + enum: + - bill_date + - now + - renewal + - term_end + TransactionTypeEnum: + type: string + enum: + - authorization + - capture + - purchase + - refund + - verify + TransactionOriginEnum: + type: string + enum: + - api + - chargeback + - force_collect + - hpp + - merchant + - recurly_admin + - recurlyjs + - recurring + - refunded_externally + - transparent + TransactionStatusEnum: + type: string + enum: + - chargeback + - declined + - error + - pending + - processing + - scheduled + - success + - void + CvvCheckEnum: + type: string + enum: + - D + - I + - M + - N + - P + - S + - U + - X + AvsCheckEnum: + type: string + enum: + - A + - B + - C + - D + - E + - F + - G + - H + - I + - J + - K + - L + - M + - N + - O + - P + - Q + - R + - S + - T + - U + - V + - W + - X + - Y + - Z + CouponCodeStateEnum: + type: string + enum: + - expired + - inactive + - maxed_out + - redeemable + PaymentMethodEnum: + type: string + enum: + - amazon + - amazon_billing_agreement + - apple_pay + - bank_account_info + - check + - credit_card + - eft + - gateway_token + - iban_bank_account + - money_order + - other + - paypal + - paypal_billing_agreement + - roku + - sepadirectdebit + - wire_transfer + CardTypeEnum: + type: string + enum: + - American Express + - Dankort + - Diners Club + - Discover + - Forbrugsforeningen + - JCB + - Laser + - Maestro + - MasterCard + - Test Card + - Union Pay + - Unknown + - Visa + AccountTypeEnum: + type: string + enum: + - checking + - savings + ErrorTypeEnum: + type: string + enum: + - bad_request + - immutable_subscription + - internal_server_error + - invalid_api_key + - invalid_api_version + - invalid_content_type + - invalid_permissions + - invalid_token + - missing_feature + - not_found + - rate_limited + - service_not_available + - simultaneous_request + - transaction + - unauthorized + - unavailable_in_api_version + - unknown_api_version + - validation + ErrorCategoryEnum: + type: string + enum: + - three_d_secure_required + - three_d_secure_action_required + - amazon + - api_error + - approved + - communication + - configuration + - duplicate + - fraud + - hard + - invalid + - not_enabled + - not_supported + - recurly + - referral + - skles + - soft + - unknown + ErrorCodeEnum: + type: string + enum: + - ach_cancel + - ach_chargeback + - ach_credit_return + - ach_exception + - ach_return + - ach_transactions_not_supported + - ach_validation_exception + - amazon_amount_exceeded + - amazon_invalid_authorization_status + - amazon_invalid_close_attempt + - amazon_invalid_create_order_reference + - amazon_invalid_order_status + - amazon_not_authorized + - amazon_order_not_modifiable + - amazon_transaction_count_exceeded + - api_error + - approved + - approved_fraud_review + - authorization_already_captured + - authorization_amount_depleted + - authorization_expired + - batch_processing_error + - billing_agreement_already_accepted + - billing_agreement_not_accepted + - call_issuer + - call_issuer_update_cardholder_data + - cannot_refund_unsettled_transactions + - card_not_activated + - card_type_not_accepted + - cardholder_requested_stop + - contact_gateway + - currency_not_supported + - customer_canceled_transaction + - cvv_required + - declined + - declined_card_number + - declined_exception + - declined_expiration_date + - declined_missing_data + - declined_saveable + - declined_security_code + - deposit_referenced_chargeback + - duplicate_transaction + - exceeds_daily_limit + - expired_card + - finbot_unavailable + - fraud_address + - fraud_address_recurly + - fraud_advanced_verification + - fraud_gateway + - fraud_generic + - fraud_ip_address + - fraud_risk_check + - fraud_security_code + - fraud_stolen_card + - fraud_too_many_attempts + - fraud_velocity + - gateway_error + - gateway_rate_limited + - gateway_timeout + - gateway_token_not_found + - gateway_unavailable + - insufficient_funds + - invalid_account_number + - invalid_amount + - invalid_card_number + - invalid_data + - invalid_email + - invalid_gateway_configuration + - invalid_issuer + - invalid_login + - invalid_merchant_type + - invalid_transaction + - issuer_unavailable + - merch_max_transaction_limit_exceeded + - moneybot_unavailable + - no_billing_information + - no_gateway + - no_gateway_found_for_transaction_amount + - partial_approval + - partial_credits_not_supported + - payment_cannot_void_authorization + - payment_not_accepted + - paypal_account_issue + - paypal_cannot_pay_self + - paypal_declined_use_alternate + - paypal_expired_reference_id + - paypal_hard_decline + - paypal_invalid_billing_agreement + - paypal_primary_declined + - processor_unavailable + - recurly_error + - recurly_failed_to_get_token + - recurly_token_mismatch + - recurly_token_not_found + - reference_transactions_not_enabled + - restricted_card + - restricted_card_chargeback + - simultaneous + - ssl_error + - temporary_hold + - three_d_secure_authentication + - three_d_secure_not_supported + - too_many_attempts + - total_credit_exceeds_capture + - transaction_already_refunded + - transaction_already_voided + - transaction_cannot_be_authorized + - transaction_cannot_be_refunded + - transaction_cannot_be_refunded_currently + - transaction_cannot_be_voided + - transaction_failed_to_settle + - transaction_not_found + - transaction_settled + - transaction_stale_at_gateway + - try_again + - unknown + - vaultly_service_unavailable + - zero_dollar_auth_not_supported ExportDates: type: object properties: object: type: string @@ -22550,5 +21518,9 @@ description: MD5 hash of the export file. href: type: string title: A link to the export file description: A presigned link to download the export file. + TaxIdentifierTypeEnum: + type: string + enum: + - cpf