From 6bd22d802fcd792ad609de25b8127f1b6dce8f03 Mon Sep 17 00:00:00 2001 From: DX Codefresh Date: Tue, 8 Nov 2022 20:16:27 +0000 Subject: [PATCH] Generated Latest Changes for v2021-02-25 --- lib/recurly.d.ts | 260 ++++++++++- lib/recurly/Client.js | 109 ++++- lib/recurly/resources/AddOn.js | 4 +- lib/recurly/resources/ExternalProduct.js | 37 ++ .../resources/ExternalProductReferenceMini.js | 35 ++ lib/recurly/resources/ExternalResourceMini.js | 29 ++ lib/recurly/resources/ExternalSubscription.js | 49 ++ lib/recurly/resources/Plan.js | 2 + lib/recurly/resources/SubscriptionAddOn.js | 4 +- lib/recurly/resources/Usage.js | 2 +- lib/recurly/resources/index.js | 4 + openapi/api.yaml | 417 +++++++++++++++++- package-lock.json | 4 +- 13 files changed, 908 insertions(+), 48 deletions(-) create mode 100644 lib/recurly/resources/ExternalProduct.js create mode 100644 lib/recurly/resources/ExternalProductReferenceMini.js create mode 100644 lib/recurly/resources/ExternalResourceMini.js create mode 100644 lib/recurly/resources/ExternalSubscription.js diff --git a/lib/recurly.d.ts b/lib/recurly.d.ts index 86b5ac2f..955ed3b9 100644 --- a/lib/recurly.d.ts +++ b/lib/recurly.d.ts @@ -2009,9 +2009,13 @@ export declare class SubscriptionAddOn { */ revenueScheduleType?: string | null; /** - * 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. + * 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. */ tierType?: string | null; + /** + * The type of calculation to be employed for an add-on. Cumulative billing will sum all usage records created in the current billing cycle. Last-in-period billing will apply only the most recent usage record in the billing period. If no value is specified, cumulative billing will be used. + */ + usageCalculationType?: string | null; /** * The time at which usage totals are reset for billing purposes. */ @@ -2387,6 +2391,138 @@ export declare class MeasuredUnit { } +export declare class ExternalProduct { + /** + * System-generated unique identifier for an external product ID, e.g. `e28zov4fw0v2`. + */ + id?: string | null; + /** + * Object type + */ + object?: string | null; + /** + * Name to identify the external product in Recurly. + */ + name?: string | null; + /** + * Just the important parts. + */ + plan?: PlanMini | null; + /** + * When the external product was created in Recurly. + */ + createdAt?: Date | null; + /** + * When the external product was updated in Recurly. + */ + updatedAt?: Date | null; + /** + * List of external product references of the external product. + */ + externalProductReferences?: ExternalProductReferenceMini[] | null; + +} + +export declare class ExternalProductReferenceMini { + /** + * System-generated unique identifier for an external product ID, e.g. `e28zov4fw0v2`. + */ + id?: string | null; + /** + * object + */ + object?: string | null; + /** + * A code which associates the external product to a corresponding object or resource in an external platform like the Apple App Store or Google Play Store. + */ + referenceCode?: string | null; + /** + * Source connection platform. + */ + externalConnectionType?: string | null; + /** + * When the external product was created in Recurly. + */ + createdAt?: Date | null; + /** + * When the external product was updated in Recurly. + */ + updatedAt?: Date | null; + +} + +export declare class ExternalSubscription { + /** + * System-generated unique identifier for an external subscription ID, e.g. `e28zov4fw0v2`. + */ + id?: string | null; + /** + * Object type + */ + object?: string | null; + /** + * Account mini details + */ + account?: AccountMini | null; + /** + * External Resource mini details + */ + externalResource?: ExternalResourceMini | null; + /** + * External Product Reference details + */ + externalProductReference?: ExternalProductReferenceMini | null; + /** + * When a new billing event occurred on the external subscription in conjunction with a recent billing period, reactivation or upgrade/downgrade. + */ + lastPurchased?: Date | null; + /** + * An indication of whether or not the external subscription will auto-renew at the expiration date. + */ + autoRenew?: boolean | null; + /** + * Identifier of the app that generated the external subscription. + */ + appIdentifier?: string | null; + /** + * An indication of the quantity of a subscribed item's quantity. + */ + quantity?: number | null; + /** + * When the external subscription was activated in the external platform. + */ + activatedAt?: Date | null; + /** + * When the external subscription expires in the external platform. + */ + expiresAt?: Date | null; + /** + * When the external subscription was created in Recurly. + */ + createdAt?: Date | null; + /** + * When the external subscription was updated in Recurly. + */ + updatedAt?: Date | null; + +} + +export declare class ExternalResourceMini { + /** + * System-generated unique identifier for an external resource ID, e.g. `e28zov4fw0v2`. + */ + id?: string | null; + /** + * Object type + */ + object?: string | null; + /** + * Identifier or URL reference where the resource is canonically available in the external platform. + */ + externalObjectReference?: string | null; + +} + export declare class BinaryFile { data?: string | null; @@ -2453,6 +2589,10 @@ export declare class Plan { * Ramp Intervals */ rampIntervals?: PlanRampInterval[] | null; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value. + */ + customFields?: CustomField[] | null; /** * Revenue schedule type */ @@ -2613,6 +2753,10 @@ export declare class AddOn { * Type of usage, returns usage type if `add_on_type` is `usage`. */ usageType?: string | null; + /** + * The type of calculation to be employed for an add-on. Cumulative billing will sum all usage records created in the current billing cycle. Last-in-period billing will apply only the most recent usage record in the billing period. If no value is specified, cumulative billing will be used. + */ + usageCalculationType?: string | null; /** * 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. */ @@ -2662,7 +2806,7 @@ export declare class AddOn { */ item?: ItemMini | null; /** - * 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. + * 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. */ tierType?: string | null; /** @@ -2831,7 +2975,7 @@ export declare class Usage { */ usageType?: string | null; /** - * 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. + * 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. */ tierType?: string | null; /** @@ -3310,7 +3454,7 @@ export interface Address { export interface BillingInfoCreate { /** - * A token [generated by Recurly.js](https://developers.recurly.com/reference/recurly-js/#getting-a-token). + * A token [generated by Recurly.js](https://recurly.com/developers/reference/recurly-js/#getting-a-token). */ tokenId?: string | null; /** @@ -4211,6 +4355,10 @@ export interface PlanCreate { * Ramp Intervals */ rampIntervals?: PlanRampInterval[] | null; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value. + */ + customFields?: CustomField[] | null; /** * Revenue schedule type */ @@ -4348,9 +4496,13 @@ export interface AddOnCreate { */ addOnType?: string | null; /** - * 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. + * 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. */ usageType?: string | null; + /** + * The type of calculation to be employed for an add-on. Cumulative billing will sum all usage records created in the current billing cycle. Last-in-period billing will apply only the most recent usage record in the billing period. If no value is specified, cumulative billing will be used. + */ + usageCalculationType?: string | null; /** * 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, `tier_type` is `flat` and `usage_type` is percentage. Must be omitted otherwise. */ @@ -4404,7 +4556,7 @@ export interface AddOnCreate { */ currencies?: AddOnPricing[] | null; /** - * 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. + * 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. */ tierType?: string | null; /** @@ -4543,6 +4695,10 @@ export interface PlanUpdate { * Ramp Intervals */ rampIntervals?: PlanRampInterval[] | null; + /** + * The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value. + */ + customFields?: CustomField[] | null; /** * Revenue schedule type */ @@ -4607,6 +4763,10 @@ export interface AddOnUpdate { * 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, `tier_type` is `flat` and `usage_type` is percentage. Must be omitted otherwise. */ usagePercentage?: number | null; + /** + * The type of calculation to be employed for an add-on. Cumulative billing will sum all usage records created in the current billing cycle. Last-in-period billing will apply only the most recent usage record in the billing period. If no value is specified, cumulative billing will be used. + */ + usageCalculationType?: string | null; /** * System-generated unique identifier for a measured unit to be associated with the add-on. Either `measured_unit_id` or `measured_unit_name` are required when `add_on_type` is `usage`. If `measured_unit_id` and `measured_unit_name` are both present, `measured_unit_id` will be used. */ @@ -4854,7 +5014,7 @@ export interface SubscriptionAddOnCreate { */ unitAmountDecimal?: string | null; /** - * 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 without an `ending_quantity` value which represents the final tier. See our [Guide](https://developers.recurly.com/guides/item-addon-guide.html) for an overview of how to configure quantity-based pricing models. + * 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 without an `ending_quantity` value which represents the final tier. See our [Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an overview of how to configure quantity-based pricing models. */ tiers?: SubscriptionAddOnTier[] | null; /** @@ -4862,7 +5022,7 @@ export interface SubscriptionAddOnCreate { */ percentageTiers?: SubscriptionAddOnPercentageTier[] | null; /** - * The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is percentage. Must be omitted otherwise. `usage_percentage` does not support tiers. See our [Guide](https://developers.recurly.com/guides/usage-based-billing-guide.html) for an overview of how to configure usage add-ons. + * 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) for an overview of how to configure usage add-ons. */ usagePercentage?: number | null; /** @@ -5992,7 +6152,7 @@ export declare class Client { */ removeABillingInfo(accountId: string, billingInfoId: string): Promise; /** - * Show the coupon redemptions for an account + * List the coupon redemptions for an account * * API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_coupon_redemptions * @@ -6033,7 +6193,7 @@ export declare class Client { */ listAccountCouponRedemptions(accountId: string, options?: object): Pager; /** - * Show the coupon redemptions that are active on an account + * List the coupon redemptions that are active on an account * * API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_active_coupon_redemptions * @@ -6303,7 +6463,7 @@ export declare class Client { */ createLineItem(accountId: string, body: LineItemCreate): Promise; /** - * Fetch a list of an account's notes + * List an account's notes * * API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_notes * @@ -7310,6 +7470,56 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. * @return {Promise} A measured unit. */ removeMeasuredUnit(measuredUnitId: string): Promise; + /** + * List a site's external products + * + * API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_external_products + * + * + * @param {Object} options - Optional configurations for the request + * @param {Object} options.params - The optional url parameters for this request. + * @param {string} options.params.sort - 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. + * + * @return {Pager} A list of the the external_products on a site. + */ + listExternalProducts(options?: object): Pager; + /** + * Fetch an external product + * + * API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_external_product + * + * + * @param {string} externalProductId - External product id + * @return {Promise} Settings for an external product. + */ + getExternalProduct(externalProductId: string): Promise; + /** + * List a site's external subscriptions + * + * API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_external_subscriptions + * + * + * @param {Object} options - Optional configurations for the request + * @param {Object} options.params - The optional url parameters for this request. + * @param {string} options.params.sort - 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. + * + * @return {Pager} A list of the the external_subscriptions on a site. + */ + listExternalSubscriptions(options?: object): Pager; + /** + * Fetch an external subscription + * + * API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_external_subscription + * + * + * @param {string} externalSubscriptionId - External subscription id + * @return {Promise} Settings for an external subscription. + */ + getExternalSubscription(externalSubscriptionId: string): Promise; /** * List a site's invoices * @@ -7653,7 +7863,7 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. */ listInvoiceLineItems(invoiceId: string, options?: object): Pager; /** - * Show the coupon redemptions applied to an invoice + * List the coupon redemptions applied to an invoice * * API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_coupon_redemptions * @@ -8805,7 +9015,7 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. */ listSubscriptionLineItems(subscriptionId: string, options?: object): Pager; /** - * Show the coupon redemptions for a subscription + * List the coupon redemptions for a subscription * * API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_coupon_redemptions * @@ -9189,7 +9399,7 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. */ getExportFiles(exportDate: string): Promise; /** - * Show the dunning campaigns for a site + * List the dunning campaigns for a site * * API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_dunning_campaigns * @@ -9204,7 +9414,7 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. */ listDunningCampaigns(options?: object): Pager; /** - * Show the settings for a dunning campaign + * Fetch a dunning campaign * * API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_dunning_campaign * @@ -9240,7 +9450,7 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. */ listInvoiceTemplates(options?: object): Pager; /** - * Show the settings for an invoice template + * Fetch an invoice template * * API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_invoice_template * @@ -9250,7 +9460,7 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. */ getInvoiceTemplate(invoiceTemplateId: string): Promise; /** - * Show all entitlements granted to an account + * List entitlements granted to an account * * API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_entitlements * @@ -9266,6 +9476,22 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. * @return {Pager} A list of the entitlements granted to an account. */ listEntitlements(accountId: string, options?: object): Pager; + /** + * List an account's external subscriptions + * + * API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_account_external_subscriptions + * + * + * @param {string} accountId - Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. + * @param {Object} options - Optional configurations for the request + * @param {Object} options.params - The optional url parameters for this request. + * @param {string} options.params.sort - 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. + * + * @return {Pager} A list of the the external_subscriptions on an account. + */ + listAccountExternalSubscriptions(accountId: string, options?: object): Pager; } diff --git a/lib/recurly/Client.js b/lib/recurly/Client.js index e0df82b1..76f4eb1b 100644 --- a/lib/recurly/Client.js +++ b/lib/recurly/Client.js @@ -683,7 +683,7 @@ class Client extends BaseClient { } /** - * Show the coupon redemptions for an account + * List the coupon redemptions for an account * * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_account_coupon_redemptions} * @@ -729,7 +729,7 @@ class Client extends BaseClient { } /** - * Show the coupon redemptions that are active on an account + * List the coupon redemptions that are active on an account * * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_active_coupon_redemptions} * @@ -1044,7 +1044,7 @@ class Client extends BaseClient { } /** - * Fetch a list of an account's notes + * List an account's notes * * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_account_notes} * @@ -2226,6 +2226,76 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. return this._makeRequest('DELETE', path, null, options) } + /** + * List a site's external products + * + * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_external_products} + * + * + * @param {Object} options - Optional configurations for the request + * @param {Object} options.params - The optional url parameters for this request. + * @param {string} options.params.sort - 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. + * + * @return {Pager} A list of the the external_products on a site. + */ + listExternalProducts (options = {}) { + let path = '/external_products' + path = this._interpolatePath(path) + return new Pager(this, path, options) + } + + /** + * Fetch an external product + * + * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/get_external_product} + * + * + * @param {string} externalProductId - External product id + * @return {Promise} Settings for an external product. + */ + async getExternalProduct (externalProductId, options = {}) { + let path = '/external_products/{external_product_id}' + path = this._interpolatePath(path, { 'external_product_id': externalProductId }) + return this._makeRequest('GET', path, null, options) + } + + /** + * List a site's external subscriptions + * + * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_external_subscriptions} + * + * + * @param {Object} options - Optional configurations for the request + * @param {Object} options.params - The optional url parameters for this request. + * @param {string} options.params.sort - 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. + * + * @return {Pager} A list of the the external_subscriptions on a site. + */ + listExternalSubscriptions (options = {}) { + let path = '/external_subscriptions' + path = this._interpolatePath(path) + return new Pager(this, path, options) + } + + /** + * Fetch an external subscription + * + * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/get_external_subscription} + * + * + * @param {string} externalSubscriptionId - External subscription id + * @return {Promise} Settings for an external subscription. + */ + async getExternalSubscription (externalSubscriptionId, options = {}) { + let path = '/external_subscriptions/{external_subscription_id}' + path = this._interpolatePath(path, { 'external_subscription_id': externalSubscriptionId }) + return this._makeRequest('GET', path, null, options) + } + /** * List a site's invoices * @@ -2625,7 +2695,7 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. } /** - * Show the coupon redemptions applied to an invoice + * List the coupon redemptions applied to an invoice * * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_coupon_redemptions} * @@ -3978,7 +4048,7 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. } /** - * Show the coupon redemptions for a subscription + * List the coupon redemptions for a subscription * * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_subscription_coupon_redemptions} * @@ -4442,7 +4512,7 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. } /** - * Show the dunning campaigns for a site + * List the dunning campaigns for a site * * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_dunning_campaigns} * @@ -4462,7 +4532,7 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. } /** - * Show the settings for a dunning campaign + * Fetch a dunning campaign * * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/get_dunning_campaign} * @@ -4513,7 +4583,7 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. } /** - * Show the settings for an invoice template + * Fetch an invoice template * * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/get_invoice_template} * @@ -4528,7 +4598,7 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. } /** - * Show all entitlements granted to an account + * List entitlements granted to an account * * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_entitlements} * @@ -4548,6 +4618,27 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. path = this._interpolatePath(path, { 'account_id': accountId }) return new Pager(this, path, options) } + + /** + * List an account's external subscriptions + * + * API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_account_external_subscriptions} + * + * + * @param {string} accountId - Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`. + * @param {Object} options - Optional configurations for the request + * @param {Object} options.params - The optional url parameters for this request. + * @param {string} options.params.sort - 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. + * + * @return {Pager} A list of the the external_subscriptions on an account. + */ + listAccountExternalSubscriptions (accountId, options = {}) { + let path = '/accounts/{account_id}/external_subscriptions' + path = this._interpolatePath(path, { 'account_id': accountId }) + return new Pager(this, path, options) + } } module.exports = Client diff --git a/lib/recurly/resources/AddOn.js b/lib/recurly/resources/AddOn.js index 400cd654..4075f910 100644 --- a/lib/recurly/resources/AddOn.js +++ b/lib/recurly/resources/AddOn.js @@ -34,9 +34,10 @@ const Resource = require('../Resource') * @prop {string} revenueScheduleType - 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. * @prop {string} state - Add-ons can be either active or inactive. * @prop {string} taxCode - Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`. - * @prop {string} tierType - 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. + * @prop {string} tierType - 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. * @prop {Array.} tiers - Tiers * @prop {Date} updatedAt - Last updated at + * @prop {string} usageCalculationType - The type of calculation to be employed for an add-on. Cumulative billing will sum all usage records created in the current billing cycle. Last-in-period billing will apply only the most recent usage record in the billing period. If no value is specified, cumulative billing will be used. * @prop {number} usagePercentage - 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. * @prop {string} usageTimeframe - The time at which usage totals are reset for billing purposes. * @prop {string} usageType - Type of usage, returns usage type if `add_on_type` is `usage`. @@ -69,6 +70,7 @@ class AddOn extends Resource { tierType: String, tiers: ['Tier'], updatedAt: Date, + usageCalculationType: String, usagePercentage: Number, usageTimeframe: String, usageType: String diff --git a/lib/recurly/resources/ExternalProduct.js b/lib/recurly/resources/ExternalProduct.js new file mode 100644 index 00000000..c69c511c --- /dev/null +++ b/lib/recurly/resources/ExternalProduct.js @@ -0,0 +1,37 @@ +/* istanbul ignore file */ +/** + * This file is automatically created by Recurly's OpenAPI generation process + * and thus any edits you make by hand will be lost. If you wish to make a + * change to this file, please create a Github issue explaining the changes you + * need and we will usher them to the appropriate places. + */ +'use strict' + +const Resource = require('../Resource') + +/** + * ExternalProduct + * @typedef {Object} ExternalProduct + * @prop {Date} createdAt - When the external product was created in Recurly. + * @prop {Array.} externalProductReferences - List of external product references of the external product. + * @prop {string} id - System-generated unique identifier for an external product ID, e.g. `e28zov4fw0v2`. + * @prop {string} name - Name to identify the external product in Recurly. + * @prop {string} object - Object type + * @prop {PlanMini} plan - Just the important parts. + * @prop {Date} updatedAt - When the external product was updated in Recurly. + */ +class ExternalProduct extends Resource { + static getSchema () { + return { + createdAt: Date, + externalProductReferences: ['ExternalProductReferenceMini'], + id: String, + name: String, + object: String, + plan: 'PlanMini', + updatedAt: Date + } + } +} + +module.exports = ExternalProduct diff --git a/lib/recurly/resources/ExternalProductReferenceMini.js b/lib/recurly/resources/ExternalProductReferenceMini.js new file mode 100644 index 00000000..eadac96e --- /dev/null +++ b/lib/recurly/resources/ExternalProductReferenceMini.js @@ -0,0 +1,35 @@ +/* istanbul ignore file */ +/** + * This file is automatically created by Recurly's OpenAPI generation process + * and thus any edits you make by hand will be lost. If you wish to make a + * change to this file, please create a Github issue explaining the changes you + * need and we will usher them to the appropriate places. + */ +'use strict' + +const Resource = require('../Resource') + +/** + * ExternalProductReferenceMini + * @typedef {Object} ExternalProductReferenceMini + * @prop {Date} createdAt - When the external product was created in Recurly. + * @prop {string} externalConnectionType - Source connection platform. + * @prop {string} id - System-generated unique identifier for an external product ID, e.g. `e28zov4fw0v2`. + * @prop {string} object - object + * @prop {string} referenceCode - A code which associates the external product to a corresponding object or resource in an external platform like the Apple App Store or Google Play Store. + * @prop {Date} updatedAt - When the external product was updated in Recurly. + */ +class ExternalProductReferenceMini extends Resource { + static getSchema () { + return { + createdAt: Date, + externalConnectionType: String, + id: String, + object: String, + referenceCode: String, + updatedAt: Date + } + } +} + +module.exports = ExternalProductReferenceMini diff --git a/lib/recurly/resources/ExternalResourceMini.js b/lib/recurly/resources/ExternalResourceMini.js new file mode 100644 index 00000000..47663f33 --- /dev/null +++ b/lib/recurly/resources/ExternalResourceMini.js @@ -0,0 +1,29 @@ +/* istanbul ignore file */ +/** + * This file is automatically created by Recurly's OpenAPI generation process + * and thus any edits you make by hand will be lost. If you wish to make a + * change to this file, please create a Github issue explaining the changes you + * need and we will usher them to the appropriate places. + */ +'use strict' + +const Resource = require('../Resource') + +/** + * ExternalResourceMini + * @typedef {Object} ExternalResourceMini + * @prop {string} externalObjectReference - Identifier or URL reference where the resource is canonically available in the external platform. + * @prop {string} id - System-generated unique identifier for an external resource ID, e.g. `e28zov4fw0v2`. + * @prop {string} object - Object type + */ +class ExternalResourceMini extends Resource { + static getSchema () { + return { + externalObjectReference: String, + id: String, + object: String + } + } +} + +module.exports = ExternalResourceMini diff --git a/lib/recurly/resources/ExternalSubscription.js b/lib/recurly/resources/ExternalSubscription.js new file mode 100644 index 00000000..c1c8154c --- /dev/null +++ b/lib/recurly/resources/ExternalSubscription.js @@ -0,0 +1,49 @@ +/* istanbul ignore file */ +/** + * This file is automatically created by Recurly's OpenAPI generation process + * and thus any edits you make by hand will be lost. If you wish to make a + * change to this file, please create a Github issue explaining the changes you + * need and we will usher them to the appropriate places. + */ +'use strict' + +const Resource = require('../Resource') + +/** + * ExternalSubscription + * @typedef {Object} ExternalSubscription + * @prop {AccountMini} account - Account mini details + * @prop {Date} activatedAt - When the external subscription was activated in the external platform. + * @prop {string} appIdentifier - Identifier of the app that generated the external subscription. + * @prop {boolean} autoRenew - An indication of whether or not the external subscription will auto-renew at the expiration date. + * @prop {Date} createdAt - When the external subscription was created in Recurly. + * @prop {Date} expiresAt - When the external subscription expires in the external platform. + * @prop {ExternalProductReferenceMini} externalProductReference - External Product Reference details + * @prop {ExternalResourceMini} externalResource - External Resource mini details + * @prop {string} id - System-generated unique identifier for an external subscription ID, e.g. `e28zov4fw0v2`. + * @prop {Date} lastPurchased - When a new billing event occurred on the external subscription in conjunction with a recent billing period, reactivation or upgrade/downgrade. + * @prop {string} object - Object type + * @prop {number} quantity - An indication of the quantity of a subscribed item's quantity. + * @prop {Date} updatedAt - When the external subscription was updated in Recurly. + */ +class ExternalSubscription extends Resource { + static getSchema () { + return { + account: 'AccountMini', + activatedAt: Date, + appIdentifier: String, + autoRenew: Boolean, + createdAt: Date, + expiresAt: Date, + externalProductReference: 'ExternalProductReferenceMini', + externalResource: 'ExternalResourceMini', + id: String, + lastPurchased: Date, + object: String, + quantity: Number, + updatedAt: Date + } + } +} + +module.exports = ExternalSubscription diff --git a/lib/recurly/resources/Plan.js b/lib/recurly/resources/Plan.js index 1f770725..2d47d056 100644 --- a/lib/recurly/resources/Plan.js +++ b/lib/recurly/resources/Plan.js @@ -20,6 +20,7 @@ const Resource = require('../Resource') * @prop {string} code - Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports. * @prop {Date} createdAt - Created at * @prop {Array.} currencies - Pricing + * @prop {Array.} customFields - The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value. * @prop {Date} deletedAt - Deleted at * @prop {string} description - Optional description, not displayed. * @prop {string} dunningCampaignId - 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. @@ -54,6 +55,7 @@ class Plan extends Resource { code: String, createdAt: Date, currencies: ['PlanPricing'], + customFields: ['CustomField'], deletedAt: Date, description: String, dunningCampaignId: String, diff --git a/lib/recurly/resources/SubscriptionAddOn.js b/lib/recurly/resources/SubscriptionAddOn.js index 82dfb1a9..7eed42b3 100644 --- a/lib/recurly/resources/SubscriptionAddOn.js +++ b/lib/recurly/resources/SubscriptionAddOn.js @@ -22,11 +22,12 @@ const Resource = require('../Resource') * @prop {number} quantity - Add-on quantity * @prop {string} revenueScheduleType - Revenue schedule type * @prop {string} subscriptionId - Subscription ID - * @prop {string} tierType - 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. + * @prop {string} tierType - 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. * @prop {Array.} tiers - If tiers are provided in the request, all existing tiers on the Subscription Add-on will be removed and replaced by the tiers in the request. If add_on.tier_type is tiered or volume and add_on.usage_type is percentage use percentage_tiers instead. There must be one tier without an `ending_quantity` value which represents the final tier. * @prop {number} unitAmount - Supports up to 2 decimal places. * @prop {string} unitAmountDecimal - Supports up to 9 decimal places. * @prop {Date} updatedAt - Updated at + * @prop {string} usageCalculationType - The type of calculation to be employed for an add-on. Cumulative billing will sum all usage records created in the current billing cycle. Last-in-period billing will apply only the most recent usage record in the billing period. If no value is specified, cumulative billing will be used. * @prop {number} usagePercentage - 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. * @prop {string} usageTimeframe - The time at which usage totals are reset for billing purposes. */ @@ -48,6 +49,7 @@ class SubscriptionAddOn extends Resource { unitAmount: Number, unitAmountDecimal: String, updatedAt: Date, + usageCalculationType: String, usagePercentage: Number, usageTimeframe: String } diff --git a/lib/recurly/resources/Usage.js b/lib/recurly/resources/Usage.js index b1f96793..a990cff4 100644 --- a/lib/recurly/resources/Usage.js +++ b/lib/recurly/resources/Usage.js @@ -21,7 +21,7 @@ const Resource = require('../Resource') * @prop {string} object - Object type * @prop {Array.} percentageTiers - The percentage tiers of the subscription based on the usage_timestamp. If tier_type = flat, percentage_tiers = [] * @prop {Date} recordingTimestamp - When the usage was recorded in your system. - * @prop {string} tierType - 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. + * @prop {string} tierType - 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. * @prop {Array.} tiers - The tiers and prices of the subscription based on the usage_timestamp. If tier_type = flat, tiers = [] * @prop {number} unitAmount - Unit price * @prop {string} unitAmountDecimal - Unit price that can optionally support a sub-cent value. diff --git a/lib/recurly/resources/index.js b/lib/recurly/resources/index.js index eb8debd8..27a8e3a8 100644 --- a/lib/recurly/resources/index.js +++ b/lib/recurly/resources/index.js @@ -63,6 +63,10 @@ module.exports.CustomFieldDefinition = require('./CustomFieldDefinition') module.exports.Item = require('./Item') module.exports.Pricing = require('./Pricing') module.exports.MeasuredUnit = require('./MeasuredUnit') +module.exports.ExternalProduct = require('./ExternalProduct') +module.exports.ExternalProductReferenceMini = require('./ExternalProductReferenceMini') +module.exports.ExternalSubscription = require('./ExternalSubscription') +module.exports.ExternalResourceMini = require('./ExternalResourceMini') module.exports.BinaryFile = require('./BinaryFile') module.exports.Plan = require('./Plan') module.exports.PlanRampInterval = require('./PlanRampInterval') diff --git a/openapi/api.yaml b/openapi/api.yaml index f75d8c9e..7a6ccba5 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -57,7 +57,7 @@ info: 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://developers.recurly.com/api/changelog.html) for a comprehensive list of changes + [changelog](https://recurly.com/developers/api/changelog.html) for a comprehensive list of changes introduced in the latest API version. ### Default Versions @@ -114,7 +114,7 @@ info: Please consider changing these messages in the target system to be better suited to the audience of the system. - Please see [transaction error codes](https://developers.recurly.com/pages/api-transaction-errors.html) for more details. + Please see [transaction error codes](https://recurly.com/developers/pages/api-transaction-errors.html) for more details. ## Pagination ### Response Schema @@ -181,7 +181,7 @@ info: ## Change Log - 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). + A list of changes for this version can be found [in the changelog](https://recurly.com/developers/api/changelog.html#v2021-02-25---current-ga-version). version: v2021-02-25 security: - api_key: [] @@ -199,6 +199,8 @@ x-tagGroups: - purchase - usage - automated_exports + - external_subscriptions + - external_products - name: Products and Promotions tags: - item @@ -338,6 +340,16 @@ tags: - name: dunning_campaigns x-displayName: Dunning Campaigns description: Settings used when attempting to dun customers whose payments are declined. +- name: external_subscriptions + x-displayName: External Subscription + description: A subscription from an external resource that is not managed by the + Recurly platform and instead is managed by third-party platforms like Apple Store + and Google Play. +- name: external_products + x-displayName: External Product + description: A product from an external resource that is not managed by the Recurly + platform and instead is managed by third-party platforms like Apple Store and + Google Play. paths: "/sites": get: @@ -2694,7 +2706,7 @@ paths: tags: - coupon_redemption operationId: list_account_coupon_redemptions - summary: Show the coupon redemptions for an account + summary: List 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: @@ -2791,7 +2803,7 @@ paths: tags: - coupon_redemption operationId: list_active_coupon_redemptions - summary: Show the coupon redemptions that are active on an account + summary: List 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: @@ -3944,7 +3956,7 @@ paths: tags: - note operationId: list_account_notes - summary: Fetch a list of an account's notes + summary: List 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: @@ -7442,6 +7454,129 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] + "/external_products": + get: + tags: + - external_products + operationId: list_external_products + summary: List a site's external products + description: See the [Pagination Guide](/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 external_products on a site. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalProductList" + '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: [] + "/external_products/{external_product_id}": + parameters: + - "$ref": "#/components/parameters/external_product_id" + get: + tags: + - external_products + operationId: get_external_product + summary: Fetch an external product + responses: + '200': + description: Settings for an external product. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalProduct" + '404': + description: Incorrect site or external product ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] + "/external_subscriptions": + get: + tags: + - external_subscriptions + operationId: list_external_subscriptions + summary: List a site's external subscriptions + description: See the [Pagination Guide](/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 external_subscriptions on a site. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalSubscriptionList" + '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: [] + "/external_subscriptions/{external_subscription_id}": + parameters: + - "$ref": "#/components/parameters/external_subscription_id" + get: + tags: + - external_subscriptions + operationId: get_external_subscription + summary: Fetch an external subscription + responses: + '200': + description: Settings for an external subscription. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalSubscription" + '404': + description: Incorrect site or external subscription ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Validation error with external resource connection or feature + flag. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] "/invoices": get: tags: @@ -8742,7 +8877,7 @@ paths: tags: - coupon_redemption operationId: list_invoice_coupon_redemptions - summary: Show the coupon redemptions applied to an invoice + summary: List 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: @@ -13327,7 +13462,7 @@ paths: tags: - coupon_redemption operationId: list_subscription_coupon_redemptions - summary: Show the coupon redemptions for a subscription + summary: List 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: @@ -14907,7 +15042,7 @@ paths: tags: - dunning_campaigns operationId: list_dunning_campaigns - summary: Show the dunning campaigns for a site + summary: List the dunning campaigns for a site description: See the [Pagination Guide](/guides/pagination.html) to learn how to use pagination in the API and Client Libraries. parameters: @@ -14939,7 +15074,7 @@ paths: tags: - dunning_campaigns operationId: get_dunning_campaign - summary: Show the settings for a dunning campaign + summary: Fetch a dunning campaign responses: '200': description: Settings for a dunning campaign. @@ -15042,7 +15177,7 @@ paths: tags: - invoice_templates operationId: get_invoice_template - summary: Show the settings for an invoice template + summary: Fetch an invoice template responses: '200': description: Settings for an invoice template. @@ -15077,7 +15212,7 @@ paths: tags: - account operationId: list_entitlements - summary: Show all entitlements granted to an account + summary: List entitlements granted to an account responses: '200': description: A list of the entitlements granted to an account. @@ -15098,6 +15233,38 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] + "/accounts/{account_id}/external_subscriptions": + parameters: + - "$ref": "#/components/parameters/account_id" + get: + tags: + - account + operationId: list_account_external_subscriptions + summary: List an account's external subscriptions + description: See the [Pagination Guide](/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 external_subscriptions on an account. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalSubscriptionList" + '404': + description: Incorrect account. + 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 - url: https://v3.eu.recurly.com @@ -15165,6 +15332,20 @@ components: required: true schema: type: string + external_product_id: + name: external_product_id + in: path + description: External product id + required: true + schema: + type: string + external_subscription_id: + name: external_subscription_id + in: path + description: External subscription id + required: true + schema: + type: string invoice_template_id: name: invoice_template_id in: path @@ -16369,6 +16550,8 @@ components: "$ref": "#/components/schemas/AddOnTypeEnum" usage_type: "$ref": "#/components/schemas/UsageTypeEnum" + usage_calculation_type: + "$ref": "#/components/schemas/UsageCalculationTypeEnum" usage_percentage: type: number format: float @@ -16522,6 +16705,8 @@ components: "$ref": "#/components/schemas/AddOnTypeCreateEnum" usage_type: "$ref": "#/components/schemas/UsageTypeCreateEnum" + usage_calculation_type: + "$ref": "#/components/schemas/UsageCalculationTypeEnum" usage_percentage: type: number format: float @@ -16682,6 +16867,8 @@ components: This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage, `tier_type` is `flat` and `usage_type` is percentage. Must be omitted otherwise. + usage_calculation_type: + "$ref": "#/components/schemas/UsageCalculationTypeEnum" measured_unit_id: type: string title: Measured Unit ID @@ -16882,7 +17069,7 @@ components: token_id: type: string title: Token ID - description: A token [generated by Recurly.js](https://developers.recurly.com/reference/recurly-js/#getting-a-token). + description: A token [generated by Recurly.js](https://recurly.com/developers/reference/recurly-js/#getting-a-token). maxLength: 22 first_name: type: string @@ -19090,6 +19277,8 @@ components: 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" @@ -19260,6 +19449,8 @@ components: 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" @@ -19474,6 +19665,8 @@ components: 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" @@ -20401,6 +20594,8 @@ components: "$ref": "#/components/schemas/RevenueScheduleTypeEnum" tier_type: "$ref": "#/components/schemas/TierTypeEnum" + usage_calculation_type: + "$ref": "#/components/schemas/UsageCalculationTypeEnum" usage_timeframe: "$ref": "#/components/schemas/UsageTimeframeEnum" tiers: @@ -20491,7 +20686,7 @@ components: 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 without an `ending_quantity` value which represents the final tier. - See our [Guide](https://developers.recurly.com/guides/item-addon-guide.html) + See our [Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an overview of how to configure quantity-based pricing models. percentage_tiers: type: array @@ -20512,7 +20707,7 @@ components: 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://developers.recurly.com/guides/usage-based-billing-guide.html) + otherwise. `usage_percentage` does not support tiers. See our [Guide](https://recurly.com/developers/guides/usage-based-billing-guide.html) for an overview of how to configure usage add-ons. revenue_schedule_type: title: Revenue schedule type @@ -22175,6 +22370,184 @@ components: type: string format: date-time description: Time the object was last updated + ExternalProduct: + type: object + description: Product from an external resource such as Apple App or Google Play. + properties: + id: + type: string + title: External product ID. + description: System-generated unique identifier for an external product + ID, e.g. `e28zov4fw0v2`. + object: + type: string + title: Object type + name: + type: string + title: Name + description: Name to identify the external product in Recurly. + plan: + "$ref": "#/components/schemas/PlanMini" + created_at: + type: string + format: date-time + description: When the external product was created in Recurly. + updated_at: + type: string + format: date-time + description: When the external product was updated in Recurly. + external_product_references: + type: array + title: External Product References + description: List of external product references of the external product. + items: + "$ref": "#/components/schemas/ExternalProductReferenceMini" + ExternalProductList: + 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/ExternalProduct" + ExternalProductReferenceMini: + type: object + title: External Product Reference details + description: External Product Reference details + properties: + id: + type: string + title: External Product ID + description: System-generated unique identifier for an external product + ID, e.g. `e28zov4fw0v2`. + object: + type: string + title: object + reference_code: + type: string + title: reference_code + description: A code which associates the external product to a corresponding + object or resource in an external platform like the Apple App Store or + Google Play Store. + external_connection_type: + type: string + title: external_connection_type + description: Source connection platform. + created_at: + type: string + format: date-time + description: When the external product was created in Recurly. + updated_at: + type: string + format: date-time + description: When the external product was updated in Recurly. + ExternalSubscription: + type: object + description: Subscription from an external resource such as Apple App or Google + Play. + properties: + id: + type: string + title: External subscription ID + description: System-generated unique identifier for an external subscription + ID, e.g. `e28zov4fw0v2`. + object: + type: string + title: Object type + account: + "$ref": "#/components/schemas/AccountMini" + external_resource: + "$ref": "#/components/schemas/ExternalResourceMini" + external_product_reference: + "$ref": "#/components/schemas/ExternalProductReferenceMini" + last_purchased: + type: string + format: date-time + title: Last purchased + description: When a new billing event occurred on the external subscription + in conjunction with a recent billing period, reactivation or upgrade/downgrade. + auto_renew: + type: boolean + title: Auto-renew + description: An indication of whether or not the external subscription will + auto-renew at the expiration date. + default: false + app_identifier: + type: string + title: App identifier + description: Identifier of the app that generated the external subscription. + quantity: + type: integer + title: Quantity + description: An indication of the quantity of a subscribed item's quantity. + default: 1 + minimum: 0 + activated_at: + type: string + format: date-time + title: Activated at + description: When the external subscription was activated in the external + platform. + expires_at: + type: string + format: date-time + title: Expires at + description: When the external subscription expires in the external platform. + created_at: + type: string + format: date-time + title: Created at + description: When the external subscription was created in Recurly. + updated_at: + type: string + format: date-time + title: Updated at + description: When the external subscription was updated in Recurly. + ExternalSubscriptionList: + 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/ExternalSubscription" + ExternalResourceMini: + type: object + title: External Resource mini details + properties: + id: + type: string + title: External resource ID + description: System-generated unique identifier for an external resource + ID, e.g. `e28zov4fw0v2`. + object: + type: string + title: Object type + external_object_reference: + type: string + title: External Object Reference + description: Identifier or URL reference where the resource is canonically + available in the external platform. + maxLength: 255 + readOnly: true CustomerPermission: type: object properties: @@ -22367,6 +22740,7 @@ components: enum: - account - item + - plan - subscription RefundTypeEnum: type: string @@ -22392,6 +22766,15 @@ components: - percentage title: Usage Type description: Type of usage, returns usage type if `add_on_type` is `usage`. + UsageCalculationTypeEnum: + type: string + description: The type of calculation to be employed for an add-on. Cumulative + billing will sum all usage records created in the current billing cycle. Last-in-period + billing will apply only the most recent usage record in the billing period. If + no value is specified, cumulative billing will be used. + enum: + - cumulative + - last_in_period BillingStatusEnum: type: string default: unbilled @@ -22596,7 +22979,7 @@ components: 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 + [Guide](https://recurly.com/developers/guides/usage-based-billing-guide.html) for an overview of how to configure usage add-ons. TierTypeEnum: type: string @@ -22604,7 +22987,7 @@ components: 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 + [Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an overview of how to configure quantity-based pricing models. default: flat enum: diff --git a/package-lock.json b/package-lock.json index 748ba935..7f8f0d71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "recurly", - "version": "4.23.0", + "version": "4.24.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "recurly", - "version": "4.23.0", + "version": "4.24.0", "license": "MIT", "devDependencies": { "@types/node": "^12.11.1",