From 2da769497493352d2202c3a72d598d20a10fb477 Mon Sep 17 00:00:00 2001 From: maciej-nedza <76946708+maciej-nedza@users.noreply.github.com> Date: Fri, 13 Dec 2024 16:29:41 +0100 Subject: [PATCH] [DE-1091] Release 6.0.0 (#93) --- README.md | 94 ++- doc/client.md | 10 +- doc/controllers/advance-invoice.md | 18 +- doc/controllers/api-exports.md | 48 +- doc/controllers/billing-portal.md | 24 +- doc/controllers/component-price-points.md | 80 ++- doc/controllers/components.md | 81 ++- doc/controllers/coupons.md | 139 ++-- doc/controllers/custom-fields.md | 54 +- doc/controllers/customers.md | 42 +- .../events-based-billing-segments.md | 36 +- doc/controllers/events.md | 62 +- doc/controllers/insights.md | 22 +- doc/controllers/invoices.md | 102 ++- doc/controllers/offers.md | 36 +- doc/controllers/payment-profiles.md | 72 +- doc/controllers/product-families.md | 24 +- doc/controllers/product-price-points.md | 68 +- doc/controllers/products.md | 36 +- doc/controllers/proforma-invoices.md | 54 +- doc/controllers/reason-codes.md | 39 +- doc/controllers/referral-codes.md | 6 +- doc/controllers/sales-commissions.md | 18 +- doc/controllers/sites.md | 16 +- doc/controllers/subscription-components.md | 108 +-- .../subscription-group-invoice-account.md | 24 +- doc/controllers/subscription-group-status.md | 24 +- doc/controllers/subscription-groups.md | 54 +- .../subscription-invoice-account.md | 36 +- doc/controllers/subscription-notes.md | 48 +- doc/controllers/subscription-products.md | 12 +- doc/controllers/subscription-status.md | 67 +- doc/controllers/subscriptions.md | 119 ++-- doc/controllers/webhooks.md | 34 +- doc/models/add-subscription-to-a-group.md | 2 +- .../change-invoice-status-event-data.md | 2 +- doc/models/change-invoice-status-event.md | 4 +- doc/models/component-price-point.md | 6 + doc/models/component.md | 2 +- doc/models/compounding-strategy.md | 2 + .../add-subscription-to-a-group-group.md | 14 - .../containers/coupon-payload-percentage.md | 14 + .../create-or-update-coupon-coupon.md | 14 - ...-or-update-percentage-coupon-percentage.md | 14 - .../containers/event-event-specific-data.md | 3 +- doc/models/coupon-currency-response.md | 6 +- doc/models/coupon-currency.md | 6 +- doc/models/coupon-payload.md | 38 + ...-or-update-coupon.md => coupon-request.md} | 19 +- doc/models/coupon.md | 11 +- doc/models/create-component-price-point.md | 4 +- doc/models/create-ebb-component.md | 10 +- doc/models/create-invoice-coupon.md | 2 +- doc/models/create-metered-component.md | 24 +- doc/models/create-on-off-component.md | 11 +- .../create-or-update-flat-amount-coupon.md | 40 -- .../create-or-update-percentage-coupon.md | 40 -- doc/models/create-prepaid-component.md | 20 +- ...ate-prepaid-usage-component-price-point.md | 6 +- doc/models/create-subscription.md | 2 +- doc/models/currency-price.md | 4 +- doc/models/currency-prices-response.md | 2 +- doc/models/ebb-component.md | 15 +- doc/models/event-key.md | 92 +++ doc/models/event-response.md | 2 +- doc/models/event-type.md | 46 -- doc/models/event.md | 4 +- doc/models/invoice-avatax-details.md | 29 + doc/models/invoice-debit.md | 32 + doc/models/invoice-line-item.md | 1 + doc/models/invoice-status.md | 1 + doc/models/invoice.md | 3 + doc/models/issue-invoice-event-data.md | 4 +- doc/models/issue-invoice-event.md | 4 +- doc/models/metered-component.md | 13 +- ...-codes-json-response.md => ok-response.md} | 6 +- doc/models/on-off-component.md | 25 +- doc/models/paid-invoice.md | 2 +- doc/models/prepaid-component-price-point.md | 49 -- doc/models/prepaid-usage-component.md | 34 +- doc/models/quantity-based-component.md | 1 - doc/models/subscription-group-member-error.md | 25 - ...> subscription-group-signup-event-data.md} | 14 +- .../subscription-group-signup-success-data.md | 40 -- .../subscription-group-signup-success.md | 42 -- ...ption-group-update-error-response-error.md | 12 +- doc/models/subscription-group-update-error.md | 20 +- doc/models/subscription-response-error.md | 27 + doc/models/update-currency-price.md | 2 +- doc/models/update-currency-prices-request.md | 2 +- doc/models/update-subscription.md | 2 +- e2e/src/config.ts | 11 +- package.json | 25 +- pnpm-lock.yaml | 659 +++++++++++++++--- src/client.ts | 33 +- src/clientInterface.ts | 2 +- src/configuration.ts | 7 +- .../componentPricePointsController.ts | 38 +- src/controllers/couponsController.ts | 55 +- src/controllers/eventsController.ts | 69 +- src/controllers/offersController.ts | 7 + .../productPricePointsController.ts | 6 + src/controllers/reasonCodesController.ts | 21 +- .../subscriptionComponentsController.ts | 12 +- .../subscriptionNotesController.ts | 19 + .../subscriptionStatusController.ts | 12 + src/controllers/subscriptionsController.ts | 40 +- src/defaultConfiguration.ts | 5 +- src/errors/subscriptionResponseError.ts | 18 + src/index.ts | 22 +- src/models/addSubscriptionToAGroup.ts | 11 +- src/models/component.ts | 2 +- src/models/componentPricePoint.ts | 34 + .../addSubscriptionToAGroupGroup.ts | 36 - ...rcentage.ts => couponPayloadPercentage.ts} | 6 +- .../containers/createOrUpdateCouponCoupon.ts | 56 -- .../containers/eventEventSpecificData.ts | 41 +- src/models/coupon.ts | 16 +- src/models/couponCurrency.ts | 17 +- src/models/couponPayload.ts | 78 +++ src/models/couponRequest.ts | 30 + src/models/createComponentPricePoint.ts | 4 +- src/models/createInvoiceCoupon.ts | 1 + src/models/createOrUpdateCoupon.ts | 28 - src/models/createOrUpdateFlatAmountCoupon.ts | 67 -- src/models/createOrUpdatePercentageCoupon.ts | 64 -- .../createPrepaidUsageComponentPricePoint.ts | 6 +- src/models/createSubscription.ts | 4 +- src/models/currencyPrice.ts | 4 + src/models/eBBComponent.ts | 18 +- src/models/event.ts | 41 +- src/models/eventKey.ts | 98 +++ src/models/eventType.ts | 52 -- src/models/invoice.ts | 14 + src/models/invoiceAvataxDetails.ts | 33 + src/models/invoiceDebit.ts | 32 + src/models/invoiceLineItem.ts | 5 + src/models/invoiceStatus.ts | 1 + src/models/meteredComponent.ts | 16 - ...asonCodesJsonResponse.ts => okResponse.ts} | 8 +- src/models/onOffComponent.ts | 13 +- src/models/prepaidComponentPricePoint.ts | 40 -- src/models/prepaidUsageComponent.ts | 30 +- src/models/quantityBasedComponent.ts | 3 - src/models/subscriptionGroupMemberError.ts | 22 - ...ts => subscriptionGroupSignupEventData.ts} | 11 +- src/models/subscriptionGroupSignupSuccess.ts | 28 - .../subscriptionGroupSignupSuccessData.ts | 41 -- src/models/subscriptionGroupUpdateError.ts | 15 +- src/models/updateSubscription.ts | 4 +- 150 files changed, 2841 insertions(+), 1828 deletions(-) delete mode 100644 doc/models/containers/add-subscription-to-a-group-group.md create mode 100644 doc/models/containers/coupon-payload-percentage.md delete mode 100644 doc/models/containers/create-or-update-coupon-coupon.md delete mode 100644 doc/models/containers/create-or-update-percentage-coupon-percentage.md create mode 100644 doc/models/coupon-payload.md rename doc/models/{create-or-update-coupon.md => coupon-request.md} (58%) delete mode 100644 doc/models/create-or-update-flat-amount-coupon.md delete mode 100644 doc/models/create-or-update-percentage-coupon.md create mode 100644 doc/models/event-key.md delete mode 100644 doc/models/event-type.md create mode 100644 doc/models/invoice-avatax-details.md create mode 100644 doc/models/invoice-debit.md rename doc/models/{reason-codes-json-response.md => ok-response.md} (72%) delete mode 100644 doc/models/prepaid-component-price-point.md delete mode 100644 doc/models/subscription-group-member-error.md rename doc/models/{subscription-group-signup-failure.md => subscription-group-signup-event-data.md} (66%) delete mode 100644 doc/models/subscription-group-signup-success-data.md delete mode 100644 doc/models/subscription-group-signup-success.md create mode 100644 doc/models/subscription-response-error.md create mode 100644 src/errors/subscriptionResponseError.ts delete mode 100644 src/models/containers/addSubscriptionToAGroupGroup.ts rename src/models/containers/{createOrUpdatePercentageCouponPercentage.ts => couponPayloadPercentage.ts} (73%) delete mode 100644 src/models/containers/createOrUpdateCouponCoupon.ts create mode 100644 src/models/couponPayload.ts create mode 100644 src/models/couponRequest.ts delete mode 100644 src/models/createOrUpdateCoupon.ts delete mode 100644 src/models/createOrUpdateFlatAmountCoupon.ts delete mode 100644 src/models/createOrUpdatePercentageCoupon.ts create mode 100644 src/models/eventKey.ts delete mode 100644 src/models/eventType.ts create mode 100644 src/models/invoiceAvataxDetails.ts create mode 100644 src/models/invoiceDebit.ts rename src/models/{reasonCodesJsonResponse.ts => okResponse.ts} (57%) delete mode 100644 src/models/prepaidComponentPricePoint.ts delete mode 100644 src/models/subscriptionGroupMemberError.ts rename src/models/{subscriptionGroupSignupFailure.ts => subscriptionGroupSignupEventData.ts} (56%) delete mode 100644 src/models/subscriptionGroupSignupSuccess.ts delete mode 100644 src/models/subscriptionGroupSignupSuccessData.ts diff --git a/README.md b/README.md index eb184d2f..0ceccb1c 100644 --- a/README.md +++ b/README.md @@ -29,27 +29,26 @@ curl -u :x -H Accept:application/json -H Content-Type:application/json Run the following command from your project directory to install the package from npm: -```ts -npm install @maxio-com/advanced-billing-sdk@5.2.0 +```bash +npm install @maxio-com/advanced-billing-sdk@6.0.0 ``` -For additional package details, see the [Npm page for the @maxio-com/advanced-billing-sdk@5.2.0 npm](https://www.npmjs.com/package/@maxio-com/advanced-billing-sdk/v/5.2.0). +For additional package details, see the [Npm page for the @maxio-com/advanced-billing-sdk@6.0.0 npm](https://www.npmjs.com/package/@maxio-com/advanced-billing-sdk/v/6.0.0). ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/client.md) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `subdomain` | `string` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | -| `domain` | `string` | The Advanced Billing server domain.
*Default*: `'chargify.com'` | -| `environment` | `Environment` | The API environment.
**Default: `Environment.Production`** | +| `site` | `string` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | +| `environment` | `Environment` | The API environment.
**Default: `Environment.US`** | | `timeout` | `number` | Timeout for API calls.
*Default*: `120000` | | `httpClientOptions` | `Partial` | Stable configurable http client options. | | `unstableHttpClientOptions` | `any` | Unstable configurable http client options. | -| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/auth/basic-authentication.md) | The credential object for basicAuth | +| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/auth/basic-authentication.md) | The credential object for basicAuth | ### HttpClientOptions @@ -81,9 +80,8 @@ const client = new Client({ password: 'BasicAuthPassword' }, timeout: 120000, - environment: Environment.Production, - subdomain: 'subdomain', - domain: 'chargify.com', + environment: Environment.US, + site: 'subdomain', }); ``` @@ -95,52 +93,52 @@ The SDK can be configured to use a different environment for making API calls. A | Name | Description | | --- | --- | -| production | **Default** Production server | -| environment2 | Production server | +| US | **Default** Default Advanced Billing environment hosted in US. Valid for the majority of our customers. | +| EU | Advanced Billing environment hosted in EU. Use only when you requested EU hosting for your AB account. | ## Authorization This API uses the following authentication schemes. -* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/auth/basic-authentication.md) +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/auth/basic-authentication.md) ## List of APIs -* [API Exports](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/api-exports.md) -* [Advance Invoice](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/advance-invoice.md) -* [Billing Portal](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/billing-portal.md) -* [Component Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/component-price-points.md) -* [Custom Fields](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/custom-fields.md) -* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/events-based-billing-segments.md) -* [Payment Profiles](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/payment-profiles.md) -* [Product Families](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/product-families.md) -* [Product Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/product-price-points.md) -* [Proforma Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/proforma-invoices.md) -* [Reason Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/reason-codes.md) -* [Referral Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/referral-codes.md) -* [Sales Commissions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/sales-commissions.md) -* [Subscription Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/subscription-components.md) -* [Subscription Groups](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/subscription-groups.md) -* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/subscription-group-invoice-account.md) -* [Subscription Group Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/subscription-group-status.md) -* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/subscription-invoice-account.md) -* [Subscription Notes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/subscription-notes.md) -* [Subscription Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/subscription-products.md) -* [Subscription Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/subscription-status.md) -* [Coupons](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/coupons.md) -* [Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/components.md) -* [Customers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/customers.md) -* [Events](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/events.md) -* [Insights](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/insights.md) -* [Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/invoices.md) -* [Offers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/offers.md) -* [Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/products.md) -* [Sites](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/sites.md) -* [Subscriptions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/subscriptions.md) -* [Webhooks](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/controllers/webhooks.md) +* [API Exports](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/api-exports.md) +* [Advance Invoice](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/advance-invoice.md) +* [Billing Portal](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/billing-portal.md) +* [Component Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/component-price-points.md) +* [Custom Fields](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/custom-fields.md) +* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/events-based-billing-segments.md) +* [Payment Profiles](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/payment-profiles.md) +* [Product Families](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/product-families.md) +* [Product Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/product-price-points.md) +* [Proforma Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/proforma-invoices.md) +* [Reason Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/reason-codes.md) +* [Referral Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/referral-codes.md) +* [Sales Commissions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/sales-commissions.md) +* [Subscription Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-components.md) +* [Subscription Groups](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-groups.md) +* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-group-invoice-account.md) +* [Subscription Group Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-group-status.md) +* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-invoice-account.md) +* [Subscription Notes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-notes.md) +* [Subscription Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-products.md) +* [Subscription Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-status.md) +* [Coupons](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/coupons.md) +* [Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/components.md) +* [Customers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/customers.md) +* [Events](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/events.md) +* [Insights](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/insights.md) +* [Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/invoices.md) +* [Offers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/offers.md) +* [Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/products.md) +* [Sites](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/sites.md) +* [Subscriptions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscriptions.md) +* [Webhooks](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/webhooks.md) ## Classes Documentation -* [ApiResponse](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/api-response.md) -* [ApiError](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/api-error.md) +* [ApiResponse](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/api-response.md) +* [ApiError](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/api-error.md) diff --git a/doc/client.md b/doc/client.md index 22d6629e..65458e9c 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,9 +5,8 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `subdomain` | `string` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | -| `domain` | `string` | The Advanced Billing server domain.
*Default*: `'chargify.com'` | -| `environment` | `Environment` | The API environment.
**Default: `Environment.Production`** | +| `site` | `string` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | +| `environment` | `Environment` | The API environment.
**Default: `Environment.US`** | | `timeout` | `number` | Timeout for API calls.
*Default*: `120000` | | `httpClientOptions` | `Partial` | Stable configurable http client options. | | `unstableHttpClientOptions` | `any` | Unstable configurable http client options. | @@ -43,9 +42,8 @@ const client = new Client({ password: 'BasicAuthPassword' }, timeout: 120000, - environment: Environment.Production, - subdomain: 'subdomain', - domain: 'chargify.com', + environment: Environment.US, + site: 'subdomain', }); ``` diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index 7481ebd7..520a9ebc 100644 --- a/doc/controllers/advance-invoice.md +++ b/doc/controllers/advance-invoice.md @@ -23,9 +23,11 @@ That said, regeneration of the invoice may be forced with the params `force: tru We recommend using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it. ```ts -async issueAdvanceInvoice( subscriptionId: number, +async issueAdvanceInvoice( + subscriptionId: number, body?: IssueAdvanceInvoiceRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -77,8 +79,10 @@ try { Once an advance invoice has been generated for a subscription's upcoming renewal, it can be viewed through this endpoint. There can only be one advance invoice per subscription per billing cycle. ```ts -async readAdvanceInvoice( subscriptionId: number, -requestOptions?: RequestOptions): Promise> +async readAdvanceInvoice( + subscriptionId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -122,9 +126,11 @@ Void a subscription's existing advance invoice. Once voided, it can later be reg A `reason` is required in order to void, and the invoice must have an open status. Voiding will cause any prepayments and credits that were applied to the invoice to be returned to the subscription. For a full overview of the impact of voiding, please [see our help docs](../../doc/models/invoice.md). ```ts -async voidAdvanceInvoice( subscriptionId: number, +async voidAdvanceInvoice( + subscriptionId: number, body?: VoidInvoiceRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/api-exports.md b/doc/controllers/api-exports.md index 1b44dccc..41d3897f 100644 --- a/doc/controllers/api-exports.md +++ b/doc/controllers/api-exports.md @@ -28,10 +28,12 @@ This API returns an array of exported proforma invoices for a provided `batch_id Example: `GET https://{subdomain}.chargify.com/api_exports/proforma_invoices/123/rows?per_page=10000&page=1`. ```ts -async listExportedProformaInvoices( batchId: string, +async listExportedProformaInvoices( + batchId: string, perPage?: number, page?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -82,10 +84,12 @@ This API returns an array of exported invoices for a provided `batch_id`. Pay cl Example: `GET https://{subdomain}.chargify.com/api_exports/invoices/123/rows?per_page=10000&page=1`. ```ts -async listExportedInvoices( batchId: string, +async listExportedInvoices( + batchId: string, perPage?: number, page?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -136,10 +140,12 @@ This API returns an array of exported subscriptions for a provided `batch_id`. P Example: `GET https://{subdomain}.chargify.com/api_exports/subscriptions/123/rows?per_page=200&page=1`. ```ts -async listExportedSubscriptions( batchId: string, +async listExportedSubscriptions( + batchId: string, perPage?: number, page?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -190,7 +196,9 @@ This API creates a proforma invoices export and returns a batchjob object. It is only available for Relationship Invoicing architecture. ```ts -async exportProformaInvoices(requestOptions?: RequestOptions): Promise> +async exportProformaInvoices( + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -231,7 +239,9 @@ try { This API creates an invoices export and returns a batchjob object. ```ts -async exportInvoices(requestOptions?: RequestOptions): Promise> +async exportInvoices( + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -272,7 +282,9 @@ try { This API creates a subscriptions export and returns a batchjob object. ```ts -async exportSubscriptions(requestOptions?: RequestOptions): Promise> +async exportSubscriptions( + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -312,8 +324,10 @@ try { This API returns a batchjob object for proforma invoices export. ```ts -async readProformaInvoicesExport( batchId: string, -requestOptions?: RequestOptions): Promise> +async readProformaInvoicesExport( + batchId: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -356,8 +370,10 @@ try { This API returns a batchjob object for invoices export. ```ts -async readInvoicesExport( batchId: string, -requestOptions?: RequestOptions): Promise> +async readInvoicesExport( + batchId: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -400,8 +416,10 @@ try { This API returns a batchjob object for subscriptions export. ```ts -async readSubscriptionsExport( batchId: string, -requestOptions?: RequestOptions): Promise> +async readSubscriptionsExport( + batchId: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/billing-portal.md b/doc/controllers/billing-portal.md index 953e4b30..37146027 100644 --- a/doc/controllers/billing-portal.md +++ b/doc/controllers/billing-portal.md @@ -35,9 +35,11 @@ If you need to provide your customer their Management URL through other means, y In order to prevent abuse & overuse, we ask that you request a new URL only when absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as much as possible. If you use the URL frequently (such as to display on your website), please **do not** make an API request to Advanced Billing every time. ```ts -async enableBillingPortalForCustomer( customerId: number, +async enableBillingPortalForCustomer( + customerId: number, autoInvite?: AutoInvite, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -89,8 +91,10 @@ This method will provide to the API user the exact URL required for a subscriber + You are limited to 15 requests for the same URL. If you make more than 15 requests before `new_link_available_at`, you will be blocked from further Management URL requests (with a response code `429`) ```ts -async readBillingPortalLink( customerId: number, -requestOptions?: RequestOptions): Promise> +async readBillingPortalLink( + customerId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -159,8 +163,10 @@ If you attempt to resend an invitation when the Customer does not exist a Custom This endpoint will only return a JSON response. ```ts -async resendBillingPortalInvitation( customerId: number, -requestOptions?: RequestOptions): Promise> +async resendBillingPortalInvitation( + customerId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -221,8 +227,10 @@ If you attempt to revoke an invitation when the Billing Portal is already disabl This endpoint will only return a JSON response. ```ts -async revokeBillingPortalAccess( customerId: number, -requestOptions?: RequestOptions): Promise> +async revokeBillingPortalAccess( + customerId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index 8239780f..f1d87a61 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -32,9 +32,11 @@ See [Price Points Documentation](https://maxio.zendesk.com/hc/en-us/articles/242 Note: Custom price points are not able to be set as the default for a component. ```ts -async promoteComponentPricePointToDefault( componentId: number, +async promoteComponentPricePointToDefault( + componentId: number, pricePointId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -110,9 +112,11 @@ try { This endpoint can be used to create a new price point for an existing component. ```ts -async createComponentPricePoint( componentId: number, +async createComponentPricePoint( + componentId: number, body?: CreateComponentPricePointRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -167,6 +171,12 @@ try { } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseError`](../../doc/models/error-array-map-response-error.md) | + # List Component Price Points @@ -179,12 +189,14 @@ When fetching a component's price points, if you have defined multiple currencie If the price point is set to `use_site_exchange_rate: true`, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. ```ts -async listComponentPricePoints( componentId: number, +async listComponentPricePoints( + componentId: number, currencyPrices?: boolean, page?: number, perPage?: number, filterType?: PricePointType[], -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -278,9 +290,11 @@ try { Use this endpoint to create multiple component price points in one request. ```ts -async bulkCreateComponentPricePoints( componentId: string, +async bulkCreateComponentPricePoints( + componentId: string, body?: CreateComponentPricePointsRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -402,6 +416,12 @@ try { } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) | + # Update Component Price Point @@ -414,10 +434,12 @@ Including an `id` will update the corresponding price, and including the `_destr Note: Custom price points cannot be updated directly. They must be edited through the Subscription. ```ts -async updateComponentPricePoint( componentId: UpdateComponentPricePointComponentId, +async updateComponentPricePoint( + componentId: UpdateComponentPricePointComponentId, pricePointId: UpdateComponentPricePointPricePointId, body?: UpdateComponentPricePointRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -489,9 +511,12 @@ try { Use this endpoint to retrieve details for a specific component price point. You can achieve this by using either the component price point ID or handle. ```ts -async readComponentPricePoint( componentId: ReadComponentPricePointComponentId, +async readComponentPricePoint( + componentId: ReadComponentPricePointComponentId, pricePointId: ReadComponentPricePointPricePointId, -requestOptions?: RequestOptions): Promise> + currencyPrices?: boolean, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -500,6 +525,7 @@ requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -619,9 +647,11 @@ try { Use this endpoint to unarchive a component price point. ```ts -async unarchiveComponentPricePoint( componentId: number, +async unarchiveComponentPricePoint( + componentId: number, pricePointId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -702,9 +732,11 @@ When creating currency prices, they need to mirror the structure of your primary Note: Currency Prices are not able to be created for custom price points. ```ts -async createCurrencyPrices( pricePointId: number, +async createCurrencyPrices( + pricePointId: number, body?: CreateCurrencyPricesRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -785,9 +817,11 @@ This endpoint allows you to update currency prices for a given currency that has Note: Currency Prices are not able to be updated for custom price points. ```ts -async updateCurrencyPrices( pricePointId: number, +async updateCurrencyPrices( + pricePointId: number, body?: UpdateCurrencyPricesRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -864,12 +898,14 @@ try { This method allows to retrieve a list of Components Price Points belonging to a Site. ```ts -async listAllComponentPricePoints( include?: ListComponentsPricePointsInclude, +async listAllComponentPricePoints( + include?: ListComponentsPricePointsInclude, page?: number, perPage?: number, direction?: SortingDirection, filter?: ListPricePointsFilter, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/components.md b/doc/controllers/components.md index a6100e45..f1e32824 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -35,9 +35,11 @@ Note that this is different from recurring quantity-based components, which DO N For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). ```ts -async createMeteredComponent( productFamilyId: string, +async createMeteredComponent( + productFamilyId: string, body?: CreateMeteredComponent, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -164,9 +166,11 @@ The allocated quantity for one-time quantity-based components immediately gets r For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). ```ts -async createQuantityBasedComponent( productFamilyId: string, +async createQuantityBasedComponent( + productFamilyId: string, body?: CreateQuantityBasedComponent, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -284,9 +288,11 @@ On/off components are used for any flat fee, recurring add on (think $99/month f For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). ```ts -async createOnOffComponent( productFamilyId: string, +async createOnOffComponent( + productFamilyId: string, body?: CreateOnOffComponent, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -309,14 +315,9 @@ const productFamilyId = 'product_family_id4'; const body: CreateOnOffComponent = { onOffComponent: { name: 'Annual Support Services', + unitPrice: '100.00', description: 'Prepay for support services', taxable: true, - prices: [ - { - startingQuantity: '0', - unitPrice: '100.00', - } - ], displayOnHostedPage: true, publicSignupPageIds: [ 320495 @@ -394,9 +395,11 @@ Prepaid components allow customers to pre-purchase units that can be used up ove For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). ```ts -async createPrepaidUsageComponent( productFamilyId: string, +async createPrepaidUsageComponent( + productFamilyId: string, body?: CreatePrepaidComponent, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -421,7 +424,6 @@ const body: CreatePrepaidComponent = { name: 'Minutes', unitName: 'minutes', pricingScheme: PricingScheme.PerUnit, - unitPrice: 2, overagePricing: { pricingScheme: PricingScheme.Stairstep, prices: [ @@ -436,6 +438,7 @@ const body: CreatePrepaidComponent = { } ], }, + unitPrice: 2, rolloverPrepaidRemainder: true, renewPrepaidAllocation: true, expirationInterval: 15, @@ -539,9 +542,11 @@ So, instead of reporting usage directly for each component (as you would with me For more information on components, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). ```ts -async createEventBasedComponent( productFamilyId: string, +async createEventBasedComponent( + productFamilyId: string, body?: CreateEBBComponent, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -646,8 +651,10 @@ try { This request will return information regarding a component having the handle you provide. You can identify your components with a handle so you don't have to save or reference the IDs we generate. ```ts -async findComponent( handle: string, -requestOptions?: RequestOptions): Promise> +async findComponent( + handle: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -716,9 +723,11 @@ This request will return information regarding a component from a specific produ You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. ```ts -async readComponent( productFamilyId: number, +async readComponent( + productFamilyId: number, componentId: string, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -793,10 +802,12 @@ This request will update a component from a specific product family. You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. ```ts -async updateProductFamilyComponent( productFamilyId: number, +async updateProductFamilyComponent( + productFamilyId: number, componentId: string, body?: UpdateComponentRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -883,9 +894,11 @@ try { Sending a DELETE request to this endpoint will archive the component. All current subscribers will be unffected; their subscription/purchase will continue to be charged as usual. ```ts -async archiveComponent( productFamilyId: number, +async archiveComponent( + productFamilyId: number, componentId: string, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -960,7 +973,8 @@ try { This request will return a list of components for a site. ```ts -async listComponents( dateField?: BasicDateField, +async listComponents( + dateField?: BasicDateField, startDate?: string, endDate?: string, startDatetime?: string, @@ -969,7 +983,8 @@ async listComponents( dateField?: BasicDateField, page?: number, perPage?: number, filter?: ListComponentsFilter, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1123,9 +1138,11 @@ This request will update a component. You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. ```ts -async updateComponent( componentId: string, +async updateComponent( + componentId: string, body?: UpdateComponentRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1208,7 +1225,8 @@ try { This request will return a list of components for a particular product family. ```ts -async listComponentsForProductFamily( productFamilyId: number, +async listComponentsForProductFamily( + productFamilyId: number, includeArchived?: boolean, page?: number, perPage?: number, @@ -1218,7 +1236,8 @@ async listComponentsForProductFamily( productFamilyId: number, endDatetime?: string, startDate?: string, startDatetime?: string, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index 024c09d1..9ee06eeb 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -38,15 +38,17 @@ Additionally, for documentation on how to apply a coupon to a subscription withi This request will create a coupon, based on the provided information. -When creating a coupon, you must specify a product family using the `product_family_id`. If no `product_family_id` is passed, the first product family available is used. You will also need to formulate your URL to cite the Product Family ID in your request. +You can create either a flat amount coupon, by specyfing `amount_in_cents`, or percentage coupon by specyfing `percentage`. -You can restrict a coupon to only apply to specific products / components by optionally passing in hashes of `restricted_products` and/or `restricted_components` in the format: -`{ "": boolean_value }` +You can restrict a coupon to only apply to specific products / components by optionally passing in `restricted_products` and/or `restricted_components` objects in the format: +`{ "": boolean_value }` ```ts -async createCoupon( productFamilyId: number, - body?: CreateOrUpdateCoupon, -requestOptions?: RequestOptions): Promise> +async createCoupon( + productFamilyId: number, + body?: CouponRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -54,7 +56,7 @@ requestOptions?: RequestOptions): Promise> | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `productFamilyId` | `number` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs | -| `body` | [`CreateOrUpdateCoupon \| undefined`](../../doc/models/create-or-update-coupon.md) | Body, Optional | - | +| `body` | [`CouponRequest \| undefined`](../../doc/models/coupon-request.md) | Body, Optional | - | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -66,15 +68,15 @@ requestOptions?: RequestOptions): Promise> ```ts const productFamilyId = 140; -const body: CreateOrUpdateCoupon = { +const body: CouponRequest = { coupon: { name: '15% off', code: '15OFF', - percentage: 15, description: '15% off for life', + percentage: 15, allowNegativeBalance: false, recurring: false, - endDate: '2012-08-29T12:00:00-04:00', + endDate: '2012-08-29', productFamilyId: '2', stackable: true, compoundingStrategy: CompoundingStrategy.Compound, @@ -119,12 +121,14 @@ List coupons for a specific Product Family in a Site. If the coupon is set to `use_site_exchange_rate: true`, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. ```ts -async listCouponsForProductFamily( productFamilyId: number, +async listCouponsForProductFamily( + productFamilyId: number, page?: number, perPage?: number, filter?: ListCouponsFilter, currencyPrices?: boolean, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -278,9 +282,12 @@ You can search for a coupon via the API with the find method. By passing a code If you have more than one product family and if the coupon you are trying to find does not belong to the default product family in your site, then you will need to specify (either in the url or as a query string param) the product family id. ```ts -async findCoupon( productFamilyId?: number, +async findCoupon( + productFamilyId?: number, code?: string, -requestOptions?: RequestOptions): Promise> + currencyPrices?: boolean, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -289,6 +296,7 @@ requestOptions?: RequestOptions): Promise> | --- | --- | --- | --- | | `productFamilyId` | `number \| undefined` | Query, Optional | The Advanced Billing id of the product family to which the coupon belongs | | `code` | `string \| undefined` | Query, Optional | The code of the coupon | +| `currencyPrices` | `boolean \| undefined` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -298,8 +306,14 @@ requestOptions?: RequestOptions): Promise> ## Example Usage ```ts +const currencyPrices = true; + try { - const { result, ...httpResponse } = await couponsController.findCoupon(); + const { result, ...httpResponse } = await couponsController.findCoupon( + undefined, + undefined, + currencyPrices +); // Get more response info... // const { statusCode, headers } = httpResponse; } catch (error) { @@ -321,9 +335,12 @@ When fetching a coupon, if you have defined multiple currencies at the site leve If the coupon is set to `use_site_exchange_rate: true`, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. ```ts -async readCoupon( productFamilyId: number, +async readCoupon( + productFamilyId: number, couponId: number, -requestOptions?: RequestOptions): Promise> + currencyPrices?: boolean, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -332,6 +349,7 @@ requestOptions?: RequestOptions): Promise> | --- | --- | --- | --- | | `productFamilyId` | `number` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs | | `couponId` | `number` | Template, Required | The Advanced Billing id of the coupon | +| `currencyPrices` | `boolean \| undefined` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -345,10 +363,13 @@ const productFamilyId = 140; const couponId = 162; +const currencyPrices = true; + try { const { result, ...httpResponse } = await couponsController.readCoupon( productFamilyId, - couponId + couponId, + currencyPrices ); // Get more response info... // const { statusCode, headers } = httpResponse; @@ -400,10 +421,12 @@ You can restrict a coupon to only apply to specific products / components by opt `{ "": boolean_value }` ```ts -async updateCoupon( productFamilyId: number, +async updateCoupon( + productFamilyId: number, couponId: number, - body?: CreateOrUpdateCoupon, -requestOptions?: RequestOptions): Promise> + body?: CouponRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -412,7 +435,7 @@ requestOptions?: RequestOptions): Promise> | --- | --- | --- | --- | | `productFamilyId` | `number` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs | | `couponId` | `number` | Template, Required | The Advanced Billing id of the coupon | -| `body` | [`CreateOrUpdateCoupon \| undefined`](../../doc/models/create-or-update-coupon.md) | Body, Optional | - | +| `body` | [`CouponRequest \| undefined`](../../doc/models/coupon-request.md) | Body, Optional | - | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -426,15 +449,15 @@ const productFamilyId = 140; const couponId = 162; -const body: CreateOrUpdateCoupon = { +const body: CouponRequest = { coupon: { name: '15% off', code: '15OFF', - percentage: 15, description: '15% off for life', + percentage: 15, allowNegativeBalance: false, recurring: false, - endDate: '2012-08-29T12:00:00-04:00', + endDate: '2012-08-29', productFamilyId: '2', stackable: true, compoundingStrategy: CompoundingStrategy.Compound, @@ -493,6 +516,12 @@ try { } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) | + # Archive Coupon @@ -501,9 +530,11 @@ Archiving makes that Coupon unavailable for future use, but allows it to remain The `archived_at` date and time will be assigned. ```ts -async archiveCoupon( productFamilyId: number, +async archiveCoupon( + productFamilyId: number, couponId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -577,11 +608,13 @@ You can retrieve a list of coupons. If the coupon is set to `use_site_exchange_rate: true`, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. ```ts -async listCoupons( page?: number, +async listCoupons( + page?: number, perPage?: number, filter?: ListCouponsFilter, currencyPrices?: boolean, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -688,9 +721,11 @@ try { This request will provide details about the coupon usage as an array of data hashes, one per product. ```ts -async readCouponUsage( productFamilyId: number, +async readCouponUsage( + productFamilyId: number, couponId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -787,9 +822,11 @@ https://.chargify.com/coupons/validate.?code=&pr ``` ```ts -async validateCoupon( code: string, +async validateCoupon( + code: string, productFamilyId?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -864,9 +901,11 @@ This endpoint allows you to create and/or update currency prices for an existing Currency pricing for coupons must mirror the setup of the primary coupon pricing - if the primary coupon is percentage based, you will not be able to define pricing in non-primary currencies. ```ts -async createOrUpdateCouponCurrencyPrices( couponId: number, +async createOrUpdateCouponCurrencyPrices( + couponId: number, body?: CouponCurrencyRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -914,6 +953,12 @@ try { } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorStringMapResponseError`](../../doc/models/error-string-map-response-error.md) | + # Create Coupon Subcodes @@ -959,9 +1004,11 @@ This request allows you to create specific subcodes underneath an existing coupo So, if the coupon subcode is `20%OFF`, the URL to delete this coupon subcode would be: `https://.chargify.com/coupons/567/codes/20%25OFF.` ```ts -async createCouponSubcodes( couponId: number, +async createCouponSubcodes( + couponId: number, body?: CouponSubcodes, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1022,10 +1069,12 @@ try { This request allows you to request the subcodes that are attached to a coupon. ```ts -async listCouponSubcodes( couponId: number, +async listCouponSubcodes( + couponId: number, page?: number, perPage?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1107,9 +1156,11 @@ The response will contain: + Any subcodes not created because they are invalid. ```ts -async updateCouponSubcodes( couponId: number, +async updateCouponSubcodes( + couponId: number, body?: CouponSubcodes, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1179,9 +1230,11 @@ Note: If you are using any of the allowed special characters (“%”, “@”, Or if the coupon subcode is 20%OFF, the URL to delete this coupon subcode would be: @https://.chargify.com/coupons/567/codes/20%25OFF. ```ts -async deleteCouponSubcode( couponId: number, +async deleteCouponSubcode( + couponId: number, subcode: string, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/custom-fields.md b/doc/controllers/custom-fields.md index ae1d75e4..cee5fb2b 100644 --- a/doc/controllers/custom-fields.md +++ b/doc/controllers/custom-fields.md @@ -49,9 +49,11 @@ It is possible to create Metafields “on the fly” when you create your Metada If configuring metafields in the Admin UI or via the API, be careful sending updates to metafields with the scope attribute – **if a partial update is sent it will overwrite the current configuration**. ```ts -async createMetafields( resourceType: ResourceType, +async createMetafields( + resourceType: ResourceType, body?: CreateMetafieldsRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -144,12 +146,14 @@ try { This endpoint lists metafields associated with a site. The metafield description and usage is contained in the response. ```ts -async listMetafields( resourceType: ResourceType, +async listMetafields( + resourceType: ResourceType, name?: string, page?: number, perPage?: number, direction?: SortingDirection, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -222,9 +226,11 @@ try { Use the following method to update metafields for your Site. Metafields can be populated with metadata after the fact. ```ts -async updateMetafield( resourceType: ResourceType, +async updateMetafield( + resourceType: ResourceType, body?: UpdateMetafieldsRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -270,9 +276,11 @@ Use the following method to delete a metafield. This will remove the metafield f Additionally, this will remove the metafield and associated metadata with all Subscriptions on the Site. ```ts -async deleteMetafield( resourceType: ResourceType, +async deleteMetafield( + resourceType: ResourceType, name?: string, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -337,10 +345,12 @@ This method will create a metafield for the site on the fly if it does not alrea Please pay special attention to the resource you use when creating metadata. ```ts -async createMetadata( resourceType: ResourceType, +async createMetadata( + resourceType: ResourceType, resourceId: number, body?: CreateMetadataRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -408,11 +418,13 @@ This request will list all of the metadata belonging to a particular resource (i This endpoint will also display the current stats of your metadata to use as a tool for pagination. ```ts -async listMetadata( resourceType: ResourceType, +async listMetadata( + resourceType: ResourceType, resourceId: number, page?: number, perPage?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -457,10 +469,12 @@ try { This method allows you to update the existing metadata associated with a subscription or customer. ```ts -async updateMetadata( resourceType: ResourceType, +async updateMetadata( + resourceType: ResourceType, resourceId: number, body?: UpdateMetadataRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -532,11 +546,13 @@ For a success, there will be a code `200` and the plain text response `true`. When a failed response is encountered, you will receive a `404` response and the plain text response of `true`. ```ts -async deleteMetadata( resourceType: ResourceType, +async deleteMetadata( + resourceType: ResourceType, resourceId: number, name?: string, names?: string[], -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -599,7 +615,8 @@ This endpoint will also display the current stats of your metadata to use as a t This endpoint will list the number of pages of metadata information that are contained within a site. ```ts -async listMetadataForResourceType( resourceType: ResourceType, +async listMetadataForResourceType( + resourceType: ResourceType, page?: number, perPage?: number, dateField?: BasicDateField, @@ -610,7 +627,8 @@ async listMetadataForResourceType( resourceType: ResourceType, withDeleted?: boolean, resourceIds?: number[], direction?: SortingDirection, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index fb949c6c..c686bd71 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -47,8 +47,10 @@ Advanced Billing allows you to attribute a language/region to your customer to d For more: [Customer Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Customer-Locale) ```ts -async createCustomer( body?: CreateCustomerRequest, -requestOptions?: RequestOptions): Promise> +async createCustomer( + body?: CreateCustomerRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -157,7 +159,8 @@ Common use cases are: To retrieve a single, exact match by reference, please use the [lookup endpoint](https://developers.chargify.com/docs/api-docs/b710d8fbef104-read-customer-by-reference). ```ts -async listCustomers( direction?: SortingDirection, +async listCustomers( + direction?: SortingDirection, page?: number, perPage?: number, dateField?: BasicDateField, @@ -166,7 +169,8 @@ async listCustomers( direction?: SortingDirection, startDatetime?: string, endDatetime?: string, q?: string, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -299,8 +303,10 @@ try { This method allows to retrieve the Customer properties by Advanced Billing-generated Customer ID. ```ts -async readCustomer( id: number, -requestOptions?: RequestOptions): Promise> +async readCustomer( + id: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -337,9 +343,11 @@ try { This method allows to update the Customer. ```ts -async updateCustomer( id: number, +async updateCustomer( + id: number, body?: UpdateCustomerRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -426,8 +434,10 @@ try { This method allows you to delete the Customer. ```ts -async deleteCustomer( id: number, -requestOptions?: RequestOptions): Promise> +async deleteCustomer( + id: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -464,8 +474,10 @@ try { Use this method to return the customer object if you have the unique **Reference ID (Your App)** value handy. It will return a single match. ```ts -async readCustomerByReference( reference: string, -requestOptions?: RequestOptions): Promise> +async readCustomerByReference( + reference: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -502,8 +514,10 @@ try { This method lists all subscriptions that belong to a customer. ```ts -async listCustomerSubscriptions( customerId: number, -requestOptions?: RequestOptions): Promise> +async listCustomerSubscriptions( + customerId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/events-based-billing-segments.md b/doc/controllers/events-based-billing-segments.md index e9112183..c65df282 100644 --- a/doc/controllers/events-based-billing-segments.md +++ b/doc/controllers/events-based-billing-segments.md @@ -25,10 +25,12 @@ This endpoint creates a new Segment for a Component with segmented Metric. It al You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. ```ts -async createSegment( componentId: string, +async createSegment( + componentId: string, pricePointId: string, body?: CreateSegmentRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -103,12 +105,14 @@ You can pass `page` and `per_page` parameters in order to access all of the segm You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. ```ts -async listSegmentsForPricePoint( componentId: string, +async listSegmentsForPricePoint( + componentId: string, pricePointId: string, page?: number, perPage?: number, filter?: ListSegmentsFilter, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -166,11 +170,13 @@ This endpoint updates a single Segment for a Component with a segmented Metric. You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. ```ts -async updateSegment( componentId: string, +async updateSegment( + componentId: string, pricePointId: string, id: number, body?: UpdateSegmentRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -227,10 +233,12 @@ This endpoint allows you to delete a Segment with specified ID. You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. ```ts -async deleteSegment( componentId: string, +async deleteSegment( + componentId: string, pricePointId: string, id: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -288,10 +296,12 @@ If any of the records contain an error the whole request would fail and none of You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. ```ts -async bulkCreateSegments( componentId: string, +async bulkCreateSegments( + componentId: string, pricePointId: string, body?: BulkCreateSegments, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -346,10 +356,12 @@ If any of the records contain an error the whole request would fail and none of You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. ```ts -async bulkUpdateSegments( componentId: string, +async bulkUpdateSegments( + componentId: string, pricePointId: string, body?: BulkUpdateSegments, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/events.md b/doc/controllers/events.md index a32acc9d..45bdea81 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -38,11 +38,17 @@ The following keys are no longer supported. + `zferral_revenue_post_failure` - (Specific to the deprecated Zferral integration) + `zferral_revenue_post_success` - (Specific to the deprecated Zferral integration) +## Event Key + +The event type is identified by the key property. You can check supported keys [here](../../doc/models/event-key.md). + ## Event Specific Data -Event Specific Data +Different event types may include additional data in `event_specific_data` property. +While some events share the same schema for `event_specific_data`, others may not include it at all. +For precise mappings from key to event_specific_data, refer to [Event](../../doc/models/event.md). -Each event type has its own `event_specific_data` specified. +### Example Here’s an example event for the `subscription_product_change` event: @@ -81,18 +87,20 @@ Here’s an example event for the `subscription_state_change` event: ``` ```ts -async listEvents( page?: number, +async listEvents( + page?: number, perPage?: number, sinceId?: bigint, maxId?: bigint, direction?: Direction, - filter?: EventType[], + filter?: EventKey[], dateField?: ListEventsDateField, startDate?: string, endDate?: string, startDatetime?: string, endDatetime?: string, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -104,7 +112,7 @@ requestOptions?: RequestOptions): Promise> | `sinceId` | `bigint \| undefined` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `maxId` | `bigint \| undefined` | Query, Optional | Returns events with an id less than or equal to the one specified | | `direction` | [`Direction \| undefined`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.
**Default**: `Direction.Desc` | -| `filter` | [`EventType[] \| undefined`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | +| `filter` | [`EventKey[] \| undefined`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | | `dateField` | [`ListEventsDateField \| undefined`](../../doc/models/list-events-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | | `startDate` | `string \| undefined` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `endDate` | `string \| undefined` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | @@ -124,8 +132,8 @@ const collect = { perPage: 50, direction: Direction.Desc, filter: [ - EventType.CustomFieldValueChange, - EventType.PaymentSuccess + EventKey.CustomFieldValueChange, + EventKey.PaymentSuccess ], dateField: ListEventsDateField.CreatedAt } @@ -209,17 +217,27 @@ try { The following request will return a list of events for a subscription. -Each event type has its own `event_specific_data` specified. +## Event Key + +The event type is identified by the key property. You can check supported keys [here](../../doc/models/event-key.md). + +## Event Specific Data + +Different event types may include additional data in `event_specific_data` property. +While some events share the same schema for `event_specific_data`, others may not include it at all. +For precise mappings from key to event_specific_data, refer to [Event](../../doc/models/event.md). ```ts -async listSubscriptionEvents( subscriptionId: number, +async listSubscriptionEvents( + subscriptionId: number, page?: number, perPage?: number, sinceId?: bigint, maxId?: bigint, direction?: Direction, - filter?: EventType[], -requestOptions?: RequestOptions): Promise> + filter?: EventKey[], + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -232,7 +250,7 @@ requestOptions?: RequestOptions): Promise> | `sinceId` | `bigint \| undefined` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `maxId` | `bigint \| undefined` | Query, Optional | Returns events with an id less than or equal to the one specified | | `direction` | [`Direction \| undefined`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.
**Default**: `Direction.Desc` | -| `filter` | [`EventType[] \| undefined`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | +| `filter` | [`EventKey[] \| undefined`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -248,8 +266,8 @@ const collect = { perPage: 50, direction: Direction.Desc, filter: [ - EventType.CustomFieldValueChange, - EventType.PaymentSuccess + EventKey.CustomFieldValueChange, + EventKey.PaymentSuccess ] } @@ -314,13 +332,15 @@ try { Get a count of all the events for a given site by using this method. ```ts -async readEventsCount( page?: number, +async readEventsCount( + page?: number, perPage?: number, sinceId?: bigint, maxId?: bigint, direction?: Direction, - filter?: EventType[], -requestOptions?: RequestOptions): Promise> + filter?: EventKey[], + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -332,7 +352,7 @@ requestOptions?: RequestOptions): Promise> | `sinceId` | `bigint \| undefined` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `maxId` | `bigint \| undefined` | Query, Optional | Returns events with an id less than or equal to the one specified | | `direction` | [`Direction \| undefined`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.
**Default**: `Direction.Desc` | -| `filter` | [`EventType[] \| undefined`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | +| `filter` | [`EventKey[] \| undefined`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -347,8 +367,8 @@ const collect = { perPage: 50, direction: Direction.Desc, filter: [ - EventType.CustomFieldValueChange, - EventType.PaymentSuccess + EventKey.CustomFieldValueChange, + EventKey.PaymentSuccess ] } diff --git a/doc/controllers/insights.md b/doc/controllers/insights.md index c5d60650..104b98f7 100644 --- a/doc/controllers/insights.md +++ b/doc/controllers/insights.md @@ -29,7 +29,9 @@ https://subdomain.chargify.com/dashboard ``` ```ts -async readSiteStats(requestOptions?: RequestOptions): Promise> +async readSiteStats( + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -84,9 +86,11 @@ try { This endpoint returns your site's current MRR, including plan and usage breakouts. ```ts -async readMrr( atTime?: string, +async readMrr( + atTime?: string, subscriptionId?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -167,11 +171,13 @@ Usage includes revenue from: * Prepaid Usage Components ```ts -async listMrrMovements( subscriptionId?: number, +async listMrrMovements( + subscriptionId?: number, page?: number, perPage?: number, direction?: SortingDirection, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -268,12 +274,14 @@ try { This endpoint returns your site's current MRR, including plan and usage breakouts split per subscription. ```ts -async listMrrPerSubscription( filter?: ListMrrFilter, +async listMrrPerSubscription( + filter?: ListMrrFilter, atTime?: string, page?: number, perPage?: number, direction?: Direction, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index e4ce3d50..0c65ba62 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -40,9 +40,11 @@ A refund less than the total of a consolidated invoice will be split across its A $50.00 refund on a $100.00 consolidated invoice with one $60.00 and one $40.00 segment, the refunded amount will be applied as 50% of each ($30.00 and $20.00 respectively). ```ts -async refundInvoice( uid: string, +async refundInvoice( + uid: string, body?: RefundInvoiceRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -100,7 +102,8 @@ try { By default, invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`, or `refunds`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. ```ts -async listInvoices( startDate?: string, +async listInvoices( + startDate?: string, endDate?: string, status?: InvoiceStatus, subscriptionId?: number, @@ -122,7 +125,8 @@ async listInvoices( startDate?: string, mNumber?: string[], productIds?: number[], sort?: InvoiceSortField, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -492,8 +496,10 @@ Response: A single Invoice. ``` ```ts -async readInvoice( uid: string, -requestOptions?: RequestOptions): Promise> +async readInvoice( + uid: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -661,14 +667,16 @@ If both a `since_date` and `since_id` are provided in request parameters, the `s Note - invoice events that occurred prior to 09/05/2018 __will not__ contain an `invoice` snapshot. ```ts -async listInvoiceEvents( sinceDate?: string, +async listInvoiceEvents( + sinceDate?: string, sinceId?: bigint, page?: number, perPage?: number, invoiceUid?: string, withChangeInvoiceStatus?: string, eventTypes?: InvoiceEventType[], -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1141,9 +1149,11 @@ In order to apply a service credit to an invoice, specify the `type` as `service Note that Advanced Billing will attempt to fully pay the invoice's `due_amount` from the Subscription's Service Credit account. At this time, partial payments from a Service Credit Account are only allowed for consolidated invoices (subscription groups). Therefore, for normal invoices the Service Credit account balance must be greater than or equal to the invoice's `due_amount`. ```ts -async recordPaymentForInvoice( uid: string, +async recordPaymentForInvoice( + uid: string, body?: CreateInvoicePaymentRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1224,8 +1234,10 @@ In order apply a payment to multiple invoices, at minimum, specify the `amount` Note that the invoice payment amounts must be greater than 0. Total amount must be greater or equal to invoices payment amount sum. ```ts -async recordPaymentForMultipleInvoices( body?: CreateMultiInvoicePaymentRequest, -requestOptions?: RequestOptions): Promise> +async recordPaymentForMultipleInvoices( + body?: CreateMultiInvoicePaymentRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1311,7 +1323,8 @@ Credit Notes are like inverse invoices. They reduce the amount a customer owes. By default, the credit notes returned by this endpoint will exclude the arrays of `line_items`, `discounts`, `taxes`, `applications`, or `refunds`. To include these arrays, pass the specific field as a key in the query with a value set to `true`. ```ts -async listCreditNotes( subscriptionId?: number, +async listCreditNotes( + subscriptionId?: number, page?: number, perPage?: number, lineItems?: boolean, @@ -1319,7 +1332,8 @@ async listCreditNotes( subscriptionId?: number, taxes?: boolean, refunds?: boolean, applications?: boolean, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1672,8 +1686,10 @@ try { Use this endpoint to retrieve the details for a credit note. ```ts -async readCreditNote( uid: string, -requestOptions?: RequestOptions): Promise> +async readCreditNote( + uid: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -2025,9 +2041,11 @@ Excess payment will result in the creation of a prepayment on the Invoice Accoun Only ungrouped or primary subscriptions may be paid using the "bulk" payment request. ```ts -async recordPaymentForSubscription( subscriptionId: number, +async recordPaymentForSubscription( + subscriptionId: number, body?: RecordPaymentRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -2116,8 +2134,10 @@ A note about reactivations: any canceled invoices from the most recent active pe When reopening a consolidated invoice, all of its canceled segments will also be reopened. ```ts -async reopenInvoice( uid: string, -requestOptions?: RequestOptions): Promise> +async reopenInvoice( + uid: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -2161,9 +2181,11 @@ try { This endpoint allows you to void any invoice with the "open" or "canceled" status. It will also allow voiding of an invoice with the "pending" status if it is not a consolidated invoice. ```ts -async voidInvoice( uid: string, +async voidInvoice( + uid: string, body?: VoidInvoiceRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -2217,11 +2239,13 @@ try { Invoice segments returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. ```ts -async listConsolidatedInvoiceSegments( invoiceUid: string, +async listConsolidatedInvoiceSegments( + invoiceUid: string, page?: number, perPage?: number, direction?: Direction, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -2705,9 +2729,11 @@ A custom memo can be sent with the `memo` parameter to override the site's defau By default, invoices will be created with open status. Possible alternative is `draft`. ```ts -async createInvoice( subscriptionId: number, +async createInvoice( + subscriptionId: number, body?: CreateInvoiceRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -2867,9 +2893,11 @@ Please note that if no recipient email addresses are specified in the request, t On success, a 204 no-content response will be returned. Please note that this does not indicate that email(s) have been delivered, but instead indicates that emails have been successfully queued for delivery. If _any_ invalid or malformed email address is found in the request body, the entire request will be rejected and a 422 response will be returned. ```ts -async sendInvoice( uid: string, +async sendInvoice( + uid: string, body?: SendInvoiceRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -2930,8 +2958,10 @@ Customer information may change after an invoice is issued which may lead to a m The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. ```ts -async previewCustomerInformationChanges( uid: string, -requestOptions?: RequestOptions): Promise> +async previewCustomerInformationChanges( + uid: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -3030,8 +3060,10 @@ This endpoint updates customer information on an open invoice and returns the up The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. ```ts -async updateCustomerInformation( uid: string, -requestOptions?: RequestOptions): Promise> +async updateCustomerInformation( + uid: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -3273,9 +3305,11 @@ For Automatic subscriptions, prepayments and service credits will apply to the i - `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings). ```ts -async issueInvoice( uid: string, +async issueInvoice( + uid: string, body?: IssueInvoiceRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index 92c728a6..0eddfcf6 100644 --- a/doc/controllers/offers.md +++ b/doc/controllers/offers.md @@ -34,8 +34,10 @@ Full documentation on how to use offers in the Advanced Billing UI can be locate You can optionally pass in a `product_price_point_id` that corresponds with the `product_id` and the offer will use that price point. If a `product_price_point_id` is not passed in, the product's default price point will be used. ```ts -async createOffer( body?: CreateOfferRequest, -requestOptions?: RequestOptions): Promise> +async createOffer( + body?: CreateOfferRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -137,10 +139,12 @@ try { This endpoint will list offers for a site. ```ts -async listOffers( page?: number, +async listOffers( + page?: number, perPage?: number, includeArchived?: boolean, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -232,14 +236,22 @@ try { } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) | + # Read Offer This method allows you to list a specific offer's attributes. This is different than list all offers for a site, as it requires an `offer_id`. ```ts -async readOffer( offerId: number, -requestOptions?: RequestOptions): Promise> +async readOffer( + offerId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -276,8 +288,10 @@ try { Archive an existing offer. Please provide an `offer_id` in order to archive the correct item. ```ts -async archiveOffer( offerId: number, -requestOptions?: RequestOptions): Promise> +async archiveOffer( + offerId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -314,8 +328,10 @@ try { Unarchive a previously archived offer. Please provide an `offer_id` in order to un-archive the correct item. ```ts -async unarchiveOffer( offerId: number, -requestOptions?: RequestOptions): Promise> +async unarchiveOffer( + offerId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index 5e5fcf29..2a6c6a2e 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -300,8 +300,10 @@ You may wish to redirect customers to different pages depending on whether their 8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was successful or not ```ts -async createPaymentProfile( body?: CreatePaymentProfileRequest, -requestOptions?: RequestOptions): Promise> +async createPaymentProfile( + body?: CreatePaymentProfileRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -384,10 +386,12 @@ try { This method will return all of the active `payment_profiles` for a Site, or for one Customer within a site. If no payment profiles are found, this endpoint will return an empty array, not a 404. ```ts -async listPaymentProfiles( page?: number, +async listPaymentProfiles( + page?: number, perPage?: number, customerId?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -522,8 +526,10 @@ Example response for Bank Account: ``` ```ts -async readPaymentProfile( paymentProfileId: number, -requestOptions?: RequestOptions): Promise> +async readPaymentProfile( + paymentProfileId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -628,9 +634,11 @@ The result will be that you have updated the billing information for the card, y - If you are using Authorize.net or Stripe, you may elect to manually trigger a retry for a past due subscription after a partial update. ```ts -async updatePaymentProfile( paymentProfileId: number, +async updatePaymentProfile( + paymentProfileId: number, body?: UpdatePaymentProfileRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -727,8 +735,10 @@ Deletes an unused payment profile. If the payment profile is in use by one or more subscriptions or groups, a 422 and error message will be returned. ```ts -async deleteUnusedPaymentProfile( paymentProfileId: number, -requestOptions?: RequestOptions): Promise> +async deleteUnusedPaymentProfile( + paymentProfileId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -776,9 +786,11 @@ This will delete a payment profile belonging to the customer on the subscription + If you delete the default payment profile for a subscription, you will need to specify another payment profile to be the default through the api, or either prompt the user to enter a card in the billing portal or on the self-service page, or visit the Payment Details tab on the subscription in the Admin UI and use the “Add New Credit Card” or “Make Active Payment Method” link, (depending on whether there are other cards present). ```ts -async deleteSubscriptionsPaymentProfile( subscriptionId: number, +async deleteSubscriptionsPaymentProfile( + subscriptionId: number, paymentProfileId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -821,9 +833,11 @@ try { Submit the two small deposit amounts the customer received in their bank account in order to verify the bank account. (Stripe only) ```ts -async verifyBankAccount( bankAccountId: number, +async verifyBankAccount( + bankAccountId: number, body?: BankAccountVerificationRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -908,9 +922,11 @@ This will delete a Payment Profile belonging to a Subscription Group. **Note**: If the Payment Profile belongs to multiple Subscription Groups and/or Subscriptions, it will be removed from all of them. ```ts -async deleteSubscriptionGroupPaymentProfile( uid: string, +async deleteSubscriptionGroupPaymentProfile( + uid: string, paymentProfileId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -955,9 +971,11 @@ This will change the default payment profile on the subscription to the existing You must elect to change the existing payment profile to a new payment profile ID in order to receive a satisfactory response from this endpoint. ```ts -async changeSubscriptionDefaultPaymentProfile( subscriptionId: number, +async changeSubscriptionDefaultPaymentProfile( + subscriptionId: number, paymentProfileId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1040,9 +1058,11 @@ You must elect to change the existing payment profile to a new payment profile I The new payment profile must belong to the subscription group's customer, otherwise you will receive an error. ```ts -async changeSubscriptionGroupDefaultPaymentProfile( uid: string, +async changeSubscriptionGroupDefaultPaymentProfile( + uid: string, paymentProfileId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1124,8 +1144,10 @@ You can use One Time Tokens while creating a subscription or payment profile ins To obtain a One Time Token you have to use [Chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview). ```ts -async readOneTimeToken( chargifyToken: string, -requestOptions?: RequestOptions): Promise> +async readOneTimeToken( + chargifyToken: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1174,8 +1196,10 @@ Additionally, if you attempt to send a "request payment update" email for a subs These error responses are designed to prevent excessive or invalid requests, and to provide clear and helpful information to users who encounter errors during the request process. ```ts -async sendRequestUpdatePaymentEmail( subscriptionId: number, -requestOptions?: RequestOptions): Promise> +async sendRequestUpdatePaymentEmail( + subscriptionId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index c6975ab3..ce2c6730 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -21,7 +21,8 @@ const productFamiliesController = new ProductFamiliesController(client); This method allows to retrieve a list of Products belonging to a Product Family. ```ts -async listProductsForProductFamily( productFamilyId: string, +async listProductsForProductFamily( + productFamilyId: string, page?: number, perPage?: number, dateField?: BasicDateField, @@ -32,7 +33,8 @@ async listProductsForProductFamily( productFamilyId: string, endDatetime?: string, includeArchived?: boolean, include?: ListProductsInclude, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -199,8 +201,10 @@ This method will create a Product Family within your Advanced Billing site. Crea Full documentation on how Product Families operate within the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Product-Families). ```ts -async createProductFamily( body?: CreateProductFamilyRequest, -requestOptions?: RequestOptions): Promise> +async createProductFamily( + body?: CreateProductFamilyRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -262,12 +266,14 @@ try { This method allows to retrieve a list of Product Families for a site. ```ts -async listProductFamilies( dateField?: BasicDateField, +async listProductFamilies( + dateField?: BasicDateField, startDate?: string, endDate?: string, startDatetime?: string, endDatetime?: string, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -341,8 +347,10 @@ This method allows to retrieve a Product Family via the `product_family_id`. The The product family can be specified either with the id number, or with the `handle:my-family` format. ```ts -async readProductFamily( id: number, -requestOptions?: RequestOptions): Promise> +async readProductFamily( + id: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index 1af03c97..bf9e2f00 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -28,9 +28,11 @@ const productPricePointsController = new ProductPricePointsController(client); [Product Price Point Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261111947789-Product-Price-Points) ```ts -async createProductPricePoint( productId: CreateProductPricePointProductId, +async createProductPricePoint( + productId: CreateProductPricePointProductId, body?: CreateProductPricePointRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -122,12 +124,15 @@ try { Use this endpoint to retrieve a list of product price points. ```ts -async listProductPricePoints( productId: ListProductPricePointsInputProductId, +async listProductPricePoints( + productId: ListProductPricePointsInputProductId, page?: number, perPage?: number, currencyPrices?: boolean, filterType?: PricePointType[], -requestOptions?: RequestOptions): Promise> + archived?: boolean, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -139,6 +144,7 @@ requestOptions?: RequestOptions): Promise**Default**: `10`
**Constraints**: `<= 200` | | `currencyPrices` | `boolean \| undefined` | Query, Optional | When fetching a product's price points, if you have defined multiple currencies at the site level, you can optionally pass the ?currency_prices=true query param to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | | `filterType` | [`PricePointType[] \| undefined`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | +| `archived` | `boolean \| undefined` | Query, Optional | Set to include archived price points in the response. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -203,10 +209,12 @@ Use this endpoint to update a product price point. Note: Custom product price points are not able to be updated. ```ts -async updateProductPricePoint( productId: UpdateProductPricePointProductId, +async updateProductPricePoint( + productId: UpdateProductPricePointProductId, pricePointId: UpdateProductPricePointPricePointId, body?: UpdateProductPricePointRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -285,10 +293,12 @@ try { Use this endpoint to retrieve details for a specific product price point. You can achieve this by using either the product price point ID or handle. ```ts -async readProductPricePoint( productId: ReadProductPricePointProductId, +async readProductPricePoint( + productId: ReadProductPricePointProductId, pricePointId: ReadProductPricePointPricePointId, currencyPrices?: boolean, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -359,9 +369,11 @@ try { Use this endpoint to archive a product price point. ```ts -async archiveProductPricePoint( productId: ArchiveProductPricePointProductId, +async archiveProductPricePoint( + productId: ArchiveProductPricePointProductId, pricePointId: ArchiveProductPricePointPricePointId, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -437,9 +449,11 @@ try { Use this endpoint to unarchive an archived product price point. ```ts -async unarchiveProductPricePoint( productId: number, +async unarchiveProductPricePoint( + productId: number, pricePointId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -511,9 +525,11 @@ Use this endpoint to make a product price point the default for the product. Note: Custom product price points are not able to be set as the default for a product. ```ts -async promoteProductPricePointToDefault( productId: number, +async promoteProductPricePointToDefault( + productId: number, pricePointId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -609,9 +625,11 @@ try { Use this endpoint to create multiple product price points in one request. ```ts -async bulkCreateProductPricePoints( productId: number, +async bulkCreateProductPricePoints( + productId: number, body?: BulkCreateProductPricePointsRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -726,9 +744,11 @@ When creating currency prices, they need to mirror the structure of your primary Note: Currency Prices are not able to be created for custom product price points. ```ts -async createProductCurrencyPrices( productPricePointId: number, +async createProductCurrencyPrices( + productPricePointId: number, body?: CreateProductCurrencyPricesRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -816,9 +836,11 @@ When updating the pricing, it needs to mirror the structure of your primary pric Note: Currency Prices are not able to be updated for custom product price points. ```ts -async updateProductCurrencyPrices( productPricePointId: number, +async updateProductCurrencyPrices( + productPricePointId: number, body?: UpdateCurrencyPricesRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -895,12 +917,14 @@ try { This method allows retrieval of a list of Products Price Points belonging to a Site. ```ts -async listAllProductPricePoints( direction?: SortingDirection, +async listAllProductPricePoints( + direction?: SortingDirection, filter?: ListPricePointsFilter, include?: ListProductsPricePointsInclude, page?: number, perPage?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/products.md b/doc/controllers/products.md index 7171a0be..85f00187 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -26,9 +26,11 @@ Use this method to create a product within your Advanced Billing site. + [Changing a Subscription's Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations) ```ts -async createProduct( productFamilyId: string, +async createProduct( + productFamilyId: string, body?: CreateOrUpdateProductRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -139,8 +141,10 @@ try { This endpoint allows you to read the current details of a product that you've created in Advanced Billing. ```ts -async readProduct( productId: number, -requestOptions?: RequestOptions): Promise> +async readProduct( + productId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -228,9 +232,11 @@ Use this method to change aspects of an existing product. Updating a product using this endpoint will create a new price point and set it as the default price point for this product. If you should like to update an existing product price point, that must be done separately. ```ts -async updateProduct( productId: number, +async updateProduct( + productId: number, body?: CreateOrUpdateProductRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -324,8 +330,10 @@ Sending a DELETE request to this endpoint will archive the product. All current This will restrict the option to chose the product for purchase via the Billing Portal, as well as disable Public Signup Pages for the product. ```ts -async archiveProduct( productId: number, -requestOptions?: RequestOptions): Promise> +async archiveProduct( + productId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -411,8 +419,10 @@ try { This method allows to retrieve a Product object by its `api_handle`. ```ts -async readProductByHandle( apiHandle: string, -requestOptions?: RequestOptions): Promise> +async readProductByHandle( + apiHandle: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -517,7 +527,8 @@ try { This method allows to retrieve a list of Products belonging to a Site. ```ts -async listProducts( dateField?: BasicDateField, +async listProducts( + dateField?: BasicDateField, filter?: ListProductsFilter, endDate?: string, endDatetime?: string, @@ -527,7 +538,8 @@ async listProducts( dateField?: BasicDateField, perPage?: number, includeArchived?: boolean, include?: ListProductsInclude, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 53dabff1..08d02bcb 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -32,8 +32,10 @@ If the information becomes outdated, simply void the old consolidated proforma i Proforma invoices are only available on Relationship Invoicing sites. To create a proforma invoice, the subscription must not be prepaid, and must be in a live state. ```ts -async createConsolidatedProformaInvoice( uid: string, -requestOptions?: RequestOptions): Promise> +async createConsolidatedProformaInvoice( + uid: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -78,14 +80,16 @@ Only proforma invoices with a `consolidation_level` of parent are returned. By default, proforma invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`. To include breakdowns, pass the specific field as a key in the query with a value set to true. ```ts -async listSubscriptionGroupProformaInvoices( uid: string, +async listSubscriptionGroupProformaInvoices( + uid: string, lineItems?: boolean, discounts?: boolean, taxes?: boolean, credits?: boolean, payments?: boolean, customFields?: boolean, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -146,8 +150,10 @@ Use this endpoint to read the details of an existing proforma invoice. Proforma invoices are only available on Relationship Invoicing sites. ```ts -async readProformaInvoice( proformaInvoiceUid: string, -requestOptions?: RequestOptions): Promise> +async readProformaInvoice( + proformaInvoiceUid: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -196,8 +202,10 @@ If you would like to preview the next billing amounts without generating a full Proforma invoices are only available on Relationship Invoicing sites. To create a proforma invoice, the subscription must not be in a group, must not be prepaid, and must be in a live state. ```ts -async createProformaInvoice( subscriptionId: number, -requestOptions?: RequestOptions): Promise> +async createProformaInvoice( + subscriptionId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -240,7 +248,8 @@ try { By default, proforma invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. ```ts -async listProformaInvoices( subscriptionId: number, +async listProformaInvoices( + subscriptionId: number, startDate?: string, endDate?: string, status?: ProformaInvoiceStatus, @@ -253,7 +262,8 @@ async listProformaInvoices( subscriptionId: number, credits?: boolean, payments?: boolean, customFields?: boolean, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -321,9 +331,11 @@ Only proforma invoices that have the appropriate status may be reopened. If the A reason for the void operation is required to be included in the request body. If one is not provided, the response will have HTTP status code 422 and an error message. ```ts -async voidProformaInvoice( proformaInvoiceUid: string, +async voidProformaInvoice( + proformaInvoiceUid: string, body?: VoidInvoiceRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -374,8 +386,10 @@ If all the data returned in the preview is as expected, you may then create a st Alternatively, if you have some proforma invoices already, you may make a preview call to determine whether any billing information for the subscription's upcoming renewal has changed. ```ts -async previewProformaInvoice( subscriptionId: number, -requestOptions?: RequestOptions): Promise> +async previewProformaInvoice( + subscriptionId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -425,8 +439,10 @@ Pass a payload that resembles a subscription create or signup preview request. F A product and customer first name, last name, and email are the minimum requirements. We recommend associating the proforma invoice with a customer_id to easily find their proforma invoices, since the subscription_id will always be blank. ```ts -async createSignupProformaInvoice( body?: CreateSubscriptionRequest, -requestOptions?: RequestOptions): Promise> +async createSignupProformaInvoice( + body?: CreateSubscriptionRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -485,9 +501,11 @@ Pass a payload that resembles a subscription create or signup preview request. F A product and customer first name, last name, and email are the minimum requirements. ```ts -async previewSignupProformaInvoice( include?: CreateSignupProformaPreviewInclude, +async previewSignupProformaInvoice( + include?: CreateSignupProformaPreviewInclude, body?: CreateSubscriptionRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index 8bd46aa0..84b58c31 100644 --- a/doc/controllers/reason-codes.md +++ b/doc/controllers/reason-codes.md @@ -36,8 +36,10 @@ Full documentation on how Reason Codes operate within Advanced Billing can be lo This method gives a merchant the option to create a reason codes for a given Site. ```ts -async createReasonCode( body?: CreateReasonCodeRequest, -requestOptions?: RequestOptions): Promise> +async createReasonCode( + body?: CreateReasonCodeRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -86,9 +88,11 @@ try { This method gives a merchant the option to retrieve a list of all of the current churn codes for a given site. ```ts -async listReasonCodes( page?: number, +async listReasonCodes( + page?: number, perPage?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -163,14 +167,22 @@ try { ] ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) | + # Read Reason Code This method gives a merchant the option to retrieve a list of a particular code for a given Site by providing the unique numerical ID of the code. ```ts -async readReasonCode( reasonCodeId: number, -requestOptions?: RequestOptions): Promise> +async readReasonCode( + reasonCodeId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -213,9 +225,11 @@ try { This method gives a merchant the option to update an existing reason code for a given site. ```ts -async updateReasonCode( reasonCodeId: number, +async updateReasonCode( + reasonCodeId: number, body?: UpdateReasonCodeRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -252,6 +266,7 @@ try { | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | | 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) | # Delete Reason Code @@ -259,8 +274,10 @@ try { This method gives a merchant the option to delete one reason code from the Churn Reason Codes. This code will be immediately removed. This action is not reversable. ```ts -async deleteReasonCode( reasonCodeId: number, -requestOptions?: RequestOptions): Promise> +async deleteReasonCode( + reasonCodeId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -272,7 +289,7 @@ requestOptions?: RequestOptions): Promise> ## Response Type -[`ReasonCodesJsonResponse`](../../doc/models/reason-codes-json-response.md) +[`OkResponse`](../../doc/models/ok-response.md) ## Example Usage diff --git a/doc/controllers/referral-codes.md b/doc/controllers/referral-codes.md index 347e3514..3bd6e3f0 100644 --- a/doc/controllers/referral-codes.md +++ b/doc/controllers/referral-codes.md @@ -22,8 +22,10 @@ Full documentation on how to use the referrals feature in the Advanced Billing U If the referral code is valid the status code will be `200` and the referral code will be returned. If the referral code is invalid, a `404` response will be returned. ```ts -async validateReferralCode( code: string, -requestOptions?: RequestOptions): Promise> +async validateReferralCode( + code: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/sales-commissions.md b/doc/controllers/sales-commissions.md index 710b2ca4..18334054 100644 --- a/doc/controllers/sales-commissions.md +++ b/doc/controllers/sales-commissions.md @@ -28,12 +28,14 @@ Access to the Sales Commission API endpoints is available to users with financia > Note: The request is at seller level, it means `<>` variable will be replaced by `app` ```ts -async listSalesCommissionSettings( sellerId: string, +async listSalesCommissionSettings( + sellerId: string, authorization?: string, liveMode?: boolean, page?: number, perPage?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -121,12 +123,14 @@ Access to the Sales Commission API endpoints is available to users with financia > Note: The request is at seller level, it means `<>` variable will be replaced by `app` ```ts -async listSalesReps( sellerId: string, +async listSalesReps( + sellerId: string, authorization?: string, liveMode?: boolean, page?: number, perPage?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -263,13 +267,15 @@ Access to the Sales Commission API endpoints is available to users with financia > Note: The request is at seller level, it means `<>` variable will be replaced by `app` ```ts -async readSalesRep( sellerId: string, +async readSalesRep( + sellerId: string, salesRepId: string, authorization?: string, liveMode?: boolean, page?: number, perPage?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index 2597a66f..cd563b4e 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -35,7 +35,9 @@ You can read more about these settings here: [Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays) ```ts -async readSite(requestOptions?: RequestOptions): Promise> +async readSite( + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -121,8 +123,10 @@ This call is asynchronous and there may be a delay before the site data is fully **This functionality will only work on sites in TEST mode. Attempts to perform this on sites in “live” mode will result in a response of 403 FORBIDDEN.** ```ts -async clearSite( cleanupScope?: CleanupScope, -requestOptions?: RequestOptions): Promise> +async clearSite( + cleanupScope?: CleanupScope, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -159,9 +163,11 @@ try { This endpoint returns public keys used for Chargify.js. ```ts -async listChargifyJsPublicKeys( page?: number, +async listChargifyJsPublicKeys( + page?: number, perPage?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index 9ced3077..8b874152 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -34,9 +34,11 @@ const subscriptionComponentsController = new SubscriptionComponentsController(cl This request will list information regarding a specific component owned by a subscription. ```ts -async readSubscriptionComponent( subscriptionId: number, +async readSubscriptionComponent( + subscriptionId: number, componentId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -108,7 +110,8 @@ This request will list a subscription's applied components. When requesting to list components for a given subscription, if the subscription contains **archived** components they will be listed in the server response. ```ts -async listSubscriptionComponents( subscriptionId: number, +async listSubscriptionComponents( + subscriptionId: number, dateField?: SubscriptionListDateField, direction?: SortingDirection, filter?: ListSubscriptionComponentsFilter, @@ -121,7 +124,8 @@ async listSubscriptionComponents( subscriptionId: number, startDatetime?: string, include?: ListSubscriptionComponentsInclude[], inUse?: boolean, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -226,9 +230,11 @@ The `price_point` key can take either a: 3. `"_default"` string, which will reset the price point to the component's current default price point. ```ts -async bulkUpdateSubscriptionComponentsPricePoints( subscriptionId: number, +async bulkUpdateSubscriptionComponentsPricePoints( + subscriptionId: number, body?: BulkComponentsPricePointAssignment, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -311,8 +317,10 @@ Resets all of a subscription's components to use the current default. **Note**: this will update the price point for all of the subscription's components, even ones that have not been allocated yet. ```ts -async bulkResetSubscriptionComponentsPricePoints( subscriptionId: number, -requestOptions?: RequestOptions): Promise> +async bulkResetSubscriptionComponentsPricePoints( + subscriptionId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -497,10 +505,12 @@ See the tables below for valid values. **NOTE: Proration uses the current price of the component as well as the current tax rates. Changes to either may cause the prorated charge/credit to be wrong.** ```ts -async allocateComponent( subscriptionId: number, +async allocateComponent( + subscriptionId: number, componentId: number, body?: CreateAllocationRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -605,10 +615,12 @@ puts component.allocated_quantity ``` ```ts -async listAllocations( subscriptionId: number, +async listAllocations( + subscriptionId: number, componentId: number, page?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -711,9 +723,11 @@ A `component_id` is required for each allocation. This endpoint only responds to JSON. It is not available for XML. ```ts -async allocateComponents( subscriptionId: number, +async allocateComponents( + subscriptionId: number, body?: AllocateComponents, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -827,9 +841,11 @@ When the allocation uses multiple different types of `upgrade_charge`s or `downg See example below for Fine-Grained Component Control response. ```ts -async previewAllocations( subscriptionId: number, +async previewAllocations( + subscriptionId: number, body?: PreviewAllocationsRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1003,11 +1019,13 @@ A few limitations exist when changing an allocation's expiration date: - An expiration date can be changed towards the past (essentially expiring it) up to the subscription's current period beginning date. ```ts -async updatePrepaidUsageAllocationExpirationDate( subscriptionId: number, +async updatePrepaidUsageAllocationExpirationDate( + subscriptionId: number, componentId: number, allocationId: number, body?: UpdateAllocationExpirationDate, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1077,11 +1095,13 @@ By default, destroying an allocation will generate a service credit on the subsc 3. `refund`: The allocation will be destroyed and the balances will be updated and a refund will be issued along with a Credit Note. ```ts -async deletePrepaidUsageAllocation( subscriptionId: number, +async deletePrepaidUsageAllocation( + subscriptionId: number, componentId: number, allocationId: number, body?: CreditSchemeRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1196,10 +1216,12 @@ Q. Is it possible to record metered usage for more than one component at a time? A. No. Usage should be reported as one API call per component on a single subscription. For example, to record that a subscriber has sent both an SMS Message and an Email, send an API call for each. ```ts -async createUsage( subscriptionId: number, +async createUsage( + subscriptionId: number, componentId: CreateUsageComponentId, body?: CreateUsageRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1289,7 +1311,8 @@ Note: The `since_date` and `until_date` attributes each default to midnight on t Use this endpoint to read the previously recorded components for a subscription. You can now specify either the component id (integer) or the component handle prefixed by "handle:" to specify the unique identifier for the component you are working with. ```ts -async listUsages( subscriptionId: number, +async listUsages( + subscriptionId: number, componentId: ListUsagesInputComponentId, sinceId?: bigint, maxId?: bigint, @@ -1297,7 +1320,8 @@ async listUsages( subscriptionId: number, untilDate?: string, page?: number, perPage?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1383,10 +1407,12 @@ Use this endpoint to activate an event-based component for a single subscription *Note: it is possible to stream events for a subscription at any time, regardless of component activation status. The activation status only determines if the subscription should be billed for event-based component usage at renewal.* ```ts -async activateEventBasedComponent( subscriptionId: number, +async activateEventBasedComponent( + subscriptionId: number, componentId: number, body?: ActivateEventBasedComponent, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1450,9 +1476,11 @@ try { Use this endpoint to deactivate an event-based component for a single subscription. Deactivating the event-based component causes Advanced Billing to ignore related events at subscription renewal. ```ts -async deactivateEventBasedComponent( subscriptionId: number, +async deactivateEventBasedComponent( + subscriptionId: number, componentId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1513,18 +1541,18 @@ https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle ``` ```ts -async recordEvent( subdomain: string, +async recordEvent( apiHandle: string, storeUid?: string, body?: EBBEvent, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subdomain` | `string` | Template, Required | Your site's subdomain | | `apiHandle` | `string` | Template, Required | Identifies the Stream for which the event should be published. | | `storeUid` | `string \| undefined` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. | | `body` | [`EBBEvent \| undefined`](../../doc/models/ebb-event.md) | Body, Optional | - | @@ -1537,8 +1565,6 @@ requestOptions?: RequestOptions): Promise> ## Example Usage ```ts -const subdomain = 'subdomain4'; - const apiHandle = 'api_handle6'; const body: EBBEvent = { @@ -1550,7 +1576,6 @@ const body: EBBEvent = { try { const { result, ...httpResponse } = await subscriptionComponentsController.recordEvent( - subdomain, apiHandle, undefined, body @@ -1575,18 +1600,18 @@ Use this endpoint to record a collection of events. A maximum of 1000 events can be published in a single request. A 422 will be returned if this limit is exceeded. ```ts -async bulkRecordEvents( subdomain: string, +async bulkRecordEvents( apiHandle: string, storeUid?: string, body?: EBBEvent[], -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subdomain` | `string` | Template, Required | Your site's subdomain | | `apiHandle` | `string` | Template, Required | Identifies the Stream for which the events should be published. | | `storeUid` | `string \| undefined` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. | | `body` | [`EBBEvent[] \| undefined`](../../doc/models/ebb-event.md) | Body, Optional | - | @@ -1599,8 +1624,6 @@ requestOptions?: RequestOptions): Promise> ## Example Usage ```ts -const subdomain = 'subdomain4'; - const apiHandle = 'api_handle6'; const body: EBBEvent[] = [ @@ -1614,7 +1637,6 @@ const body: EBBEvent[] = [ try { const { result, ...httpResponse } = await subscriptionComponentsController.bulkRecordEvents( - subdomain, apiHandle, undefined, body @@ -1635,7 +1657,8 @@ try { This request will list components applied to each subscription. ```ts -async listSubscriptionComponentsForSite( page?: number, +async listSubscriptionComponentsForSite( + page?: number, perPage?: number, sort?: ListSubscriptionComponentsSort, direction?: SortingDirection, @@ -1649,7 +1672,8 @@ async listSubscriptionComponentsForSite( page?: number, pricePointIds?: IncludeNotNull, productFamilyIds?: number[], include?: ListSubscriptionComponentsInclude, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/subscription-group-invoice-account.md b/doc/controllers/subscription-group-invoice-account.md index c6454caf..2c80570d 100644 --- a/doc/controllers/subscription-group-invoice-account.md +++ b/doc/controllers/subscription-group-invoice-account.md @@ -21,9 +21,11 @@ const subscriptionGroupInvoiceAccountController = new SubscriptionGroupInvoiceAc A prepayment can be added for a subscription group identified by the group's `uid`. This endpoint requires a `amount`, `details`, `method`, and `memo`. On success, the prepayment will be added to the group's prepayment balance. ```ts -async createSubscriptionGroupPrepayment( uid: string, +async createSubscriptionGroupPrepayment( + uid: string, body?: SubscriptionGroupPrepaymentRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -79,11 +81,13 @@ try { This request will list a subscription group's prepayments. ```ts -async listPrepaymentsForSubscriptionGroup( uid: string, +async listPrepaymentsForSubscriptionGroup( + uid: string, page?: number, perPage?: number, filter?: ListPrepaymentsFilter, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -160,9 +164,11 @@ try { Credit can be issued for a subscription group identified by the group's `uid`. Credit will be added to the group in the amount specified in the request body. The credit will be applied to group member invoices as they are generated. ```ts -async issueSubscriptionGroupServiceCredit( uid: string, +async issueSubscriptionGroupServiceCredit( + uid: string, body?: IssueServiceCreditRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -230,9 +236,11 @@ try { Credit can be deducted for a subscription group identified by the group's `uid`. Credit will be deducted from the group in the amount specified in the request body. ```ts -async deductSubscriptionGroupServiceCredit( uid: string, +async deductSubscriptionGroupServiceCredit( + uid: string, body?: DeductServiceCreditRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/subscription-group-status.md b/doc/controllers/subscription-group-status.md index af5e309b..de8717a1 100644 --- a/doc/controllers/subscription-group-status.md +++ b/doc/controllers/subscription-group-status.md @@ -23,9 +23,11 @@ This endpoint will immediately cancel all subscriptions within the specified gro In order to cancel a subscription group while also charging for any unbilled usage on metered or prepaid components, the `charge_unbilled_usage=true` parameter must be included in the request. ```ts -async cancelSubscriptionsInGroup( uid: string, +async cancelSubscriptionsInGroup( + uid: string, body?: CancelGroupedSubscriptionsRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -78,8 +80,10 @@ This endpoint will schedule all subscriptions within the specified group to be c All subscriptions in the group must be on automatic billing in order to successfully cancel them, and the group must not be in a "past_due" state. ```ts -async initiateDelayedCancellationForGroup( uid: string, -requestOptions?: RequestOptions): Promise> +async initiateDelayedCancellationForGroup( + uid: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -122,8 +126,10 @@ try { Removing the delayed cancellation on a subscription group will ensure that the subscriptions do not get canceled at the end of the period. The request will reset the `cancel_at_end_of_period` flag to false on each member in the group. ```ts -async cancelDelayedCancellationForGroup( uid: string, -requestOptions?: RequestOptions): Promise> +async cancelDelayedCancellationForGroup( + uid: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -184,9 +190,11 @@ Member subscriptions can have billing periods that are longer than the primary ( For calendar billing subscriptions, the new billing period created will be a partial one, spanning from the date of reactivation to the next corresponding calendar renewal date. ```ts -async reactivateSubscriptionGroup( uid: string, +async reactivateSubscriptionGroup( + uid: string, body?: ReactivateSubscriptionGroupRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index 208c227e..4ac7a820 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -34,8 +34,10 @@ Only one of the `subscriptions` can have `"primary": true` attribute set. When passing product to a subscription you can use either `product_id` or `product_handle` or `offer_id`. You can also use `custom_price` instead. ```ts -async signupWithSubscriptionGroup( body?: SubscriptionGroupSignupRequest, -requestOptions?: RequestOptions): Promise> +async signupWithSubscriptionGroup( + body?: SubscriptionGroupSignupRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -95,8 +97,10 @@ try { Creates a subscription group with given members. ```ts -async createSubscriptionGroup( body?: CreateSubscriptionGroupRequest, -requestOptions?: RequestOptions): Promise> +async createSubscriptionGroup( + body?: CreateSubscriptionGroupRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -174,10 +178,12 @@ Returns an array of subscription groups for the site. The response is paginated Account balance information for the subscription groups is not returned by default. If this information is desired, the `include[]=account_balances` parameter must be provided with the request. ```ts -async listSubscriptionGroups( page?: number, +async listSubscriptionGroups( + page?: number, perPage?: number, include?: SubscriptionGroupsListInclude[], -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -264,9 +270,11 @@ Use this endpoint to find subscription group details. Current billing amount for the subscription group is not returned by default. If this information is desired, the `include[]=current_billing_amount_in_cents` parameter must be provided with the request. ```ts -async readSubscriptionGroup( uid: string, +async readSubscriptionGroup( + uid: string, include?: SubscriptionGroupInclude[], -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -354,9 +362,11 @@ Use this endpoint to update subscription group members. `"member_ids"` should contain an array of both subscription IDs to set as group members and subscription IDs already present in the groups. Not including them will result in removing them from subscription group. To clean up members, just leave the array empty. ```ts -async updateSubscriptionGroupMembers( uid: string, +async updateSubscriptionGroupMembers( + uid: string, body?: UpdateSubscriptionGroupRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -435,8 +445,10 @@ Use this endpoint to delete subscription group. Only groups without members can be deleted ```ts -async deleteSubscriptionGroup( uid: string, -requestOptions?: RequestOptions): Promise> +async deleteSubscriptionGroup( + uid: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -490,8 +502,10 @@ Use this endpoint to find subscription group associated with subscription. If the subscription is not in a group endpoint will return 404 code. ```ts -async findSubscriptionGroup( subscriptionId: string, -requestOptions?: RequestOptions): Promise> +async findSubscriptionGroup( + subscriptionId: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -588,9 +602,11 @@ To create a new subscription into a subscription group, please reference the fol [Create Subscription in a Subscription Group](https://developers.chargify.com/docs/api-docs/d571659cf0f24-create-subscription#subscription-in-a-subscription-group) ```ts -async addSubscriptionToGroup( subscriptionId: number, +async addSubscriptionToGroup( + subscriptionId: number, body?: AddSubscriptionToAGroup, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -667,8 +683,10 @@ try { For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to remove existing subscription from subscription group. ```ts -async removeSubscriptionFromGroup( subscriptionId: number, -requestOptions?: RequestOptions): Promise> +async removeSubscriptionFromGroup( + subscriptionId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/subscription-invoice-account.md b/doc/controllers/subscription-invoice-account.md index 1c9477cd..711fa618 100644 --- a/doc/controllers/subscription-invoice-account.md +++ b/doc/controllers/subscription-invoice-account.md @@ -23,8 +23,10 @@ const subscriptionInvoiceAccountController = new SubscriptionInvoiceAccountContr Returns the `balance_in_cents` of the Subscription's Pending Discount, Service Credit, and Prepayment accounts, as well as the sum of the Subscription's open, payable invoices. ```ts -async readAccountBalances( subscriptionId: number, -requestOptions?: RequestOptions): Promise> +async readAccountBalances( + subscriptionId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -67,9 +69,11 @@ When the `method` specified is `"credit_card_on_file"`, the prepayment amount wi Please note that you **can't** pass `amount_in_cents`. ```ts -async createPrepayment( subscriptionId: number, +async createPrepayment( + subscriptionId: number, body?: CreatePrepaymentRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -141,11 +145,13 @@ try { This request will list a subscription's prepayments. ```ts -async listPrepayments( subscriptionId: number, +async listPrepayments( + subscriptionId: number, page?: number, perPage?: number, filter?: ListPrepaymentsFilter, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -221,9 +227,11 @@ try { Credit will be added to the subscription in the amount specified in the request body. The credit is subsequently applied to the next generated invoice. ```ts -async issueServiceCredit( subscriptionId: number, +async issueServiceCredit( + subscriptionId: number, body?: IssueServiceCreditRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -288,9 +296,11 @@ try { Credit will be removed from the subscription in the amount specified in the request body. The credit amount being deducted must be equal to or less than the current credit balance. ```ts -async deductServiceCredit( subscriptionId: number, +async deductServiceCredit( + subscriptionId: number, body?: DeductServiceCreditRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -346,10 +356,12 @@ This endpoint will refund, completely or partially, a particular prepayment appl The amount may be passed either as a decimal, with `amount`, or an integer in cents, with `amount_in_cents`. ```ts -async refundPrepayment( subscriptionId: number, +async refundPrepayment( + subscriptionId: number, prepaymentId: bigint, body?: RefundPrepaymentRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index c49dc002..3ba80ae7 100644 --- a/doc/controllers/subscription-notes.md +++ b/doc/controllers/subscription-notes.md @@ -30,9 +30,11 @@ If you have structured data such as birth date, color, etc., consider using Meta Full documentation on how to use Notes in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24251712214413-Subscription-Summary-Overview). ```ts -async createSubscriptionNote( subscriptionId: number, +async createSubscriptionNote( + subscriptionId: number, body?: UpdateSubscriptionNoteRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -74,16 +76,24 @@ try { } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) | + # List Subscription Notes Use this method to retrieve a list of Notes associated with a Subscription. The response will be an array of Notes. ```ts -async listSubscriptionNotes( subscriptionId: number, +async listSubscriptionNotes( + subscriptionId: number, page?: number, perPage?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -147,15 +157,23 @@ try { ] ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) | + # Read Subscription Note Once you have obtained the ID of the note you wish to read, use this method to show a particular note attached to a subscription. ```ts -async readSubscriptionNote( subscriptionId: number, +async readSubscriptionNote( + subscriptionId: number, noteId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -213,10 +231,12 @@ try { Use the following method to update a note for a Subscription. ```ts -async updateSubscriptionNote( subscriptionId: number, +async updateSubscriptionNote( + subscriptionId: number, noteId: number, body?: UpdateSubscriptionNoteRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -262,15 +282,23 @@ try { } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) | + # Delete Subscription Note Use the following method to delete a note for a Subscription. ```ts -async deleteSubscriptionNote( subscriptionId: number, +async deleteSubscriptionNote( + subscriptionId: number, noteId: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/subscription-products.md b/doc/controllers/subscription-products.md index 6d4a73e2..fa90df5e 100644 --- a/doc/controllers/subscription-products.md +++ b/doc/controllers/subscription-products.md @@ -74,9 +74,11 @@ You may wish to redirect customers to different pages depending on whether their 8. Optionally, you can use the applied "msg" param in the `redirect_url` to determine whether it was successful or not. ```ts -async migrateSubscriptionProduct( subscriptionId: number, +async migrateSubscriptionProduct( + subscriptionId: number, body?: SubscriptionProductMigrationRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -261,9 +263,11 @@ It is also possible to preview the migration for a date in the future, as long a This will calculate the prorated adjustment, charge, payment and credit applied values assuming the migration is done at that date in the future as opposed to right now. ```ts -async previewSubscriptionProductMigration( subscriptionId: number, +async previewSubscriptionProductMigration( + subscriptionId: number, body?: SubscriptionMigrationPreviewRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index 7df9c5be..2dc5f75b 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -35,8 +35,10 @@ The response will be `200 OK` with the updated Subscription. The response will be `422 "Unprocessable Entity`. ```ts -async retrySubscription( subscriptionId: number, -requestOptions?: RequestOptions): Promise> +async retrySubscription( + subscriptionId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -215,9 +217,11 @@ try { The DELETE action causes the cancellation of the Subscription. This means, the method sets the Subscription state to "canceled". ```ts -async cancelSubscription( subscriptionId: number, +async cancelSubscription( + subscriptionId: number, body?: CancellationRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -398,9 +402,11 @@ try { Resume a paused (on-hold) subscription. If the normal next renewal date has not passed, the subscription will return to active and will renew on that date. Otherwise, it will behave like a reactivation, setting the billing date to 'now' and charging the subscriber. ```ts -async resumeSubscription( subscriptionId: number, +async resumeSubscription( + subscriptionId: number, calendarBillingResumptionCharge?: ResumptionCharge, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -557,9 +563,11 @@ This will place the subscription in the on_hold state and it will not renew. You may not place a subscription on hold if the `next_billing` date is within 24 hours. ```ts -async pauseSubscription( subscriptionId: number, +async pauseSubscription( + subscriptionId: number, body?: PauseRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -727,9 +735,11 @@ To update a subscription's resume date, use this method to change or update the Alternately, you can change the `automatically_resume_at` to `null` if you would like the subscription to not have a resume date. ```ts -async updateAutomaticSubscriptionResumption( subscriptionId: number, +async updateAutomaticSubscriptionResumption( + subscriptionId: number, body?: PauseRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1060,9 +1070,11 @@ PUT request sent to: + Any product-related charges should have been collected ```ts -async reactivateSubscription( subscriptionId: number, +async reactivateSubscription( + subscriptionId: number, body?: ReactivateSubscriptionRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1234,9 +1246,11 @@ Requesting to cancel the subscription at the end of the period sets the `cancel_ Note that you cannot set `cancel_at_end_of_period` at subscription creation, or if the subscription is past due. ```ts -async initiateDelayedCancellation( subscriptionId: number, +async initiateDelayedCancellation( + subscriptionId: number, body?: CancellationRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1273,6 +1287,7 @@ try { | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | | 404 | Not Found | `ApiError` | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) | # Cancel Delayed Cancellation @@ -1282,8 +1297,10 @@ Removing the delayed cancellation on a subscription will ensure that it doesn't This endpoint is idempotent. If the subscription was not set to cancel in the future, removing the delayed cancellation has no effect and the call will be successful. ```ts -async cancelDelayedCancellation( subscriptionId: number, -requestOptions?: RequestOptions): Promise> +async cancelDelayedCancellation( + subscriptionId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1334,8 +1351,10 @@ try { If a subscription is currently in dunning, the subscription will be set to active and the active Dunner will be resolved. ```ts -async cancelDunning( subscriptionId: number, -requestOptions?: RequestOptions): Promise> +async cancelDunning( + subscriptionId: number, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1366,6 +1385,12 @@ try { } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) | + # Preview Renewal @@ -1393,9 +1418,11 @@ Optionally, **you may provide your own custom quantities** for any component to You can request a `POST` to obtain this data from the endpoint without any side effects. Plain and simple, this will preview data, not log any changes against a subscription. ```ts -async previewRenewal( subscriptionId: number, +async previewRenewal( + subscriptionId: number, body?: RenewalPreviewRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index 75dcf823..fd52a7a5 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -44,6 +44,14 @@ Credit card details may be required, depending on the options for the product be If you are creating a subscription with a payment profile, the attribute to send will be `credit_card_attributes` or `bank_account_attributes` for ACH and Direct Debit. That said, when you read the subscription after creation, we return the profile details under `credit_card` or `bank_account`. +## Bulk creation of subscriptions + +Bulk creation of subscriptions is currently not supported. For scenarios where multiple subscriptions must be added, particularly when assigning to the same subscription group, it is essential to switch to a single-threaded approach. + +To avoid data conflicts or inaccuracies, incorporate a sleep interval between requests. + +While this single-threaded approach may impact performance, it ensures data consistency and accuracy in cases where concurrent creation attempts could otherwise lead to issues with subscription alignment and integrity. + ## Taxable Subscriptions If your intent is to charge your subscribers tax via [Avalara Taxes](https://maxio.zendesk.com/hc/en-us/articles/24287043035661-Avalara-VAT-Tax) or [Custom Taxes](https://maxio.zendesk.com/hc/en-us/articles/24287044212749-Custom-Taxes), there are a few considerations to be made regarding collecting subscription data. @@ -364,7 +372,7 @@ For more information on Stripe Direct Debit, please view the following two resou For more information on Stripe Direct Debit, please view the following two resources: -+ [Payment Profiles via API for Stripe BECS Direct Debit]($e/Payment%20Profiles/createPaymentProfile) ++ [Payment Profiles via API for Stripe BECS Direct Debit](../../doc/controllers/payment-profiles.md#create-payment-profile) + [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) @@ -395,7 +403,7 @@ For more information on Stripe Direct Debit, please view the following two resou For more information on Stripe Direct Debit, please view the following two resources: -+ [Payment Profiles via API for Stripe BACS Direct Debit]($e/Payment%20Profiles/createPaymentProfile) ++ [Payment Profiles via API for Stripe BACS Direct Debit](../../doc/controllers/payment-profiles.md#create-payment-profile) + [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit) @@ -674,8 +682,10 @@ Each of them is required. ``` ```ts -async createSubscription( body?: CreateSubscriptionRequest, -requestOptions?: RequestOptions): Promise> +async createSubscription( + body?: CreateSubscriptionRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -695,6 +705,7 @@ requestOptions?: RequestOptions): Promise> const body: CreateSubscriptionRequest = { subscription: { productHandle: 'basic', + paymentCollectionMethod: CollectionMethod.Remittance, customerAttributes: { firstName: 'Joe', lastName: 'Blow', @@ -709,20 +720,6 @@ const body: CreateSubscriptionRequest = { country: 'US', phone: '(617) 111 - 0000', }, - creditCardAttributes: { - firstName: 'Joe', - lastName: 'Smith', - fullNumber: '4111111111111111', - cardType: CardType.Visa, - expirationMonth: '1', - expirationYear: '2021', - billingAddress: '123 Mass Ave.', - billingAddress2: 'billing_address_22', - billingCity: 'Boston', - billingState: 'MA', - billingCountry: 'US', - billingZip: '02120', - }, }, }; @@ -897,7 +894,8 @@ Use the query strings below to search for a subscription using the criteria avai Self-Service Page token for the subscriptions is not returned by default. If this information is desired, the include[]=self_service_page_token parameter must be provided with the request. ```ts -async listSubscriptions( page?: number, +async listSubscriptions( + page?: number, perPage?: number, state?: SubscriptionStateFilter, product?: number, @@ -912,7 +910,8 @@ async listSubscriptions( page?: number, direction?: SortingDirection, sort?: SubscriptionSort, include?: SubscriptionListInclude[], -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1014,9 +1013,11 @@ For a subscription using Calendar Billing, setting the next billing date is a bi Note: If you change the product associated with a subscription that contains a `snap_date` and immediately `READ/GET` the subscription data, it will still contain evidence of the existing `snap_date`. This is due to the fact that a product change is instantanous and only affects the product associated with a subscription. After the `next_billing` date arrives, the `snap_day` associated with the subscription will return to `null.` Another way of looking at this is that you willl have to wait for the next billing cycle to arrive before the `snap_date` will reset to `null`. ```ts -async updateSubscription( subscriptionId: number, +async updateSubscription( + subscriptionId: number, body?: UpdateSubscriptionRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1188,9 +1189,11 @@ Use this endpoint to find subscription details. Self-Service Page token for the subscription is not returned by default. If this information is desired, the include[]=self_service_page_token parameter must be provided with the request. ```ts -async readSubscription( subscriptionId: number, +async readSubscription( + subscriptionId: number, include?: SubscriptionInclude[], -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1393,9 +1396,11 @@ When passing `current_period_starts_at` some validations are made: If unpermitted parameters are sent, a 400 HTTP response is sent along with a string giving the reason for the problem. ```ts -async overrideSubscription( subscriptionId: number, +async overrideSubscription( + subscriptionId: number, body?: OverrideSubscriptionRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1451,8 +1456,10 @@ try { Use this endpoint to find a subscription by its reference. ```ts -async findSubscription( reference?: string, -requestOptions?: RequestOptions): Promise> +async findSubscription( + reference?: string, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1481,6 +1488,12 @@ try { } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `ApiError` | + # Purge Subscription @@ -1495,10 +1508,12 @@ If you need to remove subscriptions from a live site, please contact support to The query params will be: `?ack={customer_id}&cascade[]=customer&cascade[]=payment_profile` ```ts -async purgeSubscription( subscriptionId: number, +async purgeSubscription( + subscriptionId: number, ack: number, cascade?: SubscriptionPurgeType[], -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1512,7 +1527,7 @@ requestOptions?: RequestOptions): Promise> ## Response Type -`void` +[`SubscriptionResponse`](../../doc/models/subscription-response.md) ## Example Usage @@ -1542,15 +1557,23 @@ try { } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 400 | Bad Request | [`SubscriptionResponseError`](../../doc/models/subscription-response-error.md) | + # Update Prepaid Subscription Configuration Use this endpoint to update a subscription's prepaid configuration. ```ts -async updatePrepaidSubscriptionConfiguration( subscriptionId: number, +async updatePrepaidSubscriptionConfiguration( + subscriptionId: number, body?: UpsertPrepaidConfigurationRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1608,6 +1631,12 @@ try { } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | `ApiError` | + # Preview Subscription @@ -1638,8 +1667,10 @@ You can pass shipping and billing addresses and still decide not to calculate ta If you'd like to calculate subscriptions that do not include tax, please feel free to leave off the billing information. ```ts -async previewSubscription( body?: CreateSubscriptionRequest, -requestOptions?: RequestOptions): Promise> +async previewSubscription( + body?: CreateSubscriptionRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -1806,10 +1837,12 @@ Passing in a coupon code as a query parameter will add the code to the subscript For this reason, using this query parameter on this endpoint has been deprecated in favor of using the request body parameters as described below. When passing in request body parameters, the list of coupon codes will simply be added to any existing list of codes on the subscription. ```ts -async applyCouponsToSubscription( subscriptionId: number, +async applyCouponsToSubscription( + subscriptionId: number, code?: string, body?: AddCouponsRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -2017,9 +2050,11 @@ Use this endpoint to remove a coupon from an existing subscription. For more information on the expected behaviour of removing a coupon from a subscription, please see our documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon) ```ts -async removeCouponFromSubscription( subscriptionId: number, +async removeCouponFromSubscription( + subscriptionId: number, couponCode?: string, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -2111,9 +2146,11 @@ You can read more about the behavior of trialing subscriptions [here](https://ma When the `revert_on_failure` parameter is set to `true`, the subscription's state will remain as Trialing, we will void the invoice from activation and return any prepayments and credits applied to the invoice back to the subscription. ```ts -async activateSubscription( subscriptionId: number, +async activateSubscription( + subscriptionId: number, body?: ActivateSubscriptionRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/controllers/webhooks.md b/doc/controllers/webhooks.md index f86c7ccb..f3713e87 100644 --- a/doc/controllers/webhooks.md +++ b/doc/controllers/webhooks.md @@ -36,14 +36,16 @@ We recommend that you review Advanced Billing's webhook documentation located in This method allows you to fetch data about webhooks. You can pass query parameters if you want to filter webhooks. ```ts -async listWebhooks( status?: WebhookStatus, +async listWebhooks( + status?: WebhookStatus, sinceDate?: string, untilDate?: string, page?: number, perPage?: number, order?: WebhookOrder, subscription?: number, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -128,8 +130,10 @@ try { This method allows you to enable webhooks via API for your site ```ts -async enableWebhooks( body?: EnableWebhooksRequest, -requestOptions?: RequestOptions): Promise> +async enableWebhooks( + body?: EnableWebhooksRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -178,8 +182,10 @@ Posting to the replay endpoint does not immediately resend the webhooks. They ar You may submit an array of up to 1000 webhook IDs to replay in the request. ```ts -async replayWebhooks( body?: ReplayWebhooksRequest, -requestOptions?: RequestOptions): Promise> +async replayWebhooks( + body?: ReplayWebhooksRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -232,8 +238,10 @@ You can check available events here. [Event keys](https://maxio.zendesk.com/hc/en-us/articles/24266136649869-Webhooks-Reference#events) ```ts -async createEndpoint( body?: CreateOrUpdateEndpointRequest, -requestOptions?: RequestOptions): Promise> +async createEndpoint( + body?: CreateOrUpdateEndpointRequest, + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -301,7 +309,9 @@ try { This method returns created endpoints for site. ```ts -async listEndpoints(requestOptions?: RequestOptions): Promise> +async listEndpoints( + requestOptions?: RequestOptions +): Promise> ``` ## Parameters @@ -371,9 +381,11 @@ Sending an PUT request for existing endpoint with empty list of `webhook_subscri If you want unsubscribe from specific event, just send a list of `webhook_subscriptions` without the specific event key. ```ts -async updateEndpoint( endpointId: number, +async updateEndpoint( + endpointId: number, body?: CreateOrUpdateEndpointRequest, -requestOptions?: RequestOptions): Promise> + requestOptions?: RequestOptions +): Promise> ``` ## Parameters diff --git a/doc/models/add-subscription-to-a-group.md b/doc/models/add-subscription-to-a-group.md index d162b19b..2d1a222c 100644 --- a/doc/models/add-subscription-to-a-group.md +++ b/doc/models/add-subscription-to-a-group.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `group` | [`AddSubscriptionToAGroupGroup \| undefined`](../../doc/models/containers/add-subscription-to-a-group-group.md) | Optional | This is a container for one-of cases. | +| `group` | [`GroupSettings \| undefined`](../../doc/models/group-settings.md) | Optional | - | ## Example (as JSON) diff --git a/doc/models/change-invoice-status-event-data.md b/doc/models/change-invoice-status-event-data.md index 0063bc39..3f4a240b 100644 --- a/doc/models/change-invoice-status-event-data.md +++ b/doc/models/change-invoice-status-event-data.md @@ -24,7 +24,7 @@ Example schema for an `change_invoice_status` event "gateway_trans_id": "gateway_trans_id2", "amount": "amount2", "from_status": "draft", - "to_status": "paid", + "to_status": "pending", "consolidation_level": "none" } ``` diff --git a/doc/models/change-invoice-status-event.md b/doc/models/change-invoice-status-event.md index 34aa3b39..c486e7d1 100644 --- a/doc/models/change-invoice-status-event.md +++ b/doc/models/change-invoice-status-event.md @@ -36,8 +36,8 @@ "event_data": { "gateway_trans_id": "gateway_trans_id2", "amount": "amount8", - "from_status": "paid", - "to_status": "paid", + "from_status": "open", + "to_status": "pending", "consolidation_level": "child" } } diff --git a/doc/models/component-price-point.md b/doc/models/component-price-point.md index 0f12ccae..449d18f8 100644 --- a/doc/models/component-price-point.md +++ b/doc/models/component-price-point.md @@ -26,6 +26,12 @@ | `interval` | `number \| null \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `intervalUnit` | [`IntervalUnit \| null \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | | `currencyPrices` | [`ComponentCurrencyPrice[] \| undefined`](../../doc/models/component-currency-price.md) | Optional | An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. | +| `overagePrices` | [`ComponentPrice[] \| undefined`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | +| `overagePricingScheme` | [`PricingScheme \| undefined`](../../doc/models/pricing-scheme.md) | Optional | Applicable only to prepaid usage components. Pricing scheme for overage pricing. | +| `renewPrepaidAllocation` | `boolean \| undefined` | Optional | Applicable only to prepaid usage components. Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period. | +| `rolloverPrepaidRemainder` | `boolean \| undefined` | Optional | Applicable only to prepaid usage components. Boolean which controls whether or not remaining units should be rolled over to the next period. | +| `expirationInterval` | `number \| null \| undefined` | Optional | Applicable only to prepaid usage components where rollover_prepaid_remainder is true. The number of `expiration_interval_unit`s after which rollover amounts should expire. | +| `expirationIntervalUnit` | [`ExpirationIntervalUnit \| null \| undefined`](../../doc/models/expiration-interval-unit.md) | Optional | Applicable only to prepaid usage components where rollover_prepaid_remainder is true. A string representing the expiration interval unit for this component, either month or day. | ## Example (as JSON) diff --git a/doc/models/component.md b/doc/models/component.md index c684e5de..287ddc0c 100644 --- a/doc/models/component.md +++ b/doc/models/component.md @@ -23,7 +23,7 @@ | `taxable` | `boolean \| undefined` | Optional | Boolean flag describing whether a component is taxable or not. | | `description` | `string \| null \| undefined` | Optional | The description of the component. | | `defaultPricePointId` | `number \| null \| undefined` | Optional | - | -| `overagePrices` | [`ComponentPrice[] \| null \| undefined`](../../doc/models/component-price.md) | Optional | An array of price brackets. If the component uses the ‘per_unit’ pricing scheme, this array will be empty. | +| `overagePrices` | [`ComponentPrice[] \| null \| undefined`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | | `prices` | [`ComponentPrice[] \| null \| undefined`](../../doc/models/component-price.md) | Optional | An array of price brackets. If the component uses the ‘per_unit’ pricing scheme, this array will be empty. | | `pricePointCount` | `number \| undefined` | Optional | Count for the number of price points associated with the component | | `pricePointsUrl` | `string \| null \| undefined` | Optional | URL that points to the location to read the existing price points via GET request | diff --git a/doc/models/compounding-strategy.md b/doc/models/compounding-strategy.md index 272bfa93..2bb80c64 100644 --- a/doc/models/compounding-strategy.md +++ b/doc/models/compounding-strategy.md @@ -1,6 +1,8 @@ # Compounding Strategy +Applicable only to stackable coupons. For `compound`, Percentage-based discounts will be calculated against the remaining price, after prior discounts have been calculated. For `full-price`, Percentage-based discounts will always be calculated against the original item price, before other discounts are applied. + ## Enumeration `CompoundingStrategy` diff --git a/doc/models/containers/add-subscription-to-a-group-group.md b/doc/models/containers/add-subscription-to-a-group-group.md deleted file mode 100644 index 86bf0124..00000000 --- a/doc/models/containers/add-subscription-to-a-group-group.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Add Subscription to a Group Group - -## Class Name - -`AddSubscriptionToAGroupGroup` - -## Cases - -| Type | -| --- | -| [`GroupSettings`](../../../doc/models/group-settings.md) | -| `boolean` | - diff --git a/doc/models/containers/coupon-payload-percentage.md b/doc/models/containers/coupon-payload-percentage.md new file mode 100644 index 00000000..08fbfeb3 --- /dev/null +++ b/doc/models/containers/coupon-payload-percentage.md @@ -0,0 +1,14 @@ + +# Coupon Payload Percentage + +## Class Name + +`CouponPayloadPercentage` + +## Cases + +| Type | +| --- | +| `string` | +| `number` | + diff --git a/doc/models/containers/create-or-update-coupon-coupon.md b/doc/models/containers/create-or-update-coupon-coupon.md deleted file mode 100644 index b44ca0ba..00000000 --- a/doc/models/containers/create-or-update-coupon-coupon.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Create or Update Coupon Coupon - -## Class Name - -`CreateOrUpdateCouponCoupon` - -## Cases - -| Type | -| --- | -| [`CreateOrUpdatePercentageCoupon`](../../../doc/models/create-or-update-percentage-coupon.md) | -| [`CreateOrUpdateFlatAmountCoupon`](../../../doc/models/create-or-update-flat-amount-coupon.md) | - diff --git a/doc/models/containers/create-or-update-percentage-coupon-percentage.md b/doc/models/containers/create-or-update-percentage-coupon-percentage.md deleted file mode 100644 index 2f8ba3c7..00000000 --- a/doc/models/containers/create-or-update-percentage-coupon-percentage.md +++ /dev/null @@ -1,14 +0,0 @@ - -# Create or Update Percentage Coupon Percentage - -## Class Name - -`CreateOrUpdatePercentageCouponPercentage` - -## Cases - -| Type | -| --- | -| `string` | -| `number` | - diff --git a/doc/models/containers/event-event-specific-data.md b/doc/models/containers/event-event-specific-data.md index 45a61b3c..d8da135c 100644 --- a/doc/models/containers/event-event-specific-data.md +++ b/doc/models/containers/event-event-specific-data.md @@ -21,8 +21,7 @@ | [`PendingCancellationChange`](../../../doc/models/pending-cancellation-change.md) | | [`PrepaidSubscriptionBalanceChanged`](../../../doc/models/prepaid-subscription-balance-changed.md) | | [`ProformaInvoiceIssued`](../../../doc/models/proforma-invoice-issued.md) | -| [`SubscriptionGroupSignupSuccess`](../../../doc/models/subscription-group-signup-success.md) | -| [`SubscriptionGroupSignupFailure`](../../../doc/models/subscription-group-signup-failure.md) | +| [`SubscriptionGroupSignupEventData`](../../../doc/models/subscription-group-signup-event-data.md) | | [`CreditAccountBalanceChanged`](../../../doc/models/credit-account-balance-changed.md) | | [`PrepaymentAccountBalanceChanged`](../../../doc/models/prepayment-account-balance-changed.md) | | [`PaymentCollectionMethodChanged`](../../../doc/models/payment-collection-method-changed.md) | diff --git a/doc/models/coupon-currency-response.md b/doc/models/coupon-currency-response.md index 5a393ead..a04acad8 100644 --- a/doc/models/coupon-currency-response.md +++ b/doc/models/coupon-currency-response.md @@ -19,19 +19,19 @@ { "id": 50, "currency": "currency8", - "price": 78, + "price": 233.74, "coupon_id": 224 }, { "id": 50, "currency": "currency8", - "price": 78, + "price": 233.74, "coupon_id": 224 }, { "id": 50, "currency": "currency8", - "price": 78, + "price": 233.74, "coupon_id": 224 } ] diff --git a/doc/models/coupon-currency.md b/doc/models/coupon-currency.md index ae289ea8..bff71ecb 100644 --- a/doc/models/coupon-currency.md +++ b/doc/models/coupon-currency.md @@ -9,9 +9,9 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `number \| undefined` | Optional | - | +| `id` | `number \| null \| undefined` | Optional | - | | `currency` | `string \| undefined` | Optional | - | -| `price` | `number \| undefined` | Optional | - | +| `price` | `number \| null \| undefined` | Optional | - | | `couponId` | `number \| undefined` | Optional | - | ## Example (as JSON) @@ -20,7 +20,7 @@ { "id": 228, "currency": "currency8", - "price": 100, + "price": 169.96, "coupon_id": 210 } ``` diff --git a/doc/models/coupon-payload.md b/doc/models/coupon-payload.md new file mode 100644 index 00000000..7ff0f441 --- /dev/null +++ b/doc/models/coupon-payload.md @@ -0,0 +1,38 @@ + +# Coupon Payload + +## Structure + +`CouponPayload` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| undefined` | Optional | Required when creating a new coupon. This name is not displayed to customers and is limited to 255 characters. | +| `code` | `string \| undefined` | Optional | Required when creating a new coupon. The code is limited to 255 characters. May contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.” | +| `description` | `string \| undefined` | Optional | Required when creating a new coupon. A description of the coupon that can be displayed to customers in transactions and on statements. The description is limited to 255 characters. | +| `percentage` | [`CouponPayloadPercentage \| undefined`](../../doc/models/containers/coupon-payload-percentage.md) | Optional | This is a container for one-of cases. | +| `amountInCents` | `bigint \| undefined` | Optional | Required when creating a new flat amount coupon. Can't be used together with percentage. Flat USD discount | +| `allowNegativeBalance` | `boolean \| undefined` | Optional | If set to true, discount is not limited (credits will carry forward to next billing). Can't be used together with restrictions. | +| `recurring` | `boolean \| undefined` | Optional | - | +| `endDate` | `string \| undefined` | Optional | After the end of the given day, this coupon code will be invalid for new signups. Recurring discounts started before this date will continue to recur even after this date. | +| `productFamilyId` | `string \| undefined` | Optional | - | +| `stackable` | `boolean \| undefined` | Optional | A stackable coupon can be combined with other coupons on a Subscription. | +| `compoundingStrategy` | [`CompoundingStrategy \| undefined`](../../doc/models/compounding-strategy.md) | Optional | Applicable only to stackable coupons. For `compound`, Percentage-based discounts will be calculated against the remaining price, after prior discounts have been calculated. For `full-price`, Percentage-based discounts will always be calculated against the original item price, before other discounts are applied. | +| `excludeMidPeriodAllocations` | `boolean \| undefined` | Optional | - | +| `applyOnCancelAtEndOfPeriod` | `boolean \| undefined` | Optional | - | +| `applyOnSubscriptionExpiration` | `boolean \| undefined` | Optional | - | + +## Example (as JSON) + +```json +{ + "name": "name8", + "code": "code6", + "description": "description8", + "percentage": "String7", + "amount_in_cents": 110 +} +``` + diff --git a/doc/models/create-or-update-coupon.md b/doc/models/coupon-request.md similarity index 58% rename from doc/models/create-or-update-coupon.md rename to doc/models/coupon-request.md index 578ec055..6cdb7377 100644 --- a/doc/models/create-or-update-coupon.md +++ b/doc/models/coupon-request.md @@ -1,15 +1,15 @@ -# Create or Update Coupon +# Coupon Request ## Structure -`CreateOrUpdateCoupon` +`CouponRequest` ## Fields | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `coupon` | [`CreateOrUpdateCouponCoupon \| undefined`](../../doc/models/containers/create-or-update-coupon-coupon.md) | Optional | This is a container for one-of cases. | +| `coupon` | [`CouponPayload \| undefined`](../../doc/models/coupon-payload.md) | Optional | - | | `restrictedProducts` | `Record \| undefined` | Optional | An object where the keys are product_ids and the values are booleans indicating if the coupon should be applicable to the product | | `restrictedComponents` | `Record \| undefined` | Optional | An object where the keys are component_ids and the values are booleans indicating if the coupon should be applicable to the component | @@ -18,14 +18,11 @@ ```json { "coupon": { - "name": "name0", - "code": "code8", - "description": "description0", - "percentage": "String9", - "allow_negative_balance": false, - "recurring": false, - "end_date": "2016-03-13T12:52:32.123Z", - "product_family_id": "product_family_id6" + "name": "name4", + "code": "code2", + "description": "description6", + "percentage": "String3", + "amount_in_cents": 230 }, "restricted_products": { "key0": true diff --git a/doc/models/coupon.md b/doc/models/coupon.md index 941e488d..40298bf9 100644 --- a/doc/models/coupon.md +++ b/doc/models/coupon.md @@ -14,11 +14,11 @@ | `code` | `string \| undefined` | Optional | - | | `description` | `string \| undefined` | Optional | - | | `amount` | `number \| null \| undefined` | Optional | - | -| `amountInCents` | `number \| null \| undefined` | Optional | - | +| `amountInCents` | `bigint \| null \| undefined` | Optional | - | | `productFamilyId` | `number \| undefined` | Optional | - | | `productFamilyName` | `string \| null \| undefined` | Optional | - | | `startDate` | `string \| undefined` | Optional | - | -| `endDate` | `string \| null \| undefined` | Optional | - | +| `endDate` | `string \| null \| undefined` | Optional | After the given time, this coupon code will be invalid for new signups. Recurring discounts started before this date will continue to recur even after this date. | | `percentage` | `string \| null \| undefined` | Optional | - | | `recurring` | `boolean \| undefined` | Optional | - | | `recurringScheme` | [`RecurringScheme \| undefined`](../../doc/models/recurring-scheme.md) | Optional | - | @@ -26,11 +26,11 @@ | `durationInterval` | `number \| null \| undefined` | Optional | - | | `durationIntervalUnit` | `string \| null \| undefined` | Optional | - | | `durationIntervalSpan` | `string \| null \| undefined` | Optional | - | -| `allowNegativeBalance` | `boolean \| undefined` | Optional | - | +| `allowNegativeBalance` | `boolean \| undefined` | Optional | If set to true, discount is not limited (credits will carry forward to next billing). | | `archivedAt` | `string \| null \| undefined` | Optional | - | | `conversionLimit` | `string \| null \| undefined` | Optional | - | -| `stackable` | `boolean \| undefined` | Optional | - | -| `compoundingStrategy` | [`CompoundingStrategy \| null \| undefined`](../../doc/models/compounding-strategy.md) | Optional | - | +| `stackable` | `boolean \| undefined` | Optional | A stackable coupon can be combined with other coupons on a Subscription. | +| `compoundingStrategy` | [`CompoundingStrategy \| null \| undefined`](../../doc/models/compounding-strategy.md) | Optional | Applicable only to stackable coupons. For `compound`, Percentage-based discounts will be calculated against the remaining price, after prior discounts have been calculated. For `full-price`, Percentage-based discounts will always be calculated against the original item price, before other discounts are applied. | | `useSiteExchangeRate` | `boolean \| undefined` | Optional | - | | `createdAt` | `string \| undefined` | Optional | - | | `updatedAt` | `string \| undefined` | Optional | - | @@ -39,6 +39,7 @@ | `applyOnCancelAtEndOfPeriod` | `boolean \| undefined` | Optional | - | | `applyOnSubscriptionExpiration` | `boolean \| undefined` | Optional | - | | `couponRestrictions` | [`CouponRestriction[] \| undefined`](../../doc/models/coupon-restriction.md) | Optional | - | +| `currencyPrices` | [`CouponCurrency[] \| undefined`](../../doc/models/coupon-currency.md) | Optional | Returned in read, find, and list endpoints if the query parameter is provided. | ## Example (as JSON) diff --git a/doc/models/create-component-price-point.md b/doc/models/create-component-price-point.md index a597a900..ee5828e9 100644 --- a/doc/models/create-component-price-point.md +++ b/doc/models/create-component-price-point.md @@ -13,8 +13,8 @@ | `handle` | `string \| undefined` | Optional | - | | `pricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Price[]`](../../doc/models/price.md) | Required | - | -| `useSiteExchangeRate` | `boolean \| undefined` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site.
**Default**: `true` | -| `taxIncluded` | `boolean \| undefined` | Optional | Whether or not the price point includes tax | +| `useSiteExchangeRate` | `boolean \| undefined` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Setting not supported when creating price points in bulk.
**Default**: `true` | +| `taxIncluded` | `boolean \| undefined` | Optional | Whether or not the price point includes tax. Setting not supported when creating price points in bulk. | | `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `intervalUnit` | [`IntervalUnit \| null \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this price point, either month or day. This property is only available for sites with Multifrequency enabled. | diff --git a/doc/models/create-ebb-component.md b/doc/models/create-ebb-component.md index 9c76cee8..662425cf 100644 --- a/doc/models/create-ebb-component.md +++ b/doc/models/create-ebb-component.md @@ -29,7 +29,15 @@ "unit_price": 23.26 } ], - "upgrade_charge": "full", + "price_points": [ + { + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "interval": 92, + "interval_unit": "day" + } + ], "event_based_billing_metric_id": 68 } } diff --git a/doc/models/create-invoice-coupon.md b/doc/models/create-invoice-coupon.md index 50dcca35..d36943cc 100644 --- a/doc/models/create-invoice-coupon.md +++ b/doc/models/create-invoice-coupon.md @@ -14,7 +14,7 @@ | `amount` | [`CreateInvoiceCouponAmount \| undefined`](../../doc/models/containers/create-invoice-coupon-amount.md) | Optional | This is a container for one-of cases. | | `description` | `string \| undefined` | Optional | **Constraints**: *Maximum Length*: `255` | | `productFamilyId` | [`CreateInvoiceCouponProductFamilyId \| undefined`](../../doc/models/containers/create-invoice-coupon-product-family-id.md) | Optional | This is a container for one-of cases. | -| `compoundingStrategy` | [`CompoundingStrategy \| undefined`](../../doc/models/compounding-strategy.md) | Optional | - | +| `compoundingStrategy` | [`CompoundingStrategy \| undefined`](../../doc/models/compounding-strategy.md) | Optional | Applicable only to stackable coupons. For `compound`, Percentage-based discounts will be calculated against the remaining price, after prior discounts have been calculated. For `full-price`, Percentage-based discounts will always be calculated against the original item price, before other discounts are applied. | ## Example (as JSON) diff --git a/doc/models/create-metered-component.md b/doc/models/create-metered-component.md index 9cf46110..6616a56c 100644 --- a/doc/models/create-metered-component.md +++ b/doc/models/create-metered-component.md @@ -39,7 +39,29 @@ "unit_price": 23.26 } ], - "upgrade_charge": "none" + "price_points": [ + { + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "interval": 92, + "interval_unit": "day" + }, + { + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "interval": 92, + "interval_unit": "day" + }, + { + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "interval": 92, + "interval_unit": "day" + } + ] } } ``` diff --git a/doc/models/create-on-off-component.md b/doc/models/create-on-off-component.md index 15f298af..835967ed 100644 --- a/doc/models/create-on-off-component.md +++ b/doc/models/create-on-off-component.md @@ -20,14 +20,9 @@ "description": "description6", "handle": "handle2", "taxable": false, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "upgrade_charge": "full" + "upgrade_charge": "full", + "downgrade_credit": "full", + "unit_price": "String5" } } ``` diff --git a/doc/models/create-or-update-flat-amount-coupon.md b/doc/models/create-or-update-flat-amount-coupon.md deleted file mode 100644 index 13de86e6..00000000 --- a/doc/models/create-or-update-flat-amount-coupon.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Create or Update Flat Amount Coupon - -## Structure - -`CreateOrUpdateFlatAmountCoupon` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `string` | Required | the name of the coupon | -| `code` | `string` | Required | may contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.” | -| `description` | `string \| undefined` | Optional | - | -| `amountInCents` | `bigint` | Required | - | -| `allowNegativeBalance` | `boolean \| undefined` | Optional | - | -| `recurring` | `boolean \| undefined` | Optional | - | -| `endDate` | `string \| undefined` | Optional | - | -| `productFamilyId` | `string \| undefined` | Optional | - | -| `stackable` | `boolean \| undefined` | Optional | - | -| `compoundingStrategy` | [`CompoundingStrategy \| undefined`](../../doc/models/compounding-strategy.md) | Optional | - | -| `excludeMidPeriodAllocations` | `boolean \| undefined` | Optional | - | -| `applyOnCancelAtEndOfPeriod` | `boolean \| undefined` | Optional | - | -| `applyOnSubscriptionExpiration` | `boolean \| undefined` | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name0", - "code": "code8", - "description": "description0", - "amount_in_cents": 120, - "allow_negative_balance": false, - "recurring": false, - "end_date": "2016-03-13T12:52:32.123Z", - "product_family_id": "product_family_id4" -} -``` - diff --git a/doc/models/create-or-update-percentage-coupon.md b/doc/models/create-or-update-percentage-coupon.md deleted file mode 100644 index f0ded30c..00000000 --- a/doc/models/create-or-update-percentage-coupon.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Create or Update Percentage Coupon - -## Structure - -`CreateOrUpdatePercentageCoupon` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `string` | Required | the name of the coupon | -| `code` | `string` | Required | may contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.” | -| `description` | `string \| undefined` | Optional | - | -| `percentage` | [`CreateOrUpdatePercentageCouponPercentage`](../../doc/models/containers/create-or-update-percentage-coupon-percentage.md) | Required | This is a container for one-of cases. | -| `allowNegativeBalance` | `boolean \| undefined` | Optional | - | -| `recurring` | `boolean \| undefined` | Optional | - | -| `endDate` | `string \| undefined` | Optional | - | -| `productFamilyId` | `string \| undefined` | Optional | - | -| `stackable` | `boolean \| undefined` | Optional | - | -| `compoundingStrategy` | [`CompoundingStrategy \| undefined`](../../doc/models/compounding-strategy.md) | Optional | - | -| `excludeMidPeriodAllocations` | `boolean \| undefined` | Optional | - | -| `applyOnCancelAtEndOfPeriod` | `boolean \| undefined` | Optional | - | -| `applyOnSubscriptionExpiration` | `boolean \| undefined` | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name0", - "code": "code8", - "description": "description0", - "percentage": "String9", - "allow_negative_balance": false, - "recurring": false, - "end_date": "2016-03-13T12:52:32.123Z", - "product_family_id": "product_family_id6" -} -``` - diff --git a/doc/models/create-prepaid-component.md b/doc/models/create-prepaid-component.md index e3b333ab..d8d18a2a 100644 --- a/doc/models/create-prepaid-component.md +++ b/doc/models/create-prepaid-component.md @@ -21,7 +21,25 @@ "description": "description2", "handle": "handle8", "taxable": false, - "pricing_scheme": "per_unit" + "pricing_scheme": "per_unit", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ], + "upgrade_charge": "full", + "overage_pricing": { + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ] + } } } ``` diff --git a/doc/models/create-prepaid-usage-component-price-point.md b/doc/models/create-prepaid-usage-component-price-point.md index 72d75cb8..aa688940 100644 --- a/doc/models/create-prepaid-usage-component-price-point.md +++ b/doc/models/create-prepaid-usage-component-price-point.md @@ -15,10 +15,10 @@ | `prices` | [`Price[]`](../../doc/models/price.md) | Required | - | | `overagePricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Required | - | | `useSiteExchangeRate` | `boolean \| undefined` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site.
**Default**: `true` | -| `rolloverPrepaidRemainder` | `boolean \| undefined` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period | -| `renewPrepaidAllocation` | `boolean \| undefined` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | +| `rolloverPrepaidRemainder` | `boolean \| undefined` | Optional | (only for prepaid usage components) Boolean which controls whether or not remaining units should be rolled over to the next period | +| `renewPrepaidAllocation` | `boolean \| undefined` | Optional | (only for prepaid usage components) Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | | `expirationInterval` | `number \| undefined` | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire | -| `expirationIntervalUnit` | [`ExpirationIntervalUnit \| null \| undefined`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this component, either month or day | +| `expirationIntervalUnit` | [`ExpirationIntervalUnit \| null \| undefined`](../../doc/models/expiration-interval-unit.md) | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) A string representing the expiration interval unit for this component, either month or day | ## Example (as JSON) diff --git a/doc/models/create-subscription.md b/doc/models/create-subscription.md index b4194702..d2a09f34 100644 --- a/doc/models/create-subscription.md +++ b/doc/models/create-subscription.md @@ -55,7 +55,7 @@ | `activatedAt` | `string \| undefined` | Optional | - | | `agreementAcceptance` | [`AgreementAcceptance \| undefined`](../../doc/models/agreement-acceptance.md) | Optional | Required when creating a subscription with Maxio Payments. | | `achAgreement` | [`ACHAgreement \| undefined`](../../doc/models/ach-agreement.md) | Optional | (Optional) If passed, the proof of the authorized ACH agreement terms will be persisted. | -| `dunningCommunicationDelayEnabled` | `boolean \| null \| undefined` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute.
**Default**: `false` | +| `dunningCommunicationDelayEnabled` | `boolean \| undefined` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute.
**Default**: `false` | | `dunningCommunicationDelayTimeZone` | `string \| null \| undefined` | Optional | Time zone for the Dunning Communication Delay feature. | | `skipBillingManifestTaxes` | `boolean \| undefined` | Optional | Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests.
**Default**: `false` | diff --git a/doc/models/currency-price.md b/doc/models/currency-price.md index bb9ef2f6..b0694fc9 100644 --- a/doc/models/currency-price.md +++ b/doc/models/currency-price.md @@ -13,6 +13,8 @@ | `currency` | `string \| undefined` | Optional | - | | `price` | `number \| undefined` | Optional | - | | `formattedPrice` | `string \| undefined` | Optional | - | +| `priceId` | `number \| undefined` | Optional | - | +| `pricePointId` | `number \| undefined` | Optional | - | | `productPricePointId` | `number \| undefined` | Optional | - | | `role` | [`CurrencyPriceRole \| undefined`](../../doc/models/currency-price-role.md) | Optional | Role for the price. | @@ -24,7 +26,7 @@ "currency": "currency6", "price": 41.36, "formatted_price": "formatted_price4", - "product_price_point_id": 210 + "price_id": 178 } ``` diff --git a/doc/models/currency-prices-response.md b/doc/models/currency-prices-response.md index 1be1b32b..56f98519 100644 --- a/doc/models/currency-prices-response.md +++ b/doc/models/currency-prices-response.md @@ -21,7 +21,7 @@ "currency": "currency8", "price": 233.74, "formatted_price": "formatted_price6", - "product_price_point_id": 172 + "price_id": 116 } ] } diff --git a/doc/models/ebb-component.md b/doc/models/ebb-component.md index dffadf32..8186d04b 100644 --- a/doc/models/ebb-component.md +++ b/doc/models/ebb-component.md @@ -15,14 +15,11 @@ | `handle` | `string \| undefined` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `boolean \| undefined` | Optional | Boolean flag describing whether a component is taxable or not. | | `pricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | -| `prices` | [`Price[] \| undefined`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://help.chargify.com/products/product-components.html#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | -| `upgradeCharge` | [`CreditType \| null \| undefined`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `downgradeCredit` | [`CreditType \| null \| undefined`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | +| `prices` | [`Price[] \| undefined`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | | `pricePoints` | [`ComponentPricePointItem[] \| undefined`](../../doc/models/component-price-point-item.md) | Optional | - | | `unitPrice` | [`EBBComponentUnitPrice \| undefined`](../../doc/models/containers/ebb-component-unit-price.md) | Optional | This is a container for one-of cases. | | `taxCode` | `string \| undefined` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | | `hideDateRangeOnInvoice` | `boolean \| undefined` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `priceInCents` | `string \| undefined` | Optional | deprecated May 2011 - use unit_price instead | | `eventBasedBillingMetricId` | `number` | Required | The ID of an event based billing metric that will be attached to this component. | | `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `intervalUnit` | [`IntervalUnit \| null \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | @@ -44,7 +41,15 @@ "unit_price": 23.26 } ], - "upgrade_charge": "full", + "price_points": [ + { + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "interval": 92, + "interval_unit": "day" + } + ], "event_based_billing_metric_id": 190 } ``` diff --git a/doc/models/event-key.md b/doc/models/event-key.md new file mode 100644 index 00000000..d38126df --- /dev/null +++ b/doc/models/event-key.md @@ -0,0 +1,92 @@ + +# Event Key + +## Enumeration + +`EventKey` + +## Fields + +| Name | +| --- | +| `PaymentSuccess` | +| `PaymentFailure` | +| `SignupSuccess` | +| `SignupFailure` | +| `DelayedSignupCreationSuccess` | +| `DelayedSignupCreationFailure` | +| `BillingDateChange` | +| `ExpirationDateChange` | +| `RenewalSuccess` | +| `RenewalFailure` | +| `SubscriptionStateChange` | +| `SubscriptionProductChange` | +| `PendingCancellationChange` | +| `ExpiringCard` | +| `CustomerUpdate` | +| `CustomerCreate` | +| `CustomerDelete` | +| `ComponentAllocationChange` | +| `MeteredUsage` | +| `PrepaidUsage` | +| `UpgradeDowngradeSuccess` | +| `UpgradeDowngradeFailure` | +| `StatementClosed` | +| `StatementSettled` | +| `SubscriptionCardUpdate` | +| `SubscriptionGroupCardUpdate` | +| `SubscriptionBankAccountUpdate` | +| `RefundSuccess` | +| `RefundFailure` | +| `UpcomingRenewalNotice` | +| `TrialEndNotice` | +| `DunningStepReached` | +| `InvoiceIssued` | +| `PrepaidSubscriptionBalanceChanged` | +| `SubscriptionGroupSignupSuccess` | +| `SubscriptionGroupSignupFailure` | +| `DirectDebitPaymentPaidOut` | +| `DirectDebitPaymentRejected` | +| `DirectDebitPaymentPending` | +| `PendingPaymentCreated` | +| `PendingPaymentFailed` | +| `PendingPaymentCompleted` | +| `ProformaInvoiceIssued` | +| `SubscriptionPrepaymentAccountBalanceChanged` | +| `SubscriptionServiceCreditAccountBalanceChanged` | +| `CustomFieldValueChange` | +| `ItemPricePointChanged` | +| `RenewalSuccessRecreated` | +| `RenewalFailureRecreated` | +| `PaymentSuccessRecreated` | +| `PaymentFailureRecreated` | +| `SubscriptionDeletion` | +| `SubscriptionGroupBankAccountUpdate` | +| `SubscriptionPaypalAccountUpdate` | +| `SubscriptionGroupPaypalAccountUpdate` | +| `SubscriptionCustomerChange` | +| `AccountTransactionChanged` | +| `GoCardlessPaymentPaidOut` | +| `GoCardlessPaymentRejected` | +| `GoCardlessPaymentPending` | +| `StripeDirectDebitPaymentPaidOut` | +| `StripeDirectDebitPaymentRejected` | +| `StripeDirectDebitPaymentPending` | +| `MaxioPaymentsDirectDebitPaymentPaidOut` | +| `MaxioPaymentsDirectDebitPaymentRejected` | +| `MaxioPaymentsDirectDebitPaymentPending` | +| `InvoiceInCollectionsCanceled` | +| `SubscriptionAddedToGroup` | +| `SubscriptionRemovedFromGroup` | +| `ChargebackOpened` | +| `ChargebackLost` | +| `ChargebackAccepted` | +| `ChargebackClosed` | +| `ChargebackWon` | +| `PaymentCollectionMethodChanged` | +| `ComponentBillingDateChanged` | +| `SubscriptionTermRenewalScheduled` | +| `SubscriptionTermRenewalPending` | +| `SubscriptionTermRenewalActivated` | +| `SubscriptionTermRenewalRemoved` | + diff --git a/doc/models/event-response.md b/doc/models/event-response.md index 8afc31e7..75b10614 100644 --- a/doc/models/event-response.md +++ b/doc/models/event-response.md @@ -17,7 +17,7 @@ { "event": { "id": 242, - "key": "key0", + "key": "subscription_state_change", "message": "message0", "subscription_id": 96, "customer_id": 24, diff --git a/doc/models/event-type.md b/doc/models/event-type.md deleted file mode 100644 index 35c63e82..00000000 --- a/doc/models/event-type.md +++ /dev/null @@ -1,46 +0,0 @@ - -# Event Type - -## Enumeration - -`EventType` - -## Fields - -| Name | -| --- | -| `AccountTransactionChanged` | -| `BillingDateChange` | -| `ComponentAllocationChange` | -| `CustomerUpdate` | -| `CustomerCreate` | -| `DunningStepReached` | -| `ExpirationDateChange` | -| `ExpiringCard` | -| `MeteredUsage` | -| `PaymentSuccess` | -| `PaymentSuccessRecreated` | -| `PaymentFailure` | -| `PaymentFailureRecreated` | -| `RefundFailure` | -| `RefundSuccess` | -| `RenewalSuccess` | -| `RenewalSuccessRecreated` | -| `RenewalFailure` | -| `SignupSuccess` | -| `SignupFailure` | -| `StatementClosed` | -| `StatementSettled` | -| `SubscriptionBankAccountUpdate` | -| `SubscriptionDeletion` | -| `SubscriptionPaypalAccountUpdate` | -| `SubscriptionProductChange` | -| `SubscriptionStateChange` | -| `TrialEndNotice` | -| `UpgradeDowngradeSuccess` | -| `UpgradeDowngradeFailure` | -| `UpcomingRenewalNotice` | -| `CustomFieldValueChange` | -| `SubscriptionPrepaymentAccountBalanceChanged` | -| `SubscriptionServiceCreditAccountBalanceChanged` | - diff --git a/doc/models/event.md b/doc/models/event.md index 7e7fc4b7..07f612b7 100644 --- a/doc/models/event.md +++ b/doc/models/event.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `id` | `bigint` | Required | - | -| `key` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `key` | [`EventKey`](../../doc/models/event-key.md) | Required | - | | `message` | `string` | Required | **Constraints**: *Minimum Length*: `1` | | `subscriptionId` | `number \| null` | Required | - | | `customerId` | `number \| null` | Required | - | @@ -22,7 +22,7 @@ ```json { "id": 40, - "key": "key2", + "key": "invoice_issued", "message": "message8", "subscription_id": 150, "customer_id": 78, diff --git a/doc/models/invoice-avatax-details.md b/doc/models/invoice-avatax-details.md new file mode 100644 index 00000000..da49c5b9 --- /dev/null +++ b/doc/models/invoice-avatax-details.md @@ -0,0 +1,29 @@ + +# Invoice Avatax Details + +## Structure + +`InvoiceAvataxDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `bigint \| null \| undefined` | Optional | - | +| `status` | `string \| null \| undefined` | Optional | - | +| `documentCode` | `string \| null \| undefined` | Optional | - | +| `commitDate` | `string \| null \| undefined` | Optional | - | +| `modifyDate` | `string \| null \| undefined` | Optional | - | + +## Example (as JSON) + +```json +{ + "id": 112, + "status": "status2", + "document_code": "document_code0", + "commit_date": "2016-03-13T12:52:32.123Z", + "modify_date": "2016-03-13T12:52:32.123Z" +} +``` + diff --git a/doc/models/invoice-debit.md b/doc/models/invoice-debit.md new file mode 100644 index 00000000..72363245 --- /dev/null +++ b/doc/models/invoice-debit.md @@ -0,0 +1,32 @@ + +# Invoice Debit + +## Structure + +`InvoiceDebit` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| undefined` | Optional | - | +| `debitNoteNumber` | `string \| undefined` | Optional | - | +| `debitNoteUid` | `string \| undefined` | Optional | - | +| `role` | [`DebitNoteRole \| undefined`](../../doc/models/debit-note-role.md) | Optional | The role of the debit note. | +| `transactionTime` | `string \| undefined` | Optional | - | +| `memo` | `string \| undefined` | Optional | - | +| `originalAmount` | `string \| undefined` | Optional | - | +| `appliedAmount` | `string \| undefined` | Optional | - | + +## Example (as JSON) + +```json +{ + "uid": "uid2", + "debit_note_number": "debit_note_number2", + "debit_note_uid": "debit_note_uid8", + "role": "chargeback", + "transaction_time": "2016-03-13T12:52:32.123Z" +} +``` + diff --git a/doc/models/invoice-line-item.md b/doc/models/invoice-line-item.md index 70c38dfb..d257592f 100644 --- a/doc/models/invoice-line-item.md +++ b/doc/models/invoice-line-item.md @@ -26,6 +26,7 @@ | `productVersion` | `number \| null \| undefined` | Optional | The version of the product subscribed when the charge was made. | | `componentId` | `number \| null \| undefined` | Optional | The ID of the component being billed. Will be `nil` for non-component charges. | | `pricePointId` | `number \| null \| undefined` | Optional | The price point ID of the component being billed. Will be `nil` for non-component charges. | +| `billingScheduleItemId` | `number \| null \| undefined` | Optional | - | | `hide` | `boolean \| undefined` | Optional | - | | `componentCostData` | [`InvoiceLineItemComponentCostData \| null \| undefined`](../../doc/models/invoice-line-item-component-cost-data.md) | Optional | - | | `productPricePointId` | `number \| null \| undefined` | Optional | The price point ID of the line item's product | diff --git a/doc/models/invoice-status.md b/doc/models/invoice-status.md index b5785d72..43da5bc4 100644 --- a/doc/models/invoice-status.md +++ b/doc/models/invoice-status.md @@ -17,4 +17,5 @@ The current status of the invoice. See [Invoice Statuses](https://maxio.zendesk. | `Pending` | | `Voided` | | `Canceled` | +| `Processing` | diff --git a/doc/models/invoice.md b/doc/models/invoice.md index fd3cb9ef..e987764e 100644 --- a/doc/models/invoice.md +++ b/doc/models/invoice.md @@ -48,6 +48,7 @@ | `taxAmount` | `string \| undefined` | Optional | Total tax on the invoice. | | `totalAmount` | `string \| undefined` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | | `creditAmount` | `string \| undefined` | Optional | The amount of credit (from credit notes) applied to this invoice.

Credits offset the amount due from the customer. | +| `debitAmount` | `string \| undefined` | Optional | - | | `refundAmount` | `string \| undefined` | Optional | - | | `paidAmount` | `string \| undefined` | Optional | The amount paid on the invoice by the customer. | | `dueAmount` | `string \| undefined` | Optional | Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. | @@ -55,10 +56,12 @@ | `discounts` | [`InvoiceDiscount[] \| undefined`](../../doc/models/invoice-discount.md) | Optional | - | | `taxes` | [`InvoiceTax[] \| undefined`](../../doc/models/invoice-tax.md) | Optional | - | | `credits` | [`InvoiceCredit[] \| undefined`](../../doc/models/invoice-credit.md) | Optional | - | +| `debits` | [`InvoiceDebit[] \| undefined`](../../doc/models/invoice-debit.md) | Optional | - | | `refunds` | [`InvoiceRefund[] \| undefined`](../../doc/models/invoice-refund.md) | Optional | - | | `payments` | [`InvoicePayment[] \| undefined`](../../doc/models/invoice-payment.md) | Optional | - | | `customFields` | [`InvoiceCustomField[] \| undefined`](../../doc/models/invoice-custom-field.md) | Optional | - | | `displaySettings` | [`InvoiceDisplaySettings \| undefined`](../../doc/models/invoice-display-settings.md) | Optional | - | +| `avataxDetails` | [`InvoiceAvataxDetails \| undefined`](../../doc/models/invoice-avatax-details.md) | Optional | - | | `publicUrl` | `string \| undefined` | Optional | The public URL of the invoice | | `previousBalanceData` | [`InvoicePreviousBalance \| undefined`](../../doc/models/invoice-previous-balance.md) | Optional | - | | `publicUrlExpiresOn` | `string \| undefined` | Optional | The format is `"YYYY-MM-DD"`. | diff --git a/doc/models/issue-invoice-event-data.md b/doc/models/issue-invoice-event-data.md index 63ad92cd..6d22fcb7 100644 --- a/doc/models/issue-invoice-event-data.md +++ b/doc/models/issue-invoice-event-data.md @@ -22,8 +22,8 @@ Example schema for an `issue_invoice` event ```json { "consolidation_level": "none", - "from_status": "draft", - "to_status": "voided", + "from_status": "voided", + "to_status": "draft", "due_amount": "due_amount6", "total_amount": "total_amount0" } diff --git a/doc/models/issue-invoice-event.md b/doc/models/issue-invoice-event.md index 19465d6e..9c175e08 100644 --- a/doc/models/issue-invoice-event.md +++ b/doc/models/issue-invoice-event.md @@ -35,8 +35,8 @@ "event_type": "issue_invoice", "event_data": { "consolidation_level": "child", - "from_status": "paid", - "to_status": "paid", + "from_status": "open", + "to_status": "pending", "due_amount": "due_amount8", "total_amount": "total_amount2" } diff --git a/doc/models/metered-component.md b/doc/models/metered-component.md index c6ffbe40..caf59f38 100644 --- a/doc/models/metered-component.md +++ b/doc/models/metered-component.md @@ -16,13 +16,10 @@ | `taxable` | `boolean \| undefined` | Optional | Boolean flag describing whether a component is taxable or not. | | `pricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Price[] \| undefined`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | -| `upgradeCharge` | [`CreditType \| null \| undefined`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `downgradeCredit` | [`CreditType \| null \| undefined`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | | `pricePoints` | [`ComponentPricePointItem[] \| undefined`](../../doc/models/component-price-point-item.md) | Optional | - | | `unitPrice` | [`MeteredComponentUnitPrice \| undefined`](../../doc/models/containers/metered-component-unit-price.md) | Optional | This is a container for one-of cases. | | `taxCode` | `string \| undefined` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | | `hideDateRangeOnInvoice` | `boolean \| undefined` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `priceInCents` | `string \| undefined` | Optional | deprecated May 2011 - use unit_price instead | | `displayOnHostedPage` | `boolean \| undefined` | Optional | - | | `allowFractionalQuantities` | `boolean \| undefined` | Optional | - | | `publicSignupPageIds` | `number[] \| undefined` | Optional | - | @@ -46,7 +43,15 @@ "unit_price": 23.26 } ], - "upgrade_charge": "full" + "price_points": [ + { + "name": "name2", + "handle": "handle8", + "pricing_scheme": "per_unit", + "interval": 92, + "interval_unit": "day" + } + ] } ``` diff --git a/doc/models/reason-codes-json-response.md b/doc/models/ok-response.md similarity index 72% rename from doc/models/reason-codes-json-response.md rename to doc/models/ok-response.md index d6c31105..1b73006b 100644 --- a/doc/models/reason-codes-json-response.md +++ b/doc/models/ok-response.md @@ -1,9 +1,9 @@ -# Reason Codes Json Response +# Ok Response ## Structure -`ReasonCodesJsonResponse` +`OkResponse` ## Fields @@ -15,7 +15,7 @@ ```json { - "ok": "ok2" + "ok": "ok4" } ``` diff --git a/doc/models/on-off-component.md b/doc/models/on-off-component.md index c54dc4a2..f25ea25f 100644 --- a/doc/models/on-off-component.md +++ b/doc/models/on-off-component.md @@ -13,14 +13,12 @@ | `description` | `string \| undefined` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | | `handle` | `string \| undefined` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `boolean \| undefined` | Optional | Boolean flag describing whether a component is taxable or not. | -| `prices` | [`Price[] \| undefined`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261191737101-Price-Points-Components) for an overview of how price brackets work for different pricing schemes. | | `upgradeCharge` | [`CreditType \| null \| undefined`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | | `downgradeCredit` | [`CreditType \| null \| undefined`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | | `pricePoints` | [`ComponentPricePointItem[] \| undefined`](../../doc/models/component-price-point-item.md) | Optional | - | -| `unitPrice` | [`OnOffComponentUnitPrice \| undefined`](../../doc/models/containers/on-off-component-unit-price.md) | Optional | This is a container for one-of cases. | +| `unitPrice` | [`OnOffComponentUnitPrice`](../../doc/models/containers/on-off-component-unit-price.md) | Required | This is a container for one-of cases. | | `taxCode` | `string \| undefined` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | | `hideDateRangeOnInvoice` | `boolean \| undefined` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `priceInCents` | `string \| undefined` | Optional | deprecated May 2011 - use unit_price instead | | `displayOnHostedPage` | `boolean \| undefined` | Optional | - | | `allowFractionalQuantities` | `boolean \| undefined` | Optional | - | | `publicSignupPageIds` | `number[] \| undefined` | Optional | - | @@ -35,24 +33,9 @@ "description": "description2", "handle": "handle8", "taxable": false, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "upgrade_charge": "prorated" + "upgrade_charge": "prorated", + "downgrade_credit": "prorated", + "unit_price": "String1" } ``` diff --git a/doc/models/paid-invoice.md b/doc/models/paid-invoice.md index 3637db42..f61f3b88 100644 --- a/doc/models/paid-invoice.md +++ b/doc/models/paid-invoice.md @@ -19,7 +19,7 @@ ```json { "invoice_id": "invoice_id6", - "status": "draft", + "status": "open", "due_amount": "due_amount8", "paid_amount": "paid_amount8" } diff --git a/doc/models/prepaid-component-price-point.md b/doc/models/prepaid-component-price-point.md deleted file mode 100644 index 55ca2fb7..00000000 --- a/doc/models/prepaid-component-price-point.md +++ /dev/null @@ -1,49 +0,0 @@ - -# Prepaid Component Price Point - -## Structure - -`PrepaidComponentPricePoint` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `name` | `string \| undefined` | Optional | - | -| `handle` | `string \| undefined` | Optional | - | -| `pricingScheme` | [`PricingScheme \| undefined`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | -| `prices` | [`Price[] \| undefined`](../../doc/models/price.md) | Optional | - | -| `overagePricing` | [`OveragePricing \| undefined`](../../doc/models/overage-pricing.md) | Optional | - | - -## Example (as JSON) - -```json -{ - "name": "name8", - "handle": "handle4", - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} -``` - diff --git a/doc/models/prepaid-usage-component.md b/doc/models/prepaid-usage-component.md index efd18d7b..28678f0e 100644 --- a/doc/models/prepaid-usage-component.md +++ b/doc/models/prepaid-usage-component.md @@ -10,20 +10,19 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `unitName` | `string \| undefined` | Optional | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | +| `unitName` | `string` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | | `description` | `string \| undefined` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | | `handle` | `string \| undefined` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `boolean \| undefined` | Optional | Boolean flag describing whether a component is taxable or not. | -| `pricingScheme` | [`PricingScheme \| undefined`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | +| `pricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Price[] \| undefined`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | | `upgradeCharge` | [`CreditType \| null \| undefined`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | | `downgradeCredit` | [`CreditType \| null \| undefined`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | -| `pricePoints` | [`PrepaidComponentPricePoint[] \| undefined`](../../doc/models/prepaid-component-price-point.md) | Optional | - | +| `pricePoints` | [`CreatePrepaidUsageComponentPricePoint[] \| undefined`](../../doc/models/create-prepaid-usage-component-price-point.md) | Optional | - | | `unitPrice` | [`PrepaidUsageComponentUnitPrice \| undefined`](../../doc/models/containers/prepaid-usage-component-unit-price.md) | Optional | This is a container for one-of cases. | | `taxCode` | `string \| undefined` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | | `hideDateRangeOnInvoice` | `boolean \| undefined` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `priceInCents` | `string \| undefined` | Optional | deprecated May 2011 - use unit_price instead | -| `overagePricing` | [`OveragePricing \| undefined`](../../doc/models/overage-pricing.md) | Optional | - | +| `overagePricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Required | - | | `rolloverPrepaidRemainder` | `boolean \| undefined` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period | | `renewPrepaidAllocation` | `boolean \| undefined` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | | `expirationInterval` | `number \| undefined` | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire | @@ -41,7 +40,30 @@ "description": "description8", "handle": "handle8", "taxable": false, - "pricing_scheme": "stairstep" + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + }, + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ], + "upgrade_charge": "prorated", + "overage_pricing": { + "pricing_scheme": "stairstep", + "prices": [ + { + "starting_quantity": 242, + "ending_quantity": 40, + "unit_price": 23.26 + } + ] + } } ``` diff --git a/doc/models/quantity-based-component.md b/doc/models/quantity-based-component.md index f89e56fd..d33968c9 100644 --- a/doc/models/quantity-based-component.md +++ b/doc/models/quantity-based-component.md @@ -22,7 +22,6 @@ | `unitPrice` | [`QuantityBasedComponentUnitPrice \| undefined`](../../doc/models/containers/quantity-based-component-unit-price.md) | Optional | This is a container for one-of cases. | | `taxCode` | `string \| undefined` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | | `hideDateRangeOnInvoice` | `boolean \| undefined` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | -| `priceInCents` | `string \| undefined` | Optional | deprecated May 2011 - use unit_price instead | | `recurring` | `boolean \| undefined` | Optional | - | | `displayOnHostedPage` | `boolean \| undefined` | Optional | - | | `allowFractionalQuantities` | `boolean \| undefined` | Optional | - | diff --git a/doc/models/subscription-group-member-error.md b/doc/models/subscription-group-member-error.md deleted file mode 100644 index ed84af43..00000000 --- a/doc/models/subscription-group-member-error.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Subscription Group Member Error - -## Structure - -`SubscriptionGroupMemberError` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `id` | `number \| undefined` | Optional | - | -| `type` | `string \| undefined` | Optional | - | -| `message` | `string \| undefined` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 56, - "type": "type8", - "message": "message2" -} -``` - diff --git a/doc/models/subscription-group-signup-failure.md b/doc/models/subscription-group-signup-event-data.md similarity index 66% rename from doc/models/subscription-group-signup-failure.md rename to doc/models/subscription-group-signup-event-data.md index fd49cc31..d4174348 100644 --- a/doc/models/subscription-group-signup-failure.md +++ b/doc/models/subscription-group-signup-event-data.md @@ -1,16 +1,16 @@ -# Subscription Group Signup Failure +# Subscription Group Signup Event Data ## Structure -`SubscriptionGroupSignupFailure` +`SubscriptionGroupSignupEventData` ## Fields | Name | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionGroup` | [`SubscriptionGroupSignupFailureData`](../../doc/models/subscription-group-signup-failure-data.md) | Required | - | -| `customer` | `string \| null` | Required | - | +| `customer` | [`Customer \| null`](../../doc/models/customer.md) | Required | - | ## Example (as JSON) @@ -29,7 +29,13 @@ "organization": "organization6" } }, - "customer": "customer8" + "customer": { + "first_name": "first_name0", + "last_name": "last_name8", + "email": "email6", + "cc_emails": "cc_emails0", + "organization": "organization6" + } } ``` diff --git a/doc/models/subscription-group-signup-success-data.md b/doc/models/subscription-group-signup-success-data.md deleted file mode 100644 index eee55d93..00000000 --- a/doc/models/subscription-group-signup-success-data.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Subscription Group Signup Success Data - -## Structure - -`SubscriptionGroupSignupSuccessData` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `uid` | `string` | Required | - | -| `scheme` | `number` | Required | - | -| `customerId` | `number` | Required | - | -| `paymentProfileId` | `number` | Required | - | -| `subscriptionIds` | `number[]` | Required | - | -| `primarySubscriptionId` | `number` | Required | - | -| `nextAssessmentAt` | `string` | Required | - | -| `state` | `string` | Required | - | -| `cancelAtEndOfPeriod` | `boolean` | Required | - | - -## Example (as JSON) - -```json -{ - "uid": "uid8", - "scheme": 154, - "customer_id": 174, - "payment_profile_id": 82, - "subscription_ids": [ - 28, - 29 - ], - "primary_subscription_id": 102, - "next_assessment_at": "2016-03-13T12:52:32.123Z", - "state": "state4", - "cancel_at_end_of_period": false -} -``` - diff --git a/doc/models/subscription-group-signup-success.md b/doc/models/subscription-group-signup-success.md deleted file mode 100644 index 9a108b68..00000000 --- a/doc/models/subscription-group-signup-success.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Subscription Group Signup Success - -## Structure - -`SubscriptionGroupSignupSuccess` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `subscriptionGroup` | [`SubscriptionGroupSignupSuccessData`](../../doc/models/subscription-group-signup-success-data.md) | Required | - | -| `customer` | [`Customer`](../../doc/models/customer.md) | Required | - | - -## Example (as JSON) - -```json -{ - "subscription_group": { - "uid": "uid8", - "scheme": 200, - "customer_id": 220, - "payment_profile_id": 128, - "subscription_ids": [ - 74, - 75 - ], - "primary_subscription_id": 148, - "next_assessment_at": "2016-03-13T12:52:32.123Z", - "state": "state6", - "cancel_at_end_of_period": false - }, - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} -``` - diff --git a/doc/models/subscription-group-update-error-response-error.md b/doc/models/subscription-group-update-error-response-error.md index 1b8add9c..7783fe30 100644 --- a/doc/models/subscription-group-update-error-response-error.md +++ b/doc/models/subscription-group-update-error-response-error.md @@ -17,16 +17,8 @@ { "errors": { "members": [ - { - "id": 204, - "type": "type2", - "message": "message8" - }, - { - "id": 204, - "type": "type2", - "message": "message8" - } + "members2", + "members1" ] } } diff --git a/doc/models/subscription-group-update-error.md b/doc/models/subscription-group-update-error.md index 1af97143..a714ed9c 100644 --- a/doc/models/subscription-group-update-error.md +++ b/doc/models/subscription-group-update-error.md @@ -9,28 +9,16 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `members` | [`SubscriptionGroupMemberError[] \| undefined`](../../doc/models/subscription-group-member-error.md) | Optional | - | +| `members` | `string[] \| undefined` | Optional | - | ## Example (as JSON) ```json { "members": [ - { - "id": 204, - "type": "type2", - "message": "message8" - }, - { - "id": 204, - "type": "type2", - "message": "message8" - }, - { - "id": 204, - "type": "type2", - "message": "message8" - } + "members4", + "members5", + "members6" ] } ``` diff --git a/doc/models/subscription-response-error.md b/doc/models/subscription-response-error.md new file mode 100644 index 00000000..124dbc7c --- /dev/null +++ b/doc/models/subscription-response-error.md @@ -0,0 +1,27 @@ + +# Subscription Response Error + +## Structure + +`SubscriptionResponseError` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription` | [`Subscription \| undefined`](../../doc/models/subscription.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "subscription": { + "id": 8, + "state": "paused", + "balance_in_cents": 124, + "total_revenue_in_cents": 48, + "product_price_in_cents": 238 + } +} +``` + diff --git a/doc/models/update-currency-price.md b/doc/models/update-currency-price.md index c5e09000..13e2ca3b 100644 --- a/doc/models/update-currency-price.md +++ b/doc/models/update-currency-price.md @@ -17,7 +17,7 @@ ```json { "id": 146, - "price": 18 + "price": 71.86 } ``` diff --git a/doc/models/update-currency-prices-request.md b/doc/models/update-currency-prices-request.md index bc9f242c..24b4b7a7 100644 --- a/doc/models/update-currency-prices-request.md +++ b/doc/models/update-currency-prices-request.md @@ -18,7 +18,7 @@ "currency_prices": [ { "id": 50, - "price": 78 + "price": 233.74 } ] } diff --git a/doc/models/update-subscription.md b/doc/models/update-subscription.md index c6393865..af65d674 100644 --- a/doc/models/update-subscription.md +++ b/doc/models/update-subscription.md @@ -24,7 +24,7 @@ | `reference` | `string \| undefined` | Optional | - | | `customPrice` | [`SubscriptionCustomPrice \| undefined`](../../doc/models/subscription-custom-price.md) | Optional | (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription | | `components` | [`UpdateSubscriptionComponent[] \| undefined`](../../doc/models/update-subscription-component.md) | Optional | (Optional) An array of component ids and custom prices to be added to the subscription. | -| `dunningCommunicationDelayEnabled` | `boolean \| null \| undefined` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute. | +| `dunningCommunicationDelayEnabled` | `boolean \| undefined` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute. | | `dunningCommunicationDelayTimeZone` | `string \| null \| undefined` | Optional | Time zone for the Dunning Communication Delay feature. | | `productPricePointId` | `number \| undefined` | Optional | Set to change the current product's price point. | | `productPricePointHandle` | `string \| undefined` | Optional | Set to change the current product's price point. | diff --git a/e2e/src/config.ts b/e2e/src/config.ts index db71ad50..4dfc03c1 100644 --- a/e2e/src/config.ts +++ b/e2e/src/config.ts @@ -1,17 +1,14 @@ -import { Client, Environment } from 'advanced-billing-sdk'; +import { Client } from 'advanced-billing-sdk'; export const CONFIG = { SDK_KEY: process.env.SDK_KEY, PASSWORD: process.env.PASSWORD, SUBDOMAIN: process.env.SUBDOMAIN, - DOMAIN: process.env.DOMAIN, }; const defaultOptions = { timeout: 0, - domain: CONFIG.DOMAIN, - environment: Environment.Production, - subdomain: CONFIG.SUBDOMAIN, + site: CONFIG.SUBDOMAIN, basicAuthCredentials: { username: CONFIG.SDK_KEY || '', password: CONFIG.PASSWORD || '', @@ -26,9 +23,7 @@ export function createClient(options = defaultOptions) { export function createInvalidClient() { return createClient({ timeout: 0, - domain: CONFIG.DOMAIN, - environment: Environment.Production, - subdomain: CONFIG.SUBDOMAIN, + site: CONFIG.SUBDOMAIN, basicAuthCredentials: { username: 'invalidKey' || '', password: CONFIG.PASSWORD || '', diff --git a/package.json b/package.json index a61947db..c8bedb9e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "5.2.0", + "version": "6.0.0", "license": "MIT", "sideEffects": false, "main": "dist/cjs/index.js", @@ -18,7 +18,6 @@ "lint": "eslint **/*.ts --ignore-path .eslintignore", "lint:fix": "eslint **/*.ts --ignore-path .eslintignore --fix" }, - "peerDependencies": {}, "prettier": { "printWidth": 80, "semi": true, @@ -33,20 +32,20 @@ "email": "maxio-sdk@maxio.com" }, "devDependencies": { - "@types/jest": "^29.4.0", - "@typescript-eslint/eslint-plugin": "^5.52.0", - "@typescript-eslint/parser": "^5.52.0", - "eslint": "^8.34.0", - "jest": "^29.4.3", - "ts-jest": "^29.0.5", - "tslib": "^2.5.0", + "@types/jest": "^29.5.14", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", + "eslint": "^8.57.1", + "jest": "^29.7.0", + "ts-jest": "^29.2.5", + "tslib": "^2.8.1", "typescript": "^4.9.5" }, "dependencies": { - "@apimatic/authentication-adapters": "^0.5.4", - "@apimatic/axios-client-adapter": "^0.3.4", - "@apimatic/core": "^0.10.14", - "@apimatic/schema": "^0.7.12" + "@apimatic/authentication-adapters": "^0.5.6", + "@apimatic/axios-client-adapter": "^0.3.8", + "@apimatic/core": "^0.10.17", + "@apimatic/schema": "^0.7.15" }, "repository": { "type": "git", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 66946f5c..cb0ed7fd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,39 +9,39 @@ importers: .: dependencies: '@apimatic/authentication-adapters': - specifier: ^0.5.4 - version: 0.5.4 + specifier: ^0.5.6 + version: 0.5.6 '@apimatic/axios-client-adapter': - specifier: ^0.3.4 - version: 0.3.4 + specifier: ^0.3.8 + version: 0.3.8 '@apimatic/core': - specifier: ^0.10.14 - version: 0.10.14 + specifier: ^0.10.17 + version: 0.10.17 '@apimatic/schema': - specifier: ^0.7.12 - version: 0.7.12 + specifier: ^0.7.15 + version: 0.7.15 devDependencies: '@types/jest': - specifier: ^29.4.0 - version: 29.5.12 + specifier: ^29.5.14 + version: 29.5.14 '@typescript-eslint/eslint-plugin': - specifier: ^5.52.0 - version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.0)(typescript@4.9.5) + specifier: ^5.62.0 + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.1)(typescript@4.9.5) '@typescript-eslint/parser': - specifier: ^5.52.0 - version: 5.62.0(eslint@8.57.0)(typescript@4.9.5) + specifier: ^5.62.0 + version: 5.62.0(eslint@8.57.1)(typescript@4.9.5) eslint: - specifier: ^8.34.0 - version: 8.57.0 + specifier: ^8.57.1 + version: 8.57.1 jest: - specifier: ^29.4.3 - version: 29.7.0(@types/node@20.14.9) + specifier: ^29.7.0 + version: 29.7.0 ts-jest: - specifier: ^29.0.5 - version: 29.1.5(@babel/core@7.24.7)(jest@29.7.0)(typescript@4.9.5) + specifier: ^29.2.5 + version: 29.2.5(@babel/core@7.24.7)(jest@29.7.0)(typescript@4.9.5) tslib: - specifier: ^2.5.0 - version: 2.6.3 + specifier: ^2.8.1 + version: 2.8.1 typescript: specifier: ^4.9.5 version: 4.9.5 @@ -102,34 +102,34 @@ packages: '@jridgewell/trace-mapping': 0.3.25 dev: true - /@apimatic/authentication-adapters@0.5.4: - resolution: {integrity: sha512-UP4+LfvLQJjgtKaGr+hgQogM3JJGb9llEX8v9OVUp0xmiIVI8zt0m69nz/vk4GaNe4U6AvS3D4x0YiE5JtLVkg==} + /@apimatic/authentication-adapters@0.5.6: + resolution: {integrity: sha512-7/m+KLIpsiO83uWtCBRZKmpDtCLBoW5yIM9sOsHslI6RKbGWXu/cTnIE07nlrePLQhfX0+dO/Jl9vfFKIoLYzw==} engines: {node: '>=14.15.0 || >=16.0.0'} dependencies: - '@apimatic/core-interfaces': 0.2.6 - '@apimatic/http-headers': 0.3.2 - '@apimatic/http-query': 0.3.2 - tslib: 2.6.3 + '@apimatic/core-interfaces': 0.2.8 + '@apimatic/http-headers': 0.3.4 + '@apimatic/http-query': 0.3.4 + tslib: 2.8.1 dev: false - /@apimatic/axios-client-adapter@0.3.4: - resolution: {integrity: sha512-vRluB6E7AHnGRZp/ntPcvdj01RrxUj2ylzDR6ejsT/xbXf0SOw2awSDOEq1ZsglzakNvzbuGaWIBY+e2yq8e/Q==} + /@apimatic/axios-client-adapter@0.3.8: + resolution: {integrity: sha512-nwarzOH9f3O28zRC2HCiP9jLisKIFMDnSFjkFXio/P7X9SOPyTaeTN4K5jiHlpq5O3gChSk26LXiyDIvG1JqVw==} engines: {node: '>=14.15.0 || >=16.0.0'} dependencies: - '@apimatic/convert-to-stream': 0.1.2 - '@apimatic/core-interfaces': 0.2.6 - '@apimatic/file-wrapper': 0.3.2 - '@apimatic/http-headers': 0.3.2 - '@apimatic/http-query': 0.3.2 + '@apimatic/convert-to-stream': 0.1.4 + '@apimatic/core-interfaces': 0.2.8 + '@apimatic/file-wrapper': 0.3.4 + '@apimatic/http-headers': 0.3.4 + '@apimatic/http-query': 0.3.4 '@apimatic/json-bigint': 1.2.0 - '@apimatic/schema': 0.7.12 - axios: 1.7.2 + '@apimatic/schema': 0.7.15 + axios: 1.7.9 detect-browser: 5.3.0 detect-node: 2.1.0 - form-data: 3.0.1 + form-data: 4.0.1 lodash.flatmap: 4.5.0 tiny-warning: 1.0.3 - tslib: 2.6.3 + tslib: 2.8.1 transitivePeerDependencies: - debug dev: false @@ -139,71 +139,73 @@ packages: engines: {node: '>=10.4.0'} dev: false - /@apimatic/convert-to-stream@0.1.2: - resolution: {integrity: sha512-4UzlEIbecy1Qubbx8KXVerpt1w/KD4iEtHRfE28p0eMEU6RoLksnHVONp5i4uycvfNJsA0z0kiTBRtXkmNsWag==} + /@apimatic/convert-to-stream@0.1.4: + resolution: {integrity: sha512-QlAUUN/NT4IbajpnFw+w+4GAPwuTtPAEUMBGGKX4M2XLuv8QA4Asag6V19gLsnWFdzcu7mwpjGn+O4tsOlArMQ==} engines: {node: '>=14.15.0 || >=16.0.0'} + dependencies: + tslib: 2.8.1 dev: false - /@apimatic/core-interfaces@0.2.6: - resolution: {integrity: sha512-XbqyftDB4GO3rVOablFt7RnF03gLdctUgLT0flDP5JI3E4r+Cn2O66nFufWfSFhI/Vr0vJbVjjDG2xzZ2bHBjQ==} + /@apimatic/core-interfaces@0.2.8: + resolution: {integrity: sha512-3o9CkUMeRrg8uE1dDqcvh3MOFIOPqdNRmpFEzhJa5oc0IqHHVhCSU21V9jBe0jB1+Zxc9uHWsq55QXFpliFq8Q==} engines: {node: '>=14.15.0 || >=16.0.0'} dependencies: - '@apimatic/file-wrapper': 0.3.2 - tslib: 2.6.3 + '@apimatic/file-wrapper': 0.3.4 + tslib: 2.8.1 dev: false - /@apimatic/core@0.10.14: - resolution: {integrity: sha512-NTL82E51Ks/db+OVqntw903JiEpn6lHHM7fHcB7RV5SmPqhlZZiCElln4ThMG+tpcCr6sT3DNZYl47Np+Rblrw==} + /@apimatic/core@0.10.17: + resolution: {integrity: sha512-8AHBm0Y0cjDDtJBgx+TkGXWLWadG+zltMiew7vmrADT8GGhKX/JfMV0R9ae+E1kmnF+C2g/IH/muNx6+HH15pA==} engines: {node: '>=14.15.0 || >=16.0.0'} dependencies: '@apimatic/convert-to-stream': 0.0.2 - '@apimatic/core-interfaces': 0.2.6 - '@apimatic/file-wrapper': 0.3.2 - '@apimatic/http-headers': 0.3.2 - '@apimatic/http-query': 0.3.2 + '@apimatic/core-interfaces': 0.2.8 + '@apimatic/file-wrapper': 0.3.4 + '@apimatic/http-headers': 0.3.4 + '@apimatic/http-query': 0.3.4 '@apimatic/json-bigint': 1.2.0 - '@apimatic/schema': 0.7.12 + '@apimatic/schema': 0.7.15 detect-browser: 5.3.0 detect-node: 2.1.0 - form-data: 3.0.1 + form-data: 4.0.1 json-ptr: 3.1.1 lodash.defaultsdeep: 4.6.1 lodash.flatmap: 4.5.0 tiny-warning: 1.0.3 - tslib: 2.6.3 + tslib: 2.8.1 dev: false - /@apimatic/file-wrapper@0.3.2: - resolution: {integrity: sha512-pU2n9eEw5lIb4qWbqfgNmjrWAw8oI6I9jduE97Qpoe71+GSFZ2DWY0VBo+LXTYVm+fQBKpfcXAdheF6Ec3ilOA==} + /@apimatic/file-wrapper@0.3.4: + resolution: {integrity: sha512-XMY2Zh1pMOY1mGoz9axxR5Q5MDhdyArh2BxSfdJkRe76t2CiXdmw/+kPgBiX9QvXJXc0rcsDClqg4WMxamDepw==} engines: {node: '>=14.15.0 || >=16.0.0'} dependencies: - tslib: 2.6.3 + tslib: 2.8.1 dev: false - /@apimatic/http-headers@0.3.2: - resolution: {integrity: sha512-n6f+hSKercj29wvlqGg0gjNGZbXbpcDKelHya0SekBH0072eCqo8ndXdQ2PVsTUjWR+yErF2ZqagwX7aPhJICQ==} + /@apimatic/http-headers@0.3.4: + resolution: {integrity: sha512-ECKyQt9QaRu8nwFJS50HMKKhs+lO191URDUQ5CRzgtGPudmrrmB35I1lz3oVjXelyoJANog2IEGhx3nqoSYD7Q==} engines: {node: '>=14.15.0 || >=16.0.0'} dependencies: - tslib: 2.6.3 + tslib: 2.8.1 dev: false - /@apimatic/http-query@0.3.2: - resolution: {integrity: sha512-rT7HaoaLGraIeZE90FWo7ebwrYzW1FoaOu8NyUQKBiSo9rA6hmHcUPakUPCWIxh53tTqEnJVTSopMudpGVLZXQ==} + /@apimatic/http-query@0.3.4: + resolution: {integrity: sha512-6s5DS7dMq1lEJ+9AsTIiMyTXGX9xX5vOnduNSw8csSaQJ5lwMP4O4QzHFT3IFrvctKp/pfS75P0HYGV+9ciltg==} engines: {node: '>=14.15.0 || >=16.0.0'} dependencies: - '@apimatic/file-wrapper': 0.3.2 - tslib: 2.6.3 + '@apimatic/file-wrapper': 0.3.4 + tslib: 2.8.1 dev: false /@apimatic/json-bigint@1.2.0: resolution: {integrity: sha512-+bmVzYMdZu0Ya5L+my4FXFUih54OvQA/qlZsFOYdOoostyUuB27UDrVWQs/WVCmS0ADdo5vTU0eeTrrBkHoySw==} dev: false - /@apimatic/schema@0.7.12: - resolution: {integrity: sha512-JiIabKJuEKAF5QGFPwx2kG9vfTbQW7OLKxhRXbcIv8VvaH1DX/AdAfsDq3/+qCTmu6LpeNJmLWs8fwh8YRcsaQ==} + /@apimatic/schema@0.7.15: + resolution: {integrity: sha512-wJVQPYYJwG9TuMJLvddH7VJ7x5tRK3ycZvcsheeEL9xD2BmTIV5w5ni14gjvmLIbivRsHmMcUkCVhIEssjg+Zg==} engines: {node: '>=14.15.0 || >=16.0.0'} dependencies: - tslib: 2.6.3 + tslib: 2.8.1 dev: false /@babel/code-frame@7.24.7: @@ -553,11 +555,36 @@ packages: eslint-visitor-keys: 3.4.3 dev: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.57.1): + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.57.1 + eslint-visitor-keys: 3.4.3 + dev: true + + /@eslint-community/eslint-utils@4.4.1(eslint@8.57.1): + resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.57.1 + eslint-visitor-keys: 3.4.3 + dev: true + /@eslint-community/regexpp@4.10.1: resolution: {integrity: sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true + /@eslint-community/regexpp@4.12.1: + resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: true + /@eslint/eslintrc@2.1.4: resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -580,6 +607,11 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@eslint/js@8.57.1: + resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + /@humanwhocodes/config-array@0.11.14: resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} @@ -592,6 +624,18 @@ packages: - supports-color dev: true + /@humanwhocodes/config-array@0.13.0: + resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} + engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead + dependencies: + '@humanwhocodes/object-schema': 2.0.3 + debug: 4.4.0 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + /@humanwhocodes/module-importer@1.0.1: resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} @@ -644,14 +688,14 @@ packages: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.14.9 + '@types/node': 22.10.2 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.14.9) + jest-config: 29.7.0(@types/node@22.10.2) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -663,7 +707,7 @@ packages: jest-util: 29.7.0 jest-validate: 29.7.0 jest-watcher: 29.7.0 - micromatch: 4.0.7 + micromatch: 4.0.8 pretty-format: 29.7.0 slash: 3.0.0 strip-ansi: 6.0.1 @@ -962,6 +1006,13 @@ packages: pretty-format: 29.7.0 dev: true + /@types/jest@29.5.14: + resolution: {integrity: sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==} + dependencies: + expect: 29.7.0 + pretty-format: 29.7.0 + dev: true + /@types/json-schema@7.0.15: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} dev: true @@ -972,6 +1023,12 @@ packages: undici-types: 5.26.5 dev: true + /@types/node@22.10.2: + resolution: {integrity: sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==} + dependencies: + undici-types: 6.20.0 + dev: true + /@types/semver@7.5.8: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} dev: true @@ -1018,6 +1075,34 @@ packages: - supports-color dev: true + /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.1)(typescript@4.9.5): + resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + '@typescript-eslint/parser': ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.12.1 + '@typescript-eslint/parser': 5.62.0(eslint@8.57.1)(typescript@4.9.5) + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/type-utils': 5.62.0(eslint@8.57.1)(typescript@4.9.5) + '@typescript-eslint/utils': 5.62.0(eslint@8.57.1)(typescript@4.9.5) + debug: 4.4.0 + eslint: 8.57.1 + graphemer: 1.4.0 + ignore: 5.3.2 + natural-compare-lite: 1.4.0 + semver: 7.6.3 + tsutils: 3.21.0(typescript@4.9.5) + typescript: 4.9.5 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@4.9.5): resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1031,13 +1116,33 @@ packages: '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) - debug: 4.3.5 + debug: 4.4.0 eslint: 8.57.0 typescript: 4.9.5 transitivePeerDependencies: - supports-color dev: true + /@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@4.9.5): + resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) + debug: 4.4.0 + eslint: 8.57.1 + typescript: 4.9.5 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/scope-manager@5.62.0: resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1066,6 +1171,26 @@ packages: - supports-color dev: true + /@typescript-eslint/type-utils@5.62.0(eslint@8.57.1)(typescript@4.9.5): + resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '*' + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) + '@typescript-eslint/utils': 5.62.0(eslint@8.57.1)(typescript@4.9.5) + debug: 4.3.5 + eslint: 8.57.1 + tsutils: 3.21.0(typescript@4.9.5) + typescript: 4.9.5 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/types@5.62.0: resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1112,6 +1237,26 @@ packages: - typescript dev: true + /@typescript-eslint/utils@5.62.0(eslint@8.57.1)(typescript@4.9.5): + resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.8 + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) + eslint: 8.57.1 + eslint-scope: 5.1.1 + semver: 7.6.2 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /@typescript-eslint/visitor-keys@5.62.0: resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1124,6 +1269,10 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true + /@ungap/structured-clone@1.2.1: + resolution: {integrity: sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==} + dev: true + /acorn-jsx@5.3.2(acorn@8.12.0): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -1216,15 +1365,19 @@ packages: engines: {node: '>=8'} dev: true + /async@3.2.6: + resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} + dev: true + /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} dev: false - /axios@1.7.2: - resolution: {integrity: sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==} + /axios@1.7.9: + resolution: {integrity: sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==} dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 + follow-redirects: 1.15.9 + form-data: 4.0.1 proxy-from-env: 1.1.0 transitivePeerDependencies: - debug @@ -1313,6 +1466,12 @@ packages: concat-map: 0.0.1 dev: true + /brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: true + /braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} @@ -1481,6 +1640,25 @@ packages: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} dev: true + /create-jest@29.7.0: + resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-config: 29.7.0 + jest-util: 29.7.0 + prompts: 2.4.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + dev: true + /create-jest@29.7.0(@types/node@20.14.9): resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1509,6 +1687,15 @@ packages: which: 2.0.2 dev: true + /cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + /debug@4.3.5: resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} engines: {node: '>=6.0'} @@ -1521,6 +1708,18 @@ packages: ms: 2.1.2 dev: true + /debug@4.4.0: + resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.3 + dev: true + /dedent@1.5.3: resolution: {integrity: sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==} peerDependencies: @@ -1576,6 +1775,14 @@ packages: esutils: 2.0.3 dev: true + /ejs@3.1.10: + resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==} + engines: {node: '>=0.10.0'} + hasBin: true + dependencies: + jake: 10.9.2 + dev: true + /electron-to-chromium@1.4.814: resolution: {integrity: sha512-GVulpHjFu1Y9ZvikvbArHmAhZXtm3wHlpjTMcXNGKl4IQ4jMQjlnz8yMQYYqdLHKi/jEL2+CBC2akWVCoIGUdw==} dev: true @@ -1687,6 +1894,54 @@ packages: - supports-color dev: true + /eslint@8.57.1: + resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. + hasBin: true + dependencies: + '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.1) + '@eslint-community/regexpp': 4.12.1 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.57.1 + '@humanwhocodes/config-array': 0.13.0 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.1 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.6 + debug: 4.4.0 + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.6.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.24.0 + graphemer: 1.4.0 + ignore: 5.3.2 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.4 + strip-ansi: 6.0.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + /espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1709,6 +1964,13 @@ packages: estraverse: 5.3.0 dev: true + /esquery@1.6.0: + resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + dev: true + /esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} @@ -1823,6 +2085,12 @@ packages: flat-cache: 3.2.0 dev: true + /filelist@1.0.4: + resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} + dependencies: + minimatch: 5.1.6 + dev: true + /fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -1859,8 +2127,8 @@ packages: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} dev: true - /follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} + /follow-redirects@1.15.9: + resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==} engines: {node: '>=4.0'} peerDependencies: debug: '*' @@ -1869,17 +2137,8 @@ packages: optional: true dev: false - /form-data@3.0.1: - resolution: {integrity: sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: false - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + /form-data@4.0.1: + resolution: {integrity: sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==} engines: {node: '>= 6'} dependencies: asynckit: 0.4.0 @@ -2033,6 +2292,11 @@ packages: engines: {node: '>= 4'} dev: true + /ignore@5.3.2: + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} + engines: {node: '>= 4'} + dev: true + /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} @@ -2050,6 +2314,15 @@ packages: resolve-cwd: 3.0.0 dev: true + /import-local@3.2.0: + resolution: {integrity: sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==} + engines: {node: '>=8'} + hasBin: true + dependencies: + pkg-dir: 4.2.0 + resolve-cwd: 3.0.0 + dev: true + /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} @@ -2195,6 +2468,17 @@ packages: istanbul-lib-report: 3.0.1 dev: true + /jake@10.9.2: + resolution: {integrity: sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==} + engines: {node: '>=10'} + hasBin: true + dependencies: + async: 3.2.6 + chalk: 4.1.2 + filelist: 1.0.4 + minimatch: 3.1.2 + dev: true + /jest-changed-files@29.7.0: resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -2233,6 +2517,34 @@ packages: - supports-color dev: true + /jest-cli@29.7.0: + resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + chalk: 4.1.2 + create-jest: 29.7.0 + exit: 0.1.2 + import-local: 3.1.0 + jest-config: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + dev: true + /jest-cli@29.7.0(@types/node@20.14.9): resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -2261,6 +2573,45 @@ packages: - ts-node dev: true + /jest-config@29.7.0: + resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + dependencies: + '@babel/core': 7.24.7 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.24.7) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0 + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.7 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + dev: true + /jest-config@29.7.0(@types/node@20.14.9): resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -2301,6 +2652,46 @@ packages: - supports-color dev: true + /jest-config@29.7.0(@types/node@22.10.2): + resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + dependencies: + '@babel/core': 7.24.7 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 22.10.2 + babel-jest: 29.7.0(@babel/core@7.24.7) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0 + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.7 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + dev: true + /jest-diff@29.7.0: resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -2584,6 +2975,27 @@ packages: supports-color: 8.1.1 dev: true + /jest@29.7.0: + resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 29.7.0 + '@jest/types': 29.6.3 + import-local: 3.2.0 + jest-cli: 29.7.0 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + dev: true + /jest@29.7.0(@types/node@20.14.9): resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -2801,6 +3213,14 @@ packages: picomatch: 2.3.1 dev: true + /micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + dev: true + /mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} @@ -2829,10 +3249,21 @@ packages: brace-expansion: 1.1.11 dev: true + /minimatch@5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true + /ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: true + /natural-compare-lite@1.4.0: resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} dev: true @@ -3133,6 +3564,12 @@ packages: hasBin: true dev: true + /semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + engines: {node: '>=10'} + hasBin: true + dev: true + /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -3363,12 +3800,54 @@ packages: yargs-parser: 21.1.1 dev: true + /ts-jest@29.2.5(@babel/core@7.24.7)(jest@29.7.0)(typescript@4.9.5): + resolution: {integrity: sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==} + engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/transform': ^29.0.0 + '@jest/types': ^29.0.0 + babel-jest: ^29.0.0 + esbuild: '*' + jest: ^29.0.0 + typescript: '>=4.3 <6' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/transform': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + '@babel/core': 7.24.7 + bs-logger: 0.2.6 + ejs: 3.1.10 + fast-json-stable-stringify: 2.1.0 + jest: 29.7.0 + jest-util: 29.7.0 + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.6.3 + typescript: 4.9.5 + yargs-parser: 21.1.1 + dev: true + /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true /tslib@2.6.3: resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} + dev: true + + /tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} /tsutils@3.21.0(typescript@4.9.5): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} @@ -3419,6 +3898,10 @@ packages: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} dev: true + /undici-types@6.20.0: + resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} + dev: true + /update-browserslist-db@1.0.16(browserslist@4.23.1): resolution: {integrity: sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==} hasBin: true diff --git a/src/client.ts b/src/client.ts index 573107ae..6fdd8fb2 100644 --- a/src/client.ts +++ b/src/client.ts @@ -51,7 +51,7 @@ export class Client implements ClientInterface { ? this._config.httpClientOptions.timeout : this._config.timeout; this._userAgent = updateUserAgent( - 'AB SDK TypeScript:5.2.0 on OS {os-info}' + 'AB SDK TypeScript:6.0.0 on OS {os-info}' ); this._requestBuilderFactory = createRequestHandlerFactory( (server) => getBaseUri(server, this._config), @@ -89,17 +89,30 @@ function createHttpClientAdapter(client: HttpClient): HttpClientInterface { }; } -function getBaseUri(server: Server = 'default', config: Configuration): string { - if (config.environment === Environment.Production) { - if (server === 'default') { - return pathTemplate`https://${new SkipEncode( - config.subdomain - )}.${new SkipEncode(config.domain)}`; +function getBaseUri( + server: Server = 'production', + config: Configuration +): string { + if (config.environment === Environment.US) { + if (server === 'production') { + return pathTemplate`https://${new SkipEncode(config.site)}.chargify.com`; + } + if (server === 'ebb') { + return pathTemplate`https://events.chargify.com/${new SkipEncode( + config.site + )}`; } } - if (config.environment === Environment.Environment2) { - if (server === 'default') { - return 'https://events.chargify.com'; + if (config.environment === Environment.EU) { + if (server === 'production') { + return pathTemplate`https://${new SkipEncode( + config.site + )}.ebilling.maxio.com`; + } + if (server === 'ebb') { + return pathTemplate`https://events.chargify.com/${new SkipEncode( + config.site + )}`; } } throw new Error('Could not get Base URL. Invalid environment or server.'); diff --git a/src/clientInterface.ts b/src/clientInterface.ts index 736db3d3..c5696504 100644 --- a/src/clientInterface.ts +++ b/src/clientInterface.ts @@ -18,7 +18,7 @@ export type SdkRequestBuilderFactory = RequestBuilderFactory< export type SdkRequestBuilder = ReturnType; -export type Server = 'default'; +export type Server = 'production' | 'ebb'; export type AuthParams = ReturnType< typeof createAuthProviderFromConfig diff --git a/src/configuration.ts b/src/configuration.ts index 21fa2011..5ab1df9d 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -10,8 +10,7 @@ import { HttpClientOptions } from './clientAdapter'; export interface Configuration { timeout: number; environment: Environment; - subdomain: string; - domain: string; + site: string; basicAuthCredentials?: { username: string; password: string; @@ -22,6 +21,6 @@ export interface Configuration { /** Environments available for API */ export enum Environment { - Production = 'production', - Environment2 = 'environment2', + US = 'US', + EU = 'EU', } diff --git a/src/controllers/componentPricePointsController.ts b/src/controllers/componentPricePointsController.ts index 3f6a6ec1..4ad1039d 100644 --- a/src/controllers/componentPricePointsController.ts +++ b/src/controllers/componentPricePointsController.ts @@ -137,6 +137,12 @@ export class ComponentPricePointsController extends BaseController { req.header('Content-Type', 'application/json'); req.json(mapped.body); req.appendTemplatePath`/components/${mapped.componentId}/price_points.json`; + req.throwOn( + 422, + ErrorArrayMapResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); return req.callAsJson(componentPricePointResponseSchema, requestOptions); } @@ -223,6 +229,12 @@ export class ComponentPricePointsController extends BaseController { req.header('Content-Type', 'application/json'); req.json(mapped.body); req.appendTemplatePath`/components/${mapped.componentId}/price_points/bulk.json`; + req.throwOn( + 422, + ErrorListResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); return req.callAsJson(componentPricePointsResponseSchema, requestOptions); } @@ -278,26 +290,30 @@ export class ComponentPricePointsController extends BaseController { * Use this endpoint to retrieve details for a specific component price point. You can achieve this by * using either the component price point ID or handle. * - * @param componentId The id or handle of the component. When using the - * handle, it must be prefixed with `handle:`. Example: - * `123` for an integer ID, or `handle:example-product- - * handle` for a string handle. - * @param pricePointId The id or handle of the price point. When using the - * handle, it must be prefixed with `handle:`. Example: - * `123` for an integer ID, or `handle:example- - * price_point-handle` for a string handle. + * @param componentId The id or handle of the component. When using the + * handle, it must be prefixed with `handle:`. Example: + * `123` for an integer ID, or `handle:example-product- + * handle` for a string handle. + * @param pricePointId The id or handle of the price point. When using the + * handle, it must be prefixed with `handle:`. Example: + * `123` for an integer ID, or `handle:example- + * price_point-handle` for a string handle. + * @param currencyPrices Include an array of currency price data * @return Response from the API call */ async readComponentPricePoint( componentId: ReadComponentPricePointComponentId, pricePointId: ReadComponentPricePointPricePointId, + currencyPrices?: boolean, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('GET'); const mapped = req.prepareArgs({ componentId: [componentId, readComponentPricePointComponentIdSchema], pricePointId: [pricePointId, readComponentPricePointPricePointIdSchema], + currencyPrices: [currencyPrices, optional(boolean())], }); + req.query('currency_prices', mapped.currencyPrices); req.appendTemplatePath`/components/${mapped.componentId}/price_points/${mapped.pricePointId}.json`; req.authenticate([{ basicAuth: true }]); return req.callAsJson(componentPricePointResponseSchema, requestOptions); @@ -393,7 +409,8 @@ export class ComponentPricePointsController extends BaseController { req.throwOn( 422, ErrorArrayMapResponseError, - 'Unprocessable Entity (WebDAV)' + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." ); req.authenticate([{ basicAuth: true }]); return req.callAsJson( @@ -428,7 +445,8 @@ export class ComponentPricePointsController extends BaseController { req.throwOn( 422, ErrorArrayMapResponseError, - 'Unprocessable Entity (WebDAV)' + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." ); req.authenticate([{ basicAuth: true }]); return req.callAsJson( diff --git a/src/controllers/couponsController.ts b/src/controllers/couponsController.ts index bc887d76..4d186624 100644 --- a/src/controllers/couponsController.ts +++ b/src/controllers/couponsController.ts @@ -13,6 +13,7 @@ import { CouponCurrencyResponse, couponCurrencyResponseSchema, } from '../models/couponCurrencyResponse'; +import { CouponRequest, couponRequestSchema } from '../models/couponRequest'; import { CouponResponse, couponResponseSchema } from '../models/couponResponse'; import { CouponSubcodes, couponSubcodesSchema } from '../models/couponSubcodes'; import { @@ -20,10 +21,6 @@ import { couponSubcodesResponseSchema, } from '../models/couponSubcodesResponse'; import { CouponUsage, couponUsageSchema } from '../models/couponUsage'; -import { - CreateOrUpdateCoupon, - createOrUpdateCouponSchema, -} from '../models/createOrUpdateCoupon'; import { ListCouponsFilter, listCouponsFilterSchema, @@ -32,6 +29,7 @@ import { array, boolean, number, optional, string } from '../schema'; import { BaseController } from './baseController'; import { ApiError } from '@apimatic/core'; import { ErrorListResponseError } from '../errors/errorListResponseError'; +import { ErrorStringMapResponseError } from '../errors/errorStringMapResponseError'; import { SingleStringErrorResponseError } from '../errors/singleStringErrorResponseError'; export class CouponsController extends BaseController { @@ -50,28 +48,27 @@ export class CouponsController extends BaseController { * * This request will create a coupon, based on the provided information. * - * When creating a coupon, you must specify a product family using the `product_family_id`. If no - * `product_family_id` is passed, the first product family available is used. You will also need to - * formulate your URL to cite the Product Family ID in your request. + * You can create either a flat amount coupon, by specyfing `amount_in_cents`, or percentage coupon by + * specyfing `percentage`. * * You can restrict a coupon to only apply to specific products / components by optionally passing in - * hashes of `restricted_products` and/or `restricted_components` in the format: - * `{ "": boolean_value }` + * `restricted_products` and/or `restricted_components` objects in the format: + * `{ "": boolean_value }` * - * @param productFamilyId The Advanced Billing id of the product family to which - * the coupon belongs + * @param productFamilyId The Advanced Billing id of the product family to which the + * coupon belongs * @param body * @return Response from the API call */ async createCoupon( productFamilyId: number, - body?: CreateOrUpdateCoupon, + body?: CouponRequest, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('POST'); const mapped = req.prepareArgs({ productFamilyId: [productFamilyId, number()], - body: [body, optional(createOrUpdateCouponSchema)], + body: [body, optional(couponRequestSchema)], }); req.header('Content-Type', 'application/json'); req.json(mapped.body); @@ -158,20 +155,26 @@ export class CouponsController extends BaseController { * * @param productFamilyId The Advanced Billing id of the product family to which the coupon belongs * @param code The code of the coupon + * @param currencyPrices When fetching coupons, if you have defined multiple currencies at the site + * level, you can optionally pass the `?currency_prices=true` query param to + * include an array of currency price data in the response. * @return Response from the API call */ async findCoupon( productFamilyId?: number, code?: string, + currencyPrices?: boolean, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('GET', '/coupons/find.json'); const mapped = req.prepareArgs({ productFamilyId: [productFamilyId, optional(number())], code: [code, optional(string())], + currencyPrices: [currencyPrices, optional(boolean())], }); req.query('product_family_id', mapped.productFamilyId); req.query('code', mapped.code); + req.query('currency_prices', mapped.currencyPrices); req.authenticate([{ basicAuth: true }]); return req.callAsJson(couponResponseSchema, requestOptions); } @@ -191,18 +194,24 @@ export class CouponsController extends BaseController { * * @param productFamilyId The Advanced Billing id of the product family to which the coupon belongs * @param couponId The Advanced Billing id of the coupon + * @param currencyPrices When fetching coupons, if you have defined multiple currencies at the site + * level, you can optionally pass the `?currency_prices=true` query param to + * include an array of currency price data in the response. * @return Response from the API call */ async readCoupon( productFamilyId: number, couponId: number, + currencyPrices?: boolean, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('GET'); const mapped = req.prepareArgs({ productFamilyId: [productFamilyId, number()], couponId: [couponId, number()], + currencyPrices: [currencyPrices, optional(boolean())], }); + req.query('currency_prices', mapped.currencyPrices); req.appendTemplatePath`/product_families/${mapped.productFamilyId}/coupons/${mapped.couponId}.json`; req.authenticate([{ basicAuth: true }]); return req.callAsJson(couponResponseSchema, requestOptions); @@ -217,8 +226,8 @@ export class CouponsController extends BaseController { * hashes of `restricted_products` and/or `restricted_components` in the format: * `{ "": boolean_value }` * - * @param productFamilyId The Advanced Billing id of the product family to which - * the coupon belongs + * @param productFamilyId The Advanced Billing id of the product family to which the + * coupon belongs * @param couponId The Advanced Billing id of the coupon * @param body * @return Response from the API call @@ -226,18 +235,24 @@ export class CouponsController extends BaseController { async updateCoupon( productFamilyId: number, couponId: number, - body?: CreateOrUpdateCoupon, + body?: CouponRequest, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('PUT'); const mapped = req.prepareArgs({ productFamilyId: [productFamilyId, number()], couponId: [couponId, number()], - body: [body, optional(createOrUpdateCouponSchema)], + body: [body, optional(couponRequestSchema)], }); req.header('Content-Type', 'application/json'); req.json(mapped.body); req.appendTemplatePath`/product_families/${mapped.productFamilyId}/coupons/${mapped.couponId}.json`; + req.throwOn( + 422, + ErrorListResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); return req.callAsJson(couponResponseSchema, requestOptions); } @@ -423,6 +438,12 @@ export class CouponsController extends BaseController { req.header('Content-Type', 'application/json'); req.json(mapped.body); req.appendTemplatePath`/coupons/${mapped.couponId}/currency_prices.json`; + req.throwOn( + 422, + ErrorStringMapResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); return req.callAsJson(couponCurrencyResponseSchema, requestOptions); } diff --git a/src/controllers/eventsController.ts b/src/controllers/eventsController.ts index 2aa60c06..a7167c70 100644 --- a/src/controllers/eventsController.ts +++ b/src/controllers/eventsController.ts @@ -7,8 +7,8 @@ import { ApiResponse, commaPrefix, RequestOptions } from '../core'; import { CountResponse, countResponseSchema } from '../models/countResponse'; import { Direction, directionSchema } from '../models/direction'; +import { EventKey, eventKeySchema } from '../models/eventKey'; import { EventResponse, eventResponseSchema } from '../models/eventResponse'; -import { EventType, eventTypeSchema } from '../models/eventType'; import { ListEventsDateField, listEventsDateFieldSchema, @@ -44,12 +44,17 @@ export class EventsController extends BaseController { * + `zferral_revenue_post_failure` - (Specific to the deprecated Zferral integration) * + `zferral_revenue_post_success` - (Specific to the deprecated Zferral integration) * - * ## Event Specific Data + * ## Event Key + * The event type is identified by the key property. You can check supported keys + * [here]($m/Event%20Key). * - * Event Specific Data + * ## Event Specific Data * - * Each event type has its own `event_specific_data` specified. + * Different event types may include additional data in `event_specific_data` property. + * While some events share the same schema for `event_specific_data`, others may not include it at all. + * For precise mappings from key to event_specific_data, refer to [Event]($m/Event). * + * ### Example * Here’s an example event for the `subscription_product_change` event: * * ``` @@ -140,7 +145,7 @@ export class EventsController extends BaseController { sinceId?: bigint; maxId?: bigint; direction?: Direction; - filter?: EventType[]; + filter?: EventKey[]; dateField?: ListEventsDateField; startDate?: string; endDate?: string; @@ -156,7 +161,7 @@ export class EventsController extends BaseController { sinceId: [sinceId, optional(bigint())], maxId: [maxId, optional(bigint())], direction: [direction, optional(directionSchema)], - filter: [filter, optional(array(eventTypeSchema))], + filter: [filter, optional(array(eventKeySchema))], dateField: [dateField, optional(listEventsDateFieldSchema)], startDate: [startDate, optional(string())], endDate: [endDate, optional(string())], @@ -181,23 +186,31 @@ export class EventsController extends BaseController { /** * The following request will return a list of events for a subscription. * - * Each event type has its own `event_specific_data` specified. + * ## Event Key + * The event type is identified by the key property. You can check supported keys + * [here]($m/Event%20Key). + * + * ## Event Specific Data + * + * Different event types may include additional data in `event_specific_data` property. + * While some events share the same schema for `event_specific_data`, others may not include it at all. + * For precise mappings from key to event_specific_data, refer to [Event]($m/Event). * * @param subscriptionId The Chargify id of the subscription - * @param page Result records are organized in pages. By default, the first page of - * results is displayed. The page parameter specifies a page number of results - * to fetch. You can start navigating through the pages to consume the results. - * You do this by passing in a page parameter. Retrieve the next page by adding - * ?page=2 to the query string. If there are no results to return, then an - * empty result set will be returned. Use in query `page=1`. + * @param page Result records are organized in pages. By default, the first page of results + * is displayed. The page parameter specifies a page number of results to fetch. + * You can start navigating through the pages to consume the results. You do + * this by passing in a page parameter. Retrieve the next page by adding ?page=2 + * to the query string. If there are no results to return, then an empty result + * set will be returned. Use in query `page=1`. * @param perPage This parameter indicates how many records to fetch in each request. Default - * value is 20. The maximum allowed values is 200; any per_page value over 200 - * will be changed to 200. Use in query `per_page=200`. + * value is 20. The maximum allowed values is 200; any per_page value over 200 + * will be changed to 200. Use in query `per_page=200`. * @param sinceId Returns events with an id greater than or equal to the one specified * @param maxId Returns events with an id less than or equal to the one specified * @param direction The sort direction of the returned events. * @param filter You can pass multiple event keys after comma. Use in query - * `filter=signup_success,payment_success`. + * `filter=signup_success,payment_success`. * @return Response from the API call */ async listSubscriptionEvents( @@ -216,7 +229,7 @@ export class EventsController extends BaseController { sinceId?: bigint; maxId?: bigint; direction?: Direction; - filter?: EventType[]; + filter?: EventKey[]; }, requestOptions?: RequestOptions ): Promise> { @@ -228,7 +241,7 @@ export class EventsController extends BaseController { sinceId: [sinceId, optional(bigint())], maxId: [maxId, optional(bigint())], direction: [direction, optional(directionSchema)], - filter: [filter, optional(array(eventTypeSchema))], + filter: [filter, optional(array(eventKeySchema))], }); req.query('page', mapped.page); req.query('per_page', mapped.perPage); @@ -245,19 +258,19 @@ export class EventsController extends BaseController { * Get a count of all the events for a given site by using this method. * * @param page Result records are organized in pages. By default, the first page of results is - * displayed. The page parameter specifies a page number of results to fetch. You can - * start navigating through the pages to consume the results. You do this by passing - * in a page parameter. Retrieve the next page by adding ?page=2 to the query string. - * If there are no results to return, then an empty result set will be returned. Use - * in query `page=1`. + * displayed. The page parameter specifies a page number of results to fetch. You can + * start navigating through the pages to consume the results. You do this by passing + * in a page parameter. Retrieve the next page by adding ?page=2 to the query string. + * If there are no results to return, then an empty result set will be returned. Use + * in query `page=1`. * @param perPage This parameter indicates how many records to fetch in each request. Default value - * is 20. The maximum allowed values is 200; any per_page value over 200 will be - * changed to 200. Use in query `per_page=200`. + * is 20. The maximum allowed values is 200; any per_page value over 200 will be + * changed to 200. Use in query `per_page=200`. * @param sinceId Returns events with an id greater than or equal to the one specified * @param maxId Returns events with an id less than or equal to the one specified * @param direction The sort direction of the returned events. * @param filter You can pass multiple event keys after comma. Use in query `filter=signup_success, - * payment_success`. + * payment_success`. * @return Response from the API call */ async readEventsCount( @@ -274,7 +287,7 @@ export class EventsController extends BaseController { sinceId?: bigint; maxId?: bigint; direction?: Direction; - filter?: EventType[]; + filter?: EventKey[]; }, requestOptions?: RequestOptions ): Promise> { @@ -285,7 +298,7 @@ export class EventsController extends BaseController { sinceId: [sinceId, optional(bigint())], maxId: [maxId, optional(bigint())], direction: [direction, optional(directionSchema)], - filter: [filter, optional(array(eventTypeSchema))], + filter: [filter, optional(array(eventKeySchema))], }); req.query('page', mapped.page); req.query('per_page', mapped.perPage); diff --git a/src/controllers/offersController.ts b/src/controllers/offersController.ts index 04c366ad..1d0ecb9b 100644 --- a/src/controllers/offersController.ts +++ b/src/controllers/offersController.ts @@ -17,6 +17,7 @@ import { OfferResponse, offerResponseSchema } from '../models/offerResponse'; import { boolean, number, optional } from '../schema'; import { BaseController } from './baseController'; import { ErrorArrayMapResponseError } from '../errors/errorArrayMapResponseError'; +import { ErrorListResponseError } from '../errors/errorListResponseError'; export class OffersController extends BaseController { /** @@ -97,6 +98,12 @@ export class OffersController extends BaseController { req.query('page', mapped.page); req.query('per_page', mapped.perPage); req.query('include_archived', mapped.includeArchived); + req.throwOn( + 422, + ErrorListResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); return req.callAsJson(listOffersResponseSchema, requestOptions); } diff --git a/src/controllers/productPricePointsController.ts b/src/controllers/productPricePointsController.ts index cdb756e3..085014a0 100644 --- a/src/controllers/productPricePointsController.ts +++ b/src/controllers/productPricePointsController.ts @@ -158,6 +158,8 @@ export class ProductPricePointsController extends BaseController { * flag is set to false, it will return all of the * defined prices for each currency. * @param filterType Use in query: `filter[type]=catalog,default`. + * @param archived Set to include archived price points in the + * response. * @return Response from the API call */ async listProductPricePoints( @@ -167,12 +169,14 @@ export class ProductPricePointsController extends BaseController { perPage, currencyPrices, filterType, + archived, }: { productId: ListProductPricePointsInputProductId; page?: number; perPage?: number; currencyPrices?: boolean; filterType?: PricePointType[]; + archived?: boolean; }, requestOptions?: RequestOptions ): Promise> { @@ -183,11 +187,13 @@ export class ProductPricePointsController extends BaseController { perPage: [perPage, optional(number())], currencyPrices: [currencyPrices, optional(boolean())], filterType: [filterType, optional(array(pricePointTypeSchema))], + archived: [archived, optional(boolean())], }); req.query('page', mapped.page); req.query('per_page', mapped.perPage); req.query('currency_prices', mapped.currencyPrices); req.query('filter[type]', mapped.filterType, commaPrefix); + req.query('archived', mapped.archived); req.appendTemplatePath`/products/${mapped.productId}/price_points.json`; req.authenticate([{ basicAuth: true }]); return req.callAsJson(listProductPricePointsResponseSchema, requestOptions); diff --git a/src/controllers/reasonCodesController.ts b/src/controllers/reasonCodesController.ts index f6236421..18851d95 100644 --- a/src/controllers/reasonCodesController.ts +++ b/src/controllers/reasonCodesController.ts @@ -9,14 +9,11 @@ import { CreateReasonCodeRequest, createReasonCodeRequestSchema, } from '../models/createReasonCodeRequest'; +import { OkResponse, okResponseSchema } from '../models/okResponse'; import { ReasonCodeResponse, reasonCodeResponseSchema, } from '../models/reasonCodeResponse'; -import { - ReasonCodesJsonResponse, - reasonCodesJsonResponseSchema, -} from '../models/reasonCodesJsonResponse'; import { UpdateReasonCodeRequest, updateReasonCodeRequestSchema, @@ -101,6 +98,12 @@ export class ReasonCodesController extends BaseController { }); req.query('page', mapped.page); req.query('per_page', mapped.perPage); + req.throwOn( + 422, + ErrorListResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); return req.callAsJson(array(reasonCodeResponseSchema), requestOptions); } @@ -145,6 +148,12 @@ export class ReasonCodesController extends BaseController { req.json(mapped.body); req.appendTemplatePath`/reason_codes/${mapped.reasonCodeId}.json`; req.throwOn(404, ApiError, true, "Not Found:'{$response.body}'"); + req.throwOn( + 422, + ErrorListResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); return req.callAsJson(reasonCodeResponseSchema, requestOptions); } @@ -159,12 +168,12 @@ export class ReasonCodesController extends BaseController { async deleteReasonCode( reasonCodeId: number, requestOptions?: RequestOptions - ): Promise> { + ): Promise> { const req = this.createRequest('DELETE'); const mapped = req.prepareArgs({ reasonCodeId: [reasonCodeId, number()] }); req.appendTemplatePath`/reason_codes/${mapped.reasonCodeId}.json`; req.throwOn(404, ApiError, true, "Not Found:'{$response.body}'"); req.authenticate([{ basicAuth: true }]); - return req.callAsJson(reasonCodesJsonResponseSchema, requestOptions); + return req.callAsJson(okResponseSchema, requestOptions); } } diff --git a/src/controllers/subscriptionComponentsController.ts b/src/controllers/subscriptionComponentsController.ts index 945b5c8f..3ae387ec 100644 --- a/src/controllers/subscriptionComponentsController.ts +++ b/src/controllers/subscriptionComponentsController.ts @@ -943,7 +943,6 @@ export class SubscriptionComponentsController extends BaseController { * https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle * ``` * - * @param subdomain Your site's subdomain * @param apiHandle Identifies the Stream for which the event should be published. * @param storeUid If you've attached your own Keen project as an Advanced Billing event data- * store, use this parameter to indicate the data-store. @@ -951,15 +950,14 @@ export class SubscriptionComponentsController extends BaseController { * @return Response from the API call */ async recordEvent( - subdomain: string, apiHandle: string, storeUid?: string, body?: EBBEvent, requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('POST'); + req.baseUrl('ebb'); const mapped = req.prepareArgs({ - subdomain: [subdomain, string()], apiHandle: [apiHandle, string()], storeUid: [storeUid, optional(string())], body: [body, optional(eBBEventSchema)], @@ -967,7 +965,7 @@ export class SubscriptionComponentsController extends BaseController { req.header('Content-Type', 'application/json'); req.query('store_uid', mapped.storeUid); req.json(mapped.body); - req.appendTemplatePath`/${mapped.subdomain}/events/${mapped.apiHandle}.json`; + req.appendTemplatePath`/events/${mapped.apiHandle}.json`; req.authenticate([{ basicAuth: true }]); return req.call(requestOptions); } @@ -981,7 +979,6 @@ export class SubscriptionComponentsController extends BaseController { * A maximum of 1000 events can be published in a single request. A 422 will be returned if this limit * is exceeded. * - * @param subdomain Your site's subdomain * @param apiHandle Identifies the Stream for which the events should be published. * @param storeUid If you've attached your own Keen project as an Advanced Billing event data- * store, use this parameter to indicate the data-store. @@ -989,15 +986,14 @@ export class SubscriptionComponentsController extends BaseController { * @return Response from the API call */ async bulkRecordEvents( - subdomain: string, apiHandle: string, storeUid?: string, body?: EBBEvent[], requestOptions?: RequestOptions ): Promise> { const req = this.createRequest('POST'); + req.baseUrl('ebb'); const mapped = req.prepareArgs({ - subdomain: [subdomain, string()], apiHandle: [apiHandle, string()], storeUid: [storeUid, optional(string())], body: [body, optional(array(eBBEventSchema))], @@ -1005,7 +1001,7 @@ export class SubscriptionComponentsController extends BaseController { req.header('Content-Type', 'application/json'); req.query('store_uid', mapped.storeUid); req.json(mapped.body); - req.appendTemplatePath`/${mapped.subdomain}/events/${mapped.apiHandle}/bulk.json`; + req.appendTemplatePath`/events/${mapped.apiHandle}/bulk.json`; req.authenticate([{ basicAuth: true }]); return req.call(requestOptions); } diff --git a/src/controllers/subscriptionNotesController.ts b/src/controllers/subscriptionNotesController.ts index 181c153e..64b5f882 100644 --- a/src/controllers/subscriptionNotesController.ts +++ b/src/controllers/subscriptionNotesController.ts @@ -15,6 +15,7 @@ import { } from '../models/updateSubscriptionNoteRequest'; import { array, number, optional } from '../schema'; import { BaseController } from './baseController'; +import { ErrorListResponseError } from '../errors/errorListResponseError'; export class SubscriptionNotesController extends BaseController { /** @@ -46,6 +47,12 @@ export class SubscriptionNotesController extends BaseController { req.header('Content-Type', 'application/json'); req.json(mapped.body); req.appendTemplatePath`/subscriptions/${mapped.subscriptionId}/notes.json`; + req.throwOn( + 422, + ErrorListResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); return req.callAsJson(subscriptionNoteResponseSchema, requestOptions); } @@ -87,6 +94,12 @@ export class SubscriptionNotesController extends BaseController { req.query('page', mapped.page); req.query('per_page', mapped.perPage); req.appendTemplatePath`/subscriptions/${mapped.subscriptionId}/notes.json`; + req.throwOn( + 422, + ErrorListResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); return req.callAsJson( array(subscriptionNoteResponseSchema), @@ -140,6 +153,12 @@ export class SubscriptionNotesController extends BaseController { req.header('Content-Type', 'application/json'); req.json(mapped.body); req.appendTemplatePath`/subscriptions/${mapped.subscriptionId}/notes/${mapped.noteId}.json`; + req.throwOn( + 422, + ErrorListResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); return req.callAsJson(subscriptionNoteResponseSchema, requestOptions); } diff --git a/src/controllers/subscriptionStatusController.ts b/src/controllers/subscriptionStatusController.ts index fb1b551b..6839f007 100644 --- a/src/controllers/subscriptionStatusController.ts +++ b/src/controllers/subscriptionStatusController.ts @@ -445,6 +445,12 @@ export class SubscriptionStatusController extends BaseController { req.json(mapped.body); req.appendTemplatePath`/subscriptions/${mapped.subscriptionId}/delayed_cancel.json`; req.throwOn(404, ApiError, true, "Not Found:'{$response.body}'"); + req.throwOn( + 422, + ErrorListResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); return req.callAsJson(delayedCancellationResponseSchema, requestOptions); } @@ -490,6 +496,12 @@ export class SubscriptionStatusController extends BaseController { subscriptionId: [subscriptionId, number()], }); req.appendTemplatePath`/subscriptions/${mapped.subscriptionId}/cancel_dunning.json`; + req.throwOn( + 422, + ErrorListResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); return req.callAsJson(subscriptionResponseSchema, requestOptions); } diff --git a/src/controllers/subscriptionsController.ts b/src/controllers/subscriptionsController.ts index d60c82da..f3cfbe6a 100644 --- a/src/controllers/subscriptionsController.ts +++ b/src/controllers/subscriptionsController.ts @@ -4,12 +4,7 @@ * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ -import { - ApiResponse, - commaPrefix, - RequestOptions, - unindexedPrefix, -} from '../core'; +import { ApiResponse, RequestOptions, unindexedPrefix } from '../core'; import { ActivateSubscriptionRequest, activateSubscriptionRequestSchema, @@ -76,11 +71,13 @@ import { } from '../models/upsertPrepaidConfigurationRequest'; import { array, dict, number, optional, string } from '../schema'; import { BaseController } from './baseController'; +import { ApiError } from '@apimatic/core'; import { ErrorArrayMapResponseError } from '../errors/errorArrayMapResponseError'; import { ErrorListResponseError } from '../errors/errorListResponseError'; import { SingleErrorResponseError } from '../errors/singleErrorResponseError'; import { SubscriptionAddCouponError } from '../errors/subscriptionAddCouponError'; import { SubscriptionRemoveCouponErrorsError } from '../errors/subscriptionRemoveCouponErrorsError'; +import { SubscriptionResponseError } from '../errors/subscriptionResponseError'; export class SubscriptionsController extends BaseController { /** @@ -118,6 +115,18 @@ export class SubscriptionsController extends BaseController { * read the subscription after creation, we return the profile details under `credit_card` or * `bank_account`. * + * ## Bulk creation of subscriptions + * + * Bulk creation of subscriptions is currently not supported. For scenarios where multiple + * subscriptions must be added, particularly when assigning to the same subscription group, it is + * essential to switch to a single-threaded approach. + * + * To avoid data conflicts or inaccuracies, incorporate a sleep interval between requests. + * + * While this single-threaded approach may impact performance, it ensures data consistency and accuracy + * in cases where concurrent creation attempts could otherwise lead to issues with subscription + * alignment and integrity. + * * ## Taxable Subscriptions * * If your intent is to charge your subscribers tax via [Avalara Taxes](https://maxio.zendesk.com/hc/en- @@ -1295,6 +1304,7 @@ export class SubscriptionsController extends BaseController { reference: [reference, optional(string())], }); req.query('reference', mapped.reference); + req.throwOn(404, ApiError, true, "Not Found:'{$response.body}'"); req.authenticate([{ basicAuth: true }]); return req.callAsJson(subscriptionResponseSchema, requestOptions); } @@ -1325,7 +1335,7 @@ export class SubscriptionsController extends BaseController { ack: number, cascade?: SubscriptionPurgeType[], requestOptions?: RequestOptions - ): Promise> { + ): Promise> { const req = this.createRequest('POST'); const mapped = req.prepareArgs({ subscriptionId: [subscriptionId, number()], @@ -1333,10 +1343,16 @@ export class SubscriptionsController extends BaseController { cascade: [cascade, optional(array(subscriptionPurgeTypeSchema))], }); req.query('ack', mapped.ack); - req.query('cascade', mapped.cascade, commaPrefix); + req.query('cascade', mapped.cascade, unindexedPrefix); req.appendTemplatePath`/subscriptions/${mapped.subscriptionId}/purge.json`; + req.throwOn( + 400, + SubscriptionResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); - return req.call(requestOptions); + return req.callAsJson(subscriptionResponseSchema, requestOptions); } /** @@ -1359,6 +1375,12 @@ export class SubscriptionsController extends BaseController { req.header('Content-Type', 'application/json'); req.json(mapped.body); req.appendTemplatePath`/subscriptions/${mapped.subscriptionId}/prepaid_configurations.json`; + req.throwOn( + 422, + ApiError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); req.authenticate([{ basicAuth: true }]); return req.callAsJson(prepaidConfigurationResponseSchema, requestOptions); } diff --git a/src/defaultConfiguration.ts b/src/defaultConfiguration.ts index 887871e7..9038ab1d 100644 --- a/src/defaultConfiguration.ts +++ b/src/defaultConfiguration.ts @@ -10,9 +10,8 @@ import { RetryConfiguration } from './core'; /** Default values for the configuration parameters of the client. */ export const DEFAULT_CONFIGURATION: Configuration = { timeout: 120000, - environment: Environment.Production, - subdomain: 'subdomain', - domain: 'chargify.com', + environment: Environment.US, + site: 'subdomain', }; /** Default values for retry configuration parameters. */ diff --git a/src/errors/subscriptionResponseError.ts b/src/errors/subscriptionResponseError.ts new file mode 100644 index 00000000..563c1bd3 --- /dev/null +++ b/src/errors/subscriptionResponseError.ts @@ -0,0 +1,18 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { ApiError } from '../core'; +import { Subscription } from '../models/subscription'; + +/** + * Creates an instance of SubscriptionResponse + */ +interface SubscriptionResponse { + subscription?: Subscription; + [key: string]: unknown; +} + +export class SubscriptionResponseError extends ApiError {} diff --git a/src/index.ts b/src/index.ts index 16ea03b2..f3da3d25 100644 --- a/src/index.ts +++ b/src/index.ts @@ -69,6 +69,7 @@ export * from './errors/subscriptionGroupCreateErrorResponseError'; export * from './errors/subscriptionGroupSignupErrorResponseError'; export * from './errors/subscriptionGroupUpdateErrorResponseError'; export * from './errors/subscriptionRemoveCouponErrorsError'; +export * from './errors/subscriptionResponseError'; export * from './errors/subscriptionsMrrErrorResponseError'; export * from './errors/tooManyManagementLinkRequestsError'; export type { AccountBalance } from './models/accountBalance'; @@ -169,6 +170,8 @@ export type { Coupon } from './models/coupon'; export type { CouponCurrency } from './models/couponCurrency'; export type { CouponCurrencyRequest } from './models/couponCurrencyRequest'; export type { CouponCurrencyResponse } from './models/couponCurrencyResponse'; +export type { CouponPayload } from './models/couponPayload'; +export type { CouponRequest } from './models/couponRequest'; export type { CouponResponse } from './models/couponResponse'; export type { CouponRestriction } from './models/couponRestriction'; export type { CouponSubcodes } from './models/couponSubcodes'; @@ -207,11 +210,8 @@ export type { CreateOffer } from './models/createOffer'; export type { CreateOfferComponent } from './models/createOfferComponent'; export type { CreateOfferRequest } from './models/createOfferRequest'; export type { CreateOnOffComponent } from './models/createOnOffComponent'; -export type { CreateOrUpdateCoupon } from './models/createOrUpdateCoupon'; export type { CreateOrUpdateEndpoint } from './models/createOrUpdateEndpoint'; export type { CreateOrUpdateEndpointRequest } from './models/createOrUpdateEndpointRequest'; -export type { CreateOrUpdateFlatAmountCoupon } from './models/createOrUpdateFlatAmountCoupon'; -export type { CreateOrUpdatePercentageCoupon } from './models/createOrUpdatePercentageCoupon'; export type { CreateOrUpdateProduct } from './models/createOrUpdateProduct'; export type { CreateOrUpdateProductRequest } from './models/createOrUpdateProductRequest'; export type { CreateOrUpdateSegmentPrice } from './models/createOrUpdateSegmentPrice'; @@ -288,8 +288,8 @@ export type { EndpointResponse } from './models/endpointResponse'; export type { Errors } from './models/errors'; export type { Event } from './models/event'; export type { EventBasedBillingSegmentError } from './models/eventBasedBillingSegmentError'; +export { EventKey } from './models/eventKey'; export type { EventResponse } from './models/eventResponse'; -export { EventType } from './models/eventType'; export { ExpirationIntervalUnit } from './models/expirationIntervalUnit'; export { FailedPaymentAction } from './models/failedPaymentAction'; export type { FailedPaymentEvent } from './models/failedPaymentEvent'; @@ -310,12 +310,14 @@ export { IncludeOption } from './models/includeOption'; export { IntervalUnit } from './models/intervalUnit'; export type { Invoice } from './models/invoice'; export type { InvoiceAddress } from './models/invoiceAddress'; +export type { InvoiceAvataxDetails } from './models/invoiceAvataxDetails'; export type { InvoiceBalanceItem } from './models/invoiceBalanceItem'; export { InvoiceConsolidationLevel } from './models/invoiceConsolidationLevel'; export type { InvoiceCredit } from './models/invoiceCredit'; export type { InvoiceCustomer } from './models/invoiceCustomer'; export type { InvoiceCustomField } from './models/invoiceCustomField'; export { InvoiceDateField } from './models/invoiceDateField'; +export type { InvoiceDebit } from './models/invoiceDebit'; export type { InvoiceDiscount } from './models/invoiceDiscount'; export type { InvoiceDiscountBreakout } from './models/invoiceDiscountBreakout'; export { InvoiceDiscountSourceType } from './models/invoiceDiscountSourceType'; @@ -415,6 +417,7 @@ export type { OfferDiscount } from './models/offerDiscount'; export type { OfferItem } from './models/offerItem'; export type { OfferResponse } from './models/offerResponse'; export type { OfferSignupPage } from './models/offerSignupPage'; +export type { OkResponse } from './models/okResponse'; export type { OnOffComponent } from './models/onOffComponent'; export type { OrganizationAddress } from './models/organizationAddress'; export type { OriginInvoice } from './models/originInvoice'; @@ -441,7 +444,6 @@ export type { PaypalPaymentProfile } from './models/paypalPaymentProfile'; export { PayPalVault } from './models/payPalVault'; export type { PendingCancellationChange } from './models/pendingCancellationChange'; export type { PortalManagementLink } from './models/portalManagementLink'; -export type { PrepaidComponentPricePoint } from './models/prepaidComponentPricePoint'; export type { PrepaidConfiguration } from './models/prepaidConfiguration'; export type { PrepaidConfigurationResponse } from './models/prepaidConfigurationResponse'; export type { PrepaidProductPricePointFilter } from './models/prepaidProductPricePointFilter'; @@ -487,7 +489,6 @@ export type { ReactivationBilling } from './models/reactivationBilling'; export { ReactivationCharge } from './models/reactivationCharge'; export type { ReasonCode } from './models/reasonCode'; export type { ReasonCodeResponse } from './models/reasonCodeResponse'; -export type { ReasonCodesJsonResponse } from './models/reasonCodesJsonResponse'; export type { RecordPaymentRequest } from './models/recordPaymentRequest'; export type { RecordPaymentResponse } from './models/recordPaymentResponse'; export { RecurringScheme } from './models/recurringScheme'; @@ -552,7 +553,6 @@ export type { SubscriptionGroupCreditCard } from './models/subscriptionGroupCred export type { SubscriptionGroupCustomer } from './models/subscriptionGroupCustomer'; export { SubscriptionGroupInclude } from './models/subscriptionGroupInclude'; export type { SubscriptionGroupItem } from './models/subscriptionGroupItem'; -export type { SubscriptionGroupMemberError } from './models/subscriptionGroupMemberError'; export type { SubscriptionGroupMembersArrayError } from './models/subscriptionGroupMembersArrayError'; export type { SubscriptionGroupPaymentProfile } from './models/subscriptionGroupPaymentProfile'; export type { SubscriptionGroupPrepayment } from './models/subscriptionGroupPrepayment'; @@ -563,13 +563,11 @@ export type { SubscriptionGroupResponse } from './models/subscriptionGroupRespon export type { SubscriptionGroupSignup } from './models/subscriptionGroupSignup'; export type { SubscriptionGroupSignupComponent } from './models/subscriptionGroupSignupComponent'; export type { SubscriptionGroupSignupError } from './models/subscriptionGroupSignupError'; -export type { SubscriptionGroupSignupFailure } from './models/subscriptionGroupSignupFailure'; +export type { SubscriptionGroupSignupEventData } from './models/subscriptionGroupSignupEventData'; export type { SubscriptionGroupSignupFailureData } from './models/subscriptionGroupSignupFailureData'; export type { SubscriptionGroupSignupItem } from './models/subscriptionGroupSignupItem'; export type { SubscriptionGroupSignupRequest } from './models/subscriptionGroupSignupRequest'; export type { SubscriptionGroupSignupResponse } from './models/subscriptionGroupSignupResponse'; -export type { SubscriptionGroupSignupSuccess } from './models/subscriptionGroupSignupSuccess'; -export type { SubscriptionGroupSignupSuccessData } from './models/subscriptionGroupSignupSuccessData'; export type { SubscriptionGroupSingleError } from './models/subscriptionGroupSingleError'; export { SubscriptionGroupsListInclude } from './models/subscriptionGroupsListInclude'; export type { SubscriptionGroupSubscriptionError } from './models/subscriptionGroupSubscriptionError'; @@ -647,7 +645,6 @@ export { WebhookOrder } from './models/webhookOrder'; export type { WebhookResponse } from './models/webhookResponse'; export { WebhookStatus } from './models/webhookStatus'; export { WebhookSubscription } from './models/webhookSubscription'; -export * from './models/containers/addSubscriptionToAGroupGroup'; export * from './models/containers/allocationPreviewItemPreviousQuantity'; export * from './models/containers/allocationPreviewItemQuantity'; export * from './models/containers/allocationPreviousQuantity'; @@ -659,6 +656,7 @@ export * from './models/containers/archiveProductPricePointProductId'; export * from './models/containers/calendarBillingSnapDay'; export * from './models/containers/componentAllocationChangeAllocatedQuantity'; export * from './models/containers/componentPricePointAssignmentPricePoint'; +export * from './models/containers/couponPayloadPercentage'; export * from './models/containers/createAllocationPricePointId'; export * from './models/containers/createComponentPricePointRequestPricePoint'; export * from './models/containers/createComponentPricePointsRequestPricePoints'; @@ -674,8 +672,6 @@ export * from './models/containers/createInvoiceItemUnitPrice'; export * from './models/containers/createInvoicePaymentAmount'; export * from './models/containers/createMetafieldsRequestMetafields'; export * from './models/containers/createMultiInvoicePaymentAmount'; -export * from './models/containers/createOrUpdateCouponCoupon'; -export * from './models/containers/createOrUpdatePercentageCouponPercentage'; export * from './models/containers/createOrUpdateSegmentPriceUnitPrice'; export * from './models/containers/createPaymentProfileExpirationMonth'; export * from './models/containers/createPaymentProfileExpirationYear'; diff --git a/src/models/addSubscriptionToAGroup.ts b/src/models/addSubscriptionToAGroup.ts index 8428fff6..16725dc6 100644 --- a/src/models/addSubscriptionToAGroup.ts +++ b/src/models/addSubscriptionToAGroup.ts @@ -4,17 +4,14 @@ * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ -import { expandoObject, optional, Schema } from '../schema'; -import { - AddSubscriptionToAGroupGroup, - addSubscriptionToAGroupGroupSchema, -} from './containers/addSubscriptionToAGroupGroup'; +import { expandoObject, lazy, optional, Schema } from '../schema'; +import { GroupSettings, groupSettingsSchema } from './groupSettings'; export interface AddSubscriptionToAGroup { - group?: AddSubscriptionToAGroupGroup; + group?: GroupSettings; [key: string]: unknown; } export const addSubscriptionToAGroupSchema: Schema = expandoObject( - { group: ['group', optional(addSubscriptionToAGroupGroupSchema)] } + { group: ['group', optional(lazy(() => groupSettingsSchema))] } ); diff --git a/src/models/component.ts b/src/models/component.ts index c6d32888..8eb74837 100644 --- a/src/models/component.ts +++ b/src/models/component.ts @@ -50,7 +50,7 @@ export interface Component { /** The description of the component. */ description?: string | null; defaultPricePointId?: number | null; - /** An array of price brackets. If the component uses the ‘per_unit’ pricing scheme, this array will be empty. */ + /** Applicable only to prepaid usage components. An array of overage price brackets. */ overagePrices?: ComponentPrice[] | null; /** An array of price brackets. If the component uses the ‘per_unit’ pricing scheme, this array will be empty. */ prices?: ComponentPrice[] | null; diff --git a/src/models/componentPricePoint.ts b/src/models/componentPricePoint.ts index 155ea016..2dd522e6 100644 --- a/src/models/componentPricePoint.ts +++ b/src/models/componentPricePoint.ts @@ -20,6 +20,10 @@ import { componentCurrencyPriceSchema, } from './componentCurrencyPrice'; import { ComponentPrice, componentPriceSchema } from './componentPrice'; +import { + ExpirationIntervalUnit, + expirationIntervalUnitSchema, +} from './expirationIntervalUnit'; import { IntervalUnit, intervalUnitSchema } from './intervalUnit'; import { PricePointType, pricePointTypeSchema } from './pricePointType'; import { PricingScheme, pricingSchemeSchema } from './pricingScheme'; @@ -55,6 +59,18 @@ export interface ComponentPricePoint { intervalUnit?: IntervalUnit | null; /** An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. */ currencyPrices?: ComponentCurrencyPrice[]; + /** Applicable only to prepaid usage components. An array of overage price brackets. */ + overagePrices?: ComponentPrice[]; + /** Applicable only to prepaid usage components. Pricing scheme for overage pricing. */ + overagePricingScheme?: PricingScheme; + /** Applicable only to prepaid usage components. Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period. */ + renewPrepaidAllocation?: boolean; + /** Applicable only to prepaid usage components. Boolean which controls whether or not remaining units should be rolled over to the next period. */ + rolloverPrepaidRemainder?: boolean; + /** Applicable only to prepaid usage components where rollover_prepaid_remainder is true. The number of `expiration_interval_unit`s after which rollover amounts should expire. */ + expirationInterval?: number | null; + /** Applicable only to prepaid usage components where rollover_prepaid_remainder is true. A string representing the expiration interval unit for this component, either month or day. */ + expirationIntervalUnit?: ExpirationIntervalUnit | null; [key: string]: unknown; } @@ -80,5 +96,23 @@ export const componentPricePointSchema: Schema = expandoObj 'currency_prices', optional(array(lazy(() => componentCurrencyPriceSchema))), ], + overagePrices: [ + 'overage_prices', + optional(array(lazy(() => componentPriceSchema))), + ], + overagePricingScheme: [ + 'overage_pricing_scheme', + optional(pricingSchemeSchema), + ], + renewPrepaidAllocation: ['renew_prepaid_allocation', optional(boolean())], + rolloverPrepaidRemainder: [ + 'rollover_prepaid_remainder', + optional(boolean()), + ], + expirationInterval: ['expiration_interval', optional(nullable(number()))], + expirationIntervalUnit: [ + 'expiration_interval_unit', + optional(nullable(expirationIntervalUnitSchema)), + ], } ); diff --git a/src/models/containers/addSubscriptionToAGroupGroup.ts b/src/models/containers/addSubscriptionToAGroupGroup.ts deleted file mode 100644 index abb8f617..00000000 --- a/src/models/containers/addSubscriptionToAGroupGroup.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * AdvancedBilling - * - * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -import { boolean, oneOf, Schema, validateAndMap } from '../../schema'; -import { GroupSettings, groupSettingsSchema } from '../groupSettings'; - -/** This is a container type for one-of types. */ -export type AddSubscriptionToAGroupGroup = GroupSettings | boolean; - -export const addSubscriptionToAGroupGroupSchema: Schema = oneOf( - [groupSettingsSchema, boolean()] -); - -export namespace AddSubscriptionToAGroupGroup { - /** - * Validation method to narrow down union type to GroupSettings type case. - * - * This is Group Settings case. - */ - export function isGroupSettings(value: unknown): value is GroupSettings { - const validationResult = validateAndMap(value, groupSettingsSchema); - return validationResult.errors === false; - } - - /** - * Validation method to narrow down union type to boolean type case. - * - * This is Boolean case. - */ - export function isBoolean(value: unknown): value is boolean { - return typeof value === 'boolean'; - } -} diff --git a/src/models/containers/createOrUpdatePercentageCouponPercentage.ts b/src/models/containers/couponPayloadPercentage.ts similarity index 73% rename from src/models/containers/createOrUpdatePercentageCouponPercentage.ts rename to src/models/containers/couponPayloadPercentage.ts index 09270e55..e2102476 100644 --- a/src/models/containers/createOrUpdatePercentageCouponPercentage.ts +++ b/src/models/containers/couponPayloadPercentage.ts @@ -7,13 +7,13 @@ import { number, oneOf, Schema, string } from '../../schema'; /** This is a container type for one-of types. */ -export type CreateOrUpdatePercentageCouponPercentage = string | number; +export type CouponPayloadPercentage = string | number; -export const createOrUpdatePercentageCouponPercentageSchema: Schema = oneOf( +export const couponPayloadPercentageSchema: Schema = oneOf( [string(), number()] ); -export namespace CreateOrUpdatePercentageCouponPercentage { +export namespace CouponPayloadPercentage { /** * Validation method to narrow down union type to string type case. * diff --git a/src/models/containers/createOrUpdateCouponCoupon.ts b/src/models/containers/createOrUpdateCouponCoupon.ts deleted file mode 100644 index fec45962..00000000 --- a/src/models/containers/createOrUpdateCouponCoupon.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * AdvancedBilling - * - * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -import { oneOf, Schema, validateAndMap } from '../../schema'; -import { - CreateOrUpdateFlatAmountCoupon, - createOrUpdateFlatAmountCouponSchema, -} from '../createOrUpdateFlatAmountCoupon'; -import { - CreateOrUpdatePercentageCoupon, - createOrUpdatePercentageCouponSchema, -} from '../createOrUpdatePercentageCoupon'; - -/** This is a container type for one-of types. */ -export type CreateOrUpdateCouponCoupon = - | CreateOrUpdatePercentageCoupon - | CreateOrUpdateFlatAmountCoupon; - -export const createOrUpdateCouponCouponSchema: Schema = oneOf( - [createOrUpdatePercentageCouponSchema, createOrUpdateFlatAmountCouponSchema] -); - -export namespace CreateOrUpdateCouponCoupon { - /** - * Validation method to narrow down union type to CreateOrUpdatePercentageCoupon type case. - * - * This is Create or Update Percentage Coupon case. - */ - export function isCreateOrUpdatePercentageCoupon( - value: unknown - ): value is CreateOrUpdatePercentageCoupon { - const validationResult = validateAndMap( - value, - createOrUpdatePercentageCouponSchema - ); - return validationResult.errors === false; - } - - /** - * Validation method to narrow down union type to CreateOrUpdateFlatAmountCoupon type case. - * - * This is Create or Update Flat Amount Coupon case. - */ - export function isCreateOrUpdateFlatAmountCoupon( - value: unknown - ): value is CreateOrUpdateFlatAmountCoupon { - const validationResult = validateAndMap( - value, - createOrUpdateFlatAmountCouponSchema - ); - return validationResult.errors === false; - } -} diff --git a/src/models/containers/eventEventSpecificData.ts b/src/models/containers/eventEventSpecificData.ts index ff631033..ab17b0c7 100644 --- a/src/models/containers/eventEventSpecificData.ts +++ b/src/models/containers/eventEventSpecificData.ts @@ -54,13 +54,9 @@ import { } from '../proformaInvoiceIssued'; import { RefundSuccess, refundSuccessSchema } from '../refundSuccess'; import { - SubscriptionGroupSignupFailure, - subscriptionGroupSignupFailureSchema, -} from '../subscriptionGroupSignupFailure'; -import { - SubscriptionGroupSignupSuccess, - subscriptionGroupSignupSuccessSchema, -} from '../subscriptionGroupSignupSuccess'; + SubscriptionGroupSignupEventData, + subscriptionGroupSignupEventDataSchema, +} from '../subscriptionGroupSignupEventData'; import { SubscriptionProductChange, subscriptionProductChangeSchema, @@ -84,8 +80,7 @@ export type EventEventSpecificData = | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued - | SubscriptionGroupSignupSuccess - | SubscriptionGroupSignupFailure + | SubscriptionGroupSignupEventData | CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged @@ -106,8 +101,7 @@ export const eventEventSpecificDataSchema: Schema = oneO pendingCancellationChangeSchema, prepaidSubscriptionBalanceChangedSchema, proformaInvoiceIssuedSchema, - subscriptionGroupSignupSuccessSchema, - subscriptionGroupSignupFailureSchema, + subscriptionGroupSignupEventDataSchema, creditAccountBalanceChangedSchema, prepaymentAccountBalanceChangedSchema, paymentCollectionMethodChangedSchema, @@ -269,31 +263,16 @@ export namespace EventEventSpecificData { } /** - * Validation method to narrow down union type to SubscriptionGroupSignupSuccess type case. - * - * This is Subscription Group Signup Success case. - */ - export function isSubscriptionGroupSignupSuccess( - value: unknown - ): value is SubscriptionGroupSignupSuccess { - const validationResult = validateAndMap( - value, - subscriptionGroupSignupSuccessSchema - ); - return validationResult.errors === false; - } - - /** - * Validation method to narrow down union type to SubscriptionGroupSignupFailure type case. + * Validation method to narrow down union type to SubscriptionGroupSignupEventData type case. * - * This is Subscription Group Signup Failure case. + * This is Subscription Group Signup Event Data case. */ - export function isSubscriptionGroupSignupFailure( + export function isSubscriptionGroupSignupEventData( value: unknown - ): value is SubscriptionGroupSignupFailure { + ): value is SubscriptionGroupSignupEventData { const validationResult = validateAndMap( value, - subscriptionGroupSignupFailureSchema + subscriptionGroupSignupEventDataSchema ); return validationResult.errors === false; } diff --git a/src/models/coupon.ts b/src/models/coupon.ts index 2523bbae..13279deb 100644 --- a/src/models/coupon.ts +++ b/src/models/coupon.ts @@ -6,6 +6,7 @@ import { array, + bigint, boolean, expandoObject, lazy, @@ -19,6 +20,7 @@ import { CompoundingStrategy, compoundingStrategySchema, } from './compoundingStrategy'; +import { CouponCurrency, couponCurrencySchema } from './couponCurrency'; import { CouponRestriction, couponRestrictionSchema, @@ -32,10 +34,11 @@ export interface Coupon { code?: string; description?: string; amount?: number | null; - amountInCents?: number | null; + amountInCents?: bigint | null; productFamilyId?: number; productFamilyName?: string | null; startDate?: string; + /** After the given time, this coupon code will be invalid for new signups. Recurring discounts started before this date will continue to recur even after this date. */ endDate?: string | null; percentage?: string | null; recurring?: boolean; @@ -44,10 +47,13 @@ export interface Coupon { durationInterval?: number | null; durationIntervalUnit?: string | null; durationIntervalSpan?: string | null; + /** If set to true, discount is not limited (credits will carry forward to next billing). */ allowNegativeBalance?: boolean; archivedAt?: string | null; conversionLimit?: string | null; + /** A stackable coupon can be combined with other coupons on a Subscription. */ stackable?: boolean; + /** Applicable only to stackable coupons. For `compound`, Percentage-based discounts will be calculated against the remaining price, after prior discounts have been calculated. For `full-price`, Percentage-based discounts will always be calculated against the original item price, before other discounts are applied. */ compoundingStrategy?: CompoundingStrategy | null; useSiteExchangeRate?: boolean; createdAt?: string; @@ -57,6 +63,8 @@ export interface Coupon { applyOnCancelAtEndOfPeriod?: boolean; applyOnSubscriptionExpiration?: boolean; couponRestrictions?: CouponRestriction[]; + /** Returned in read, find, and list endpoints if the query parameter is provided. */ + currencyPrices?: CouponCurrency[]; [key: string]: unknown; } @@ -66,7 +74,7 @@ export const couponSchema: Schema = expandoObject({ code: ['code', optional(string())], description: ['description', optional(string())], amount: ['amount', optional(nullable(number()))], - amountInCents: ['amount_in_cents', optional(nullable(number()))], + amountInCents: ['amount_in_cents', optional(nullable(bigint()))], productFamilyId: ['product_family_id', optional(number())], productFamilyName: ['product_family_name', optional(nullable(string()))], startDate: ['start_date', optional(string())], @@ -112,4 +120,8 @@ export const couponSchema: Schema = expandoObject({ 'coupon_restrictions', optional(array(lazy(() => couponRestrictionSchema))), ], + currencyPrices: [ + 'currency_prices', + optional(array(lazy(() => couponCurrencySchema))), + ], }); diff --git a/src/models/couponCurrency.ts b/src/models/couponCurrency.ts index 287ccadf..eff30a66 100644 --- a/src/models/couponCurrency.ts +++ b/src/models/couponCurrency.ts @@ -4,19 +4,26 @@ * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ -import { expandoObject, number, optional, Schema, string } from '../schema'; +import { + expandoObject, + nullable, + number, + optional, + Schema, + string, +} from '../schema'; export interface CouponCurrency { - id?: number; + id?: number | null; currency?: string; - price?: number; + price?: number | null; couponId?: number; [key: string]: unknown; } export const couponCurrencySchema: Schema = expandoObject({ - id: ['id', optional(number())], + id: ['id', optional(nullable(number()))], currency: ['currency', optional(string())], - price: ['price', optional(number())], + price: ['price', optional(nullable(number()))], couponId: ['coupon_id', optional(number())], }); diff --git a/src/models/couponPayload.ts b/src/models/couponPayload.ts new file mode 100644 index 00000000..956da9ef --- /dev/null +++ b/src/models/couponPayload.ts @@ -0,0 +1,78 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { + bigint, + boolean, + expandoObject, + optional, + Schema, + string, +} from '../schema'; +import { + CompoundingStrategy, + compoundingStrategySchema, +} from './compoundingStrategy'; +import { + CouponPayloadPercentage, + couponPayloadPercentageSchema, +} from './containers/couponPayloadPercentage'; + +export interface CouponPayload { + /** Required when creating a new coupon. This name is not displayed to customers and is limited to 255 characters. */ + name?: string; + /** Required when creating a new coupon. The code is limited to 255 characters. May contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.” */ + code?: string; + /** Required when creating a new coupon. A description of the coupon that can be displayed to customers in transactions and on statements. The description is limited to 255 characters. */ + description?: string; + /** Required when creating a new percentage coupon. Can't be used together with amount_in_cents. Percentage discount */ + percentage?: CouponPayloadPercentage; + /** Required when creating a new flat amount coupon. Can't be used together with percentage. Flat USD discount */ + amountInCents?: bigint; + /** If set to true, discount is not limited (credits will carry forward to next billing). Can't be used together with restrictions. */ + allowNegativeBalance?: boolean; + recurring?: boolean; + /** After the end of the given day, this coupon code will be invalid for new signups. Recurring discounts started before this date will continue to recur even after this date. */ + endDate?: string; + productFamilyId?: string; + /** A stackable coupon can be combined with other coupons on a Subscription. */ + stackable?: boolean; + /** Applicable only to stackable coupons. For `compound`, Percentage-based discounts will be calculated against the remaining price, after prior discounts have been calculated. For `full-price`, Percentage-based discounts will always be calculated against the original item price, before other discounts are applied. */ + compoundingStrategy?: CompoundingStrategy; + excludeMidPeriodAllocations?: boolean; + applyOnCancelAtEndOfPeriod?: boolean; + applyOnSubscriptionExpiration?: boolean; + [key: string]: unknown; +} + +export const couponPayloadSchema: Schema = expandoObject({ + name: ['name', optional(string())], + code: ['code', optional(string())], + description: ['description', optional(string())], + percentage: ['percentage', optional(couponPayloadPercentageSchema)], + amountInCents: ['amount_in_cents', optional(bigint())], + allowNegativeBalance: ['allow_negative_balance', optional(boolean())], + recurring: ['recurring', optional(boolean())], + endDate: ['end_date', optional(string())], + productFamilyId: ['product_family_id', optional(string())], + stackable: ['stackable', optional(boolean())], + compoundingStrategy: [ + 'compounding_strategy', + optional(compoundingStrategySchema), + ], + excludeMidPeriodAllocations: [ + 'exclude_mid_period_allocations', + optional(boolean()), + ], + applyOnCancelAtEndOfPeriod: [ + 'apply_on_cancel_at_end_of_period', + optional(boolean()), + ], + applyOnSubscriptionExpiration: [ + 'apply_on_subscription_expiration', + optional(boolean()), + ], +}); diff --git a/src/models/couponRequest.ts b/src/models/couponRequest.ts new file mode 100644 index 00000000..d9070a9d --- /dev/null +++ b/src/models/couponRequest.ts @@ -0,0 +1,30 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { + boolean, + dict, + expandoObject, + lazy, + optional, + Schema, +} from '../schema'; +import { CouponPayload, couponPayloadSchema } from './couponPayload'; + +export interface CouponRequest { + coupon?: CouponPayload; + /** An object where the keys are product_ids and the values are booleans indicating if the coupon should be applicable to the product */ + restrictedProducts?: Record; + /** An object where the keys are component_ids and the values are booleans indicating if the coupon should be applicable to the component */ + restrictedComponents?: Record; + [key: string]: unknown; +} + +export const couponRequestSchema: Schema = expandoObject({ + coupon: ['coupon', optional(lazy(() => couponPayloadSchema))], + restrictedProducts: ['restricted_products', optional(dict(boolean()))], + restrictedComponents: ['restricted_components', optional(dict(boolean()))], +}); diff --git a/src/models/createComponentPricePoint.ts b/src/models/createComponentPricePoint.ts index 7c07bfe9..44367e54 100644 --- a/src/models/createComponentPricePoint.ts +++ b/src/models/createComponentPricePoint.ts @@ -25,9 +25,9 @@ export interface CreateComponentPricePoint { /** The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. */ pricingScheme: PricingScheme; prices: Price[]; - /** Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. */ + /** Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Setting not supported when creating price points in bulk. */ useSiteExchangeRate?: boolean; - /** Whether or not the price point includes tax */ + /** Whether or not the price point includes tax. Setting not supported when creating price points in bulk. */ taxIncluded?: boolean; /** The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. */ interval?: number; diff --git a/src/models/createInvoiceCoupon.ts b/src/models/createInvoiceCoupon.ts index 731c0c67..59cc4acb 100644 --- a/src/models/createInvoiceCoupon.ts +++ b/src/models/createInvoiceCoupon.ts @@ -28,6 +28,7 @@ export interface CreateInvoiceCoupon { amount?: CreateInvoiceCouponAmount; description?: string; productFamilyId?: CreateInvoiceCouponProductFamilyId; + /** Applicable only to stackable coupons. For `compound`, Percentage-based discounts will be calculated against the remaining price, after prior discounts have been calculated. For `full-price`, Percentage-based discounts will always be calculated against the original item price, before other discounts are applied. */ compoundingStrategy?: CompoundingStrategy; [key: string]: unknown; } diff --git a/src/models/createOrUpdateCoupon.ts b/src/models/createOrUpdateCoupon.ts deleted file mode 100644 index 446fb4e6..00000000 --- a/src/models/createOrUpdateCoupon.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * AdvancedBilling - * - * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -import { boolean, dict, expandoObject, optional, Schema } from '../schema'; -import { - CreateOrUpdateCouponCoupon, - createOrUpdateCouponCouponSchema, -} from './containers/createOrUpdateCouponCoupon'; - -export interface CreateOrUpdateCoupon { - coupon?: CreateOrUpdateCouponCoupon; - /** An object where the keys are product_ids and the values are booleans indicating if the coupon should be applicable to the product */ - restrictedProducts?: Record; - /** An object where the keys are component_ids and the values are booleans indicating if the coupon should be applicable to the component */ - restrictedComponents?: Record; - [key: string]: unknown; -} - -export const createOrUpdateCouponSchema: Schema = expandoObject( - { - coupon: ['coupon', optional(createOrUpdateCouponCouponSchema)], - restrictedProducts: ['restricted_products', optional(dict(boolean()))], - restrictedComponents: ['restricted_components', optional(dict(boolean()))], - } -); diff --git a/src/models/createOrUpdateFlatAmountCoupon.ts b/src/models/createOrUpdateFlatAmountCoupon.ts deleted file mode 100644 index 8da807de..00000000 --- a/src/models/createOrUpdateFlatAmountCoupon.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * AdvancedBilling - * - * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -import { - bigint, - boolean, - expandoObject, - optional, - Schema, - string, -} from '../schema'; -import { - CompoundingStrategy, - compoundingStrategySchema, -} from './compoundingStrategy'; - -export interface CreateOrUpdateFlatAmountCoupon { - /** the name of the coupon */ - name: string; - /** may contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.” */ - code: string; - description?: string; - amountInCents: bigint; - allowNegativeBalance?: boolean; - recurring?: boolean; - endDate?: string; - productFamilyId?: string; - stackable?: boolean; - compoundingStrategy?: CompoundingStrategy; - excludeMidPeriodAllocations?: boolean; - applyOnCancelAtEndOfPeriod?: boolean; - applyOnSubscriptionExpiration?: boolean; - [key: string]: unknown; -} - -export const createOrUpdateFlatAmountCouponSchema: Schema = expandoObject( - { - name: ['name', string()], - code: ['code', string()], - description: ['description', optional(string())], - amountInCents: ['amount_in_cents', bigint()], - allowNegativeBalance: ['allow_negative_balance', optional(boolean())], - recurring: ['recurring', optional(boolean())], - endDate: ['end_date', optional(string())], - productFamilyId: ['product_family_id', optional(string())], - stackable: ['stackable', optional(boolean())], - compoundingStrategy: [ - 'compounding_strategy', - optional(compoundingStrategySchema), - ], - excludeMidPeriodAllocations: [ - 'exclude_mid_period_allocations', - optional(boolean()), - ], - applyOnCancelAtEndOfPeriod: [ - 'apply_on_cancel_at_end_of_period', - optional(boolean()), - ], - applyOnSubscriptionExpiration: [ - 'apply_on_subscription_expiration', - optional(boolean()), - ], - } -); diff --git a/src/models/createOrUpdatePercentageCoupon.ts b/src/models/createOrUpdatePercentageCoupon.ts deleted file mode 100644 index 7622adf0..00000000 --- a/src/models/createOrUpdatePercentageCoupon.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * AdvancedBilling - * - * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -import { boolean, expandoObject, optional, Schema, string } from '../schema'; -import { - CompoundingStrategy, - compoundingStrategySchema, -} from './compoundingStrategy'; -import { - CreateOrUpdatePercentageCouponPercentage, - createOrUpdatePercentageCouponPercentageSchema, -} from './containers/createOrUpdatePercentageCouponPercentage'; - -export interface CreateOrUpdatePercentageCoupon { - /** the name of the coupon */ - name: string; - /** may contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.” */ - code: string; - description?: string; - percentage: CreateOrUpdatePercentageCouponPercentage; - allowNegativeBalance?: boolean; - recurring?: boolean; - endDate?: string; - productFamilyId?: string; - stackable?: boolean; - compoundingStrategy?: CompoundingStrategy; - excludeMidPeriodAllocations?: boolean; - applyOnCancelAtEndOfPeriod?: boolean; - applyOnSubscriptionExpiration?: boolean; - [key: string]: unknown; -} - -export const createOrUpdatePercentageCouponSchema: Schema = expandoObject( - { - name: ['name', string()], - code: ['code', string()], - description: ['description', optional(string())], - percentage: ['percentage', createOrUpdatePercentageCouponPercentageSchema], - allowNegativeBalance: ['allow_negative_balance', optional(boolean())], - recurring: ['recurring', optional(boolean())], - endDate: ['end_date', optional(string())], - productFamilyId: ['product_family_id', optional(string())], - stackable: ['stackable', optional(boolean())], - compoundingStrategy: [ - 'compounding_strategy', - optional(compoundingStrategySchema), - ], - excludeMidPeriodAllocations: [ - 'exclude_mid_period_allocations', - optional(boolean()), - ], - applyOnCancelAtEndOfPeriod: [ - 'apply_on_cancel_at_end_of_period', - optional(boolean()), - ], - applyOnSubscriptionExpiration: [ - 'apply_on_subscription_expiration', - optional(boolean()), - ], - } -); diff --git a/src/models/createPrepaidUsageComponentPricePoint.ts b/src/models/createPrepaidUsageComponentPricePoint.ts index afce2e76..eadb0de7 100644 --- a/src/models/createPrepaidUsageComponentPricePoint.ts +++ b/src/models/createPrepaidUsageComponentPricePoint.ts @@ -32,13 +32,13 @@ export interface CreatePrepaidUsageComponentPricePoint { overagePricing: OveragePricing; /** Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. */ useSiteExchangeRate?: boolean; - /** Boolean which controls whether or not remaining units should be rolled over to the next period */ + /** (only for prepaid usage components) Boolean which controls whether or not remaining units should be rolled over to the next period */ rolloverPrepaidRemainder?: boolean; - /** Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period */ + /** (only for prepaid usage components) Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period */ renewPrepaidAllocation?: boolean; /** (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire */ expirationInterval?: number; - /** A string representing the expiration interval unit for this component, either month or day */ + /** (only for prepaid usage components where rollover_prepaid_remainder is true) A string representing the expiration interval unit for this component, either month or day */ expirationIntervalUnit?: ExpirationIntervalUnit | null; [key: string]: unknown; } diff --git a/src/models/createSubscription.ts b/src/models/createSubscription.ts index 5bd2459f..f2ebca95 100644 --- a/src/models/createSubscription.ts +++ b/src/models/createSubscription.ts @@ -140,7 +140,7 @@ export interface CreateSubscription { /** (Optional) If passed, the proof of the authorized ACH agreement terms will be persisted. */ achAgreement?: ACHAgreement; /** Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute. */ - dunningCommunicationDelayEnabled?: boolean | null; + dunningCommunicationDelayEnabled?: boolean; /** Time zone for the Dunning Communication Delay feature. */ dunningCommunicationDelayTimeZone?: string | null; /** Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests. */ @@ -237,7 +237,7 @@ export const createSubscriptionSchema: Schema = expandoObjec achAgreement: ['ach_agreement', optional(lazy(() => aCHAgreementSchema))], dunningCommunicationDelayEnabled: [ 'dunning_communication_delay_enabled', - optional(nullable(boolean())), + optional(boolean()), ], dunningCommunicationDelayTimeZone: [ 'dunning_communication_delay_time_zone', diff --git a/src/models/currencyPrice.ts b/src/models/currencyPrice.ts index fa5cd0e8..59eb0611 100644 --- a/src/models/currencyPrice.ts +++ b/src/models/currencyPrice.ts @@ -15,6 +15,8 @@ export interface CurrencyPrice { currency?: string; price?: number; formattedPrice?: string; + priceId?: number; + pricePointId?: number; productPricePointId?: number; /** Role for the price. */ role?: CurrencyPriceRole; @@ -26,6 +28,8 @@ export const currencyPriceSchema: Schema = expandoObject({ currency: ['currency', optional(string())], price: ['price', optional(number())], formattedPrice: ['formatted_price', optional(string())], + priceId: ['price_id', optional(number())], + pricePointId: ['price_point_id', optional(number())], productPricePointId: ['product_price_point_id', optional(number())], role: ['role', optional(currencyPriceRoleSchema)], }); diff --git a/src/models/eBBComponent.ts b/src/models/eBBComponent.ts index 696cd767..c5a93448 100644 --- a/src/models/eBBComponent.ts +++ b/src/models/eBBComponent.ts @@ -23,7 +23,6 @@ import { EBBComponentUnitPrice, eBBComponentUnitPriceSchema, } from './containers/eBBComponentUnitPrice'; -import { CreditType, creditTypeSchema } from './creditType'; import { IntervalUnit, intervalUnitSchema } from './intervalUnit'; import { Price, priceSchema } from './price'; import { PricingScheme, pricingSchemeSchema } from './pricingScheme'; @@ -41,18 +40,8 @@ export interface EBBComponent { taxable?: boolean; /** The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. */ pricingScheme: PricingScheme; - /** (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://help.chargify.com/products/product-components.html#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes. */ + /** (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. */ prices?: Price[]; - /** - * The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - * Available values: `full`, `prorated`, `none`. - */ - upgradeCharge?: CreditType | null; - /** - * The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - * Available values: `full`, `prorated`, `none`. - */ - downgradeCredit?: CreditType | null; pricePoints?: ComponentPricePointItem[]; /** The amount the customer will be charged per unit when the pricing scheme is “per_unit”. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 */ unitPrice?: EBBComponentUnitPrice; @@ -60,8 +49,6 @@ export interface EBBComponent { taxCode?: string; /** (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. */ hideDateRangeOnInvoice?: boolean; - /** deprecated May 2011 - use unit_price instead */ - priceInCents?: string; /** The ID of an event based billing metric that will be attached to this component. */ eventBasedBillingMetricId: number; /** The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. */ @@ -79,8 +66,6 @@ export const eBBComponentSchema: Schema = expandoObject({ taxable: ['taxable', optional(boolean())], pricingScheme: ['pricing_scheme', pricingSchemeSchema], prices: ['prices', optional(array(lazy(() => priceSchema)))], - upgradeCharge: ['upgrade_charge', optional(nullable(creditTypeSchema))], - downgradeCredit: ['downgrade_credit', optional(nullable(creditTypeSchema))], pricePoints: [ 'price_points', optional(array(lazy(() => componentPricePointItemSchema))), @@ -88,7 +73,6 @@ export const eBBComponentSchema: Schema = expandoObject({ unitPrice: ['unit_price', optional(eBBComponentUnitPriceSchema)], taxCode: ['tax_code', optional(string())], hideDateRangeOnInvoice: ['hide_date_range_on_invoice', optional(boolean())], - priceInCents: ['price_in_cents', optional(string())], eventBasedBillingMetricId: ['event_based_billing_metric_id', number()], interval: ['interval', optional(number())], intervalUnit: ['interval_unit', optional(nullable(intervalUnitSchema))], diff --git a/src/models/event.ts b/src/models/event.ts index 9777269c..7546a10b 100644 --- a/src/models/event.ts +++ b/src/models/event.ts @@ -16,21 +16,58 @@ import { EventEventSpecificData, eventEventSpecificDataSchema, } from './containers/eventEventSpecificData'; +import { EventKey, eventKeySchema } from './eventKey'; export interface Event { id: bigint; - key: string; + key: EventKey; message: string; subscriptionId: number | null; customerId: number | null; createdAt: string; + /** + * The schema varies based on the event key. The key-to-event data mapping is as follows: + * * `subscription_product_change` - SubscriptionProductChange + * * `subscription_state_change` - SubscriptionStateChange + * * `signup_success`, `delayed_signup_creation_success`, `payment_success`, `payment_failure`, `renewal_success`, `renewal_failure`, `chargeback_lost`, `chargeback_accepted`, `chargeback_closed` - PaymentRelatedEvents + * * `refund_success` - RefundSuccess + * * `component_allocation_change` - ComponentAllocationChange + * * `metered_usage` - MeteredUsage + * * `prepaid_usage` - PrepaidUsage + * * `dunning_step_reached` - DunningStepReached + * * `invoice_issued` - InvoiceIssued + * * `pending_cancellation_change` - PendingCancellationChange + * * `prepaid_subscription_balance_changed` - PrepaidSubscriptionBalanceChanged + * * `subscription_group_signup_success` and `subscription_group_signup_failure` - SubscriptionGroupSignupEventData + * * `proforma_invoice_issued` - ProformaInvoiceIssued + * * `subscription_prepayment_account_balance_changed` - PrepaymentAccountBalanceChanged + * * `payment_collection_method_changed` - PaymentCollectionMethodChanged + * * `subscription_service_credit_account_balance_changed` - CreditAccountBalanceChanged + * * `item_price_point_changed` - ItemPricePointChanged + * * `custom_field_value_change` - CustomFieldValueChange + * * The rest, that is `delayed_signup_creation_failure`, `billing_date_change`, `expiration_date_change`, `expiring_card`, + * `customer_update`, `customer_create`, `customer_delete`, `upgrade_downgrade_success`, `upgrade_downgrade_failure`, + * `statement_closed`, `statement_settled`, `subscription_card_update`, `subscription_group_card_update`, + * `subscription_bank_account_update`, `refund_failure`, `upcoming_renewal_notice`, `trial_end_notice`, + * `direct_debit_payment_paid_out`, `direct_debit_payment_rejected`, `direct_debit_payment_pending`, `pending_payment_created`, + * `pending_payment_failed`, `pending_payment_completed`, don't have event_specific_data defined, + * `renewal_success_recreated`, `renewal_failure_recreated`, `payment_success_recreated`, `payment_failure_recreated`, + * `subscription_deletion`, `subscription_group_bank_account_update`, `subscription_paypal_account_update`, `subscription_group_paypal_account_update`, + * `subscription_customer_change`, `account_transaction_changed`, `go_cardless_payment_paid_out`, `go_cardless_payment_rejected`, + * `go_cardless_payment_pending`, `stripe_direct_debit_payment_paid_out`, `stripe_direct_debit_payment_rejected`, `stripe_direct_debit_payment_pending`, + * `maxio_payments_direct_debit_payment_paid_out`, `maxio_payments_direct_debit_payment_rejected`, `maxio_payments_direct_debit_payment_pending`, + * `invoice_in_collections_canceled`, `subscription_added_to_group`, `subscription_removed_from_group`, `chargeback_opened`, `chargeback_lost`, + * `chargeback_accepted`, `chargeback_closed`, `chargeback_won`, `payment_collection_method_changed`, `component_billing_date_changed`, + * `subscription_term_renewal_scheduled`, `subscription_term_renewal_pending`, `subscription_term_renewal_activated`, `subscription_term_renewal_removed` + * they map to `null` instead. + */ eventSpecificData: EventEventSpecificData | null; [key: string]: unknown; } export const eventSchema: Schema = expandoObject({ id: ['id', bigint()], - key: ['key', string()], + key: ['key', eventKeySchema], message: ['message', string()], subscriptionId: ['subscription_id', nullable(number())], customerId: ['customer_id', nullable(number())], diff --git a/src/models/eventKey.ts b/src/models/eventKey.ts new file mode 100644 index 00000000..332d81bd --- /dev/null +++ b/src/models/eventKey.ts @@ -0,0 +1,98 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { Schema, stringEnum } from '../schema'; + +/** + * Enum for EventKey + */ +export enum EventKey { + PaymentSuccess = 'payment_success', + PaymentFailure = 'payment_failure', + SignupSuccess = 'signup_success', + SignupFailure = 'signup_failure', + DelayedSignupCreationSuccess = 'delayed_signup_creation_success', + DelayedSignupCreationFailure = 'delayed_signup_creation_failure', + BillingDateChange = 'billing_date_change', + ExpirationDateChange = 'expiration_date_change', + RenewalSuccess = 'renewal_success', + RenewalFailure = 'renewal_failure', + SubscriptionStateChange = 'subscription_state_change', + SubscriptionProductChange = 'subscription_product_change', + PendingCancellationChange = 'pending_cancellation_change', + ExpiringCard = 'expiring_card', + CustomerUpdate = 'customer_update', + CustomerCreate = 'customer_create', + CustomerDelete = 'customer_delete', + ComponentAllocationChange = 'component_allocation_change', + MeteredUsage = 'metered_usage', + PrepaidUsage = 'prepaid_usage', + UpgradeDowngradeSuccess = 'upgrade_downgrade_success', + UpgradeDowngradeFailure = 'upgrade_downgrade_failure', + StatementClosed = 'statement_closed', + StatementSettled = 'statement_settled', + SubscriptionCardUpdate = 'subscription_card_update', + SubscriptionGroupCardUpdate = 'subscription_group_card_update', + SubscriptionBankAccountUpdate = 'subscription_bank_account_update', + RefundSuccess = 'refund_success', + RefundFailure = 'refund_failure', + UpcomingRenewalNotice = 'upcoming_renewal_notice', + TrialEndNotice = 'trial_end_notice', + DunningStepReached = 'dunning_step_reached', + InvoiceIssued = 'invoice_issued', + PrepaidSubscriptionBalanceChanged = 'prepaid_subscription_balance_changed', + SubscriptionGroupSignupSuccess = 'subscription_group_signup_success', + SubscriptionGroupSignupFailure = 'subscription_group_signup_failure', + DirectDebitPaymentPaidOut = 'direct_debit_payment_paid_out', + DirectDebitPaymentRejected = 'direct_debit_payment_rejected', + DirectDebitPaymentPending = 'direct_debit_payment_pending', + PendingPaymentCreated = 'pending_payment_created', + PendingPaymentFailed = 'pending_payment_failed', + PendingPaymentCompleted = 'pending_payment_completed', + ProformaInvoiceIssued = 'proforma_invoice_issued', + SubscriptionPrepaymentAccountBalanceChanged = 'subscription_prepayment_account_balance_changed', + SubscriptionServiceCreditAccountBalanceChanged = 'subscription_service_credit_account_balance_changed', + CustomFieldValueChange = 'custom_field_value_change', + ItemPricePointChanged = 'item_price_point_changed', + RenewalSuccessRecreated = 'renewal_success_recreated', + RenewalFailureRecreated = 'renewal_failure_recreated', + PaymentSuccessRecreated = 'payment_success_recreated', + PaymentFailureRecreated = 'payment_failure_recreated', + SubscriptionDeletion = 'subscription_deletion', + SubscriptionGroupBankAccountUpdate = 'subscription_group_bank_account_update', + SubscriptionPaypalAccountUpdate = 'subscription_paypal_account_update', + SubscriptionGroupPaypalAccountUpdate = 'subscription_group_paypal_account_update', + SubscriptionCustomerChange = 'subscription_customer_change', + AccountTransactionChanged = 'account_transaction_changed', + GoCardlessPaymentPaidOut = 'go_cardless_payment_paid_out', + GoCardlessPaymentRejected = 'go_cardless_payment_rejected', + GoCardlessPaymentPending = 'go_cardless_payment_pending', + StripeDirectDebitPaymentPaidOut = 'stripe_direct_debit_payment_paid_out', + StripeDirectDebitPaymentRejected = 'stripe_direct_debit_payment_rejected', + StripeDirectDebitPaymentPending = 'stripe_direct_debit_payment_pending', + MaxioPaymentsDirectDebitPaymentPaidOut = 'maxio_payments_direct_debit_payment_paid_out', + MaxioPaymentsDirectDebitPaymentRejected = 'maxio_payments_direct_debit_payment_rejected', + MaxioPaymentsDirectDebitPaymentPending = 'maxio_payments_direct_debit_payment_pending', + InvoiceInCollectionsCanceled = 'invoice_in_collections_canceled', + SubscriptionAddedToGroup = 'subscription_added_to_group', + SubscriptionRemovedFromGroup = 'subscription_removed_from_group', + ChargebackOpened = 'chargeback_opened', + ChargebackLost = 'chargeback_lost', + ChargebackAccepted = 'chargeback_accepted', + ChargebackClosed = 'chargeback_closed', + ChargebackWon = 'chargeback_won', + PaymentCollectionMethodChanged = 'payment_collection_method_changed', + ComponentBillingDateChanged = 'component_billing_date_changed', + SubscriptionTermRenewalScheduled = 'subscription_term_renewal_scheduled', + SubscriptionTermRenewalPending = 'subscription_term_renewal_pending', + SubscriptionTermRenewalActivated = 'subscription_term_renewal_activated', + SubscriptionTermRenewalRemoved = 'subscription_term_renewal_removed', +} + +/** + * Schema for EventKey + */ +export const eventKeySchema: Schema = stringEnum(EventKey); diff --git a/src/models/eventType.ts b/src/models/eventType.ts deleted file mode 100644 index 61244088..00000000 --- a/src/models/eventType.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * AdvancedBilling - * - * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -import { Schema, stringEnum } from '../schema'; - -/** - * Enum for EventType - */ -export enum EventType { - AccountTransactionChanged = 'account_transaction_changed', - BillingDateChange = 'billing_date_change', - ComponentAllocationChange = 'component_allocation_change', - CustomerUpdate = 'customer_update', - CustomerCreate = 'customer_create', - DunningStepReached = 'dunning_step_reached', - ExpirationDateChange = 'expiration_date_change', - ExpiringCard = 'expiring_card', - MeteredUsage = 'metered_usage', - PaymentSuccess = 'payment_success', - PaymentSuccessRecreated = 'payment_success_recreated', - PaymentFailure = 'payment_failure', - PaymentFailureRecreated = 'payment_failure_recreated', - RefundFailure = 'refund_failure', - RefundSuccess = 'refund_success', - RenewalSuccess = 'renewal_success', - RenewalSuccessRecreated = 'renewal_success_recreated', - RenewalFailure = 'renewal_failure', - SignupSuccess = 'signup_success', - SignupFailure = 'signup_failure', - StatementClosed = 'statement_closed', - StatementSettled = 'statement_settled', - SubscriptionBankAccountUpdate = 'subscription_bank_account_update', - SubscriptionDeletion = 'subscription_deletion', - SubscriptionPaypalAccountUpdate = 'subscription_paypal_account_update', - SubscriptionProductChange = 'subscription_product_change', - SubscriptionStateChange = 'subscription_state_change', - TrialEndNotice = 'trial_end_notice', - UpgradeDowngradeSuccess = 'upgrade_downgrade_success', - UpgradeDowngradeFailure = 'upgrade_downgrade_failure', - UpcomingRenewalNotice = 'upcoming_renewal_notice', - CustomFieldValueChange = 'custom_field_value_change', - SubscriptionPrepaymentAccountBalanceChanged = 'subscription_prepayment_account_balance_changed', - SubscriptionServiceCreditAccountBalanceChanged = 'subscription_service_credit_account_balance_changed', -} - -/** - * Schema for EventType - */ -export const eventTypeSchema: Schema = stringEnum(EventType); diff --git a/src/models/invoice.ts b/src/models/invoice.ts index dc4aac86..c4599a57 100644 --- a/src/models/invoice.ts +++ b/src/models/invoice.ts @@ -17,6 +17,10 @@ import { } from '../schema'; import { CollectionMethod, collectionMethodSchema } from './collectionMethod'; import { InvoiceAddress, invoiceAddressSchema } from './invoiceAddress'; +import { + InvoiceAvataxDetails, + invoiceAvataxDetailsSchema, +} from './invoiceAvataxDetails'; import { InvoiceConsolidationLevel, invoiceConsolidationLevelSchema, @@ -27,6 +31,7 @@ import { InvoiceCustomField, invoiceCustomFieldSchema, } from './invoiceCustomField'; +import { InvoiceDebit, invoiceDebitSchema } from './invoiceDebit'; import { InvoiceDiscount, invoiceDiscountSchema } from './invoiceDiscount'; import { InvoiceDisplaySettings, @@ -137,6 +142,7 @@ export interface Invoice { * Credits offset the amount due from the customer. */ creditAmount?: string; + debitAmount?: string; refundAmount?: string; /** The amount paid on the invoice by the customer. */ paidAmount?: string; @@ -147,10 +153,12 @@ export interface Invoice { discounts?: InvoiceDiscount[]; taxes?: InvoiceTax[]; credits?: InvoiceCredit[]; + debits?: InvoiceDebit[]; refunds?: InvoiceRefund[]; payments?: InvoicePayment[]; customFields?: InvoiceCustomField[]; displaySettings?: InvoiceDisplaySettings; + avataxDetails?: InvoiceAvataxDetails; /** The public URL of the invoice */ publicUrl?: string; previousBalanceData?: InvoicePreviousBalance; @@ -211,6 +219,7 @@ export const invoiceSchema: Schema = expandoObject({ taxAmount: ['tax_amount', optional(string())], totalAmount: ['total_amount', optional(string())], creditAmount: ['credit_amount', optional(string())], + debitAmount: ['debit_amount', optional(string())], refundAmount: ['refund_amount', optional(string())], paidAmount: ['paid_amount', optional(string())], dueAmount: ['due_amount', optional(string())], @@ -218,6 +227,7 @@ export const invoiceSchema: Schema = expandoObject({ discounts: ['discounts', optional(array(lazy(() => invoiceDiscountSchema)))], taxes: ['taxes', optional(array(lazy(() => invoiceTaxSchema)))], credits: ['credits', optional(array(lazy(() => invoiceCreditSchema)))], + debits: ['debits', optional(array(lazy(() => invoiceDebitSchema)))], refunds: ['refunds', optional(array(lazy(() => invoiceRefundSchema)))], payments: ['payments', optional(array(lazy(() => invoicePaymentSchema)))], customFields: [ @@ -228,6 +238,10 @@ export const invoiceSchema: Schema = expandoObject({ 'display_settings', optional(lazy(() => invoiceDisplaySettingsSchema)), ], + avataxDetails: [ + 'avatax_details', + optional(lazy(() => invoiceAvataxDetailsSchema)), + ], publicUrl: ['public_url', optional(string())], previousBalanceData: [ 'previous_balance_data', diff --git a/src/models/invoiceAvataxDetails.ts b/src/models/invoiceAvataxDetails.ts new file mode 100644 index 00000000..ec96489f --- /dev/null +++ b/src/models/invoiceAvataxDetails.ts @@ -0,0 +1,33 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { + bigint, + expandoObject, + nullable, + optional, + Schema, + string, +} from '../schema'; + +export interface InvoiceAvataxDetails { + id?: bigint | null; + status?: string | null; + documentCode?: string | null; + commitDate?: string | null; + modifyDate?: string | null; + [key: string]: unknown; +} + +export const invoiceAvataxDetailsSchema: Schema = expandoObject( + { + id: ['id', optional(nullable(bigint()))], + status: ['status', optional(nullable(string()))], + documentCode: ['document_code', optional(nullable(string()))], + commitDate: ['commit_date', optional(nullable(string()))], + modifyDate: ['modify_date', optional(nullable(string()))], + } +); diff --git a/src/models/invoiceDebit.ts b/src/models/invoiceDebit.ts new file mode 100644 index 00000000..e87f242e --- /dev/null +++ b/src/models/invoiceDebit.ts @@ -0,0 +1,32 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { expandoObject, optional, Schema, string } from '../schema'; +import { DebitNoteRole, debitNoteRoleSchema } from './debitNoteRole'; + +export interface InvoiceDebit { + uid?: string; + debitNoteNumber?: string; + debitNoteUid?: string; + /** The role of the debit note. */ + role?: DebitNoteRole; + transactionTime?: string; + memo?: string; + originalAmount?: string; + appliedAmount?: string; + [key: string]: unknown; +} + +export const invoiceDebitSchema: Schema = expandoObject({ + uid: ['uid', optional(string())], + debitNoteNumber: ['debit_note_number', optional(string())], + debitNoteUid: ['debit_note_uid', optional(string())], + role: ['role', optional(debitNoteRoleSchema)], + transactionTime: ['transaction_time', optional(string())], + memo: ['memo', optional(string())], + originalAmount: ['original_amount', optional(string())], + appliedAmount: ['applied_amount', optional(string())], +}); diff --git a/src/models/invoiceLineItem.ts b/src/models/invoiceLineItem.ts index f73c4f28..dbfed18e 100644 --- a/src/models/invoiceLineItem.ts +++ b/src/models/invoiceLineItem.ts @@ -84,6 +84,7 @@ export interface InvoiceLineItem { componentId?: number | null; /** The price point ID of the component being billed. Will be `nil` for non-component charges. */ pricePointId?: number | null; + billingScheduleItemId?: number | null; hide?: boolean; componentCostData?: InvoiceLineItemComponentCostData | null; /** The price point ID of the line item's product */ @@ -111,6 +112,10 @@ export const invoiceLineItemSchema: Schema = expandoObject({ productVersion: ['product_version', optional(nullable(number()))], componentId: ['component_id', optional(nullable(number()))], pricePointId: ['price_point_id', optional(nullable(number()))], + billingScheduleItemId: [ + 'billing_schedule_item_id', + optional(nullable(number())), + ], hide: ['hide', optional(boolean())], componentCostData: [ 'component_cost_data', diff --git a/src/models/invoiceStatus.ts b/src/models/invoiceStatus.ts index 8bd36a06..cd877496 100644 --- a/src/models/invoiceStatus.ts +++ b/src/models/invoiceStatus.ts @@ -16,6 +16,7 @@ export enum InvoiceStatus { Pending = 'pending', Voided = 'voided', Canceled = 'canceled', + Processing = 'processing', } /** diff --git a/src/models/meteredComponent.ts b/src/models/meteredComponent.ts index a3b15960..28efcb40 100644 --- a/src/models/meteredComponent.ts +++ b/src/models/meteredComponent.ts @@ -23,7 +23,6 @@ import { MeteredComponentUnitPrice, meteredComponentUnitPriceSchema, } from './containers/meteredComponentUnitPrice'; -import { CreditType, creditTypeSchema } from './creditType'; import { IntervalUnit, intervalUnitSchema } from './intervalUnit'; import { Price, priceSchema } from './price'; import { PricingScheme, pricingSchemeSchema } from './pricingScheme'; @@ -43,16 +42,6 @@ export interface MeteredComponent { pricingScheme: PricingScheme; /** (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. */ prices?: Price[]; - /** - * The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - * Available values: `full`, `prorated`, `none`. - */ - upgradeCharge?: CreditType | null; - /** - * The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. - * Available values: `full`, `prorated`, `none`. - */ - downgradeCredit?: CreditType | null; pricePoints?: ComponentPricePointItem[]; /** The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 */ unitPrice?: MeteredComponentUnitPrice; @@ -60,8 +49,6 @@ export interface MeteredComponent { taxCode?: string; /** (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. */ hideDateRangeOnInvoice?: boolean; - /** deprecated May 2011 - use unit_price instead */ - priceInCents?: string; displayOnHostedPage?: boolean; allowFractionalQuantities?: boolean; publicSignupPageIds?: number[]; @@ -80,8 +67,6 @@ export const meteredComponentSchema: Schema = expandoObject({ taxable: ['taxable', optional(boolean())], pricingScheme: ['pricing_scheme', pricingSchemeSchema], prices: ['prices', optional(array(lazy(() => priceSchema)))], - upgradeCharge: ['upgrade_charge', optional(nullable(creditTypeSchema))], - downgradeCredit: ['downgrade_credit', optional(nullable(creditTypeSchema))], pricePoints: [ 'price_points', optional(array(lazy(() => componentPricePointItemSchema))), @@ -89,7 +74,6 @@ export const meteredComponentSchema: Schema = expandoObject({ unitPrice: ['unit_price', optional(meteredComponentUnitPriceSchema)], taxCode: ['tax_code', optional(string())], hideDateRangeOnInvoice: ['hide_date_range_on_invoice', optional(boolean())], - priceInCents: ['price_in_cents', optional(string())], displayOnHostedPage: ['display_on_hosted_page', optional(boolean())], allowFractionalQuantities: [ 'allow_fractional_quantities', diff --git a/src/models/reasonCodesJsonResponse.ts b/src/models/okResponse.ts similarity index 57% rename from src/models/reasonCodesJsonResponse.ts rename to src/models/okResponse.ts index 22605421..a402a143 100644 --- a/src/models/reasonCodesJsonResponse.ts +++ b/src/models/okResponse.ts @@ -6,11 +6,11 @@ import { expandoObject, optional, Schema, string } from '../schema'; -export interface ReasonCodesJsonResponse { +export interface OkResponse { ok?: string; [key: string]: unknown; } -export const reasonCodesJsonResponseSchema: Schema = expandoObject( - { ok: ['ok', optional(string())] } -); +export const okResponseSchema: Schema = expandoObject({ + ok: ['ok', optional(string())], +}); diff --git a/src/models/onOffComponent.ts b/src/models/onOffComponent.ts index 3a44f6f4..65f59301 100644 --- a/src/models/onOffComponent.ts +++ b/src/models/onOffComponent.ts @@ -25,7 +25,6 @@ import { } from './containers/onOffComponentUnitPrice'; import { CreditType, creditTypeSchema } from './creditType'; import { IntervalUnit, intervalUnitSchema } from './intervalUnit'; -import { Price, priceSchema } from './price'; export interface OnOffComponent { /** A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". */ @@ -36,8 +35,6 @@ export interface OnOffComponent { handle?: string; /** Boolean flag describing whether a component is taxable or not. */ taxable?: boolean; - /** (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261191737101-Price-Points-Components) for an overview of how price brackets work for different pricing schemes. */ - prices?: Price[]; /** * The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. * Available values: `full`, `prorated`, `none`. @@ -49,14 +46,12 @@ export interface OnOffComponent { */ downgradeCredit?: CreditType | null; pricePoints?: ComponentPricePointItem[]; - /** The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 */ - unitPrice?: OnOffComponentUnitPrice; + /** This is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 */ + unitPrice: OnOffComponentUnitPrice; /** A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. */ taxCode?: string; /** (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. */ hideDateRangeOnInvoice?: boolean; - /** deprecated May 2011 - use unit_price instead */ - priceInCents?: string; displayOnHostedPage?: boolean; allowFractionalQuantities?: boolean; publicSignupPageIds?: number[]; @@ -72,17 +67,15 @@ export const onOffComponentSchema: Schema = expandoObject({ description: ['description', optional(string())], handle: ['handle', optional(string())], taxable: ['taxable', optional(boolean())], - prices: ['prices', optional(array(lazy(() => priceSchema)))], upgradeCharge: ['upgrade_charge', optional(nullable(creditTypeSchema))], downgradeCredit: ['downgrade_credit', optional(nullable(creditTypeSchema))], pricePoints: [ 'price_points', optional(array(lazy(() => componentPricePointItemSchema))), ], - unitPrice: ['unit_price', optional(onOffComponentUnitPriceSchema)], + unitPrice: ['unit_price', onOffComponentUnitPriceSchema], taxCode: ['tax_code', optional(string())], hideDateRangeOnInvoice: ['hide_date_range_on_invoice', optional(boolean())], - priceInCents: ['price_in_cents', optional(string())], displayOnHostedPage: ['display_on_hosted_page', optional(boolean())], allowFractionalQuantities: [ 'allow_fractional_quantities', diff --git a/src/models/prepaidComponentPricePoint.ts b/src/models/prepaidComponentPricePoint.ts deleted file mode 100644 index 140cfe78..00000000 --- a/src/models/prepaidComponentPricePoint.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * AdvancedBilling - * - * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -import { - array, - expandoObject, - lazy, - optional, - Schema, - string, -} from '../schema'; -import { OveragePricing, overagePricingSchema } from './overagePricing'; -import { Price, priceSchema } from './price'; -import { PricingScheme, pricingSchemeSchema } from './pricingScheme'; - -export interface PrepaidComponentPricePoint { - name?: string; - handle?: string; - /** The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. */ - pricingScheme?: PricingScheme; - prices?: Price[]; - overagePricing?: OveragePricing; - [key: string]: unknown; -} - -export const prepaidComponentPricePointSchema: Schema = expandoObject( - { - name: ['name', optional(string())], - handle: ['handle', optional(string())], - pricingScheme: ['pricing_scheme', optional(pricingSchemeSchema)], - prices: ['prices', optional(array(lazy(() => priceSchema)))], - overagePricing: [ - 'overage_pricing', - optional(lazy(() => overagePricingSchema)), - ], - } -); diff --git a/src/models/prepaidUsageComponent.ts b/src/models/prepaidUsageComponent.ts index 02caf3a1..b9ac367f 100644 --- a/src/models/prepaidUsageComponent.ts +++ b/src/models/prepaidUsageComponent.ts @@ -19,16 +19,16 @@ import { PrepaidUsageComponentUnitPrice, prepaidUsageComponentUnitPriceSchema, } from './containers/prepaidUsageComponentUnitPrice'; +import { + CreatePrepaidUsageComponentPricePoint, + createPrepaidUsageComponentPricePointSchema, +} from './createPrepaidUsageComponentPricePoint'; import { CreditType, creditTypeSchema } from './creditType'; import { ExpirationIntervalUnit, expirationIntervalUnitSchema, } from './expirationIntervalUnit'; import { OveragePricing, overagePricingSchema } from './overagePricing'; -import { - PrepaidComponentPricePoint, - prepaidComponentPricePointSchema, -} from './prepaidComponentPricePoint'; import { Price, priceSchema } from './price'; import { PricingScheme, pricingSchemeSchema } from './pricingScheme'; @@ -36,7 +36,7 @@ export interface PrepaidUsageComponent { /** A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". */ name: string; /** The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item */ - unitName?: string; + unitName: string; /** A description for the component that will be displayed to the user on the hosted signup page. */ description?: string; /** A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'. */ @@ -44,7 +44,7 @@ export interface PrepaidUsageComponent { /** Boolean flag describing whether a component is taxable or not. */ taxable?: boolean; /** The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. */ - pricingScheme?: PricingScheme; + pricingScheme: PricingScheme; /** (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. */ prices?: Price[]; /** @@ -57,16 +57,14 @@ export interface PrepaidUsageComponent { * Available values: `full`, `prorated`, `none`. */ downgradeCredit?: CreditType | null; - pricePoints?: PrepaidComponentPricePoint[]; + pricePoints?: CreatePrepaidUsageComponentPricePoint[]; /** The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For On/Off Components, this is the amount that the customer will be charged when they turn the component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 */ unitPrice?: PrepaidUsageComponentUnitPrice; /** A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. */ taxCode?: string; /** (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. */ hideDateRangeOnInvoice?: boolean; - /** deprecated May 2011 - use unit_price instead */ - priceInCents?: string; - overagePricing?: OveragePricing; + overagePricing: OveragePricing; /** Boolean which controls whether or not remaining units should be rolled over to the next period */ rolloverPrepaidRemainder?: boolean; /** Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period */ @@ -83,26 +81,22 @@ export interface PrepaidUsageComponent { export const prepaidUsageComponentSchema: Schema = expandoObject( { name: ['name', string()], - unitName: ['unit_name', optional(string())], + unitName: ['unit_name', string()], description: ['description', optional(string())], handle: ['handle', optional(string())], taxable: ['taxable', optional(boolean())], - pricingScheme: ['pricing_scheme', optional(pricingSchemeSchema)], + pricingScheme: ['pricing_scheme', pricingSchemeSchema], prices: ['prices', optional(array(lazy(() => priceSchema)))], upgradeCharge: ['upgrade_charge', optional(nullable(creditTypeSchema))], downgradeCredit: ['downgrade_credit', optional(nullable(creditTypeSchema))], pricePoints: [ 'price_points', - optional(array(lazy(() => prepaidComponentPricePointSchema))), + optional(array(lazy(() => createPrepaidUsageComponentPricePointSchema))), ], unitPrice: ['unit_price', optional(prepaidUsageComponentUnitPriceSchema)], taxCode: ['tax_code', optional(string())], hideDateRangeOnInvoice: ['hide_date_range_on_invoice', optional(boolean())], - priceInCents: ['price_in_cents', optional(string())], - overagePricing: [ - 'overage_pricing', - optional(lazy(() => overagePricingSchema)), - ], + overagePricing: ['overage_pricing', lazy(() => overagePricingSchema)], rolloverPrepaidRemainder: [ 'rollover_prepaid_remainder', optional(boolean()), diff --git a/src/models/quantityBasedComponent.ts b/src/models/quantityBasedComponent.ts index 42ffe25d..b47f3133 100644 --- a/src/models/quantityBasedComponent.ts +++ b/src/models/quantityBasedComponent.ts @@ -60,8 +60,6 @@ export interface QuantityBasedComponent { taxCode?: string; /** (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. */ hideDateRangeOnInvoice?: boolean; - /** deprecated May 2011 - use unit_price instead */ - priceInCents?: string; recurring?: boolean; displayOnHostedPage?: boolean; allowFractionalQuantities?: boolean; @@ -91,7 +89,6 @@ export const quantityBasedComponentSchema: Schema = expa unitPrice: ['unit_price', optional(quantityBasedComponentUnitPriceSchema)], taxCode: ['tax_code', optional(string())], hideDateRangeOnInvoice: ['hide_date_range_on_invoice', optional(boolean())], - priceInCents: ['price_in_cents', optional(string())], recurring: ['recurring', optional(boolean())], displayOnHostedPage: ['display_on_hosted_page', optional(boolean())], allowFractionalQuantities: [ diff --git a/src/models/subscriptionGroupMemberError.ts b/src/models/subscriptionGroupMemberError.ts deleted file mode 100644 index d32289d8..00000000 --- a/src/models/subscriptionGroupMemberError.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * AdvancedBilling - * - * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -import { expandoObject, number, optional, Schema, string } from '../schema'; - -export interface SubscriptionGroupMemberError { - id?: number; - type?: string; - message?: string; - [key: string]: unknown; -} - -export const subscriptionGroupMemberErrorSchema: Schema = expandoObject( - { - id: ['id', optional(number())], - type: ['type', optional(string())], - message: ['message', optional(string())], - } -); diff --git a/src/models/subscriptionGroupSignupFailure.ts b/src/models/subscriptionGroupSignupEventData.ts similarity index 56% rename from src/models/subscriptionGroupSignupFailure.ts rename to src/models/subscriptionGroupSignupEventData.ts index f42d02ce..aa6c9677 100644 --- a/src/models/subscriptionGroupSignupFailure.ts +++ b/src/models/subscriptionGroupSignupEventData.ts @@ -4,24 +4,25 @@ * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ -import { expandoObject, lazy, nullable, Schema, string } from '../schema'; +import { expandoObject, lazy, nullable, Schema } from '../schema'; +import { Customer, customerSchema } from './customer'; import { SubscriptionGroupSignupFailureData, subscriptionGroupSignupFailureDataSchema, } from './subscriptionGroupSignupFailureData'; -export interface SubscriptionGroupSignupFailure { +export interface SubscriptionGroupSignupEventData { subscriptionGroup: SubscriptionGroupSignupFailureData; - customer: string | null; + customer: Customer | null; [key: string]: unknown; } -export const subscriptionGroupSignupFailureSchema: Schema = expandoObject( +export const subscriptionGroupSignupEventDataSchema: Schema = expandoObject( { subscriptionGroup: [ 'subscription_group', lazy(() => subscriptionGroupSignupFailureDataSchema), ], - customer: ['customer', nullable(string())], + customer: ['customer', nullable(lazy(() => customerSchema))], } ); diff --git a/src/models/subscriptionGroupSignupSuccess.ts b/src/models/subscriptionGroupSignupSuccess.ts deleted file mode 100644 index 766856f2..00000000 --- a/src/models/subscriptionGroupSignupSuccess.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * AdvancedBilling - * - * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -import { expandoObject, lazy, Schema } from '../schema'; -import { Customer, customerSchema } from './customer'; -import { - SubscriptionGroupSignupSuccessData, - subscriptionGroupSignupSuccessDataSchema, -} from './subscriptionGroupSignupSuccessData'; - -export interface SubscriptionGroupSignupSuccess { - subscriptionGroup: SubscriptionGroupSignupSuccessData; - customer: Customer; - [key: string]: unknown; -} - -export const subscriptionGroupSignupSuccessSchema: Schema = expandoObject( - { - subscriptionGroup: [ - 'subscription_group', - lazy(() => subscriptionGroupSignupSuccessDataSchema), - ], - customer: ['customer', lazy(() => customerSchema)], - } -); diff --git a/src/models/subscriptionGroupSignupSuccessData.ts b/src/models/subscriptionGroupSignupSuccessData.ts deleted file mode 100644 index 87f12112..00000000 --- a/src/models/subscriptionGroupSignupSuccessData.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * AdvancedBilling - * - * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -import { - array, - boolean, - expandoObject, - number, - Schema, - string, -} from '../schema'; - -export interface SubscriptionGroupSignupSuccessData { - uid: string; - scheme: number; - customerId: number; - paymentProfileId: number; - subscriptionIds: number[]; - primarySubscriptionId: number; - nextAssessmentAt: string; - state: string; - cancelAtEndOfPeriod: boolean; - [key: string]: unknown; -} - -export const subscriptionGroupSignupSuccessDataSchema: Schema = expandoObject( - { - uid: ['uid', string()], - scheme: ['scheme', number()], - customerId: ['customer_id', number()], - paymentProfileId: ['payment_profile_id', number()], - subscriptionIds: ['subscription_ids', array(number())], - primarySubscriptionId: ['primary_subscription_id', number()], - nextAssessmentAt: ['next_assessment_at', string()], - state: ['state', string()], - cancelAtEndOfPeriod: ['cancel_at_end_of_period', boolean()], - } -); diff --git a/src/models/subscriptionGroupUpdateError.ts b/src/models/subscriptionGroupUpdateError.ts index 16ea79c7..e74591ea 100644 --- a/src/models/subscriptionGroupUpdateError.ts +++ b/src/models/subscriptionGroupUpdateError.ts @@ -4,22 +4,13 @@ * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ -import { array, expandoObject, lazy, optional, Schema } from '../schema'; -import { - SubscriptionGroupMemberError, - subscriptionGroupMemberErrorSchema, -} from './subscriptionGroupMemberError'; +import { array, expandoObject, optional, Schema, string } from '../schema'; export interface SubscriptionGroupUpdateError { - members?: SubscriptionGroupMemberError[]; + members?: string[]; [key: string]: unknown; } export const subscriptionGroupUpdateErrorSchema: Schema = expandoObject( - { - members: [ - 'members', - optional(array(lazy(() => subscriptionGroupMemberErrorSchema))), - ], - } + { members: ['members', optional(array(string()))] } ); diff --git a/src/models/updateSubscription.ts b/src/models/updateSubscription.ts index f25e7ca7..2cf8e6f7 100644 --- a/src/models/updateSubscription.ts +++ b/src/models/updateSubscription.ts @@ -59,7 +59,7 @@ export interface UpdateSubscription { /** (Optional) An array of component ids and custom prices to be added to the subscription. */ components?: UpdateSubscriptionComponent[]; /** Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute. */ - dunningCommunicationDelayEnabled?: boolean | null; + dunningCommunicationDelayEnabled?: boolean; /** Time zone for the Dunning Communication Delay feature. */ dunningCommunicationDelayTimeZone?: string | null; /** Set to change the current product's price point. */ @@ -103,7 +103,7 @@ export const updateSubscriptionSchema: Schema = expandoObjec ], dunningCommunicationDelayEnabled: [ 'dunning_communication_delay_enabled', - optional(nullable(boolean())), + optional(boolean()), ], dunningCommunicationDelayTimeZone: [ 'dunning_communication_delay_time_zone',